| 64 | } |
| 65 | |
| 66 | static bool LuaLoadModule(lua_State *L, const char *buf, uint32_t size, const char *filename) |
| 67 | { |
| 68 | int top = lua_gettop(L); |
| 69 | (void) top; |
| 70 | |
| 71 | int ret = luaL_loadbuffer(L, buf, size, filename); |
| 72 | if (ret == 0) |
| 73 | { |
| 74 | assert(top + 1 == lua_gettop(L)); |
| 75 | return true; |
| 76 | } |
| 77 | else |
| 78 | { |
| 79 | dmLogError("Error running script: %s", lua_tostring(L,-1)); |
| 80 | lua_pop(L, 1); |
| 81 | assert(top == lua_gettop(L)); |
| 82 | return false; |
| 83 | } |
| 84 | |
| 85 | return true; |
| 86 | } |
| 87 | |
| 88 | static int LoadModule(lua_State *L) { |
| 89 | int top = lua_gettop(L); |
no test coverage detected