int luaopen_sdl_wm(lua_State *L) { lua_newtable(L); luaT_setfuncs(L, sdl_wmlib); return 1; }
void torch_MemoryFile_init(lua_State *L) { luaT_newmetatable(L, "torch.MemoryFile", "torch.File", torch_MemoryFile_new, torch_MemoryFile_free, NULL); luaT_setfuncs(L, torch_MemoryFile__, 0); lua_pop(L, 1); }
void torch_Generator_init(lua_State *L) { luaT_newmetatable(L, torch_Generator, NULL, torch_Generator_new, torch_Generator_free, torch_Generator_factory); luaT_setfuncs(L, torch_Generator_table_, 0); lua_pop(L, 1); }
int luaopen_sdl_audio(lua_State *L) { lua_newtable(L); luaT_setfuncs(L, sdl_audiolib); lua_pushboolean(L, 1); lua_setfield(L, -2, "loaded"); lua_createtable(L, 0, 2); lua_pushvalue(L, -1); lua_replace(L, luaT_environindex); lua_pushvalue(L, luaT_environindex); luaT_pushcclosure(L, luaT_stdgc<music_t, luaT_environindex>, 1); lua_setfield(L, -2, "__gc"); lua_pushvalue(L, 1); lua_setfield(L, -2, "__index"); lua_pop(L, 1); luaT_setfuncs(L, sdl_musiclib); return 1; }
DLL_EXPORT int luaopen_libjpeg(lua_State *L) { libjpeg_FloatMain_init(L); libjpeg_DoubleMain_init(L); libjpeg_ByteMain_init(L); lua_newtable(L); lua_pushvalue(L, -1); lua_setglobal(L, "libjpeg"); lua_newtable(L); luaT_setfuncs(L, libjpeg_DoubleMain__, 0); lua_setfield(L, -2, "double"); lua_newtable(L); luaT_setfuncs(L, libjpeg_FloatMain__, 0); lua_setfield(L, -2, "float"); lua_newtable(L); luaT_setfuncs(L, libjpeg_ByteMain__, 0); lua_setfield(L, -2, "byte"); return 1; }
void luaT_registeratname(lua_State *L, const struct luaL_Reg *methods, const char *name) { int idx = lua_gettop(L); luaL_checktype(L, idx, LUA_TTABLE); lua_pushstring(L, name); lua_rawget(L, idx); if(lua_isnil(L, -1)) { lua_pop(L, 1); lua_pushstring(L, name); lua_newtable(L); lua_rawset(L, idx); lua_pushstring(L, name); lua_rawget(L, idx); } luaT_setfuncs(L, methods, 0); lua_pop(L, 1); }
static void cutorch_Event_init(lua_State *L) { luaT_newmetatable(L, "cutorch.Event", NULL, cutorch_Event_new, cutorch_Event_free, NULL); luaT_setfuncs(L, cutorch_Event__, 0); lua_pop(L, 1); }
void torch_TensorOperator_(init)(lua_State *L) { luaT_pushmetatable(L, torch_Tensor); luaT_setfuncs(L, torch_TensorOperator_(_), 0); lua_pop(L, 1); }
void torch_utils_init(lua_State *L) { torch_updateerrorhandlers(L); luaT_setfuncs(L, torch_utils__, 0); }