0
|
1 |
|
|
2 |
#include <lua.h> |
|
3 |
|
|
4 |
#include "lm_types.h" |
|
5 |
#include "lm_message_node.h" |
|
6 |
#include "lm_message.h" |
|
7 |
#include "lm_message_handler.h" |
|
8 |
#include "lm_proxy.h" |
|
9 |
#include "lm_ssl.h" |
|
10 |
#include "lm_connection.h" |
|
11 |
|
|
12 |
int luaopen_loudmouth (lua_State *L) |
|
13 |
{ |
|
14 |
lua_pushstring (L, LLM_OBJREGISTRY); // 1 registry key |
|
15 |
lua_newtable (L); // 2 registry value (table) |
|
16 |
lua_createtable (L, 0, 1); // 3 metatable |
|
17 |
lua_pushstring (L, "__mode"); // 4 metatable key |
|
18 |
lua_pushstring (L, "v"); // 5 metatable value |
|
19 |
lua_settable (L, -3); // 3 metatable |
|
20 |
lua_setmetatable (L, -2); // 2 registry value |
|
21 |
lua_rawset (L, LUA_REGISTRYINDEX); // 0 |
|
22 |
|
|
23 |
lua_createtable (L, 6, 0); |
|
24 |
lua_pushvalue (L, -1); |
|
25 |
lua_setglobal (L, "lm"); |
|
26 |
|
|
27 |
luaopen_lm_message_node (L); |
|
28 |
luaopen_lm_message (L); |
|
29 |
luaopen_lm_message_handler (L); |
|
30 |
luaopen_lm_proxy (L); |
|
31 |
luaopen_lm_ssl (L); |
|
32 |
luaopen_lm_connection (L); |
|
33 |
lua_pop (L, 6); |
|
34 |
|
|
35 |
return 1; |
|
36 |
} |
|
37 |
|