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

Function Lpb_enum

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

Source from the content-addressed store, hash-verified

1300}
1301
1302static int Lpb_enum(lua_State *L) {
1303 lpb_State *LS = lpb_lstate(L);
1304 const pb_Type *t = lpb_type(LS, lpb_checkslice(L, 1));
1305 const pb_Field *f = lpb_field(L, 2, t);
1306 if (f == NULL) return 0;
1307 if (lua_type(L, 2) == LUA_TNUMBER)
1308 lua_pushstring(L, (const char*)f->name);
1309 else
1310 lpb_pushinteger(L, f->number, 1, LS->int64_mode);
1311 return 1;
1312}
1313
1314static int lpb_pushdeffield(lua_State *L, lpb_State *LS, const pb_Field *f, int is_proto3) {
1315 int ret = 0, u = 0;

Callers

nothing calls this directly

Calls 7

lpb_lstateFunction · 0.85
lpb_typeFunction · 0.85
lpb_checksliceFunction · 0.85
lpb_fieldFunction · 0.85
lua_typeFunction · 0.85
lua_pushstringFunction · 0.85
lpb_pushintegerFunction · 0.85

Tested by

no test coverage detected