use automake 1.11, autoconf 2.65
[abook.git] / xmalloc.h
blobc94e14608eb2f6ea8f06f1b43eb891576e141fd8
1 #ifndef _XMALLOC_H
2 #define _XMALLOC_H
4 #include <stdlib.h> /* for size_t */
6 /*
7 * avoid possible collision with readline xmalloc functions
8 */
10 #define xmalloc _xmalloc_xmalloc
11 #define xrealloc _xmalloc_xrealloc
13 void xmalloc_set_error_handler(void (*)(int));
14 void * xmalloc(size_t);
15 void * xmalloc0(size_t);
16 void * xmalloc_inc(size_t, size_t);
17 void * xmalloc0_inc(size_t, size_t);
18 void * xrealloc(void *, size_t);
19 void * xrealloc_inc(void *, size_t, size_t);
20 char * xstrdup(const char *s);
21 char * xstrndup(const char *s, size_t);
23 #define xfree(ptr) do { free(ptr); ptr = NULL; } while(0)
25 #endif