int luax_getregistry(lua_State *L, Registry r) { switch (r) { case REGISTRY_GC: return luax_insistlove(L, "_gc"); case REGISTRY_MODULES: return luax_insistlove(L, "_modules"); default: return luaL_error(L, "Attempted to use invalid registry."); } }
int luax_insistregistry(lua_State *L, Registry r) { switch (r) { case REGISTRY_MODULES: return luax_insistlove(L, "_modules"); case REGISTRY_OBJECTS: return luax_insist(L, LUA_REGISTRYINDEX, "_loveobjects"); default: return luaL_error(L, "Attempted to use invalid registry."); } }