2015-09-19 07:11:53 -07:00
|
|
|
#ifndef HOOKS_H_INCLUDED
|
|
|
|
# define HOOKS_H_INCLUDED
|
|
|
|
|
|
|
|
#ifdef WITH_LUA
|
2015-09-21 03:20:39 -07:00
|
|
|
# include <lua.h>
|
2015-09-19 07:11:53 -07:00
|
|
|
|
|
|
|
|
|
|
|
struct luadata {
|
|
|
|
char *script; /* Path to Lua script in --lua-script */
|
|
|
|
lua_State *L; /* The Lua machine */
|
|
|
|
};
|
|
|
|
|
2015-09-25 08:43:17 -07:00
|
|
|
struct luadata *hooks_init(struct udata *ud, char *luascript);
|
2015-09-19 07:11:53 -07:00
|
|
|
void hooks_exit(struct luadata *, char *reason);
|
|
|
|
void hooks_hook(struct udata *ud, char *topic, JsonNode *obj);
|
2015-09-28 09:59:16 -07:00
|
|
|
int hooks_norec(struct udata *ud, char *user, char *device, char *payload);
|
2015-09-19 07:11:53 -07:00
|
|
|
|
|
|
|
#endif /* WITH_LUA */
|
|
|
|
|
|
|
|
#endif
|