]> git.deb.at Git - pkg/abook.git/blob - xmalloc.h
Upload 0.6.1-2 to unstable
[pkg/abook.git] / xmalloc.h
1 #ifndef _XMALLOC_H
2 #define _XMALLOC_H
3
4 #include <stdlib.h> /* for size_t */
5
6 /*
7  * avoid possible collision with readline xmalloc functions
8  */
9
10 #define xmalloc         _xmalloc_xmalloc
11 #define xrealloc        _xmalloc_xrealloc
12
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);
22
23 #define xfree(ptr)      do { free(ptr); ptr = NULL; } while(0)
24
25 #endif