* 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_fork(void);
#ifdef DEBUG
-#define ASSERT(x) do { if (!(x)) die("Assertion `%s' failed at %s:%d", #x, __FILE__, __LINE__); } while(0)
+void assert_failed(char *assertion, char *file, int line) NONRET;
+#define ASSERT(x) do { if (!(x)) assert_failed(#x, __FILE__, __LINE__); } while(0)
#else
-#define ASSERT(x) do { } while(0)
+void assert_failed(void) NONRET;
+#define ASSERT(x) do { if (__builtin_constant_p(x) && !(x)) assert_failed(); } while(0)
#endif
#ifdef LOCAL_DEBUG
*/
#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 */
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 */