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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4a7320c98d6c1987f62672c69a0d3925e6da1dd7dc2234ccaddbf754e26fb41e
4
- data.tar.gz: e7ee6f01a88ff81457934a2a2c0d2855c59be3f32a38725c82846c002faf0453
3
+ metadata.gz: d95467fb6126c24e1901048ce619fece73112dee058dfe3afd5f27cb8556eeda
4
+ data.tar.gz: 6a1254e64cb04b5fe90e9b7710ec743e0ee4b2068af0e336e55faa86de96923b
5
5
  SHA512:
6
- metadata.gz: 6a754e64422834d615d8e14109487217b1c4ae4a6e6f63ce8bb81eb58fc79a4f07aba7a238f118c9e4e70ea5985c77dfbbc317c155f2ba287fe6bde994cc3b32
7
- data.tar.gz: 9a9fcf18c7bd5966e3feab9537281d67f61b44d7ad71452d6c4fb6f9d3e30bd12f28021c365b26c2f4c95ae11157d632d20700b7e7fefcdefc2096658812da60
6
+ metadata.gz: 5e946a3e1f7253a5a9c1f4307403a8055298011f19839362eda189ed45f290da0a7201cf57823978f1253310228bc245c4a47c81836206409c4d55e6414c3857
7
+ data.tar.gz: 2afdb56601f91741a9e27d1759ed3436019e547466a461a51bf03405192b6e621da7ad74874ff0bdf497652f8c868eff993bbd7cbb279e5636f32b6152f94a5c
data/CHANGELOG.md CHANGED
@@ -1,23 +1,27 @@
1
- # Changelog
2
-
3
- ## [1.0] - 2025-03-27
4
- - First version of Standalone-Ruby released.
5
-
6
- ## [1.1] - 2025-03-28
7
- - Added support for projects with visual interfaces.
8
-
9
- ## [1.2] - 2025-04-02
10
- - Added .cmd file extension support.
11
- - Added options for new supports
12
- - Project text outputs corrected
13
- - Added launcher to lib folder
14
-
15
- ## [1.2.1] - 2025-04-03
16
- - Project text outputs corrected again
17
-
18
- ## [1.3] - 2025-04-04
19
- - Logger support has been added for testing purposes and will be adjusted later.
20
-
21
- ## [1.3.1] - 2025-04-04
22
- - Added platform analysis function
23
- - Logger support fixed
1
+ # Changelog
2
+
3
+ ## [1.0] - 2025-03-27
4
+ - First version of Standalone-Ruby released.
5
+
6
+ ## [1.1] - 2025-03-28
7
+ - Added support for projects with visual interfaces.
8
+
9
+ ## [1.2] - 2025-04-02
10
+ - Added .cmd file extension support.
11
+ - Added options for new supports
12
+ - Project text outputs corrected
13
+ - Added launcher to lib folder
14
+
15
+ ## [1.2.1] - 2025-04-03
16
+ - Project text outputs corrected again
17
+
18
+ ## [1.3] - 2025-04-04
19
+ - Logger support has been added for testing purposes and will be adjusted later.
20
+
21
+ ## [1.3.1] - 2025-04-04
22
+ - Added platform analysis function
23
+ - Logger support fixed
24
+
25
+ ## [1.4] - 2025-04-06
26
+ - Added exe support!
27
+ - Improvements have been made for non-GUI programs.
data/bin/standalone-ruby CHANGED
@@ -1,4 +1,4 @@
1
- require File.expand_path('../lib/standalone_ruby', __dir__)
2
-
3
- standalone_ruby = StandaloneRuby.new
1
+ require File.expand_path('../lib/standalone_ruby', __dir__)
2
+
3
+ standalone_ruby = StandaloneRuby.new
4
4
  standalone_ruby.run
