1 /* nstd.h */ 2 3 /* Never Standard.h 4 5 This has all the prototypes that are supposed to 6 be in a standard place but never are, and when they are 7 the standard place isn't standard 8 */ 9 10 #ifndef NSTD_H 11 #define NSTD_H 1 12 13 #include "../config.h" 14 15 #ifdef NO_PROTOS 16 #define PROTO(name,args) name() 17 #else 18 #define PROTO(name,args) name args 19 #endif 20 21 /* types */ 22 23 #ifdef NO_VOID_STAR 24 typedef char *PTR ; 25 #else 26 typedef void *PTR ; 27 #endif 28 29 #ifdef SIZE_T_STDDEF_H 30 #include <stddef.h> 31 #else 32 #ifdef SIZE_T_TYPES_H 33 #include <sys/types.h> 34 #else 35 typedef unsigned size_t ; 36 #endif 37 #endif 38 39 /* stdlib.h */ 40 41 double PROTO(strtod, (const char*, char**)) ; 42 void PROTO(free, (void*)) ; 43 PTR PROTO(malloc, (size_t)) ; 44 PTR PROTO(realloc, (void*,size_t)) ; 45 void PROTO(exit, (int)) ; 46 char* PROTO(getenv, (const char*)) ; 47 48 /* string.h */ 49 50 /* 51 int PROTO(memcmp, (const void*,const void*,size_t)) ; 52 PTR PROTO(memcpy, (void*,const void*,size_t)) ; 53 PTR PROTO(memset, (void*,int,size_t)) ; 54 char* PROTO(strchr, (const char*, int)) ; 55 int PROTO(strcmp, (const char*,const char*)) ; 56 char* PROTO(strcpy, (char *, const char*)) ; 57 size_t PROTO(strlen, (const char*)) ; 58 int PROTO(strncmp, (const char*,const char*,size_t)) ; 59 char* PROTO(strncpy, (char*, const char*, size_t)) ; 60 char* PROTO(strrchr, (const char*,int)) ; 61 char* PROTO(strerror, (int)) ; 62 */ 63 64 65 #ifdef NO_ERRNO_H 66 extern int errno ; 67 #else 68 #include <errno.h> 69 #endif 70 71 /* math.h */ 72 double PROTO(fmod,(double,double)) ; 73 74 /* if have to diddle with errno to get errors from the math library */ 75 #ifndef STDC_MATHERR 76 #define STDC_MATHERR (FPE_TRAPS_ON && NO_MATHERR) 77 #endif 78 79 #endif /* NSTD_H */ 80 81