2000-10-18 20:12:10 +00:00
|
|
|
#include <sys/types.h>
|
|
|
|
|
2000-03-26 00:33:07 +00:00
|
|
|
#ifndef PARAMS
|
|
|
|
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
|
|
|
|
# define PARAMS(Args) Args
|
|
|
|
# else
|
|
|
|
# define PARAMS(Args) ()
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Exit value when the requested amount of memory is not available.
|
|
|
|
The caller may set it to some other value. */
|
|
|
|
extern int xalloc_exit_failure;
|
|
|
|
|
|
|
|
/* FIXME: describe */
|
|
|
|
extern char *const xalloc_msg_memory_exhausted;
|
|
|
|
|
|
|
|
/* FIXME: describe */
|
2011-05-28 21:36:52 +00:00
|
|
|
extern void (*xalloc_fail_func) (int);
|
2000-03-26 00:33:07 +00:00
|
|
|
|
2003-08-24 20:38:31 +00:00
|
|
|
void *xmalloc PARAMS ((size_t n)) __attribute__ ((__malloc__));
|
|
|
|
void *xmalloc_and_zero PARAMS ((size_t n)) __attribute__ ((__malloc__));
|
2000-03-26 00:33:07 +00:00
|
|
|
void *xcalloc PARAMS ((size_t n, size_t s));
|
2003-08-24 20:38:31 +00:00
|
|
|
void *xrealloc PARAMS ((void *p, size_t n)) __attribute__ ((__malloc__));
|
2002-04-09 15:26:01 +00:00
|
|
|
|
2003-08-24 20:38:31 +00:00
|
|
|
char *xstrdup PARAMS ((const char *s)) __attribute__ ((__malloc__));
|
2009-09-08 16:16:58 +00:00
|
|
|
|
|
|
|
extern int xasprintf(char **strp, const char *fmt, ...);
|
|
|
|
extern int xvasprintf(char **strp, const char *fmt, va_list ap);
|