2 * Sherlock Library -- Object Functions
4 * (c) 1997--2003 Martin Mares <mj@ucw.cz>
6 * This software may be freely distributed and used according to the terms
7 * of the GNU Lesser General Public License.
10 #ifndef _SHERLOCK_OBJECT_H
11 #define _SHERLOCK_OBJECT_H
13 #define MAX_ATTR_SIZE 1024 /* Maximum length an attribute can ever have (including name and trailing 0) */
17 struct odes { /* Object description */
20 struct oattr *cached_attr;
23 struct oattr { /* Object attribute */
24 struct oattr *next, *same;
29 void obj_dump(struct odes *);
30 struct odes *obj_new(struct mempool *);
31 int obj_read(struct fastbuf *, struct odes *);
32 void obj_write(struct fastbuf *, struct odes *);
33 void obj_write_nocheck(struct fastbuf *, struct odes *);
34 struct oattr *obj_find_attr(struct odes *, uns);
35 struct oattr *obj_find_attr_last(struct odes *, uns);
36 uns obj_del_attr(struct odes *, struct oattr *);
37 byte *obj_find_aval(struct odes *, uns);
38 struct oattr *obj_set_attr(struct odes *, uns, byte *);
39 struct oattr *obj_set_attr_num(struct odes *, uns, uns);
40 struct oattr *obj_add_attr(struct odes *, uns, byte *);
41 struct oattr *obj_prepend_attr(struct odes *, uns, byte *);
42 struct oattr *obj_insert_attr(struct odes *o, struct oattr *first, struct oattr *after, byte *v);
43 void obj_move_attr_to_head(struct odes *o, uns);
44 void obj_move_attr_to_tail(struct odes *o, uns);