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.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +27 -23
  3. data/bin/standalone-ruby +3 -3
  4. data/lib/data/exe_template/launcher_stub.c +35 -0
  5. data/lib/data/exe_template/launcher_stub.cpp +9 -0
  6. data/lib/data/tcc/include/_mingw.h +54 -0
  7. data/lib/data/tcc/include/assert.h +71 -0
  8. data/lib/data/tcc/include/conio.h +159 -0
  9. data/lib/data/tcc/include/ctype.h +232 -0
  10. data/lib/data/tcc/include/dir.h +26 -0
  11. data/lib/data/tcc/include/direct.h +95 -0
  12. data/lib/data/tcc/include/dirent.h +96 -0
  13. data/lib/data/tcc/include/dos.h +110 -0
  14. data/lib/data/tcc/include/errno.h +117 -0
  15. data/lib/data/tcc/include/excpt.h +20 -0
  16. data/lib/data/tcc/include/fcntl.h +135 -0
  17. data/lib/data/tcc/include/fenv.h +85 -0
  18. data/lib/data/tcc/include/float.h +224 -0
  19. data/lib/data/tcc/include/inttypes.h +275 -0
  20. data/lib/data/tcc/include/io.h +296 -0
  21. data/lib/data/tcc/include/limits.h +115 -0
  22. data/lib/data/tcc/include/locale.h +100 -0
  23. data/lib/data/tcc/include/malloc.h +87 -0
  24. data/lib/data/tcc/include/math.h +438 -0
  25. data/lib/data/tcc/include/mem.h +8 -0
  26. data/lib/data/tcc/include/memory.h +9 -0
  27. data/lib/data/tcc/include/process.h +158 -0
  28. data/lib/data/tcc/include/setjmp.h +72 -0
  29. data/lib/data/tcc/include/share.h +44 -0
  30. data/lib/data/tcc/include/signal.h +111 -0
  31. data/lib/data/tcc/include/stdarg.h +16 -0
  32. data/lib/data/tcc/include/stdbool.h +10 -0
  33. data/lib/data/tcc/include/stddef.h +26 -0
  34. data/lib/data/tcc/include/stdint.h +184 -0
  35. data/lib/data/tcc/include/stdio.h +413 -0
  36. data/lib/data/tcc/include/stdlib.h +482 -0
  37. data/lib/data/tcc/include/string.h +206 -0
  38. data/lib/data/tcc/include/sys/fcntl.h +8 -0
  39. data/lib/data/tcc/include/sys/file.h +9 -0
  40. data/lib/data/tcc/include/sys/locking.h +52 -0
  41. data/lib/data/tcc/include/sys/stat.h +190 -0
  42. data/lib/data/tcc/include/sys/time.h +3 -0
  43. data/lib/data/tcc/include/sys/timeb.h +82 -0
  44. data/lib/data/tcc/include/sys/types.h +118 -0
  45. data/lib/data/tcc/include/sys/unistd.h +9 -0
  46. data/lib/data/tcc/include/sys/utime.h +89 -0
  47. data/lib/data/tcc/include/tchar.h +367 -0
  48. data/lib/data/tcc/include/time.h +219 -0
  49. data/lib/data/tcc/include/unistd.h +10 -0
  50. data/lib/data/tcc/include/values.h +4 -0
  51. data/lib/data/tcc/include/varargs.h +11 -0
  52. data/lib/data/tcc/include/wchar.h +318 -0
  53. data/lib/data/tcc/include/wctype.h +127 -0
  54. data/lib/data/tcc/include/winapi/basetsd.h +119 -0
  55. data/lib/data/tcc/include/winapi/basetyps.h +144 -0
  56. data/lib/data/tcc/include/winapi/winbase.h +1852 -0
  57. data/lib/data/tcc/include/winapi/wincon.h +207 -0
  58. data/lib/data/tcc/include/winapi/windef.h +240 -0
  59. data/lib/data/tcc/include/winapi/windows.h +176 -0
  60. data/lib/data/tcc/include/winapi/winerror.h +1054 -0
  61. data/lib/data/tcc/include/winapi/wingdi.h +2843 -0
  62. data/lib/data/tcc/include/winapi/winnetwk.h +346 -0
  63. data/lib/data/tcc/include/winapi/winnls.h +651 -0
  64. data/lib/data/tcc/include/winapi/winnt.h +2667 -0
  65. data/lib/data/tcc/include/winapi/winreg.h +159 -0
  66. data/lib/data/tcc/include/winapi/winsvc.h +309 -0
  67. data/lib/data/tcc/include/winapi/winuser.h +3472 -0
  68. data/lib/data/tcc/include/winapi/winver.h +133 -0
  69. data/lib/data/tcc/lib/gdi32.def +337 -0
  70. data/lib/data/tcc/lib/kernel32.def +763 -0
  71. data/lib/data/tcc/lib/libtcc1.a +0 -0
  72. data/lib/data/tcc/lib/msvcrt.def +782 -0
  73. data/lib/data/tcc/lib/user32.def +654 -0
  74. data/lib/data/tcc/tcc.exe +0 -0
  75. data/lib/data/tcc/tiny_impdef.exe +0 -0
  76. data/lib/data/tcc/tiny_libmaker.exe +0 -0
  77. data/lib/data/vbs/default_vbs.txt +1 -1
  78. data/lib/data/vbs/vbs_gui.txt +1 -1
  79. data/lib/standalone_ruby.rb +6 -6
  80. data/lib/utils/config_generator.rb +5 -0
  81. data/lib/utils/displayer.rb +61 -59
  82. data/lib/utils/exe_packer.rb +68 -0
  83. data/lib/utils/launcher.rb +15 -16
  84. data/lib/utils/launcher_handler.rb +2 -0
  85. data/lib/utils/logger_helper.rb +24 -24
  86. data/lib/utils/parameter_parser.rb +206 -201
  87. data/lib/utils/ruby_copy.rb +26 -26
  88. metadata +77 -3
  89. data/lib/data/bat/default_bat.txt +0 -9
