| 202 | } |
| 203 | |
| 204 | static int Lpb_state(lua_State *L) { |
| 205 | int top = lua_gettop(L); |
| 206 | lpb_lstate(L); |
| 207 | lua_rawgetp(L, LUA_REGISTRYINDEX, state_name); |
| 208 | if (top != 0) { |
| 209 | if (lua_isnil(L, 1)) |
| 210 | lua_pushnil(L); |
| 211 | else { |
| 212 | luaL_checkudata(L, 1, PB_STATE); |
| 213 | lua_pushvalue(L, 1); |
| 214 | } |
| 215 | lua_rawsetp(L, LUA_REGISTRYINDEX, state_name); |
| 216 | } |
| 217 | return 1; |
| 218 | } |
| 219 | |
| 220 | |
| 221 | /* protobuf util routines */ |
nothing calls this directly
no test coverage detected