#pragma once // Shared internals for the binding translation units. Each `gui`, `sys`, ... table // lives in its own file so that adding a binding touches one small file rather than // the runtime everything else also edits. extern "C" { #include #include } #include class LuaApp; // The owning app, recovered from the state itself rather than a file-static, so a // second lua_State (a coroutine, or a future second app) cannot reach the wrong one. LuaApp* app(lua_State* L); void bindApp(lua_State* L, LuaApp* owner); void registerGui(lua_State* L); void registerNode(lua_State* L); void registerSys(lua_State* L); void registerSettings(lua_State* L); void registerInput(lua_State* L); void registerFs(lua_State* L); void registerWifi(lua_State* L); void registerHttp(lua_State* L); // Reads a script through the SD mount; Lua's stock loaders use stdio, which cannot // see it. Shared because both `require` and the app launcher need it. bool readScript(const char* path, String& out); int loadScript(lua_State* L, const char* path);