standalone-ruby 1.3.1 → 1.4
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 +27 -23
- data/bin/standalone-ruby +3 -3
- data/lib/data/exe_template/launcher_stub.c +35 -0
- data/lib/data/exe_template/launcher_stub.cpp +9 -0
- data/lib/data/tcc/include/_mingw.h +54 -0
- data/lib/data/tcc/include/assert.h +71 -0
- data/lib/data/tcc/include/conio.h +159 -0
- data/lib/data/tcc/include/ctype.h +232 -0
- data/lib/data/tcc/include/dir.h +26 -0
- data/lib/data/tcc/include/direct.h +95 -0
- data/lib/data/tcc/include/dirent.h +96 -0
- data/lib/data/tcc/include/dos.h +110 -0
- data/lib/data/tcc/include/errno.h +117 -0
- data/lib/data/tcc/include/excpt.h +20 -0
- data/lib/data/tcc/include/fcntl.h +135 -0
- data/lib/data/tcc/include/fenv.h +85 -0
- data/lib/data/tcc/include/float.h +224 -0
- data/lib/data/tcc/include/inttypes.h +275 -0
- data/lib/data/tcc/include/io.h +296 -0
- data/lib/data/tcc/include/limits.h +115 -0
- data/lib/data/tcc/include/locale.h +100 -0
- data/lib/data/tcc/include/malloc.h +87 -0
- data/lib/data/tcc/include/math.h +438 -0
- data/lib/data/tcc/include/mem.h +8 -0
- data/lib/data/tcc/include/memory.h +9 -0
- data/lib/data/tcc/include/process.h +158 -0
- data/lib/data/tcc/include/setjmp.h +72 -0
- data/lib/data/tcc/include/share.h +44 -0
- data/lib/data/tcc/include/signal.h +111 -0
- data/lib/data/tcc/include/stdarg.h +16 -0
- data/lib/data/tcc/include/stdbool.h +10 -0
- data/lib/data/tcc/include/stddef.h +26 -0
- data/lib/data/tcc/include/stdint.h +184 -0
- data/lib/data/tcc/include/stdio.h +413 -0
- data/lib/data/tcc/include/stdlib.h +482 -0
- data/lib/data/tcc/include/string.h +206 -0
- data/lib/data/tcc/include/sys/fcntl.h +8 -0
- data/lib/data/tcc/include/sys/file.h +9 -0
- data/lib/data/tcc/include/sys/locking.h +52 -0
- data/lib/data/tcc/include/sys/stat.h +190 -0
- data/lib/data/tcc/include/sys/time.h +3 -0
- data/lib/data/tcc/include/sys/timeb.h +82 -0
- data/lib/data/tcc/include/sys/types.h +118 -0
- data/lib/data/tcc/include/sys/unistd.h +9 -0
- data/lib/data/tcc/include/sys/utime.h +89 -0
- data/lib/data/tcc/include/tchar.h +367 -0
- data/lib/data/tcc/include/time.h +219 -0
- data/lib/data/tcc/include/unistd.h +10 -0
- data/lib/data/tcc/include/values.h +4 -0
- data/lib/data/tcc/include/varargs.h +11 -0
- data/lib/data/tcc/include/wchar.h +318 -0
- data/lib/data/tcc/include/wctype.h +127 -0
- data/lib/data/tcc/include/winapi/basetsd.h +119 -0
- data/lib/data/tcc/include/winapi/basetyps.h +144 -0
- data/lib/data/tcc/include/winapi/winbase.h +1852 -0
- data/lib/data/tcc/include/winapi/wincon.h +207 -0
- data/lib/data/tcc/include/winapi/windef.h +240 -0
- data/lib/data/tcc/include/winapi/windows.h +176 -0
- data/lib/data/tcc/include/winapi/winerror.h +1054 -0
- data/lib/data/tcc/include/winapi/wingdi.h +2843 -0
- data/lib/data/tcc/include/winapi/winnetwk.h +346 -0
- data/lib/data/tcc/include/winapi/winnls.h +651 -0
- data/lib/data/tcc/include/winapi/winnt.h +2667 -0
- data/lib/data/tcc/include/winapi/winreg.h +159 -0
- data/lib/data/tcc/include/winapi/winsvc.h +309 -0
- data/lib/data/tcc/include/winapi/winuser.h +3472 -0
- data/lib/data/tcc/include/winapi/winver.h +133 -0
- data/lib/data/tcc/lib/gdi32.def +337 -0
- data/lib/data/tcc/lib/kernel32.def +763 -0
- data/lib/data/tcc/lib/libtcc1.a +0 -0
- data/lib/data/tcc/lib/msvcrt.def +782 -0
- data/lib/data/tcc/lib/user32.def +654 -0
- data/lib/data/tcc/tcc.exe +0 -0
- data/lib/data/tcc/tiny_impdef.exe +0 -0
- data/lib/data/tcc/tiny_libmaker.exe +0 -0
- data/lib/data/vbs/default_vbs.txt +1 -1
- data/lib/data/vbs/vbs_gui.txt +1 -1
- data/lib/standalone_ruby.rb +6 -6
- data/lib/utils/config_generator.rb +5 -0
- data/lib/utils/displayer.rb +61 -59
- data/lib/utils/exe_packer.rb +68 -0
- data/lib/utils/launcher.rb +15 -16
- data/lib/utils/launcher_handler.rb +2 -0
- data/lib/utils/logger_helper.rb +24 -24
- data/lib/utils/parameter_parser.rb +206 -201
- data/lib/utils/ruby_copy.rb +26 -26
- metadata +77 -3
- data/lib/data/bat/default_bat.txt +0 -9
@@ -0,0 +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
|
+
|
@@ -0,0 +1,206 @@
|
|
1
|
+
/*
|
2
|
+
* string.h
|
3
|
+
*
|
4
|
+
* Definitions for memory and string 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 _STRING_H_
|
28
|
+
#define _STRING_H_
|
29
|
+
|
30
|
+
/* All the headers include this file. */
|
31
|
+
#include <_mingw.h>
|
32
|
+
|
33
|
+
/*
|
34
|
+
* Define size_t, wchar_t and NULL
|
35
|
+
*/
|
36
|
+
#define __need_size_t
|
37
|
+
#define __need_wchar_t
|
38
|
+
#define __need_NULL
|
39
|
+
#ifndef RC_INVOKED
|
40
|
+
#include <stddef.h>
|
41
|
+
#endif /* Not RC_INVOKED */
|
42
|
+
|
43
|
+
#ifndef RC_INVOKED
|
44
|
+
|
45
|
+
#ifdef __cplusplus
|
46
|
+
extern "C" {
|
47
|
+
#endif
|
48
|
+
|
49
|
+
/*
|
50
|
+
* Prototypes of the ANSI Standard C library string functions.
|
51
|
+
*/
|
52
|
+
void* memchr (const void*, int, size_t);
|
53
|
+
int memcmp (const void*, const void*, size_t);
|
54
|
+
void* memcpy (void*, const void*, size_t);
|
55
|
+
void* memmove (void*, const void*, size_t);
|
56
|
+
void* memset (void*, int, size_t);
|
57
|
+
char* strcat (char*, const char*);
|
58
|
+
char* strchr (const char*, int);
|
59
|
+
int strcmp (const char*, const char*);
|
60
|
+
int strcoll (const char*, const char*); /* Compare using locale */
|
61
|
+
char* strcpy (char*, const char*);
|
62
|
+
size_t strcspn (const char*, const char*);
|
63
|
+
char* strerror (int); /* NOTE: NOT an old name wrapper. */
|
64
|
+
char* _strerror (const char *);
|
65
|
+
size_t strlen (const char*);
|
66
|
+
char* strncat (char*, const char*, size_t);
|
67
|
+
int strncmp (const char*, const char*, size_t);
|
68
|
+
char* strncpy (char*, const char*, size_t);
|
69
|
+
char* strpbrk (const char*, const char*);
|
70
|
+
char* strrchr (const char*, int);
|
71
|
+
size_t strspn (const char*, const char*);
|
72
|
+
char* strstr (const char*, const char*);
|
73
|
+
char* strtok (char*, const char*);
|
74
|
+
size_t strxfrm (char*, const char*, size_t);
|
75
|
+
|
76
|
+
#ifndef __STRICT_ANSI__
|
77
|
+
/*
|
78
|
+
* Extra non-ANSI functions provided by the CRTDLL library
|
79
|
+
*/
|
80
|
+
void* _memccpy (void*, const void*, int, size_t);
|
81
|
+
int _memicmp (const void*, const void*, size_t);
|
82
|
+
char* _strdup (const char*);
|
83
|
+
int _strcmpi (const char*, const char*);
|
84
|
+
int _stricmp (const char*, const char*);
|
85
|
+
int _stricoll (const char*, const char*);
|
86
|
+
char* _strlwr (char*);
|
87
|
+
int _strnicmp (const char*, const char*, size_t);
|
88
|
+
char* _strnset (char*, int, size_t);
|
89
|
+
char* _strrev (char*);
|
90
|
+
char* _strset (char*, int);
|
91
|
+
char* _strupr (char*);
|
92
|
+
void _swab (const char*, char*, size_t);
|
93
|
+
|
94
|
+
/*
|
95
|
+
* Multi-byte character functions
|
96
|
+
*/
|
97
|
+
unsigned char* _mbschr (unsigned char*, unsigned char*);
|
98
|
+
unsigned char* _mbsncat (unsigned char*, const unsigned char*, size_t);
|
99
|
+
unsigned char* _mbstok (unsigned char*, unsigned char*);
|
100
|
+
|
101
|
+
#ifdef __MSVCRT__
|
102
|
+
int _strncoll(const char*, const char*, size_t);
|
103
|
+
int _strnicoll(const char*, const char*, size_t);
|
104
|
+
#endif
|
105
|
+
|
106
|
+
#endif /* Not __STRICT_ANSI__ */
|
107
|
+
|
108
|
+
/*
|
109
|
+
* Unicode versions of the standard calls.
|
110
|
+
*/
|
111
|
+
wchar_t* wcscat (wchar_t*, const wchar_t*);
|
112
|
+
wchar_t* wcschr (const wchar_t*, wchar_t);
|
113
|
+
int wcscmp (const wchar_t*, const wchar_t*);
|
114
|
+
int wcscoll (const wchar_t*, const wchar_t*);
|
115
|
+
wchar_t* wcscpy (wchar_t*, const wchar_t*);
|
116
|
+
size_t wcscspn (const wchar_t*, const wchar_t*);
|
117
|
+
/* Note: No wcserror in CRTDLL. */
|
118
|
+
size_t wcslen (const wchar_t*);
|
119
|
+
wchar_t* wcsncat (wchar_t*, const wchar_t*, size_t);
|
120
|
+
int wcsncmp(const wchar_t*, const wchar_t*, size_t);
|
121
|
+
wchar_t* wcsncpy(wchar_t*, const wchar_t*, size_t);
|
122
|
+
wchar_t* wcspbrk(const wchar_t*, const wchar_t*);
|
123
|
+
wchar_t* wcsrchr(const wchar_t*, wchar_t);
|
124
|
+
size_t wcsspn(const wchar_t*, const wchar_t*);
|
125
|
+
wchar_t* wcsstr(const wchar_t*, const wchar_t*);
|
126
|
+
wchar_t* wcstok(wchar_t*, const wchar_t*);
|
127
|
+
size_t wcsxfrm(wchar_t*, const wchar_t*, size_t);
|
128
|
+
|
129
|
+
#ifndef __STRICT_ANSI__
|
130
|
+
/*
|
131
|
+
* Unicode versions of non-ANSI functions provided by CRTDLL.
|
132
|
+
*/
|
133
|
+
|
134
|
+
/* NOTE: _wcscmpi not provided by CRTDLL, this define is for portability */
|
135
|
+
#define _wcscmpi _wcsicmp
|
136
|
+
|
137
|
+
wchar_t* _wcsdup (wchar_t*);
|
138
|
+
int _wcsicmp (const wchar_t*, const wchar_t*);
|
139
|
+
int _wcsicoll (const wchar_t*, const wchar_t*);
|
140
|
+
wchar_t* _wcslwr (wchar_t*);
|
141
|
+
int _wcsnicmp (const wchar_t*, const wchar_t*, size_t);
|
142
|
+
wchar_t* _wcsnset (wchar_t*, wchar_t, size_t);
|
143
|
+
wchar_t* _wcsrev (wchar_t*);
|
144
|
+
wchar_t* _wcsset (wchar_t*, wchar_t);
|
145
|
+
wchar_t* _wcsupr (wchar_t*);
|
146
|
+
|
147
|
+
#ifdef __MSVCRT__
|
148
|
+
int _wcsncoll(const wchar_t*, const wchar_t*, size_t);
|
149
|
+
int _wcsnicoll(const wchar_t*, const wchar_t*, size_t);
|
150
|
+
#endif
|
151
|
+
|
152
|
+
|
153
|
+
#endif /* Not __STRICT_ANSI__ */
|
154
|
+
|
155
|
+
|
156
|
+
#ifndef __STRICT_ANSI__
|
157
|
+
#ifndef _NO_OLDNAMES
|
158
|
+
|
159
|
+
/*
|
160
|
+
* Non-underscored versions of non-ANSI functions. They live in liboldnames.a
|
161
|
+
* and provide a little extra portability. Also a few extra UNIX-isms like
|
162
|
+
* strcasecmp.
|
163
|
+
*/
|
164
|
+
|
165
|
+
void* memccpy (void*, const void*, int, size_t);
|
166
|
+
int memicmp (const void*, const void*, size_t);
|
167
|
+
char* strdup (const char*);
|
168
|
+
int strcmpi (const char*, const char*);
|
169
|
+
int stricmp (const char*, const char*);
|
170
|
+
int strcasecmp (const char*, const char*);
|
171
|
+
int stricoll (const char*, const char*);
|
172
|
+
char* strlwr (char*);
|
173
|
+
int strnicmp (const char*, const char*, size_t);
|
174
|
+
int strncasecmp (const char*, const char*, size_t);
|
175
|
+
char* strnset (char*, int, size_t);
|
176
|
+
char* strrev (char*);
|
177
|
+
char* strset (char*, int);
|
178
|
+
char* strupr (char*);
|
179
|
+
#ifndef _UWIN
|
180
|
+
void swab (const char*, char*, size_t);
|
181
|
+
#endif /* _UWIN */
|
182
|
+
|
183
|
+
/* NOTE: There is no _wcscmpi, but this is for compatibility. */
|
184
|
+
int wcscmpi (const wchar_t*, const wchar_t*);
|
185
|
+
wchar_t* wcsdup (wchar_t*);
|
186
|
+
int wcsicmp (const wchar_t*, const wchar_t*);
|
187
|
+
int wcsicoll (const wchar_t*, const wchar_t*);
|
188
|
+
wchar_t* wcslwr (wchar_t*);
|
189
|
+
int wcsnicmp (const wchar_t*, const wchar_t*, size_t);
|
190
|
+
wchar_t* wcsnset (wchar_t*, wchar_t, size_t);
|
191
|
+
wchar_t* wcsrev (wchar_t*);
|
192
|
+
wchar_t* wcsset (wchar_t*, wchar_t);
|
193
|
+
wchar_t* wcsupr (wchar_t*);
|
194
|
+
|
195
|
+
#endif /* Not _NO_OLDNAMES */
|
196
|
+
#endif /* Not strict ANSI */
|
197
|
+
|
198
|
+
|
199
|
+
#ifdef __cplusplus
|
200
|
+
}
|
201
|
+
#endif
|
202
|
+
|
203
|
+
#endif /* Not RC_INVOKED */
|
204
|
+
|
205
|
+
#endif /* Not _STRING_H_ */
|
206
|
+
|