1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
#ifdef __cplusplus
extern "C" {
#endif
#include "lua.h"
#ifdef __cplusplus
}
#endif
#include "lualcm_lcm.h"
#include "lualcm_hash.h"
#include "lualcm_pack.h"
int luaopen_lcm_lcm(lua_State* L) {
ll_lcm_makemetatable(L);
ll_lcm_register_new(L);
return 1;
}
int luaopen_lcm__hash(lua_State* L) {
ll_hash_makemetatable(L);
ll_hash_register_new(L);
return 1;
}
int luaopen_lcm__pack(lua_State* L) {
ll_pack_register(L);
return 1;
}
int luaopen_lcm(lua_State* L) {
lua_newtable(L);
lua_pushstring(L, "lcm");
luaopen_lcm_lcm(L);
lua_rawset(L, -3);
lua_pushstring(L, "_hash");
luaopen_lcm__hash(L);
lua_rawset(L, -3);
lua_pushstring(L, "_pack");
luaopen_lcm__pack(L);
lua_rawset(L, -3);
return 1;
}
|