diff -r 7728d6ec3abf -r 5229a5d098b2 src/spbot/lua_config.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/spbot/lua_config.c Thu May 28 00:35:02 2009 +0300 @@ -0,0 +1,16 @@ +#include "lua_config.h" + +#include + +err_t lua_config_load (struct nexus_lua *lua, const char *path, error_t *err) +{ + // just use luaL_loadfile and translate the error code + if (nexus_lua_error(lua->st, luaL_loadfile(lua->st, path), err)) + // XXX: pollute the stack + return ERROR_CODE(err); + + // execute it + // XXX; error handler with debug info + return nexus_lua_error(lua->st, lua_pcall(lua->st, 0, 0, 0), err); +} +