equal
deleted
inserted
replaced
125 }; |
125 }; |
126 |
126 |
127 int luaopen_lm_message_handler (lua_State *L) |
127 int luaopen_lm_message_handler (lua_State *L) |
128 { |
128 { |
129 luaL_newmetatable (L, "loudmouth.message_handler"); |
129 luaL_newmetatable (L, "loudmouth.message_handler"); |
130 lua_pushstring (L, "__index"); |
130 lua_pushvalue (L, -1); |
131 lua_pushvalue (L, -2); |
131 lua_setfield (L, -2, "__index"); |
132 lua_settable (L, -3); |
|
133 luaL_register (L, NULL, reg_m_lm_handler); |
132 luaL_register (L, NULL, reg_m_lm_handler); |
134 lua_pop (L, 1); |
133 lua_pop (L, 1); |
135 lua_newtable (L); // XXX we can specify here exact amount of fields |
134 lua_newtable (L); // XXX we can specify here exact amount of fields |
136 luaL_register (L, NULL, reg_f_lm_handler); |
135 luaL_register (L, NULL, reg_f_lm_handler); |
137 return 1; |
136 return 1; |