+static inline void
+dump_oattr(struct fastbuf *out, struct oattr *oa)
+{
+ for (struct oattr *a = oa; a; a = a->same)
+ bprintf(out, "%c%s\n", a->attr, a->val);
+}
+
+static void
+dump_parsed_bucket(struct fastbuf *out, struct obuck_header *h, struct fastbuf *b)
+{
+ struct odes *o = obj_read_bucket(buck_buf, pool, h->type, h->length, b, NULL);
+ if (!o)
+ bprintf(out, "Cannot parse bucket %x of type %x and length %d: %m\n", h->oid, h->type, h->length);
+ else
+ {
+#define IS_HEADER(x) (x=='O' || x=='U')
+ for (struct oattr *oa = o->attrs; oa; oa = oa->next)
+ if (IS_HEADER(oa->attr))
+ dump_oattr(out, oa);
+ bputc(out, '\n');
+ for (struct oattr *oa = o->attrs; oa; oa = oa->next)
+ if (!IS_HEADER(oa->attr))
+ dump_oattr(out, oa);
+ }
+}
+