MCPcopy Create free account
hub / github.com/crownengine/crown / loadjitmodule

Function loadjitmodule

3rdparty/luajit/src/luajit.c:298–319  ·  view source on GitHub ↗

Load add-on module. */

Source from the content-addressed store, hash-verified

296
297/* Load add-on module. */
298static int loadjitmodule(lua_State *L)
299{
300 lua_getglobal(L, "require");
301 lua_pushliteral(L, "jit.");
302 lua_pushvalue(L, -3);
303 lua_concat(L, 2);
304 if (lua_pcall(L, 1, 1, 0)) {
305 const char *msg = lua_tostring(L, -1);
306 if (msg && !strncmp(msg, "module ", 7))
307 goto nomodule;
308 return report(L, 1);
309 }
310 lua_getfield(L, -1, "start");
311 if (lua_isnil(L, -1)) {
312 nomodule:
313 l_message(progname,
314 "unknown luaJIT command or jit.* modules not installed");
315 return 1;
316 }
317 lua_remove(L, -2); /* Drop module table. */
318 return 0;
319}
320
321/* Run command with options. */
322static int runcmdopt(lua_State *L, const char *opt)

Callers 2

dojitcmdFunction · 0.85
dobytecodeFunction · 0.85

Calls 8

strncmpFunction · 0.85
lua_pushvalueFunction · 0.70
lua_concatFunction · 0.70
lua_pcallFunction · 0.70
reportFunction · 0.70
lua_getfieldFunction · 0.70
l_messageFunction · 0.70
lua_removeFunction · 0.70

Tested by

no test coverage detected