]> mj.ucw.cz Git - libucw.git/blobdiff - lib/lib.h
Added license notices to all library files which are not specific
[libucw.git] / lib / lib.h
index 7b406dd90fa36289f665a47dbc40453b14c5cede..ad19f505f38ea191ac9e34406b66d7d8db63d368 100644 (file)
--- a/lib/lib.h
+++ b/lib/lib.h
@@ -2,6 +2,9 @@
  *     Sherlock Library -- Miscellaneous Functions
  *
  *     (c) 1997--2001 Martin Mares <mj@ucw.cz>
+ *
+ *     This software may be freely distributed and used according to the terms
+ *     of the GNU Lesser General Public License.
  */
 
 /*
 
 void log(unsigned int cat, const char *msg, ...) __attribute__((format(printf,2,3)));
 void die(byte *, ...) NONRET;
+void assert_failed(char *assertion, char *file, int line) NONRET;
 void log_init(byte *);
 void log_file(byte *);
 void log_fork(void);
 
 #ifdef DEBUG
-#define ASSERT(x) do { if (!(x)) die("Assertion `%s' failed at %s:%d", #x, __FILE__, __LINE__); } while(0)
+#define ASSERT(x) do { if (!(x)) assert_failed(#x, __FILE__, __LINE__); } while(0)
 #else
 #define ASSERT(x) do { } while(0)
 #endif
@@ -84,11 +88,11 @@ void log_fork(void);
  */
 #define xmalloc sh_xmalloc
 void *xmalloc(unsigned);
-void *xmalloc_zero(unsigned);
 void *xrealloc(void *, unsigned);
 #define xfree(x) free(x)
 #endif
 
+void *xmalloc_zero(unsigned);
 byte *stralloc(byte *);
 
 /* Objects */
@@ -118,6 +122,8 @@ 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 *, struct oattr *, 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 */