diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2018-01-23 16:54:55 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2018-01-23 16:54:55 (GMT) |
commit | 5bf617b1e9347322b8b16419fd5e74107e8b1c26 (patch) | |
tree | e5bbb785b82b35bc62df41bebca8b540078aaf76 /xpa/xalloc.h | |
parent | 51e1f85047b34f095ed69a3024d696997d2667c8 (diff) | |
parent | 0ebcd152c10d2eae6b62f16e7138aa187a8a1bdd (diff) | |
download | blt-5bf617b1e9347322b8b16419fd5e74107e8b1c26.zip blt-5bf617b1e9347322b8b16419fd5e74107e8b1c26.tar.gz blt-5bf617b1e9347322b8b16419fd5e74107e8b1c26.tar.bz2 |
Merge commit '0ebcd152c10d2eae6b62f16e7138aa187a8a1bdd' as 'xpa'
Diffstat (limited to 'xpa/xalloc.h')
-rw-r--r-- | xpa/xalloc.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/xpa/xalloc.h b/xpa/xalloc.h new file mode 100644 index 0000000..c25fb32 --- /dev/null +++ b/xpa/xalloc.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2004 Smithsonian Astrophysical Observatory + */ + +/* + * + * xalloc.h -- declarations for safe (error-checked) memory allocation + * + */ + +#ifndef __xalloc_h +#define __xalloc_h + +#if HAVE_CONFIG_H +#include <conf.h> +#endif + +#include <sys/types.h> +#if HAVE_STRING_H +#include <string.h> +#endif +#if HAVE_MALLOC_H +#include <malloc.h> +#endif +#if HAVE_STDLIB_H +#include <stdlib.h> +#endif +#if HAVE_UNISTD_H +#include <unistd.h> +#endif +#ifdef HAVE_SETJMP_H +#define XALLOC_SETJMP 142857 +#include <setjmp.h> +#endif + +#include <prsetup.h> + +_PRbeg + +void *xmalloc _PRx((size_t n)); +void *xcalloc _PRx((size_t n, size_t s)); +void *xrealloc _PRx((void *p, size_t n)); +void xfree _PRx((void *p)); +char *xstrdup _PRx((char *s)); +#if HAVE_SETJMP_H +void xalloc_savejmp _PRx((jmp_buf *env)); +#endif + +_PRend + +#endif |