@@ -0,0 +1,413 @@
1
+ /*
2
+ * stdio.h
3
+ *
4
+ * Definitions of types and prototypes of functions for standard input and
5
+ * output.
6
+ *
7
+ * NOTE: The file manipulation functions provided by Microsoft seem to
8
+ * work with either slash (/) or backslash (\) as the path separator.
9
+ *
10
+ * This file is part of the Mingw32 package.
11
+ *
12
+ * Contributors:
13
+ * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
14
+ *
15
+ * THIS SOFTWARE IS NOT COPYRIGHTED
16
+ *
17
+ * This source code is offered for use in the public domain. You may
18
+ * use, modify or distribute it freely.
19
+ *
20
+ * This code is distributed in the hope that it will be useful but
21
+ * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
22
+ * DISCLAIMED. This includes but is not limited to warranties of
23
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
24
+ *
25
+ * $Revision: 1.2 $
26
+ * $Author: bellard $
27
+ * $Date: 2005/04/17 13:14:29 $
28
+ *
29
+ */
30
+
31
+ #ifndef _STDIO_H_
32
+ #define _STDIO_H_
33
+
34
+ /* All the headers include this file. */
35
+ #include <_mingw.h>
36
+
37
+ #define __need_size_t
38
+ #define __need_NULL
39
+ #define __need_wchar_t
40
+ #define __need_wint_t
41
+ #ifndef RC_INVOKED
42
+ #include <stddef.h>
43
+ #endif /* Not RC_INVOKED */
44
+
45
+
46
+ /* Flags for the iobuf structure */
47
+ #define _IOREAD 1
48
+ #define _IOWRT 2
49
+ #define _IORW 0x0080 /* opened as "r+w" */
50
+
51
+
52
+ /*
53
+ * The three standard file pointers provided by the run time library.
54
+ * NOTE: These will go to the bit-bucket silently in GUI applications!
55
+ */
56
+ #define STDIN_FILENO 0
57
+ #define STDOUT_FILENO 1
58
+ #define STDERR_FILENO 2
59
+
60
+ /* Returned by various functions on end of file condition or error. */
61
+ #define EOF (-1)
62
+
63
+ /*
64
+ * The maximum length of a file name. You should use GetVolumeInformation
65
+ * instead of this constant. But hey, this works.
66
+ *
67
+ * NOTE: This is used in the structure _finddata_t (see io.h) so changing it
68
+ * is probably not a good idea.
69
+ */
70
+ #define FILENAME_MAX (260)
71
+
72
+ /*
73
+ * The maximum number of files that may be open at once. I have set this to
74
+ * a conservative number. The actual value may be higher.
75
+ */
76
+ #define FOPEN_MAX (20)
77
+
78
+ /* After creating this many names, tmpnam and tmpfile return NULL */
79
+ #define TMP_MAX 32767
80
+ /*
81
+ * Tmpnam, tmpfile and, sometimes, _tempnam try to create
82
+ * temp files in the root directory of the current drive
83
+ * (not in pwd, as suggested by some older MS doc's).
84
+ * Redefining these macros does not effect the CRT functions.
85
+ */
86
+ #define _P_tmpdir "\\"
87
+ #define _wP_tmpdir L"\\"
88
+
89
+ /*
90
+ * The maximum size of name (including NUL) that will be put in the user
91
+ * supplied buffer caName for tmpnam.
92
+ * Inferred from the size of the static buffer returned by tmpnam
93
+ * when passed a NULL argument. May actually be smaller.
94
+ */
95
+ #define L_tmpnam (16)
96
+
97
+ #define _IOFBF 0x0000
98
+ #define _IOLBF 0x0040
99
+ #define _IONBF 0x0004
100
+
101
+ /*
102
+ * The buffer size as used by setbuf such that it is equivalent to
103
+ * (void) setvbuf(fileSetBuffer, caBuffer, _IOFBF, BUFSIZ).
104
+ */
105
+ #define BUFSIZ 512
106
+
107
+ /* Constants for nOrigin indicating the position relative to which fseek
108
+ * sets the file position. Enclosed in ifdefs because io.h could also
109
+ * define them. (Though not anymore since io.h includes this file now.) */
110
+ #ifndef SEEK_SET
111
+ #define SEEK_SET (0)
112
+ #endif
113
+
114
+ #ifndef SEEK_CUR
115
+ #define SEEK_CUR (1)
116
+ #endif
117
+
118
+ #ifndef SEEK_END
119
+ #define SEEK_END (2)
120
+ #endif
121
+
122
+
123
+ #ifndef RC_INVOKED
124
+
125
+ /*
126
+ * I used to include stdarg.h at this point, in order to allow for the
127
+ * functions later on in the file which use va_list. That conflicts with
128
+ * using stdio.h and varargs.h in the same file, so I do the typedef myself.
129
+ */
130
+ #ifndef _VA_LIST
131
+ #define _VA_LIST
132
+ #if defined __GNUC__ && __GNUC__ >= 3
133
+ typedef __builtin_va_list va_list;
134
+ #else
135
+ typedef char* va_list;
136
+ #endif
137
+ #endif
138
+ /*
139
+ * The structure underlying the FILE type.
140
+ *
141
+ * I still believe that nobody in their right mind should make use of the
142
+ * internals of this structure. Provided by Pedro A. Aranda Gutiirrez
143
+ * <paag@tid.es>.
144
+ */
145
+ #ifndef _FILE_DEFINED
146
+ #define _FILE_DEFINED
147
+ typedef struct _iobuf
148
+ {
149
+ char* _ptr;
150
+ int _cnt;
151
+ char* _base;
152
+ int _flag;
153
+ int _file;
154
+ int _charbuf;
155
+ int _bufsiz;
156
+ char* _tmpfname;
157
+ } FILE;
158
+ #endif /* Not _FILE_DEFINED */
159
+
160
+
161
+ /*
162
+ * The standard file handles
163
+ */
164
+ #ifndef __DECLSPEC_SUPPORTED
165
+
166
+ extern FILE (*__imp__iob)[]; /* A pointer to an array of FILE */
167
+
168
+ #define _iob (*__imp__iob) /* An array of FILE */
169
+
170
+ #else /* __DECLSPEC_SUPPORTED */
171
+
172
+ __MINGW_IMPORT FILE _iob[]; /* An array of FILE imported from DLL. */
173
+
174
+ #endif /* __DECLSPEC_SUPPORTED */
175
+
176
+ #define stdin (&_iob[STDIN_FILENO])
177
+ #define stdout (&_iob[STDOUT_FILENO])
178
+ #define stderr (&_iob[STDERR_FILENO])
179
+
180
+ #ifdef __cplusplus
181
+ extern "C" {
182
+ #endif
183
+
184
+ /*
185
+ * File Operations
186
+ */
187
+ FILE* fopen (const char*, const char*);
188
+ FILE* freopen (const char*, const char*, FILE*);
189
+ int fflush (FILE*);
190
+ int fclose (FILE*);
191
+ /* MS puts remove & rename (but not wide versions) in io.h also */
192
+ int remove (const char*);
193
+ int rename (const char*, const char*);
194
+ FILE* tmpfile (void);
195
+ char* tmpnam (char*);
196
+ char* _tempnam (const char*, const char*);
197
+
198
+ #ifndef NO_OLDNAMES
199
+ char* tempnam (const char*, const char*);
200
+ #endif
201
+
202
+ int setvbuf (FILE*, char*, int, size_t);
203
+
204
+ void setbuf (FILE*, char*);
205
+
206
+ /*
207
+ * Formatted Output
208
+ */
209
+
210
+ int fprintf (FILE*, const char*, ...);
211
+ int printf (const char*, ...);
212
+ int sprintf (char*, const char*, ...);
213
+ int _snprintf (char*, size_t, const char*, ...);
214
+ int vfprintf (FILE*, const char*, va_list);
215
+ int vprintf (const char*, va_list);
216
+ int vsprintf (char*, const char*, va_list);
217
+ int _vsnprintf (char*, size_t, const char*, va_list);
218
+
219
+ #ifndef __NO_ISOCEXT /* externs in libmingwex.a */
220
+ int snprintf(char* s, size_t n, const char* format, ...);
221
+ extern inline int vsnprintf (char* s, size_t n, const char* format,
222
+ va_list arg)
223
+ { return _vsnprintf ( s, n, format, arg); }
224
+ #endif
225
+
226
+ /*
227
+ * Formatted Input
228
+ */
229
+
230
+ int fscanf (FILE*, const char*, ...);
231
+ int scanf (const char*, ...);
232
+ int sscanf (const char*, const char*, ...);
233
+ /*
234
+ * Character Input and Output Functions
235
+ */
236
+
237
+ int fgetc (FILE*);
238
+ char* fgets (char*, int, FILE*);
239
+ int fputc (int, FILE*);
240
+ int fputs (const char*, FILE*);
241
+ int getc (FILE*);
242
+ int getchar (void);
243
+ char* gets (char*);
244
+ int putc (int, FILE*);
245
+ int putchar (int);
246
+ int puts (const char*);
247
+ int ungetc (int, FILE*);
248
+
249
+ /*
250
+ * Direct Input and Output Functions
251
+ */
252
+
253
+ size_t fread (void*, size_t, size_t, FILE*);
254
+ size_t fwrite (const void*, size_t, size_t, FILE*);
255
+
256
+ /*
257
+ * File Positioning Functions
258
+ */
259
+
260
+ int fseek (FILE*, long, int);
261
+ long ftell (FILE*);
262
+ void rewind (FILE*);
263
+
264
+ #ifdef __USE_MINGW_FSEEK /* These are in libmingwex.a */
265
+ /*
266
+ * Workaround for limitations on win9x where a file contents are
267
+ * not zero'd out if you seek past the end and then write.
268
+ */
269
+
270
+ int __mingw_fseek (FILE *, long, int);
271
+ int __mingw_fwrite (const void*, size_t, size_t, FILE*);
272
+ #define fseek(fp, offset, whence) __mingw_fseek(fp, offset, whence)
273
+ #define fwrite(buffer, size, count, fp) __mingw_fwrite(buffer, size, count, fp)
274
+ #endif /* __USE_MINGW_FSEEK */
275
+
276
+
277
+ /*
278
+ * An opaque data type used for storing file positions... The contents of
279
+ * this type are unknown, but we (the compiler) need to know the size
280
+ * because the programmer using fgetpos and fsetpos will be setting aside
281
+ * storage for fpos_t structres. Actually I tested using a byte array and
282
+ * it is fairly evident that the fpos_t type is a long (in CRTDLL.DLL).
283
+ * Perhaps an unsigned long? TODO? It's definitely a 64-bit number in
284
+ * MSVCRT however, and for now `long long' will do.
285
+ */
286
+ #ifdef __MSVCRT__
287
+ typedef long long fpos_t;
288
+ #else
289
+ typedef long fpos_t;
290
+ #endif
291
+
292
+ int fgetpos (FILE*, fpos_t*);
293
+ int fsetpos (FILE*, const fpos_t*);
294
+
295
+ /*
296
+ * Error Functions
297
+ */
298
+
299
+ void clearerr (FILE*);
300
+ int feof (FILE*);
301
+ int ferror (FILE*);
302
+ void perror (const char*);
303
+
304
+
305
+ #ifndef __STRICT_ANSI__
306
+ /*
307
+ * Pipes
308
+ */
309
+ FILE* _popen (const char*, const char*);
310
+ int _pclose (FILE*);
311
+
312
+ #ifndef NO_OLDNAMES
313
+ FILE* popen (const char*, const char*);
314
+ int pclose (FILE*);
315
+ #endif
316
+
317
+ /*
318
+ * Other Non ANSI functions
319
+ */
320
+ int _flushall (void);
321
+ int _fgetchar (void);
322
+ int _fputchar (int);
323
+ FILE* _fdopen (int, const char*);
324
+ int _fileno (FILE*);
325
+
326
+ #ifndef _NO_OLDNAMES
327
+ int fgetchar (void);
328
+ int fputchar (int);
329
+ FILE* fdopen (int, const char*);
330
+ int fileno (FILE*);
331
+ #endif /* Not _NO_OLDNAMES */
332
+
333
+ #endif /* Not __STRICT_ANSI__ */
334
+
335
+ /* Wide versions */
336
+
337
+ #ifndef _WSTDIO_DEFINED
338
+ /* also in wchar.h - keep in sync */
339
+ int fwprintf (FILE*, const wchar_t*, ...);
340
+ int wprintf (const wchar_t*, ...);
341
+ int swprintf (wchar_t*, const wchar_t*, ...);
342
+ int _snwprintf (wchar_t*, size_t, const wchar_t*, ...);
343
+ int vfwprintf (FILE*, const wchar_t*, va_list);
344
+ int vwprintf (const wchar_t*, va_list);
345
+ int vswprintf (wchar_t*, const wchar_t*, va_list);
346
+ int _vsnwprintf (wchar_t*, size_t, const wchar_t*, va_list);
347
+ int fwscanf (FILE*, const wchar_t*, ...);
348
+ int wscanf (const wchar_t*, ...);
349
+ int swscanf (const wchar_t*, const wchar_t*, ...);
350
+ wint_t fgetwc (FILE*);
351
+ wint_t fputwc (wchar_t, FILE*);
352
+ wint_t ungetwc (wchar_t, FILE*);
353
+ #ifdef __MSVCRT__
354
+ wchar_t* fgetws (wchar_t*, int, FILE*);
355
+ int fputws (const wchar_t*, FILE*);
356
+ wint_t getwc (FILE*);
357
+ wint_t getwchar (void);
358
+ wchar_t* _getws (wchar_t*);
359
+ wint_t putwc (wint_t, FILE*);
360
+ int _putws (const wchar_t*);
361
+ wint_t putwchar (wint_t);
362
+ FILE* _wfopen (const wchar_t*, const wchar_t*);
363
+ FILE* _wfreopen (const wchar_t*, const wchar_t*, FILE*);
364
+ FILE* _wfsopen (const wchar_t*, const wchar_t*, int);
365
+ wchar_t* _wtmpnam (wchar_t*);
366
+ wchar_t* _wtempnam (const wchar_t*, const wchar_t*);
367
+ int _wrename (const wchar_t*, const wchar_t*);
368
+ int _wremove (const wchar_t*);
369
+ void _wperror (const wchar_t*);
370
+ FILE* _wpopen (const wchar_t*, const wchar_t*);
371
+ #endif /* __MSVCRT__ */
372
+
373
+ #ifndef __NO_ISOCEXT /* externs in libmingwex.a */
374
+ int snwprintf(wchar_t* s, size_t n, const wchar_t* format, ...);
375
+ extern inline int vsnwprintf (wchar_t* s, size_t n, const wchar_t* format,
376
+ va_list arg)
377
+ { return _vsnwprintf ( s, n, format, arg); }
378
+ #endif
379
+
380
+ #define _WSTDIO_DEFINED
381
+ #endif /* _WSTDIO_DEFINED */
382
+
383
+ #ifndef __STRICT_ANSI__
384
+ #ifdef __MSVCRT__
385
+ #ifndef NO_OLDNAMES
386
+ FILE* wpopen (const wchar_t*, const wchar_t*);
387
+ #endif /* not NO_OLDNAMES */
388
+ #endif /* MSVCRT runtime */
389
+
390
+ /*
391
+ * Other Non ANSI wide functions
392
+ */
393
+ wint_t _fgetwchar (void);
394
+ wint_t _fputwchar (wint_t);
395
+ int _getw (FILE*);
396
+ int _putw (int, FILE*);
397
+
398
+ #ifndef _NO_OLDNAMES
399
+ wint_t fgetwchar (void);
400
+ wint_t fputwchar (wint_t);
401
+ int getw (FILE*);
402
+ int putw (int, FILE*);
403
+ #endif /* Not _NO_OLDNAMES */
404
+
405
+ #endif /* __STRICT_ANSI */
406
+
407
+ #ifdef __cplusplus
408
+ }
409
+ #endif
410
+
411
+ #endif /* Not RC_INVOKED */
412
+
413
+ #endif /* _STDIO_H_ */