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

Function handle_luainit

libraries/AP_Scripting/lua/src/lua.c:536–548  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

534
535
536static int handle_luainit (lua_State *L) {
537 const char *name = "=" LUA_INITVARVERSION;
538 const char *init = getenv(name + 1);
539 if (init == NULL) {
540 name = "=" LUA_INIT_VAR;
541 init = getenv(name + 1); /* try alternative name */
542 }
543 if (init == NULL) return LUA_OK;
544 else if (init[0] == '@')
545 return dofile(L, init+1);
546 else
547 return dostring(L, init, name);
548}
549
550
551/*

Callers 1

pmainFunction · 0.85

Calls 2

dofileFunction · 0.85
dostringFunction · 0.85

Tested by

no test coverage detected