@@ -0,0 +1,35 @@
1
+ #include <windows.h>
2
+
3
+ int main() {
4
+ // VBS dosyasının yolu
5
+ char command[] = "wscript.exe LAUNCHER_FILE";
6
+
7
+ // CreateProcess için gerekli yapı
8
+ STARTUPINFO si = {0};
9
+ PROCESS_INFORMATION pi = {0};
10
+
11
+ // CreateProcess fonksiyonu ile dış programı başlatıyoruz
12
+ if (CreateProcess(
13
+ NULL, // Uygulama adı (NULL olduğu için command parametresi kullanılır)
14
+ command, // Çalıştırılacak komut
15
+ NULL, // Güvenlik özellikleri
16
+ NULL, // Güvenlik özellikleri
17
+ FALSE, // Ebeveynin girdisini paylaşma
18
+ 0, // Çalıştırma bayrakları
19
+ NULL, // Çevre değişkenleri
20
+ NULL, // Çalıştırılacak dizin
21
+ &si, // Başlatma bilgisi
22
+ &pi // Süreç bilgisi
23
+ )) {
24
+ // Başarılıysa, sürecin tamamlanmasını bekleyelim
25
+ WaitForSingleObject(pi.hProcess, INFINITE);
26
+
27
+ // Sürecin bitişiyle ilgili bilgileri temizleyelim
28
+ CloseHandle(pi.hProcess);
29
+ CloseHandle(pi.hThread);
30
+ } else {
31
+
32
+ }
33
+
34
+ return 0;
35
+ }
@@ -0,0 +1,9 @@
1
+ #include <iostream>
2
+ #include <cstdlib>
3
+
4
+ int main() {
5
+ const char* command = "wscript.exe LAUNCHER_FILE";
6
+
7
+ int result = system(command);
8
+ return 0;
9
+ }
@@ -0,0 +1,54 @@
1
+ /*
2
+ * _mingw.h
3
+ *
4
+ * This file is for TCC-PE and not part of the Mingw32 package.
5
+ *
6
+ * THIS SOFTWARE IS NOT COPYRIGHTED
7
+ *
8
+ * This source code is offered for use in the public domain. You may
9
+ * use, modify or distribute it freely.
10
+ *
11
+ * This code is distributed in the hope that it will be useful but
12
+ * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
13
+ * DISCLAIMED. This includes but is not limited to warranties of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15
+ *
16
+ */
17
+
18
+ #ifndef __MINGW_H
19
+ #define __MINGW_H
20
+
21
+ #include <stddef.h>
22
+
23
+ #define __int64 long long
24
+ #define __int32 long
25
+ #define __int16 short
26
+ #define __int8 char
27
+ #define __cdecl __attribute__((__cdecl__))
28
+ #define __stdcall __attribute__((__stdcall__))
29
+ #define __declspec(x) __attribute__((x))
30
+
31
+ #define __MINGW32_VERSION 2.0
32
+ #define __MINGW32_MAJOR_VERSION 2
33
+ #define __MINGW32_MINOR_VERSION 0
34
+
35
+ #define __MSVCRT__ 1
36
+ #define __MINGW_IMPORT extern
37
+ #define _CRTIMP
38
+ #define __CRT_INLINE extern __inline__
39
+
40
+ #define WIN32 1
41
+
42
+ #ifndef _WINT_T
43
+ #define _WINT_T
44
+ typedef unsigned int wint_t;
45
+ #endif
46
+
47
+ /* for winapi */
48
+ #define _ANONYMOUS_UNION
49
+ #define _ANONYMOUS_STRUCT
50
+ #define DECLSPEC_NORETURN
51
+ #define WIN32_LEAN_AND_MEAN
52
+ #define DECLARE_STDCALL_P(type) __stdcall type
53
+
54
+ #endif /* __MINGW_H */
@@ -0,0 +1,71 @@
1
+ /*
2
+ * assert.h
3
+ *
4
+ * Define the assert macro for debug output.
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 _ASSERT_H_
28
+ #define _ASSERT_H_
29
+
30
+ /* All the headers include this file. */
31
+ #include <_mingw.h>
32
+
33
+ #ifndef RC_INVOKED
34
+
35
+ #ifdef __cplusplus
36
+ extern "C" {
37
+ #endif
38
+
39
+ #ifdef NDEBUG
40
+
41
+ /*
42
+ * If not debugging, assert does nothing.
43
+ */
44
+ #define assert(x) ((void)0)
45
+
46
+ #else /* debugging enabled */
47
+
48
+ /*
49
+ * CRTDLL nicely supplies a function which does the actual output and
50
+ * call to abort.
51
+ */
52
+ void _assert (const char*, const char*, int)
53
+ #ifdef __GNUC__
54
+ __attribute__ ((noreturn))
55
+ #endif
56
+ ;
57
+
58
+ /*
59
+ * Definition of the assert macro.
60
+ */
61
+ #define assert(e) ((e) ? (void)0 : _assert(#e, __FILE__, __LINE__))
62
+ #endif /* NDEBUG */
63
+
64
+ #ifdef __cplusplus
65
+ }
66
+ #endif
67
+
68
+ #endif /* Not RC_INVOKED */
69
+
70
+ #endif /* Not _ASSERT_H_ */
71
+
@@ -0,0 +1,159 @@
1
+ /* A conio implementation for Mingw/Dev-C++.
2
+ *
3
+ * Written by:
4
+ * Hongli Lai <hongli@telekabel.nl>
5
+ * tkorrovi <tkorrovi@altavista.net> on 2002/02/26.
6
+ * Andrew Westcott <ajwestco@users.sourceforge.net>
7
+ *
8
+ * Offered for use in the public domain without any warranty.
9
+ */
10
+
11
+ #ifndef _CONIO_H_
12
+ #define _CONIO_H_
13
+
14
+
15
+ #include <stdio.h>
16
+
17
+ #ifdef __cplusplus
18
+ extern "C" {
19
+ #endif
20
+
21
+ #define BLINK 0
22
+
23
+ typedef enum
24
+ {
25
+ BLACK,
26
+ BLUE,
27
+ GREEN,
28
+ CYAN,
29
+ RED,
30
+ MAGENTA,
31
+ BROWN,
32
+ LIGHTGRAY,
33
+ DARKGRAY,
34
+ LIGHTBLUE,
35
+ LIGHTGREEN,
36
+ LIGHTCYAN,
37
+ LIGHTRED,
38
+ LIGHTMAGENTA,
39
+ YELLOW,
40
+ WHITE
41
+ } COLORS;
42
+
43
+
44
+ #define cgets _cgets
45
+ #define cprintf _cprintf
46
+ #define cputs _cputs
47
+ #define cscanf _cscanf
48
+ #define ScreenClear clrscr
49
+
50
+ /* blinkvideo */
51
+
52
+ void clreol (void);
53
+ void clrscr (void);
54
+
55
+ int _conio_gettext (int left, int top, int right, int bottom,
56
+ char *str);
57
+ /* _conio_kbhit */
58
+
59
+ void delline (void);
60
+
61
+ /* gettextinfo */
62
+ void gotoxy(int x, int y);
63
+ /*
64
+ highvideo
65
+ insline
66
+ intensevideo
67
+ lowvideo
68
+ movetext
69
+ normvideo
70
+ */
71
+
72
+ void puttext (int left, int top, int right, int bottom, char *str);
73
+
74
+ // Screen Variables
75
+
76
+ /* ScreenCols
77
+ ScreenGetChar
78
+ ScreenGetCursor
79
+ ScreenMode
80
+ ScreenPutChar
81
+ ScreenPutString
82
+ ScreenRetrieve
83
+ ScreenRows
84
+ ScreenSetCursor
85
+ ScreenUpdate
86
+ ScreenUpdateLine
87
+ ScreenVisualBell
88
+ _set_screen_lines */
89
+
90
+ void _setcursortype (int type);
91
+
92
+ void textattr (int _attr);
93
+
94
+ void textbackground (int color);
95
+
96
+ void textcolor (int color);
97
+
98
+ /* textmode */
99
+
100
+ int wherex (void);
101
+
102
+ int wherey (void);
103
+
104
+ /* window */
105
+
106
+
107
+
108
+ /* The code below was part of Mingw's conio.h */
109
+ /*
110
+ * conio.h
111
+ *
112
+ * Low level console I/O functions. Pretty please try to use the ANSI
113
+ * standard ones if you are writing new code.
114
+ *
115
+ * This file is part of the Mingw32 package.
116
+ *
117
+ * Contributors:
118
+ * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
119
+ *
120
+ * THIS SOFTWARE IS NOT COPYRIGHTED
121
+ *
122
+ * This source code is offered for use in the public domain. You may
123
+ * use, modify or distribute it freely.
124
+ *
125
+ * This code is distributed in the hope that it will be useful but
126
+ * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
127
+ * DISCLAMED. This includes but is not limited to warranties of
128
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
129
+ *
130
+ * $Revision: 1.2 $
131
+ * $Author: bellard $
132
+ * $Date: 2005/04/17 13:14:29 $
133
+ *
134
+ */
135
+
136
+ char* _cgets (char*);
137
+ int _cprintf (const char*, ...);
138
+ int _cputs (const char*);
139
+ int _cscanf (char*, ...);
140
+
141
+ int _getch (void);
142
+ int _getche (void);
143
+ int _kbhit (void);
144
+ int _putch (int);
145
+ int _ungetch (int);
146
+
147
+
148
+ int getch (void);
149
+ int getche (void);
150
+ int kbhit (void);
151
+ int putch (int);
152
+ int ungetch (int);
153
+
154
+
155
+ #ifdef __cplusplus
156
+ }
157
+ #endif
158
+
159
+ #endif /* _CONIO_H_ */
@@ -0,0 +1,232 @@
1
+ /*
2
+ * ctype.h
3
+ *
4
+ * Functions for testing character types and converting characters.
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 _CTYPE_H_
28
+ #define _CTYPE_H_
29
+
30
+ /* All the headers include this file. */
31
+ #include <_mingw.h>
32
+
33
+ #define __need_wchar_t
34
+ #define __need_wint_t
35
+ #ifndef RC_INVOKED
36
+ #include <stddef.h>
37
+ #endif /* Not RC_INVOKED */
38
+
39
+
40
+ /*
41
+ * The following flags are used to tell iswctype and _isctype what character
42
+ * types you are looking for.
43
+ */
44
+ #define _UPPER 0x0001
45
+ #define _LOWER 0x0002
46
+ #define _DIGIT 0x0004
47
+ #define _SPACE 0x0008 /* HT LF VT FF CR SP */
48
+ #define _PUNCT 0x0010
49
+ #define _CONTROL 0x0020
50
+ #define _BLANK 0x0040 /* this is SP only, not SP and HT as in C99 */
51
+ #define _HEX 0x0080
52
+ #define _LEADBYTE 0x8000
53
+
54
+ #define _ALPHA 0x0103
55
+
56
+ #ifndef RC_INVOKED
57
+
58
+ #ifdef __cplusplus
59
+ extern "C" {
60
+ #endif
61
+
62
+ int isalnum(int);
63
+ int isalpha(int);
64
+ int iscntrl(int);
65
+ int isdigit(int);
66
+ int isgraph(int);
67
+ int islower(int);
68
+ int isprint(int);
69
+ int ispunct(int);
70
+ int isspace(int);
71
+ int isupper(int);
72
+ int isxdigit(int);
73
+
74
+ #ifndef __STRICT_ANSI__
75
+ int _isctype (int, int);
76
+ #endif
77
+
78
+ /* These are the ANSI versions, with correct checking of argument */
79
+ int tolower(int);
80
+ int toupper(int);
81
+
82
+ /*
83
+ * NOTE: The above are not old name type wrappers, but functions exported
84
+ * explicitly by MSVCRT/CRTDLL. However, underscored versions are also
85
+ * exported.
86
+ */
87
+ #ifndef __STRICT_ANSI__
88
+ /*
89
+ * These are the cheap non-std versions: The return values are undefined
90
+ * if the argument is not ASCII char or is not of appropriate case
91
+ */
92
+ int _tolower(int);
93
+ int _toupper(int);
94
+ #endif
95
+
96
+ /* Also defined in stdlib.h */
97
+ #ifndef MB_CUR_MAX
98
+ # ifdef __MSVCRT__
99
+ # define MB_CUR_MAX __mb_cur_max
100
+ __MINGW_IMPORT int __mb_cur_max;
101
+ # else /* not __MSVCRT */
102
+ # define MB_CUR_MAX __mb_cur_max_dll
103
+ __MINGW_IMPORT int __mb_cur_max_dll;
104
+ # endif /* not __MSVCRT */
105
+ #endif /* MB_CUR_MAX */
106
+
107
+ __MINGW_IMPORT unsigned short _ctype[];
108
+ #ifdef __MSVCRT__
109
+ __MINGW_IMPORT unsigned short* _pctype;
110
+ #else /* CRTDLL */
111
+ __MINGW_IMPORT unsigned short* _pctype_dll;
112
+ #define _pctype _pctype_dll
113
+ #endif
114
+
115
+ /*
116
+ * Use inlines here rather than macros, because macros will upset
117
+ * C++ usage (eg, ::isalnum), and so usually get undefined
118
+ *
119
+ * According to standard for SB chars, these function are defined only
120
+ * for input values representable by unsigned char or EOF.
121
+ * Thus, there is no range test.
122
+ * This reproduces behaviour of MSVCRT.dll lib implemention for SB chars.
123
+ *
124
+ * If no MB char support is needed, these can be simplified even
125
+ * more by command line define -DMB_CUR_MAX=1. The compiler will then
126
+ * optimise away the constant condition.
127
+ */
128
+
129
+
130
+ #if ! (defined (__NO_CTYPE_INLINES) || defined (__STRICT_ANSI__ ))
131
+ /* use simple lookup if SB locale, else _isctype() */
132
+ #define __ISCTYPE(c, mask) (MB_CUR_MAX == 1 ? (_pctype[c] & mask) : _isctype(c, mask))
133
+ extern __inline__ int isalnum(int c) {return __ISCTYPE(c, (_ALPHA|_DIGIT));}
134
+ extern __inline__ int isalpha(int c) {return __ISCTYPE(c, _ALPHA);}
135
+ extern __inline__ int iscntrl(int c) {return __ISCTYPE(c, _CONTROL);}
136
+ extern __inline__ int isdigit(int c) {return __ISCTYPE(c, _DIGIT);}
137
+ extern __inline__ int isgraph(int c) {return __ISCTYPE(c, (_PUNCT|_ALPHA|_DIGIT));}
138
+ extern __inline__ int islower(int c) {return __ISCTYPE(c, _LOWER);}
139
+ extern __inline__ int isprint(int c) {return __ISCTYPE(c, (_BLANK|_PUNCT|_ALPHA|_DIGIT));}
140
+ extern __inline__ int ispunct(int c) {return __ISCTYPE(c, _PUNCT);}
141
+ extern __inline__ int isspace(int c) {return __ISCTYPE(c, _SPACE);}
142
+ extern __inline__ int isupper(int c) {return __ISCTYPE(c, _UPPER);}
143
+ extern __inline__ int isxdigit(int c) {return __ISCTYPE(c, _HEX);}
144
+
145
+ /* these reproduce behaviour of lib underscored versions */
146
+ extern __inline__ int _tolower(int c) {return ( c -'A'+'a');}
147
+ extern __inline__ int _toupper(int c) {return ( c -'a'+'A');}
148
+
149
+ /* TODO? Is it worth inlining ANSI tolower, toupper? Probably only
150
+ if we only want C-locale. */
151
+
152
+ #endif /* _NO_CTYPE_INLINES */
153
+
154
+ /* Wide character equivalents */
155
+
156
+ #ifndef WEOF
157
+ #define WEOF (wchar_t)(0xFFFF)
158
+ #endif
159
+
160
+ #ifndef _WCTYPE_T_DEFINED
161
+ typedef wchar_t wctype_t;
162
+ #define _WCTYPE_T_DEFINED
163
+ #endif
164
+
165
+ int iswalnum(wint_t);
166
+ int iswalpha(wint_t);
167
+ int iswascii(wint_t);
168
+ int iswcntrl(wint_t);
169
+ int iswctype(wint_t, wctype_t);
170
+ int is_wctype(wint_t, wctype_t); /* Obsolete! */
171
+ int iswdigit(wint_t);
172
+ int iswgraph(wint_t);
173
+ int iswlower(wint_t);
174
+ int iswprint(wint_t);
175
+ int iswpunct(wint_t);
176
+ int iswspace(wint_t);
177
+ int iswupper(wint_t);
178
+ int iswxdigit(wint_t);
179
+
180
+ wchar_t towlower(wchar_t);
181
+ wchar_t towupper(wchar_t);
182
+
183
+ int isleadbyte (int);
184
+
185
+ /* Also in wctype.h */
186
+ #if ! (defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED))
187
+ #define __WCTYPE_INLINES_DEFINED
188
+ extern __inline__ int iswalnum(wint_t wc) {return (iswctype(wc,_ALPHA|_DIGIT));}
189
+ extern __inline__ int iswalpha(wint_t wc) {return (iswctype(wc,_ALPHA));}
190
+ extern __inline__ int iswascii(wint_t wc) {return (((unsigned)wc & 0x7F) ==0);}
191
+ extern __inline__ int iswcntrl(wint_t wc) {return (iswctype(wc,_CONTROL));}
192
+ extern __inline__ int iswdigit(wint_t wc) {return (iswctype(wc,_DIGIT));}
193
+ extern __inline__ int iswgraph(wint_t wc) {return (iswctype(wc,_PUNCT|_ALPHA|_DIGIT));}
194
+ extern __inline__ int iswlower(wint_t wc) {return (iswctype(wc,_LOWER));}
195
+ extern __inline__ int iswprint(wint_t wc) {return (iswctype(wc,_BLANK|_PUNCT|_ALPHA|_DIGIT));}
196
+ extern __inline__ int iswpunct(wint_t wc) {return (iswctype(wc,_PUNCT));}
197
+ extern __inline__ int iswspace(wint_t wc) {return (iswctype(wc,_SPACE));}
198
+ extern __inline__ int iswupper(wint_t wc) {return (iswctype(wc,_UPPER));}
199
+ extern __inline__ int iswxdigit(wint_t wc) {return (iswctype(wc,_HEX));}
200
+ extern __inline__ int isleadbyte(int c) {return (_pctype[(unsigned char)(c)] & _LEADBYTE);}
201
+ #endif /* !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED)) */
202
+
203
+ #ifndef __STRICT_ANSI__
204
+ int __isascii (int);
205
+ int __toascii (int);
206
+ int __iscsymf (int); /* Valid first character in C symbol */
207
+ int __iscsym (int); /* Valid character in C symbol (after first) */
208
+
209
+ #ifndef __NO_CTYPE_INLINES
210
+ extern __inline__ int __isascii(int c) {return (((unsigned)c & ~0x7F) == 0);}
211
+ extern __inline__ int __toascii(int c) {return (c & 0x7F);}
212
+ extern __inline__ int __iscsymf(int c) {return (isalpha(c) || (c == '_'));}
213
+ extern __inline__ int __iscsym(int c) {return (isalnum(c) || (c == '_'));}
214
+ #endif /* __NO_CTYPE_INLINES */
215
+
216
+ #ifndef _NO_OLDNAMES
217
+ int isascii (int);
218
+ int toascii (int);
219
+ int iscsymf (int);
220
+ int iscsym (int);
221
+ #endif /* Not _NO_OLDNAMES */
222
+
223
+ #endif /* Not __STRICT_ANSI__ */
224
+
225
+ #ifdef __cplusplus
226
+ }
227
+ #endif
228
+
229
+ #endif /* Not RC_INVOKED */
230
+
231
+ #endif /* Not _CTYPE_H_ */
232
+
@@ -0,0 +1,26 @@
1
+ /*
2
+ * dir.h
3
+ *
4
+ * This file OBSOLESCENT and only provided for backward compatibility.
5
+ * Please use io.h instead.
6
+ *
7
+ * This file is part of the Mingw32 package.
8
+ *
9
+ * Contributors:
10
+ * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
11
+ * Mumit Khan <khan@xraylith.wisc.edu>
12
+ *
13
+ * THIS SOFTWARE IS NOT COPYRIGHTED
14
+ *
15
+ * This source code is offered for use in the public domain. You may
16
+ * use, modify or distribute it freely.
17
+ *
18
+ * This code is distributed in the hope that it will be useful but
19
+ * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
20
+ * DISCLAIMED. This includes but is not limited to warranties of
21
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22
+ *
23
+ */
24
+
25
+ #include <io.h>
26
+