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

Function Lpb_defaults

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

Source from the content-addressed store, hash-verified

1401}
1402
1403static int Lpb_defaults(lua_State *L) {
1404 lpb_State *LS = lpb_lstate(L);
1405 const pb_Type *t = lpb_type(LS, lpb_checkslice(L, 1));
1406 int clear = lua_toboolean(L, 2);
1407 if (t == NULL) luaL_argerror(L, 1, "type not found");
1408 lpb_pushdefmeta(L, LS, t);
1409 if (clear) lpb_cleardefmeta(L, LS, t);
1410 return 1;
1411}
1412
1413static int Lpb_hook(lua_State *L) {
1414 lpb_State *LS = lpb_lstate(L);

Callers

nothing calls this directly

Calls 7

lpb_lstateFunction · 0.85
lpb_typeFunction · 0.85
lpb_checksliceFunction · 0.85
lua_tobooleanFunction · 0.85
luaL_argerrorFunction · 0.85
lpb_pushdefmetaFunction · 0.85
lpb_cleardefmetaFunction · 0.85

Tested by

no test coverage detected