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

Method createLuaState

Source/Lua/CtrlrLuaManager.cpp:112–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110}
111
112void CtrlrLuaManager::createLuaState()
113{
114 luaState = luaL_newstate();
115 luaL_openlibs(luaState);
116
117 lua_pushcfunction(luaState, luaopen_base);
118 lua_pushliteral(luaState, "base");
119 lua_call(luaState, 1, 0);
120
121 lua_pushcfunction(luaState, luaopen_table);
122 lua_pushliteral(luaState, "table");
123 lua_call(luaState, 1, 0);
124
125 lua_pushcfunction(luaState, luaopen_string);
126 lua_pushliteral(luaState, "string");
127 lua_call(luaState, 1, 0);
128
129 lua_pushcfunction(luaState, luaopen_math);
130 lua_pushliteral(luaState, "math");
131 lua_call(luaState, 1, 0);
132
133 lua_pushcfunction(luaState, luaopen_io);
134 lua_pushliteral(luaState, "io");
135 lua_call(luaState, 1, 0);
136
137 lua_pushcfunction(luaState, luaopen_debug);
138 lua_pushliteral(luaState, "debug");
139 lua_call(luaState, 1, 0);
140
141 lua_pushcfunction(luaState, luaopen_package);
142 lua_pushliteral(luaState, "package");
143 lua_call(luaState, 1, 0);
144
145 lua_pushcfunction(luaState, luaopen_os);
146 lua_pushliteral(luaState, "os");
147 lua_call(luaState, 1, 0);
148
149 lua_pushcfunction(luaState, luaopen_bit);
150 lua_pushliteral(luaState, "bit");
151 lua_call(luaState, 1, 0);
152
153 lua_pushcfunction(luaState, luaopen_usb);
154 lua_pushliteral(luaState, "usb");
155 lua_call(luaState, 1, 0);
156
157 using namespace luabind;
158 open(luaState);
159
160 luabind::bind_class_info(luaState);
161
162 set_pcall_callback (add_file_and_line);
163}
164
165void CtrlrLuaManager::createLuaStateAudio()
166{

Callers

nothing calls this directly

Calls 6

luaL_newstateFunction · 0.85
luaL_openlibsFunction · 0.85
lua_callFunction · 0.85
bind_class_infoFunction · 0.85
set_pcall_callbackFunction · 0.85
openFunction · 0.50

Tested by

no test coverage detected