| 1411 | } |
| 1412 | |
| 1413 | static int Lpb_hook(lua_State *L) { |
| 1414 | lpb_State *LS = lpb_lstate(L); |
| 1415 | const pb_Type *t = lpb_type(LS, lpb_checkslice(L, 1)); |
| 1416 | int type = lua_type(L, 2); |
| 1417 | if (t == NULL) luaL_argerror(L, 1, "type not found"); |
| 1418 | if (type != LUA_TNONE && type != LUA_TNIL && type != LUA_TFUNCTION) |
| 1419 | typeerror(L, 2, "function"); |
| 1420 | lua_settop(L, 2); |
| 1421 | lpb_pushdechooktable(L, LS); |
| 1422 | lua_rawgetp(L, 3, t); |
| 1423 | if (type != LUA_TNONE) { |
| 1424 | lua_pushvalue(L, 2); |
| 1425 | lua_rawsetp(L, 3, t); |
| 1426 | } |
| 1427 | return 1; |
| 1428 | } |
| 1429 | |
| 1430 | static int Lpb_encode_hook(lua_State *L) { |
| 1431 | lpb_State *LS = lpb_lstate(L); |
nothing calls this directly
no test coverage detected