MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / open

Function open

Source/Misc/luabind/src/open.cpp:110–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108 }
109
110 LUABIND_API void open(lua_State* L)
111 {
112 bool is_main_thread = lua_pushthread(L) == 1;
113 lua_pop(L, 1);
114
115 if (!is_main_thread)
116 {
117 throw std::runtime_error(
118 "luabind::open() must be called with the main thread "
119 "lua_State*"
120 );
121 }
122
123 push_gc_udata<detail::class_registry>(L, &detail::classes_tag, L);
124 push_gc_udata<detail::class_id_map>(L, &detail::classid_map_tag);
125 push_gc_udata<detail::cast_graph>(L, &detail::cast_graph_tag);
126 push_gc_udata<detail::class_map>(L, &detail::class_map_tag);
127
128 // add functions (class, cast etc...)
129 lua_pushcfunction(L, detail::create_class::stage1);
130 lua_setglobal(L, "class");
131
132 lua_pushcfunction(L, &make_property);
133 lua_setglobal(L, "property");
134
135 lua_pushlightuserdata(L, &main_thread_tag);
136 lua_pushlightuserdata(L, L);
137 lua_rawset(L, LUA_REGISTRYINDEX);
138
139 lua_pushcfunction(L, &deprecated_super);
140 lua_setglobal(L, "super");
141 }
142
143} // namespace luabind

Callers 6

createLuaStateMethod · 0.50
createLuaStateAudioMethod · 0.50
open_handlesFunction · 0.50
_get_usbfs_fdFunction · 0.50
_open_sysfs_attrFunction · 0.50
dispatcherMethod · 0.50

Calls 3

lua_pushthreadFunction · 0.85
lua_pushlightuserdataFunction · 0.85
lua_rawsetFunction · 0.85

Tested by

no test coverage detected