3 lua_State
* newState() {
4 lua_State
* l
= lua_open();
9 void doLuaFile(lua_State
* l
,std::string file
) {
10 if (luaL_dofile(l
, file
.c_str())) {
11 printf("%s\n", lua_tostring(l
, -1));
15 void registerFunction(lua_State
* l
, std::string name
, lua_CFunction function
) {
16 lua_pushcfunction(l
, function
);
17 lua_setglobal(l
, name
.c_str());