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

Function loadfunc

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

Source from the content-addressed store, hash-verified

516*/
517#if !defined(ARDUPILOT_BUILD)
518static int loadfunc (lua_State *L, const char *filename, const char *modname) {
519 const char *openfunc;
520 const char *mark;
521 modname = luaL_gsub(L, modname, ".", LUA_OFSEP);
522 mark = strchr(modname, *LUA_IGMARK);
523 if (mark) {
524 int stat;
525 openfunc = lua_pushlstring(L, modname, mark - modname);
526 openfunc = lua_pushfstring(L, LUA_POF"%s", openfunc);
527 stat = lookforfunc(L, filename, openfunc);
528 if (stat != ERRFUNC) return stat;
529 modname = mark + 1; /* else go ahead and try old-style name */
530 }
531 openfunc = lua_pushfstring(L, LUA_POF"%s", modname);
532 return lookforfunc(L, filename, openfunc);
533}
534
535
536static int searcher_C (lua_State *L) {

Callers 2

searcher_CFunction · 0.85
searcher_CrootFunction · 0.85

Calls 4

luaL_gsubFunction · 0.85
lua_pushlstringFunction · 0.85
lua_pushfstringFunction · 0.85
lookforfuncFunction · 0.85

Tested by

no test coverage detected