]> mj.ucw.cz Git - libucw.git/blobdiff - lib/obj2buck.c
Moved object reading and writing functions where they belong.
[libucw.git] / lib / obj2buck.c
index 9198fad56ec4c449243c21da264a044533b50a81..0ced895bea00c8132bc19ddfdb3a41c6a03b7eb3 100644 (file)
@@ -184,3 +184,29 @@ bput_attr_num(struct fastbuf *b, uns type, uns val)
   else
     bprintf(b, "%c%d\n", type, val);
 }
+
+void
+obj_write(struct fastbuf *f, struct odes *d)
+{
+  for(struct oattr *a=d->attrs; a; a=a->next)
+    for(struct oattr *b=a; b; b=b->same)
+      {
+       byte *z;
+       for (z = b->val; *z; z++)
+         if (*z < ' ' && *z != '\t')
+           {
+             log(L_ERROR, "obj_dump: Found non-ASCII characters (URL might be %s)", obj_find_aval(d, 'U'));
+             *z = '?';
+           }
+       ASSERT(z - b->val <= MAX_ATTR_SIZE-2);
+       bput_attr_str(f, a->attr, b->val);
+      }
+}
+
+void
+obj_write_nocheck(struct fastbuf *f, struct odes *d)
+{
+  for(struct oattr *a=d->attrs; a; a=a->next)
+    for(struct oattr *b=a; b; b=b->same)
+      bput_attr_str(f, a->attr, b->val);
+}