From: Martin Mares Date: Fri, 24 Jan 2003 18:06:39 +0000 (+0000) Subject: Object functions are numerous enough to deserve their own header file. X-Git-Tag: holmes-import~1293 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=115aec7929c19d3276bdf7baa7917f95483cf417;p=libucw.git Object functions are numerous enough to deserve their own header file. --- diff --git a/lib/lib.h b/lib/lib.h index 12e79ec5..abd536d5 100644 --- a/lib/lib.h +++ b/lib/lib.h @@ -96,37 +96,6 @@ void *xrealloc(void *, unsigned); void *xmalloc_zero(unsigned); byte *stralloc(byte *); -/* Objects */ - -struct fastbuf; - -struct odes { /* Object description */ - struct oattr *attrs; - struct mempool *pool; - struct oattr *cached_attr; -}; - -struct oattr { /* Object attribute */ - struct oattr *next, *same; - byte attr; - byte val[1]; -}; - -void obj_dump(struct odes *); -struct odes *obj_new(struct mempool *); -int obj_read(struct fastbuf *, struct odes *); -void obj_write(struct fastbuf *, struct odes *); -void obj_write_nocheck(struct fastbuf *, struct odes *); -struct oattr *obj_find_attr(struct odes *, uns); -struct oattr *obj_find_attr_last(struct odes *, uns); -uns obj_del_attr(struct odes *, struct oattr *); -byte *obj_find_aval(struct odes *, uns); -struct oattr *obj_set_attr(struct odes *, uns, byte *); -struct oattr *obj_set_attr_num(struct odes *, uns, uns); -struct oattr *obj_add_attr(struct odes *, uns, byte *); -struct oattr *obj_prepend_attr(struct odes *, uns, byte *); -struct oattr *obj_insert_attr(struct odes *o, struct oattr *first, struct oattr *after, byte *v); - /* Content-Type pattern matching and filters */ int match_ct_patt(byte *, byte *); diff --git a/lib/object.c b/lib/object.c index fb5d231f..0c5f88bd 100644 --- a/lib/object.c +++ b/lib/object.c @@ -10,6 +10,7 @@ #include "lib/lib.h" #include "lib/pools.h" #include "lib/fastbuf.h" +#include "lib/object.h" #include #include diff --git a/lib/object.h b/lib/object.h new file mode 100644 index 00000000..01da6ab9 --- /dev/null +++ b/lib/object.h @@ -0,0 +1,42 @@ +/* + * Sherlock Library -- Object Functions + * + * (c) 1997--2003 Martin Mares + * + * This software may be freely distributed and used according to the terms + * of the GNU Lesser General Public License. + */ + +#ifndef _SHERLOCK_OBJECT_H +#define _SHERLOCK_OBJECT_H + +struct fastbuf; + +struct odes { /* Object description */ + struct oattr *attrs; + struct mempool *pool; + struct oattr *cached_attr; +}; + +struct oattr { /* Object attribute */ + struct oattr *next, *same; + byte attr; + byte val[1]; +}; + +void obj_dump(struct odes *); +struct odes *obj_new(struct mempool *); +int obj_read(struct fastbuf *, struct odes *); +void obj_write(struct fastbuf *, struct odes *); +void obj_write_nocheck(struct fastbuf *, struct odes *); +struct oattr *obj_find_attr(struct odes *, uns); +struct oattr *obj_find_attr_last(struct odes *, uns); +uns obj_del_attr(struct odes *, struct oattr *); +byte *obj_find_aval(struct odes *, uns); +struct oattr *obj_set_attr(struct odes *, uns, byte *); +struct oattr *obj_set_attr_num(struct odes *, uns, uns); +struct oattr *obj_add_attr(struct odes *, uns, byte *); +struct oattr *obj_prepend_attr(struct odes *, uns, byte *); +struct oattr *obj_insert_attr(struct odes *o, struct oattr *first, struct oattr *after, byte *v); + +#endif