| 1270 | } |
| 1271 | |
| 1272 | static int Lpb_fieldsiter(lua_State *L) { |
| 1273 | lpb_State *LS = lpb_lstate(L); |
| 1274 | const pb_Type *t = lpb_type(LS, lpb_checkslice(L, 1)); |
| 1275 | const pb_Field *f = pb_fname(t, lpb_name(LS, lpb_toslice(L, 2))); |
| 1276 | if ((f == NULL && !lua_isnoneornil(L, 2)) || !pb_nextfield(t, &f)) |
| 1277 | return 0; |
| 1278 | return lpb_pushfield(L, t, f); |
| 1279 | } |
| 1280 | |
| 1281 | static int Lpb_fields(lua_State *L) { |
| 1282 | lua_pushcfunction(L, Lpb_fieldsiter); |
nothing calls this directly
no test coverage detected