MCPcopy Create free account
hub / github.com/Tencent/UnLua / Lpb_hook

Function Lpb_hook

Plugins/UnLuaExtensions/LuaProtobuf/Source/src/pb.cpp:1413–1428  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1411}
1412
1413static 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
1430static int Lpb_encode_hook(lua_State *L) {
1431 lpb_State *LS = lpb_lstate(L);

Callers

nothing calls this directly

Calls 11

lpb_lstateFunction · 0.85
lpb_typeFunction · 0.85
lpb_checksliceFunction · 0.85
lua_typeFunction · 0.85
luaL_argerrorFunction · 0.85
typeerrorFunction · 0.85
lua_settopFunction · 0.85
lpb_pushdechooktableFunction · 0.85
lua_pushvalueFunction · 0.85
lua_rawgetpFunction · 0.70
lua_rawsetpFunction · 0.70

Tested by

no test coverage detected