blob: b9530aa0a5d1fcd06ceafa78bdbaba3ef4ca12e1 [file] [log] [blame]
Thierry FOURNIER6f1fd482015-01-23 14:06:13 +01001#ifndef _PROTO_HLUA_H
2#define _PROTO_HLUA_H
3
Thierry FOURNIERa718b292015-03-04 16:48:34 +01004#ifdef USE_LUA
5
Thierry FOURNIER6f1fd482015-01-23 14:06:13 +01006#include <lua.h>
7
8#include <types/hlua.h>
9
Thierry FOURNIERa718b292015-03-04 16:48:34 +010010#define HLUA_INIT(__hlua) do { (__hlua)->T = 0; } while(0)
11
Thierry FOURNIER6f1fd482015-01-23 14:06:13 +010012/* Lua HAProxy integration functions. */
Thierry FOURNIER380d0932015-01-23 14:27:52 +010013void hlua_ctx_destroy(struct hlua *lua);
Thierry FOURNIER6f1fd482015-01-23 14:06:13 +010014void hlua_init();
Thierry FOURNIERa4a0f3d2015-01-23 12:08:30 +010015int hlua_post_init();
Thierry FOURNIER6f1fd482015-01-23 14:06:13 +010016
Thierry FOURNIERa718b292015-03-04 16:48:34 +010017#else /* USE_LUA */
18
19#define HLUA_INIT(__hlua)
20
21/* Empty function for compilation without Lua. */
22static inline void hlua_init() { }
23static inline int hlua_post_init() { return 1; }
24static inline void hlua_ctx_destroy() { }
25
26#endif /* USE_LUA */
27
Thierry FOURNIER6f1fd482015-01-23 14:06:13 +010028#endif /* _PROTO_HLUA_H */