triton-windows 3.3.0a0.post11__cp310-cp310-win_amd64.whl → 3.3.0a0.post13__cp310-cp310-win_amd64.whl

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.

Potentially problematic release.


This version of triton-windows might be problematic. Click here for more details.

Files changed (101) hide show
  1. triton/_C/libtriton.pyd +0 -0
  2. triton/__init__.py +0 -12
  3. triton/backends/nvidia/compiler.py +3 -1
  4. triton/backends/nvidia/driver.py +4 -4
  5. triton/compiler/compiler.py +4 -4
  6. triton/runtime/build.py +29 -10
  7. triton/runtime/tcc/include/_mingw.h +170 -0
  8. triton/runtime/tcc/include/assert.h +57 -0
  9. triton/runtime/tcc/include/conio.h +409 -0
  10. triton/runtime/tcc/include/ctype.h +281 -0
  11. triton/runtime/tcc/include/dir.h +31 -0
  12. triton/runtime/tcc/include/direct.h +68 -0
  13. triton/runtime/tcc/include/dirent.h +135 -0
  14. triton/runtime/tcc/include/dos.h +55 -0
  15. triton/runtime/tcc/include/errno.h +75 -0
  16. triton/runtime/tcc/include/excpt.h +123 -0
  17. triton/runtime/tcc/include/fcntl.h +52 -0
  18. triton/runtime/tcc/include/fenv.h +108 -0
  19. triton/runtime/tcc/include/float.h +57 -0
  20. triton/runtime/tcc/include/inttypes.h +297 -0
  21. triton/runtime/tcc/include/io.h +418 -0
  22. triton/runtime/tcc/include/limits.h +111 -0
  23. triton/runtime/tcc/include/locale.h +91 -0
  24. triton/runtime/tcc/include/malloc.h +181 -0
  25. triton/runtime/tcc/include/math.h +737 -0
  26. triton/runtime/tcc/include/mem.h +13 -0
  27. triton/runtime/tcc/include/memory.h +40 -0
  28. triton/runtime/tcc/include/process.h +176 -0
  29. triton/runtime/tcc/include/sec_api/conio_s.h +42 -0
  30. triton/runtime/tcc/include/sec_api/crtdbg_s.h +19 -0
  31. triton/runtime/tcc/include/sec_api/io_s.h +33 -0
  32. triton/runtime/tcc/include/sec_api/mbstring_s.h +52 -0
  33. triton/runtime/tcc/include/sec_api/search_s.h +25 -0
  34. triton/runtime/tcc/include/sec_api/stdio_s.h +145 -0
  35. triton/runtime/tcc/include/sec_api/stdlib_s.h +67 -0
  36. triton/runtime/tcc/include/sec_api/stralign_s.h +30 -0
  37. triton/runtime/tcc/include/sec_api/string_s.h +41 -0
  38. triton/runtime/tcc/include/sec_api/sys/timeb_s.h +34 -0
  39. triton/runtime/tcc/include/sec_api/tchar_s.h +266 -0
  40. triton/runtime/tcc/include/sec_api/time_s.h +61 -0
  41. triton/runtime/tcc/include/sec_api/wchar_s.h +128 -0
  42. triton/runtime/tcc/include/setjmp.h +160 -0
  43. triton/runtime/tcc/include/share.h +28 -0
  44. triton/runtime/tcc/include/signal.h +63 -0
  45. triton/runtime/tcc/include/stdarg.h +79 -0
  46. triton/runtime/tcc/include/stdbool.h +11 -0
  47. triton/runtime/tcc/include/stddef.h +54 -0
  48. triton/runtime/tcc/include/stdint.h +212 -0
  49. triton/runtime/tcc/include/stdio.h +429 -0
  50. triton/runtime/tcc/include/stdlib.h +580 -0
  51. triton/runtime/tcc/include/string.h +164 -0
  52. triton/runtime/tcc/include/sys/fcntl.h +13 -0
  53. triton/runtime/tcc/include/sys/file.h +14 -0
  54. triton/runtime/tcc/include/sys/locking.h +30 -0
  55. triton/runtime/tcc/include/sys/stat.h +290 -0
  56. triton/runtime/tcc/include/sys/time.h +69 -0
  57. triton/runtime/tcc/include/sys/timeb.h +133 -0
  58. triton/runtime/tcc/include/sys/types.h +118 -0
  59. triton/runtime/tcc/include/sys/unistd.h +14 -0
  60. triton/runtime/tcc/include/sys/utime.h +146 -0
  61. triton/runtime/tcc/include/tcc/tcc_libm.h +201 -0
  62. triton/runtime/tcc/include/tcclib.h +80 -0
  63. triton/runtime/tcc/include/tchar.h +1102 -0
  64. triton/runtime/tcc/include/time.h +287 -0
  65. triton/runtime/tcc/include/vadefs.h +11 -0
  66. triton/runtime/tcc/include/values.h +4 -0
  67. triton/runtime/tcc/include/varargs.h +12 -0
  68. triton/runtime/tcc/include/wchar.h +873 -0
  69. triton/runtime/tcc/include/wctype.h +172 -0
  70. triton/runtime/tcc/include/winapi/basetsd.h +149 -0
  71. triton/runtime/tcc/include/winapi/basetyps.h +85 -0
  72. triton/runtime/tcc/include/winapi/guiddef.h +156 -0
  73. triton/runtime/tcc/include/winapi/poppack.h +8 -0
  74. triton/runtime/tcc/include/winapi/pshpack1.h +8 -0
  75. triton/runtime/tcc/include/winapi/pshpack2.h +8 -0
  76. triton/runtime/tcc/include/winapi/pshpack4.h +8 -0
  77. triton/runtime/tcc/include/winapi/pshpack8.h +8 -0
  78. triton/runtime/tcc/include/winapi/winbase.h +2951 -0
  79. triton/runtime/tcc/include/winapi/wincon.h +301 -0
  80. triton/runtime/tcc/include/winapi/windef.h +293 -0
  81. triton/runtime/tcc/include/winapi/windows.h +127 -0
  82. triton/runtime/tcc/include/winapi/winerror.h +3166 -0
  83. triton/runtime/tcc/include/winapi/wingdi.h +4080 -0
  84. triton/runtime/tcc/include/winapi/winnt.h +5835 -0
  85. triton/runtime/tcc/include/winapi/winreg.h +272 -0
  86. triton/runtime/tcc/include/winapi/winuser.h +5651 -0
  87. triton/runtime/tcc/include/winapi/winver.h +160 -0
  88. triton/runtime/tcc/lib/cuda.def +697 -0
  89. triton/runtime/tcc/lib/gdi32.def +337 -0
  90. triton/runtime/tcc/lib/kernel32.def +770 -0
  91. triton/runtime/tcc/lib/libtcc1-64.a +0 -0
  92. triton/runtime/tcc/lib/msvcrt.def +1399 -0
  93. triton/runtime/tcc/lib/python3.def +810 -0
  94. triton/runtime/tcc/lib/user32.def +658 -0
  95. triton/runtime/tcc/libtcc.dll +0 -0
  96. triton/runtime/tcc/tcc.exe +0 -0
  97. triton/windows_utils.py +78 -80
  98. {triton_windows-3.3.0a0.post11.dist-info → triton_windows-3.3.0a0.post13.dist-info}/METADATA +1 -1
  99. {triton_windows-3.3.0a0.post11.dist-info → triton_windows-3.3.0a0.post13.dist-info}/RECORD +101 -11
  100. {triton_windows-3.3.0a0.post11.dist-info → triton_windows-3.3.0a0.post13.dist-info}/WHEEL +0 -0
  101. {triton_windows-3.3.0a0.post11.dist-info → triton_windows-3.3.0a0.post13.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,409 @@
1
+ /**
2
+ * This file has no copyright assigned and is placed in the Public Domain.
3
+ * This file is part of the w64 mingw-runtime package.
4
+ * No warranty is given; refer to the file DISCLAIMER within this package.
5
+ */
6
+ #ifndef _INC_CONIO
7
+ #define _INC_CONIO
8
+
9
+ #include <_mingw.h>
10
+
11
+ #ifdef __cplusplus
12
+ extern "C" {
13
+ #endif
14
+
15
+ _CRTIMP char *_cgets(char *_Buffer);
16
+ _CRTIMP int __cdecl _cprintf(const char *_Format,...);
17
+ _CRTIMP int __cdecl _cputs(const char *_Str);
18
+ _CRTIMP int __cdecl _cscanf(const char *_Format,...);
19
+ _CRTIMP int __cdecl _cscanf_l(const char *_Format,_locale_t _Locale,...);
20
+ _CRTIMP int __cdecl _getch(void);
21
+ _CRTIMP int __cdecl _getche(void);
22
+ _CRTIMP int __cdecl _vcprintf(const char *_Format,va_list _ArgList);
23
+ _CRTIMP int __cdecl _cprintf_p(const char *_Format,...);
24
+ _CRTIMP int __cdecl _vcprintf_p(const char *_Format,va_list _ArgList);
25
+ _CRTIMP int __cdecl _cprintf_l(const char *_Format,_locale_t _Locale,...);
26
+ _CRTIMP int __cdecl _vcprintf_l(const char *_Format,_locale_t _Locale,va_list _ArgList);
27
+ _CRTIMP int __cdecl _cprintf_p_l(const char *_Format,_locale_t _Locale,...);
28
+ _CRTIMP int __cdecl _vcprintf_p_l(const char *_Format,_locale_t _Locale,va_list _ArgList);
29
+ _CRTIMP int __cdecl _kbhit(void);
30
+
31
+ #if defined(_X86_) && !defined(__x86_64)
32
+ int __cdecl _inp(unsigned short);
33
+ unsigned short __cdecl _inpw(unsigned short);
34
+ unsigned long __cdecl _inpd(unsigned short);
35
+ int __cdecl _outp(unsigned short,int);
36
+ unsigned short __cdecl _outpw(unsigned short,unsigned short);
37
+ unsigned long __cdecl _outpd(unsigned short,unsigned long);
38
+ #endif
39
+
40
+ _CRTIMP int __cdecl _putch(int _Ch);
41
+ _CRTIMP int __cdecl _ungetch(int _Ch);
42
+ _CRTIMP int __cdecl _getch_nolock(void);
43
+ _CRTIMP int __cdecl _getche_nolock(void);
44
+ _CRTIMP int __cdecl _putch_nolock(int _Ch);
45
+ _CRTIMP int __cdecl _ungetch_nolock(int _Ch);
46
+
47
+ #ifndef _WCONIO_DEFINED
48
+ #define _WCONIO_DEFINED
49
+
50
+ #ifndef WEOF
51
+ #define WEOF (wint_t)(0xFFFF)
52
+ #endif
53
+
54
+ _CRTIMP wchar_t *_cgetws(wchar_t *_Buffer);
55
+ _CRTIMP wint_t __cdecl _getwch(void);
56
+ _CRTIMP wint_t __cdecl _getwche(void);
57
+ _CRTIMP wint_t __cdecl _putwch(wchar_t _WCh);
58
+ _CRTIMP wint_t __cdecl _ungetwch(wint_t _WCh);
59
+ _CRTIMP int __cdecl _cputws(const wchar_t *_String);
60
+ _CRTIMP int __cdecl _cwprintf(const wchar_t *_Format,...);
61
+ _CRTIMP int __cdecl _cwscanf(const wchar_t *_Format,...);
62
+ _CRTIMP int __cdecl _cwscanf_l(const wchar_t *_Format,_locale_t _Locale,...);
63
+ _CRTIMP int __cdecl _vcwprintf(const wchar_t *_Format,va_list _ArgList);
64
+ _CRTIMP int __cdecl _cwprintf_p(const wchar_t *_Format,...);
65
+ _CRTIMP int __cdecl _vcwprintf_p(const wchar_t *_Format,va_list _ArgList);
66
+ _CRTIMP int __cdecl _cwprintf_l(const wchar_t *_Format,_locale_t _Locale,...);
67
+ _CRTIMP int __cdecl _vcwprintf_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
68
+ _CRTIMP int __cdecl _cwprintf_p_l(const wchar_t *_Format,_locale_t _Locale,...);
69
+ _CRTIMP int __cdecl _vcwprintf_p_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
70
+ _CRTIMP wint_t __cdecl _putwch_nolock(wchar_t _WCh);
71
+ _CRTIMP wint_t __cdecl _getwch_nolock(void);
72
+ _CRTIMP wint_t __cdecl _getwche_nolock(void);
73
+ _CRTIMP wint_t __cdecl _ungetwch_nolock(wint_t _WCh);
74
+ #endif
75
+
76
+ #ifndef NO_OLDNAMES
77
+ char *__cdecl cgets(char *_Buffer);
78
+ int __cdecl cprintf(const char *_Format,...);
79
+ int __cdecl cputs(const char *_Str);
80
+ int __cdecl cscanf(const char *_Format,...);
81
+ int __cdecl getch(void);
82
+ int __cdecl getche(void);
83
+ int __cdecl kbhit(void);
84
+ int __cdecl putch(int _Ch);
85
+ int __cdecl ungetch(int _Ch);
86
+
87
+ #if (defined(_X86_) && !defined(__x86_64))
88
+ int __cdecl inp(unsigned short);
89
+ unsigned short __cdecl inpw(unsigned short);
90
+ int __cdecl outp(unsigned short,int);
91
+ unsigned short __cdecl outpw(unsigned short,unsigned short);
92
+ #endif
93
+
94
+ /* I/O intrin functions. */
95
+ __CRT_INLINE unsigned char __inbyte(unsigned short Port)
96
+ {
97
+ unsigned char value;
98
+ __asm__ __volatile__ ("inb %w1,%b0"
99
+ : "=a" (value)
100
+ : "Nd" (Port));
101
+ return value;
102
+ }
103
+ __CRT_INLINE unsigned short __inword(unsigned short Port)
104
+ {
105
+ unsigned short value;
106
+ __asm__ __volatile__ ("inw %w1,%w0"
107
+ : "=a" (value)
108
+ : "Nd" (Port));
109
+ return value;
110
+ }
111
+ __CRT_INLINE unsigned long __indword(unsigned short Port)
112
+ {
113
+ unsigned long value;
114
+ __asm__ __volatile__ ("inl %w1,%0"
115
+ : "=a" (value)
116
+ : "Nd" (Port));
117
+ return value;
118
+ }
119
+ __CRT_INLINE void __outbyte(unsigned short Port,unsigned char Data)
120
+ {
121
+ __asm__ __volatile__ ("outb %b0,%w1"
122
+ :
123
+ : "a" (Data), "Nd" (Port));
124
+ }
125
+ __CRT_INLINE void __outword(unsigned short Port,unsigned short Data)
126
+ {
127
+ __asm__ __volatile__ ("outw %w0,%w1"
128
+ :
129
+ : "a" (Data), "Nd" (Port));
130
+ }
131
+ __CRT_INLINE void __outdword(unsigned short Port,unsigned long Data)
132
+ {
133
+ __asm__ __volatile__ ("outl %0,%w1"
134
+ :
135
+ : "a" (Data), "Nd" (Port));
136
+ }
137
+ __CRT_INLINE void __inbytestring(unsigned short Port,unsigned char *Buffer,unsigned long Count)
138
+ {
139
+ __asm__ __volatile__ (
140
+ "cld ; rep ; insb "
141
+ : "=D" (Buffer), "=c" (Count)
142
+ : "d"(Port), "0"(Buffer), "1" (Count)
143
+ );
144
+ }
145
+ __CRT_INLINE void __inwordstring(unsigned short Port,unsigned short *Buffer,unsigned long Count)
146
+ {
147
+ __asm__ __volatile__ (
148
+ "cld ; rep ; insw "
149
+ : "=D" (Buffer), "=c" (Count)
150
+ : "d"(Port), "0"(Buffer), "1" (Count)
151
+ );
152
+ }
153
+ __CRT_INLINE void __indwordstring(unsigned short Port,unsigned long *Buffer,unsigned long Count)
154
+ {
155
+ __asm__ __volatile__ (
156
+ "cld ; rep ; insl "
157
+ : "=D" (Buffer), "=c" (Count)
158
+ : "d"(Port), "0"(Buffer), "1" (Count)
159
+ );
160
+ }
161
+
162
+ __CRT_INLINE void __outbytestring(unsigned short Port,unsigned char *Buffer,unsigned long Count)
163
+ {
164
+ __asm__ __volatile__ (
165
+ "cld ; rep ; outsb "
166
+ : "=S" (Buffer), "=c" (Count)
167
+ : "d"(Port), "0"(Buffer), "1" (Count)
168
+ );
169
+ }
170
+ __CRT_INLINE void __outwordstring(unsigned short Port,unsigned short *Buffer,unsigned long Count)
171
+ {
172
+ __asm__ __volatile__ (
173
+ "cld ; rep ; outsw "
174
+ : "=S" (Buffer), "=c" (Count)
175
+ : "d"(Port), "0"(Buffer), "1" (Count)
176
+ );
177
+ }
178
+ __CRT_INLINE void __outdwordstring(unsigned short Port,unsigned long *Buffer,unsigned long Count)
179
+ {
180
+ __asm__ __volatile__ (
181
+ "cld ; rep ; outsl "
182
+ : "=S" (Buffer), "=c" (Count)
183
+ : "d"(Port), "0"(Buffer), "1" (Count)
184
+ );
185
+ }
186
+
187
+ __CRT_INLINE unsigned __int64 __readcr0(void)
188
+ {
189
+ unsigned __int64 value;
190
+ __asm__ __volatile__ (
191
+ "mov %%cr0, %[value]"
192
+ : [value] "=q" (value));
193
+ return value;
194
+ }
195
+
196
+ /* Register sizes are different between 32/64 bit mode. So we have to do this for _WIN64 and _WIN32
197
+ separately. */
198
+
199
+ #ifdef _WIN64
200
+ __CRT_INLINE void __writecr0(unsigned __int64 Data)
201
+ {
202
+ __asm__ __volatile__ (
203
+ "mov %[Data], %%cr0"
204
+ :
205
+ : [Data] "q" (Data)
206
+ : "memory");
207
+ }
208
+
209
+ __CRT_INLINE unsigned __int64 __readcr2(void)
210
+ {
211
+ unsigned __int64 value;
212
+ __asm__ __volatile__ (
213
+ "mov %%cr2, %[value]"
214
+ : [value] "=q" (value));
215
+ return value;
216
+ }
217
+
218
+ __CRT_INLINE void __writecr2(unsigned __int64 Data)
219
+ {
220
+ __asm__ __volatile__ (
221
+ "mov %[Data], %%cr2"
222
+ :
223
+ : [Data] "q" (Data)
224
+ : "memory");
225
+ }
226
+
227
+ __CRT_INLINE unsigned __int64 __readcr3(void)
228
+ {
229
+ unsigned __int64 value;
230
+ __asm__ __volatile__ (
231
+ "mov %%cr3, %[value]"
232
+ : [value] "=q" (value));
233
+ return value;
234
+ }
235
+
236
+ __CRT_INLINE void __writecr3(unsigned __int64 Data)
237
+ {
238
+ __asm__ __volatile__ (
239
+ "mov %[Data], %%cr3"
240
+ :
241
+ : [Data] "q" (Data)
242
+ : "memory");
243
+ }
244
+
245
+ __CRT_INLINE unsigned __int64 __readcr4(void)
246
+ {
247
+ unsigned __int64 value;
248
+ __asm__ __volatile__ (
249
+ "mov %%cr4, %[value]"
250
+ : [value] "=q" (value));
251
+ return value;
252
+ }
253
+
254
+ __CRT_INLINE void __writecr4(unsigned __int64 Data)
255
+ {
256
+ __asm__ __volatile__ (
257
+ "mov %[Data], %%cr4"
258
+ :
259
+ : [Data] "q" (Data)
260
+ : "memory");
261
+ }
262
+
263
+ __CRT_INLINE unsigned __int64 __readcr8(void)
264
+ {
265
+ unsigned __int64 value;
266
+ __asm__ __volatile__ (
267
+ "mov %%cr8, %[value]"
268
+ : [value] "=q" (value));
269
+ return value;
270
+ }
271
+
272
+ __CRT_INLINE void __writecr8(unsigned __int64 Data)
273
+ {
274
+ __asm__ __volatile__ (
275
+ "mov %[Data], %%cr8"
276
+ :
277
+ : [Data] "q" (Data)
278
+ : "memory");
279
+ }
280
+
281
+ #elif defined(_WIN32)
282
+
283
+ __CRT_INLINE void __writecr0(unsigned Data)
284
+ {
285
+ __asm__ __volatile__ (
286
+ "mov %[Data], %%cr0"
287
+ :
288
+ : [Data] "q" (Data)
289
+ : "memory");
290
+ }
291
+
292
+ __CRT_INLINE unsigned long __readcr2(void)
293
+ {
294
+ unsigned long value;
295
+ __asm__ __volatile__ (
296
+ "mov %%cr2, %[value]"
297
+ : [value] "=q" (value));
298
+ return value;
299
+ }
300
+
301
+ __CRT_INLINE void __writecr2(unsigned Data)
302
+ {
303
+ __asm__ __volatile__ (
304
+ "mov %[Data], %%cr2"
305
+ :
306
+ : [Data] "q" (Data)
307
+ : "memory");
308
+ }
309
+
310
+ __CRT_INLINE unsigned long __readcr3(void)
311
+ {
312
+ unsigned long value;
313
+ __asm__ __volatile__ (
314
+ "mov %%cr3, %[value]"
315
+ : [value] "=q" (value));
316
+ return value;
317
+ }
318
+
319
+ __CRT_INLINE void __writecr3(unsigned Data)
320
+ {
321
+ __asm__ __volatile__ (
322
+ "mov %[Data], %%cr3"
323
+ :
324
+ : [Data] "q" (Data)
325
+ : "memory");
326
+ }
327
+
328
+ __CRT_INLINE unsigned long __readcr4(void)
329
+ {
330
+ unsigned long value;
331
+ __asm__ __volatile__ (
332
+ "mov %%cr4, %[value]"
333
+ : [value] "=q" (value));
334
+ return value;
335
+ }
336
+
337
+ __CRT_INLINE void __writecr4(unsigned Data)
338
+ {
339
+ __asm__ __volatile__ (
340
+ "mov %[Data], %%cr4"
341
+ :
342
+ : [Data] "q" (Data)
343
+ : "memory");
344
+ }
345
+
346
+ __CRT_INLINE unsigned long __readcr8(void)
347
+ {
348
+ unsigned long value; __asm__ __volatile__ (
349
+ "mov %%cr8, %[value]"
350
+ : [value] "=q" (value));
351
+ return value;
352
+ }
353
+
354
+ __CRT_INLINE void __writecr8(unsigned Data)
355
+ {
356
+ __asm__ __volatile__ (
357
+ "mov %[Data], %%cr8"
358
+ :
359
+ : [Data] "q" (Data)
360
+ : "memory");
361
+ }
362
+
363
+ #endif
364
+
365
+ __CRT_INLINE unsigned __int64 __readmsr(unsigned long msr)
366
+ {
367
+ unsigned __int64 val1, val2;
368
+ __asm__ __volatile__(
369
+ "rdmsr"
370
+ : "=a" (val1), "=d" (val2)
371
+ : "c" (msr));
372
+ return val1 | (val2 << 32);
373
+ }
374
+
375
+ __CRT_INLINE void __writemsr (unsigned long msr, unsigned __int64 Value)
376
+ {
377
+ unsigned long val1 = Value, val2 = Value >> 32;
378
+ __asm__ __volatile__ (
379
+ "wrmsr"
380
+ :
381
+ : "c" (msr), "a" (val1), "d" (val2));
382
+ }
383
+
384
+ __CRT_INLINE unsigned __int64 __rdtsc(void)
385
+ {
386
+ unsigned __int64 val1, val2;
387
+ __asm__ __volatile__ (
388
+ "rdtsc"
389
+ : "=a" (val1), "=d" (val2));
390
+ return val1 | (val2 << 32);
391
+ }
392
+
393
+ __CRT_INLINE void __cpuid(int CPUInfo[4], int InfoType)
394
+ {
395
+ __asm__ __volatile__ (
396
+ "cpuid"
397
+ : "=a" (CPUInfo [0]), "=b" (CPUInfo [1]), "=c" (CPUInfo [2]), "=d" (CPUInfo [3])
398
+ : "a" (InfoType));
399
+ }
400
+
401
+ #endif
402
+
403
+ #ifdef __cplusplus
404
+ }
405
+ #endif
406
+
407
+ #include <sec_api/conio_s.h>
408
+
409
+ #endif
@@ -0,0 +1,281 @@
1
+ /**
2
+ * This file has no copyright assigned and is placed in the Public Domain.
3
+ * This file is part of the w64 mingw-runtime package.
4
+ * No warranty is given; refer to the file DISCLAIMER within this package.
5
+ */
6
+ #ifndef _INC_CTYPE
7
+ #define _INC_CTYPE
8
+
9
+ #include <_mingw.h>
10
+
11
+ #ifdef __cplusplus
12
+ extern "C" {
13
+ #endif
14
+
15
+ #ifndef WEOF
16
+ #define WEOF (wint_t)(0xFFFF)
17
+ #endif
18
+
19
+ #ifndef _CRT_CTYPEDATA_DEFINED
20
+ #define _CRT_CTYPEDATA_DEFINED
21
+ #ifndef _CTYPE_DISABLE_MACROS
22
+
23
+ #ifndef __PCTYPE_FUNC
24
+ #define __PCTYPE_FUNC __pctype_func()
25
+ #ifdef _MSVCRT_
26
+ #define __pctype_func() (_pctype)
27
+ #else
28
+ #define __pctype_func() (*_imp___pctype)
29
+ #endif
30
+ #endif
31
+
32
+ #ifndef _pctype
33
+ #ifdef _MSVCRT_
34
+ extern unsigned short *_pctype;
35
+ #else
36
+ extern unsigned short **_imp___pctype;
37
+ #define _pctype (*_imp___pctype)
38
+ #endif
39
+ #endif
40
+
41
+ #endif
42
+ #endif
43
+
44
+ #ifndef _CRT_WCTYPEDATA_DEFINED
45
+ #define _CRT_WCTYPEDATA_DEFINED
46
+ #ifndef _CTYPE_DISABLE_MACROS
47
+ #ifndef _wctype
48
+ #ifdef _MSVCRT_
49
+ extern unsigned short *_wctype;
50
+ #else
51
+ extern unsigned short **_imp___wctype;
52
+ #define _wctype (*_imp___wctype)
53
+ #endif
54
+ #endif
55
+ #ifdef _MSVCRT_
56
+ #define __pwctype_func() (_pwctype)
57
+ #ifndef _pwctype
58
+ extern unsigned short *_pwctype;
59
+ #endif
60
+ #else
61
+ #define __pwctype_func() (*_imp___pwctype)
62
+ #ifndef _pwctype
63
+ extern unsigned short **_imp___pwctype;
64
+ #define _pwctype (*_imp___pwctype)
65
+ #endif
66
+ #endif
67
+ #endif
68
+ #endif
69
+
70
+ /* CRT stuff */
71
+ #if 1
72
+ extern const unsigned char __newclmap[];
73
+ extern const unsigned char __newcumap[];
74
+ extern pthreadlocinfo __ptlocinfo;
75
+ extern pthreadmbcinfo __ptmbcinfo;
76
+ extern int __globallocalestatus;
77
+ extern int __locale_changed;
78
+ extern struct threadlocaleinfostruct __initiallocinfo;
79
+ extern _locale_tstruct __initiallocalestructinfo;
80
+ pthreadlocinfo __cdecl __updatetlocinfo(void);
81
+ pthreadmbcinfo __cdecl __updatetmbcinfo(void);
82
+ #endif
83
+
84
+ #define _UPPER 0x1
85
+ #define _LOWER 0x2
86
+ #define _DIGIT 0x4
87
+ #define _SPACE 0x8
88
+
89
+ #define _PUNCT 0x10
90
+ #define _CONTROL 0x20
91
+ #define _BLANK 0x40
92
+ #define _HEX 0x80
93
+
94
+ #define _LEADBYTE 0x8000
95
+ #define _ALPHA (0x0100|_UPPER|_LOWER)
96
+
97
+ #ifndef _CTYPE_DEFINED
98
+ #define _CTYPE_DEFINED
99
+
100
+ _CRTIMP int __cdecl _isctype(int _C,int _Type);
101
+ _CRTIMP int __cdecl _isctype_l(int _C,int _Type,_locale_t _Locale);
102
+ _CRTIMP int __cdecl isalpha(int _C);
103
+ _CRTIMP int __cdecl _isalpha_l(int _C,_locale_t _Locale);
104
+ _CRTIMP int __cdecl isupper(int _C);
105
+ _CRTIMP int __cdecl _isupper_l(int _C,_locale_t _Locale);
106
+ _CRTIMP int __cdecl islower(int _C);
107
+ _CRTIMP int __cdecl _islower_l(int _C,_locale_t _Locale);
108
+ _CRTIMP int __cdecl isdigit(int _C);
109
+ _CRTIMP int __cdecl _isdigit_l(int _C,_locale_t _Locale);
110
+ _CRTIMP int __cdecl isxdigit(int _C);
111
+ _CRTIMP int __cdecl _isxdigit_l(int _C,_locale_t _Locale);
112
+ _CRTIMP int __cdecl isspace(int _C);
113
+ _CRTIMP int __cdecl _isspace_l(int _C,_locale_t _Locale);
114
+ _CRTIMP int __cdecl ispunct(int _C);
115
+ _CRTIMP int __cdecl _ispunct_l(int _C,_locale_t _Locale);
116
+ _CRTIMP int __cdecl isalnum(int _C);
117
+ _CRTIMP int __cdecl _isalnum_l(int _C,_locale_t _Locale);
118
+ _CRTIMP int __cdecl isprint(int _C);
119
+ _CRTIMP int __cdecl _isprint_l(int _C,_locale_t _Locale);
120
+ _CRTIMP int __cdecl isgraph(int _C);
121
+ _CRTIMP int __cdecl _isgraph_l(int _C,_locale_t _Locale);
122
+ _CRTIMP int __cdecl iscntrl(int _C);
123
+ _CRTIMP int __cdecl _iscntrl_l(int _C,_locale_t _Locale);
124
+ _CRTIMP int __cdecl toupper(int _C);
125
+ _CRTIMP int __cdecl tolower(int _C);
126
+ _CRTIMP int __cdecl _tolower(int _C);
127
+ _CRTIMP int __cdecl _tolower_l(int _C,_locale_t _Locale);
128
+ _CRTIMP int __cdecl _toupper(int _C);
129
+ _CRTIMP int __cdecl _toupper_l(int _C,_locale_t _Locale);
130
+ _CRTIMP int __cdecl __isascii(int _C);
131
+ _CRTIMP int __cdecl __toascii(int _C);
132
+ _CRTIMP int __cdecl __iscsymf(int _C);
133
+ _CRTIMP int __cdecl __iscsym(int _C);
134
+
135
+ #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || !defined (NO_OLDNAMES)
136
+ int __cdecl isblank(int _C);
137
+ #endif
138
+ #endif
139
+
140
+ #ifndef _WCTYPE_DEFINED
141
+ #define _WCTYPE_DEFINED
142
+
143
+ int __cdecl iswalpha(wint_t _C);
144
+ _CRTIMP int __cdecl _iswalpha_l(wint_t _C,_locale_t _Locale);
145
+ int __cdecl iswupper(wint_t _C);
146
+ _CRTIMP int __cdecl _iswupper_l(wint_t _C,_locale_t _Locale);
147
+ int __cdecl iswlower(wint_t _C);
148
+ _CRTIMP int __cdecl _iswlower_l(wint_t _C,_locale_t _Locale);
149
+ int __cdecl iswdigit(wint_t _C);
150
+ _CRTIMP int __cdecl _iswdigit_l(wint_t _C,_locale_t _Locale);
151
+ int __cdecl iswxdigit(wint_t _C);
152
+ _CRTIMP int __cdecl _iswxdigit_l(wint_t _C,_locale_t _Locale);
153
+ int __cdecl iswspace(wint_t _C);
154
+ _CRTIMP int __cdecl _iswspace_l(wint_t _C,_locale_t _Locale);
155
+ int __cdecl iswpunct(wint_t _C);
156
+ _CRTIMP int __cdecl _iswpunct_l(wint_t _C,_locale_t _Locale);
157
+ int __cdecl iswalnum(wint_t _C);
158
+ _CRTIMP int __cdecl _iswalnum_l(wint_t _C,_locale_t _Locale);
159
+ int __cdecl iswprint(wint_t _C);
160
+ _CRTIMP int __cdecl _iswprint_l(wint_t _C,_locale_t _Locale);
161
+ int __cdecl iswgraph(wint_t _C);
162
+ _CRTIMP int __cdecl _iswgraph_l(wint_t _C,_locale_t _Locale);
163
+ int __cdecl iswcntrl(wint_t _C);
164
+ _CRTIMP int __cdecl _iswcntrl_l(wint_t _C,_locale_t _Locale);
165
+ int __cdecl iswascii(wint_t _C);
166
+ int __cdecl isleadbyte(int _C);
167
+ _CRTIMP int __cdecl _isleadbyte_l(int _C,_locale_t _Locale);
168
+ wint_t __cdecl towupper(wint_t _C);
169
+ _CRTIMP wint_t __cdecl _towupper_l(wint_t _C,_locale_t _Locale);
170
+ wint_t __cdecl towlower(wint_t _C);
171
+ _CRTIMP wint_t __cdecl _towlower_l(wint_t _C,_locale_t _Locale);
172
+ int __cdecl iswctype(wint_t _C,wctype_t _Type);
173
+ _CRTIMP int __cdecl _iswctype_l(wint_t _C,wctype_t _Type,_locale_t _Locale);
174
+ _CRTIMP int __cdecl __iswcsymf(wint_t _C);
175
+ _CRTIMP int __cdecl _iswcsymf_l(wint_t _C,_locale_t _Locale);
176
+ _CRTIMP int __cdecl __iswcsym(wint_t _C);
177
+ _CRTIMP int __cdecl _iswcsym_l(wint_t _C,_locale_t _Locale);
178
+ int __cdecl is_wctype(wint_t _C,wctype_t _Type);
179
+
180
+ #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || !defined (NO_OLDNAMES)
181
+ int __cdecl iswblank(wint_t _C);
182
+ #endif
183
+ #endif
184
+
185
+ #ifndef _CTYPE_DISABLE_MACROS
186
+
187
+ #ifndef MB_CUR_MAX
188
+ #define MB_CUR_MAX ___mb_cur_max_func()
189
+ #ifndef __mb_cur_max
190
+ #ifdef _MSVCRT_
191
+ extern int __mb_cur_max;
192
+ #else
193
+ #define __mb_cur_max (*_imp____mb_cur_max)
194
+ extern int *_imp____mb_cur_max;
195
+ #endif
196
+ #endif
197
+ #ifdef _MSVCRT_
198
+ #define ___mb_cur_max_func() (__mb_cur_max)
199
+ #else
200
+ #define ___mb_cur_max_func() (*_imp____mb_cur_max)
201
+ #endif
202
+ #endif
203
+
204
+ #define __chvalidchk(a,b) (__PCTYPE_FUNC[(a)] & (b))
205
+ #define _chvalidchk_l(_Char,_Flag,_Locale) (!_Locale ? __chvalidchk(_Char,_Flag) : ((_locale_t)_Locale)->locinfo->pctype[_Char] & (_Flag))
206
+ #define _ischartype_l(_Char,_Flag,_Locale) (((_Locale)!=NULL && (((_locale_t)(_Locale))->locinfo->mb_cur_max) > 1) ? _isctype_l(_Char,(_Flag),_Locale) : _chvalidchk_l(_Char,_Flag,_Locale))
207
+ #define _isalpha_l(_Char,_Locale) _ischartype_l(_Char,_ALPHA,_Locale)
208
+ #define _isupper_l(_Char,_Locale) _ischartype_l(_Char,_UPPER,_Locale)
209
+ #define _islower_l(_Char,_Locale) _ischartype_l(_Char,_LOWER,_Locale)
210
+ #define _isdigit_l(_Char,_Locale) _ischartype_l(_Char,_DIGIT,_Locale)
211
+ #define _isxdigit_l(_Char,_Locale) _ischartype_l(_Char,_HEX,_Locale)
212
+ #define _isspace_l(_Char,_Locale) _ischartype_l(_Char,_SPACE,_Locale)
213
+ #define _ispunct_l(_Char,_Locale) _ischartype_l(_Char,_PUNCT,_Locale)
214
+ #define _isalnum_l(_Char,_Locale) _ischartype_l(_Char,_ALPHA|_DIGIT,_Locale)
215
+ #define _isprint_l(_Char,_Locale) _ischartype_l(_Char,_BLANK|_PUNCT|_ALPHA|_DIGIT,_Locale)
216
+ #define _isgraph_l(_Char,_Locale) _ischartype_l(_Char,_PUNCT|_ALPHA|_DIGIT,_Locale)
217
+ #define _iscntrl_l(_Char,_Locale) _ischartype_l(_Char,_CONTROL,_Locale)
218
+ #define _tolower(_Char) ((_Char)-'A'+'a')
219
+ #define _toupper(_Char) ((_Char)-'a'+'A')
220
+ #define __isascii(_Char) ((unsigned)(_Char) < 0x80)
221
+ #define __toascii(_Char) ((_Char) & 0x7f)
222
+
223
+ #ifndef _WCTYPE_INLINE_DEFINED
224
+ #define _WCTYPE_INLINE_DEFINED
225
+
226
+ #undef _CRT_WCTYPE_NOINLINE
227
+ #ifndef __cplusplus
228
+ #define iswalpha(_c) (iswctype(_c,_ALPHA))
229
+ #define iswupper(_c) (iswctype(_c,_UPPER))
230
+ #define iswlower(_c) (iswctype(_c,_LOWER))
231
+ #define iswdigit(_c) (iswctype(_c,_DIGIT))
232
+ #define iswxdigit(_c) (iswctype(_c,_HEX))
233
+ #define iswspace(_c) (iswctype(_c,_SPACE))
234
+ #define iswpunct(_c) (iswctype(_c,_PUNCT))
235
+ #define iswalnum(_c) (iswctype(_c,_ALPHA|_DIGIT))
236
+ #define iswprint(_c) (iswctype(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT))
237
+ #define iswgraph(_c) (iswctype(_c,_PUNCT|_ALPHA|_DIGIT))
238
+ #define iswcntrl(_c) (iswctype(_c,_CONTROL))
239
+ #define iswascii(_c) ((unsigned)(_c) < 0x80)
240
+ #define _iswalpha_l(_c,_p) (_iswctype_l(_c,_ALPHA,_p))
241
+ #define _iswupper_l(_c,_p) (_iswctype_l(_c,_UPPER,_p))
242
+ #define _iswlower_l(_c,_p) (_iswctype_l(_c,_LOWER,_p))
243
+ #define _iswdigit_l(_c,_p) (_iswctype_l(_c,_DIGIT,_p))
244
+ #define _iswxdigit_l(_c,_p) (_iswctype_l(_c,_HEX,_p))
245
+ #define _iswspace_l(_c,_p) (_iswctype_l(_c,_SPACE,_p))
246
+ #define _iswpunct_l(_c,_p) (_iswctype_l(_c,_PUNCT,_p))
247
+ #define _iswalnum_l(_c,_p) (_iswctype_l(_c,_ALPHA|_DIGIT,_p))
248
+ #define _iswprint_l(_c,_p) (_iswctype_l(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT,_p))
249
+ #define _iswgraph_l(_c,_p) (_iswctype_l(_c,_PUNCT|_ALPHA|_DIGIT,_p))
250
+ #define _iswcntrl_l(_c,_p) (_iswctype_l(_c,_CONTROL,_p))
251
+ #endif
252
+ #endif
253
+
254
+ #define __iscsymf(_c) (isalpha(_c) || ((_c)=='_'))
255
+ #define __iscsym(_c) (isalnum(_c) || ((_c)=='_'))
256
+ #define __iswcsymf(_c) (iswalpha(_c) || ((_c)=='_'))
257
+ #define __iswcsym(_c) (iswalnum(_c) || ((_c)=='_'))
258
+ #define _iscsymf_l(_c,_p) (_isalpha_l(_c,_p) || ((_c)=='_'))
259
+ #define _iscsym_l(_c,_p) (_isalnum_l(_c,_p) || ((_c)=='_'))
260
+ #define _iswcsymf_l(_c,_p) (_iswalpha_l(_c,_p) || ((_c)=='_'))
261
+ #define _iswcsym_l(_c,_p) (_iswalnum_l(_c,_p) || ((_c)=='_'))
262
+ #endif
263
+
264
+ #ifndef NO_OLDNAMES
265
+ #ifndef _CTYPE_DEFINED
266
+ int __cdecl isascii(int _C);
267
+ int __cdecl toascii(int _C);
268
+ int __cdecl iscsymf(int _C);
269
+ int __cdecl iscsym(int _C);
270
+ #else
271
+ #define isascii __isascii
272
+ #define toascii __toascii
273
+ #define iscsymf __iscsymf
274
+ #define iscsym __iscsym
275
+ #endif
276
+ #endif
277
+
278
+ #ifdef __cplusplus
279
+ }
280
+ #endif
281
+ #endif