00001
00005 #ifdef HAVE_CONFIG_H
00006 #include "config.h"
00007 #endif
00008
00009 #if defined (__GLIBC__) && defined(__LCLINT__)
00010
00011
00012 extern __const __int32_t *__ctype_tolower;
00013
00014 extern __const __int32_t *__ctype_toupper;
00015
00016 #endif
00017
00018 #include <ctype.h>
00019
00020
00021 #define _isspaceptr(_chp) isspace((int)(*(unsigned char *)(_chp)))
00022
00023 #include <errno.h>
00024 #include <fcntl.h>
00025 #include <limits.h>
00026
00027 #ifdef HAVE_MCHECK_H
00028 #include <mcheck.h>
00029 #endif
00030
00031 #include <stdio.h>
00032 #include <stdlib.h>
00033 #include <string.h>
00034
00035 #ifdef HAVE_UNISTD_H
00036 #include <unistd.h>
00037 #endif
00038
00039 #ifdef __NeXT
00040
00041
00042 #include <libc.h>
00043 #endif
00044
00045
00046
00047 void * xmalloc (size_t size)
00048
00049
00050 ;
00051
00052
00053 void * xcalloc (size_t nmemb, size_t size)
00054
00055 ;
00056
00057
00058 void * xrealloc ( void * ptr, size_t size)
00059
00060 ;
00061
00062
00063 char * xstrdup (const char *str)
00064 ;
00065
00066
00067
00068 #if defined(HAVE_MCHECK_H) && defined(__GNUC__)
00069 #define vmefail() (fprintf(stderr, "virtual memory exhausted.\n"), exit(EXIT_FAILURE), NULL)
00070 #define xmalloc(_size) (malloc(_size) ? : vmefail())
00071 #define xcalloc(_nmemb, _size) (calloc((_nmemb), (_size)) ? : vmefail())
00072 #define xrealloc(_ptr, _size) (realloc((_ptr), (_size)) ? : vmefail())
00073 #define xstrdup(_str) (strcpy((malloc(strlen(_str)+1) ? : vmefail()), (_str)))
00074 #else
00075 #define xmalloc(_size) malloc(_size)
00076 #define xcalloc(_nmemb, _size) calloc((_nmemb), (_size))
00077 #define xrealloc(_ptr, _size) realloc((_ptr), (_size))
00078 #define xstrdup(_str) strdup(_str)
00079 #endif
00080
00081 #if defined(HAVE___SECURE_GETENV) && !defined(__LCLINT__)
00082 #define getenv(_s) __secure_getenv(_s)
00083 #endif
00084
00085 #include "popt.h"