|
|
1.1 root 1: /***
2: *stdlib.h - declarations/definitions for commonly used library functions
3: *
4: * Copyright (c) 1985-1990, Microsoft Corporation. All rights reserved.
5: *
6: *Purpose:
7: * This include file contains the function declarations for
8: * commonly used library functions which either don't fit somewhere
9: * else, or, like toupper/tolower, can't be declared in the normal
10: * place for other reasons.
11: * [ANSI]
12: *
13: ****/
14:
15:
16: #ifndef _SIZE_T_DEFINED
17: typedef unsigned int size_t;
18: #define _SIZE_T_DEFINED
19: #endif
20:
21:
22: /* define NULL pointer value */
23:
24: #define NULL 0
25:
26:
27: /* definition of the return type for the onexit() function */
28:
29: #define EXIT_SUCCESS 0
30: #define EXIT_FAILURE 1
31:
32:
33: #ifndef _ONEXIT_T_DEFINED
34: typedef int (_cdecl * _cdecl onexit_t)();
35: #define _ONEXIT_T_DEFINED
36: #endif
37:
38:
39: /* Data structure definitions for div and ldiv runtimes. */
40:
41: #ifndef _DIV_T_DEFINED
42:
43: typedef struct _div_t {
44: int quot;
45: int rem;
46: } div_t;
47:
48: typedef struct _ldiv_t {
49: long quot;
50: long rem;
51: } ldiv_t;
52:
53: #define _DIV_T_DEFINED
54: #endif
55:
56: /* Maximum value that can be returned by the rand function. */
57:
58: #define RAND_MAX 0x7fff
59:
60:
61: /* min and max macros */
62:
63: #define max(a,b) (((a) > (b)) ? (a) : (b))
64: #define min(a,b) (((a) < (b)) ? (a) : (b))
65:
66:
67: /* sizes for buffers used by the _makepath() and _splitpath() functions.
68: * note that the sizes include space for 0-terminator
69: */
70:
71: #define _MAX_PATH 260 /* max. length of full pathname */
72: #define _MAX_DRIVE 3 /* max. length of drive component */
73: #define _MAX_DIR 256 /* max. length of path component */
74: #define _MAX_FNAME 256 /* max. length of file name component */
75: #define _MAX_EXT 256 /* max. length of extension component */
76:
77: /* external variable declarations */
78:
79: #ifdef _MT
80: extern unsigned * _cdecl _errno(void);
81: extern unsigned * _cdecl __doserrno(void);
82: #define errno (*_errno())
83: #define _doserrno (*__doserrno())
84: #else
85: extern int _cdecl errno; /* XENIX style error number */
86: extern int _cdecl _doserrno; /* MS-DOS system error value */
87: #endif
88: extern char * _cdecl sys_errlist[]; /* perror error message table */
89: extern int _cdecl sys_nerr; /* # of entries in sys_errlist table */
90:
91: extern char ** _cdecl environ; /* pointer to environment table */
92: extern int _cdecl _fmode; /* default file translation mode */
93: extern int _cdecl _fileinfo; /* open file info mode (for spawn) */
94:
95: extern unsigned int _cdecl _psp; /* Program Segment Prefix */
96:
97:
98: /* DOS major/minor version numbers */
99:
100: extern unsigned int _cdecl _osmajor;
101: extern unsigned int _cdecl _osminor;
102:
103: #define DOS_MODE 0 /* Real Address Mode */
104: #define OS2_MODE 1 /* Protected Address Mode */
105:
106: extern unsigned char _cdecl _osmode;
107:
108:
109: /* function prototypes */
110:
111: void _cdecl abort(void);
112: int _cdecl abs(int);
113: int _cdecl atexit(void (_cdecl *)(void));
114: double _cdecl atof(const char *);
115: int _cdecl atoi(const char *);
116: long _cdecl atol(const char *);
117: void * _cdecl bsearch(const void *, const void *, size_t, size_t,
118: int (_cdecl *)(const void *, const void *));
119: void * _cdecl calloc(size_t, size_t);
120: div_t _cdecl div(int, int);
121: char * _cdecl ecvt(double, int, int *, int *);
122: void _cdecl exit(int);
123: void _cdecl _exit(int);
124: char * _cdecl fcvt(double, int, int *, int *);
125: void _cdecl free(void *);
126: char * _cdecl _fullpath(char *, const char *, size_t);
127: char * _cdecl gcvt(double, int, char *);
128: char * _cdecl getenv(const char *);
129: char * _cdecl itoa(int, char *, int);
130: long _cdecl labs(long);
131: ldiv_t _cdecl ldiv(long, long);
132: unsigned long _cdecl _lrotl(unsigned long, int);
133: unsigned long _cdecl _lrotr(unsigned long, int);
134: char * _cdecl ltoa(long, char *, int);
135: void _cdecl _makepath(char *, const char *, const char *, const char *,
136: const char *);
137: void * _cdecl malloc(size_t);
138: onexit_t _cdecl onexit(onexit_t);
139: void _cdecl perror(const char *);
140: int _cdecl putenv(const char *);
141: void _cdecl qsort(void *, size_t, size_t, int (_cdecl *)(const void *,
142: const void *));
143: unsigned int _cdecl _rotl(unsigned int, int);
144: unsigned int _cdecl _rotr(unsigned int, int);
145: int _cdecl rand(void);
146: void * _cdecl realloc(void *, size_t);
147: void _cdecl _searchenv(const char *, const char *, char *);
148: void _cdecl _splitpath(const char *, char *, char *, char *, char *);
149: void _cdecl srand(unsigned int);
150: double _cdecl strtod(const char *, char **);
151: long _cdecl strtol(const char *, char **, int);
152: unsigned long _cdecl strtoul(const char *, char **, int);
153: void _cdecl swab(char *, char *, int);
154: int _cdecl system(const char *);
155: char * _cdecl ultoa(unsigned long, char *, int);
156:
157: #ifndef tolower /* tolower has been undefined - use function */
158: int _cdecl tolower(int);
159: #endif /* tolower */
160:
161: #ifndef toupper /* toupper has been undefined - use function */
162: int _cdecl toupper(int);
163: #endif /* toupper */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.