| 1167 | { lua_createtable(L, 0, t->field_count - t->oneof_field + t->oneof_count*2); } |
| 1168 | |
| 1169 | LUALIB_API const pb_Type *lpb_type(lpb_State *LS, pb_Slice s) { |
| 1170 | const pb_Type *t; |
| 1171 | if (s.p == NULL || *s.p == '.') |
| 1172 | t = pb_type(lpbS_state(LS), lpb_name(LS, s)); |
| 1173 | else { |
| 1174 | pb_Buffer b; |
| 1175 | pb_initbuffer(&b); |
| 1176 | *pb_prepbuffsize(&b, 1) = '.'; |
| 1177 | pb_addsize(&b, 1); |
| 1178 | pb_addslice(&b, s); |
| 1179 | t = pb_type(lpbS_state(LS), pb_name(lpbS_state(LS),pb_result(&b),NULL)); |
| 1180 | pb_resetbuffer(&b); |
| 1181 | } |
| 1182 | return t; |
| 1183 | } |
| 1184 | |
| 1185 | static const pb_Field *lpb_field(lua_State *L, int idx, const pb_Type *t) { |
| 1186 | lpb_State *LS = lpb_lstate(L); |
no test coverage detected