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