- if (is_anon_type(t->name, "enum")) {
- dump_decl_enum_items(fd, t->real.enm->items, level);
+ if (psi_decl_type_is_anon(t->name, "enum")) {
+ size_t i = 0, c = psi_plist_count(t->real.enm->items);
+ struct psi_decl_enum_item *item;
+
+ dprintf(fd, "{\n");
+ ++level;
+ while (psi_plist_get(t->real.enm->items, i++, &item)) {
+ dprintf(fd, "%s", psi_t_indent(level));
+ psi_decl_enum_item_dump(fd, item);
+ if (i < c) {
+ dprintf(fd, "%s\n", i < c ? "," : "");
+ }
+ }
+ --level;
+ dprintf(fd, "%s} ", psi_t_indent(level));