summaryrefslogtreecommitdiff
path: root/v4.0/src/TOOLS/BLD/INC/STDLIB.H
diff options
context:
space:
mode:
authorGravatar Mark Zbikowski2024-04-25 21:24:10 +0100
committerGravatar Microsoft Open Source2024-04-25 22:32:27 +0000
commit2d04cacc5322951f187bb17e017c12920ac8ebe2 (patch)
tree80ee017efa878dfd5344b44249e6a241f2a7f6e2 /v4.0/src/TOOLS/BLD/INC/STDLIB.H
parentMerge pull request #430 from jpbaltazar/typoptbr (diff)
downloadms-dos-main.tar.gz
ms-dos-main.tar.xz
ms-dos-main.zip
MZ is back!HEADmain
Diffstat (limited to 'v4.0/src/TOOLS/BLD/INC/STDLIB.H')
-rw-r--r--v4.0/src/TOOLS/BLD/INC/STDLIB.H151
1 files changed, 151 insertions, 0 deletions
diff --git a/v4.0/src/TOOLS/BLD/INC/STDLIB.H b/v4.0/src/TOOLS/BLD/INC/STDLIB.H
new file mode 100644
index 0000000..5fb67d7
--- /dev/null
+++ b/v4.0/src/TOOLS/BLD/INC/STDLIB.H
@@ -0,0 +1,151 @@
1/***
2*stdlib.h - declarations/definitions for commonly used library functions
3*
4* Copyright (c) 1985-1988, 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 (ctype.h in the case of toupper/tolower) for other reasons.
11* [ANSI]
12*
13*******************************************************************************/
14
15
16#ifndef _SIZE_T_DEFINED
17typedef unsigned int size_t;
18#define _SIZE_T_DEFINED
19#endif
20
21#ifndef NO_EXT_KEYS /* extensions enabled */
22 #define _CDECL cdecl
23 #define _NEAR near
24#else /* extensions not enabled */
25 #define _CDECL
26 #define _NEAR
27#endif /* NO_EXT_KEYS */
28
29
30/* definition of the return type for the onexit() function */
31
32#ifndef _ONEXIT_T_DEFINED
33typedef int (_CDECL * _CDECL onexit_t)();
34#define _ONEXIT_T_DEFINED
35#endif
36
37
38/* Data structure definitions for div and ldiv runtimes. */
39
40#ifndef _DIV_T_DEFINED
41
42typedef struct {
43 int quot;
44 int rem;
45} div_t;
46
47typedef struct {
48 long quot;
49 long rem;
50} ldiv_t;
51
52#define _DIV_T_DEFINED
53#endif
54
55/* Maximum value that can be returned by the rand function. */
56
57#define RAND_MAX 0x7fff
58
59
60/* min and max macros */
61
62#define max(a,b) (((a) > (b)) ? (a) : (b))
63#define min(a,b) (((a) < (b)) ? (a) : (b))
64
65
66/* sizes for buffers used by the _makepath() and _splitpath() functions.
67 * note that the sizes include space for 0-terminator
68 */
69
70#define _MAX_PATH 144 /* max. length of full pathname */
71#define _MAX_DRIVE 3 /* max. length of drive component */
72#define _MAX_DIR 130 /* max. length of path component */
73#define _MAX_FNAME 9 /* max. length of file name component */
74#define _MAX_EXT 5 /* max. length of extension component */
75
76/* external variable declarations */
77
78extern int _NEAR _CDECL errno; /* XENIX style error number */
79extern int _NEAR _CDECL _doserrno; /* MS-DOS system error value */
80extern char * _NEAR _CDECL sys_errlist[]; /* perror error message table */
81extern int _NEAR _CDECL sys_nerr; /* # of entries in sys_errlist table */
82
83extern char ** _NEAR _CDECL environ; /* pointer to environment table */
84
85extern unsigned int _NEAR _CDECL _psp; /* Program Segment Prefix */
86
87extern int _NEAR _CDECL _fmode; /* default file translation mode */
88
89/* DOS major/minor version numbers */
90
91extern unsigned char _NEAR _CDECL _osmajor;
92extern unsigned char _NEAR _CDECL _osminor;
93
94#define DOS_MODE 0 /* Real Address Mode */
95#define OS2_MODE 1 /* Protected Address Mode */
96
97extern unsigned char _NEAR _CDECL _osmode;
98
99
100/* function prototypes */
101
102double _CDECL atof(const char *);
103double _CDECL strtod(const char *, char * *);
104ldiv_t _CDECL ldiv(long, long);
105
106void _CDECL abort(void);
107int _CDECL abs(int);
108int _CDECL atexit(void (_CDECL *)(void));
109int _CDECL atoi(const char *);
110long _CDECL atol(const char *);
111void * _CDECL bsearch(const void *, const void *, size_t, size_t, int (_CDECL *)(const void *, const void *));
112void * _CDECL calloc(size_t, size_t);
113div_t _CDECL div(int, int);
114char * _CDECL ecvt(double, int, int *, int *);
115void _CDECL exit(int);
116void _CDECL _exit(int);
117char * _CDECL fcvt(double, int, int *, int *);
118void _CDECL free(void *);
119char * _CDECL gcvt(double, int, char *);
120char * _CDECL getenv(const char *);
121char * _CDECL itoa(int, char *, int);
122long _CDECL labs(long);
123unsigned long _CDECL _lrotl(unsigned long, int);
124unsigned long _CDECL _lrotr(unsigned long, int);
125char * _CDECL ltoa(long, char *, int);
126void _CDECL _makepath(char *, char *, char *, char *, char *);
127void * _CDECL malloc(size_t);
128onexit_t _CDECL onexit(onexit_t);
129void _CDECL perror(const char *);
130int _CDECL putenv(char *);
131void _CDECL qsort(void *, size_t, size_t, int (_CDECL *)(const void *, const void *));
132unsigned int _CDECL _rotl(unsigned int, int);
133unsigned int _CDECL _rotr(unsigned int, int);
134int _CDECL rand(void);
135void * _CDECL realloc(void *, size_t);
136void _CDECL _searchenv(char *, char *, char *);
137void _CDECL _splitpath(char *, char *, char *, char *, char *);
138void _CDECL srand(unsigned int);
139long _CDECL strtol(const char *, char * *, int);
140unsigned long _CDECL strtoul(const char *, char * *, int);
141void _CDECL swab(char *, char *, int);
142int _CDECL system(const char *);
143char * _CDECL ultoa(unsigned long, char *, int);
144
145#ifndef tolower /* tolower has been undefined - use function */
146int _CDECL tolower(int);
147#endif /* tolower */
148
149#ifndef toupper /* toupper has been undefined - use function */
150int _CDECL toupper(int);
151#endif /* toupper */