Board Thread:Lua Help/@comment-36865288-20190101154709/@comment-36865288-20190101164810

Think I got it...sort of:

int LakeDir_register( lua_State *L ) { /* newclass = {} */ lua_createtable(L, 0, 0); luat_setcfunctionfield( L, "__gc", LakeDir_gc ); luat_setcfunctionfield( L, "__tostring", LakeDir_tostring ); luat_setcfunctionfield( L, "new", LakeDir ); luat_setcfunctionfield( L, "open", LakeDirOpen ); luat_setcfunctionfield( L, "next", LakeDirNext ); lua_setglobal(L, "LakeDir"); (void)luaL_dostring(L, "LakeDir.__index = LakeDir" ); (void)luaL_dostring(L, "setmetatable(LakeDir,LakeDir)" ); return 1; }