| 1265 | } |
| 1266 | |
| 1267 | PB_API void pb_deltype(pb_State *S, pb_Type *t) { |
| 1268 | pb_FieldEntry *nf = NULL; |
| 1269 | pb_OneofEntry *ne = NULL; |
| 1270 | if (S == NULL || t == NULL) return; |
| 1271 | while (pb_nextentry(&t->field_names, (const pb_Entry**)&nf)) { |
| 1272 | if (nf->value != NULL) { |
| 1273 | pb_FieldEntry *of = (pb_FieldEntry*)pb_gettable( |
| 1274 | &t->field_tags, nf->value->number); |
| 1275 | if (of && of->value == nf->value) |
| 1276 | of->entry.key = 0, of->value = NULL; |
| 1277 | pbT_freefield(S, nf->value); |
| 1278 | } |
| 1279 | } |
| 1280 | while (pb_nextentry(&t->field_tags, (const pb_Entry**)&nf)) |
| 1281 | if (nf->value != NULL) pbT_freefield(S, nf->value); |
| 1282 | while (pb_nextentry(&t->oneof_index, (const pb_Entry**)&ne)) |
| 1283 | pb_delname(S, ne->name); |
| 1284 | pb_freetable(&t->field_tags); |
| 1285 | pb_freetable(&t->field_names); |
| 1286 | pb_freetable(&t->oneof_index); |
| 1287 | t->oneof_field = 0, t->field_count = 0; |
| 1288 | t->is_dead = 1; |
| 1289 | pb_delsort(t); |
| 1290 | /*pb_delname(S, t->name); */ |
| 1291 | /*pb_poolfree(&S->typepool, t); */ |
| 1292 | } |
| 1293 | |
| 1294 | PB_API pb_Field *pb_newfield(pb_State *S, pb_Type *t, pb_Name *fname, int32_t number) { |
| 1295 | pb_FieldEntry *nf, *tf; |
no test coverage detected