| 65 | } |
| 66 | |
| 67 | int precompile_lua(char *lua_buffer, void **compiled_data, int *size) { |
| 68 | lua_State *lua; |
| 69 | Proto *f; |
| 70 | lua=lua_open(); |
| 71 | luaL_loadstring(lua,lua_buffer); |
| 72 | lua_atpanic(lua, l_panic); |
| 73 | const Closure* c=(const Closure*)lua_topointer(lua,-1); |
| 74 | if (c) { |
| 75 | f = c->l.p; |
| 76 | } else { |
| 77 | return -1; |
| 78 | } |
| 79 | luaU_dump(lua,f,lua_writer1,size, 0); |
| 80 | *compiled_data = malloc(*size); |
| 81 | void *data = NULL; |
| 82 | data = *compiled_data; |
| 83 | luaU_dump(lua,f,lua_writer2,&data, 0); |
| 84 | return 0; |
| 85 | } |
| 86 | |
| 87 | const char *luabb_pushfstring(lua_State *lua, char *fmt, ...) { |
| 88 | char c[1]; |
nothing calls this directly
no test coverage detected