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

Method create_sandbox

libraries/AP_Scripting/lua_scripts.cpp:233–262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

231}
232
233void lua_scripts::create_sandbox(lua_State *L) {
234 lua_newtable(L);
235 luaopen_base_sandbox(L);
236
237#if ENABLE_DEBUG_MODULE
238 lua_pushstring(L, "debug");
239 luaopen_debug(L);
240 lua_settable(L, -3);
241#endif
242 lua_pushstring(L, "math");
243 luaopen_math(L);
244 lua_settable(L, -3);
245 lua_pushstring(L, "table");
246 luaopen_table(L);
247 lua_settable(L, -3);
248 lua_pushstring(L, "string");
249 luaopen_string(L);
250 lua_settable(L, -3);
251 lua_pushstring(L, "io");
252 luaopen_io(L);
253 lua_settable(L, -3);
254 lua_pushstring(L, "utf8");
255 luaopen_utf8(L);
256 lua_settable(L, -3);
257 lua_pushstring(L, "package");
258 luaopen_package(L);
259 lua_settable(L, -3);
260
261 load_generated_sandbox(L);
262}
263
264void lua_scripts::load_all_scripts_in_dir(lua_State *L, const char *dirname) {
265 if (dirname == nullptr) {

Callers

nothing calls this directly

Calls 10

luaopen_base_sandboxFunction · 0.85
lua_pushstringFunction · 0.85
luaopen_debugFunction · 0.85
lua_settableFunction · 0.85
luaopen_mathFunction · 0.85
luaopen_tableFunction · 0.85
luaopen_stringFunction · 0.85
luaopen_ioFunction · 0.85
luaopen_utf8Function · 0.85
luaopen_packageFunction · 0.85

Tested by

no test coverage detected