Debian Codegraph @

xpa/xalloc.h

raw symbols SCIP
1 /*
2 * Copyright (c) 2004 Smithsonian Astrophysical Observatory
3 */
4
5 /*
6 *
7 * xalloc.h -- declarations for safe (error-checked) memory allocation
8 *
9 */
10
11 #ifndef __xalloc_h
12 #define __xalloc_h
13
14 #if HAVE_CONFIG_H
15 #include <conf.h>
16 #endif
17
18 #include <sys/types.h>
19 #if HAVE_STRING_H
20 #include <string.h>
21 #endif
22 #if HAVE_MALLOC_H
23 #include <malloc.h>
24 #endif
25 #if HAVE_STDLIB_H
26 #include <stdlib.h>
27 #endif
28 #if HAVE_UNISTD_H
29 #include <unistd.h>
30 #endif
31 #ifdef HAVE_SETJMP_H
32 #define XALLOC_SETJMP 142857
33 #include <setjmp.h>
34 #endif
35
36 #include <prsetup.h>
37
38 _PRbeg
39
40 void *xmalloc _PRx((size_t n));
41 void *xcalloc _PRx((size_t n, size_t s));
42 void *xrealloc _PRx((void *p, size_t n));
43 void xfree _PRx((void *p));
44 char *xstrdup _PRx((char *s));
45 #if HAVE_SETJMP_H
46 void xalloc_savejmp _PRx((jmp_buf *env));
47 #endif
48
49 _PRend
50
51 #endif