MCPcopy Create free account
hub / github.com/ArduPilot/ardupilot / ll_loadlib

Function ll_loadlib

libraries/AP_Scripting/lua/src/loadlib.c:398–410  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

396
397
398static int ll_loadlib (lua_State *L) {
399 const char *path = luaL_checkstring(L, 1);
400 const char *init = luaL_checkstring(L, 2);
401 int stat = lookforfunc(L, path, init);
402 if (stat == 0) /* no errors? */
403 return 1; /* return the loaded function */
404 else { /* error; error message is on stack top */
405 lua_pushnil(L);
406 lua_insert(L, -2);
407 lua_pushstring(L, (stat == ERRLIB) ? LIB_FAIL : "init");
408 return 3; /* return nil, error message, and where */
409 }
410}
411
412
413

Callers

nothing calls this directly

Calls 3

lookforfuncFunction · 0.85
lua_pushnilFunction · 0.85
lua_pushstringFunction · 0.85

Tested by

no test coverage detected