standalone-ruby 1.4.2 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +32 -22
- data/lib/data/bat-cmd/default_bat_cmd.txt +9 -9
- data/lib/data/c_compilers/tcc/include/_mingw.h +54 -0
- data/lib/data/c_compilers/tcc/include/assert.h +71 -0
- data/lib/data/c_compilers/tcc/include/conio.h +159 -0
- data/lib/data/c_compilers/tcc/include/ctype.h +232 -0
- data/lib/data/c_compilers/tcc/include/dir.h +26 -0
- data/lib/data/c_compilers/tcc/include/direct.h +95 -0
- data/lib/data/c_compilers/tcc/include/dirent.h +96 -0
- data/lib/data/c_compilers/tcc/include/dos.h +110 -0
- data/lib/data/c_compilers/tcc/include/errno.h +117 -0
- data/lib/data/c_compilers/tcc/include/excpt.h +20 -0
- data/lib/data/c_compilers/tcc/include/fcntl.h +135 -0
- data/lib/data/c_compilers/tcc/include/fenv.h +85 -0
- data/lib/data/c_compilers/tcc/include/float.h +224 -0
- data/lib/data/c_compilers/tcc/include/inttypes.h +275 -0
- data/lib/data/c_compilers/tcc/include/io.h +296 -0
- data/lib/data/c_compilers/tcc/include/limits.h +115 -0
- data/lib/data/c_compilers/tcc/include/locale.h +100 -0
- data/lib/data/c_compilers/tcc/include/malloc.h +87 -0
- data/lib/data/c_compilers/tcc/include/math.h +438 -0
- data/lib/data/c_compilers/tcc/include/mem.h +8 -0
- data/lib/data/c_compilers/tcc/include/memory.h +9 -0
- data/lib/data/c_compilers/tcc/include/process.h +158 -0
- data/lib/data/c_compilers/tcc/include/setjmp.h +72 -0
- data/lib/data/c_compilers/tcc/include/share.h +44 -0
- data/lib/data/c_compilers/tcc/include/signal.h +111 -0
- data/lib/data/c_compilers/tcc/include/stdarg.h +16 -0
- data/lib/data/c_compilers/tcc/include/stdbool.h +10 -0
- data/lib/data/c_compilers/tcc/include/stddef.h +26 -0
- data/lib/data/c_compilers/tcc/include/stdint.h +184 -0
- data/lib/data/c_compilers/tcc/include/stdio.h +413 -0
- data/lib/data/c_compilers/tcc/include/stdlib.h +482 -0
- data/lib/data/c_compilers/tcc/include/string.h +206 -0
- data/lib/data/c_compilers/tcc/include/sys/fcntl.h +8 -0
- data/lib/data/c_compilers/tcc/include/sys/file.h +9 -0
- data/lib/data/c_compilers/tcc/include/sys/locking.h +52 -0
- data/lib/data/c_compilers/tcc/include/sys/stat.h +190 -0
- data/lib/data/c_compilers/tcc/include/sys/time.h +3 -0
- data/lib/data/c_compilers/tcc/include/sys/timeb.h +82 -0
- data/lib/data/c_compilers/tcc/include/sys/types.h +118 -0
- data/lib/data/c_compilers/tcc/include/sys/unistd.h +9 -0
- data/lib/data/c_compilers/tcc/include/sys/utime.h +89 -0
- data/lib/data/c_compilers/tcc/include/tchar.h +367 -0
- data/lib/data/c_compilers/tcc/include/time.h +219 -0
- data/lib/data/c_compilers/tcc/include/unistd.h +10 -0
- data/lib/data/c_compilers/tcc/include/values.h +4 -0
- data/lib/data/c_compilers/tcc/include/varargs.h +11 -0
- data/lib/data/c_compilers/tcc/include/wchar.h +318 -0
- data/lib/data/c_compilers/tcc/include/wctype.h +127 -0
- data/lib/data/c_compilers/tcc/include/winapi/basetsd.h +119 -0
- data/lib/data/c_compilers/tcc/include/winapi/basetyps.h +144 -0
- data/lib/data/c_compilers/tcc/include/winapi/winbase.h +1852 -0
- data/lib/data/c_compilers/tcc/include/winapi/wincon.h +207 -0
- data/lib/data/c_compilers/tcc/include/winapi/windef.h +240 -0
- data/lib/data/c_compilers/tcc/include/winapi/windows.h +176 -0
- data/lib/data/c_compilers/tcc/include/winapi/winerror.h +1054 -0
- data/lib/data/c_compilers/tcc/include/winapi/wingdi.h +2843 -0
- data/lib/data/c_compilers/tcc/include/winapi/winnetwk.h +346 -0
- data/lib/data/c_compilers/tcc/include/winapi/winnls.h +651 -0
- data/lib/data/c_compilers/tcc/include/winapi/winnt.h +2667 -0
- data/lib/data/c_compilers/tcc/include/winapi/winreg.h +159 -0
- data/lib/data/c_compilers/tcc/include/winapi/winsvc.h +309 -0
- data/lib/data/c_compilers/tcc/include/winapi/winuser.h +3472 -0
- data/lib/data/c_compilers/tcc/include/winapi/winver.h +133 -0
- data/lib/data/c_compilers/tcc/lib/gdi32.def +337 -0
- data/lib/data/c_compilers/tcc/lib/kernel32.def +763 -0
- data/lib/data/c_compilers/tcc/lib/libtcc1.a +0 -0
- data/lib/data/c_compilers/tcc/lib/msvcrt.def +782 -0
- data/lib/data/c_compilers/tcc/lib/user32.def +654 -0
- data/lib/data/c_compilers/tcc/tcc.exe +0 -0
- data/lib/data/exe_templates/launcher_stub.c +30 -0
- data/lib/data/exe_templates/launcher_stub.cpp +31 -0
- data/lib/data/launcher_templates/vbs/default_vbs.txt +7 -0
- data/lib/data/launcher_templates/vbs/vbs_gui.txt +8 -0
- data/lib/data/resource_files/default.rc +17 -0
- data/lib/data/tcc/include/_mingw.h +54 -54
- data/lib/data/tcc/include/assert.h +71 -71
- data/lib/data/tcc/include/conio.h +159 -159
- data/lib/data/tcc/include/ctype.h +232 -232
- data/lib/data/tcc/include/dir.h +26 -26
- data/lib/data/tcc/include/direct.h +95 -95
- data/lib/data/tcc/include/dirent.h +96 -96
- data/lib/data/tcc/include/dos.h +110 -110
- data/lib/data/tcc/include/errno.h +117 -117
- data/lib/data/tcc/include/excpt.h +20 -20
- data/lib/data/tcc/include/fcntl.h +135 -135
- data/lib/data/tcc/include/fenv.h +85 -85
- data/lib/data/tcc/include/float.h +224 -224
- data/lib/data/tcc/include/inttypes.h +275 -275
- data/lib/data/tcc/include/io.h +296 -296
- data/lib/data/tcc/include/limits.h +115 -115
- data/lib/data/tcc/include/locale.h +100 -100
- data/lib/data/tcc/include/malloc.h +87 -87
- data/lib/data/tcc/include/math.h +438 -438
- data/lib/data/tcc/include/mem.h +8 -8
- data/lib/data/tcc/include/memory.h +9 -9
- data/lib/data/tcc/include/process.h +158 -158
- data/lib/data/tcc/include/setjmp.h +72 -72
- data/lib/data/tcc/include/share.h +44 -44
- data/lib/data/tcc/include/signal.h +111 -111
- data/lib/data/tcc/include/stdarg.h +16 -16
- data/lib/data/tcc/include/stdbool.h +10 -10
- data/lib/data/tcc/include/stddef.h +26 -26
- data/lib/data/tcc/include/stdint.h +184 -184
- data/lib/data/tcc/include/stdio.h +413 -413
- data/lib/data/tcc/include/stdlib.h +482 -482
- data/lib/data/tcc/include/string.h +206 -206
- data/lib/data/tcc/include/sys/fcntl.h +8 -8
- data/lib/data/tcc/include/sys/file.h +9 -9
- data/lib/data/tcc/include/sys/locking.h +52 -52
- data/lib/data/tcc/include/sys/stat.h +190 -190
- data/lib/data/tcc/include/sys/time.h +3 -3
- data/lib/data/tcc/include/sys/timeb.h +82 -82
- data/lib/data/tcc/include/sys/types.h +118 -118
- data/lib/data/tcc/include/sys/unistd.h +9 -9
- data/lib/data/tcc/include/sys/utime.h +89 -89
- data/lib/data/tcc/include/tchar.h +367 -367
- data/lib/data/tcc/include/time.h +219 -219
- data/lib/data/tcc/include/unistd.h +10 -10
- data/lib/data/tcc/include/values.h +4 -4
- data/lib/data/tcc/include/varargs.h +11 -11
- data/lib/data/tcc/include/wchar.h +318 -318
- data/lib/data/tcc/include/wctype.h +127 -127
- data/lib/data/tcc/include/winapi/basetsd.h +119 -119
- data/lib/data/tcc/include/winapi/basetyps.h +144 -144
- data/lib/data/tcc/include/winapi/winbase.h +1852 -1852
- data/lib/data/tcc/include/winapi/wincon.h +207 -207
- data/lib/data/tcc/include/winapi/windef.h +240 -240
- data/lib/data/tcc/include/winapi/windows.h +176 -176
- data/lib/data/tcc/include/winapi/winerror.h +1054 -1054
- data/lib/data/tcc/include/winapi/wingdi.h +2843 -2843
- data/lib/data/tcc/include/winapi/winnetwk.h +346 -346
- data/lib/data/tcc/include/winapi/winnls.h +651 -651
- data/lib/data/tcc/include/winapi/winnt.h +2667 -2667
- data/lib/data/tcc/include/winapi/winreg.h +159 -159
- data/lib/data/tcc/include/winapi/winsvc.h +309 -309
- data/lib/data/tcc/include/winapi/winuser.h +3472 -3472
- data/lib/data/tcc/include/winapi/winver.h +133 -133
- data/lib/data/tcc/lib/gdi32.def +337 -337
- data/lib/data/tcc/lib/kernel32.def +763 -763
- data/lib/data/tcc/lib/msvcrt.def +782 -782
- data/lib/data/tcc/lib/user32.def +654 -654
- data/lib/data/vbs/default_vbs.txt +7 -7
- data/lib/data/vbs/vbs_gui.txt +8 -8
- data/lib/displayer.rb +66 -0
- data/lib/exe_packer.rb +82 -0
- data/lib/launcher.rb +84 -0
- data/lib/launcher_handler.rb +53 -0
- data/lib/logger_helper.rb +24 -0
- data/lib/parameter_parser.rb +210 -0
- data/lib/ruby_copy.rb +26 -0
- data/lib/sfx_generator.rb +11 -0
- data/lib/standalone_ruby.rb +1 -1
- data/lib/utils/launcher_handler.rb +110 -110
- data/lib/version/version.rb +1 -1
- metadata +85 -3
@@ -1,482 +1,482 @@
|
|
1
|
-
/*
|
2
|
-
* stdlib.h
|
3
|
-
*
|
4
|
-
* Definitions for common types, variables, and functions.
|
5
|
-
*
|
6
|
-
* This file is part of the Mingw32 package.
|
7
|
-
*
|
8
|
-
* Contributors:
|
9
|
-
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
|
10
|
-
*
|
11
|
-
* THIS SOFTWARE IS NOT COPYRIGHTED
|
12
|
-
*
|
13
|
-
* This source code is offered for use in the public domain. You may
|
14
|
-
* use, modify or distribute it freely.
|
15
|
-
*
|
16
|
-
* This code is distributed in the hope that it will be useful but
|
17
|
-
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
18
|
-
* DISCLAIMED. This includes but is not limited to warranties of
|
19
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
20
|
-
*
|
21
|
-
* $Revision: 1.2 $
|
22
|
-
* $Author: bellard $
|
23
|
-
* $Date: 2005/04/17 13:14:29 $
|
24
|
-
*
|
25
|
-
*/
|
26
|
-
|
27
|
-
#ifndef _STDLIB_H_
|
28
|
-
#define _STDLIB_H_
|
29
|
-
|
30
|
-
/* All the headers include this file. */
|
31
|
-
#include <_mingw.h>
|
32
|
-
|
33
|
-
|
34
|
-
#define __need_size_t
|
35
|
-
#define __need_wchar_t
|
36
|
-
#define __need_NULL
|
37
|
-
#ifndef RC_INVOKED
|
38
|
-
#include <stddef.h>
|
39
|
-
#endif /* RC_INVOKED */
|
40
|
-
|
41
|
-
/*
|
42
|
-
* RAND_MAX is the maximum value that may be returned by rand.
|
43
|
-
* The minimum is zero.
|
44
|
-
*/
|
45
|
-
#define RAND_MAX 0x7FFF
|
46
|
-
|
47
|
-
/*
|
48
|
-
* These values may be used as exit status codes.
|
49
|
-
*/
|
50
|
-
#define EXIT_SUCCESS 0
|
51
|
-
#define EXIT_FAILURE 1
|
52
|
-
|
53
|
-
/*
|
54
|
-
* Definitions for path name functions.
|
55
|
-
* NOTE: All of these values have simply been chosen to be conservatively high.
|
56
|
-
* Remember that with long file names we can no longer depend on
|
57
|
-
* extensions being short.
|
58
|
-
*/
|
59
|
-
#ifndef __STRICT_ANSI__
|
60
|
-
|
61
|
-
#ifndef MAX_PATH
|
62
|
-
#define MAX_PATH (260)
|
63
|
-
#endif
|
64
|
-
|
65
|
-
#define _MAX_PATH MAX_PATH
|
66
|
-
#define _MAX_DRIVE (3)
|
67
|
-
#define _MAX_DIR 256
|
68
|
-
#define _MAX_FNAME 256
|
69
|
-
#define _MAX_EXT 256
|
70
|
-
|
71
|
-
#endif /* Not __STRICT_ANSI__ */
|
72
|
-
|
73
|
-
|
74
|
-
#ifndef RC_INVOKED
|
75
|
-
|
76
|
-
#ifdef __cplusplus
|
77
|
-
extern "C" {
|
78
|
-
#endif
|
79
|
-
|
80
|
-
/*
|
81
|
-
* This seems like a convenient place to declare these variables, which
|
82
|
-
* give programs using WinMain (or main for that matter) access to main-ish
|
83
|
-
* argc and argv. environ is a pointer to a table of environment variables.
|
84
|
-
* NOTE: Strings in _argv and environ are ANSI strings.
|
85
|
-
*/
|
86
|
-
extern int _argc;
|
87
|
-
extern char** _argv;
|
88
|
-
|
89
|
-
/* imports from runtime dll of the above variables */
|
90
|
-
#ifdef __MSVCRT__
|
91
|
-
|
92
|
-
extern int* __p___argc(void);
|
93
|
-
extern char*** __p___argv(void);
|
94
|
-
extern wchar_t*** __p___wargv(void);
|
95
|
-
|
96
|
-
#define __argc (*__p___argc())
|
97
|
-
#define __argv (*__p___argv())
|
98
|
-
#define __wargv (*__p___wargv())
|
99
|
-
|
100
|
-
#else /* !MSVCRT */
|
101
|
-
|
102
|
-
#ifndef __DECLSPEC_SUPPORTED
|
103
|
-
|
104
|
-
extern int* __imp___argc_dll;
|
105
|
-
extern char*** __imp___argv_dll;
|
106
|
-
#define __argc (*__imp___argc_dll)
|
107
|
-
#define __argv (*__imp___argv_dll)
|
108
|
-
|
109
|
-
#else /* __DECLSPEC_SUPPORTED */
|
110
|
-
|
111
|
-
__MINGW_IMPORT int __argc_dll;
|
112
|
-
__MINGW_IMPORT char** __argv_dll;
|
113
|
-
#define __argc __argc_dll
|
114
|
-
#define __argv __argv_dll
|
115
|
-
|
116
|
-
#endif /* __DECLSPEC_SUPPORTED */
|
117
|
-
|
118
|
-
#endif /* __MSVCRT */
|
119
|
-
|
120
|
-
/*
|
121
|
-
* Also defined in ctype.h.
|
122
|
-
*/
|
123
|
-
|
124
|
-
#ifndef MB_CUR_MAX
|
125
|
-
# ifdef __MSVCRT__
|
126
|
-
# define MB_CUR_MAX __mb_cur_max
|
127
|
-
__MINGW_IMPORT int __mb_cur_max;
|
128
|
-
# else /* not __MSVCRT */
|
129
|
-
# define MB_CUR_MAX __mb_cur_max_dll
|
130
|
-
__MINGW_IMPORT int __mb_cur_max_dll;
|
131
|
-
# endif /* not __MSVCRT */
|
132
|
-
#endif /* MB_CUR_MAX */
|
133
|
-
|
134
|
-
/*
|
135
|
-
* MS likes to declare errno in stdlib.h as well.
|
136
|
-
*/
|
137
|
-
|
138
|
-
#ifdef _UWIN
|
139
|
-
#undef errno
|
140
|
-
extern int errno;
|
141
|
-
#else
|
142
|
-
int* _errno(void);
|
143
|
-
#define errno (*_errno())
|
144
|
-
#endif
|
145
|
-
int* __doserrno(void);
|
146
|
-
#define _doserrno (*__doserrno())
|
147
|
-
|
148
|
-
/*
|
149
|
-
* Use environ from the DLL, not as a global.
|
150
|
-
*/
|
151
|
-
|
152
|
-
#ifdef __MSVCRT__
|
153
|
-
extern char *** __p__environ(void);
|
154
|
-
extern wchar_t *** __p__wenviron(void);
|
155
|
-
# define _environ (*__p__environ())
|
156
|
-
# define _wenviron (*__p__wenviron())
|
157
|
-
#else /* ! __MSVCRT__ */
|
158
|
-
# ifndef __DECLSPEC_SUPPORTED
|
159
|
-
extern char *** __imp__environ_dll;
|
160
|
-
# define _environ (*__imp__environ_dll)
|
161
|
-
# else /* __DECLSPEC_SUPPORTED */
|
162
|
-
__MINGW_IMPORT char ** _environ_dll;
|
163
|
-
# define _environ _environ_dll
|
164
|
-
# endif /* __DECLSPEC_SUPPORTED */
|
165
|
-
#endif /* ! __MSVCRT__ */
|
166
|
-
|
167
|
-
#define environ _environ
|
168
|
-
|
169
|
-
#ifdef __MSVCRT__
|
170
|
-
/* One of the MSVCRTxx libraries */
|
171
|
-
|
172
|
-
#ifndef __DECLSPEC_SUPPORTED
|
173
|
-
extern int* __imp__sys_nerr;
|
174
|
-
# define sys_nerr (*__imp__sys_nerr)
|
175
|
-
#else /* __DECLSPEC_SUPPORTED */
|
176
|
-
__MINGW_IMPORT int _sys_nerr;
|
177
|
-
# ifndef _UWIN
|
178
|
-
# define sys_nerr _sys_nerr
|
179
|
-
# endif /* _UWIN */
|
180
|
-
#endif /* __DECLSPEC_SUPPORTED */
|
181
|
-
|
182
|
-
#else /* ! __MSVCRT__ */
|
183
|
-
|
184
|
-
/* CRTDLL run time library */
|
185
|
-
|
186
|
-
#ifndef __DECLSPEC_SUPPORTED
|
187
|
-
extern int* __imp__sys_nerr_dll;
|
188
|
-
# define sys_nerr (*__imp__sys_nerr_dll)
|
189
|
-
#else /* __DECLSPEC_SUPPORTED */
|
190
|
-
__MINGW_IMPORT int _sys_nerr_dll;
|
191
|
-
# define sys_nerr _sys_nerr_dll
|
192
|
-
#endif /* __DECLSPEC_SUPPORTED */
|
193
|
-
|
194
|
-
#endif /* ! __MSVCRT__ */
|
195
|
-
|
196
|
-
#ifndef __DECLSPEC_SUPPORTED
|
197
|
-
extern char*** __imp__sys_errlist;
|
198
|
-
#define sys_errlist (*__imp__sys_errlist)
|
199
|
-
#else /* __DECLSPEC_SUPPORTED */
|
200
|
-
__MINGW_IMPORT char* _sys_errlist[];
|
201
|
-
#ifndef _UWIN
|
202
|
-
#define sys_errlist _sys_errlist
|
203
|
-
#endif /* _UWIN */
|
204
|
-
#endif /* __DECLSPEC_SUPPORTED */
|
205
|
-
|
206
|
-
/*
|
207
|
-
* OS version and such constants.
|
208
|
-
*/
|
209
|
-
#ifndef __STRICT_ANSI__
|
210
|
-
|
211
|
-
#ifdef __MSVCRT__
|
212
|
-
/* msvcrtxx.dll */
|
213
|
-
|
214
|
-
extern unsigned int* __p__osver(void);
|
215
|
-
extern unsigned int* __p__winver(void);
|
216
|
-
extern unsigned int* __p__winmajor(void);
|
217
|
-
extern unsigned int* __p__winminor(void);
|
218
|
-
|
219
|
-
#define _osver (*__p__osver())
|
220
|
-
#define _winver (*__p__winver())
|
221
|
-
#define _winmajor (*__p__winmajor())
|
222
|
-
#define _winminor (*__p__winminor())
|
223
|
-
|
224
|
-
#else
|
225
|
-
/* Not msvcrtxx.dll, thus crtdll.dll */
|
226
|
-
|
227
|
-
#ifndef __DECLSPEC_SUPPORTED
|
228
|
-
|
229
|
-
extern unsigned int* _imp___osver_dll;
|
230
|
-
extern unsigned int* _imp___winver_dll;
|
231
|
-
extern unsigned int* _imp___winmajor_dll;
|
232
|
-
extern unsigned int* _imp___winminor_dll;
|
233
|
-
|
234
|
-
#define _osver (*_imp___osver_dll)
|
235
|
-
#define _winver (*_imp___winver_dll)
|
236
|
-
#define _winmajor (*_imp___winmajor_dll)
|
237
|
-
#define _winminor (*_imp___winminor_dll)
|
238
|
-
|
239
|
-
#else /* __DECLSPEC_SUPPORTED */
|
240
|
-
|
241
|
-
__MINGW_IMPORT unsigned int _osver_dll;
|
242
|
-
__MINGW_IMPORT unsigned int _winver_dll;
|
243
|
-
__MINGW_IMPORT unsigned int _winmajor_dll;
|
244
|
-
__MINGW_IMPORT unsigned int _winminor_dll;
|
245
|
-
|
246
|
-
#define _osver _osver_dll
|
247
|
-
#define _winver _winver_dll
|
248
|
-
#define _winmajor _winmajor_dll
|
249
|
-
#define _winminor _winminor_dll
|
250
|
-
|
251
|
-
#endif /* __DECLSPEC_SUPPORTED */
|
252
|
-
|
253
|
-
#endif
|
254
|
-
|
255
|
-
#if defined __MSVCRT__
|
256
|
-
/* although the _pgmptr is exported as DATA,
|
257
|
-
* be safe and use the access function __p__pgmptr() to get it. */
|
258
|
-
char** __p__pgmptr(void);
|
259
|
-
#define _pgmptr (*__p__pgmptr())
|
260
|
-
wchar_t** __p__wpgmptr(void);
|
261
|
-
#define _wpgmptr (*__p__wpgmptr())
|
262
|
-
#else /* ! __MSVCRT__ */
|
263
|
-
# ifndef __DECLSPEC_SUPPORTED
|
264
|
-
extern char** __imp__pgmptr_dll;
|
265
|
-
# define _pgmptr (*__imp__pgmptr_dll)
|
266
|
-
# else /* __DECLSPEC_SUPPORTED */
|
267
|
-
__MINGW_IMPORT char* _pgmptr_dll;
|
268
|
-
# define _pgmptr _pgmptr_dll
|
269
|
-
# endif /* __DECLSPEC_SUPPORTED */
|
270
|
-
/* no wide version in CRTDLL */
|
271
|
-
#endif /* __MSVCRT__ */
|
272
|
-
|
273
|
-
#endif /* Not __STRICT_ANSI__ */
|
274
|
-
|
275
|
-
#ifdef __GNUC__
|
276
|
-
#define _ATTRIB_NORETURN __attribute__ ((noreturn))
|
277
|
-
#else /* Not __GNUC__ */
|
278
|
-
#define _ATTRIB_NORETURN
|
279
|
-
#endif /* __GNUC__ */
|
280
|
-
|
281
|
-
double atof (const char*);
|
282
|
-
int atoi (const char*);
|
283
|
-
long atol (const char*);
|
284
|
-
int _wtoi (const wchar_t *);
|
285
|
-
long _wtol (const wchar_t *);
|
286
|
-
|
287
|
-
double strtod (const char*, char**);
|
288
|
-
#if !defined __NO_ISOCEXT /* extern stubs in static libmingwex.a */
|
289
|
-
extern __inline__ float strtof (const char *nptr, char **endptr)
|
290
|
-
{ return (strtod (nptr, endptr));}
|
291
|
-
#endif /* __NO_ISOCEXT */
|
292
|
-
|
293
|
-
long strtol (const char*, char**, int);
|
294
|
-
unsigned long strtoul (const char*, char**, int);
|
295
|
-
|
296
|
-
#ifndef _WSTDLIB_DEFINED
|
297
|
-
/* also declared in wchar.h */
|
298
|
-
double wcstod (const wchar_t*, wchar_t**);
|
299
|
-
#if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */
|
300
|
-
extern __inline__ float wcstof( const wchar_t *nptr, wchar_t **endptr)
|
301
|
-
{ return (wcstod(nptr, endptr)); }
|
302
|
-
#endif /* __NO_ISOCEXT */
|
303
|
-
|
304
|
-
long wcstol (const wchar_t*, wchar_t**, int);
|
305
|
-
unsigned long wcstoul (const wchar_t*, wchar_t**, int);
|
306
|
-
#define _WSTDLIB_DEFINED
|
307
|
-
#endif
|
308
|
-
|
309
|
-
size_t wcstombs (char*, const wchar_t*, size_t);
|
310
|
-
int wctomb (char*, wchar_t);
|
311
|
-
|
312
|
-
int mblen (const char*, size_t);
|
313
|
-
size_t mbstowcs (wchar_t*, const char*, size_t);
|
314
|
-
int mbtowc (wchar_t*, const char*, size_t);
|
315
|
-
|
316
|
-
int rand (void);
|
317
|
-
void srand (unsigned int);
|
318
|
-
|
319
|
-
void* calloc (size_t, size_t);
|
320
|
-
void* malloc (size_t);
|
321
|
-
void* realloc (void*, size_t);
|
322
|
-
void free (void*);
|
323
|
-
|
324
|
-
void abort (void) _ATTRIB_NORETURN;
|
325
|
-
void exit (int) _ATTRIB_NORETURN;
|
326
|
-
int atexit (void (*)(void));
|
327
|
-
|
328
|
-
int system (const char*);
|
329
|
-
char* getenv (const char*);
|
330
|
-
|
331
|
-
void* bsearch (const void*, const void*, size_t, size_t,
|
332
|
-
int (*)(const void*, const void*));
|
333
|
-
void qsort (const void*, size_t, size_t,
|
334
|
-
int (*)(const void*, const void*));
|
335
|
-
|
336
|
-
int abs (int);
|
337
|
-
long labs (long);
|
338
|
-
|
339
|
-
/*
|
340
|
-
* div_t and ldiv_t are structures used to return the results of div and
|
341
|
-
* ldiv.
|
342
|
-
*
|
343
|
-
* NOTE: div and ldiv appear not to work correctly unless
|
344
|
-
* -fno-pcc-struct-return is specified. This is included in the
|
345
|
-
* mingw32 specs file.
|
346
|
-
*/
|
347
|
-
typedef struct { int quot, rem; } div_t;
|
348
|
-
typedef struct { long quot, rem; } ldiv_t;
|
349
|
-
|
350
|
-
div_t div (int, int);
|
351
|
-
ldiv_t ldiv (long, long);
|
352
|
-
|
353
|
-
#ifndef __STRICT_ANSI__
|
354
|
-
|
355
|
-
/*
|
356
|
-
* NOTE: Officially the three following functions are obsolete. The Win32 API
|
357
|
-
* functions SetErrorMode, Beep and Sleep are their replacements.
|
358
|
-
*/
|
359
|
-
void _beep (unsigned int, unsigned int);
|
360
|
-
void _seterrormode (int);
|
361
|
-
void _sleep (unsigned long);
|
362
|
-
|
363
|
-
void _exit (int) _ATTRIB_NORETURN;
|
364
|
-
#if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */
|
365
|
-
/* C99 function name */
|
366
|
-
void _Exit(int) _ATTRIB_NORETURN; /* Declare to get noreturn attribute. */
|
367
|
-
extern __inline__ void _Exit(int status)
|
368
|
-
{ _exit(status); }
|
369
|
-
#endif
|
370
|
-
/* _onexit is MS extension. Use atexit for portability. */
|
371
|
-
typedef int (* _onexit_t)(void);
|
372
|
-
_onexit_t _onexit( _onexit_t );
|
373
|
-
|
374
|
-
int _putenv (const char*);
|
375
|
-
void _searchenv (const char*, const char*, char*);
|
376
|
-
|
377
|
-
|
378
|
-
char* _ecvt (double, int, int*, int*);
|
379
|
-
char* _fcvt (double, int, int*, int*);
|
380
|
-
char* _gcvt (double, int, char*);
|
381
|
-
|
382
|
-
void _makepath (char*, const char*, const char*, const char*, const char*);
|
383
|
-
void _splitpath (const char*, char*, char*, char*, char*);
|
384
|
-
char* _fullpath (char*, const char*, size_t);
|
385
|
-
|
386
|
-
|
387
|
-
char* _itoa (int, char*, int);
|
388
|
-
char* _ltoa (long, char*, int);
|
389
|
-
char* _ultoa(unsigned long, char*, int);
|
390
|
-
wchar_t* _itow (int, wchar_t*, int);
|
391
|
-
wchar_t* _ltow (long, wchar_t*, int);
|
392
|
-
wchar_t* _ultow (unsigned long, wchar_t*, int);
|
393
|
-
|
394
|
-
#ifdef __MSVCRT__
|
395
|
-
__int64 _atoi64(const char *);
|
396
|
-
char* _i64toa(__int64, char *, int);
|
397
|
-
char* _ui64toa(unsigned __int64, char *, int);
|
398
|
-
__int64 _wtoi64(const wchar_t *);
|
399
|
-
wchar_t* _i64tow(__int64, wchar_t *, int);
|
400
|
-
wchar_t* _ui64tow(unsigned __int64, wchar_t *, int);
|
401
|
-
|
402
|
-
wchar_t* _wgetenv(const wchar_t*);
|
403
|
-
int _wputenv(const wchar_t*);
|
404
|
-
void _wsearchenv(const wchar_t*, const wchar_t*, wchar_t*);
|
405
|
-
void _wmakepath(wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*);
|
406
|
-
void _wsplitpath (const wchar_t*, wchar_t*, wchar_t*, wchar_t*, wchar_t*);
|
407
|
-
wchar_t* _wfullpath (wchar_t*, const wchar_t*, size_t);
|
408
|
-
#endif
|
409
|
-
|
410
|
-
#ifndef _NO_OLDNAMES
|
411
|
-
|
412
|
-
int putenv (const char*);
|
413
|
-
void searchenv (const char*, const char*, char*);
|
414
|
-
|
415
|
-
char* itoa (int, char*, int);
|
416
|
-
char* ltoa (long, char*, int);
|
417
|
-
|
418
|
-
#ifndef _UWIN
|
419
|
-
char* ecvt (double, int, int*, int*);
|
420
|
-
char* fcvt (double, int, int*, int*);
|
421
|
-
char* gcvt (double, int, char*);
|
422
|
-
#endif /* _UWIN */
|
423
|
-
#endif /* Not _NO_OLDNAMES */
|
424
|
-
|
425
|
-
#endif /* Not __STRICT_ANSI__ */
|
426
|
-
|
427
|
-
/* C99 names */
|
428
|
-
|
429
|
-
#if !defined __NO_ISOCEXT /* externs in static libmingwex.a */
|
430
|
-
|
431
|
-
typedef struct { long long quot, rem; } lldiv_t;
|
432
|
-
|
433
|
-
lldiv_t lldiv (long long, long long);
|
434
|
-
|
435
|
-
extern __inline__ long long llabs(long long _j)
|
436
|
-
{return (_j >= 0 ? _j : -_j);}
|
437
|
-
|
438
|
-
long long strtoll (const char* __restrict__, char** __restrict, int);
|
439
|
-
unsigned long long strtoull (const char* __restrict__, char** __restrict__, int);
|
440
|
-
|
441
|
-
#if defined (__MSVCRT__) /* these are stubs for MS _i64 versions */
|
442
|
-
long long atoll (const char *);
|
443
|
-
|
444
|
-
#if !defined (__STRICT_ANSI__)
|
445
|
-
long long wtoll(const wchar_t *);
|
446
|
-
char* lltoa(long long, char *, int);
|
447
|
-
char* ulltoa(unsigned long long , char *, int);
|
448
|
-
wchar_t* lltow(long long, wchar_t *, int);
|
449
|
-
wchar_t* ulltow(unsigned long long, wchar_t *, int);
|
450
|
-
|
451
|
-
/* inline using non-ansi functions */
|
452
|
-
extern __inline__ long long atoll (const char * _c)
|
453
|
-
{ return _atoi64 (_c); }
|
454
|
-
extern __inline__ char* lltoa(long long _n, char * _c, int _i)
|
455
|
-
{ return _i64toa (_n, _c, _i); }
|
456
|
-
extern __inline__ char* ulltoa(unsigned long long _n, char * _c, int _i)
|
457
|
-
{ return _ui64toa (_n, _c, _i); }
|
458
|
-
extern __inline__ long long wtoll(const wchar_t * _w)
|
459
|
-
{ return _wtoi64 (_w); }
|
460
|
-
extern __inline__ wchar_t* lltow(long long _n, wchar_t * _w, int _i)
|
461
|
-
{ return _i64tow (_n, _w, _i); }
|
462
|
-
extern __inline__ wchar_t* ulltow(unsigned long long _n, wchar_t * _w, int _i)
|
463
|
-
{ return _ui64tow (_n, _w, _i); }
|
464
|
-
#endif /* (__STRICT_ANSI__) */
|
465
|
-
|
466
|
-
#endif /* __MSVCRT__ */
|
467
|
-
|
468
|
-
#endif /* !__NO_ISOCEXT */
|
469
|
-
|
470
|
-
/*
|
471
|
-
* Undefine the no return attribute used in some function definitions
|
472
|
-
*/
|
473
|
-
#undef _ATTRIB_NORETURN
|
474
|
-
|
475
|
-
#ifdef __cplusplus
|
476
|
-
}
|
477
|
-
#endif
|
478
|
-
|
479
|
-
#endif /* Not RC_INVOKED */
|
480
|
-
|
481
|
-
#endif /* Not _STDLIB_H_ */
|
482
|
-
|
1
|
+
/*
|
2
|
+
* stdlib.h
|
3
|
+
*
|
4
|
+
* Definitions for common types, variables, and functions.
|
5
|
+
*
|
6
|
+
* This file is part of the Mingw32 package.
|
7
|
+
*
|
8
|
+
* Contributors:
|
9
|
+
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
|
10
|
+
*
|
11
|
+
* THIS SOFTWARE IS NOT COPYRIGHTED
|
12
|
+
*
|
13
|
+
* This source code is offered for use in the public domain. You may
|
14
|
+
* use, modify or distribute it freely.
|
15
|
+
*
|
16
|
+
* This code is distributed in the hope that it will be useful but
|
17
|
+
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
18
|
+
* DISCLAIMED. This includes but is not limited to warranties of
|
19
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
20
|
+
*
|
21
|
+
* $Revision: 1.2 $
|
22
|
+
* $Author: bellard $
|
23
|
+
* $Date: 2005/04/17 13:14:29 $
|
24
|
+
*
|
25
|
+
*/
|
26
|
+
|
27
|
+
#ifndef _STDLIB_H_
|
28
|
+
#define _STDLIB_H_
|
29
|
+
|
30
|
+
/* All the headers include this file. */
|
31
|
+
#include <_mingw.h>
|
32
|
+
|
33
|
+
|
34
|
+
#define __need_size_t
|
35
|
+
#define __need_wchar_t
|
36
|
+
#define __need_NULL
|
37
|
+
#ifndef RC_INVOKED
|
38
|
+
#include <stddef.h>
|
39
|
+
#endif /* RC_INVOKED */
|
40
|
+
|
41
|
+
/*
|
42
|
+
* RAND_MAX is the maximum value that may be returned by rand.
|
43
|
+
* The minimum is zero.
|
44
|
+
*/
|
45
|
+
#define RAND_MAX 0x7FFF
|
46
|
+
|
47
|
+
/*
|
48
|
+
* These values may be used as exit status codes.
|
49
|
+
*/
|
50
|
+
#define EXIT_SUCCESS 0
|
51
|
+
#define EXIT_FAILURE 1
|
52
|
+
|
53
|
+
/*
|
54
|
+
* Definitions for path name functions.
|
55
|
+
* NOTE: All of these values have simply been chosen to be conservatively high.
|
56
|
+
* Remember that with long file names we can no longer depend on
|
57
|
+
* extensions being short.
|
58
|
+
*/
|
59
|
+
#ifndef __STRICT_ANSI__
|
60
|
+
|
61
|
+
#ifndef MAX_PATH
|
62
|
+
#define MAX_PATH (260)
|
63
|
+
#endif
|
64
|
+
|
65
|
+
#define _MAX_PATH MAX_PATH
|
66
|
+
#define _MAX_DRIVE (3)
|
67
|
+
#define _MAX_DIR 256
|
68
|
+
#define _MAX_FNAME 256
|
69
|
+
#define _MAX_EXT 256
|
70
|
+
|
71
|
+
#endif /* Not __STRICT_ANSI__ */
|
72
|
+
|
73
|
+
|
74
|
+
#ifndef RC_INVOKED
|
75
|
+
|
76
|
+
#ifdef __cplusplus
|
77
|
+
extern "C" {
|
78
|
+
#endif
|
79
|
+
|
80
|
+
/*
|
81
|
+
* This seems like a convenient place to declare these variables, which
|
82
|
+
* give programs using WinMain (or main for that matter) access to main-ish
|
83
|
+
* argc and argv. environ is a pointer to a table of environment variables.
|
84
|
+
* NOTE: Strings in _argv and environ are ANSI strings.
|
85
|
+
*/
|
86
|
+
extern int _argc;
|
87
|
+
extern char** _argv;
|
88
|
+
|
89
|
+
/* imports from runtime dll of the above variables */
|
90
|
+
#ifdef __MSVCRT__
|
91
|
+
|
92
|
+
extern int* __p___argc(void);
|
93
|
+
extern char*** __p___argv(void);
|
94
|
+
extern wchar_t*** __p___wargv(void);
|
95
|
+
|
96
|
+
#define __argc (*__p___argc())
|
97
|
+
#define __argv (*__p___argv())
|
98
|
+
#define __wargv (*__p___wargv())
|
99
|
+
|
100
|
+
#else /* !MSVCRT */
|
101
|
+
|
102
|
+
#ifndef __DECLSPEC_SUPPORTED
|
103
|
+
|
104
|
+
extern int* __imp___argc_dll;
|
105
|
+
extern char*** __imp___argv_dll;
|
106
|
+
#define __argc (*__imp___argc_dll)
|
107
|
+
#define __argv (*__imp___argv_dll)
|
108
|
+
|
109
|
+
#else /* __DECLSPEC_SUPPORTED */
|
110
|
+
|
111
|
+
__MINGW_IMPORT int __argc_dll;
|
112
|
+
__MINGW_IMPORT char** __argv_dll;
|
113
|
+
#define __argc __argc_dll
|
114
|
+
#define __argv __argv_dll
|
115
|
+
|
116
|
+
#endif /* __DECLSPEC_SUPPORTED */
|
117
|
+
|
118
|
+
#endif /* __MSVCRT */
|
119
|
+
|
120
|
+
/*
|
121
|
+
* Also defined in ctype.h.
|
122
|
+
*/
|
123
|
+
|
124
|
+
#ifndef MB_CUR_MAX
|
125
|
+
# ifdef __MSVCRT__
|
126
|
+
# define MB_CUR_MAX __mb_cur_max
|
127
|
+
__MINGW_IMPORT int __mb_cur_max;
|
128
|
+
# else /* not __MSVCRT */
|
129
|
+
# define MB_CUR_MAX __mb_cur_max_dll
|
130
|
+
__MINGW_IMPORT int __mb_cur_max_dll;
|
131
|
+
# endif /* not __MSVCRT */
|
132
|
+
#endif /* MB_CUR_MAX */
|
133
|
+
|
134
|
+
/*
|
135
|
+
* MS likes to declare errno in stdlib.h as well.
|
136
|
+
*/
|
137
|
+
|
138
|
+
#ifdef _UWIN
|
139
|
+
#undef errno
|
140
|
+
extern int errno;
|
141
|
+
#else
|
142
|
+
int* _errno(void);
|
143
|
+
#define errno (*_errno())
|
144
|
+
#endif
|
145
|
+
int* __doserrno(void);
|
146
|
+
#define _doserrno (*__doserrno())
|
147
|
+
|
148
|
+
/*
|
149
|
+
* Use environ from the DLL, not as a global.
|
150
|
+
*/
|
151
|
+
|
152
|
+
#ifdef __MSVCRT__
|
153
|
+
extern char *** __p__environ(void);
|
154
|
+
extern wchar_t *** __p__wenviron(void);
|
155
|
+
# define _environ (*__p__environ())
|
156
|
+
# define _wenviron (*__p__wenviron())
|
157
|
+
#else /* ! __MSVCRT__ */
|
158
|
+
# ifndef __DECLSPEC_SUPPORTED
|
159
|
+
extern char *** __imp__environ_dll;
|
160
|
+
# define _environ (*__imp__environ_dll)
|
161
|
+
# else /* __DECLSPEC_SUPPORTED */
|
162
|
+
__MINGW_IMPORT char ** _environ_dll;
|
163
|
+
# define _environ _environ_dll
|
164
|
+
# endif /* __DECLSPEC_SUPPORTED */
|
165
|
+
#endif /* ! __MSVCRT__ */
|
166
|
+
|
167
|
+
#define environ _environ
|
168
|
+
|
169
|
+
#ifdef __MSVCRT__
|
170
|
+
/* One of the MSVCRTxx libraries */
|
171
|
+
|
172
|
+
#ifndef __DECLSPEC_SUPPORTED
|
173
|
+
extern int* __imp__sys_nerr;
|
174
|
+
# define sys_nerr (*__imp__sys_nerr)
|
175
|
+
#else /* __DECLSPEC_SUPPORTED */
|
176
|
+
__MINGW_IMPORT int _sys_nerr;
|
177
|
+
# ifndef _UWIN
|
178
|
+
# define sys_nerr _sys_nerr
|
179
|
+
# endif /* _UWIN */
|
180
|
+
#endif /* __DECLSPEC_SUPPORTED */
|
181
|
+
|
182
|
+
#else /* ! __MSVCRT__ */
|
183
|
+
|
184
|
+
/* CRTDLL run time library */
|
185
|
+
|
186
|
+
#ifndef __DECLSPEC_SUPPORTED
|
187
|
+
extern int* __imp__sys_nerr_dll;
|
188
|
+
# define sys_nerr (*__imp__sys_nerr_dll)
|
189
|
+
#else /* __DECLSPEC_SUPPORTED */
|
190
|
+
__MINGW_IMPORT int _sys_nerr_dll;
|
191
|
+
# define sys_nerr _sys_nerr_dll
|
192
|
+
#endif /* __DECLSPEC_SUPPORTED */
|
193
|
+
|
194
|
+
#endif /* ! __MSVCRT__ */
|
195
|
+
|
196
|
+
#ifndef __DECLSPEC_SUPPORTED
|
197
|
+
extern char*** __imp__sys_errlist;
|
198
|
+
#define sys_errlist (*__imp__sys_errlist)
|
199
|
+
#else /* __DECLSPEC_SUPPORTED */
|
200
|
+
__MINGW_IMPORT char* _sys_errlist[];
|
201
|
+
#ifndef _UWIN
|
202
|
+
#define sys_errlist _sys_errlist
|
203
|
+
#endif /* _UWIN */
|
204
|
+
#endif /* __DECLSPEC_SUPPORTED */
|
205
|
+
|
206
|
+
/*
|
207
|
+
* OS version and such constants.
|
208
|
+
*/
|
209
|
+
#ifndef __STRICT_ANSI__
|
210
|
+
|
211
|
+
#ifdef __MSVCRT__
|
212
|
+
/* msvcrtxx.dll */
|
213
|
+
|
214
|
+
extern unsigned int* __p__osver(void);
|
215
|
+
extern unsigned int* __p__winver(void);
|
216
|
+
extern unsigned int* __p__winmajor(void);
|
217
|
+
extern unsigned int* __p__winminor(void);
|
218
|
+
|
219
|
+
#define _osver (*__p__osver())
|
220
|
+
#define _winver (*__p__winver())
|
221
|
+
#define _winmajor (*__p__winmajor())
|
222
|
+
#define _winminor (*__p__winminor())
|
223
|
+
|
224
|
+
#else
|
225
|
+
/* Not msvcrtxx.dll, thus crtdll.dll */
|
226
|
+
|
227
|
+
#ifndef __DECLSPEC_SUPPORTED
|
228
|
+
|
229
|
+
extern unsigned int* _imp___osver_dll;
|
230
|
+
extern unsigned int* _imp___winver_dll;
|
231
|
+
extern unsigned int* _imp___winmajor_dll;
|
232
|
+
extern unsigned int* _imp___winminor_dll;
|
233
|
+
|
234
|
+
#define _osver (*_imp___osver_dll)
|
235
|
+
#define _winver (*_imp___winver_dll)
|
236
|
+
#define _winmajor (*_imp___winmajor_dll)
|
237
|
+
#define _winminor (*_imp___winminor_dll)
|
238
|
+
|
239
|
+
#else /* __DECLSPEC_SUPPORTED */
|
240
|
+
|
241
|
+
__MINGW_IMPORT unsigned int _osver_dll;
|
242
|
+
__MINGW_IMPORT unsigned int _winver_dll;
|
243
|
+
__MINGW_IMPORT unsigned int _winmajor_dll;
|
244
|
+
__MINGW_IMPORT unsigned int _winminor_dll;
|
245
|
+
|
246
|
+
#define _osver _osver_dll
|
247
|
+
#define _winver _winver_dll
|
248
|
+
#define _winmajor _winmajor_dll
|
249
|
+
#define _winminor _winminor_dll
|
250
|
+
|
251
|
+
#endif /* __DECLSPEC_SUPPORTED */
|
252
|
+
|
253
|
+
#endif
|
254
|
+
|
255
|
+
#if defined __MSVCRT__
|
256
|
+
/* although the _pgmptr is exported as DATA,
|
257
|
+
* be safe and use the access function __p__pgmptr() to get it. */
|
258
|
+
char** __p__pgmptr(void);
|
259
|
+
#define _pgmptr (*__p__pgmptr())
|
260
|
+
wchar_t** __p__wpgmptr(void);
|
261
|
+
#define _wpgmptr (*__p__wpgmptr())
|
262
|
+
#else /* ! __MSVCRT__ */
|
263
|
+
# ifndef __DECLSPEC_SUPPORTED
|
264
|
+
extern char** __imp__pgmptr_dll;
|
265
|
+
# define _pgmptr (*__imp__pgmptr_dll)
|
266
|
+
# else /* __DECLSPEC_SUPPORTED */
|
267
|
+
__MINGW_IMPORT char* _pgmptr_dll;
|
268
|
+
# define _pgmptr _pgmptr_dll
|
269
|
+
# endif /* __DECLSPEC_SUPPORTED */
|
270
|
+
/* no wide version in CRTDLL */
|
271
|
+
#endif /* __MSVCRT__ */
|
272
|
+
|
273
|
+
#endif /* Not __STRICT_ANSI__ */
|
274
|
+
|
275
|
+
#ifdef __GNUC__
|
276
|
+
#define _ATTRIB_NORETURN __attribute__ ((noreturn))
|
277
|
+
#else /* Not __GNUC__ */
|
278
|
+
#define _ATTRIB_NORETURN
|
279
|
+
#endif /* __GNUC__ */
|
280
|
+
|
281
|
+
double atof (const char*);
|
282
|
+
int atoi (const char*);
|
283
|
+
long atol (const char*);
|
284
|
+
int _wtoi (const wchar_t *);
|
285
|
+
long _wtol (const wchar_t *);
|
286
|
+
|
287
|
+
double strtod (const char*, char**);
|
288
|
+
#if !defined __NO_ISOCEXT /* extern stubs in static libmingwex.a */
|
289
|
+
extern __inline__ float strtof (const char *nptr, char **endptr)
|
290
|
+
{ return (strtod (nptr, endptr));}
|
291
|
+
#endif /* __NO_ISOCEXT */
|
292
|
+
|
293
|
+
long strtol (const char*, char**, int);
|
294
|
+
unsigned long strtoul (const char*, char**, int);
|
295
|
+
|
296
|
+
#ifndef _WSTDLIB_DEFINED
|
297
|
+
/* also declared in wchar.h */
|
298
|
+
double wcstod (const wchar_t*, wchar_t**);
|
299
|
+
#if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */
|
300
|
+
extern __inline__ float wcstof( const wchar_t *nptr, wchar_t **endptr)
|
301
|
+
{ return (wcstod(nptr, endptr)); }
|
302
|
+
#endif /* __NO_ISOCEXT */
|
303
|
+
|
304
|
+
long wcstol (const wchar_t*, wchar_t**, int);
|
305
|
+
unsigned long wcstoul (const wchar_t*, wchar_t**, int);
|
306
|
+
#define _WSTDLIB_DEFINED
|
307
|
+
#endif
|
308
|
+
|
309
|
+
size_t wcstombs (char*, const wchar_t*, size_t);
|
310
|
+
int wctomb (char*, wchar_t);
|
311
|
+
|
312
|
+
int mblen (const char*, size_t);
|
313
|
+
size_t mbstowcs (wchar_t*, const char*, size_t);
|
314
|
+
int mbtowc (wchar_t*, const char*, size_t);
|
315
|
+
|
316
|
+
int rand (void);
|
317
|
+
void srand (unsigned int);
|
318
|
+
|
319
|
+
void* calloc (size_t, size_t);
|
320
|
+
void* malloc (size_t);
|
321
|
+
void* realloc (void*, size_t);
|
322
|
+
void free (void*);
|
323
|
+
|
324
|
+
void abort (void) _ATTRIB_NORETURN;
|
325
|
+
void exit (int) _ATTRIB_NORETURN;
|
326
|
+
int atexit (void (*)(void));
|
327
|
+
|
328
|
+
int system (const char*);
|
329
|
+
char* getenv (const char*);
|
330
|
+
|
331
|
+
void* bsearch (const void*, const void*, size_t, size_t,
|
332
|
+
int (*)(const void*, const void*));
|
333
|
+
void qsort (const void*, size_t, size_t,
|
334
|
+
int (*)(const void*, const void*));
|
335
|
+
|
336
|
+
int abs (int);
|
337
|
+
long labs (long);
|
338
|
+
|
339
|
+
/*
|
340
|
+
* div_t and ldiv_t are structures used to return the results of div and
|
341
|
+
* ldiv.
|
342
|
+
*
|
343
|
+
* NOTE: div and ldiv appear not to work correctly unless
|
344
|
+
* -fno-pcc-struct-return is specified. This is included in the
|
345
|
+
* mingw32 specs file.
|
346
|
+
*/
|
347
|
+
typedef struct { int quot, rem; } div_t;
|
348
|
+
typedef struct { long quot, rem; } ldiv_t;
|
349
|
+
|
350
|
+
div_t div (int, int);
|
351
|
+
ldiv_t ldiv (long, long);
|
352
|
+
|
353
|
+
#ifndef __STRICT_ANSI__
|
354
|
+
|
355
|
+
/*
|
356
|
+
* NOTE: Officially the three following functions are obsolete. The Win32 API
|
357
|
+
* functions SetErrorMode, Beep and Sleep are their replacements.
|
358
|
+
*/
|
359
|
+
void _beep (unsigned int, unsigned int);
|
360
|
+
void _seterrormode (int);
|
361
|
+
void _sleep (unsigned long);
|
362
|
+
|
363
|
+
void _exit (int) _ATTRIB_NORETURN;
|
364
|
+
#if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */
|
365
|
+
/* C99 function name */
|
366
|
+
void _Exit(int) _ATTRIB_NORETURN; /* Declare to get noreturn attribute. */
|
367
|
+
extern __inline__ void _Exit(int status)
|
368
|
+
{ _exit(status); }
|
369
|
+
#endif
|
370
|
+
/* _onexit is MS extension. Use atexit for portability. */
|
371
|
+
typedef int (* _onexit_t)(void);
|
372
|
+
_onexit_t _onexit( _onexit_t );
|
373
|
+
|
374
|
+
int _putenv (const char*);
|
375
|
+
void _searchenv (const char*, const char*, char*);
|
376
|
+
|
377
|
+
|
378
|
+
char* _ecvt (double, int, int*, int*);
|
379
|
+
char* _fcvt (double, int, int*, int*);
|
380
|
+
char* _gcvt (double, int, char*);
|
381
|
+
|
382
|
+
void _makepath (char*, const char*, const char*, const char*, const char*);
|
383
|
+
void _splitpath (const char*, char*, char*, char*, char*);
|
384
|
+
char* _fullpath (char*, const char*, size_t);
|
385
|
+
|
386
|
+
|
387
|
+
char* _itoa (int, char*, int);
|
388
|
+
char* _ltoa (long, char*, int);
|
389
|
+
char* _ultoa(unsigned long, char*, int);
|
390
|
+
wchar_t* _itow (int, wchar_t*, int);
|
391
|
+
wchar_t* _ltow (long, wchar_t*, int);
|
392
|
+
wchar_t* _ultow (unsigned long, wchar_t*, int);
|
393
|
+
|
394
|
+
#ifdef __MSVCRT__
|
395
|
+
__int64 _atoi64(const char *);
|
396
|
+
char* _i64toa(__int64, char *, int);
|
397
|
+
char* _ui64toa(unsigned __int64, char *, int);
|
398
|
+
__int64 _wtoi64(const wchar_t *);
|
399
|
+
wchar_t* _i64tow(__int64, wchar_t *, int);
|
400
|
+
wchar_t* _ui64tow(unsigned __int64, wchar_t *, int);
|
401
|
+
|
402
|
+
wchar_t* _wgetenv(const wchar_t*);
|
403
|
+
int _wputenv(const wchar_t*);
|
404
|
+
void _wsearchenv(const wchar_t*, const wchar_t*, wchar_t*);
|
405
|
+
void _wmakepath(wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*);
|
406
|
+
void _wsplitpath (const wchar_t*, wchar_t*, wchar_t*, wchar_t*, wchar_t*);
|
407
|
+
wchar_t* _wfullpath (wchar_t*, const wchar_t*, size_t);
|
408
|
+
#endif
|
409
|
+
|
410
|
+
#ifndef _NO_OLDNAMES
|
411
|
+
|
412
|
+
int putenv (const char*);
|
413
|
+
void searchenv (const char*, const char*, char*);
|
414
|
+
|
415
|
+
char* itoa (int, char*, int);
|
416
|
+
char* ltoa (long, char*, int);
|
417
|
+
|
418
|
+
#ifndef _UWIN
|
419
|
+
char* ecvt (double, int, int*, int*);
|
420
|
+
char* fcvt (double, int, int*, int*);
|
421
|
+
char* gcvt (double, int, char*);
|
422
|
+
#endif /* _UWIN */
|
423
|
+
#endif /* Not _NO_OLDNAMES */
|
424
|
+
|
425
|
+
#endif /* Not __STRICT_ANSI__ */
|
426
|
+
|
427
|
+
/* C99 names */
|
428
|
+
|
429
|
+
#if !defined __NO_ISOCEXT /* externs in static libmingwex.a */
|
430
|
+
|
431
|
+
typedef struct { long long quot, rem; } lldiv_t;
|
432
|
+
|
433
|
+
lldiv_t lldiv (long long, long long);
|
434
|
+
|
435
|
+
extern __inline__ long long llabs(long long _j)
|
436
|
+
{return (_j >= 0 ? _j : -_j);}
|
437
|
+
|
438
|
+
long long strtoll (const char* __restrict__, char** __restrict, int);
|
439
|
+
unsigned long long strtoull (const char* __restrict__, char** __restrict__, int);
|
440
|
+
|
441
|
+
#if defined (__MSVCRT__) /* these are stubs for MS _i64 versions */
|
442
|
+
long long atoll (const char *);
|
443
|
+
|
444
|
+
#if !defined (__STRICT_ANSI__)
|
445
|
+
long long wtoll(const wchar_t *);
|
446
|
+
char* lltoa(long long, char *, int);
|
447
|
+
char* ulltoa(unsigned long long , char *, int);
|
448
|
+
wchar_t* lltow(long long, wchar_t *, int);
|
449
|
+
wchar_t* ulltow(unsigned long long, wchar_t *, int);
|
450
|
+
|
451
|
+
/* inline using non-ansi functions */
|
452
|
+
extern __inline__ long long atoll (const char * _c)
|
453
|
+
{ return _atoi64 (_c); }
|
454
|
+
extern __inline__ char* lltoa(long long _n, char * _c, int _i)
|
455
|
+
{ return _i64toa (_n, _c, _i); }
|
456
|
+
extern __inline__ char* ulltoa(unsigned long long _n, char * _c, int _i)
|
457
|
+
{ return _ui64toa (_n, _c, _i); }
|
458
|
+
extern __inline__ long long wtoll(const wchar_t * _w)
|
459
|
+
{ return _wtoi64 (_w); }
|
460
|
+
extern __inline__ wchar_t* lltow(long long _n, wchar_t * _w, int _i)
|
461
|
+
{ return _i64tow (_n, _w, _i); }
|
462
|
+
extern __inline__ wchar_t* ulltow(unsigned long long _n, wchar_t * _w, int _i)
|
463
|
+
{ return _ui64tow (_n, _w, _i); }
|
464
|
+
#endif /* (__STRICT_ANSI__) */
|
465
|
+
|
466
|
+
#endif /* __MSVCRT__ */
|
467
|
+
|
468
|
+
#endif /* !__NO_ISOCEXT */
|
469
|
+
|
470
|
+
/*
|
471
|
+
* Undefine the no return attribute used in some function definitions
|
472
|
+
*/
|
473
|
+
#undef _ATTRIB_NORETURN
|
474
|
+
|
475
|
+
#ifdef __cplusplus
|
476
|
+
}
|
477
|
+
#endif
|
478
|
+
|
479
|
+
#endif /* Not RC_INVOKED */
|
480
|
+
|
481
|
+
#endif /* Not _STDLIB_H_ */
|
482
|
+
|