src/lua_config.c
changeset 106 f00661136ac2
child 217 7728d6ec3abf
equal deleted inserted replaced
105:b6b183fbf373 106:f00661136ac2
       
     1 #include "lua_config.h"
       
     2 
       
     3 #include <lua5.1/lauxlib.h>
       
     4 
       
     5 err_t lua_config_load (struct nexus_lua *lua, const char *path, struct error_info *err)
       
     6 {
       
     7     // just use luaL_loadfile and translate the error code
       
     8     if (nexus_lua_error(lua->st, luaL_loadfile(lua->st, path), err))
       
     9         // XXX: pollute the stack
       
    10         return ERROR_CODE(err);
       
    11     
       
    12     // execute it
       
    13     // XXX; error handler with debug info
       
    14     return nexus_lua_error(lua->st, lua_pcall(lua->st, 0, 0, 0), err);
       
    15 }
       
    16