MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / ll_loadfunc

Function ll_loadfunc

third-party/lua-5.2.4/src/loadlib.c:286–304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

284
285
286static int ll_loadfunc (lua_State *L, const char *path, const char *sym) {
287 void *reg = ll_checkclib(L, path); /* check loaded C libraries */
288 if (reg == NULL) { /* must load library? */
289 reg = ll_load(L, path, *sym == '*');
290 if (reg == NULL) return ERRLIB; /* unable to load library */
291 ll_addtoclib(L, path, reg);
292 }
293 if (*sym == '*') { /* loading only library (no function)? */
294 lua_pushboolean(L, 1); /* return 'true' */
295 return 0; /* no errors */
296 }
297 else {
298 lua_CFunction f = ll_sym(L, reg, sym);
299 if (f == NULL)
300 return ERRFUNC; /* unable to find function */
301 lua_pushcfunction(L, f); /* else create new function */
302 return 0; /* no errors */
303 }
304}
305
306
307static int ll_loadlib (lua_State *L) {

Callers 2

ll_loadlibFunction · 0.70
loadfuncFunction · 0.70

Calls 5

ll_checkclibFunction · 0.85
ll_addtoclibFunction · 0.85
ll_loadFunction · 0.70
lua_pushbooleanFunction · 0.70
ll_symFunction · 0.70

Tested by

no test coverage detected