| 375 | } |
| 376 | |
| 377 | LuaStack LuaEnvironment::execute(const LuaResource *lr, int nres) |
| 378 | { |
| 379 | LuaStack stack(L); |
| 380 | int status; |
| 381 | |
| 382 | status = luaL_loadbuffer(L, lua_resource::program(lr), lr->size, "<unknown>"); |
| 383 | if (status == LUA_OK) |
| 384 | status = this->call(0, nres); |
| 385 | if (status != LUA_OK) { |
| 386 | report(L, status); |
| 387 | device()->pause(); |
| 388 | } |
| 389 | |
| 390 | return stack; |
| 391 | } |
| 392 | |
| 393 | LuaStack LuaEnvironment::execute_string(const char *s) |
| 394 | { |