123456789101112131415161718192021222324252627282930313233 |
- #include <lua.h>
- //#include <lualib.h>
- #include <lauxlib.h>
- #include <lsup_rdf.h>
- 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;
- }
|