| 1300 | } |
| 1301 | |
| 1302 | static 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 | |
| 1314 | static int lpb_pushdeffield(lua_State *L, lpb_State *LS, const pb_Field *f, int is_proto3) { |
| 1315 | int ret = 0, u = 0; |
nothing calls this directly
no test coverage detected