#include //#include #include #include lua_State *L; static int l_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_lib [] = { {"init", l_init}, {NULL, NULL} }; int luaopen_lsup (lua_State *L) { luaL_newlib (L, lsup_lib); return 1; }