| 1031 | |
| 1032 | |
| 1033 | LUALIB_API lua_State *luaL_newstate (void) { |
| 1034 | lua_State *L = lua_newstate(l_alloc, NULL); |
| 1035 | if (L) { |
| 1036 | int *warnstate; /* space for warning state */ |
| 1037 | lua_atpanic(L, &panic); |
| 1038 | warnstate = (int *)lua_newuserdatauv(L, sizeof(int), 0); |
| 1039 | luaL_ref(L, LUA_REGISTRYINDEX); /* make sure it won't be collected */ |
| 1040 | *warnstate = 0; /* default is warnings off */ |
| 1041 | lua_setwarnf(L, warnf, warnstate); |
| 1042 | } |
| 1043 | return L; |
| 1044 | } |
| 1045 | |
| 1046 | |
| 1047 | LUALIB_API void luaL_checkversion_ (lua_State *L, lua_Number ver, size_t sz) { |
no test coverage detected