]> mj.ucw.cz Git - libucw.git/commitdiff
Object functions are numerous enough to deserve their own header file.
authorMartin Mares <mj@ucw.cz>
Fri, 24 Jan 2003 18:06:39 +0000 (18:06 +0000)
committerMartin Mares <mj@ucw.cz>
Fri, 24 Jan 2003 18:06:39 +0000 (18:06 +0000)
lib/lib.h
lib/object.c
lib/object.h [new file with mode: 0644]

index 12e79ec5c589e824b92d7d5b38282a5746572c30..abd536d57773bf28e16ff0880fbe7ffe99bf853c 100644 (file)
--- 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 *);
index fb5d231ff4e5dbd5194ff15dbdfd0e2736795af5..0c5f88bd76d1a6b32d9ca244207bfc40690b0ce2 100644 (file)
@@ -10,6 +10,7 @@
 #include "lib/lib.h"
 #include "lib/pools.h"
 #include "lib/fastbuf.h"
+#include "lib/object.h"
 
 #include <string.h>
 #include <stdio.h>
diff --git a/lib/object.h b/lib/object.h
new file mode 100644 (file)
index 0000000..01da6ab
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ *     Sherlock Library -- Object Functions
+ *
+ *     (c) 1997--2003 Martin Mares <mj@ucw.cz>
+ *
+ *     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