]> mj.ucw.cz Git - libucw.git/commitdiff
obj_add_attr() now returns head of the attribute value chain, so that you
authorMartin Mares <mj@ucw.cz>
Fri, 26 Jan 2001 16:27:38 +0000 (16:27 +0000)
committerMartin Mares <mj@ucw.cz>
Fri, 26 Jan 2001 16:27:38 +0000 (16:27 +0000)
can easily do:

struct oattr *a;
a = obj_add_attr(obj, NULL, 'x', "val1");
a = obj_add_attr(obj, a, 'x', "val2");

to insert multi-valued attributes quickly.

lib/object.c

index d12461527a4a24889e38cf900b1ecbaf65745e14..839bc65e558ad6dd4f8735fad4110854de475e3b 100644 (file)
@@ -220,5 +220,5 @@ obj_add_attr(struct odes *o, struct oattr *a, uns x, byte *v)
   b = oa_new(o, x, v);
   a->last_same->same = b;
   a->last_same = b;
-  return b;
+  return a;
 }