Thierry FOURNIER | 6f1fd48 | 2015-01-23 14:06:13 +0100 | [diff] [blame] | 1 | #ifndef _PROTO_HLUA_H |
| 2 | #define _PROTO_HLUA_H |
| 3 | |
Thierry FOURNIER | a718b29 | 2015-03-04 16:48:34 +0100 | [diff] [blame^] | 4 | #ifdef USE_LUA |
| 5 | |
Thierry FOURNIER | 6f1fd48 | 2015-01-23 14:06:13 +0100 | [diff] [blame] | 6 | #include <lua.h> |
| 7 | |
| 8 | #include <types/hlua.h> |
| 9 | |
Thierry FOURNIER | a718b29 | 2015-03-04 16:48:34 +0100 | [diff] [blame^] | 10 | #define HLUA_INIT(__hlua) do { (__hlua)->T = 0; } while(0) |
| 11 | |
Thierry FOURNIER | 6f1fd48 | 2015-01-23 14:06:13 +0100 | [diff] [blame] | 12 | /* Lua HAProxy integration functions. */ |
Thierry FOURNIER | 380d093 | 2015-01-23 14:27:52 +0100 | [diff] [blame] | 13 | void hlua_ctx_destroy(struct hlua *lua); |
Thierry FOURNIER | 6f1fd48 | 2015-01-23 14:06:13 +0100 | [diff] [blame] | 14 | void hlua_init(); |
Thierry FOURNIER | a4a0f3d | 2015-01-23 12:08:30 +0100 | [diff] [blame] | 15 | int hlua_post_init(); |
Thierry FOURNIER | 6f1fd48 | 2015-01-23 14:06:13 +0100 | [diff] [blame] | 16 | |
Thierry FOURNIER | a718b29 | 2015-03-04 16:48:34 +0100 | [diff] [blame^] | 17 | #else /* USE_LUA */ |
| 18 | |
| 19 | #define HLUA_INIT(__hlua) |
| 20 | |
| 21 | /* Empty function for compilation without Lua. */ |
| 22 | static inline void hlua_init() { } |
| 23 | static inline int hlua_post_init() { return 1; } |
| 24 | static inline void hlua_ctx_destroy() { } |
| 25 | |
| 26 | #endif /* USE_LUA */ |
| 27 | |
Thierry FOURNIER | 6f1fd48 | 2015-01-23 14:06:13 +0100 | [diff] [blame] | 28 | #endif /* _PROTO_HLUA_H */ |