#include //#include #include #include lua_State *L; static int l_env_init (lua_State *L) { LSUP_rc rc; if ((rc = LSUP_init ()) != LSUP_OK) { lua_pushnil (L); lua_pushstring (L, LSUP_strerror (rc)); return 2; } return 0; } static const struct luaL_Reg lsup [] = { {"env_init", l_env_init}, {NULL, NULL} }; int init (lua_State *L) { lua_newtable (L); luaL_setfuncs(L, lsup, 0); lua_setglobal (L, "LSUP"); return 1; }