History

win64: use new headers from mingw

grischka committed 17 years ago

Commit dc251a71 parent 06aed3d91 files · +32103 −17293Browse files

Unified · Split

91 files
  1. Makefile +2 −2
  2. include/stdarg.h +9 −3
  3. include/varargs.h +7 −6
  4. win32/include/_mingw.h +73 −11
  5. win32/include/assert.h +37 −54
  6. win32/include/conio.h +392 −142
  7. win32/include/ctype.h +256 −207
  8. win32/include/dir.h +5 −0
  9. win32/include/direct.h +46 −73
  10. win32/include/dirent.h +108 −69
  11. win32/include/dos.h +34 −89
  12. win32/include/errno.h +63 −105
  13. win32/include/excpt.h +118 −15
  14. win32/include/fcntl.h +45 −128
  15. win32/include/fenv.h +62 −39
  16. win32/include/float.h +0 −224
  17. win32/include/inttypes.h +45 −23
  18. win32/include/io.h +367 −245
  19. win32/include/limits.h +98 −102
  20. win32/include/locale.h +75 −84
  21. win32/include/malloc.h +156 −66
  22. win32/include/math.h +669 −330
  23. win32/include/mem.h +5 −0
  24. win32/include/memory.h +37 −6
  25. win32/include/process.h +159 −141
  26. win32/include/sec_api/conio_s.h +42 −0
  27. win32/include/sec_api/crtdbg_s.h +19 −0
  28. win32/include/sec_api/io_s.h +33 −0
  29. win32/include/sec_api/mbstring_s.h +52 −0
  30. win32/include/sec_api/search_s.h +25 −0
  31. win32/include/sec_api/stdio_s.h +145 −0
  32. win32/include/sec_api/stdlib_s.h +67 −0
  33. win32/include/sec_api/stralign_s.h +30 −0
  34. win32/include/sec_api/string_s.h +41 −0
  35. win32/include/sec_api/sys/timeb_s.h +34 −0
  36. win32/include/sec_api/tchar_s.h +266 −0
  37. win32/include/sec_api/time_s.h +61 −0
  38. win32/include/sec_api/wchar_s.h +128 −0
  39. win32/include/setjmp.h +141 −53
  40. win32/include/share.h +23 −39
  41. win32/include/signal.h +46 −94
  42. win32/include/stdarg.h +0 −19
  43. win32/include/stdbool.h +0 −10
  44. win32/include/stddef.h +0 −23
  45. win32/include/stdint.h +41 −16
  46. win32/include/stdio.h +371 −355
  47. win32/include/stdlib.h +502 −404
  48. win32/include/string.h +146 −188
  49. win32/include/sys/fcntl.h +5 −0
  50. win32/include/sys/file.h +5 −0
  51. win32/include/sys/locking.h +22 −44
  52. win32/include/sys/stat.h +247 −149
  53. win32/include/sys/time.h +66 −0
  54. win32/include/sys/timeb.h +111 −63
  55. win32/include/sys/types.h +79 −81
  56. win32/include/sys/unistd.h +5 −0
  57. win32/include/sys/utime.h +124 −69
  58. win32/include/tchar.h +1069 −334
  59. win32/include/time.h +243 −176
  60. win32/include/unistd.h +30 −0
  61. win32/include/vadefs.h +11 −0
  62. win32/include/varargs.h +0 −11
  63. win32/include/wchar.h +813 −260
  64. win32/include/wctype.h +150 −105
  65. win32/include/winapi/basetsd.h +134 −104
  66. win32/include/winapi/basetyps.h +67 −126
  67. win32/include/winapi/guiddef.h +151 −0
  68. win32/include/winapi/intrin.h +11 −0
  69. win32/include/winapi/poppack.h +8 −0
  70. win32/include/winapi/pshpack1.h +8 −0
  71. win32/include/winapi/pshpack2.h +8 −0
  72. win32/include/winapi/pshpack4.h +8 −0
  73. win32/include/winapi/pshpack8.h +8 −0
  74. win32/include/winapi/reason.h +80 −0
  75. win32/include/winapi/specstrings.h +7 −0
  76. win32/include/winapi/stralign.h +154 −0
  77. win32/include/winapi/tvout.h +79 −0
  78. win32/include/winapi/winbase.h +2894 −1795
  79. win32/include/winapi/wincon.h +268 −174
  80. win32/include/winapi/windef.h +239 −186
  81. win32/include/winapi/windows.h +85 −138
  82. win32/include/winapi/winerror.h +2446 −334
  83. win32/include/winapi/wingdi.h +3861 −2624
  84. win32/include/winapi/winnetwk.h +418 −288
  85. win32/include/winapi/winnls.h +588 −474
  86. win32/include/winapi/winnt.h +5612 −2509
  87. win32/include/winapi/winreg.h +219 −106
  88. win32/include/winapi/winsvc.h +351 −263
  89. win32/include/winapi/winuser.h +5589 −3410
  90. win32/include/winapi/winver.h +132 −105
  91. win32/lib/msvcrt.def +617 −0
Makefile+2−2
@@ -177,7 +177,7 @@ VPATH+=lib · 176 unmodified lines
177ifdef CONFIG_WIN32177ifdef CONFIG_WIN32
178# for windows, we must use TCC because we generate ELF objects178# for windows, we must use TCC because we generate ELF objects
179LIBTCC1_OBJS+=crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o179LIBTCC1_OBJS+=crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o
180LIBTCC1_CC=./tcc.exe -Bwin32 -DTCC_TARGET_PE180LIBTCC1_CC=./tcc.exe -Bwin32 -Iinclude $(NATIVE_TARGET)
181VPATH+=win32/lib181VPATH+=win32/lib
182endif182endif
183ifeq ($(ARCH),i386)183ifeq ($(ARCH),i386)
@@ -245,7 +245,7 @@ install: $(PROGS) $(LIBTCC1) libtcc.a tcc-doc.html · 61 unmodified lines
245 $(INSTALL) -m644 $(LIBTCC1) win32/lib/*.def "$(tccdir)/lib"245 $(INSTALL) -m644 $(LIBTCC1) win32/lib/*.def "$(tccdir)/lib"
246 cp -r win32/include/. "$(tccdir)/include"246 cp -r win32/include/. "$(tccdir)/include"
247 cp -r win32/examples/. "$(tccdir)/examples"247 cp -r win32/examples/. "$(tccdir)/examples"
248# $(INSTALL) -m644 $(addprefix include/,$(TCC_INCLUDES)) "$(tccdir)/include"248 $(INSTALL) -m644 $(addprefix include/,$(TCC_INCLUDES)) "$(tccdir)/include"
249 $(INSTALL) -m644 tcc-doc.html win32/tcc-win32.txt "$(tccdir)/doc"249 $(INSTALL) -m644 tcc-doc.html win32/tcc-win32.txt "$(tccdir)/doc"
250 $(INSTALL) -m644 libtcc.a libtcc.h "$(tccdir)/libtcc"250 $(INSTALL) -m644 libtcc.a libtcc.h "$(tccdir)/libtcc"
251endif251endif
include/stdarg.h+9−3
@@ -2,6 +2,7 @@ · 1 unmodified line
2#define _STDARG_H2#define _STDARG_H
3 3
4#ifdef __x86_64__4#ifdef __x86_64__
5#ifndef _WIN64
5#include <stdlib.h>6#include <stdlib.h>
6 7
7/* GCC compatible definition of va_list. */8/* GCC compatible definition of va_list. */
@@ -48,16 +49,21 @@ typedef struct __va_list_struct *va_list; · 40 unmodified lines
48 *(dest) = *(src))49 *(dest) = *(src))
49#define va_end(ap) __builtin_free(ap)50#define va_end(ap) __builtin_free(ap)
50 51
51#else52#else /* _WIN64 */
52
53typedef char *va_list;53typedef char *va_list;
54#define va_start(ap,last) ap = ((char *)&(last)) + ((sizeof(last)+7)&~7)
55#define va_arg(ap,type) (ap += (sizeof(type)+7)&~7, *(type *)(ap - ((sizeof(type)+7)&~7)))
56#define va_copy(dest, src) (dest) = (src)
57#define va_end(ap)
58#endif
54 59
60#else /* __i386__ */
61typedef char *va_list;
55/* only correct for i386 */62/* only correct for i386 */
56#define va_start(ap,last) ap = ((char *)&(last)) + ((sizeof(last)+3)&~3)63#define va_start(ap,last) ap = ((char *)&(last)) + ((sizeof(last)+3)&~3)
57#define va_arg(ap,type) (ap += (sizeof(type)+3)&~3, *(type *)(ap - ((sizeof(type)+3)&~3)))64#define va_arg(ap,type) (ap += (sizeof(type)+3)&~3, *(type *)(ap - ((sizeof(type)+3)&~3)))
58#define va_copy(dest, src) (dest) = (src)65#define va_copy(dest, src) (dest) = (src)
59#define va_end(ap)66#define va_end(ap)
60
61#endif67#endif
62 68
63/* fix a buggy dependency on GCC in libio.h */69/* fix a buggy dependency on GCC in libio.h */
include/varargs.h+7−6
@@ -1,11 +1,12 @@
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 */
1#ifndef _VARARGS_H6#ifndef _VARARGS_H
2#define _VARARGS_H7#define _VARARGS_H
3 8
4#include <stdarg.h>9#error "TinyCC no longer implements <varargs.h>."
5 10#error "Revise your code to use <stdarg.h>."
6#define va_dcl
7#define va_alist __va_alist
8#undef va_start
9#define va_start(ap) ap = __builtin_varargs_start
10 11
11#endif12#endif
win32/include/_mingw.h+73−11
@@ -1,7 +1,7 @@
1/*1/*
2 * _mingw.h2 * _mingw.h
3 *3 *
4 * This file is for TCC-PE and not part of the Mingw32 package.4 * This file is for TinyCC and not part of the Mingw32 package.
5 *5 *
6 * THIS SOFTWARE IS NOT COPYRIGHTED6 * THIS SOFTWARE IS NOT COPYRIGHTED
7 *7 *
@@ -24,25 +24,75 @@ · 16 unmodified lines
24#define __int32 long24#define __int32 long
25#define __int16 short25#define __int16 short
26#define __int8 char26#define __int8 char
27
27#define __cdecl __attribute__((__cdecl__))28#define __cdecl __attribute__((__cdecl__))
28#define __stdcall __attribute__((__stdcall__))
29#define __declspec(x) __attribute__((x))29#define __declspec(x) __attribute__((x))
30#define __fastcall
31
32// #define __MINGW_IMPORT extern __declspec(dllimport)
30 33
31#define __MINGW32_VERSION 2.034#undef _MSVCRT_
32#define __MINGW32_MAJOR_VERSION 235#undef __MINGW_IMPORT
33#define __MINGW32_MINOR_VERSION 0
34 36
35#define __MSVCRT__ 137#define _CRTIMP extern
36#define __MINGW_IMPORT extern
37#define _CRTIMP
38#define __CRT_INLINE extern __inline__38#define __CRT_INLINE extern __inline__
39#define __MINGW_NOTHROW
40#define __MINGW_ATTRIB_NORETURN
41#define __MINGW_ATTRIB_DEPRECATED
42#define __GNUC_VA_LIST
43
44#define _CONST_RETURN
45#define _CRT_ALIGN(x) __attribute__((aligned(x)))
46#define DECLSPEC_ALIGN(x) __attribute__((aligned(x)))
47
48#define __CRT_STRINGIZE(_Value) #_Value
49#define _CRT_STRINGIZE(_Value) __CRT_STRINGIZE(_Value)
39 50
51#define __CRT_WIDE(_String) L ## _String
52#define _CRT_WIDE(_String) __CRT_WIDE(_String)
53
54#ifdef _WIN64
55typedef __int64 intptr_t;
56typedef unsigned __int64 uintptr_t;
57#define __stdcall
58#define _AMD64_ 1
59#define __x86_64 1
60#else
61typedef __int32 intptr_t;
62typedef unsigned __int32 uintptr_t;
63#define __stdcall __attribute__((__stdcall__))
64#define _X86_ 1
40#define WIN32 165#define WIN32 1
66#endif
41 67
42#ifndef _WINT_T68#define _INTEGRAL_MAX_BITS 64
43#define _WINT_T69#define _CRT_PACKING 8
44typedef unsigned int wint_t;70
71typedef long __time32_t;
72#define _TIME32_T_DEFINED
73typedef __int64 __time64_t;
74#define _TIME64_T_DEFINED
75
76#ifdef _USE_32BIT_TIME_T
77#ifdef _WIN64
78#error You cannot use 32-bit time_t (_USE_32BIT_TIME_T) with _WIN64
79#endif
80typedef __time32_t time_t;
81#else
82typedef __time64_t time_t;
45#endif83#endif
84#define _TIME_T_DEFINED
85
86#define _WCTYPE_T_DEFINED
87typedef unsigned int wint_t;
88typedef unsigned short wctype_t;
89
90#define _ERRCODE_DEFINED
91typedef int errno_t;
92
93typedef struct threadlocaleinfostruct *pthreadlocinfo;
94typedef struct threadmbcinfostruct *pthreadmbcinfo;
95typedef struct localeinfo_struct _locale_tstruct,*_locale_t;
46 96
47/* for winapi */97/* for winapi */
48#define _ANONYMOUS_UNION98#define _ANONYMOUS_UNION
@@ -50,5 +100,17 @@ typedef unsigned int wint_t; · 1 unmodified line
50#define DECLSPEC_NORETURN100#define DECLSPEC_NORETURN
51#define WIN32_LEAN_AND_MEAN101#define WIN32_LEAN_AND_MEAN
52#define DECLARE_STDCALL_P(type) __stdcall type102#define DECLARE_STDCALL_P(type) __stdcall type
103#define NOSERVICE 1
104#define NOMCX 1
105#define NOIME 1
106#ifndef WINVER
107#define WINVER 0x0502
108#endif
109#ifndef _WIN32_WINNT
110#define _WIN32_WINNT 0x502
111#endif
112
113/* get va_list */
114#include <stdarg.h>
53 115
54#endif /* __MINGW_H */116#endif /* __MINGW_H */
win32/include/assert.h+37−54
@@ -1,71 +1,54 @@
1/* 1/**
2 * assert.h2 * This file has no copyright assigned and is placed in the Public Domain.
3 *3 * This file is part of the w64 mingw-runtime package.
4 * Define the assert macro for debug output.4 * No warranty is given; refer to the file DISCLAIMER within this package.
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 */5 */
6#ifndef __ASSERT_H_
7#define __ASSERT_H_
26 8
27#ifndef _ASSERT_H_
28#define _ASSERT_H_
29
30/* All the headers include this file. */
31#include <_mingw.h>9#include <_mingw.h>
32 10#ifdef __cplusplus
33#ifndef RC_INVOKED11#include <stdlib.h>
34
35#ifdef __cplusplus
36extern "C" {
37#endif12#endif
38 13
39#ifdef NDEBUG14#ifdef NDEBUG
15#ifndef assert
16#define assert(_Expression) ((void)0)
17#endif
18#else
19
20#ifndef _CRT_TERMINATE_DEFINED
21#define _CRT_TERMINATE_DEFINED
22 void __cdecl __MINGW_NOTHROW exit(int _Code) __MINGW_ATTRIB_NORETURN;
23 _CRTIMP void __cdecl __MINGW_NOTHROW _exit(int _Code) __MINGW_ATTRIB_NORETURN;
24#if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */
25/* C99 function name */
26void __cdecl _Exit(int) __MINGW_ATTRIB_NORETURN;
27__CRT_INLINE __MINGW_ATTRIB_NORETURN void __cdecl _Exit(int status)
28{ _exit(status); }
29#endif
40 30
41/*31#pragma push_macro("abort")
42 * If not debugging, assert does nothing.32#undef abort
43 */33 void __cdecl __declspec(noreturn) abort(void);
44#define assert(x) ((void)0)34#pragma pop_macro("abort")
45 35
46#else /* debugging enabled */36#endif
47 37
48/*38#ifdef __cplusplus
49 * CRTDLL nicely supplies a function which does the actual output and39extern "C" {
50 * call to abort.
51 */
52void _assert (const char*, const char*, int)
53#ifdef __GNUC__
54 __attribute__ ((noreturn))
55#endif40#endif
56 ;
57 41
58/*42extern void __cdecl _wassert(const wchar_t *_Message,const wchar_t *_File,unsigned _Line);
59 * Definition of the assert macro.
60 */
61#define assert(e) ((e) ? (void)0 : _assert(#e, __FILE__, __LINE__))
62#endif /* NDEBUG */
63 43
64#ifdef __cplusplus44#ifdef __cplusplus
65}45}
66#endif46#endif
67 47
68#endif /* Not RC_INVOKED */48#ifndef assert
49#define assert(_Expression) (void)((!!(_Expression)) || (_wassert(_CRT_WIDE(#_Expression),_CRT_WIDE(__FILE__),__LINE__),0))
50#endif
69 51
70#endif /* Not _ASSERT_H_ */52#endif
71 53
54#endif
win32/include/conio.h+392−142
@@ -1,159 +1,409 @@
1/* A conio implementation for Mingw/Dev-C++.1/**
2 *2 * This file has no copyright assigned and is placed in the Public Domain.
3 * Written by:3 * This file is part of the w64 mingw-runtime package.
4 * Hongli Lai <hongli@telekabel.nl>4 * No warranty is given; refer to the file DISCLAIMER within this package.
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 */5 */
6#ifndef _INC_CONIO
7#define _INC_CONIO
10 8
11#ifndef _CONIO_H_9#include <_mingw.h>
12#define _CONIO_H_
13
14
15#include <stdio.h>
16 10
17#ifdef __cplusplus11#ifdef __cplusplus
18extern "C" {12extern "C" {
19#endif13#endif
20 14
21#define BLINK 015 _CRTIMP char *_cgets(char *_Buffer);
22 16 _CRTIMP int __cdecl _cprintf(const char *_Format,...);
23typedef enum17 _CRTIMP int __cdecl _cputs(const char *_Str);
24{18 _CRTIMP int __cdecl _cscanf(const char *_Format,...);
25 BLACK,19 _CRTIMP int __cdecl _cscanf_l(const char *_Format,_locale_t _Locale,...);
26 BLUE,20 _CRTIMP int __cdecl _getch(void);
27 GREEN,21 _CRTIMP int __cdecl _getche(void);
28 CYAN,22 _CRTIMP int __cdecl _vcprintf(const char *_Format,va_list _ArgList);
29 RED,23 _CRTIMP int __cdecl _cprintf_p(const char *_Format,...);
30 MAGENTA,24 _CRTIMP int __cdecl _vcprintf_p(const char *_Format,va_list _ArgList);
31 BROWN,25 _CRTIMP int __cdecl _cprintf_l(const char *_Format,_locale_t _Locale,...);
32 LIGHTGRAY,26 _CRTIMP int __cdecl _vcprintf_l(const char *_Format,_locale_t _Locale,va_list _ArgList);
33 DARKGRAY,27 _CRTIMP int __cdecl _cprintf_p_l(const char *_Format,_locale_t _Locale,...);
34 LIGHTBLUE,28 _CRTIMP int __cdecl _vcprintf_p_l(const char *_Format,_locale_t _Locale,va_list _ArgList);
35 LIGHTGREEN,29 _CRTIMP int __cdecl _kbhit(void);
36 LIGHTCYAN,30
37 LIGHTRED,31#if defined(_X86_) && !defined(__x86_64)
38 LIGHTMAGENTA,32 int __cdecl _inp(unsigned short);
39 YELLOW,33 unsigned short __cdecl _inpw(unsigned short);
40 WHITE34 unsigned long __cdecl _inpd(unsigned short);
41} COLORS;35 int __cdecl _outp(unsigned short,int);
42 36 unsigned short __cdecl _outpw(unsigned short,unsigned short);
43 37 unsigned long __cdecl _outpd(unsigned short,unsigned long);
44#define cgets _cgets38#endif
45#define cprintf _cprintf39
46#define cputs _cputs40 _CRTIMP int __cdecl _putch(int _Ch);
47#define cscanf _cscanf41 _CRTIMP int __cdecl _ungetch(int _Ch);
48#define ScreenClear clrscr42 _CRTIMP int __cdecl _getch_nolock(void);
49 43 _CRTIMP int __cdecl _getche_nolock(void);
50/* blinkvideo */44 _CRTIMP int __cdecl _putch_nolock(int _Ch);
51 45 _CRTIMP int __cdecl _ungetch_nolock(int _Ch);
52void clreol (void);46
53void clrscr (void);47#ifndef _WCONIO_DEFINED
54 48#define _WCONIO_DEFINED
55int _conio_gettext (int left, int top, int right, int bottom,49
56 char *str);50#ifndef WEOF
57/* _conio_kbhit */51#define WEOF (wint_t)(0xFFFF)
58 52#endif
59void delline (void);
60
61/* gettextinfo */
62void gotoxy(int x, int y);
63/*
64highvideo
65insline
66intensevideo
67lowvideo
68movetext
69normvideo
70*/
71
72void puttext (int left, int top, int right, int bottom, char *str);
73
74// Screen Variables
75
76/* ScreenCols
77ScreenGetChar
78ScreenGetCursor
79ScreenMode
80ScreenPutChar
81ScreenPutString
82ScreenRetrieve
83ScreenRows
84ScreenSetCursor
85ScreenUpdate
86ScreenUpdateLine
87ScreenVisualBell
88_set_screen_lines */
89
90void _setcursortype (int type);
91
92void textattr (int _attr);
93
94void textbackground (int color);
95
96void textcolor (int color);
97
98/* textmode */
99
100int wherex (void);
101
102int 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 53
136char* _cgets (char*);54 _CRTIMP wchar_t *_cgetws(wchar_t *_Buffer);
137int _cprintf (const char*, ...);55 _CRTIMP wint_t __cdecl _getwch(void);
138int _cputs (const char*);56 _CRTIMP wint_t __cdecl _getwche(void);
139int _cscanf (char*, ...);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
140 75
141int _getch (void);76#ifndef NO_OLDNAMES
142int _getche (void);77 char *__cdecl cgets(char *_Buffer);
143int _kbhit (void);78 int __cdecl cprintf(const char *_Format,...);
144int _putch (int);79 int __cdecl cputs(const char *_Str);
145int _ungetch (int);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
146 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 seperatly. */
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
147 364
148int getch (void);365 __CRT_INLINE unsigned __int64 __readmsr(unsigned long msr)
149int getche (void);366 {
150int kbhit (void);367 unsigned __int64 val1, val2;
151int putch (int);368 __asm__ __volatile__(
152int ungetch (int);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 }
153 400
401#endif
154 402
155#ifdef __cplusplus403#ifdef __cplusplus
156}404}
157#endif405#endif
158 406
159#endif /* _CONIO_H_ */407#include <sec_api/conio_s.h>
408
409#endif
win32/include/ctype.h+256−207
@@ -1,232 +1,281 @@
1/* 1/**
2 * ctype.h2 * This file has no copyright assigned and is placed in the Public Domain.
3 *3 * This file is part of the w64 mingw-runtime package.
4 * Functions for testing character types and converting characters.4 * No warranty is given; refer to the file DISCLAIMER within this package.
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 */5 */
6#ifndef _INC_CTYPE
7#define _INC_CTYPE
26 8
27#ifndef _CTYPE_H_
28#define _CTYPE_H_
29
30/* All the headers include this file. */
31#include <_mingw.h>9#include <_mingw.h>
32 10
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 __cplusplus11#ifdef __cplusplus
59extern "C" {12extern "C" {
60#endif13#endif
61 14
62int isalnum(int);15#ifndef WEOF
63int isalpha(int);16#define WEOF (wint_t)(0xFFFF)
64int iscntrl(int);
65int isdigit(int);
66int isgraph(int);
67int islower(int);
68int isprint(int);
69int ispunct(int);
70int isspace(int);
71int isupper(int);
72int isxdigit(int);
73
74#ifndef __STRICT_ANSI__
75int _isctype (int, int);
76#endif17#endif
77 18
78/* These are the ANSI versions, with correct checking of argument */19#ifndef _CRT_CTYPEDATA_DEFINED
79int tolower(int);20#define _CRT_CTYPEDATA_DEFINED
80int toupper(int);21#ifndef _CTYPE_DISABLE_MACROS
81 22
82/*23#ifndef __PCTYPE_FUNC
83 * NOTE: The above are not old name type wrappers, but functions exported24#define __PCTYPE_FUNC __pctype_func()
84 * explicitly by MSVCRT/CRTDLL. However, underscored versions are also25#ifdef _MSVCRT_
85 * exported.26#define __pctype_func() (_pctype)
86 */27#else
87#ifndef __STRICT_ANSI__28#define __pctype_func() (*_imp___pctype)
88/*29#endif
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 */
92int _tolower(int);
93int _toupper(int);
94#endif30#endif
95 31
96/* Also defined in stdlib.h */32#ifndef _pctype
97#ifndef MB_CUR_MAX33#ifdef _MSVCRT_
98# ifdef __MSVCRT__34 extern unsigned short *_pctype;
99# define MB_CUR_MAX __mb_cur_max35#else
100 __MINGW_IMPORT int __mb_cur_max;36 extern unsigned short **_imp___pctype;
101# else /* not __MSVCRT */37#define _pctype (*_imp___pctype)
102# define MB_CUR_MAX __mb_cur_max_dll38#endif
103 __MINGW_IMPORT int __mb_cur_max_dll;39#endif
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 40
41#endif
42#endif
129 43
130#if ! (defined (__NO_CTYPE_INLINES) || defined (__STRICT_ANSI__ ))44#ifndef _CRT_WCTYPEDATA_DEFINED
131/* use simple lookup if SB locale, else _isctype() */45#define _CRT_WCTYPEDATA_DEFINED
132#define __ISCTYPE(c, mask) (MB_CUR_MAX == 1 ? (_pctype[c] & mask) : _isctype(c, mask))46#ifndef _CTYPE_DISABLE_MACROS
133extern __inline__ int isalnum(int c) {return __ISCTYPE(c, (_ALPHA|_DIGIT));}47#ifndef _wctype
134extern __inline__ int isalpha(int c) {return __ISCTYPE(c, _ALPHA);}48#ifdef _MSVCRT_
135extern __inline__ int iscntrl(int c) {return __ISCTYPE(c, _CONTROL);}49 extern unsigned short *_wctype;
136extern __inline__ int isdigit(int c) {return __ISCTYPE(c, _DIGIT);}50#else
137extern __inline__ int isgraph(int c) {return __ISCTYPE(c, (_PUNCT|_ALPHA|_DIGIT));}51 extern unsigned short **_imp___wctype;
138extern __inline__ int islower(int c) {return __ISCTYPE(c, _LOWER);}52#define _wctype (*_imp___wctype)
139extern __inline__ int isprint(int c) {return __ISCTYPE(c, (_BLANK|_PUNCT|_ALPHA|_DIGIT));}53#endif
140extern __inline__ int ispunct(int c) {return __ISCTYPE(c, _PUNCT);}54#endif
141extern __inline__ int isspace(int c) {return __ISCTYPE(c, _SPACE);}55#ifdef _MSVCRT_
142extern __inline__ int isupper(int c) {return __ISCTYPE(c, _UPPER);}56#define __pwctype_func() (_pwctype)
143extern __inline__ int isxdigit(int c) {return __ISCTYPE(c, _HEX);}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
144 69
145/* these reproduce behaviour of lib underscored versions */70 /* CRT stuff */
146extern __inline__ int _tolower(int c) {return ( c -'A'+'a');}71#if 1
147extern __inline__ int _toupper(int c) {return ( c -'a'+'A');}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
148 83
149/* TODO? Is it worth inlining ANSI tolower, toupper? Probably only84#define _UPPER 0x1
150 if we only want C-locale. */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)
136int __cdecl isblank(int _C);
137#endif
138#endif
151 139
152#endif /* _NO_CTYPE_INLINES */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)
181int __cdecl iswblank(wint_t _C);
182#endif
183#endif
153 184
154/* Wide character equivalents */185#ifndef _CTYPE_DISABLE_MACROS
155 186
156#ifndef WEOF187#ifndef MB_CUR_MAX
157#define WEOF (wchar_t)(0xFFFF)188#define MB_CUR_MAX ___mb_cur_max_func()
158#endif189#ifndef __mb_cur_max
159 190#ifdef _MSVCRT_
160#ifndef _WCTYPE_T_DEFINED191 extern int __mb_cur_max;
161typedef wchar_t wctype_t;192#else
162#define _WCTYPE_T_DEFINED193#define __mb_cur_max (*_imp____mb_cur_max)
163#endif194 extern int *_imp____mb_cur_max;
164 195#endif
165int iswalnum(wint_t);196#endif
166int iswalpha(wint_t);197#ifdef _MSVCRT_
167int iswascii(wint_t);198#define ___mb_cur_max_func() (__mb_cur_max)
168int iswcntrl(wint_t);199#else
169int iswctype(wint_t, wctype_t);200#define ___mb_cur_max_func() (*_imp____mb_cur_max)
170int is_wctype(wint_t, wctype_t); /* Obsolete! */201#endif
171int iswdigit(wint_t);202#endif
172int iswgraph(wint_t);
173int iswlower(wint_t);
174int iswprint(wint_t);
175int iswpunct(wint_t);
176int iswspace(wint_t);
177int iswupper(wint_t);
178int iswxdigit(wint_t);
179
180wchar_t towlower(wchar_t);
181wchar_t towupper(wchar_t);
182
183int isleadbyte (int);
184
185/* Also in wctype.h */
186#if ! (defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED))
187#define __WCTYPE_INLINES_DEFINED
188extern __inline__ int iswalnum(wint_t wc) {return (iswctype(wc,_ALPHA|_DIGIT));}
189extern __inline__ int iswalpha(wint_t wc) {return (iswctype(wc,_ALPHA));}
190extern __inline__ int iswascii(wint_t wc) {return (((unsigned)wc & 0x7F) ==0);}
191extern __inline__ int iswcntrl(wint_t wc) {return (iswctype(wc,_CONTROL));}
192extern __inline__ int iswdigit(wint_t wc) {return (iswctype(wc,_DIGIT));}
193extern __inline__ int iswgraph(wint_t wc) {return (iswctype(wc,_PUNCT|_ALPHA|_DIGIT));}
194extern __inline__ int iswlower(wint_t wc) {return (iswctype(wc,_LOWER));}
195extern __inline__ int iswprint(wint_t wc) {return (iswctype(wc,_BLANK|_PUNCT|_ALPHA|_DIGIT));}
196extern __inline__ int iswpunct(wint_t wc) {return (iswctype(wc,_PUNCT));}
197extern __inline__ int iswspace(wint_t wc) {return (iswctype(wc,_SPACE));}
198extern __inline__ int iswupper(wint_t wc) {return (iswctype(wc,_UPPER));}
199extern __inline__ int iswxdigit(wint_t wc) {return (iswctype(wc,_HEX));}
200extern __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__
204int __isascii (int);
205int __toascii (int);
206int __iscsymf (int); /* Valid first character in C symbol */
207int __iscsym (int); /* Valid character in C symbol (after first) */
208
209#ifndef __NO_CTYPE_INLINES
210extern __inline__ int __isascii(int c) {return (((unsigned)c & ~0x7F) == 0);}
211extern __inline__ int __toascii(int c) {return (c & 0x7F);}
212extern __inline__ int __iscsymf(int c) {return (isalpha(c) || (c == '_'));}
213extern __inline__ int __iscsym(int c) {return (isalnum(c) || (c == '_'));}
214#endif /* __NO_CTYPE_INLINES */
215
216#ifndef _NO_OLDNAMES
217int isascii (int);
218int toascii (int);
219int iscsymf (int);
220int iscsym (int);
221#endif /* Not _NO_OLDNAMES */
222
223#endif /* Not __STRICT_ANSI__ */
224 203
225#ifdef __cplusplus204#define __chvalidchk(a,b) (__PCTYPE_FUNC[(a)] & (b))
226}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
227#endif252#endif
228 253
229#endif /* Not RC_INVOKED */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
230 263
231#endif /* Not _CTYPE_H_ */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
232 277
278#ifdef __cplusplus
279}
280#endif
281#endif
win32/include/dir.h+5−0
@@ -1,3 +1,8 @@
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 */
1/* 6/*
2 * dir.h7 * dir.h
3 *8 *
win32/include/direct.h+46−73
@@ -1,95 +1,68 @@
1/*1/**
2 * direct.h2 * This file has no copyright assigned and is placed in the Public Domain.
3 *3 * This file is part of the w64 mingw-runtime package.
4 * Functions for manipulating paths and directories (included from io.h)4 * No warranty is given; refer to the file DISCLAIMER within this package.
5 * plus functions for setting the current drive.
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 *
12 * THIS SOFTWARE IS NOT COPYRIGHTED
13 *
14 * This source code is offered for use in the public domain. You may
15 * use, modify or distribute it freely.
16 *
17 * This code is distributed in the hope that it will be useful but
18 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
19 * DISCLAIMED. This includes but is not limited to warranties of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 *
22 * $Revision: 1.2 $
23 * $Author: bellard $
24 * $Date: 2005/04/17 13:14:29 $
25 *
26 */5 */
6#ifndef _INC_DIRECT
7#define _INC_DIRECT
27 8
28#ifndef __STRICT_ANSI__
29
30#ifndef _DIRECT_H_
31#define _DIRECT_H_
32
33/* All the headers include this file. */
34#include <_mingw.h>9#include <_mingw.h>
35
36#define __need_wchar_t
37#ifndef RC_INVOKED
38#include <stddef.h>
39#endif /* Not RC_INVOKED */
40
41#include <io.h>10#include <io.h>
42 11
43#ifndef RC_INVOKED12#pragma pack(push,_CRT_PACKING)
44 13
45#ifdef __cplusplus14#ifdef __cplusplus
46extern "C" {15extern "C" {
47#endif16#endif
48 17
49#ifndef _DISKFREE_T_DEFINED18#ifndef _DISKFREE_T_DEFINED
50/* needed by _getdiskfree (also in dos.h) */
51struct _diskfree_t {
52 unsigned total_clusters;
53 unsigned avail_clusters;
54 unsigned sectors_per_cluster;
55 unsigned bytes_per_sector;
56};
57#define _DISKFREE_T_DEFINED19#define _DISKFREE_T_DEFINED
58#endif 20 struct _diskfree_t {
59 21 unsigned total_clusters;
60/*22 unsigned avail_clusters;
61 * You really shouldn't be using these. Use the Win32 API functions instead.23 unsigned sectors_per_cluster;
62 * However, it does make it easier to port older code.24 unsigned bytes_per_sector;
63 */25 };
64int _getdrive (void);26#endif
65unsigned long _getdrives(void);
66int _chdrive (int);
67char* _getdcwd (int, char*, int);
68unsigned _getdiskfree (unsigned, struct _diskfree_t *);
69 27
70#ifndef _NO_OLDNAMES28 _CRTIMP char *__cdecl _getcwd(char *_DstBuf,int _SizeInBytes);
71# define diskfree_t _diskfree_t29 _CRTIMP char *__cdecl _getdcwd(int _Drive,char *_DstBuf,int _SizeInBytes);
30 char *__cdecl _getdcwd_nolock(int _Drive,char *_DstBuf,int _SizeInBytes);
31 _CRTIMP int __cdecl _chdir(const char *_Path);
32 _CRTIMP int __cdecl _mkdir(const char *_Path);
33 _CRTIMP int __cdecl _rmdir(const char *_Path);
34 _CRTIMP int __cdecl _chdrive(int _Drive);
35 _CRTIMP int __cdecl _getdrive(void);
36 _CRTIMP unsigned long __cdecl _getdrives(void);
37
38#ifndef _GETDISKFREE_DEFINED
39#define _GETDISKFREE_DEFINED
40 _CRTIMP unsigned __cdecl _getdiskfree(unsigned _Drive,struct _diskfree_t *_DiskFree);
72#endif41#endif
73 42
74#ifndef _WDIRECT_DEFINED43#ifndef _WDIRECT_DEFINED
75/* wide character versions. Also in wchar.h */
76#ifdef __MSVCRT__
77int _wchdir(const wchar_t*);
78wchar_t* _wgetcwd(wchar_t*, int);
79wchar_t* _wgetdcwd(int, wchar_t*, int);
80int _wmkdir(const wchar_t*);
81int _wrmdir(const wchar_t*);
82#endif /* __MSVCRT__ */
83#define _WDIRECT_DEFINED44#define _WDIRECT_DEFINED
45 _CRTIMP wchar_t *__cdecl _wgetcwd(wchar_t *_DstBuf,int _SizeInWords);
46 _CRTIMP wchar_t *__cdecl _wgetdcwd(int _Drive,wchar_t *_DstBuf,int _SizeInWords);
47 wchar_t *__cdecl _wgetdcwd_nolock(int _Drive,wchar_t *_DstBuf,int _SizeInWords);
48 _CRTIMP int __cdecl _wchdir(const wchar_t *_Path);
49 _CRTIMP int __cdecl _wmkdir(const wchar_t *_Path);
50 _CRTIMP int __cdecl _wrmdir(const wchar_t *_Path);
84#endif51#endif
85 52
86#ifdef __cplusplus53#ifndef NO_OLDNAMES
87}
88#endif
89 54
90#endif /* Not RC_INVOKED */55#define diskfree_t _diskfree_t
91 56
92#endif /* Not _DIRECT_H_ */57 char *__cdecl getcwd(char *_DstBuf,int _SizeInBytes);
58 int __cdecl chdir(const char *_Path);
59 int __cdecl mkdir(const char *_Path);
60 int __cdecl rmdir(const char *_Path);
61#endif
93 62
94#endif /* Not __STRICT_ANSI__ */63#ifdef __cplusplus
64}
65#endif
95 66
67#pragma pack(pop)
68#endif
win32/include/dirent.h+108−69
@@ -1,33 +1,18 @@
1/*1/**
2 * DIRENT.H (formerly DIRLIB.H)2 * This file has no copyright assigned and is placed in the Public Domain.
3 *3 * This file is part of the w64 mingw-runtime package.
4 * by M. J. Weinstein Released to public domain 1-Jan-894 * No warranty is given; refer to the file DISCLAIMER within this package.
5 *
6 * Because I have heard that this feature (opendir, readdir, closedir)
7 * it so useful for programmers coming from UNIX or attempting to port
8 * UNIX code, and because it is reasonably light weight, I have included
9 * it in the Mingw32 package. I have also added an implementation of
10 * rewinddir, seekdir and telldir.
11 * - Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
12 *
13 * This code is distributed in the hope that is will be useful but
14 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
15 * DISCLAIMED. This includeds but is not limited to warranties of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 *
18 * $Revision: 1.2 $
19 * $Author: bellard $
20 * $Date: 2005/04/17 13:14:29 $
21 *
22 */5 */
6/* All the headers include this file. */
7#include <_mingw.h>
23 8
24#ifndef __STRICT_ANSI__9#ifndef __STRICT_ANSI__
25 10
26#ifndef _DIRENT_H_11#ifndef _DIRENT_H_
27#define _DIRENT_H_12#define _DIRENT_H_
28 13
29/* All the headers include this file. */14
30#include <_mingw.h>15#pragma pack(push,_CRT_PACKING)
31 16
32#include <io.h>17#include <io.h>
33 18
@@ -37,52 +22,103 @@ · 3 unmodified lines
37extern "C" {22extern "C" {
38#endif23#endif
39 24
40struct dirent25 struct dirent
41{26 {
42 long d_ino; /* Always zero. */27 long d_ino; /* Always zero. */
43 unsigned short d_reclen; /* Always zero. */28 unsigned short d_reclen; /* Always zero. */
44 unsigned short d_namlen; /* Length of name in d_name. */29 unsigned short d_namlen; /* Length of name in d_name. */
45 char* d_name; /* File name. */30 char* d_name; /* File name. */
46 /* NOTE: The name in the dirent structure points to the name in the31 /* NOTE: The name in the dirent structure points to the name in the
47 * finddata_t structure in the DIR. */32 * finddata_t structure in the DIR. */
48};33 };
49 34
50/*35 /*
51 * This is an internal data structure. Good programmers will not use it36 * This is an internal data structure. Good programmers will not use it
52 * except as an argument to one of the functions below.37 * except as an argument to one of the functions below.
53 */38 * dd_stat field is now int (was short in older versions).
54typedef struct39 */
55{40 typedef struct
56 /* disk transfer area for this dir */41 {
57 struct _finddata_t dd_dta;42 /* disk transfer area for this dir */
58 43 struct _finddata_t dd_dta;
59 /* dirent struct to return from dir (NOTE: this makes this thread44
60 * safe as long as only one thread uses a particular DIR struct at45 /* dirent struct to return from dir (NOTE: this makes this thread
61 * a time) */46 * safe as long as only one thread uses a particular DIR struct at
62 struct dirent dd_dir;47 * a time) */
63 48 struct dirent dd_dir;
64 /* _findnext handle */49
65 long dd_handle;50 /* _findnext handle */
66 51 long dd_handle;
67 /*52
68 * Status of search:53 /*
69 * 0 = not started yet (next entry to read is first entry)54 * Status of search:
70 * -1 = off the end55 * 0 = not started yet (next entry to read is first entry)
71 * positive = 0 based index of next entry56 * -1 = off the end
72 */57 * positive = 0 based index of next entry
73 short dd_stat;58 */
74 59 int dd_stat;
75 /* given path for dir with search pattern (struct is extended) */60
76 char dd_name[1];61 /* given path for dir with search pattern (struct is extended) */
77} DIR;62 char dd_name[1];
78 63 } DIR;
79 64
80DIR* opendir (const char*);65 DIR* __cdecl opendir (const char*);
81struct dirent* readdir (DIR*);66 struct dirent* __cdecl readdir (DIR*);
82int closedir (DIR*);67 int __cdecl closedir (DIR*);
83void rewinddir (DIR*);68 void __cdecl rewinddir (DIR*);
84long telldir (DIR*);69 long __cdecl telldir (DIR*);
85void seekdir (DIR*, long);70 void __cdecl seekdir (DIR*, long);
71
72
73 /* wide char versions */
74
75 struct _wdirent
76 {
77 long d_ino; /* Always zero. */
78 unsigned short d_reclen; /* Always zero. */
79 unsigned short d_namlen; /* Length of name in d_name. */
80 wchar_t* d_name; /* File name. */
81 /* NOTE: The name in the dirent structure points to the name in the * wfinddata_t structure in the _WDIR. */
82 };
83
84 /*
85 * This is an internal data structure. Good programmers will not use it
86 * except as an argument to one of the functions below.
87 */
88 typedef struct
89 {
90 /* disk transfer area for this dir */
91 struct _wfinddata_t dd_dta;
92
93 /* dirent struct to return from dir (NOTE: this makes this thread
94 * safe as long as only one thread uses a particular DIR struct at
95 * a time) */
96 struct _wdirent dd_dir;
97
98 /* _findnext handle */
99 long dd_handle;
100
101 /*
102 * Status of search:
103 * 0 = not started yet (next entry to read is first entry)
104 * -1 = off the end
105 * positive = 0 based index of next entry
106 */
107 int dd_stat;
108
109 /* given path for dir with search pattern (struct is extended) */
110 wchar_t dd_name[1];
111 } _WDIR;
112
113
114
115 _WDIR* __cdecl _wopendir (const wchar_t*);
116 struct _wdirent* __cdecl _wreaddir (_WDIR*);
117 int __cdecl _wclosedir (_WDIR*);
118 void __cdecl _wrewinddir (_WDIR*);
119 long __cdecl _wtelldir (_WDIR*);
120 void __cdecl _wseekdir (_WDIR*, long);
121
86 122
87#ifdef __cplusplus123#ifdef __cplusplus
88}124}
@@ -90,7 +126,10 @@ void seekdir (DIR*, long); · 1 unmodified line
90 126
91#endif /* Not RC_INVOKED */127#endif /* Not RC_INVOKED */
92 128
129#pragma pack(pop)
130
93#endif /* Not _DIRENT_H_ */131#endif /* Not _DIRENT_H_ */
94 132
133
95#endif /* Not __STRICT_ANSI__ */134#endif /* Not __STRICT_ANSI__ */
96 135
win32/include/dos.h+34−89
@@ -1,110 +1,55 @@
1/*1/**
2 * dos.h2 * This file has no copyright assigned and is placed in the Public Domain.
3 *3 * This file is part of the w64 mingw-runtime package.
4 * DOS-specific functions and structures.4 * No warranty is given; refer to the file DISCLAIMER within this package.
5 *
6 * This file is part of the Mingw32 package.
7 *
8 * Contributors:
9 * Created by J.J. van der Heijden <J.J.vanderHeijden@student.utwente.nl>
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 */5 */
6#ifndef _INC_DOS
7#define _INC_DOS
26 8
27#ifndef __STRICT_ANSI__
28
29#ifndef _DOS_H_
30#define _DOS_H_
31
32/* All the headers include this file. */
33#include <_mingw.h>9#include <_mingw.h>
34
35#define __need_wchar_t
36#ifndef RC_INVOKED
37#include <stddef.h>
38#endif /* Not RC_INVOKED */
39
40/* For DOS file attributes */
41#include <io.h>10#include <io.h>
42 11
43#ifndef RC_INVOKED12#pragma pack(push,_CRT_PACKING)
44 13
45#ifdef __cplusplus14#ifdef __cplusplus
46extern "C" {15extern "C" {
47#endif16#endif
48 17
49#ifndef __MSVCRT__ /* these are in CRTDLL, but not MSVCRT */18#ifndef _DISKFREE_T_DEFINED
50#ifndef __DECLSPEC_SUPPORTED19#define _DISKFREE_T_DEFINED
51extern unsigned int *__imp__basemajor_dll;
52extern unsigned int *__imp__baseminor_dll;
53extern unsigned int *__imp__baseversion_dll;
54extern unsigned int *__imp__osmajor_dll;
55extern unsigned int *__imp__osminor_dll;
56extern unsigned int *__imp__osmode_dll;
57
58#define _basemajor (*__imp__basemajor_dll)
59#define _baseminor (*__imp__baseminor_dll)
60#define _baseversion (*__imp__baseversion_dll)
61#define _osmajor (*__imp__osmajor_dll)
62#define _osminor (*__imp__osminor_dll)
63#define _osmode (*__imp__osmode_dll)
64
65#else /* __DECLSPEC_SUPPORTED */
66
67__MINGW_IMPORT unsigned int _basemajor_dll;
68__MINGW_IMPORT unsigned int _baseminor_dll;
69__MINGW_IMPORT unsigned int _baseversion_dll;
70__MINGW_IMPORT unsigned int _osmajor_dll;
71__MINGW_IMPORT unsigned int _osminor_dll;
72__MINGW_IMPORT unsigned int _osmode_dll;
73 20
74#define _basemajor _basemajor_dll21 struct _diskfree_t {
75#define _baseminor _baseminor_dll22 unsigned total_clusters;
76#define _baseversion _baseversion_dll23 unsigned avail_clusters;
77#define _osmajor _osmajor_dll24 unsigned sectors_per_cluster;
78#define _osminor _osminor_dll25 unsigned bytes_per_sector;
79#define _osmode _osmode_dll26 };
27#endif
80 28
81#endif /* __DECLSPEC_SUPPORTED */29#define _A_NORMAL 0x00
82#endif /* ! __MSVCRT__ */30#define _A_RDONLY 0x01
31#define _A_HIDDEN 0x02
32#define _A_SYSTEM 0x04
33#define _A_SUBDIR 0x10
34#define _A_ARCH 0x20
83 35
84#ifndef _DISKFREE_T_DEFINED36#ifndef _GETDISKFREE_DEFINED
85/* needed by _getdiskfree (also in direct.h) */37#define _GETDISKFREE_DEFINED
86struct _diskfree_t {38 _CRTIMP unsigned __cdecl _getdiskfree(unsigned _Drive,struct _diskfree_t *_DiskFree);
87 unsigned total_clusters;39#endif
88 unsigned avail_clusters;
89 unsigned sectors_per_cluster;
90 unsigned bytes_per_sector;
91};
92#define _DISKFREE_T_DEFINED
93#endif
94 40
95unsigned _getdiskfree (unsigned, struct _diskfree_t *);41#if (defined(_X86_) && !defined(__x86_64))
42 void __cdecl _disable(void);
43 void __cdecl _enable(void);
44#endif
96 45
97#ifndef _NO_OLDNAMES46#ifndef NO_OLDNAMES
98# define diskfree_t _diskfree_t47#define diskfree_t _diskfree_t
99#endif48#endif
100 49
101#ifdef __cplusplus50#ifdef __cplusplus
102}51}
103#endif52#endif
104 53
105#endif /* Not RC_INVOKED */54#pragma pack(pop)
106 55#endif
107#endif /* Not _DOS_H_ */
108
109#endif /* Not __STRICT_ANSI__ */
110
win32/include/errno.h+63−105
@@ -1,117 +1,75 @@
1/* 1/**
2 * errno.h2 * This file has no copyright assigned and is placed in the Public Domain.
3 *3 * This file is part of the w64 mingw-runtime package.
4 * Error numbers and access to error reporting.4 * No warranty is given; refer to the file DISCLAIMER within this package.
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 */5 */
6#ifndef _INC_ERRNO
7#define _INC_ERRNO
26 8
27#ifndef _ERRNO_H_
28#define _ERRNO_H_
29
30/* All the headers include this file. */
31#include <_mingw.h>9#include <_mingw.h>
32 10
33/*11#ifdef __cplusplus
34 * Error numbers.
35 * TODO: Can't be sure of some of these assignments, I guessed from the
36 * names given by strerror and the defines in the Cygnus errno.h. A lot
37 * of the names from the Cygnus errno.h are not represented, and a few
38 * of the descriptions returned by strerror do not obviously match
39 * their error naming.
40 */
41#define EPERM 1 /* Operation not permitted */
42#define ENOFILE 2 /* No such file or directory */
43#define ENOENT 2
44#define ESRCH 3 /* No such process */
45#define EINTR 4 /* Interrupted function call */
46#define EIO 5 /* Input/output error */
47#define ENXIO 6 /* No such device or address */
48#define E2BIG 7 /* Arg list too long */
49#define ENOEXEC 8 /* Exec format error */
50#define EBADF 9 /* Bad file descriptor */
51#define ECHILD 10 /* No child processes */
52#define EAGAIN 11 /* Resource temporarily unavailable */
53#define ENOMEM 12 /* Not enough space */
54#define EACCES 13 /* Permission denied */
55#define EFAULT 14 /* Bad address */
56/* 15 - Unknown Error */
57#define EBUSY 16 /* strerror reports "Resource device" */
58#define EEXIST 17 /* File exists */
59#define EXDEV 18 /* Improper link (cross-device link?) */
60#define ENODEV 19 /* No such device */
61#define ENOTDIR 20 /* Not a directory */
62#define EISDIR 21 /* Is a directory */
63#define EINVAL 22 /* Invalid argument */
64#define ENFILE 23 /* Too many open files in system */
65#define EMFILE 24 /* Too many open files */
66#define ENOTTY 25 /* Inappropriate I/O control operation */
67/* 26 - Unknown Error */
68#define EFBIG 27 /* File too large */
69#define ENOSPC 28 /* No space left on device */
70#define ESPIPE 29 /* Invalid seek (seek on a pipe?) */
71#define EROFS 30 /* Read-only file system */
72#define EMLINK 31 /* Too many links */
73#define EPIPE 32 /* Broken pipe */
74#define EDOM 33 /* Domain error (math functions) */
75#define ERANGE 34 /* Result too large (possibly too small) */
76/* 35 - Unknown Error */
77#define EDEADLOCK 36 /* Resource deadlock avoided (non-Cyg) */
78#define EDEADLK 36
79/* 37 - Unknown Error */
80#define ENAMETOOLONG 38 /* Filename too long (91 in Cyg?) */
81#define ENOLCK 39 /* No locks available (46 in Cyg?) */
82#define ENOSYS 40 /* Function not implemented (88 in Cyg?) */
83#define ENOTEMPTY 41 /* Directory not empty (90 in Cyg?) */
84#define EILSEQ 42 /* Illegal byte sequence */
85
86/*
87 * NOTE: ENAMETOOLONG and ENOTEMPTY conflict with definitions in the
88 * sockets.h header provided with windows32api-0.1.2.
89 * You should go and put an #if 0 ... #endif around the whole block
90 * of errors (look at the comment above them).
91 */
92
93#ifndef RC_INVOKED
94
95#ifdef __cplusplus
96extern "C" {12extern "C" {
97#endif13#endif
98 14
99/*15#ifndef _CRT_ERRNO_DEFINED
100 * Definitions of errno. For _doserrno, sys_nerr and * sys_errlist, see16#define _CRT_ERRNO_DEFINED
101 * stdlib.h.17 _CRTIMP extern int *__cdecl _errno(void);
102 */18#define errno (*_errno())
103#ifdef _UWIN19
104#undef errno20 errno_t __cdecl _set_errno(int _Value);
105extern int errno;21 errno_t __cdecl _get_errno(int *_Value);
106#else
107int* _errno(void);
108#define errno (*_errno())
109#endif22#endif
110 23
111#ifdef __cplusplus24#define EPERM 1
112}25#define ENOENT 2
26#define ESRCH 3
27#define EINTR 4
28#define EIO 5
29#define ENXIO 6
30#define E2BIG 7
31#define ENOEXEC 8
32#define EBADF 9
33#define ECHILD 10
34#define EAGAIN 11
35#define ENOMEM 12
36#define EACCES 13
37#define EFAULT 14
38#define EBUSY 16
39#define EEXIST 17
40#define EXDEV 18
41#define ENODEV 19
42#define ENOTDIR 20
43#define EISDIR 21
44#define ENFILE 23
45#define EMFILE 24
46#define ENOTTY 25
47#define EFBIG 27
48#define ENOSPC 28
49#define ESPIPE 29
50#define EROFS 30
51#define EMLINK 31
52#define EPIPE 32
53#define EDOM 33
54#define EDEADLK 36
55#define ENAMETOOLONG 38
56#define ENOLCK 39
57#define ENOSYS 40
58#define ENOTEMPTY 41
59
60#ifndef RC_INVOKED
61#if !defined(_SECURECRT_ERRCODE_VALUES_DEFINED)
62#define _SECURECRT_ERRCODE_VALUES_DEFINED
63#define EINVAL 22
64#define ERANGE 34
65#define EILSEQ 42
66#define STRUNCATE 80
67#endif
113#endif68#endif
114 69
115#endif /* Not RC_INVOKED */70#define EDEADLOCK EDEADLK
116 71
117#endif /* Not _ERRNO_H_ */72#ifdef __cplusplus
73}
74#endif
75#endif
win32/include/excpt.h+118−15
@@ -1,20 +1,123 @@
1#ifndef _EXCPT_H1/**
2#define _EXCPT_H2 * This file has no copyright assigned and is placed in the Public Domain.
3#if __GNUC__ >=33 * This file is part of the w64 mingw-runtime package.
4#pragma GCC system_header4 * No warranty is given; refer to the file DISCLAIMER within this package.
5 */
6#ifndef _INC_EXCPT
7#define _INC_EXCPT
8
9#include <_mingw.h>
10
11#pragma pack(push,_CRT_PACKING)
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17 struct _EXCEPTION_POINTERS;
18
19#ifndef EXCEPTION_DISPOSITION
20#define EXCEPTION_DISPOSITION int
21#endif
22#define ExceptionContinueExecution 0
23#define ExceptionContinueSearch 1
24#define ExceptionNestedException 2
25#define ExceptionCollidedUnwind 3
26
27#if (defined(_X86_) && !defined(__x86_64))
28 struct _EXCEPTION_RECORD;
29 struct _CONTEXT;
30
31 EXCEPTION_DISPOSITION __cdecl _except_handler(struct _EXCEPTION_RECORD *_ExceptionRecord,void *_EstablisherFrame,struct _CONTEXT *_ContextRecord,void *_DispatcherContext);
32#elif defined(__ia64__)
33
34 typedef struct _EXCEPTION_POINTERS *Exception_info_ptr;
35 struct _EXCEPTION_RECORD;
36 struct _CONTEXT;
37 struct _DISPATCHER_CONTEXT;
38
39 _CRTIMP EXCEPTION_DISPOSITION __cdecl __C_specific_handler (struct _EXCEPTION_RECORD *_ExceptionRecord,unsigned __int64 _MemoryStackFp,unsigned __int64 _BackingStoreFp,struct _CONTEXT *_ContextRecord,struct _DISPATCHER_CONTEXT *_DispatcherContext,unsigned __int64 _GlobalPointer);
40#elif defined(__x86_64)
41
42 struct _EXCEPTION_RECORD;
43 struct _CONTEXT;
44#endif
45
46#define GetExceptionCode _exception_code
47#define exception_code _exception_code
48#define GetExceptionInformation (struct _EXCEPTION_POINTERS *)_exception_info
49#define exception_info (struct _EXCEPTION_POINTERS *)_exception_info
50#define AbnormalTermination _abnormal_termination
51#define abnormal_termination _abnormal_termination
52
53 unsigned long __cdecl _exception_code(void);
54 void *__cdecl _exception_info(void);
55 int __cdecl _abnormal_termination(void);
56
57#define EXCEPTION_EXECUTE_HANDLER 1
58#define EXCEPTION_CONTINUE_SEARCH 0
59#define EXCEPTION_CONTINUE_EXECUTION -1
60
61 /* CRT stuff */
62 typedef void (__cdecl * _PHNDLR)(int);
63
64 struct _XCPT_ACTION {
65 unsigned long XcptNum;
66 int SigNum;
67 _PHNDLR XcptAction;
68 };
69
70 extern struct _XCPT_ACTION _XcptActTab[];
71 extern int _XcptActTabCount;
72 extern int _XcptActTabSize;
73 extern int _First_FPE_Indx;
74 extern int _Num_FPE;
75
76 int __cdecl __CppXcptFilter(unsigned long _ExceptionNum,struct _EXCEPTION_POINTERS * _ExceptionPtr);
77 int __cdecl _XcptFilter(unsigned long _ExceptionNum,struct _EXCEPTION_POINTERS * _ExceptionPtr);
78
79 /*
80 * The type of function that is expected as an exception handler to be
81 * installed with _try1.
82 */
83 typedef EXCEPTION_DISPOSITION (*PEXCEPTION_HANDLER)(struct _EXCEPTION_RECORD*, void*, struct _CONTEXT*, void*);
84
85#ifndef HAVE_NO_SEH
86 /*
87 * This is not entirely necessary, but it is the structure installed by
88 * the _try1 primitive below.
89 */
90 typedef struct _EXCEPTION_REGISTRATION {
91 struct _EXCEPTION_REGISTRATION *prev;
92 EXCEPTION_DISPOSITION (*handler)(struct _EXCEPTION_RECORD*, void*, struct _CONTEXT*, void*);
93 } EXCEPTION_REGISTRATION, *PEXCEPTION_REGISTRATION;
94
95 typedef EXCEPTION_REGISTRATION EXCEPTION_REGISTRATION_RECORD;
96 typedef PEXCEPTION_REGISTRATION PEXCEPTION_REGISTRATION_RECORD;
97#endif
98
99#if (defined(_X86_) && !defined(__x86_64))
100#define __try1(pHandler) \
101 __asm__ ("pushl %0;pushl %%fs:0;movl %%esp,%%fs:0;" : : "g" (pHandler));
102
103#define __except1 \
104 __asm__ ("movl (%%esp),%%eax;movl %%eax,%%fs:0;addl $8,%%esp;" \
105 : : : "%eax");
106#elif defined(__x86_64)
107#define __try1(pHandler) \
108 __asm__ ("pushq %0;pushq %%gs:0;movq %%rsp,%%gs:0;" : : "g" (pHandler));
109
110#define __except1 \
111 __asm__ ("movq (%%rsp),%%rax;movq %%rax,%%gs:0;addq $16,%%rsp;" \
112 : : : "%rax");
113#else
114#define __try1(pHandler)
115#define __except1
5#endif116#endif
6 117
7/* FIXME: This will make some code compile. The programs will most118#ifdef __cplusplus
8 likely crash when an exception is raised, but at least they will119}
9 compile. */
10#ifdef __GNUC__
11#define __try
12#define __except(x) if (0) /* don't execute handler */
13#define __finally
14
15#define _try __try
16#define _except __except
17#define _finally __finally
18#endif120#endif
19 121
122#pragma pack(pop)
20#endif123#endif
win32/include/fcntl.h+45−128
@@ -1,135 +1,52 @@
1/*1/**
2 * fcntl.h2 * This file has no copyright assigned and is placed in the Public Domain.
3 *3 * This file is part of the w64 mingw-runtime package.
4 * Access constants for _open. Note that the permissions constants are4 * No warranty is given; refer to the file DISCLAIMER within this package.
5 * in sys/stat.h (ick).
6 *
7 * This code is part of the Mingw32 package.
8 *
9 * Contributors:
10 * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
11 *
12 * THIS SOFTWARE IS NOT COPYRIGHTED
13 *
14 * This source code is offered for use in the public domain. You may
15 * use, modify or distribute it freely.
16 *
17 * This code is distributed in the hope that it will be useful but
18 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
19 * DISCLAIMED. This includes but is not limited to warranties of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 *
22 * $Revision: 1.2 $
23 * $Author: bellard $
24 * $Date: 2005/04/17 13:14:29 $
25 *
26 */5 */
27
28#ifndef __STRICT_ANSI__
29
30#ifndef _FCNTL_H_
31#define _FCNTL_H_
32
33/* All the headers include this file. */
34#include <_mingw.h>6#include <_mingw.h>
35 7
36/*
37 * It appears that fcntl.h should include io.h for compatibility...
38 */
39#include <io.h>8#include <io.h>
40 9
41/* Specifiy one of these flags to define the access mode. */10#ifndef _INC_FCNTL
42#define _O_RDONLY 011#define _INC_FCNTL
43#define _O_WRONLY 112
44#define _O_RDWR 213#define _O_RDONLY 0x0000
45 14#define _O_WRONLY 0x0001
46/* Mask for access mode bits in the _open flags. */15#define _O_RDWR 0x0002
47#define _O_ACCMODE (_O_RDONLY|_O_WRONLY|_O_RDWR)16#define _O_APPEND 0x0008
48 17#define _O_CREAT 0x0100
49#define _O_APPEND 0x0008 /* Writes will add to the end of the file. */18#define _O_TRUNC 0x0200
50 19#define _O_EXCL 0x0400
51#define _O_RANDOM 0x001020#define _O_TEXT 0x4000
52#define _O_SEQUENTIAL 0x002021#define _O_BINARY 0x8000
53#define _O_TEMPORARY 0x0040 /* Make the file dissappear after closing.22#define _O_WTEXT 0x10000
54 * WARNING: Even if not created by _open! */23#define _O_U16TEXT 0x20000
55#define _O_NOINHERIT 0x008024#define _O_U8TEXT 0x40000
56 25#define _O_ACCMODE (_O_RDONLY|_O_WRONLY|_O_RDWR)
57#define _O_CREAT 0x0100 /* Create the file if it does not exist. */26
58#define _O_TRUNC 0x0200 /* Truncate the file if it does exist. */27#define _O_RAW _O_BINARY
59#define _O_EXCL 0x0400 /* Open only if the file does not exist. */28#define _O_NOINHERIT 0x0080
60 29#define _O_TEMPORARY 0x0040
61/* NOTE: Text is the default even if the given _O_TEXT bit is not on. */30#define _O_SHORT_LIVED 0x1000
62#define _O_TEXT 0x4000 /* CR-LF in file becomes LF in memory. */31
63#define _O_BINARY 0x8000 /* Input and output is not translated. */32#define _O_SEQUENTIAL 0x0020
64#define _O_RAW _O_BINARY33#define _O_RANDOM 0x0010
65 34
66#ifndef _NO_OLDNAMES35#if !defined(NO_OLDNAMES) || defined(_POSIX)
67 36#define O_RDONLY _O_RDONLY
68/* POSIX/Non-ANSI names for increased portability */37#define O_WRONLY _O_WRONLY
69#define O_RDONLY _O_RDONLY38#define O_RDWR _O_RDWR
70#define O_WRONLY _O_WRONLY39#define O_APPEND _O_APPEND
71#define O_RDWR _O_RDWR40#define O_CREAT _O_CREAT
72#define O_ACCMODE _O_ACCMODE41#define O_TRUNC _O_TRUNC
73#define O_APPEND _O_APPEND42#define O_EXCL _O_EXCL
74#define O_CREAT _O_CREAT43#define O_TEXT _O_TEXT
75#define O_TRUNC _O_TRUNC44#define O_BINARY _O_BINARY
76#define O_EXCL _O_EXCL45#define O_RAW _O_BINARY
77#define O_TEXT _O_TEXT46#define O_TEMPORARY _O_TEMPORARY
78#define O_BINARY _O_BINARY47#define O_NOINHERIT _O_NOINHERIT
79#define O_TEMPORARY _O_TEMPORARY48#define O_SEQUENTIAL _O_SEQUENTIAL
80#define O_NOINHERIT _O_NOINHERIT49#define O_RANDOM _O_RANDOM
81#define O_SEQENTIAL _O_SEQUENTIAL50#define O_ACCMODE _O_ACCMODE
82#define O_RANDOM _O_RANDOM
83
84#endif /* Not _NO_OLDNAMES */
85
86
87#ifndef RC_INVOKED
88
89/*
90 * This variable determines the default file mode.
91 * TODO: Which flags work?
92 */
93#ifndef __DECLSPEC_SUPPORTED
94
95#ifdef __MSVCRT__
96extern unsigned int* __imp__fmode;
97#define _fmode (*__imp__fmode)
98#else
99/* CRTDLL */
100extern unsigned int* __imp__fmode_dll;
101#define _fmode (*__imp__fmode_dll)
102#endif51#endif
103
104#else /* __DECLSPEC_SUPPORTED */
105
106#ifdef __MSVCRT__
107__MINGW_IMPORT unsigned int _fmode;
108#else /* ! __MSVCRT__ */
109__MINGW_IMPORT unsigned int _fmode_dll;
110#define _fmode _fmode_dll
111#endif /* ! __MSVCRT__ */
112
113#endif /* __DECLSPEC_SUPPORTED */
114
115
116#ifdef __cplusplus
117extern "C" {
118#endif52#endif
119
120int _setmode (int, int);
121
122#ifndef _NO_OLDNAMES
123int setmode (int, int);
124#endif /* Not _NO_OLDNAMES */
125
126#ifdef __cplusplus
127}
128#endif
129
130#endif /* Not RC_INVOKED */
131
132#endif /* Not _FCNTL_H_ */
133
134#endif /* Not __STRICT_ANSI__ */
135
win32/include/fenv.h+62−39
@@ -1,15 +1,49 @@
1#ifndef _FENV_H1/**
2#define _FENV_H2 * 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 _FENV_H_
7#define _FENV_H_
3 8
9#include <_mingw.h>
10
11/* FPU status word exception flags */
12#define FE_INVALID 0x01
13#define FE_DENORMAL 0x02
14#define FE_DIVBYZERO 0x04
15#define FE_OVERFLOW 0x08
16#define FE_UNDERFLOW 0x10
17#define FE_INEXACT 0x20
18#define FE_ALL_EXCEPT (FE_INVALID | FE_DENORMAL | FE_DIVBYZERO \
19 | FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT)
20
21/* FPU control word rounding flags */
22#define FE_TONEAREST 0x0000
23#define FE_DOWNWARD 0x0400
24#define FE_UPWARD 0x0800
25#define FE_TOWARDZERO 0x0c00
26
27/* The MXCSR exception flags are the same as the
28 FE flags. */
29#define __MXCSR_EXCEPT_FLAG_SHIFT 0
30
31/* How much to shift FE status word exception flags
32 to get MXCSR rounding flags, */
33#define __MXCSR_ROUND_FLAG_SHIFT 3
34
35#ifndef RC_INVOKED
4/*36/*
5 For now, support only for the basic abstraction of flags that are37 For now, support only for the basic abstraction of flags that are
6 either set or clear. fexcept_t could be structure that holds more info38 either set or clear. fexcept_t could be structure that holds more
7 about the fp environment.39 info about the fp environment.
8*/40*/
9typedef unsigned short fexcept_t;41typedef unsigned short fexcept_t;
10 42
11/* This 28-byte struct represents the entire floating point43/* This 32-byte struct represents the entire floating point
12 environment as stored by fnstenv or fstenv */44 environment as stored by fnstenv or fstenv, augmented by
45 the contents of the MXCSR register, as stored by stmxcsr
46 (if CPU supports it). */
13typedef struct47typedef struct
14{48{
15 unsigned short __control_word;49 unsigned short __control_word;
@@ -24,58 +58,47 @@ typedef struct · 8 unmodified lines
24 unsigned int __data_offset;58 unsigned int __data_offset;
25 unsigned short __data_selector; 59 unsigned short __data_selector;
26 unsigned short __unused3;60 unsigned short __unused3;
61 unsigned int __mxcsr; /* contents of the MXCSR register */
27} fenv_t;62} fenv_t;
28 63
29 64
30/* FPU status word exception flags */65/*The C99 standard (7.6.9) allows us to define implementation-specific macros for
31#define FE_INVALID 0x0166 different fp environments */
32#define FE_DENORMAL 0x0267
33#define FE_DIVBYZERO 0x0468/* The default Intel x87 floating point environment (64-bit mantissa) */
34#define FE_OVERFLOW 0x0869#define FE_PC64_ENV ((const fenv_t *)-1)
35#define FE_UNDERFLOW 0x10
36#define FE_INEXACT 0x20
37#define FE_ALL_EXCEPT (FE_INVALID | FE_DENORMAL | FE_DIVBYZERO \
38 | FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT)
39
40/* FPU control word rounding flags */
41#define FE_TONEAREST 0x0000
42#define FE_DOWNWARD 0x0400
43#define FE_UPWARD 0x0800
44#define FE_TOWARDZERO 0x0c00
45 70
71/* The floating point environment set by MSVCRT _fpreset (53-bit mantissa) */
72#define FE_PC53_ENV ((const fenv_t *)-2)
46 73
47/* The default floating point environment */74/* The FE_DFL_ENV macro is required by standard.
48#define FE_DFL_ENV ((const fenv_t *)-1)75 fesetenv will use the environment set at app startup.*/
76#define FE_DFL_ENV ((const fenv_t *) 0)
49 77
50
51#ifndef RC_INVOKED
52#ifdef __cplusplus78#ifdef __cplusplus
53extern "C" {79extern "C" {
54#endif80#endif
55 81
56
57/*TODO: Some of these could be inlined */82/*TODO: Some of these could be inlined */
58/* 7.6.2 Exception */83/* 7.6.2 Exception */
59 84
60extern int feclearexcept (int);85extern int __cdecl feclearexcept (int);
61extern int fegetexceptflag (fexcept_t * flagp, int excepts);86extern int __cdecl fegetexceptflag (fexcept_t * flagp, int excepts);
62extern int feraiseexcept (int excepts );87extern int __cdecl feraiseexcept (int excepts );
63extern int fesetexceptflag (const fexcept_t *, int);88extern int __cdecl fesetexceptflag (const fexcept_t *, int);
64extern int fetestexcept (int excepts);89extern int __cdecl fetestexcept (int excepts);
65
66 90
67/* 7.6.3 Rounding */91/* 7.6.3 Rounding */
68 92
69extern int fegetround (void);93extern int __cdecl fegetround (void);
70extern int fesetround (int mode);94extern int __cdecl fesetround (int mode);
71
72 95
73/* 7.6.4 Environment */96/* 7.6.4 Environment */
74 97
75extern int fegetenv (fenv_t * envp);98extern int __cdecl fegetenv(fenv_t * envp);
76extern int fesetenv (const fenv_t * );99extern int __cdecl fesetenv(const fenv_t * );
77extern int feupdateenv (const fenv_t *);100extern int __cdecl feupdateenv(const fenv_t *);
78extern int feholdexcept (fenv_t *);101extern int __cdecl feholdexcept(fenv_t *);
79 102
80#ifdef __cplusplus103#ifdef __cplusplus
81}104}
win32/include/float.h+0−224
@@ -1,224 +0,0 @@
1/*
2 * float.h
3 *
4 * Constants related to floating point arithmetic.
5 *
6 * Also included here are some non-ANSI bits for accessing the floating
7 * point controller.
8 *
9 * NOTE: GCC provides float.h, and it is probably more accurate than this,
10 * but it doesn't include the non-standard stuff for accessing the
11 * fp controller. (TODO: Move those bits elsewhere?) Thus it is
12 * probably not a good idea to use the GCC supplied version instead
13 * of this header.
14 *
15 * This file is part of the Mingw32 package.
16 *
17 * Contributors:
18 * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
19 *
20 * THIS SOFTWARE IS NOT COPYRIGHTED
21 *
22 * This source code is offered for use in the public domain. You may
23 * use, modify or distribute it freely.
24 *
25 * This code is distributed in the hope that it will be useful but
26 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
27 * DISCLAIMED. This includes but is not limited to warranties of
28 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
29 *
30 * $Revision: 1.2 $
31 * $Author: bellard $
32 * $Date: 2005/04/17 13:14:29 $
33 *
34 */
35
36#ifndef _FLOAT_H_
37#define _FLOAT_H_
38
39/* All the headers include this file. */
40#include <_mingw.h>
41
42#define FLT_ROUNDS 1
43#define FLT_GUARD 1
44#define FLT_NORMALIZE 1
45
46/*
47 * The characteristics of float.
48 */
49
50/* The radix for floating point representation. */
51#define FLT_RADIX 2
52
53/* Decimal digits of precision. */
54#define FLT_DIG 6
55
56/* Smallest number such that 1+x != 1 */
57#define FLT_EPSILON 1.19209290e-07F
58
59/* The number of base FLT_RADIX digits in the mantissa. */
60#define FLT_MANT_DIG 24
61
62/* The maximum floating point number. */
63#define FLT_MAX 3.40282347e+38F
64
65/* Maximum n such that FLT_RADIX^n - 1 is representable. */
66#define FLT_MAX_EXP 128
67
68/* Maximum n such that 10^n is representable. */
69#define FLT_MAX_10_EXP 38
70
71/* Minimum normalized floating-point number. */
72#define FLT_MIN 1.17549435e-38F
73
74/* Minimum n such that FLT_RADIX^n is a normalized number. */
75#define FLT_MIN_EXP (-125)
76
77/* Minimum n such that 10^n is a normalized number. */
78#define FLT_MIN_10_EXP (-37)
79
80
81/*
82 * The characteristics of double.
83 */
84#define DBL_DIG 15
85#define DBL_EPSILON 1.1102230246251568e-16
86#define DBL_MANT_DIG 53
87#define DBL_MAX 1.7976931348623157e+308
88#define DBL_MAX_EXP 1024
89#define DBL_MAX_10_EXP 308
90#define DBL_MIN 2.2250738585072014e-308
91#define DBL_MIN_EXP (-1021)
92#define DBL_MIN_10_EXP (-307)
93
94
95/*
96 * The characteristics of long double.
97 * NOTE: long double is the same as double.
98 */
99#define LDBL_DIG 15
100#define LDBL_EPSILON 1.1102230246251568e-16L
101#define LDBL_MANT_DIG 53
102#define LDBL_MAX 1.7976931348623157e+308L
103#define LDBL_MAX_EXP 1024
104#define LDBL_MAX_10_EXP 308
105#define LDBL_MIN 2.2250738585072014e-308L
106#define LDBL_MIN_EXP (-1021)
107#define LDBL_MIN_10_EXP (-307)
108
109
110/*
111 * Functions and definitions for controlling the FPU.
112 */
113#ifndef __STRICT_ANSI__
114
115/* TODO: These constants are only valid for x86 machines */
116
117/* Control word masks for unMask */
118#define _MCW_EM 0x0008001F /* Error masks */
119#define _MCW_IC 0x00040000 /* Infinity */
120#define _MCW_RC 0x00000300 /* Rounding */
121#define _MCW_PC 0x00030000 /* Precision */
122
123/* Control word values for unNew (use with related unMask above) */
124#define _EM_INVALID 0x00000010
125#define _EM_DENORMAL 0x00080000
126#define _EM_ZERODIVIDE 0x00000008
127#define _EM_OVERFLOW 0x00000004
128#define _EM_UNDERFLOW 0x00000002
129#define _EM_INEXACT 0x00000001
130#define _IC_AFFINE 0x00040000
131#define _IC_PROJECTIVE 0x00000000
132#define _RC_CHOP 0x00000300
133#define _RC_UP 0x00000200
134#define _RC_DOWN 0x00000100
135#define _RC_NEAR 0x00000000
136#define _PC_24 0x00020000
137#define _PC_53 0x00010000
138#define _PC_64 0x00000000
139
140/* These are also defined in Mingw math.h, needed to work around
141 GCC build issues. */
142/* Return values for fpclass. */
143#ifndef __MINGW_FPCLASS_DEFINED
144#define __MINGW_FPCLASS_DEFINED 1
145#define _FPCLASS_SNAN 0x0001 /* Signaling "Not a Number" */
146#define _FPCLASS_QNAN 0x0002 /* Quiet "Not a Number" */
147#define _FPCLASS_NINF 0x0004 /* Negative Infinity */
148#define _FPCLASS_NN 0x0008 /* Negative Normal */
149#define _FPCLASS_ND 0x0010 /* Negative Denormal */
150#define _FPCLASS_NZ 0x0020 /* Negative Zero */
151#define _FPCLASS_PZ 0x0040 /* Positive Zero */
152#define _FPCLASS_PD 0x0080 /* Positive Denormal */
153#define _FPCLASS_PN 0x0100 /* Positive Normal */
154#define _FPCLASS_PINF 0x0200 /* Positive Infinity */
155#endif /* __MINGW_FPCLASS_DEFINED */
156
157/* invalid subconditions (_SW_INVALID also set) */
158#define _SW_UNEMULATED 0x0040 /* unemulated instruction */
159#define _SW_SQRTNEG 0x0080 /* square root of a neg number */
160#define _SW_STACKOVERFLOW 0x0200 /* FP stack overflow */
161#define _SW_STACKUNDERFLOW 0x0400 /* FP stack underflow */
162
163/* Floating point error signals and return codes */
164#define _FPE_INVALID 0x81
165#define _FPE_DENORMAL 0x82
166#define _FPE_ZERODIVIDE 0x83
167#define _FPE_OVERFLOW 0x84
168#define _FPE_UNDERFLOW 0x85
169#define _FPE_INEXACT 0x86
170#define _FPE_UNEMULATED 0x87
171#define _FPE_SQRTNEG 0x88
172#define _FPE_STACKOVERFLOW 0x8a
173#define _FPE_STACKUNDERFLOW 0x8b
174#define _FPE_EXPLICITGEN 0x8c /* raise( SIGFPE ); */
175
176#ifndef RC_INVOKED
177
178#ifdef __cplusplus
179extern "C" {
180#endif
181
182/* Set the FPU control word as cw = (cw & ~unMask) | (unNew & unMask),
183 * i.e. change the bits in unMask to have the values they have in unNew,
184 * leaving other bits unchanged. */
185unsigned int _controlfp (unsigned int unNew, unsigned int unMask);
186unsigned int _control87 (unsigned int unNew, unsigned int unMask);
187
188
189unsigned int _clearfp (void); /* Clear the FPU status word */
190unsigned int _statusfp (void); /* Report the FPU status word */
191#define _clear87 _clearfp
192#define _status87 _statusfp
193
194void _fpreset (void); /* Reset the FPU */
195void fpreset (void);
196
197/* Global 'variable' for the current floating point error code. */
198int * __fpecode(void);
199#define _fpecode (*(__fpecode()))
200
201/*
202 * IEEE recommended functions
203 */
204
205double _chgsign (double);
206double _copysign (double, double);
207double _logb (double);
208double _nextafter (double, double);
209double _scalb (double, long);
210
211int _finite (double);
212int _fpclass (double);
213int _isnan (double);
214
215#ifdef __cplusplus
216}
217#endif
218
219#endif /* Not RC_INVOKED */
220
221#endif /* Not __STRICT_ANSI__ */
222
223#endif /* _FLOAT_H_ */
224
win32/include/inttypes.h+45−23
@@ -1,8 +1,14 @@
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 */
1/* 7.8 Format conversion of integer types <inttypes.h> */6/* 7.8 Format conversion of integer types <inttypes.h> */
2 7
3#ifndef _INTTYPES_H8#ifndef _INTTYPES_H_
4#define _INTTYPES_H9#define _INTTYPES_H_
5 10
11#include <_mingw.h>
6#include <stdint.h>12#include <stdint.h>
7#define __need_wchar_t13#define __need_wchar_t
8#include <stddef.h>14#include <stddef.h>
@@ -43,7 +49,6 @@ typedef struct { · 34 unmodified lines
43#define PRIdFAST64 "I64d"49#define PRIdFAST64 "I64d"
44 50
45#define PRIdMAX "I64d"51#define PRIdMAX "I64d"
46#define PRIdPTR "d"
47 52
48#define PRIi8 "i"53#define PRIi8 "i"
49#define PRIi16 "i"54#define PRIi16 "i"
@@ -61,7 +66,6 @@ typedef struct { · 11 unmodified lines
61#define PRIiFAST64 "I64i"66#define PRIiFAST64 "I64i"
62 67
63#define PRIiMAX "I64i"68#define PRIiMAX "I64i"
64#define PRIiPTR "i"
65 69
66#define PRIo8 "o"70#define PRIo8 "o"
67#define PRIo16 "o"71#define PRIo16 "o"
@@ -80,8 +84,6 @@ typedef struct { · 12 unmodified lines
80 84
81#define PRIoMAX "I64o"85#define PRIoMAX "I64o"
82 86
83#define PRIoPTR "o"
84
85/* fprintf macros for unsigned types */87/* fprintf macros for unsigned types */
86#define PRIu8 "u"88#define PRIu8 "u"
87#define PRIu16 "u"89#define PRIu16 "u"
@@ -100,7 +102,6 @@ typedef struct { · 12 unmodified lines
100#define PRIuFAST64 "I64u"102#define PRIuFAST64 "I64u"
101 103
102#define PRIuMAX "I64u"104#define PRIuMAX "I64u"
103#define PRIuPTR "u"
104 105
105#define PRIx8 "x"106#define PRIx8 "x"
106#define PRIx16 "x"107#define PRIx16 "x"
@@ -118,7 +119,6 @@ typedef struct { · 11 unmodified lines
118#define PRIxFAST64 "I64x"119#define PRIxFAST64 "I64x"
119 120
120#define PRIxMAX "I64x"121#define PRIxMAX "I64x"
121#define PRIxPTR "x"
122 122
123#define PRIX8 "X"123#define PRIX8 "X"
124#define PRIX16 "X"124#define PRIX16 "X"
@@ -136,7 +136,6 @@ typedef struct { · 11 unmodified lines
136#define PRIXFAST64 "I64X"136#define PRIXFAST64 "I64X"
137 137
138#define PRIXMAX "I64X"138#define PRIXMAX "I64X"
139#define PRIXPTR "X"
140 139
141/*140/*
142 * fscanf macros for signed int types141 * fscanf macros for signed int types
@@ -158,7 +157,6 @@ typedef struct { · 15 unmodified lines
158#define SCNdFAST64 "I64d"157#define SCNdFAST64 "I64d"
159 158
160#define SCNdMAX "I64d"159#define SCNdMAX "I64d"
161#define SCNdPTR "d"
162 160
163#define SCNi16 "hi"161#define SCNi16 "hi"
164#define SCNi32 "i"162#define SCNi32 "i"
@@ -173,7 +171,6 @@ typedef struct { · 8 unmodified lines
173#define SCNiFAST64 "I64i"171#define SCNiFAST64 "I64i"
174 172
175#define SCNiMAX "I64i"173#define SCNiMAX "I64i"
176#define SCNiPTR "i"
177 174
178#define SCNo16 "ho"175#define SCNo16 "ho"
179#define SCNo32 "o"176#define SCNo32 "o"
@@ -188,7 +185,6 @@ typedef struct { · 8 unmodified lines
188#define SCNoFAST64 "I64o"185#define SCNoFAST64 "I64o"
189 186
190#define SCNoMAX "I64o"187#define SCNoMAX "I64o"
191#define SCNoPTR "o"
192 188
193#define SCNx16 "hx"189#define SCNx16 "hx"
194#define SCNx32 "x"190#define SCNx32 "x"
@@ -203,8 +199,6 @@ typedef struct { · 8 unmodified lines
203#define SCNxFAST64 "I64x"199#define SCNxFAST64 "I64x"
204 200
205#define SCNxMAX "I64x"201#define SCNxMAX "I64x"
206#define SCNxPTR "x"
207
208 202
209/* fscanf macros for unsigned int types */203/* fscanf macros for unsigned int types */
210 204
@@ -221,7 +215,32 @@ typedef struct { · 10 unmodified lines
221#define SCNuFAST64 "I64u"215#define SCNuFAST64 "I64u"
222 216
223#define SCNuMAX "I64u"217#define SCNuMAX "I64u"
224#define SCNuPTR "u"218
219#ifdef _WIN64
220#define PRIdPTR "I64d"
221#define PRIiPTR "I64i"
222#define PRIoPTR "I64o"
223#define PRIuPTR "I64u"
224#define PRIxPTR "I64x"
225#define PRIXPTR "I64X"
226#define SCNdPTR "I64d"
227#define SCNiPTR "I64i"
228#define SCNoPTR "I64o"
229#define SCNxPTR "I64x"
230#define SCNuPTR "I64u"
231#else
232#define PRIdPTR "d"
233#define PRIiPTR "i"
234#define PRIoPTR "o"
235#define PRIuPTR "u"
236#define PRIxPTR "x"
237#define PRIXPTR "X"
238#define SCNdPTR "d"
239#define SCNiPTR "i"
240#define SCNoPTR "o"
241#define SCNxPTR "x"
242 #define SCNuPTR "u"
243#endif
225 244
226#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L245#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
227/*246/*
@@ -254,19 +273,22 @@ typedef struct { · 26 unmodified lines
254 273
255#endif /* !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) */274#endif /* !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) */
256 275
257extern inline intmax_t imaxabs (intmax_t j)276intmax_t __cdecl imaxabs (intmax_t j);
277__CRT_INLINE intmax_t __cdecl imaxabs (intmax_t j)
258 {return (j >= 0 ? j : -j);}278 {return (j >= 0 ? j : -j);}
259imaxdiv_t imaxdiv (intmax_t numer, intmax_t denom);279imaxdiv_t __cdecl imaxdiv (intmax_t numer, intmax_t denom);
260 280
261/* 7.8.2 Conversion functions for greatest-width integer types */281/* 7.8.2 Conversion functions for greatest-width integer types */
262 282
263intmax_t strtoimax (const char* __restrict__ nptr, char** __restrict__ endptr, int base);283intmax_t __cdecl strtoimax (const char* __restrict__ nptr,
264uintmax_t strtoumax (const char* __restrict__ nptr, char** __restrict__ endptr, int base);284 char** __restrict__ endptr, int base);
285uintmax_t __cdecl strtoumax (const char* __restrict__ nptr,
286 char** __restrict__ endptr, int base);
265 287
266intmax_t wcstoimax (const wchar_t* __restrict__ nptr, wchar_t** __restrict__ endptr,288intmax_t __cdecl wcstoimax (const wchar_t* __restrict__ nptr,
267 int base);289 wchar_t** __restrict__ endptr, int base);
268uintmax_t wcstoumax (const wchar_t* __restrict__ nptr, wchar_t** __restrict__ endptr,290uintmax_t __cdecl wcstoumax (const wchar_t* __restrict__ nptr,
269 int base);291 wchar_t** __restrict__ endptr, int base);
270 292
271#ifdef __cplusplus293#ifdef __cplusplus
272}294}
win32/include/io.h+367−245
@@ -1,296 +1,418 @@
1/*
2 * io.h
3 *
4 * System level I/O functions and types.
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 __STRICT_ANSI__
28 1
29#ifndef _IO_H_2/**
30#define _IO_H_3 * This file has no copyright assigned and is placed in the Public Domain.
4 * This file is part of the w64 mingw-runtime package.
5 * No warranty is given; refer to the file DISCLAIMER within this package.
6 */
7#ifndef _IO_H_
8#define _IO_H_
31 9
32/* All the headers include this file. */
33#include <_mingw.h>10#include <_mingw.h>
11#include <string.h>
34 12
35/* We need the definition of FILE anyway... */13#pragma pack(push,_CRT_PACKING)
36#include <stdio.h>
37
38/* MSVC's io.h contains the stuff from dir.h, so I will too.
39 * NOTE: This also defines off_t, the file offset type, through
40 * an inclusion of sys/types.h */
41#ifndef __STRICT_ANSI__
42 14
43#include <sys/types.h> /* To get time_t. */15#ifndef _POSIX_
44 16
45/*17#ifdef __cplusplus
46 * Attributes of files as returned by _findfirst et al.18extern "C" {
47 */19#endif
48#define _A_NORMAL 0x00000000
49#define _A_RDONLY 0x00000001
50#define _A_HIDDEN 0x00000002
51#define _A_SYSTEM 0x00000004
52#define _A_VOLID 0x00000008
53#define _A_SUBDIR 0x00000010
54#define _A_ARCH 0x00000020
55
56
57#ifndef RC_INVOKED
58 20
59#ifndef _FSIZE_T_DEFINED21_CRTIMP char* __cdecl _getcwd (char*, int);
60typedef unsigned long _fsize_t;22#ifndef _FSIZE_T_DEFINED
23 typedef unsigned long _fsize_t;
61#define _FSIZE_T_DEFINED24#define _FSIZE_T_DEFINED
62#endif25#endif
63 26
64/*27#ifndef _FINDDATA_T_DEFINED
65 * The following structure is filled in by _findfirst or _findnext when28
66 * they succeed in finding a match.29 struct _finddata32_t {
67 */30 unsigned attrib;
68struct _finddata_t31 __time32_t time_create;
69{32 __time32_t time_access;
70 unsigned attrib; /* Attributes, see constants above. */33 __time32_t time_write;
71 time_t time_create;34 _fsize_t size;
72 time_t time_access; /* always midnight local time */35 char name[260];
73 time_t time_write;36 };
74 _fsize_t size;37
75 char name[FILENAME_MAX]; /* may include spaces. */38/*#if _INTEGRAL_MAX_BITS >= 64*/
76};39
77 40 struct _finddata32i64_t {
78struct _finddatai64_t {41 unsigned attrib;
79 unsigned attrib;42 __time32_t time_create;
80 time_t time_create;43 __time32_t time_access;
81 time_t time_access;44 __time32_t time_write;
82 time_t time_write;45 __int64 size;
83 __int64 size;46 char name[260];
84 char name[FILENAME_MAX];47 };
85};48
49 struct _finddata64i32_t {
50 unsigned attrib;
51 __time64_t time_create;
52 __time64_t time_access;
53 __time64_t time_write;
54 _fsize_t size;
55 char name[260];
56 };
57
58 struct __finddata64_t {
59 unsigned attrib;
60 __time64_t time_create;
61 __time64_t time_access;
62 __time64_t time_write;
63 __int64 size;
64 char name[260];
65 };
66/* #endif */
67
68#ifdef _USE_32BIT_TIME_T
69#define _finddata_t _finddata32_t
70#define _finddatai64_t _finddata32i64_t
71
72#ifdef _WIN64
73#define _findfirst _findfirst32
74#define _findnext _findnext32
75#else
76#define _findfirst32 _findfirst
77#define _findnext32 _findnext
78#endif
79#define _findfirsti64 _findfirst32i64
80#define _findnexti64 _findnext32i64
81#else
82#define _finddata_t _finddata64i32_t
83#define _finddatai64_t __finddata64_t
84
85#define _findfirst _findfirst64i32
86#define _findnext _findnext64i32
87#define _findfirsti64 _findfirst64
88#define _findnexti64 _findnext64
89#endif
86 90
91#define _FINDDATA_T_DEFINED
92#endif
87 93
88#ifndef _WFINDDATA_T_DEFINED94#ifndef _WFINDDATA_T_DEFINED
89struct _wfinddata_t {95
90 unsigned attrib;96 struct _wfinddata32_t {
91 time_t time_create; /* -1 for FAT file systems */97 unsigned attrib;
92 time_t time_access; /* -1 for FAT file systems */98 __time32_t time_create;
93 time_t time_write;99 __time32_t time_access;
94 _fsize_t size;100 __time32_t time_write;
95 wchar_t name[FILENAME_MAX]; /* may include spaces. */101 _fsize_t size;
96};102 wchar_t name[260];
97struct _wfinddatai64_t {103 };
98 unsigned attrib;104
99 time_t time_create;105/* #if _INTEGRAL_MAX_BITS >= 64 */
100 time_t time_access;106
101 time_t time_write;107 struct _wfinddata32i64_t {
102 __int64 size;108 unsigned attrib;
103 wchar_t name[FILENAME_MAX];109 __time32_t time_create;
104};110 __time32_t time_access;
111 __time32_t time_write;
112 __int64 size;
113 wchar_t name[260];
114 };
115
116 struct _wfinddata64i32_t {
117 unsigned attrib;
118 __time64_t time_create;
119 __time64_t time_access;
120 __time64_t time_write;
121 _fsize_t size;
122 wchar_t name[260];
123 };
124
125 struct _wfinddata64_t {
126 unsigned attrib;
127 __time64_t time_create;
128 __time64_t time_access;
129 __time64_t time_write;
130 __int64 size;
131 wchar_t name[260];
132 };
133/* #endif */
134
135#ifdef _USE_32BIT_TIME_T
136#define _wfinddata_t _wfinddata32_t
137#define _wfinddatai64_t _wfinddata32i64_t
138
139#define _wfindfirst _wfindfirst32
140#define _wfindnext _wfindnext32
141#define _wfindfirsti64 _wfindfirst32i64
142#define _wfindnexti64 _wfindnext32i64
143#else
144#define _wfinddata_t _wfinddata64i32_t
145#define _wfinddatai64_t _wfinddata64_t
146
147#define _wfindfirst _wfindfirst64i32
148#define _wfindnext _wfindnext64i32
149#define _wfindfirsti64 _wfindfirst64
150#define _wfindnexti64 _wfindnext64
151#endif
105 152
106#define _WFINDDATA_T_DEFINED153#define _WFINDDATA_T_DEFINED
107#endif154#endif
108 155
109#ifdef __cplusplus156#define _A_NORMAL 0x00
110extern "C" {157#define _A_RDONLY 0x01
158#define _A_HIDDEN 0x02
159#define _A_SYSTEM 0x04
160#define _A_SUBDIR 0x10
161#define _A_ARCH 0x20
162
163#ifndef _SIZE_T_DEFINED
164#define _SIZE_T_DEFINED
165#undef size_t
166#ifdef _WIN64
167#if defined(__GNUC__) && defined(__STRICT_ANSI__)
168 typedef unsigned int size_t __attribute__ ((mode (DI)));
169#else
170 typedef unsigned __int64 size_t;
171#endif
172#else
173 typedef unsigned int size_t;
174#endif
111#endif175#endif
112 176
113/*177#ifndef _SSIZE_T_DEFINED
114 * Functions for searching for files. _findfirst returns -1 if no match178#define _SSIZE_T_DEFINED
115 * is found. Otherwise it returns a handle to be used in _findnext and179#undef ssize_t
116 * _findclose calls. _findnext also returns -1 if no match could be found,180#ifdef _WIN64
117 * and 0 if a match was found. Call _findclose when you are finished.181#if defined(__GNUC__) && defined(__STRICT_ANSI__)
118 */182 typedef int ssize_t __attribute__ ((mode (DI)));
119int _findfirst (const char*, struct _finddata_t*);183#else
120int _findnext (int, struct _finddata_t*);184 typedef __int64 ssize_t;
121int _findclose (int);185#endif
186#else
187 typedef int ssize_t;
188#endif
189#endif
122 190
123int _chdir (const char*);191#ifndef _OFF_T_DEFINED
124char* _getcwd (char*, int);192#define _OFF_T_DEFINED
125int _mkdir (const char*);193#ifndef _OFF_T_
126char* _mktemp (char*);194#define _OFF_T_
127int _rmdir (const char*);195 typedef long _off_t;
196#if !defined(NO_OLDNAMES) || defined(_POSIX)
197 typedef long off_t;
198#endif
199#endif
200#endif
128 201
202#ifndef _OFF64_T_DEFINED
203#define _OFF64_T_DEFINED
204#if defined(__GNUC__) && defined(__STRICT_ANSI__)
205 typedef int _off64_t __attribute__ ((mode (DI)));
206#if !defined(NO_OLDNAMES) || defined(_POSIX)
207 typedef int off64_t __attribute__ ((mode (DI)));
208#endif
209#else
210 typedef long long _off64_t;
211#if !defined(NO_OLDNAMES) || defined(_POSIX)
212 typedef long long off64_t;
213#endif
214#endif
215#endif
129 216
130#ifdef __MSVCRT__217 /* Some defines for _access nAccessMode (MS doesn't define them, but
131__int64 _filelengthi64(int);218 * it doesn't seem to hurt to add them). */
132long _findfirsti64(const char*, struct _finddatai64_t*);219#define F_OK 0 /* Check for file existence */
133int _findnexti64(long, struct _finddatai64_t*);220#define X_OK 1 /* Check for execute permission. */
134__int64 _lseeki64(int, __int64, int);221#define W_OK 2 /* Check for write permission */
135__int64 _telli64(int);222#define R_OK 4 /* Check for read permission */
136#endif /* __MSVCRT__ */
137 223
224 _CRTIMP int __cdecl _access(const char *_Filename,int _AccessMode);
225 _CRTIMP int __cdecl _chmod(const char *_Filename,int _Mode);
226 _CRTIMP int __cdecl _chsize(int _FileHandle,long _Size);
227 _CRTIMP int __cdecl _close(int _FileHandle);
228 _CRTIMP int __cdecl _commit(int _FileHandle);
229 _CRTIMP int __cdecl _creat(const char *_Filename,int _PermissionMode);
230 _CRTIMP int __cdecl _dup(int _FileHandle);
231 _CRTIMP int __cdecl _dup2(int _FileHandleSrc,int _FileHandleDst);
232 _CRTIMP int __cdecl _eof(int _FileHandle);
233 _CRTIMP long __cdecl _filelength(int _FileHandle);
234 _CRTIMP intptr_t __cdecl _findfirst32(const char *_Filename,struct _finddata32_t *_FindData);
235 _CRTIMP int __cdecl _findnext32(intptr_t _FindHandle,struct _finddata32_t *_FindData);
236 _CRTIMP int __cdecl _findclose(intptr_t _FindHandle);
237 _CRTIMP int __cdecl _isatty(int _FileHandle);
238 _CRTIMP int __cdecl _locking(int _FileHandle,int _LockMode,long _NumOfBytes);
239 _CRTIMP long __cdecl _lseek(int _FileHandle,long _Offset,int _Origin);
240 _off64_t lseek64(int fd,_off64_t offset, int whence);
241 _CRTIMP char *__cdecl _mktemp(char *_TemplateName);
242 _CRTIMP int __cdecl _pipe(int *_PtHandles,unsigned int _PipeSize,int _TextMode);
243 _CRTIMP int __cdecl _read(int _FileHandle,void *_DstBuf,unsigned int _MaxCharCount);
244
245#ifndef _CRT_DIRECTORY_DEFINED
246#define _CRT_DIRECTORY_DEFINED
247 int __cdecl remove(const char *_Filename);
248 int __cdecl rename(const char *_OldFilename,const char *_NewFilename);
249 _CRTIMP int __cdecl _unlink(const char *_Filename);
250#ifndef NO_OLDNAMES
251 int __cdecl unlink(const char *_Filename);
252#endif
253#endif
138 254
139#ifndef _NO_OLDNAMES255 _CRTIMP int __cdecl _setmode(int _FileHandle,int _Mode);
256 _CRTIMP long __cdecl _tell(int _FileHandle);
257 _CRTIMP int __cdecl _umask(int _Mode);
258 _CRTIMP int __cdecl _write(int _FileHandle,const void *_Buf,unsigned int _MaxCharCount);
259
260#if _INTEGRAL_MAX_BITS >= 64
261 _CRTIMP __int64 __cdecl _filelengthi64(int _FileHandle);
262 _CRTIMP intptr_t __cdecl _findfirst32i64(const char *_Filename,struct _finddata32i64_t *_FindData);
263 _CRTIMP intptr_t __cdecl _findfirst64(const char *_Filename,struct __finddata64_t *_FindData);
264#ifdef __cplusplus
265#include <string.h>
266#endif
267 intptr_t __cdecl _findfirst64i32(const char *_Filename,struct _finddata64i32_t *_FindData);
268 __CRT_INLINE intptr_t __cdecl _findfirst64i32(const char *_Filename,struct _finddata64i32_t *_FindData)
269 {
270 struct __finddata64_t fd;
271 intptr_t ret = _findfirst64(_Filename,&fd);
272 _FindData->attrib=fd.attrib;
273 _FindData->time_create=fd.time_create;
274 _FindData->time_access=fd.time_access;
275 _FindData->time_write=fd.time_write;
276 _FindData->size=(_fsize_t) fd.size;
277 strncpy(_FindData->name,fd.name,260);
278 return ret;
279 }
280 _CRTIMP int __cdecl _findnext32i64(intptr_t _FindHandle,struct _finddata32i64_t *_FindData);
281 _CRTIMP int __cdecl _findnext64(intptr_t _FindHandle,struct __finddata64_t *_FindData);
282 int __cdecl _findnext64i32(intptr_t _FindHandle,struct _finddata64i32_t *_FindData);
283 __CRT_INLINE int __cdecl _findnext64i32(intptr_t _FindHandle,struct _finddata64i32_t *_FindData)
284 {
285 struct __finddata64_t fd;
286 int ret = _findnext64(_FindHandle,&fd);
287 _FindData->attrib=fd.attrib;
288 _FindData->time_create=fd.time_create;
289 _FindData->time_access=fd.time_access;
290 _FindData->time_write=fd.time_write;
291 _FindData->size=(_fsize_t) fd.size;
292 strncpy(_FindData->name,fd.name,260);
293 return ret;
294 }
295 __int64 __cdecl _lseeki64(int _FileHandle,__int64 _Offset,int _Origin);
296 __int64 __cdecl _telli64(int _FileHandle);
297#endif
298#ifndef NO_OLDNAMES
140 299
141#ifndef _UWIN300#ifndef _UWIN
142int chdir (const char*);301 int __cdecl chdir (const char *);
143char* getcwd (char*, int);302 char *__cdecl getcwd (char *, int);
144int mkdir (const char*);303 int __cdecl mkdir (const char *);
145char* mktemp (char*);304 char *__cdecl mktemp(char *);
146int rmdir (const char*);305 int __cdecl rmdir (const char*);
306 int __cdecl chmod (const char *, int);
147#endif /* _UWIN */307#endif /* _UWIN */
148 308
149#endif /* Not _NO_OLDNAMES */309#endif /* Not NO_OLDNAMES */
150 310
151#ifdef __cplusplus311 _CRTIMP errno_t __cdecl _sopen_s(int *_FileHandle,const char *_Filename,int _OpenFlag,int _ShareFlag,int _PermissionMode);
152}312
313#ifndef __cplusplus
314 _CRTIMP int __cdecl _open(const char *_Filename,int _OpenFlag,...);
315 _CRTIMP int __cdecl _sopen(const char *_Filename,int _OpenFlag,int _ShareFlag,...);
316#else
317 extern "C++" _CRTIMP int __cdecl _open(const char *_Filename,int _Openflag,int _PermissionMode = 0);
318 extern "C++" _CRTIMP int __cdecl _sopen(const char *_Filename,int _Openflag,int _ShareFlag,int _PermissionMode = 0);
153#endif319#endif
154 320
155#endif /* Not RC_INVOKED */321#ifndef _WIO_DEFINED
322#define _WIO_DEFINED
323 _CRTIMP int __cdecl _waccess(const wchar_t *_Filename,int _AccessMode);
324 _CRTIMP int __cdecl _wchmod(const wchar_t *_Filename,int _Mode);
325 _CRTIMP int __cdecl _wcreat(const wchar_t *_Filename,int _PermissionMode);
326 _CRTIMP intptr_t __cdecl _wfindfirst32(const wchar_t *_Filename,struct _wfinddata32_t *_FindData);
327 _CRTIMP int __cdecl _wfindnext32(intptr_t _FindHandle,struct _wfinddata32_t *_FindData);
328 _CRTIMP int __cdecl _wunlink(const wchar_t *_Filename);
329 _CRTIMP int __cdecl _wrename(const wchar_t *_NewFilename,const wchar_t *_OldFilename);
330 _CRTIMP wchar_t *__cdecl _wmktemp(wchar_t *_TemplateName);
331
332#if _INTEGRAL_MAX_BITS >= 64
333 _CRTIMP intptr_t __cdecl _wfindfirst32i64(const wchar_t *_Filename,struct _wfinddata32i64_t *_FindData);
334 intptr_t __cdecl _wfindfirst64i32(const wchar_t *_Filename,struct _wfinddata64i32_t *_FindData);
335 _CRTIMP intptr_t __cdecl _wfindfirst64(const wchar_t *_Filename,struct _wfinddata64_t *_FindData);
336 _CRTIMP int __cdecl _wfindnext32i64(intptr_t _FindHandle,struct _wfinddata32i64_t *_FindData);
337 int __cdecl _wfindnext64i32(intptr_t _FindHandle,struct _wfinddata64i32_t *_FindData);
338 _CRTIMP int __cdecl _wfindnext64(intptr_t _FindHandle,struct _wfinddata64_t *_FindData);
339#endif
156 340
157#endif /* Not __STRICT_ANSI__ */341 _CRTIMP errno_t __cdecl _wsopen_s(int *_FileHandle,const wchar_t *_Filename,int _OpenFlag,int _ShareFlag,int _PermissionFlag);
158 342
159/* TODO: Maximum number of open handles has not been tested, I just set343#if !defined(__cplusplus) || !(defined(_X86_) && !defined(__x86_64))
160 * it the same as FOPEN_MAX. */344 _CRTIMP int __cdecl _wopen(const wchar_t *_Filename,int _OpenFlag,...);
161#define HANDLE_MAX FOPEN_MAX345 _CRTIMP int __cdecl _wsopen(const wchar_t *_Filename,int _OpenFlag,int _ShareFlag,...);
346#else
347 extern "C++" _CRTIMP int __cdecl _wopen(const wchar_t *_Filename,int _OpenFlag,int _PermissionMode = 0);
348 extern "C++" _CRTIMP int __cdecl _wsopen(const wchar_t *_Filename,int _OpenFlag,int _ShareFlag,int _PermissionMode = 0);
349#endif
162 350
351#endif
163 352
164/* Some defines for _access nAccessMode (MS doesn't define them, but353 int __cdecl __lock_fhandle(int _Filehandle);
165 * it doesn't seem to hurt to add them). */354 void __cdecl _unlock_fhandle(int _Filehandle);
166#define F_OK 0 /* Check for file existence */355 _CRTIMP intptr_t __cdecl _get_osfhandle(int _FileHandle);
167#define X_OK 1 /* Check for execute permission. */356 _CRTIMP int __cdecl _open_osfhandle(intptr_t _OSFileHandle,int _Flags);
168#define W_OK 2 /* Check for write permission */357
169#define R_OK 4 /* Check for read permission */358#ifndef NO_OLDNAMES
359 int __cdecl access(const char *_Filename,int _AccessMode);
360 int __cdecl chmod(const char *_Filename,int _AccessMode);
361 int __cdecl chsize(int _FileHandle,long _Size);
362 int __cdecl close(int _FileHandle);
363 int __cdecl creat(const char *_Filename,int _PermissionMode);
364 int __cdecl dup(int _FileHandle);
365 int __cdecl dup2(int _FileHandleSrc,int _FileHandleDst);
366 int __cdecl eof(int _FileHandle);
367 long __cdecl filelength(int _FileHandle);
368 int __cdecl isatty(int _FileHandle);
369 int __cdecl locking(int _FileHandle,int _LockMode,long _NumOfBytes);
370 long __cdecl lseek(int _FileHandle,long _Offset,int _Origin);
371 char *__cdecl mktemp(char *_TemplateName);
372 int __cdecl open(const char *_Filename,int _OpenFlag,...);
373 int __cdecl read(int _FileHandle,void *_DstBuf,unsigned int _MaxCharCount);
374 int __cdecl setmode(int _FileHandle,int _Mode);
375 int __cdecl sopen(const char *_Filename,int _OpenFlag,int _ShareFlag,...);
376 long __cdecl tell(int _FileHandle);
377 int __cdecl umask(int _Mode);
378 int __cdecl write(int _Filehandle,const void *_Buf,unsigned int _MaxCharCount);
379#endif
170 380
171#ifndef RC_INVOKED381#ifdef __cplusplus
382}
383#endif
384#endif
172 385
173#ifdef __cplusplus386#ifdef __cplusplus
174extern "C" {387extern "C" {
175#endif388#endif
176 389
177int _access (const char*, int);390/* Misc stuff */
178int _chsize (int, long);391char *getlogin(void);
179int _close (int);392#ifdef __USE_MINGW_ALARM
180int _commit(int);393unsigned int alarm(unsigned int seconds);
181 394#endif
182/* NOTE: The only significant bit in unPermissions appears to be bit 7 (0x80),
183 * the "owner write permission" bit (on FAT). */
184int _creat (const char*, unsigned);
185
186int _dup (int);
187int _dup2 (int, int);
188long _filelength (int);
189int _fileno (FILE*);
190long _get_osfhandle (int);
191int _isatty (int);
192
193/* In a very odd turn of events this function is excluded from those
194 * files which define _STREAM_COMPAT. This is required in order to
195 * build GNU libio because of a conflict with _eof in streambuf.h
196 * line 107. Actually I might just be able to change the name of
197 * the enum member in streambuf.h... we'll see. TODO */
198#ifndef _STREAM_COMPAT
199int _eof (int);
200#endif
201
202/* LK_... locking commands defined in sys/locking.h. */
203int _locking (int, int, long);
204
205long _lseek (int, long, int);
206
207/* Optional third argument is unsigned unPermissions. */
208int _open (const char*, int, ...);
209
210int _open_osfhandle (long, int);
211int _pipe (int *, unsigned int, int);
212int _read (int, void*, unsigned int);
213
214/* SH_... flags for nShFlags defined in share.h
215 * Optional fourth argument is unsigned unPermissions */
216int _sopen (const char*, int, int, ...);
217
218long _tell (int);
219/* Should umask be in sys/stat.h and/or sys/types.h instead? */
220int _umask (int);
221int _unlink (const char*);
222int _write (int, const void*, unsigned int);
223
224/* Wide character versions. Also declared in wchar.h. */
225/* Not in crtdll.dll */
226#if !defined (_WIO_DEFINED)
227#if defined (__MSVCRT__)
228int _waccess(const wchar_t*, int);
229int _wchmod(const wchar_t*, int);
230int _wcreat(const wchar_t*, int);
231long _wfindfirst(wchar_t*, struct _wfinddata_t*);
232int _wfindnext(long, struct _wfinddata_t *);
233int _wunlink(const wchar_t*);
234int _wopen(const wchar_t*, int, ...);
235int _wsopen(const wchar_t*, int, int, ...);
236wchar_t * _wmktemp(wchar_t*);
237long _wfindfirsti64(const wchar_t*, struct _wfinddatai64_t*);
238int _wfindnexti64(long, struct _wfinddatai64_t*);
239#endif /* defined (__MSVCRT__) */
240#define _WIO_DEFINED
241#endif /* _WIO_DEFINED */
242
243#ifndef _NO_OLDNAMES
244/*
245 * Non-underscored versions of non-ANSI functions to improve portability.
246 * These functions live in libmoldname.a.
247 */
248 395
249#ifndef _UWIN396#ifdef __USE_MINGW_ACCESS
250int access (const char*, int);397/* Old versions of MSVCRT access() just ignored X_OK, while the version
251int chsize (int, long );398 shipped with Vista, returns an error code. This will restore the
252int close (int);399 old behaviour */
253int creat (const char*, int);400static inline int __mingw_access (const char *__fname, int __mode) {
254int dup (int);401 return _access (__fname, __mode & ~X_OK);
255int dup2 (int, int);402}
256int eof (int);
257long filelength (int);
258int fileno (FILE*);
259int isatty (int);
260long lseek (int, long, int);
261int open (const char*, int, ...);
262int read (int, void*, unsigned int);
263int sopen (const char*, int, int, ...);
264long tell (int);
265int umask (int);
266int unlink (const char*);
267int write (int, const void*, unsigned int);
268#endif /* _UWIN */
269 403
270/* Wide character versions. Also declared in wchar.h. */404#define access(__f,__m) __mingw_access (__f, __m)
271/* Where do these live? Not in libmoldname.a nor in libmsvcrt.a */
272#if 0
273int waccess(const wchar_t *, int);
274int wchmod(const wchar_t *, int);
275int wcreat(const wchar_t *, int);
276long wfindfirst(wchar_t *, struct _wfinddata_t *);
277int wfindnext(long, struct _wfinddata_t *);
278int wunlink(const wchar_t *);
279int wrename(const wchar_t *, const wchar_t *);
280int wopen(const wchar_t *, int, ...);
281int wsopen(const wchar_t *, int, int, ...);
282wchar_t * wmktemp(wchar_t *);
283#endif405#endif
284 406
285#endif /* Not _NO_OLDNAMES */
286 407
287#ifdef __cplusplus408#ifdef __cplusplus
288}409}
289#endif410#endif
290 411
291#endif /* Not RC_INVOKED */
292 412
293#endif /* _IO_H_ not defined */413#pragma pack(pop)
414
415#include <sec_api/io_s.h>
294 416
295#endif /* Not strict ANSI */417#endif /* End _IO_H_ */
296 418
win32/include/limits.h+98−102
@@ -1,115 +1,111 @@
1/* 1/**
2 * limits.h2 * This file has no copyright assigned and is placed in the Public Domain.
3 *3 * This file is part of the w64 mingw-runtime package.
4 * Defines constants for the sizes of integral types.4 * No warranty is given; refer to the file DISCLAIMER within this package.
5 *
6 * NOTE: GCC should supply a version of this header and it should be safe to
7 * use that version instead of this one (maybe safer).
8 *
9 * This file is part of the Mingw32 package.
10 *
11 * Contributors:
12 * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
13 *
14 * THIS SOFTWARE IS NOT COPYRIGHTED
15 *
16 * This source code is offered for use in the public domain. You may
17 * use, modify or distribute it freely.
18 *
19 * This code is distributed in the hope that it will be useful but
20 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
21 * DISCLAIMED. This includes but is not limited to warranties of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
23 *
24 * $Revision: 1.2 $
25 * $Author: bellard $
26 * $Date: 2005/04/17 13:14:29 $
27 *
28 */5 */
29
30#ifndef _LIMITS_H_
31#define _LIMITS_H_
32
33/* All the headers include this file. */
34#include <_mingw.h>6#include <_mingw.h>
35 7
36/*8#ifndef _INC_LIMITS
37 * File system limits9#define _INC_LIMITS
38 *
39 * TODO: NAME_MAX and OPEN_MAX are file system limits or not? Are they the
40 * same as FILENAME_MAX and FOPEN_MAX from stdio.h?
41 * NOTE: Apparently the actual size of PATH_MAX is 260, but a space is
42 * required for the NUL. TODO: Test?
43 */
44#define PATH_MAX (259)
45 10
46/*11/*
47 * Characteristics of the char data type.12* File system limits
48 *13*
49 * TODO: Is MB_LEN_MAX correct?14* TODO: NAME_MAX and OPEN_MAX are file system limits or not? Are they the
50 */15* same as FILENAME_MAX and FOPEN_MAX from stdio.h?
51#define CHAR_BIT 816* NOTE: Apparently the actual size of PATH_MAX is 260, but a space is
52#define MB_LEN_MAX 217* required for the NUL. TODO: Test?
53 18*/
54#define SCHAR_MIN (-128)19#define PATH_MAX (259)
55#define SCHAR_MAX 127
56
57#define UCHAR_MAX 255
58 20
59/* TODO: Is this safe? I think it might just be testing the preprocessor,21#define CHAR_BIT 8
60 * not the compiler itself... */22#define SCHAR_MIN (-128)
61#if ('\x80' < 0)23#define SCHAR_MAX 127
62#define CHAR_MIN SCHAR_MIN24#define UCHAR_MAX 0xff
63#define CHAR_MAX SCHAR_MAX25
64#else26#define CHAR_MIN SCHAR_MIN
65#define CHAR_MIN 027#define CHAR_MAX SCHAR_MAX
66#define CHAR_MAX UCHAR_MAX28
29#define MB_LEN_MAX 5
30#define SHRT_MIN (-32768)
31#define SHRT_MAX 32767
32#define USHRT_MAX 0xffff
33#define INT_MIN (-2147483647 - 1)
34#define INT_MAX 2147483647
35#define UINT_MAX 0xffffffff
36#define LONG_MIN (-2147483647L - 1)
37#define LONG_MAX 2147483647L
38#define ULONG_MAX 0xffffffffUL
39#define LLONG_MAX 9223372036854775807ll
40#define LLONG_MIN (-9223372036854775807ll - 1)
41#define ULLONG_MAX 0xffffffffffffffffull
42
43#if _INTEGRAL_MAX_BITS >= 8
44#define _I8_MIN (-127 - 1)
45#define _I8_MAX 127i8
46#define _UI8_MAX 0xffu
67#endif47#endif
68 48
69/*49#if _INTEGRAL_MAX_BITS >= 16
70 * Maximum and minimum values for ints.50#define _I16_MIN (-32767 - 1)
71 */51#define _I16_MAX 32767i16
72#define INT_MAX 214748364752#define _UI16_MAX 0xffffu
73#define INT_MIN (-INT_MAX-1)53#endif
74
75#define UINT_MAX 0xffffffff
76
77/*
78 * Maximum and minimum values for shorts.
79 */
80#define SHRT_MAX 32767
81#define SHRT_MIN (-SHRT_MAX-1)
82
83#define USHRT_MAX 0xffff
84
85/*
86 * Maximum and minimum values for longs and unsigned longs.
87 *
88 * TODO: This is not correct for Alphas, which have 64 bit longs.
89 */
90#define LONG_MAX 2147483647L
91
92#define LONG_MIN (-LONG_MAX-1)
93
94#define ULONG_MAX 0xffffffffUL
95
96
97/*
98 * The GNU C compiler also allows 'long long int'
99 */
100#if !defined(__STRICT_ANSI__) && defined(__GNUC__)
101
102#define LONG_LONG_MAX 9223372036854775807LL
103#define LONG_LONG_MIN (-LONG_LONG_MAX-1)
104 54
105#define ULONG_LONG_MAX (2ULL * LONG_LONG_MAX + 1)55#if _INTEGRAL_MAX_BITS >= 32
56#define _I32_MIN (-2147483647 - 1)
57#define _I32_MAX 2147483647
58#define _UI32_MAX 0xffffffffu
59#endif
106 60
107/* ISO C9x macro names */61#if defined(__GNUC__)
108#define LLONG_MAX LONG_LONG_MAX62#undef LONG_LONG_MAX
109#define LLONG_MIN LONG_LONG_MIN63#define LONG_LONG_MAX 9223372036854775807ll
110#define ULLONG_MAX ULONG_LONG_MAX64#undef LONG_LONG_MIN
65#define LONG_LONG_MIN (-LONG_LONG_MAX-1)
66#undef ULONG_LONG_MAX
67#define ULONG_LONG_MAX (2ull * LONG_LONG_MAX + 1ull)
68#endif
111 69
112#endif /* Not Strict ANSI and GNU C compiler */70#if _INTEGRAL_MAX_BITS >= 64
71#define _I64_MIN (-9223372036854775807ll - 1)
72#define _I64_MAX 9223372036854775807ll
73#define _UI64_MAX 0xffffffffffffffffull
74#endif
113 75
76#ifndef SIZE_MAX
77#ifdef _WIN64
78#define SIZE_MAX _UI64_MAX
79#else
80#define SIZE_MAX UINT_MAX
81#endif
82#endif
114 83
115#endif /* not _LIMITS_H_ */84#ifdef _POSIX_
85#define _POSIX_ARG_MAX 4096
86#define _POSIX_CHILD_MAX 6
87#define _POSIX_LINK_MAX 8
88#define _POSIX_MAX_CANON 255
89#define _POSIX_MAX_INPUT 255
90#define _POSIX_NAME_MAX 14
91#define _POSIX_NGROUPS_MAX 0
92#define _POSIX_OPEN_MAX 16
93#define _POSIX_PATH_MAX 255
94#define _POSIX_PIPE_BUF 512
95#define _POSIX_SSIZE_MAX 32767
96#define _POSIX_STREAM_MAX 8
97#define _POSIX_TZNAME_MAX 3
98#define ARG_MAX 14500
99#define LINK_MAX 1024
100#define MAX_CANON _POSIX_MAX_CANON
101#define MAX_INPUT _POSIX_MAX_INPUT
102#define NAME_MAX 255
103#define NGROUPS_MAX 16
104#define OPEN_MAX 32
105#define PATH_MAX 512
106#define PIPE_BUF _POSIX_PIPE_BUF
107#define SSIZE_MAX _POSIX_SSIZE_MAX
108#define STREAM_MAX 20
109#define TZNAME_MAX 10
110#endif
111#endif
win32/include/locale.h+75−84
@@ -1,100 +1,91 @@
1/* 1/**
2 * locale.h2 * This file has no copyright assigned and is placed in the Public Domain.
3 *3 * This file is part of the w64 mingw-runtime package.
4 * Functions and types for localization (ie. changing the appearance of4 * No warranty is given; refer to the file DISCLAIMER within this package.
5 * output based on the standards of a certain country).
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 *
12 * THIS SOFTWARE IS NOT COPYRIGHTED
13 *
14 * This source code is offered for use in the public domain. You may
15 * use, modify or distribute it freely.
16 *
17 * This code is distributed in the hope that it will be useful but
18 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
19 * DISCLAIMED. This includes but is not limited to warranties of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 *
22 * $Revision: 1.2 $
23 * $Author: bellard $
24 * $Date: 2005/04/17 13:14:29 $
25 *
26 */5 */
6#ifndef _INC_LOCALE
7#define _INC_LOCALE
27 8
28#ifndef _LOCALE_H_
29#define _LOCALE_H_
30
31/* All the headers include this file. */
32#include <_mingw.h>9#include <_mingw.h>
33 10
34/*11#pragma pack(push,_CRT_PACKING)
35 * NOTE: I have tried to test this, but I am limited by my knowledge of
36 * locale issues. The structure does not bomb if you look at the
37 * values, and 'decimal_point' even seems to be correct. But the
38 * rest of the values are, by default, not particularly useful
39 * (read meaningless and not related to the international settings
40 * of the system).
41 */
42 12
43#define LC_ALL 013#ifdef __cplusplus
44#define LC_COLLATE 114extern "C" {
45#define LC_CTYPE 215#endif
46#define LC_MONETARY 3
47#define LC_NUMERIC 4
48#define LC_TIME 5
49#define LC_MIN LC_ALL
50#define LC_MAX LC_TIME
51 16
52#ifndef RC_INVOKED17#ifndef NULL
18#ifdef __cplusplus
19#define NULL 0
20#else
21#define NULL ((void *)0)
22#endif
23#endif
53 24
54/*25#define LC_ALL 0
55 * The structure returned by 'localeconv'.26#define LC_COLLATE 1
56 */27#define LC_CTYPE 2
57struct lconv28#define LC_MONETARY 3
58{29#define LC_NUMERIC 4
59 char* decimal_point;30#define LC_TIME 5
60 char* thousands_sep;
61 char* grouping;
62 char* int_curr_symbol;
63 char* currency_symbol;
64 char* mon_decimal_point;
65 char* mon_thousands_sep;
66 char* mon_grouping;
67 char* positive_sign;
68 char* negative_sign;
69 char int_frac_digits;
70 char frac_digits;
71 char p_cs_precedes;
72 char p_sep_by_space;
73 char n_cs_precedes;
74 char n_sep_by_space;
75 char p_sign_posn;
76 char n_sign_posn;
77};
78 31
79#ifdef __cplusplus32#define LC_MIN LC_ALL
80extern "C" {33#define LC_MAX LC_TIME
34
35#ifndef _LCONV_DEFINED
36#define _LCONV_DEFINED
37 struct lconv {
38 char *decimal_point;
39 char *thousands_sep;
40 char *grouping;
41 char *int_curr_symbol;
42 char *currency_symbol;
43 char *mon_decimal_point;
44 char *mon_thousands_sep;
45 char *mon_grouping;
46 char *positive_sign;
47 char *negative_sign;
48 char int_frac_digits;
49 char frac_digits;
50 char p_cs_precedes;
51 char p_sep_by_space;
52 char n_cs_precedes;
53 char n_sep_by_space;
54 char p_sign_posn;
55 char n_sign_posn;
56 };
81#endif57#endif
82 58
83char* setlocale (int, const char*);59#ifndef _CONFIG_LOCALE_SWT
84struct lconv* localeconv (void);60#define _CONFIG_LOCALE_SWT
85 61
86#ifndef _WLOCALE_DEFINED /* also declared in wchar.h */62#define _ENABLE_PER_THREAD_LOCALE 0x1
87# define __need_wchar_t63#define _DISABLE_PER_THREAD_LOCALE 0x2
88# include <stddef.h>64#define _ENABLE_PER_THREAD_LOCALE_GLOBAL 0x10
89 wchar_t* _wsetlocale(int, const wchar_t*);65#define _DISABLE_PER_THREAD_LOCALE_GLOBAL 0x20
90# define _WLOCALE_DEFINED66#define _ENABLE_PER_THREAD_LOCALE_NEW 0x100
91#endif /* ndef _WLOCALE_DEFINED */67#define _DISABLE_PER_THREAD_LOCALE_NEW 0x200
92 68
93#ifdef __cplusplus
94}
95#endif69#endif
96 70
97#endif /* Not RC_INVOKED */71 int __cdecl _configthreadlocale(int _Flag);
72 char *__cdecl setlocale(int _Category,const char *_Locale);
73 _CRTIMP struct lconv *__cdecl localeconv(void);
74 _locale_t __cdecl _get_current_locale(void);
75 _locale_t __cdecl _create_locale(int _Category,const char *_Locale);
76 void __cdecl _free_locale(_locale_t _Locale);
77 _locale_t __cdecl __get_current_locale(void);
78 _locale_t __cdecl __create_locale(int _Category,const char *_Locale);
79 void __cdecl __free_locale(_locale_t _Locale);
98 80
99#endif /* Not _LOCALE_H_ */81#ifndef _WLOCALE_DEFINED
82#define _WLOCALE_DEFINED
83 _CRTIMP wchar_t *__cdecl _wsetlocale(int _Category,const wchar_t *_Locale);
84#endif
100 85
86#ifdef __cplusplus
87}
88#endif
89
90#pragma pack(pop)
91#endif
win32/include/malloc.h+156−66
@@ -1,87 +1,177 @@
1/*1/**
2 * malloc.h2 * This file has no copyright assigned and is placed in the Public Domain.
3 *3 * This file is part of the w64 mingw-runtime package.
4 * Support for programs which want to use malloc.h to get memory management4 * No warranty is given; refer to the file DISCLAIMER within this package.
5 * functions. Unless you absolutely need some of these functions and they are
6 * not in the ANSI headers you should use the ANSI standard header files
7 * instead.
8 *
9 * This file is part of the Mingw32 package.
10 *
11 * Contributors:
12 * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
13 *
14 * THIS SOFTWARE IS NOT COPYRIGHTED
15 *
16 * This source code is offered for use in the public domain. You may
17 * use, modify or distribute it freely.
18 *
19 * This code is distributed in the hope that it will be useful but
20 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
21 * DISCLAIMED. This includes but is not limited to warranties of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
23 *
24 * $Revision: 1.2 $
25 * $Author: bellard $
26 * $Date: 2005/04/17 13:14:29 $
27 *
28 */5 */
29
30#ifndef __STRICT_ANSI__
31
32#ifndef _MALLOC_H_6#ifndef _MALLOC_H_
33#define _MALLOC_H_7#define _MALLOC_H_
34 8
35/* All the headers include this file. */
36#include <_mingw.h>9#include <_mingw.h>
37 10
38#include <stdlib.h>11#pragma pack(push,_CRT_PACKING)
39 12
40#ifndef RC_INVOKED13#ifndef _MM_MALLOC_H_INCLUDED
14#define _MM_MALLOC_H_INCLUDED
15#endif
41 16
42/*17#ifdef __cplusplus
43 * The structure used to walk through the heap with _heapwalk.18extern "C" {
44 */19#endif
45typedef struct _heapinfo20
46{21#ifdef _WIN64
47 int* _pentry;22#define _HEAP_MAXREQ 0xFFFFFFFFFFFFFFE0
48 size_t _size;23#else
49 int _useflag;24#define _HEAP_MAXREQ 0xFFFFFFE0
50} _HEAPINFO;25#endif
26
27#ifndef _STATIC_ASSERT
28#define _STATIC_ASSERT(expr) typedef char __static_assert_t[(expr)]
29#endif
30
31/* Return codes for _heapwalk() */
32#define _HEAPEMPTY (-1)
33#define _HEAPOK (-2)
34#define _HEAPBADBEGIN (-3)
35#define _HEAPBADNODE (-4)
36#define _HEAPEND (-5)
37#define _HEAPBADPTR (-6)
51 38
52/* Values for _heapinfo.useflag */39/* Values for _heapinfo.useflag */
53#define _USEDENTRY 040#define _FREEENTRY 0
54#define _FREEENTRY 141#define _USEDENTRY 1
42
43#ifndef _HEAPINFO_DEFINED
44#define _HEAPINFO_DEFINED
45 /* The structure used to walk through the heap with _heapwalk. */
46 typedef struct _heapinfo {
47 int *_pentry;
48 size_t _size;
49 int _useflag;
50 } _HEAPINFO;
51#endif
55 52
56#ifdef __cplusplus53 extern unsigned int _amblksiz;
57extern "C" {54
55#define _mm_free(a) _aligned_free(a)
56#define _mm_malloc(a,b) _aligned_malloc(a,b)
57
58#ifndef _CRT_ALLOCATION_DEFINED
59#define _CRT_ALLOCATION_DEFINED
60 void *__cdecl calloc(size_t _NumOfElements,size_t _SizeOfElements);
61 void __cdecl free(void *_Memory);
62 void *__cdecl malloc(size_t _Size);
63 void *__cdecl realloc(void *_Memory,size_t _NewSize);
64 _CRTIMP void *__cdecl _recalloc(void *_Memory,size_t _Count,size_t _Size);
65 /* _CRTIMP void __cdecl _aligned_free(void *_Memory);
66 _CRTIMP void *__cdecl _aligned_malloc(size_t _Size,size_t _Alignment); */
67 _CRTIMP void *__cdecl _aligned_offset_malloc(size_t _Size,size_t _Alignment,size_t _Offset);
68 _CRTIMP void *__cdecl _aligned_realloc(void *_Memory,size_t _Size,size_t _Alignment);
69 _CRTIMP void *__cdecl _aligned_recalloc(void *_Memory,size_t _Count,size_t _Size,size_t _Alignment);
70 _CRTIMP void *__cdecl _aligned_offset_realloc(void *_Memory,size_t _Size,size_t _Alignment,size_t _Offset);
71 _CRTIMP void *__cdecl _aligned_offset_recalloc(void *_Memory,size_t _Count,size_t _Size,size_t _Alignment,size_t _Offset);
72#endif
73
74#define _MAX_WAIT_MALLOC_CRT 60000
75
76 _CRTIMP int __cdecl _resetstkoflw (void);
77 _CRTIMP unsigned long __cdecl _set_malloc_crt_max_wait(unsigned long _NewValue);
78
79 _CRTIMP void *__cdecl _expand(void *_Memory,size_t _NewSize);
80 _CRTIMP size_t __cdecl _msize(void *_Memory);
81#ifdef __GNUC__
82#undef _alloca
83#define _alloca(x) __builtin_alloca((x))
84#else
85 void *__cdecl _alloca(size_t _Size);
86#endif
87 _CRTIMP size_t __cdecl _get_sbh_threshold(void);
88 _CRTIMP int __cdecl _set_sbh_threshold(size_t _NewValue);
89 _CRTIMP errno_t __cdecl _set_amblksiz(size_t _Value);
90 _CRTIMP errno_t __cdecl _get_amblksiz(size_t *_Value);
91 _CRTIMP int __cdecl _heapadd(void *_Memory,size_t _Size);
92 _CRTIMP int __cdecl _heapchk(void);
93 _CRTIMP int __cdecl _heapmin(void);
94 _CRTIMP int __cdecl _heapset(unsigned int _Fill);
95 _CRTIMP int __cdecl _heapwalk(_HEAPINFO *_EntryInfo);
96 _CRTIMP size_t __cdecl _heapused(size_t *_Used,size_t *_Commit);
97 _CRTIMP intptr_t __cdecl _get_heap_handle(void);
98
99#define _ALLOCA_S_THRESHOLD 1024
100#define _ALLOCA_S_STACK_MARKER 0xCCCC
101#define _ALLOCA_S_HEAP_MARKER 0xDDDD
102
103#if(defined(_X86_) && !defined(__x86_64))
104#define _ALLOCA_S_MARKER_SIZE 8
105#elif defined(__ia64__) || defined(__x86_64)
106#define _ALLOCA_S_MARKER_SIZE 16
107#endif
108
109#if !defined(RC_INVOKED)
110 static __inline void *_MarkAllocaS(void *_Ptr,unsigned int _Marker) {
111 if(_Ptr) {
112 *((unsigned int*)_Ptr) = _Marker;
113 _Ptr = (char*)_Ptr + _ALLOCA_S_MARKER_SIZE;
114 }
115 return _Ptr;
116 }
117#endif
118
119#undef _malloca
120#define _malloca(size) \
121 ((((size) + _ALLOCA_S_MARKER_SIZE) <= _ALLOCA_S_THRESHOLD) ? \
122 _MarkAllocaS(_alloca((size) + _ALLOCA_S_MARKER_SIZE),_ALLOCA_S_STACK_MARKER) : \
123 _MarkAllocaS(malloc((size) + _ALLOCA_S_MARKER_SIZE),_ALLOCA_S_HEAP_MARKER))
124#undef _FREEA_INLINE
125#define _FREEA_INLINE
126
127#ifndef RC_INVOKED
128#undef _freea
129 static __inline void __cdecl _freea(void *_Memory) {
130 unsigned int _Marker;
131 if(_Memory) {
132 _Memory = (char*)_Memory - _ALLOCA_S_MARKER_SIZE;
133 _Marker = *(unsigned int *)_Memory;
134 if(_Marker==_ALLOCA_S_HEAP_MARKER) {
135 free(_Memory);
136 }
137#ifdef _ASSERTE
138 else if(_Marker!=_ALLOCA_S_STACK_MARKER) {
139 _ASSERTE(("Corrupted pointer passed to _freea",0));
140 }
141#endif
142 }
143 }
144#endif /* RC_INVOKED */
145
146#ifndef NO_OLDNAMES
147#undef alloca
148#ifdef __GNUC__
149#define alloca(x) __builtin_alloca((x))
150#else
151#define alloca _alloca
152#endif
58#endif153#endif
59/*
60 The _heap* memory allocation functions are supported on NT
61 but not W9x. On latter, they always set errno to ENOSYS.
62*/
63int _heapwalk (_HEAPINFO*);
64 154
65#ifndef _NO_OLDNAMES155#ifdef HEAPHOOK
66int heapwalk (_HEAPINFO*);156#ifndef _HEAPHOOK_DEFINED
67#endif /* Not _NO_OLDNAMES */157#define _HEAPHOOK_DEFINED
158 typedef int (__cdecl *_HEAPHOOK)(int,size_t,void *,void **);
159#endif
68 160
69int _heapchk (void); /* Verify heap integrety. */161 _CRTIMP _HEAPHOOK __cdecl _setheaphook(_HEAPHOOK _NewHook);
70int _heapmin (void); /* Return unused heap to the OS. */
71int _heapset (unsigned int);
72 162
73size_t _msize (void*);163#define _HEAP_MALLOC 1
74size_t _get_sbh_threshold (void); 164#define _HEAP_CALLOC 2
75int _set_sbh_threshold (size_t);165#define _HEAP_FREE 3
76void * _expand (void*, size_t); 166#define _HEAP_REALLOC 4
167#define _HEAP_MSIZE 5
168#define _HEAP_EXPAND 6
169#endif
77 170
78#ifdef __cplusplus171#ifdef __cplusplus
79}172}
80#endif173#endif
81 174
82#endif /* RC_INVOKED */175#pragma pack(pop)
83
84#endif /* Not _MALLOC_H_ */
85
86#endif /* Not __STRICT_ANSI__ */
87 176
177#endif /* _MALLOC_H_ */
win32/include/math.h+669−330
@@ -1,70 +1,59 @@
1/* 1/**
2 * math.h2 * This file has no copyright assigned and is placed in the Public Domain.
3 *3 * This file is part of the w64 mingw-runtime package.
4 * Mathematical functions.4 * No warranty is given; refer to the file DISCLAIMER within this package.
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 */5 */
26
27#ifndef _MATH_H_6#ifndef _MATH_H_
28#define _MATH_H_7#define _MATH_H_
29 8
30/* All the headers include this file. */9#if __GNUC__ >= 3
31#include <_mingw.h>10#pragma GCC system_header
32 11#endif
33/*
34 * Types for the _exception structure.
35 */
36 12
37#define _DOMAIN 1 /* domain error in argument */13#include <_mingw.h>
38#define _SING 2 /* singularity */
39#define _OVERFLOW 3 /* range overflow */
40#define _UNDERFLOW 4 /* range underflow */
41#define _TLOSS 5 /* total loss of precision */
42#define _PLOSS 6 /* partial loss of precision */
43 14
44/*15struct exception;
45 * Exception types with non-ANSI names for compatibility.
46 */
47 16
48#ifndef __STRICT_ANSI__17#pragma pack(push,_CRT_PACKING)
49#ifndef _NO_OLDNAMES
50 18
51#define DOMAIN _DOMAIN19#define _DOMAIN 1
52#define SING _SING20#define _SING 2
53#define OVERFLOW _OVERFLOW21#define _OVERFLOW 3
54#define UNDERFLOW _UNDERFLOW22#define _UNDERFLOW 4
55#define TLOSS _TLOSS23#define _TLOSS 5
56#define PLOSS _PLOSS24#define _PLOSS 6
57 25
58#endif /* Not _NO_OLDNAMES */26#ifndef __STRICT_ANSI__
59#endif /* Not __STRICT_ANSI__ */27#ifndef NO_OLDNAMES
28#define DOMAIN _DOMAIN
29#define SING _SING
30#define OVERFLOW _OVERFLOW
31#define UNDERFLOW _UNDERFLOW
32#define TLOSS _TLOSS
33#define PLOSS _PLOSS
34#endif
35#endif
60 36
37#ifndef __STRICT_ANSI__
38#define M_E 2.71828182845904523536
39#define M_LOG2E 1.44269504088896340736
40#define M_LOG10E 0.434294481903251827651
41#define M_LN2 0.693147180559945309417
42#define M_LN10 2.30258509299404568402
43#define M_PI 3.14159265358979323846
44#define M_PI_2 1.57079632679489661923
45#define M_PI_4 0.785398163397448309616
46#define M_1_PI 0.318309886183790671538
47#define M_2_PI 0.636619772367581343076
48#define M_2_SQRTPI 1.12837916709551257390
49#define M_SQRT2 1.41421356237309504880
50#define M_SQRT1_2 0.707106781186547524401
51#endif
61 52
62/* These are also defined in Mingw float.h; needed here as well to work 53#ifndef __STRICT_ANSI__
63 around GCC build issues. */54/* See also float.h */
64#ifndef __STRICT_ANSI__
65#ifndef __MINGW_FPCLASS_DEFINED55#ifndef __MINGW_FPCLASS_DEFINED
66#define __MINGW_FPCLASS_DEFINED 156#define __MINGW_FPCLASS_DEFINED 1
67/* IEEE 754 classication */
68#define _FPCLASS_SNAN 0x0001 /* Signaling "Not a Number" */57#define _FPCLASS_SNAN 0x0001 /* Signaling "Not a Number" */
69#define _FPCLASS_QNAN 0x0002 /* Quiet "Not a Number" */58#define _FPCLASS_QNAN 0x0002 /* Quiet "Not a Number" */
70#define _FPCLASS_NINF 0x0004 /* Negative Infinity */59#define _FPCLASS_NINF 0x0004 /* Negative Infinity */
@@ -75,250 +64,679 @@ · 4 unmodified lines
75#define _FPCLASS_PD 0x0080 /* Positive Denormal */64#define _FPCLASS_PD 0x0080 /* Positive Denormal */
76#define _FPCLASS_PN 0x0100 /* Positive Normal */65#define _FPCLASS_PN 0x0100 /* Positive Normal */
77#define _FPCLASS_PINF 0x0200 /* Positive Infinity */66#define _FPCLASS_PINF 0x0200 /* Positive Infinity */
78#endif /* __MINGW_FPCLASS_DEFINED */67#endif
79#endif /* Not __STRICT_ANSI__ */68#endif
80
81#ifndef RC_INVOKED
82 69
83#ifdef __cplusplus70#ifdef __cplusplus
84extern "C" {71extern "C" {
85#endif72#endif
86 73
87/*74#ifndef _EXCEPTION_DEFINED
88 * HUGE_VAL is returned by strtod when the value would overflow the75#define _EXCEPTION_DEFINED
89 * representation of 'double'. There are other uses as well.76 struct _exception {
90 *77 int type;
91 * __imp__HUGE is a pointer to the actual variable _HUGE in78 char *name;
92 * MSVCRT.DLL. If we used _HUGE directly we would get a pointer79 double arg1;
93 * to a thunk function.80 double arg2;
94 *81 double retval;
95 * NOTE: The CRTDLL version uses _HUGE_dll instead.82 };
96 */83#endif
97
98#ifndef __DECLSPEC_SUPPORTED
99 84
100#ifdef __MSVCRT__85#ifndef _COMPLEX_DEFINED
101extern double* __imp__HUGE;86#define _COMPLEX_DEFINED
102#define HUGE_VAL (*__imp__HUGE)87 struct _complex {
103#else88 double x,y;
104/* CRTDLL */89 };
105extern double* __imp__HUGE_dll;
106#define HUGE_VAL (*__imp__HUGE_dll)
107#endif90#endif
108 91
109#else /* __DECLSPEC_SUPPORTED */92#define EDOM 33
93#define ERANGE 34
110 94
111#ifdef __MSVCRT__95#ifndef _HUGE
112__MINGW_IMPORT double _HUGE;96#ifdef _MSVCRT_
113#define HUGE_VAL _HUGE97 extern double *_HUGE;
114#else98#else
115/* CRTDLL */99 extern double *_imp___HUGE;
116__MINGW_IMPORT double _HUGE_dll;100#define _HUGE (*_imp___HUGE)
117#define HUGE_VAL _HUGE_dll101#endif
118#endif102#endif
119 103
120#endif /* __DECLSPEC_SUPPORTED */104#define HUGE_VAL _HUGE
121
122struct _exception
123{
124 int type;
125 char *name;
126 double arg1;
127 double arg2;
128 double retval;
129};
130
131
132double sin (double);
133double cos (double);
134double tan (double);
135double sinh (double);
136double cosh (double);
137double tanh (double);
138double asin (double);
139double acos (double);
140double atan (double);
141double atan2 (double, double);
142double exp (double);
143double log (double);
144double log10 (double);
145double pow (double, double);
146double sqrt (double);
147double ceil (double);
148double floor (double);
149double fabs (double);
150double ldexp (double, int);
151double frexp (double, int*);
152double modf (double, double*);
153double fmod (double, double);
154
155
156#ifndef __STRICT_ANSI__
157
158/* Complex number (for cabs) */
159struct _complex
160{
161 double x; /* Real part */
162 double y; /* Imaginary part */
163};
164
165double _cabs (struct _complex);
166double _hypot (double, double);
167double _j0 (double);
168double _j1 (double);
169double _jn (int, double);
170double _y0 (double);
171double _y1 (double);
172double _yn (int, double);
173int _matherr (struct _exception *);
174
175/* These are also declared in Mingw float.h; needed here as well to work
176 around GCC build issues. */
177/* BEGIN FLOAT.H COPY */
178/*
179 * IEEE recommended functions
180 */
181
182double _chgsign (double);
183double _copysign (double, double);
184double _logb (double);
185double _nextafter (double, double);
186double _scalb (double, long);
187
188int _finite (double);
189int _fpclass (double);
190int _isnan (double);
191
192/* END FLOAT.H COPY */
193
194#if !defined (_NO_OLDNAMES) \
195 || (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L )
196
197/*
198 * Non-underscored versions of non-ANSI functions. These reside in
199 * liboldnames.a. They are now also ISO C99 standand names.
200 * Provided for extra portability.
201 */
202 105
203double cabs (struct _complex);106#ifndef _CRT_ABS_DEFINED
204double hypot (double, double);107#define _CRT_ABS_DEFINED
205double j0 (double);108 int __cdecl abs(int _X);
206double j1 (double);109 long __cdecl labs(long _X);
207double jn (int, double);110#endif
208double y0 (double);111 double __cdecl acos(double _X);
209double y1 (double);112 double __cdecl asin(double _X);
210double yn (int, double);113 double __cdecl atan(double _X);
114 double __cdecl atan2(double _Y,double _X);
115#ifndef _SIGN_DEFINED
116#define _SIGN_DEFINED
117 _CRTIMP double __cdecl _copysign (double _Number,double _Sign);
118 _CRTIMP double __cdecl _chgsign (double _X);
119#endif
120 double __cdecl cos(double _X);
121 double __cdecl cosh(double _X);
122 double __cdecl exp(double _X);
123 double __cdecl expm1(double _X);
124 double __cdecl fabs(double _X);
125 double __cdecl fmod(double _X,double _Y);
126 double __cdecl log(double _X);
127 double __cdecl log10(double _X);
128 double __cdecl pow(double _X,double _Y);
129 double __cdecl sin(double _X);
130 double __cdecl sinh(double _X);
131 double __cdecl tan(double _X);
132 double __cdecl tanh(double _X);
133 double __cdecl sqrt(double _X);
134#ifndef _CRT_ATOF_DEFINED
135#define _CRT_ATOF_DEFINED
136 double __cdecl atof(const char *_String);
137 double __cdecl _atof_l(const char *_String,_locale_t _Locale);
138#endif
211 139
212#endif /* Not _NO_OLDNAMES */140 _CRTIMP double __cdecl _cabs(struct _complex _ComplexA);
141 double __cdecl ceil(double _X);
142 double __cdecl floor(double _X);
143 double __cdecl frexp(double _X,int *_Y);
144 double __cdecl _hypot(double _X,double _Y);
145 _CRTIMP double __cdecl _j0(double _X);
146 _CRTIMP double __cdecl _j1(double _X);
147 _CRTIMP double __cdecl _jn(int _X,double _Y);
148 double __cdecl ldexp(double _X,int _Y);
149#ifndef _CRT_MATHERR_DEFINED
150#define _CRT_MATHERR_DEFINED
151 int __cdecl _matherr(struct _exception *_Except);
152#endif
153 double __cdecl modf(double _X,double *_Y);
154 _CRTIMP double __cdecl _y0(double _X);
155 _CRTIMP double __cdecl _y1(double _X);
156 _CRTIMP double __cdecl _yn(int _X,double _Y);
157
158#if(defined(_X86_) && !defined(__x86_64))
159 _CRTIMP int __cdecl _set_SSE2_enable(int _Flag);
160 /* from libmingwex */
161 float __cdecl _hypotf(float _X,float _Y);
162#endif
213 163
214#endif /* Not __STRICT_ANSI__ */164 float frexpf(float _X,int *_Y);
165 float __cdecl ldexpf(float _X,int _Y);
166 long double __cdecl ldexpl(long double _X,int _Y);
167 float __cdecl acosf(float _X);
168 float __cdecl asinf(float _X);
169 float __cdecl atanf(float _X);
170 float __cdecl atan2f(float _X,float _Y);
171 float __cdecl cosf(float _X);
172 float __cdecl sinf(float _X);
173 float __cdecl tanf(float _X);
174 float __cdecl coshf(float _X);
175 float __cdecl sinhf(float _X);
176 float __cdecl tanhf(float _X);
177 float __cdecl expf(float _X);
178 float __cdecl expm1f(float _X);
179 float __cdecl logf(float _X);
180 float __cdecl log10f(float _X);
181 float __cdecl modff(float _X,float *_Y);
182 float __cdecl powf(float _X,float _Y);
183 float __cdecl sqrtf(float _X);
184 float __cdecl ceilf(float _X);
185 float __cdecl floorf(float _X);
186 float __cdecl fmodf(float _X,float _Y);
187 float __cdecl _hypotf(float _X,float _Y);
188 float __cdecl fabsf(float _X);
189#if !defined(__ia64__)
190 /* from libmingwex */
191 float __cdecl _copysignf (float _Number,float _Sign);
192 float __cdecl _chgsignf (float _X);
193 float __cdecl _logbf(float _X);
194 float __cdecl _nextafterf(float _X,float _Y);
195 int __cdecl _finitef(float _X);
196 int __cdecl _isnanf(float _X);
197 int __cdecl _fpclassf(float _X);
198#endif
215 199
216#ifdef __cplusplus200#ifndef __cplusplus
217}201 __CRT_INLINE long double __cdecl fabsl (long double x)
202 {
203 long double res;
204 __asm__ ("fabs;" : "=t" (res) : "0" (x));
205 return res;
206 }
207#define _hypotl(x,y) ((long double)_hypot((double)(x),(double)(y)))
208#define _matherrl _matherr
209 __CRT_INLINE long double _chgsignl(long double _Number) { return _chgsign((double)(_Number)); }
210 __CRT_INLINE long double _copysignl(long double _Number,long double _Sign) { return _copysign((double)(_Number),(double)(_Sign)); }
211 __CRT_INLINE float frexpf(float _X,int *_Y) { return ((float)frexp((double)_X,_Y)); }
212
213#if !defined (__ia64__)
214 __CRT_INLINE float __cdecl fabsf (float x)
215 {
216 float res;
217 __asm__ ("fabs;" : "=t" (res) : "0" (x));
218 return res;
219 }
220
221 __CRT_INLINE float __cdecl ldexpf (float x, int expn) { return (float) ldexp (x, expn); }
222#endif
223#else
224 // cplusplus
225 __CRT_INLINE long double __cdecl fabsl (long double x)
226 {
227 long double res;
228 __asm__ ("fabs;" : "=t" (res) : "0" (x));
229 return res;
230 }
231 __CRT_INLINE long double modfl(long double _X,long double *_Y) {
232 double _Di,_Df = modf((double)_X,&_Di);
233 *_Y = (long double)_Di;
234 return (_Df);
235 }
236 __CRT_INLINE long double _chgsignl(long double _Number) { return _chgsign(static_cast<double>(_Number)); }
237 __CRT_INLINE long double _copysignl(long double _Number,long double _Sign) { return _copysign(static_cast<double>(_Number),static_cast<double>(_Sign)); }
238 __CRT_INLINE float frexpf(float _X,int *_Y) { return ((float)frexp((double)_X,_Y)); }
239#ifndef __ia64__
240 __CRT_INLINE float __cdecl fabsf (float x)
241 {
242 float res;
243 __asm__ ("fabs;" : "=t" (res) : "0" (x));
244 return res;
245 }
246 __CRT_INLINE float __cdecl ldexpf (float x, int expn) { return (float) ldexp (x, expn); }
247#ifndef __x86_64
248 __CRT_INLINE float acosf(float _X) { return ((float)acos((double)_X)); }
249 __CRT_INLINE float asinf(float _X) { return ((float)asin((double)_X)); }
250 __CRT_INLINE float atanf(float _X) { return ((float)atan((double)_X)); }
251 __CRT_INLINE float atan2f(float _X,float _Y) { return ((float)atan2((double)_X,(double)_Y)); }
252 __CRT_INLINE float ceilf(float _X) { return ((float)ceil((double)_X)); }
253 __CRT_INLINE float cosf(float _X) { return ((float)cos((double)_X)); }
254 __CRT_INLINE float coshf(float _X) { return ((float)cosh((double)_X)); }
255 __CRT_INLINE float expf(float _X) { return ((float)exp((double)_X)); }
256 __CRT_INLINE float floorf(float _X) { return ((float)floor((double)_X)); }
257 __CRT_INLINE float fmodf(float _X,float _Y) { return ((float)fmod((double)_X,(double)_Y)); }
258 __CRT_INLINE float logf(float _X) { return ((float)log((double)_X)); }
259 __CRT_INLINE float log10f(float _X) { return ((float)log10((double)_X)); }
260 __CRT_INLINE float modff(float _X,float *_Y) {
261 double _Di,_Df = modf((double)_X,&_Di);
262 *_Y = (float)_Di;
263 return ((float)_Df);
264 }
265 __CRT_INLINE float powf(float _X,float _Y) { return ((float)pow((double)_X,(double)_Y)); }
266 __CRT_INLINE float sinf(float _X) { return ((float)sin((double)_X)); }
267 __CRT_INLINE float sinhf(float _X) { return ((float)sinh((double)_X)); }
268 __CRT_INLINE float sqrtf(float _X) { return ((float)sqrt((double)_X)); }
269 __CRT_INLINE float tanf(float _X) { return ((float)tan((double)_X)); }
270 __CRT_INLINE float tanhf(float _X) { return ((float)tanh((double)_X)); }
271#endif
272#endif
218#endif273#endif
219#endif /* Not RC_INVOKED */
220 274
275#ifndef NO_OLDNAMES
276#define matherr _matherr
277
278#define HUGE _HUGE
279 /* double __cdecl cabs(struct _complex _X); */
280 double __cdecl hypot(double _X,double _Y);
281 _CRTIMP double __cdecl j0(double _X);
282 _CRTIMP double __cdecl j1(double _X);
283 _CRTIMP double __cdecl jn(int _X,double _Y);
284 _CRTIMP double __cdecl y0(double _X);
285 _CRTIMP double __cdecl y1(double _X);
286 _CRTIMP double __cdecl yn(int _X,double _Y);
287#endif
221 288
222#ifndef __NO_ISOCEXT289#ifndef __NO_ISOCEXT
290#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \
291 || !defined __STRICT_ANSI__ || defined __GLIBCPP__
223 292
224#define INFINITY HUGE_VAL
225#define NAN (0.0F/0.0F)293#define NAN (0.0F/0.0F)
294#define HUGE_VALF (1.0F/0.0F)
295#define HUGE_VALL (1.0L/0.0L)
296#define INFINITY (1.0F/0.0F)
297
226 298
227/*
228 Return values for fpclassify.
229 These are based on Intel x87 fpu condition codes
230 in the high byte of status word and differ from
231 the return values for MS IEEE 754 extension _fpclass()
232*/
233#define FP_NAN 0x0100299#define FP_NAN 0x0100
234#define FP_NORMAL 0x0400300#define FP_NORMAL 0x0400
235#define FP_INFINITE (FP_NAN | FP_NORMAL)301#define FP_INFINITE (FP_NAN | FP_NORMAL)
236#define FP_ZERO 0x4000302#define FP_ZERO 0x4000
237#define FP_SUBNORMAL (FP_NORMAL | FP_ZERO)303#define FP_SUBNORMAL (FP_NORMAL | FP_ZERO)
238/* 0x0200 is signbit mask */304 /* 0x0200 is signbit mask */
239 305
240#ifndef RC_INVOKED
241#ifdef __cplusplus
242extern "C" {
243#endif
244 306
245double nan(const char *tagp);307 /*
246float nanf(const char *tagp);308 We can't __CRT_INLINE float or double, because we want to ensure truncation
309 to semantic type before classification.
310 (A normal long double value might become subnormal when
311 converted to double, and zero when converted to float.)
312 */
247 313
248#ifndef __STRICT_ANSI__314 extern int __cdecl __fpclassifyf (float);
249#define nan() nan("")315 extern int __cdecl __fpclassify (double);
250#define nanf() nanf("")
251#endif
252 316
317 __CRT_INLINE int __cdecl __fpclassifyl (long double x){
318 unsigned short sw;
319 __asm__ ("fxam; fstsw %%ax;" : "=a" (sw): "t" (x));
320 return sw & (FP_NAN | FP_NORMAL | FP_ZERO );
321 }
253 322
254/*323#define fpclassify(x) (sizeof (x) == sizeof (float) ? __fpclassifyf (x) \
255 We can't inline float, because we want to ensure truncation324 : sizeof (x) == sizeof (double) ? __fpclassify (x) \
256 to semantic type before classification. If we extend to long325 : __fpclassifyl (x))
257 double, we will also need to make double extern only.
258 (A normal long double value might become subnormal when
259 converted to double, and zero when converted to float.)
260*/
261extern __inline__ int __fpclassify (double x){
262 unsigned short sw;
263 __asm__ ("fxam; fstsw %%ax;" : "=a" (sw): "t" (x));
264 return sw & (FP_NAN | FP_NORMAL | FP_ZERO );
265}
266 326
267extern int __fpclassifyf (float);327 /* 7.12.3.2 */
328#define isfinite(x) ((fpclassify(x) & FP_NAN) == 0)
268 329
269#define fpclassify(x) ((sizeof(x) == sizeof(float)) ? __fpclassifyf(x) \330 /* 7.12.3.3 */
270 : __fpclassify(x))331#define isinf(x) (fpclassify(x) == FP_INFINITE)
271 332
272/* We don't need to worry about trucation here:333 /* 7.12.3.4 */
273 A NaN stays a NaN. */334 /* We don't need to worry about trucation here:
335 A NaN stays a NaN. */
336
337 __CRT_INLINE int __cdecl __isnan (double _x)
338 {
339 unsigned short sw;
340 __asm__ ("fxam;"
341 "fstsw %%ax": "=a" (sw) : "t" (_x));
342 return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL))
343 == FP_NAN;
344 }
345
346 __CRT_INLINE int __cdecl __isnanf (float _x)
347 {
348 unsigned short sw;
349 __asm__ ("fxam;"
350 "fstsw %%ax": "=a" (sw) : "t" (_x));
351 return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL))
352 == FP_NAN;
353 }
354
355 __CRT_INLINE int __cdecl __isnanl (long double _x)
356 {
357 unsigned short sw;
358 __asm__ ("fxam;"
359 "fstsw %%ax": "=a" (sw) : "t" (_x));
360 return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL))
361 == FP_NAN;
362 }
363
364
365#define isnan(x) (sizeof (x) == sizeof (float) ? __isnanf (x) \
366 : sizeof (x) == sizeof (double) ? __isnan (x) \
367 : __isnanl (x))
368
369 /* 7.12.3.5 */
370#define isnormal(x) (fpclassify(x) == FP_NORMAL)
274 371
275extern __inline__ int __isnan (double _x)372 /* 7.12.3.6 The signbit macro */
276{373 __CRT_INLINE int __cdecl __signbit (double x) {
277 unsigned short sw;374 unsigned short stw;
278 __asm__ ("fxam;"375 __asm__ ( "fxam; fstsw %%ax;": "=a" (stw) : "t" (x));
279 "fstsw %%ax": "=a" (sw) : "t" (_x));376 return stw & 0x0200;
280 return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL))377 }
281 == FP_NAN;378
282}379 __CRT_INLINE int __cdecl __signbitf (float x) {
380 unsigned short stw;
381 __asm__ ("fxam; fstsw %%ax;": "=a" (stw) : "t" (x));
382 return stw & 0x0200;
383 }
384
385 __CRT_INLINE int __cdecl __signbitl (long double x) {
386 unsigned short stw;
387 __asm__ ("fxam; fstsw %%ax;": "=a" (stw) : "t" (x));
388 return stw & 0x0200;
389 }
390
391#define signbit(x) (sizeof (x) == sizeof (float) ? __signbitf (x) \
392 : sizeof (x) == sizeof (double) ? __signbit (x) \
393 : __signbitl (x))
394
395 extern double __cdecl exp2(double);
396 extern float __cdecl exp2f(float);
397 extern long double __cdecl exp2l(long double);
398
399#define FP_ILOGB0 ((int)0x80000000)
400#define FP_ILOGBNAN ((int)0x80000000)
401 extern int __cdecl ilogb (double);
402 extern int __cdecl ilogbf (float);
403 extern int __cdecl ilogbl (long double);
404
405 extern double __cdecl log1p(double);
406 extern float __cdecl log1pf(float);
407 extern long double __cdecl log1pl(long double);
408
409 extern double __cdecl log2 (double);
410 extern float __cdecl log2f (float);
411 extern long double __cdecl log2l (long double);
412
413 extern double __cdecl logb (double);
414 extern float __cdecl logbf (float);
415 extern long double __cdecl logbl (long double);
416
417 __CRT_INLINE double __cdecl logb (double x)
418 {
419 double res;
420 __asm__ ("fxtract\n\t"
421 "fstp %%st" : "=t" (res) : "0" (x));
422 return res;
423 }
424
425 __CRT_INLINE float __cdecl logbf (float x)
426 {
427 float res;
428 __asm__ ("fxtract\n\t"
429 "fstp %%st" : "=t" (res) : "0" (x));
430 return res;
431 }
432
433 __CRT_INLINE long double __cdecl logbl (long double x)
434 {
435 long double res;
436 __asm__ ("fxtract\n\t"
437 "fstp %%st" : "=t" (res) : "0" (x));
438 return res;
439 }
440
441 extern long double __cdecl modfl (long double, long double*);
442
443 /* 7.12.6.13 */
444 extern double __cdecl scalbn (double, int);
445 extern float __cdecl scalbnf (float, int);
446 extern long double __cdecl scalbnl (long double, int);
447
448 extern double __cdecl scalbln (double, long);
449 extern float __cdecl scalblnf (float, long);
450 extern long double __cdecl scalblnl (long double, long);
451
452 /* 7.12.7.1 */
453 /* Implementations adapted from Cephes versions */
454 extern double __cdecl cbrt (double);
455 extern float __cdecl cbrtf (float);
456 extern long double __cdecl cbrtl (long double);
457
458 __CRT_INLINE float __cdecl hypotf (float x, float y)
459 { return (float) hypot (x, y);}
460 extern long double __cdecl hypotl (long double, long double);
461
462 extern long double __cdecl powl (long double, long double);
463 extern long double __cdecl expl(long double);
464 extern long double __cdecl expm1l(long double);
465 extern long double __cdecl coshl(long double);
466 extern long double __cdecl fabsl (long double);
467 extern long double __cdecl acosl(long double);
468 extern long double __cdecl asinl(long double);
469 extern long double __cdecl atanl(long double);
470 extern long double __cdecl atan2l(long double,long double);
471 extern long double __cdecl sinhl(long double);
472 extern long double __cdecl tanhl(long double);
473
474 /* 7.12.8.1 The erf functions */
475 extern double __cdecl erf (double);
476 extern float __cdecl erff (float);
477 /* TODO
478 extern long double __cdecl erfl (long double);
479 */
480
481 /* 7.12.8.2 The erfc functions */
482 extern double __cdecl erfc (double);
483 extern float __cdecl erfcf (float);
484 /* TODO
485 extern long double __cdecl erfcl (long double);
486 */
487
488 /* 7.12.8.3 The lgamma functions */
489 extern double __cdecl lgamma (double);
490 extern float __cdecl lgammaf (float);
491 extern long double __cdecl lgammal (long double);
492
493 /* 7.12.8.4 The tgamma functions */
494 extern double __cdecl tgamma (double);
495 extern float __cdecl tgammaf (float);
496 extern long double __cdecl tgammal (long double);
497
498 extern long double __cdecl ceill (long double);
499 extern long double __cdecl floorl (long double);
500 extern long double __cdecl frexpl(long double,int *);
501 extern long double __cdecl log10l(long double);
502 extern long double __cdecl logl(long double);
503 extern long double __cdecl cosl(long double);
504 extern long double __cdecl sinl(long double);
505 extern long double __cdecl tanl(long double);
506 extern long double sqrtl(long double);
507
508 /* 7.12.9.3 */
509 extern double __cdecl nearbyint ( double);
510 extern float __cdecl nearbyintf (float);
511 extern long double __cdecl nearbyintl (long double);
512
513 /* 7.12.9.4 */
514 /* round, using fpu control word settings */
515 __CRT_INLINE double __cdecl rint (double x)
516 {
517 double retval;
518 __asm__ ("frndint;": "=t" (retval) : "0" (x));
519 return retval;
520 }
521
522 __CRT_INLINE float __cdecl rintf (float x)
523 {
524 float retval;
525 __asm__ ("frndint;" : "=t" (retval) : "0" (x) );
526 return retval;
527 }
528
529 __CRT_INLINE long double __cdecl rintl (long double x)
530 {
531 long double retval;
532 __asm__ ("frndint;" : "=t" (retval) : "0" (x) );
533 return retval;
534 }
535
536 /* 7.12.9.5 */
537 __CRT_INLINE long __cdecl lrint (double x)
538 {
539 long retval;
540 __asm__ __volatile__ \
541 ("fistpl %0" : "=m" (retval) : "t" (x) : "st"); \
542 return retval;
543 }
544
545 __CRT_INLINE long __cdecl lrintf (float x)
546 {
547 long retval;
548 __asm__ __volatile__ \
549 ("fistpl %0" : "=m" (retval) : "t" (x) : "st"); \
550 return retval;
551 }
552
553 __CRT_INLINE long __cdecl lrintl (long double x)
554 {
555 long retval;
556 __asm__ __volatile__ \
557 ("fistpl %0" : "=m" (retval) : "t" (x) : "st"); \
558 return retval;
559 }
560
561 __CRT_INLINE long long __cdecl llrint (double x)
562 {
563 long long retval;
564 __asm__ __volatile__ \
565 ("fistpll %0" : "=m" (retval) : "t" (x) : "st"); \
566 return retval;
567 }
568
569 __CRT_INLINE long long __cdecl llrintf (float x)
570 {
571 long long retval;
572 __asm__ __volatile__ \
573 ("fistpll %0" : "=m" (retval) : "t" (x) : "st"); \
574 return retval;
575 }
576
577 __CRT_INLINE long long __cdecl llrintl (long double x)
578 {
579 long long retval;
580 __asm__ __volatile__ \
581 ("fistpll %0" : "=m" (retval) : "t" (x) : "st"); \
582 return retval;
583 }
584
585 /* 7.12.9.6 */
586 /* round away from zero, regardless of fpu control word settings */
587 extern double __cdecl round (double);
588 extern float __cdecl roundf (float);
589 extern long double __cdecl roundl (long double);
590
591 /* 7.12.9.7 */
592 extern long __cdecl lround (double);
593 extern long __cdecl lroundf (float);
594 extern long __cdecl lroundl (long double);
595
596 extern long long __cdecl llround (double);
597 extern long long __cdecl llroundf (float);
598 extern long long __cdecl llroundl (long double);
599
600 /* 7.12.9.8 */
601 /* round towards zero, regardless of fpu control word settings */
602 extern double __cdecl trunc (double);
603 extern float __cdecl truncf (float);
604 extern long double __cdecl truncl (long double);
605
606 extern long double __cdecl fmodl (long double, long double);
607
608 /* 7.12.10.2 */
609 extern double __cdecl remainder (double, double);
610 extern float __cdecl remainderf (float, float);
611 extern long double __cdecl remainderl (long double, long double);
612
613 /* 7.12.10.3 */
614 extern double __cdecl remquo(double, double, int *);
615 extern float __cdecl remquof(float, float, int *);
616 extern long double __cdecl remquol(long double, long double, int *);
617
618 /* 7.12.11.1 */
619 extern double __cdecl copysign (double, double); /* in libmoldname.a */
620 extern float __cdecl copysignf (float, float);
621 extern long double __cdecl copysignl (long double, long double);
622
623 /* 7.12.11.2 Return a NaN */
624 extern double __cdecl nan(const char *tagp);
625 extern float __cdecl nanf(const char *tagp);
626 extern long double __cdecl nanl(const char *tagp);
283 627
284extern __inline__ int __isnanf (float _x)628#ifndef __STRICT_ANSI__
285{629#define _nan() nan("")
286 unsigned short sw;630#define _nanf() nanf("")
287 __asm__ ("fxam;"631#define _nanl() nanl("")
288 "fstsw %%ax": "=a" (sw) : "t" (_x));632#endif
289 return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL))
290 == FP_NAN;
291}
292 633
293#define isnan(x) ((sizeof(x) == sizeof(float)) ? __isnanf(x) \634 /* 7.12.11.3 */
294 : __isnan(x))635 extern double __cdecl nextafter (double, double); /* in libmoldname.a */
636 extern float __cdecl nextafterf (float, float);
637 extern long double __cdecl nextafterl (long double, long double);
638
639 /* 7.12.11.4 The nexttoward functions: TODO */
640
641 /* 7.12.12.1 */
642 /* x > y ? (x - y) : 0.0 */
643 extern double __cdecl fdim (double x, double y);
644 extern float __cdecl fdimf (float x, float y);
645 extern long double __cdecl fdiml (long double x, long double y);
646
647 /* fmax and fmin.
648 NaN arguments are treated as missing data: if one argument is a NaN
649 and the other numeric, then these functions choose the numeric
650 value. */
651
652 /* 7.12.12.2 */
653 extern double __cdecl fmax (double, double);
654 extern float __cdecl fmaxf (float, float);
655 extern long double __cdecl fmaxl (long double, long double);
656
657 /* 7.12.12.3 */
658 extern double __cdecl fmin (double, double);
659 extern float __cdecl fminf (float, float);
660 extern long double __cdecl fminl (long double, long double);
661
662 /* 7.12.13.1 */
663 /* return x * y + z as a ternary op */
664 extern double __cdecl fma (double, double, double);
665 extern float __cdecl fmaf (float, float, float);
666 extern long double __cdecl fmal (long double, long double, long double);
667
668
669 /* 7.12.14 */
670 /*
671 * With these functions, comparisons involving quiet NaNs set the FP
672 * condition code to "unordered". The IEEE floating-point spec
673 * dictates that the result of floating-point comparisons should be
674 * false whenever a NaN is involved, with the exception of the != op,
675 * which always returns true: yes, (NaN != NaN) is true).
676 */
295 677
678#if __GNUC__ >= 3
296 679
297#define isfinite(x) ((fpclassify(x) & FP_NAN) == 0)680#define isgreater(x, y) __builtin_isgreater(x, y)
298#define isinf(x) (fpclassify(x) == FP_INFINITE)681#define isgreaterequal(x, y) __builtin_isgreaterequal(x, y)
299#define isnormal(x) (fpclassify(x) == FP_NORMAL)682#define isless(x, y) __builtin_isless(x, y)
683#define islessequal(x, y) __builtin_islessequal(x, y)
684#define islessgreater(x, y) __builtin_islessgreater(x, y)
685#define isunordered(x, y) __builtin_isunordered(x, y)
300 686
687#else
688 /* helper */
689 __CRT_INLINE int __cdecl
690 __fp_unordered_compare (long double x, long double y){
691 unsigned short retval;
692 __asm__ ("fucom %%st(1);"
693 "fnstsw;": "=a" (retval) : "t" (x), "u" (y));
694 return retval;
695 }
301 696
302extern __inline__ int __signbit (double x) {697#define isgreater(x, y) ((__fp_unordered_compare(x, y) \
303 unsigned short stw;698 & 0x4500) == 0)
304 __asm__ ( "fxam; fstsw %%ax;": "=a" (stw) : "t" (x));699#define isless(x, y) ((__fp_unordered_compare (y, x) \
305 return stw & 0x0200;700 & 0x4500) == 0)
306}701#define isgreaterequal(x, y) ((__fp_unordered_compare (x, y) \
702 & FP_INFINITE) == 0)
703#define islessequal(x, y) ((__fp_unordered_compare(y, x) \
704 & FP_INFINITE) == 0)
705#define islessgreater(x, y) ((__fp_unordered_compare(x, y) \
706 & FP_SUBNORMAL) == 0)
707#define isunordered(x, y) ((__fp_unordered_compare(x, y) \
708 & 0x4500) == 0x4500)
307 709
308extern __inline__ int __signbitf (float x) {710#endif
309 unsigned short stw;711
310 __asm__ ("fxam; fstsw %%ax;": "=a" (stw) : "t" (x));712
311 return stw & 0x0200;713#endif /* __STDC_VERSION__ >= 199901L */
714#endif /* __NO_ISOCEXT */
715
716#ifdef __cplusplus
717}
718extern "C++" {
719 template<class _Ty> inline _Ty _Pow_int(_Ty _X,int _Y) {
720 unsigned int _N;
721 if(_Y >= 0) _N = (unsigned int)_Y;
722 else _N = (unsigned int)(-_Y);
723 for(_Ty _Z = _Ty(1);;_X *= _X) {
724 if((_N & 1)!=0) _Z *= _X;
725 if((_N >>= 1)==0) return (_Y < 0 ? _Ty(1) / _Z : _Z);
726 }
727 }
312}728}
729#endif
730
731#pragma pack(pop)
313 732
314#define signbit(x) ((sizeof(x) == sizeof(float)) ? __signbitf(x) \733/* 7.12.14 */
315 : __signbit(x))
316/* 734/*
317 * With these functions, comparisons involving quiet NaNs set the FP735 * With these functions, comparisons involving quiet NaNs set the FP
318 * condition code to "unordered". The IEEE floating-point spec736 * condition code to "unordered". The IEEE floating-point spec
319 * dictates that the result of floating-point comparisons should be737 * dictates that the result of floating-point comparisons should be
320 * false whenever a NaN is involved, with the exception of the !=, 738 * false whenever a NaN is involved, with the exception of the != op,
321 * which always returns true.739 * which always returns true: yes, (NaN != NaN) is true).
322 */740 */
323 741
324#if __GNUC__ >= 3742#if __GNUC__ >= 3
@@ -332,7 +750,8 @@ extern __inline__ int __signbitf (float x) { · 7 unmodified lines
332 750
333#else751#else
334/* helper */752/* helper */
335extern __inline__ int __fp_unordered_compare (double x, double y){753__CRT_INLINE int __cdecl
754__fp_unordered_compare (long double x, long double y){
336 unsigned short retval;755 unsigned short retval;
337 __asm__ ("fucom %%st(1);"756 __asm__ ("fucom %%st(1);"
338 "fnstsw;": "=a" (retval) : "t" (x), "u" (y));757 "fnstsw;": "=a" (retval) : "t" (x), "u" (y));
@@ -354,85 +773,5 @@ extern __inline__ int __fp_unordered_compare (double x, double y){ · 15 unmodified lines
354 773
355#endif774#endif
356 775
357/* round, using fpu control word settings */776#endif /* End _MATH_H_ */
358extern __inline__ double rint (double x)
359{
360 double retval;
361 __asm__ ("frndint;": "=t" (retval) : "0" (x));
362 return retval;
363}
364
365extern __inline__ float rintf (float x)
366{
367 float retval;
368 __asm__ ("frndint;" : "=t" (retval) : "0" (x) );
369 return retval;
370}
371
372/* round away from zero, regardless of fpu control word settings */
373extern double round (double);
374extern float roundf (float);
375
376/* round towards zero, regardless of fpu control word settings */
377extern double trunc (double);
378extern float truncf (float);
379
380
381/* fmax and fmin.
382 NaN arguments are treated as missing data: if one argument is a NaN and the other numeric, then the
383 these functions choose the numeric value.
384*/
385
386extern double fmax (double, double);
387extern double fmin (double, double);
388extern float fmaxf (float, float);
389float fminf (float, float);
390
391/* return x * y + z as a ternary op */
392extern double fma (double, double, double);
393extern float fmaf (float, float, float);
394
395/* one lonely transcendental */
396extern double log2 (double _x);
397extern float log2f (float _x);
398
399/* The underscored versions are in MSVCRT.dll.
400 The stubs for these are in libmingwex.a */
401
402double copysign (double, double);
403float copysignf (float, float);
404double logb (double);
405float logbf (float);
406double nextafter (double, double);
407float nextafterf (float, float);
408double scalb (double, long);
409float scalbf (float, long);
410
411#if !defined (__STRICT_ANSI__) /* inline using non-ANSI functions */
412extern __inline__ double copysign (double x, double y)
413 { return _copysign(x, y); }
414extern __inline__ float copysignf (float x, float y)
415 { return _copysign(x, y); }
416extern __inline__ double logb (double x)
417 { return _logb(x); }
418extern __inline__ float logbf (float x)
419 { return _logb(x); }
420extern __inline__ double nextafter(double x, double y)
421 { return _nextafter(x, y); }
422extern __inline__ float nextafterf(float x, float y)
423 { return _nextafter(x, y); }
424extern __inline__ double scalb (double x, long i)
425 { return _scalb (x, i); }
426extern __inline__ float scalbf (float x, long i)
427 { return _scalb(x, i); }
428#endif /* (__STRICT_ANSI__) */
429
430#ifdef __cplusplus
431}
432#endif
433#endif /* Not RC_INVOKED */
434
435#endif /* __NO_ISOCEXT */
436
437#endif /* Not _MATH_H_ */
438 777
win32/include/mem.h+5−0
@@ -1,3 +1,8 @@
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 */
1/*6/*
2 * This file is part of the Mingw32 package.7 * This file is part of the Mingw32 package.
3 *8 *
win32/include/memory.h+37−6
@@ -1,9 +1,40 @@
1/*1/**
2 * This file is part of the Mingw32 package.2 * This file has no copyright assigned and is placed in the Public Domain.
3 *3 * This file is part of the w64 mingw-runtime package.
4 * memory.h maps to the standard string.h header.4 * No warranty is given; refer to the file DISCLAIMER within this package.
5 */5 */
6#ifndef __STRICT_ANSI__6#ifndef _INC_MEMORY
7#include <string.h>7#define _INC_MEMORY
8
9#include <_mingw.h>
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15#ifndef _CONST_RETURN
16#define _CONST_RETURN
8#endif17#endif
9 18
19#define _WConst_return _CONST_RETURN
20
21#ifndef _CRT_MEMORY_DEFINED
22#define _CRT_MEMORY_DEFINED
23 _CRTIMP void *__cdecl _memccpy(void *_Dst,const void *_Src,int _Val,size_t _MaxCount);
24 _CONST_RETURN void *__cdecl memchr(const void *_Buf ,int _Val,size_t _MaxCount);
25 _CRTIMP int __cdecl _memicmp(const void *_Buf1,const void *_Buf2,size_t _Size);
26 _CRTIMP int __cdecl _memicmp_l(const void *_Buf1,const void *_Buf2,size_t _Size,_locale_t _Locale);
27 int __cdecl memcmp(const void *_Buf1,const void *_Buf2,size_t _Size);
28 void *__cdecl memcpy(void *_Dst,const void *_Src,size_t _Size);
29 void *__cdecl memset(void *_Dst,int _Val,size_t _Size);
30
31#ifndef NO_OLDNAMES
32 void *__cdecl memccpy(void *_Dst,const void *_Src,int _Val,size_t _Size);
33 int __cdecl memicmp(const void *_Buf1,const void *_Buf2,size_t _Size);
34#endif
35#endif
36
37#ifdef __cplusplus
38}
39#endif
40#endif
win32/include/process.h+159−141
@@ -1,158 +1,176 @@
1/* 1/**
2 * process.h2 * This file has no copyright assigned and is placed in the Public Domain.
3 *3 * This file is part of the w64 mingw-runtime package.
4 * Function calls for spawning child processes.4 * No warranty is given; refer to the file DISCLAIMER within this package.
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 */5 */
6#ifndef _INC_PROCESS
7#define _INC_PROCESS
26 8
27#ifndef __STRICT_ANSI__
28
29#ifndef _PROCESS_H_
30#define _PROCESS_H_
31
32/* All the headers include this file. */
33#include <_mingw.h>9#include <_mingw.h>
34 10
35/* Includes a definition of _pid_t and pid_t */11/* Includes a definition of _pid_t and pid_t */
36#include <sys/types.h>12#include <sys/types.h>
37 13
38/*14#ifndef _POSIX_
39 * Constants for cwait actions.15#ifdef __cplusplus
40 * Obsolete for Win32.
41 */
42#define _WAIT_CHILD 0
43#define _WAIT_GRANDCHILD 1
44
45#ifndef _NO_OLDNAMES
46#define WAIT_CHILD _WAIT_CHILD
47#define WAIT_GRANDCHILD _WAIT_GRANDCHILD
48#endif /* Not _NO_OLDNAMES */
49
50/*
51 * Mode constants for spawn functions.
52 */
53#define _P_WAIT 0
54#define _P_NOWAIT 1
55#define _P_OVERLAY 2
56#define _OLD_P_OVERLAY _P_OVERLAY
57#define _P_NOWAITO 3
58#define _P_DETACH 4
59
60#ifndef _NO_OLDNAMES
61#define P_WAIT _P_WAIT
62#define P_NOWAIT _P_NOWAIT
63#define P_OVERLAY _P_OVERLAY
64#define OLD_P_OVERLAY _OLD_P_OVERLAY
65#define P_NOWAITO _P_NOWAITO
66#define P_DETACH _P_DETACH
67#endif /* Not _NO_OLDNAMES */
68
69
70#ifndef RC_INVOKED
71
72#ifdef __cplusplus
73extern "C" {16extern "C" {
74#endif17#endif
75 18
76void _cexit(void);19#define _P_WAIT 0
77void _c_exit(void);20#define _P_NOWAIT 1
78 21#define _OLD_P_OVERLAY 2
79int _cwait (int*, _pid_t, int);22#define _P_NOWAITO 3
80 23#define _P_DETACH 4
81_pid_t _getpid(void);24#define _P_OVERLAY 2
82
83int _execl (const char*, const char*, ...);
84int _execle (const char*, const char*, ...);
85int _execlp (const char*, const char*, ...);
86int _execlpe (const char*, const char*, ...);
87int _execv (const char*, char* const*);
88int _execve (const char*, char* const*, char* const*);
89int _execvp (const char*, char* const*);
90int _execvpe (const char*, char* const*, char* const*);
91
92int _spawnl (int, const char*, const char*, ...);
93int _spawnle (int, const char*, const char*, ...);
94int _spawnlp (int, const char*, const char*, ...);
95int _spawnlpe (int, const char*, const char*, ...);
96int _spawnv (int, const char*, char* const*);
97int _spawnve (int, const char*, char* const*, char* const*);
98int _spawnvp (int, const char*, char* const*);
99int _spawnvpe (int, const char*, char* const*, char* const*);
100
101/*
102 * The functions _beginthreadex and _endthreadex are not provided by CRTDLL.
103 * They are provided by MSVCRT.
104 *
105 * NOTE: Apparently _endthread calls CloseHandle on the handle of the thread,
106 * making for race conditions if you are not careful. Basically you have to
107 * make sure that no-one is going to do *anything* with the thread handle
108 * after the thread calls _endthread or returns from the thread function.
109 *
110 * NOTE: No old names for these functions. Use the underscore.
111 */
112unsigned long
113 _beginthread (void (*)(void *), unsigned, void*);
114void _endthread (void);
115
116#ifdef __MSVCRT__
117unsigned long
118 _beginthreadex (void *, unsigned, unsigned (__stdcall *) (void *),
119 void*, unsigned, unsigned*);
120void _endthreadex (unsigned);
121#endif
122 25
26#define _WAIT_CHILD 0
27#define _WAIT_GRANDCHILD 1
28
29 _CRTIMP uintptr_t __cdecl _beginthread(void (__cdecl *_StartAddress) (void *),unsigned _StackSize,void *_ArgList);
30 _CRTIMP void __cdecl _endthread(void);
31 _CRTIMP uintptr_t __cdecl _beginthreadex(void *_Security,unsigned _StackSize,unsigned (__stdcall *_StartAddress) (void *),void *_ArgList,unsigned _InitFlag,unsigned *_ThrdAddr);
32 _CRTIMP void __cdecl _endthreadex(unsigned _Retval);
33
34#ifndef _CRT_TERMINATE_DEFINED
35#define _CRT_TERMINATE_DEFINED
36 void __cdecl __MINGW_NOTHROW exit(int _Code) __MINGW_ATTRIB_NORETURN;
37 _CRTIMP void __cdecl __MINGW_NOTHROW _exit(int _Code) __MINGW_ATTRIB_NORETURN;
38
39#pragma push_macro("abort")
40#undef abort
41 void __cdecl __declspec(noreturn) abort(void);
42#pragma pop_macro("abort")
123 43
124#ifndef _NO_OLDNAMES
125/*
126 * Functions without the leading underscore, for portability. These functions
127 * live in liboldnames.a.
128 */
129int cwait (int*, pid_t, int);
130pid_t getpid (void);
131int execl (const char*, const char*, ...);
132int execle (const char*, const char*, ...);
133int execlp (const char*, const char*, ...);
134int execlpe (const char*, const char*, ...);
135int execv (const char*, char* const*);
136int execve (const char*, char* const*, char* const*);
137int execvp (const char*, char* const*);
138int execvpe (const char*, char* const*, char* const*);
139int spawnl (int, const char*, const char*, ...);
140int spawnle (int, const char*, const char*, ...);
141int spawnlp (int, const char*, const char*, ...);
142int spawnlpe (int, const char*, const char*, ...);
143int spawnv (int, const char*, char* const*);
144int spawnve (int, const char*, char* const*, char* const*);
145int spawnvp (int, const char*, char* const*);
146int spawnvpe (int, const char*, char* const*, char* const*);
147#endif /* Not _NO_OLDNAMES */
148
149#ifdef __cplusplus
150}
151#endif44#endif
152 45
153#endif /* Not RC_INVOKED */46 _CRTIMP void __cdecl __MINGW_NOTHROW _cexit(void);
47 _CRTIMP void __cdecl __MINGW_NOTHROW _c_exit(void);
48 _CRTIMP int __cdecl _getpid(void);
49 _CRTIMP intptr_t __cdecl _cwait(int *_TermStat,intptr_t _ProcHandle,int _Action);
50 _CRTIMP intptr_t __cdecl _execl(const char *_Filename,const char *_ArgList,...);
51 _CRTIMP intptr_t __cdecl _execle(const char *_Filename,const char *_ArgList,...);
52 _CRTIMP intptr_t __cdecl _execlp(const char *_Filename,const char *_ArgList,...);
53 _CRTIMP intptr_t __cdecl _execlpe(const char *_Filename,const char *_ArgList,...);
54 _CRTIMP intptr_t __cdecl _execv(const char *_Filename,const char *const *_ArgList);
55 _CRTIMP intptr_t __cdecl _execve(const char *_Filename,const char *const *_ArgList,const char *const *_Env);
56 _CRTIMP intptr_t __cdecl _execvp(const char *_Filename,const char *const *_ArgList);
57 _CRTIMP intptr_t __cdecl _execvpe(const char *_Filename,const char *const *_ArgList,const char *const *_Env);
58 _CRTIMP intptr_t __cdecl _spawnl(int _Mode,const char *_Filename,const char *_ArgList,...);
59 _CRTIMP intptr_t __cdecl _spawnle(int _Mode,const char *_Filename,const char *_ArgList,...);
60 _CRTIMP intptr_t __cdecl _spawnlp(int _Mode,const char *_Filename,const char *_ArgList,...);
61 _CRTIMP intptr_t __cdecl _spawnlpe(int _Mode,const char *_Filename,const char *_ArgList,...);
62 _CRTIMP intptr_t __cdecl _spawnv(int _Mode,const char *_Filename,const char *const *_ArgList);
63 _CRTIMP intptr_t __cdecl _spawnve(int _Mode,const char *_Filename,const char *const *_ArgList,const char *const *_Env);
64 _CRTIMP intptr_t __cdecl _spawnvp(int _Mode,const char *_Filename,const char *const *_ArgList);
65 _CRTIMP intptr_t __cdecl _spawnvpe(int _Mode,const char *_Filename,const char *const *_ArgList,const char *const *_Env);
66
67#ifndef _CRT_SYSTEM_DEFINED
68#define _CRT_SYSTEM_DEFINED
69 int __cdecl system(const char *_Command);
70#endif
154 71
155#endif /* _PROCESS_H_ not defined */72#ifndef _WPROCESS_DEFINED
73#define _WPROCESS_DEFINED
74 _CRTIMP intptr_t __cdecl _wexecl(const wchar_t *_Filename,const wchar_t *_ArgList,...);
75 _CRTIMP intptr_t __cdecl _wexecle(const wchar_t *_Filename,const wchar_t *_ArgList,...);
76 _CRTIMP intptr_t __cdecl _wexeclp(const wchar_t *_Filename,const wchar_t *_ArgList,...);
77 _CRTIMP intptr_t __cdecl _wexeclpe(const wchar_t *_Filename,const wchar_t *_ArgList,...);
78 _CRTIMP intptr_t __cdecl _wexecv(const wchar_t *_Filename,const wchar_t *const *_ArgList);
79 _CRTIMP intptr_t __cdecl _wexecve(const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env);
80 _CRTIMP intptr_t __cdecl _wexecvp(const wchar_t *_Filename,const wchar_t *const *_ArgList);
81 _CRTIMP intptr_t __cdecl _wexecvpe(const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env);
82 _CRTIMP intptr_t __cdecl _wspawnl(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...);
83 _CRTIMP intptr_t __cdecl _wspawnle(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...);
84 _CRTIMP intptr_t __cdecl _wspawnlp(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...);
85 _CRTIMP intptr_t __cdecl _wspawnlpe(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...);
86 _CRTIMP intptr_t __cdecl _wspawnv(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList);
87 _CRTIMP intptr_t __cdecl _wspawnve(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env);
88 _CRTIMP intptr_t __cdecl _wspawnvp(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList);
89 _CRTIMP intptr_t __cdecl _wspawnvpe(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env);
90#ifndef _CRT_WSYSTEM_DEFINED
91#define _CRT_WSYSTEM_DEFINED
92 _CRTIMP int __cdecl _wsystem(const wchar_t *_Command);
93#endif
94#endif
156 95
157#endif /* Not __STRICT_ANSI__ */96 void __cdecl __security_init_cookie(void);
97#if (defined(_X86_) && !defined(__x86_64))
98 void __fastcall __security_check_cookie(uintptr_t _StackCookie);
99 __declspec(noreturn) void __cdecl __report_gsfailure(void);
100#else
101 void __cdecl __security_check_cookie(uintptr_t _StackCookie);
102 __declspec(noreturn) void __cdecl __report_gsfailure(uintptr_t _StackCookie);
103#endif
104 extern uintptr_t __security_cookie;
105
106 intptr_t __cdecl _loaddll(char *_Filename);
107 int __cdecl _unloaddll(intptr_t _Handle);
108 int (__cdecl *__cdecl _getdllprocaddr(intptr_t _Handle,char *_ProcedureName,intptr_t _Ordinal))(void);
109
110#ifdef _DECL_DLLMAIN
111#ifdef _WINDOWS_
112 WINBOOL WINAPI DllMain(HANDLE _HDllHandle,DWORD _Reason,LPVOID _Reserved);
113 WINBOOL WINAPI _CRT_INIT(HANDLE _HDllHandle,DWORD _Reason,LPVOID _Reserved);
114 WINBOOL WINAPI _wCRT_INIT(HANDLE _HDllHandle,DWORD _Reason,LPVOID _Reserved);
115 extern WINBOOL (WINAPI *const _pRawDllMain)(HANDLE,DWORD,LPVOID);
116#else
117 int __stdcall DllMain(void *_HDllHandle,unsigned _Reason,void *_Reserved);
118 int __stdcall _CRT_INIT(void *_HDllHandle,unsigned _Reason,void *_Reserved);
119 int __stdcall _wCRT_INIT(void *_HDllHandle,unsigned _Reason,void *_Reserved);
120 extern int (__stdcall *const _pRawDllMain)(void *,unsigned,void *);
121#endif
122#endif
158 123
124#ifndef NO_OLDNAMES
125#define P_WAIT _P_WAIT
126#define P_NOWAIT _P_NOWAIT
127#define P_OVERLAY _P_OVERLAY
128#define OLD_P_OVERLAY _OLD_P_OVERLAY
129#define P_NOWAITO _P_NOWAITO
130#define P_DETACH _P_DETACH
131#define WAIT_CHILD _WAIT_CHILD
132#define WAIT_GRANDCHILD _WAIT_GRANDCHILD
133
134 intptr_t __cdecl cwait(int *_TermStat,intptr_t _ProcHandle,int _Action);
135#ifdef __GNUC__
136 int __cdecl execl(const char *_Filename,const char *_ArgList,...);
137 int __cdecl execle(const char *_Filename,const char *_ArgList,...);
138 int __cdecl execlp(const char *_Filename,const char *_ArgList,...);
139 int __cdecl execlpe(const char *_Filename,const char *_ArgList,...);
140#else
141 intptr_t __cdecl execl(const char *_Filename,const char *_ArgList,...);
142 intptr_t __cdecl execle(const char *_Filename,const char *_ArgList,...);
143 intptr_t __cdecl execlp(const char *_Filename,const char *_ArgList,...);
144 intptr_t __cdecl execlpe(const char *_Filename,const char *_ArgList,...);
145#endif
146 intptr_t __cdecl spawnl(int,const char *_Filename,const char *_ArgList,...);
147 intptr_t __cdecl spawnle(int,const char *_Filename,const char *_ArgList,...);
148 intptr_t __cdecl spawnlp(int,const char *_Filename,const char *_ArgList,...);
149 intptr_t __cdecl spawnlpe(int,const char *_Filename,const char *_ArgList,...);
150 int __cdecl getpid(void);
151#ifdef __GNUC__
152 /* Those methods are predefined by gcc builtins to return int. So to prevent
153 stupid warnings, define them in POSIX way. This is save, because those
154 methods do not return in success case, so that the return value is not
155 really dependent to its scalar width. */
156 int __cdecl execv(const char *_Filename,char *const _ArgList[]);
157 int __cdecl execve(const char *_Filename,char *const _ArgList[],char *const _Env[]);
158 int __cdecl execvp(const char *_Filename,char *const _ArgList[]);
159 int __cdecl execvpe(const char *_Filename,char *const _ArgList[],char *const _Env[]);
160#else
161 intptr_t __cdecl execv(const char *_Filename,char *const _ArgList[]);
162 intptr_t __cdecl execve(const char *_Filename,char *const _ArgList[],char *const _Env[]);
163 intptr_t __cdecl execvp(const char *_Filename,char *const _ArgList[]);
164 intptr_t __cdecl execvpe(const char *_Filename,char *const _ArgList[],char *const _Env[]);
165#endif
166 intptr_t __cdecl spawnv(int,const char *_Filename,char *const _ArgList[]);
167 intptr_t __cdecl spawnve(int,const char *_Filename,char *const _ArgList[],char *const _Env[]);
168 intptr_t __cdecl spawnvp(int,const char *_Filename,char *const _ArgList[]);
169 intptr_t __cdecl spawnvpe(int,const char *_Filename,char *const _ArgList[],char *const _Env[]);
170#endif
171
172#ifdef __cplusplus
173}
174#endif
175#endif
176#endif
win32/include/sec_api/conio_s.h+42−0
@@ -0,0 +1,42 @@
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
7#ifndef _INC_CONIO_S
8#define _INC_CONIO_S
9
10#include <conio.h>
11
12#if defined(MINGW_HAS_SECURE_API)
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18 _CRTIMP errno_t __cdecl _cgets_s(char *_Buffer,size_t _Size,size_t *_SizeRead);
19 _CRTIMP int __cdecl _cprintf_s(const char *_Format,...);
20 _CRTIMP int __cdecl _cscanf_s(const char *_Format,...);
21 _CRTIMP int __cdecl _cscanf_s_l(const char *_Format,_locale_t _Locale,...);
22 _CRTIMP int __cdecl _vcprintf_s(const char *_Format,va_list _ArgList);
23 _CRTIMP int __cdecl _cprintf_s_l(const char *_Format,_locale_t _Locale,...);
24 _CRTIMP int __cdecl _vcprintf_s_l(const char *_Format,_locale_t _Locale,va_list _ArgList);
25
26#ifndef _WCONIO_DEFINED_S
27#define _WCONIO_DEFINED_S
28 _CRTIMP errno_t __cdecl _cgetws_s(wchar_t *_Buffer,size_t _SizeInWords,size_t *_SizeRead);
29 _CRTIMP int __cdecl _cwprintf_s(const wchar_t *_Format,...);
30 _CRTIMP int __cdecl _cwscanf_s(const wchar_t *_Format,...);
31 _CRTIMP int __cdecl _cwscanf_s_l(const wchar_t *_Format,_locale_t _Locale,...);
32 _CRTIMP int __cdecl _vcwprintf_s(const wchar_t *_Format,va_list _ArgList);
33 _CRTIMP int __cdecl _cwprintf_s_l(const wchar_t *_Format,_locale_t _Locale,...);
34 _CRTIMP int __cdecl _vcwprintf_s_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
35#endif
36
37#ifdef __cplusplus
38}
39#endif
40
41#endif
42#endif
win32/include/sec_api/crtdbg_s.h+19−0
@@ -0,0 +1,19 @@
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
7#ifndef _INC_CRTDBG_S
8#define _INC_CRTDBG_S
9
10#include <crtdbg.h>
11
12#if defined(MINGW_HAS_SECURE_API)
13
14#define _dupenv_s_dbg(ps1,size,s2,t,f,l) _dupenv_s(ps1,size,s2)
15#define _wdupenv_s_dbg(ps1,size,s2,t,f,l) _wdupenv_s(ps1,size,s2)
16
17#endif
18
19#endif
win32/include/sec_api/io_s.h+33−0
@@ -0,0 +1,33 @@
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_IO_S
7#define _INC_IO_S
8
9#include <io.h>
10
11#if defined(MINGW_HAS_SECURE_API)
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17 _CRTIMP errno_t __cdecl _access_s(const char *_Filename,int _AccessMode);
18 _CRTIMP errno_t __cdecl _chsize_s(int _FileHandle,__int64 _Size);
19 _CRTIMP errno_t __cdecl _mktemp_s(char *_TemplateName,size_t _Size);
20 _CRTIMP errno_t __cdecl _umask_s(int _NewMode,int *_OldMode);
21
22#ifndef _WIO_S_DEFINED
23#define _WIO_S_DEFINED
24 _CRTIMP errno_t __cdecl _waccess_s(const wchar_t *_Filename,int _AccessMode);
25 _CRTIMP errno_t __cdecl _wmktemp_s(wchar_t *_TemplateName,size_t _SizeInWords);
26#endif
27
28#ifdef __cplusplus
29}
30#endif
31
32#endif
33#endif
win32/include/sec_api/mbstring_s.h+52−0
@@ -0,0 +1,52 @@
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_MBSTRING_S
7#define _INC_MBSTRING_S
8
9#include <mbstring.h>
10
11#if defined(MINGW_HAS_SECURE_API)
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17#ifndef _MBSTRING_S_DEFINED
18#define _MBSTRING_S_DEFINED
19 _CRTIMP errno_t __cdecl _mbscat_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src);
20 _CRTIMP errno_t __cdecl _mbscat_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,_locale_t _Locale);
21 _CRTIMP errno_t __cdecl _mbscpy_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src);
22 _CRTIMP errno_t __cdecl _mbscpy_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,_locale_t _Locale);
23 _CRTIMP errno_t __cdecl _mbslwr_s(unsigned char *_Str,size_t _SizeInBytes);
24 _CRTIMP errno_t __cdecl _mbslwr_s_l(unsigned char *_Str,size_t _SizeInBytes,_locale_t _Locale);
25 _CRTIMP errno_t __cdecl _mbsnbcat_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount);
26 _CRTIMP errno_t __cdecl _mbsnbcat_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount,_locale_t _Locale);
27 _CRTIMP errno_t __cdecl _mbsnbcpy_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount);
28 _CRTIMP errno_t __cdecl _mbsnbcpy_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount,_locale_t _Locale);
29 _CRTIMP errno_t __cdecl _mbsnbset_s(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Ch,size_t _MaxCount);
30 _CRTIMP errno_t __cdecl _mbsnbset_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Ch,size_t _MaxCount,_locale_t _Locale);
31 _CRTIMP errno_t __cdecl _mbsncat_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount);
32 _CRTIMP errno_t __cdecl _mbsncat_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount,_locale_t _Locale);
33 _CRTIMP errno_t __cdecl _mbsncpy_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount);
34 _CRTIMP errno_t __cdecl _mbsncpy_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount,_locale_t _Locale);
35 _CRTIMP errno_t __cdecl _mbsnset_s(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Val,size_t _MaxCount);
36 _CRTIMP errno_t __cdecl _mbsnset_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Val,size_t _MaxCount,_locale_t _Locale);
37 _CRTIMP errno_t __cdecl _mbsset_s(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Val);
38 _CRTIMP errno_t __cdecl _mbsset_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Val,_locale_t _Locale);
39 _CRTIMP unsigned char *__cdecl _mbstok_s(unsigned char *_Str,const unsigned char *_Delim,unsigned char **_Context);
40 _CRTIMP unsigned char *__cdecl _mbstok_s_l(unsigned char *_Str,const unsigned char *_Delim,unsigned char **_Context,_locale_t _Locale);
41 _CRTIMP errno_t __cdecl _mbsupr_s(unsigned char *_Str,size_t _SizeInBytes);
42 _CRTIMP errno_t __cdecl _mbsupr_s_l(unsigned char *_Str,size_t _SizeInBytes,_locale_t _Locale);
43 _CRTIMP errno_t __cdecl _mbccpy_s(unsigned char *_Dst,size_t _DstSizeInBytes,int *_PCopied,const unsigned char *_Src);
44 _CRTIMP errno_t __cdecl _mbccpy_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,int *_PCopied,const unsigned char *_Src,_locale_t _Locale);
45#endif
46
47#ifdef __cplusplus
48}
49#endif
50
51#endif
52#endif
win32/include/sec_api/search_s.h+25−0
@@ -0,0 +1,25 @@
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_SEARCH_S
7#define _INC_SEARCH_S
8
9#include <search.h>
10
11#if defined(MINGW_HAS_SECURE_API)
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17 _CRTIMP void *__cdecl _lfind_s(const void *_Key,const void *_Base,unsigned int *_NumOfElements,size_t _SizeOfElements,int (__cdecl *_PtFuncCompare)(void *,const void *,const void *),void *_Context);
18 _CRTIMP void *__cdecl _lsearch_s(const void *_Key,void *_Base,unsigned int *_NumOfElements,size_t _SizeOfElements,int (__cdecl *_PtFuncCompare)(void *,const void *,const void *),void *_Context);
19
20#ifdef __cplusplus
21}
22#endif
23
24#endif
25#endif
win32/include/sec_api/stdio_s.h+145−0
@@ -0,0 +1,145 @@
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_STDIO_S
7#define _INC_STDIO_S
8
9#include <stdio.h>
10
11#if defined(MINGW_HAS_SECURE_API)
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17#ifndef _STDIO_S_DEFINED
18#define _STDIO_S_DEFINED
19 _CRTIMP errno_t __cdecl clearerr_s(FILE *_File);
20 int __cdecl fprintf_s(FILE *_File,const char *_Format,...);
21 size_t __cdecl fread_s(void *_DstBuf,size_t _DstSize,size_t _ElementSize,size_t _Count,FILE *_File);
22 _CRTIMP int __cdecl _fscanf_s_l(FILE *_File,const char *_Format,_locale_t _Locale,...);
23 int __cdecl printf_s(const char *_Format,...);
24 _CRTIMP int __cdecl _scanf_l(const char *_Format,_locale_t _Locale,...);
25 _CRTIMP int __cdecl _scanf_s_l(const char *_Format,_locale_t _Locale,...);
26 _CRTIMP int __cdecl _snprintf_s(char *_DstBuf,size_t _DstSize,size_t _MaxCount,const char *_Format,...);
27 _CRTIMP int __cdecl _snprintf_c(char *_DstBuf,size_t _MaxCount,const char *_Format,...);
28 _CRTIMP int __cdecl _vsnprintf_c(char *_DstBuf,size_t _MaxCount,const char *_Format,va_list _ArgList);
29 int __cdecl sprintf_s(char *_DstBuf,size_t _DstSize,const char *_Format,...);
30 _CRTIMP int __cdecl _fscanf_l(FILE *_File,const char *_Format,_locale_t _Locale,...);
31 _CRTIMP int __cdecl _sscanf_l(const char *_Src,const char *_Format,_locale_t _Locale,...);
32 _CRTIMP int __cdecl _sscanf_s_l(const char *_Src,const char *_Format,_locale_t _Locale,...);
33 _CRTIMP int __cdecl _snscanf_s(const char *_Src,size_t _MaxCount,const char *_Format,...);
34 _CRTIMP int __cdecl _snscanf_l(const char *_Src,size_t _MaxCount,const char *_Format,_locale_t _Locale,...);
35 _CRTIMP int __cdecl _snscanf_s_l(const char *_Src,size_t _MaxCount,const char *_Format,_locale_t _Locale,...);
36 int __cdecl vfprintf_s(FILE *_File,const char *_Format,va_list _ArgList);
37 int __cdecl vprintf_s(const char *_Format,va_list _ArgList);
38 int __cdecl vsnprintf_s(char *_DstBuf,size_t _DstSize,size_t _MaxCount,const char *_Format,va_list _ArgList);
39 _CRTIMP int __cdecl _vsnprintf_s(char *_DstBuf,size_t _DstSize,size_t _MaxCount,const char *_Format,va_list _ArgList);
40 int __cdecl vsprintf_s(char *_DstBuf,size_t _Size,const char *_Format,va_list _ArgList);
41 _CRTIMP int __cdecl _fprintf_p(FILE *_File,const char *_Format,...);
42 _CRTIMP int __cdecl _printf_p(const char *_Format,...);
43 _CRTIMP int __cdecl _sprintf_p(char *_Dst,size_t _MaxCount,const char *_Format,...);
44 _CRTIMP int __cdecl _vfprintf_p(FILE *_File,const char *_Format,va_list _ArgList);
45 _CRTIMP int __cdecl _vprintf_p(const char *_Format,va_list _ArgList);
46 _CRTIMP int __cdecl _vsprintf_p(char *_Dst,size_t _MaxCount,const char *_Format,va_list _ArgList);
47 _CRTIMP int __cdecl _scprintf_p(const char *_Format,...);
48 _CRTIMP int __cdecl _vscprintf_p(const char *_Format,va_list _ArgList);
49 _CRTIMP int __cdecl _printf_l(const char *_Format,_locale_t _Locale,...);
50 _CRTIMP int __cdecl _printf_p_l(const char *_Format,_locale_t _Locale,...);
51 _CRTIMP int __cdecl _vprintf_l(const char *_Format,_locale_t _Locale,va_list _ArgList);
52 _CRTIMP int __cdecl _vprintf_p_l(const char *_Format,_locale_t _Locale,va_list _ArgList);
53 _CRTIMP int __cdecl _fprintf_l(FILE *_File,const char *_Format,_locale_t _Locale,...);
54 _CRTIMP int __cdecl _fprintf_p_l(FILE *_File,const char *_Format,_locale_t _Locale,...);
55 _CRTIMP int __cdecl _vfprintf_l(FILE *_File,const char *_Format,_locale_t _Locale,va_list _ArgList);
56 _CRTIMP int __cdecl _vfprintf_p_l(FILE *_File,const char *_Format,_locale_t _Locale,va_list _ArgList);
57 _CRTIMP int __cdecl _sprintf_l(char *_DstBuf,const char *_Format,_locale_t _Locale,...);
58 _CRTIMP int __cdecl _sprintf_p_l(char *_DstBuf,size_t _MaxCount,const char *_Format,_locale_t _Locale,...);
59 _CRTIMP int __cdecl _vsprintf_l(char *_DstBuf,const char *_Format,_locale_t,va_list _ArgList);
60 _CRTIMP int __cdecl _vsprintf_p_l(char *_DstBuf,size_t _MaxCount,const char *_Format,_locale_t _Locale,va_list _ArgList);
61 _CRTIMP int __cdecl _scprintf_l(const char *_Format,_locale_t _Locale,...);
62 _CRTIMP int __cdecl _scprintf_p_l(const char *_Format,_locale_t _Locale,...);
63 _CRTIMP int __cdecl _vscprintf_l(const char *_Format,_locale_t _Locale,va_list _ArgList);
64 _CRTIMP int __cdecl _vscprintf_p_l(const char *_Format,_locale_t _Locale,va_list _ArgList);
65 _CRTIMP int __cdecl _printf_s_l(const char *_Format,_locale_t _Locale,...);
66 _CRTIMP int __cdecl _vprintf_s_l(const char *_Format,_locale_t _Locale,va_list _ArgList);
67 _CRTIMP int __cdecl _fprintf_s_l(FILE *_File,const char *_Format,_locale_t _Locale,...);
68 _CRTIMP int __cdecl _vfprintf_s_l(FILE *_File,const char *_Format,_locale_t _Locale,va_list _ArgList);
69 _CRTIMP int __cdecl _sprintf_s_l(char *_DstBuf,size_t _DstSize,const char *_Format,_locale_t _Locale,...);
70 _CRTIMP int __cdecl _vsprintf_s_l(char *_DstBuf,size_t _DstSize,const char *_Format,_locale_t _Locale,va_list _ArgList);
71 _CRTIMP int __cdecl _snprintf_s_l(char *_DstBuf,size_t _DstSize,size_t _MaxCount,const char *_Format,_locale_t _Locale,...);
72 _CRTIMP int __cdecl _vsnprintf_s_l(char *_DstBuf,size_t _DstSize,size_t _MaxCount,const char *_Format,_locale_t _Locale,va_list _ArgList);
73 _CRTIMP int __cdecl _snprintf_l(char *_DstBuf,size_t _MaxCount,const char *_Format,_locale_t _Locale,...);
74 _CRTIMP int __cdecl _snprintf_c_l(char *_DstBuf,size_t _MaxCount,const char *_Format,_locale_t _Locale,...);
75 _CRTIMP int __cdecl _vsnprintf_l(char *_DstBuf,size_t _MaxCount,const char *_Format,_locale_t _Locale,va_list _ArgList);
76 _CRTIMP int __cdecl _vsnprintf_c_l(char *_DstBuf,size_t _MaxCount,const char *,_locale_t _Locale,va_list _ArgList);
77
78#ifndef _WSTDIO_S_DEFINED
79#define _WSTDIO_S_DEFINED
80 _CRTIMP wchar_t *__cdecl _getws_s(wchar_t *_Str,size_t _SizeInWords);
81 int __cdecl fwprintf_s(FILE *_File,const wchar_t *_Format,...);
82 int __cdecl wprintf_s(const wchar_t *_Format,...);
83 int __cdecl vwprintf_s(const wchar_t *_Format,va_list _ArgList);
84 int __cdecl swprintf_s(wchar_t *_Dst,size_t _SizeInWords,const wchar_t *_Format,...);
85 int __cdecl vswprintf_s(wchar_t *_Dst,size_t _SizeInWords,const wchar_t *_Format,va_list _ArgList);
86 _CRTIMP int __cdecl _snwprintf_s(wchar_t *_DstBuf,size_t _DstSizeInWords,size_t _MaxCount,const wchar_t *_Format,...);
87 _CRTIMP int __cdecl _vsnwprintf_s(wchar_t *_DstBuf,size_t _DstSizeInWords,size_t _MaxCount,const wchar_t *_Format,va_list _ArgList);
88 _CRTIMP int __cdecl _wprintf_s_l(const wchar_t *_Format,_locale_t _Locale,...);
89 _CRTIMP int __cdecl _vwprintf_s_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
90 _CRTIMP int __cdecl _fwprintf_s_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,...);
91 _CRTIMP int __cdecl _vfwprintf_s_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
92 _CRTIMP int __cdecl _swprintf_s_l(wchar_t *_DstBuf,size_t _DstSize,const wchar_t *_Format,_locale_t _Locale,...);
93 _CRTIMP int __cdecl _vswprintf_s_l(wchar_t *_DstBuf,size_t _DstSize,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
94 _CRTIMP int __cdecl _snwprintf_s_l(wchar_t *_DstBuf,size_t _DstSize,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,...);
95 _CRTIMP int __cdecl _vsnwprintf_s_l(wchar_t *_DstBuf,size_t _DstSize,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
96 _CRTIMP int __cdecl _fwscanf_s_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,...);
97 _CRTIMP int __cdecl _swscanf_s_l(const wchar_t *_Src,const wchar_t *_Format,_locale_t _Locale,...);
98 _CRTIMP int __cdecl _snwscanf_s(const wchar_t *_Src,size_t _MaxCount,const wchar_t *_Format,...);
99 _CRTIMP int __cdecl _snwscanf_s_l(const wchar_t *_Src,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,...);
100 _CRTIMP int __cdecl _wscanf_s_l(const wchar_t *_Format,_locale_t _Locale,...);
101 _CRTIMP errno_t __cdecl _wfopen_s(FILE **_File,const wchar_t *_Filename,const wchar_t *_Mode);
102 _CRTIMP errno_t __cdecl _wfreopen_s(FILE **_File,const wchar_t *_Filename,const wchar_t *_Mode,FILE *_OldFile);
103 _CRTIMP errno_t __cdecl _wtmpnam_s(wchar_t *_DstBuf,size_t _SizeInWords);
104 _CRTIMP int __cdecl _fwprintf_p(FILE *_File,const wchar_t *_Format,...);
105 _CRTIMP int __cdecl _wprintf_p(const wchar_t *_Format,...);
106 _CRTIMP int __cdecl _vfwprintf_p(FILE *_File,const wchar_t *_Format,va_list _ArgList);
107 _CRTIMP int __cdecl _vwprintf_p(const wchar_t *_Format,va_list _ArgList);
108 _CRTIMP int __cdecl _swprintf_p(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,...);
109 _CRTIMP int __cdecl _vswprintf_p(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,va_list _ArgList);
110 _CRTIMP int __cdecl _scwprintf_p(const wchar_t *_Format,...);
111 _CRTIMP int __cdecl _vscwprintf_p(const wchar_t *_Format,va_list _ArgList);
112 _CRTIMP int __cdecl _wprintf_l(const wchar_t *_Format,_locale_t _Locale,...);
113 _CRTIMP int __cdecl _wprintf_p_l(const wchar_t *_Format,_locale_t _Locale,...);
114 _CRTIMP int __cdecl _vwprintf_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
115 _CRTIMP int __cdecl _vwprintf_p_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
116 _CRTIMP int __cdecl _fwprintf_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,...);
117 _CRTIMP int __cdecl _fwprintf_p_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,...);
118 _CRTIMP int __cdecl _vfwprintf_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
119 _CRTIMP int __cdecl _vfwprintf_p_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
120 _CRTIMP int __cdecl _swprintf_c_l(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,...);
121 _CRTIMP int __cdecl _swprintf_p_l(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,...);
122 _CRTIMP int __cdecl _vswprintf_c_l(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
123 _CRTIMP int __cdecl _vswprintf_p_l(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
124 _CRTIMP int __cdecl _scwprintf_l(const wchar_t *_Format,_locale_t _Locale,...);
125 _CRTIMP int __cdecl _scwprintf_p_l(const wchar_t *_Format,_locale_t _Locale,...);
126 _CRTIMP int __cdecl _vscwprintf_p_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
127 _CRTIMP int __cdecl _snwprintf_l(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,...);
128 _CRTIMP int __cdecl _vsnwprintf_l(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
129 _CRTIMP int __cdecl __swprintf_l(wchar_t *_Dest,const wchar_t *_Format,_locale_t _Plocinfo,...);
130 _CRTIMP int __cdecl __vswprintf_l(wchar_t *_Dest,const wchar_t *_Format,_locale_t _Plocinfo,va_list _Args);
131 _CRTIMP int __cdecl _vscwprintf_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
132 _CRTIMP int __cdecl _fwscanf_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,...);
133 _CRTIMP int __cdecl _swscanf_l(const wchar_t *_Src,const wchar_t *_Format,_locale_t _Locale,...);
134 _CRTIMP int __cdecl _snwscanf_l(const wchar_t *_Src,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,...);
135 _CRTIMP int __cdecl _wscanf_l(const wchar_t *_Format,_locale_t _Locale,...);
136#endif
137#endif
138
139 _CRTIMP size_t __cdecl _fread_nolock_s(void *_DstBuf,size_t _DstSize,size_t _ElementSize,size_t _Count,FILE *_File);
140
141#ifdef __cplusplus
142}
143#endif
144#endif
145#endif
win32/include/sec_api/stdlib_s.h+67−0
@@ -0,0 +1,67 @@
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_STDLIB_S
7#define _INC_STDLIB_S
8
9#include <stdlib.h>
10
11#if defined(MINGW_HAS_SECURE_API)
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17 _CRTIMP errno_t __cdecl _dupenv_s(char **_PBuffer,size_t *_PBufferSizeInBytes,const char *_VarName);
18 _CRTIMP errno_t __cdecl _itoa_s(int _Value,char *_DstBuf,size_t _Size,int _Radix);
19#if _INTEGRAL_MAX_BITS >= 64
20 _CRTIMP errno_t __cdecl _i64toa_s(__int64 _Val,char *_DstBuf,size_t _Size,int _Radix);
21 _CRTIMP errno_t __cdecl _ui64toa_s(unsigned __int64 _Val,char *_DstBuf,size_t _Size,int _Radix);
22#endif
23 _CRTIMP errno_t __cdecl _ltoa_s(long _Val,char *_DstBuf,size_t _Size,int _Radix);
24 _CRTIMP errno_t __cdecl mbstowcs_s(size_t *_PtNumOfCharConverted,wchar_t *_DstBuf,size_t _SizeInWords,const char *_SrcBuf,size_t _MaxCount);
25 _CRTIMP errno_t __cdecl _mbstowcs_s_l(size_t *_PtNumOfCharConverted,wchar_t *_DstBuf,size_t _SizeInWords,const char *_SrcBuf,size_t _MaxCount,_locale_t _Locale);
26 _CRTIMP errno_t __cdecl _ultoa_s(unsigned long _Val,char *_DstBuf,size_t _Size,int _Radix);
27 _CRTIMP errno_t __cdecl _wctomb_s_l(int *_SizeConverted,char *_MbCh,size_t _SizeInBytes,wchar_t _WCh,_locale_t _Locale);
28 _CRTIMP errno_t __cdecl wcstombs_s(size_t *_PtNumOfCharConverted,char *_Dst,size_t _DstSizeInBytes,const wchar_t *_Src,size_t _MaxCountInBytes);
29 _CRTIMP errno_t __cdecl _wcstombs_s_l(size_t *_PtNumOfCharConverted,char *_Dst,size_t _DstSizeInBytes,const wchar_t *_Src,size_t _MaxCountInBytes,_locale_t _Locale);
30
31#ifndef _WSTDLIB_S_DEFINED
32#define _WSTDLIB_S_DEFINED
33 _CRTIMP errno_t __cdecl _itow_s (int _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix);
34 _CRTIMP errno_t __cdecl _ltow_s (long _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix);
35 _CRTIMP errno_t __cdecl _ultow_s (unsigned long _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix);
36 _CRTIMP errno_t __cdecl _wgetenv_s(size_t *_ReturnSize,wchar_t *_DstBuf,size_t _DstSizeInWords,const wchar_t *_VarName);
37 _CRTIMP errno_t __cdecl _wdupenv_s(wchar_t **_Buffer,size_t *_BufferSizeInWords,const wchar_t *_VarName);
38#if _INTEGRAL_MAX_BITS >= 64
39 _CRTIMP errno_t __cdecl _i64tow_s(__int64 _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix);
40 _CRTIMP errno_t __cdecl _ui64tow_s(unsigned __int64 _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix);
41#endif
42#endif
43
44#ifndef _POSIX_
45 _CRTIMP errno_t __cdecl _ecvt_s(char *_DstBuf,size_t _Size,double _Val,int _NumOfDights,int *_PtDec,int *_PtSign);
46 _CRTIMP errno_t __cdecl _fcvt_s(char *_DstBuf,size_t _Size,double _Val,int _NumOfDec,int *_PtDec,int *_PtSign);
47 _CRTIMP errno_t __cdecl _gcvt_s(char *_DstBuf,size_t _Size,double _Val,int _NumOfDigits);
48 _CRTIMP errno_t __cdecl _makepath_s(char *_PathResult,size_t _Size,const char *_Drive,const char *_Dir,const char *_Filename,const char *_Ext);
49 _CRTIMP errno_t __cdecl _putenv_s(const char *_Name,const char *_Value);
50 _CRTIMP errno_t __cdecl _searchenv_s(const char *_Filename,const char *_EnvVar,char *_ResultPath,size_t _SizeInBytes);
51 _CRTIMP errno_t __cdecl _splitpath_s(const char *_FullPath,char *_Drive,size_t _DriveSize,char *_Dir,size_t _DirSize,char *_Filename,size_t _FilenameSize,char *_Ext,size_t _ExtSize);
52
53#ifndef _WSTDLIBP_S_DEFINED
54#define _WSTDLIBP_S_DEFINED
55 _CRTIMP errno_t __cdecl _wmakepath_s(wchar_t *_PathResult,size_t _SizeInWords,const wchar_t *_Drive,const wchar_t *_Dir,const wchar_t *_Filename,const wchar_t *_Ext);
56 _CRTIMP errno_t __cdecl _wputenv_s(const wchar_t *_Name,const wchar_t *_Value);
57 _CRTIMP errno_t __cdecl _wsearchenv_s(const wchar_t *_Filename,const wchar_t *_EnvVar,wchar_t *_ResultPath,size_t _SizeInWords);
58 _CRTIMP errno_t __cdecl _wsplitpath_s(const wchar_t *_FullPath,wchar_t *_Drive,size_t _DriveSizeInWords,wchar_t *_Dir,size_t _DirSizeInWords,wchar_t *_Filename,size_t _FilenameSizeInWords,wchar_t *_Ext,size_t _ExtSizeInWords);
59#endif
60#endif
61
62#ifdef __cplusplus
63}
64#endif
65
66#endif
67#endif
win32/include/sec_api/stralign_s.h+30−0
@@ -0,0 +1,30 @@
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 __STRALIGN_H_S_
7#define __STRALIGN_H_S_
8
9#include <stralign.h>
10
11#if defined(MINGW_HAS_SECURE_API)
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17#if !defined(I_X86_) && defined(_WSTRING_S_DEFINED)
18#if defined(__cplusplus) && defined(_WConst_Return)
19 static __inline PUWSTR ua_wcscpy_s(PUWSTR Destination,size_t DestinationSize,PCUWSTR Source) {
20 if(WSTR_ALIGNED(Source) && WSTR_ALIGNED(Destination)) return (wcscpy_s((PWSTR)Destination,DestinationSize,(PCWSTR)Source)==0 ? Destination : NULL);
21 return uaw_wcscpy((PCUWSTR)String,Character);
22 }
23#endif
24#endif
25
26#ifdef __cplusplus
27}
28#endif
29#endif
30#endif
win32/include/sec_api/string_s.h+41−0
@@ -0,0 +1,41 @@
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_STRING_S
7#define _INC_STRING_S
8
9#include <string.h>
10
11#if defined(MINGW_HAS_SECURE_API)
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17 _CRTIMP errno_t __cdecl _strset_s(char *_Dst,size_t _DstSize,int _Value);
18 _CRTIMP errno_t __cdecl _strerror_s(char *_Buf,size_t _SizeInBytes,const char *_ErrMsg);
19 _CRTIMP errno_t __cdecl _strlwr_s(char *_Str,size_t _Size);
20 _CRTIMP errno_t __cdecl _strlwr_s_l(char *_Str,size_t _Size,_locale_t _Locale);
21 _CRTIMP errno_t __cdecl _strnset_s(char *_Str,size_t _Size,int _Val,size_t _MaxCount);
22 _CRTIMP errno_t __cdecl _strupr_s(char *_Str,size_t _Size);
23 _CRTIMP errno_t __cdecl _strupr_s_l(char *_Str,size_t _Size,_locale_t _Locale);
24#ifndef _WSTRING_S_DEFINED
25#define _WSTRING_S_DEFINED
26 _CRTIMP wchar_t *__cdecl wcstok_s(wchar_t *_Str,const wchar_t *_Delim,wchar_t **_Context);
27 _CRTIMP errno_t __cdecl _wcserror_s(wchar_t *_Buf,size_t _SizeInWords,int _ErrNum);
28 _CRTIMP errno_t __cdecl __wcserror_s(wchar_t *_Buffer,size_t _SizeInWords,const wchar_t *_ErrMsg);
29 _CRTIMP errno_t __cdecl _wcsnset_s(wchar_t *_Dst,size_t _DstSizeInWords,wchar_t _Val,size_t _MaxCount);
30 _CRTIMP errno_t __cdecl _wcsset_s(wchar_t *_Str,size_t _SizeInWords,wchar_t _Val);
31 _CRTIMP errno_t __cdecl _wcslwr_s(wchar_t *_Str,size_t _SizeInWords);
32 _CRTIMP errno_t __cdecl _wcslwr_s_l(wchar_t *_Str,size_t _SizeInWords,_locale_t _Locale);
33 _CRTIMP errno_t __cdecl _wcsupr_s(wchar_t *_Str,size_t _Size);
34 _CRTIMP errno_t __cdecl _wcsupr_s_l(wchar_t *_Str,size_t _Size,_locale_t _Locale);
35#endif
36
37#ifdef __cplusplus
38}
39#endif
40#endif
41#endif
win32/include/sec_api/sys/timeb_s.h+34−0
@@ -0,0 +1,34 @@
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
7#ifndef _TIMEB_H_S
8#define _TIMEB_H_S
9
10#include <sys/timeb.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16#if defined(MINGW_HAS_SECURE_API)
17
18#ifdef _USE_32BIT_TIME_T
19#define _ftime_s _ftime32_s
20#else
21#define _ftime_s _ftime64_s
22#endif
23
24 _CRTIMP errno_t __cdecl _ftime32_s(struct __timeb32 *_Time);
25#if _INTEGRAL_MAX_BITS >= 64
26 _CRTIMP errno_t __cdecl _ftime64_s(struct __timeb64 *_Time);
27#endif
28#endif
29
30#ifdef __cplusplus
31}
32#endif
33
34#endif
win32/include/sec_api/tchar_s.h+266−0
@@ -0,0 +1,266 @@
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_TCHAR_S
7#define _INC_TCHAR_S
8
9#include <tchar.h>
10
11#if defined(MINGW_HAS_SECURE_API)
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17#ifdef _UNICODE
18
19#define _tprintf_s wprintf_s
20#define _tprintf_s_l _wprintf_s_l
21#define _tcprintf_s _cwprintf_s
22#define _tcprintf_s_l _cwprintf_s_l
23#define _vtcprintf_s _vcwprintf_s
24#define _vtcprintf_s_l _vcwprintf_s_l
25#define _ftprintf_s fwprintf_s
26#define _ftprintf_s_l _fwprintf_s_l
27#define _stprintf_s swprintf_s
28#define _stprintf_s_l _swprintf_s_l
29#define _sntprintf_s _snwprintf_s
30#define _sntprintf_s_l _snwprintf_s_l
31#define _vtprintf_s vwprintf_s
32#define _vtprintf_s_l _vwprintf_s_l
33#define _vftprintf_s vfwprintf_s
34#define _vftprintf_s_l _vfwprintf_s_l
35#define _vstprintf_s vswprintf_s
36#define _vstprintf_s_l _vswprintf_s_l
37#define _vsntprintf_s _vsnwprintf_s
38#define _vsntprintf_s_l _vsnwprintf_s_l
39
40#define _tscanf_s wscanf_s
41#define _tscanf_s_l _wscanf_s_l
42#define _tcscanf_s _cwscanf_s
43#define _tcscanf_s_l _cwscanf_s_l
44#define _ftscanf_s fwscanf_s
45#define _ftscanf_s_l _fwscanf_s_l
46#define _stscanf_s swscanf_s
47#define _stscanf_s_l _swscanf_s_l
48#define _sntscanf_s _snwscanf_s
49#define _sntscanf_s_l _snwscanf_s_l
50
51#define _cgetts_s _cgetws_s
52#define _getts_s _getws_s
53
54#define _itot_s _itow_s
55#define _ltot_s _ltow_s
56#define _ultot_s _ultow_s
57#define _i64tot_s _i64tow_s
58#define _ui64tot_s _ui64tow_s
59
60#define _tcscat_s wcscat_s
61#define _tcscpy_s wcscpy_s
62#define _tcsncat_s wcsncat_s
63#define _tcsncat_s_l _wcsncat_s_l
64#define _tcsncpy_s wcsncpy_s
65#define _tcsncpy_s_l _wcsncpy_s_l
66#define _tcstok_s wcstok_s
67#define _tcstok_s_l _wcstok_s_l
68#define _tcserror_s _wcserror_s
69#define __tcserror_s __wcserror_s
70
71#define _tcsnset_s _wcsnset_s
72#define _tcsnset_s_l _wcsnset_s_l
73#define _tcsset_s _wcsset_s
74#define _tcsset_s_l _wcsset_s_l
75
76#define _tasctime_s _wasctime_s
77#define _tctime_s _wctime_s
78#define _tctime32_s _wctime32_s
79#define _tctime64_s _wctime64_s
80#define _tstrdate_s _wstrdate_s
81#define _tstrtime_s _wstrtime_s
82
83#define _tgetenv_s _wgetenv_s
84#define _tdupenv_s _wdupenv_s
85#define _tmakepath_s _wmakepath_s
86#define _tputenv_s _wputenv_s
87#define _tsearchenv_s _wsearchenv_s
88#define _tsplitpath_s _wsplitpath_s
89
90#define _tfopen_s _wfopen_s
91#define _tfreopen_s _wfreopen_s
92#define _ttmpnam_s _wtmpnam_s
93#define _taccess_s _waccess_s
94#define _tmktemp_s _wmktemp_s
95
96#define _tcsnccat_s wcsncat_s
97#define _tcsnccat_s_l _wcsncat_s_l
98#define _tcsnccpy_s wcsncpy_s
99#define _tcsnccpy_s_l _wcsncpy_s_l
100
101#define _tcslwr_s _wcslwr_s
102#define _tcslwr_s_l _wcslwr_s_l
103#define _tcsupr_s _wcsupr_s
104#define _tcsupr_s_l _wcsupr_s_l
105
106#define _wcstok_s_l(_String,_Delimiters,_Current_position,_Locale) (wcstok_s(_String,_Delimiters,_Current_position))
107#define _wcsnset_s_l(_Destination,_Destination_size_chars,_Value,_Count,_Locale) (_wcsnset_s(_Destination,_Destination_size_chars,_Value,_Count))
108#define _wcsset_s_l(_Destination,_Destination_size_chars,_Value,_Locale) (_wcsset_s(_Destination,_Destination_size_chars,_Value))
109
110#else
111
112#define _tprintf_s printf_s
113#define _tprintf_s_l _printf_s_l
114#define _tcprintf_s _cprintf_s
115#define _tcprintf_s_l _cprintf_s_l
116#define _vtcprintf_s _vcprintf_s
117#define _vtcprintf_s_l _vcprintf_s_l
118#define _ftprintf_s fprintf_s
119#define _ftprintf_s_l _fprintf_s_l
120#define _stprintf_s sprintf_s
121#define _stprintf_s_l _sprintf_s_l
122#define _sntprintf_s _snprintf_s
123#define _sntprintf_s_l _snprintf_s_l
124#define _vtprintf_s vprintf_s
125#define _vtprintf_s_l _vprintf_s_l
126#define _vftprintf_s vfprintf_s
127#define _vftprintf_s_l _vfprintf_s_l
128#define _vstprintf_s vsprintf_s
129#define _vstprintf_s_l _vsprintf_s_l
130#define _vsntprintf_s _vsnprintf_s
131#define _vsntprintf_s_l _vsnprintf_s_l
132#define _tscanf_s scanf_s
133#define _tscanf_s_l _scanf_s_l
134#define _tcscanf_s _cscanf_s
135#define _tcscanf_s_l _cscanf_s_l
136#define _ftscanf_s fscanf_s
137#define _ftscanf_s_l _fscanf_s_l
138#define _stscanf_s sscanf_s
139#define _stscanf_s_l _sscanf_s_l
140#define _sntscanf_s _snscanf_s
141#define _sntscanf_s_l _snscanf_s_l
142
143#define _getts_s gets_s
144#define _cgetts_s _cgets_s
145#define _itot_s _itoa_s
146#define _ltot_s _ltoa_s
147#define _ultot_s _ultoa_s
148#define _i64tot_s _i64toa_s
149#define _ui64tot_s _ui64toa_s
150
151#define _tcscat_s strcat_s
152#define _tcscpy_s strcpy_s
153#define _tcserror_s strerror_s
154#define __tcserror_s _strerror_s
155
156#define _tasctime_s asctime_s
157#define _tctime_s ctime_s
158#define _tctime32_s _ctime32_s
159#define _tctime64_s _ctime64_s
160#define _tstrdate_s _strdate_s
161#define _tstrtime_s _strtime_s
162
163#define _tgetenv_s getenv_s
164#define _tdupenv_s _dupenv_s
165#define _tmakepath_s _makepath_s
166#define _tputenv_s _putenv_s
167#define _tsearchenv_s _searchenv_s
168#define _tsplitpath_s _splitpath_s
169
170#define _tfopen_s fopen_s
171#define _tfreopen_s freopen_s
172#define _ttmpnam_s tmpnam_s
173#define _tmktemp_s _mktemp_s
174
175#ifndef _POSIX_
176#define _taccess_s _access_s
177#endif
178
179#define _tsopen_s _sopen_s
180
181#ifdef _MBCS
182
183#ifdef _MB_MAP_DIRECT
184
185#define _tcsncat_s _mbsnbcat_s
186#define _tcsncat_s_l _mbsnbcat_s_l
187#define _tcsncpy_s _mbsnbcpy_s
188#define _tcsncpy_s_l _mbsnbcpy_s_l
189#define _tcstok_s _mbstok_s
190#define _tcstok_s_l _mbstok_s_l
191
192#define _tcsnset_s _mbsnbset_s
193#define _tcsnset_s_l _mbsnbset_s_l
194#define _tcsset_s _mbsset_s
195#define _tcsset_s_l _mbsset_s_l
196
197#define _tcsnccat_s _mbsncat_s
198#define _tcsnccat_s_l _mbsncat_s_l
199#define _tcsnccpy_s _mbsncpy_s
200#define _tcsnccpy_s_l _mbsncpy_s_l
201#define _tcsncset_s _mbsnset_s
202#define _tcsncset_s_l _mbsnset_s_l
203
204#define _tcslwr_s _mbslwr_s
205#define _tcslwr_s_l _mbslwr_s_l
206#define _tcsupr_s _mbsupr_s
207#define _tcsupr_s_l _mbsupr_s_l
208
209#define _tccpy_s _mbccpy_s
210#define _tccpy_s_l _mbccpy_s_l
211#else
212
213 _CRTIMP char *__cdecl _tcsncat_s(char *_Dst,size_t _DstSizeInChars,const char *_Src,size_t _MaxCount);
214 _CRTIMP char *__cdecl _tcsncat_s_l(char *_Dst,size_t _DstSizeInChars,const char *_Src,size_t _MaxCount,_locale_t _Locale);
215 _CRTIMP char *__cdecl _tcsncpy_s(char *_Dst,size_t _DstSizeInChars,const char *_Src,size_t _MaxCount);
216 _CRTIMP char *__cdecl _tcsncpy_s_l(char *_Dst,size_t _DstSizeInChars,const char *_Src,size_t _MaxCount,_locale_t _Locale);
217 _CRTIMP char *__cdecl _tcstok_s(char *_Str,const char *_Delim,char **_Context);
218 _CRTIMP char *__cdecl _tcstok_s_l(char *_Str,const char *_Delim,char **_Context,_locale_t _Locale);
219 _CRTIMP errno_t __cdecl _tcsset_s(char *_Str,size_t _SizeInChars,unsigned int _Val);
220 _CRTIMP errno_t __cdecl _tcsset_s_l(char *_Str,size_t _SizeInChars,unsigned int,_locale_t _Locale);
221 _CRTIMP char *__cdecl _tcsnccat_s(char *_Dst,size_t _DstSizeInChars,const char *_Src,size_t _MaxCount);
222 _CRTIMP char *__cdecl _tcsnccat_s_l(char *_Dst,size_t _DstSizeInChars,const char *_Src,size_t _MaxCount,_locale_t _Locale);
223 _CRTIMP char *__cdecl _tcsnccpy_s(char *_Dst,size_t _DstSizeInChars,const char *_Src,size_t _MaxCount);
224 _CRTIMP char *__cdecl _tcsnccpy_s_l(char *_Dst,size_t _DstSizeInChars,const char *_Src,size_t _MaxCount,_locale_t _Locale);
225 _CRTIMP char *__cdecl _tcslwr_s(char *_Str,size_t _SizeInChars);
226 _CRTIMP char *__cdecl _tcslwr_s_l(char *_Str,size_t _SizeInChars,_locale_t _Locale);
227 _CRTIMP char *__cdecl _tcsupr_s(char *_Str,size_t _SizeInChars);
228 _CRTIMP char *__cdecl _tcsupr_s_l(char *_Str,size_t _SizeInChars,_locale_t _Locale);
229
230#endif
231
232#else
233
234#define _tcsncat_s strncat_s
235#define _tcsncat_s_l _strncat_s_l
236#define _tcsncpy_s strncpy_s
237#define _tcsncpy_s_l _strncpy_s_l
238#define _tcstok_s strtok_s
239#define _tcstok_s_l _strtok_s_l
240
241#define _tcsnset_s _strnset_s
242#define _tcsnset_s_l _strnset_s_l
243#define _tcsset_s _strset_s
244#define _tcsset_s _strset_s
245#define _tcsset_s_l _strset_s_l
246
247#define _tcsnccat_s strncat_s
248#define _tcsnccat_s_l _strncat_s_l
249#define _tcsnccpy_s strncpy_s
250#define _tcsnccpy_s_l _strncpy_s_l
251
252#define _tcslwr_s _strlwr_s
253#define _tcslwr_s_l _strlwr_s_l
254#define _tcsupr_s _strupr_s
255#define _tcsupr_s_l _strupr_s_l
256
257#define _strnset_s_l(_Destination,_Destination_size_chars,_Value,_Count,_Locale) (_strnset_s(_Destination,_Destination_size_chars,_Value,_Count))
258#define _strset_s_l(_Destination,_Destination_size_chars,_Value,_Locale) (_strset_s(_Destination,_Destination_size_chars,_Value))
259#endif
260#endif
261
262#ifdef __cplusplus
263}
264#endif
265#endif
266#endif
win32/include/sec_api/time_s.h+61−0
@@ -0,0 +1,61 @@
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 _TIME_H__S
7#define _TIME_H__S
8
9#include <time.h>
10
11#if defined(MINGW_HAS_SECURE_API)
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17 _CRTIMP errno_t __cdecl _ctime32_s(char *_Buf,size_t _SizeInBytes,const __time32_t *_Time);
18 _CRTIMP errno_t __cdecl _gmtime32_s(struct tm *_Tm,const __time32_t *_Time);
19 _CRTIMP errno_t __cdecl _localtime32_s(struct tm *_Tm,const __time32_t *_Time);
20 _CRTIMP errno_t __cdecl _strdate_s(char *_Buf,size_t _SizeInBytes);
21 _CRTIMP errno_t __cdecl _strtime_s(char *_Buf ,size_t _SizeInBytes);
22#if _INTEGRAL_MAX_BITS >= 64
23 _CRTIMP errno_t __cdecl _ctime64_s(char *_Buf,size_t _SizeInBytes,const __time64_t *_Time);
24 _CRTIMP errno_t __cdecl _gmtime64_s(struct tm *_Tm,const __time64_t *_Time);
25 _CRTIMP errno_t __cdecl _localtime64_s(struct tm *_Tm,const __time64_t *_Time);
26#endif
27
28#ifndef _WTIME_S_DEFINED
29#define _WTIME_S_DEFINED
30 _CRTIMP errno_t __cdecl _wasctime_s(wchar_t *_Buf,size_t _SizeInWords,const struct tm *_Tm);
31 _CRTIMP errno_t __cdecl _wctime32_s(wchar_t *_Buf,size_t _SizeInWords,const __time32_t *_Time);
32 _CRTIMP errno_t __cdecl _wstrdate_s(wchar_t *_Buf,size_t _SizeInWords);
33 _CRTIMP errno_t __cdecl _wstrtime_s(wchar_t *_Buf,size_t _SizeInWords);
34#if _INTEGRAL_MAX_BITS >= 64
35 _CRTIMP errno_t __cdecl _wctime64_s(wchar_t *_Buf,size_t _SizeInWords,const __time64_t *_Time);
36#endif
37
38#if !defined (RC_INVOKED) && !defined (_INC_WTIME_S_INL)
39#define _INC_WTIME_S_INL
40#ifdef _USE_32BIT_TIME_T
41__CRT_INLINE errno_t __cdecl _wctime_s(wchar_t *_Buffer,size_t _SizeInWords,const time_t *_Time) { return _wctime32_s(_Buffer,_SizeInWords,_Time); }
42#else
43__CRT_INLINE errno_t __cdecl _wctime_s(wchar_t *_Buffer,size_t _SizeInWords,const time_t *_Time) { return _wctime64_s(_Buffer,_SizeInWords,_Time); }
44#endif
45#endif
46#endif
47
48#ifndef RC_INVOKED
49#ifdef _USE_32BIT_TIME_T
50__CRT_INLINE errno_t __cdecl localtime_s(struct tm *_Tm,const time_t *_Time) { return _localtime32_s(_Tm,_Time); }
51#else
52__CRT_INLINE errno_t __cdecl localtime_s(struct tm *_Tm,const time_t *_Time) { return _localtime64_s(_Tm,_Time); }
53#endif
54#endif
55
56#ifdef __cplusplus
57}
58#endif
59
60#endif
61#endif
win32/include/sec_api/wchar_s.h+128−0
@@ -0,0 +1,128 @@
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_WCHAR_S
7#define _INC_WCHAR_S
8
9#include <wchar.h>
10
11#if defined(MINGW_HAS_SECURE_API)
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17#ifndef _WIO_S_DEFINED
18#define _WIO_S_DEFINED
19 _CRTIMP errno_t __cdecl _waccess_s(const wchar_t *_Filename,int _AccessMode);
20 _CRTIMP errno_t __cdecl _wmktemp_s(wchar_t *_TemplateName,size_t _SizeInWords);
21#endif
22
23#ifndef _WCONIO_S_DEFINED
24#define _WCONIO_S_DEFINED
25 _CRTIMP errno_t __cdecl _cgetws_s(wchar_t *_Buffer,size_t _SizeInWords,size_t *_SizeRead);
26 _CRTIMP int __cdecl _cwprintf_s(const wchar_t *_Format,...);
27 _CRTIMP int __cdecl _cwscanf_s(const wchar_t *_Format,...);
28 _CRTIMP int __cdecl _cwscanf_s_l(const wchar_t *_Format,_locale_t _Locale,...);
29 _CRTIMP int __cdecl _vcwprintf_s(const wchar_t *_Format,va_list _ArgList);
30 _CRTIMP int __cdecl _cwprintf_s_l(const wchar_t *_Format,_locale_t _Locale,...);
31 _CRTIMP int __cdecl _vcwprintf_s_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
32#endif
33
34#ifndef _WSTDIO_S_DEFINED
35#define _WSTDIO_S_DEFINED
36 _CRTIMP wchar_t *__cdecl _getws_s(wchar_t *_Str,size_t _SizeInWords);
37 int __cdecl fwprintf_s(FILE *_File,const wchar_t *_Format,...);
38 int __cdecl wprintf_s(const wchar_t *_Format,...);
39 int __cdecl vfwprintf_s(FILE *_File,const wchar_t *_Format,va_list _ArgList);
40 int __cdecl vwprintf_s(const wchar_t *_Format,va_list _ArgList);
41 int __cdecl swprintf_s(wchar_t *_Dst,size_t _SizeInWords,const wchar_t *_Format,...);
42 int __cdecl vswprintf_s(wchar_t *_Dst,size_t _SizeInWords,const wchar_t *_Format,va_list _ArgList);
43 _CRTIMP int __cdecl _snwprintf_s(wchar_t *_DstBuf,size_t _DstSizeInWords,size_t _MaxCount,const wchar_t *_Format,...);
44 _CRTIMP int __cdecl _vsnwprintf_s(wchar_t *_DstBuf,size_t _DstSizeInWords,size_t _MaxCount,const wchar_t *_Format,va_list _ArgList);
45 _CRTIMP int __cdecl _wprintf_s_l(const wchar_t *_Format,_locale_t _Locale,...);
46 _CRTIMP int __cdecl _vwprintf_s_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
47 _CRTIMP int __cdecl _fwprintf_s_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,...);
48 _CRTIMP int __cdecl _vfwprintf_s_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
49 _CRTIMP int __cdecl _swprintf_s_l(wchar_t *_DstBuf,size_t _DstSize,const wchar_t *_Format,_locale_t _Locale,...);
50 _CRTIMP int __cdecl _vswprintf_s_l(wchar_t *_DstBuf,size_t _DstSize,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
51 _CRTIMP int __cdecl _snwprintf_s_l(wchar_t *_DstBuf,size_t _DstSize,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,...);
52 _CRTIMP int __cdecl _vsnwprintf_s_l(wchar_t *_DstBuf,size_t _DstSize,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
53 _CRTIMP int __cdecl _fwscanf_s_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,...);
54 _CRTIMP int __cdecl _swscanf_s_l(const wchar_t *_Src,const wchar_t *_Format,_locale_t _Locale,...);
55 _CRTIMP int __cdecl _snwscanf_s(const wchar_t *_Src,size_t _MaxCount,const wchar_t *_Format,...);
56 _CRTIMP int __cdecl _snwscanf_s_l(const wchar_t *_Src,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,...);
57 _CRTIMP int __cdecl _wscanf_s_l(const wchar_t *_Format,_locale_t _Locale,...);
58 _CRTIMP errno_t __cdecl _wfopen_s(FILE **_File,const wchar_t *_Filename,const wchar_t *_Mode);
59 _CRTIMP errno_t __cdecl _wfreopen_s(FILE **_File,const wchar_t *_Filename,const wchar_t *_Mode,FILE *_OldFile);
60 _CRTIMP errno_t __cdecl _wtmpnam_s(wchar_t *_DstBuf,size_t _SizeInWords);
61#endif
62
63#ifndef _WSTDLIB_S_DEFINED
64#define _WSTDLIB_S_DEFINED
65 _CRTIMP errno_t __cdecl _itow_s (int _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix);
66 _CRTIMP errno_t __cdecl _ltow_s (long _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix);
67 _CRTIMP errno_t __cdecl _ultow_s (unsigned long _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix);
68 _CRTIMP errno_t __cdecl _wgetenv_s(size_t *_ReturnSize,wchar_t *_DstBuf,size_t _DstSizeInWords,const wchar_t *_VarName);
69 _CRTIMP errno_t __cdecl _wdupenv_s(wchar_t **_Buffer,size_t *_BufferSizeInWords,const wchar_t *_VarName);
70#if _INTEGRAL_MAX_BITS >= 64
71 _CRTIMP errno_t __cdecl _i64tow_s(__int64 _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix);
72 _CRTIMP errno_t __cdecl _ui64tow_s(unsigned __int64 _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix);
73#endif
74#endif
75
76#ifndef _POSIX_
77#ifndef _WSTDLIBP_S_DEFINED
78#define _WSTDLIBP_S_DEFINED
79 _CRTIMP errno_t __cdecl _wmakepath_s(wchar_t *_PathResult,size_t _SizeInWords,const wchar_t *_Drive,const wchar_t *_Dir,const wchar_t *_Filename,const wchar_t *_Ext);
80 _CRTIMP errno_t __cdecl _wputenv_s(const wchar_t *_Name,const wchar_t *_Value);
81 _CRTIMP errno_t __cdecl _wsearchenv_s(const wchar_t *_Filename,const wchar_t *_EnvVar,wchar_t *_ResultPath,size_t _SizeInWords);
82 _CRTIMP errno_t __cdecl _wsplitpath_s(const wchar_t *_FullPath,wchar_t *_Drive,size_t _DriveSizeInWords,wchar_t *_Dir,size_t _DirSizeInWords,wchar_t *_Filename,size_t _FilenameSizeInWords,wchar_t *_Ext,size_t _ExtSizeInWords);
83#endif
84#endif
85
86#ifndef _WSTRING_S_DEFINED
87#define _WSTRING_S_DEFINED
88 _CRTIMP wchar_t *__cdecl wcstok_s(wchar_t *_Str,const wchar_t *_Delim,wchar_t **_Context);
89 _CRTIMP errno_t __cdecl _wcserror_s(wchar_t *_Buf,size_t _SizeInWords,int _ErrNum);
90 _CRTIMP errno_t __cdecl __wcserror_s(wchar_t *_Buffer,size_t _SizeInWords,const wchar_t *_ErrMsg);
91 _CRTIMP errno_t __cdecl _wcsnset_s(wchar_t *_Dst,size_t _DstSizeInWords,wchar_t _Val,size_t _MaxCount);
92 _CRTIMP errno_t __cdecl _wcsset_s(wchar_t *_Str,size_t _SizeInWords,wchar_t _Val);
93 _CRTIMP errno_t __cdecl _wcslwr_s(wchar_t *_Str,size_t _SizeInWords);
94 _CRTIMP errno_t __cdecl _wcslwr_s_l(wchar_t *_Str,size_t _SizeInWords,_locale_t _Locale);
95 _CRTIMP errno_t __cdecl _wcsupr_s(wchar_t *_Str,size_t _Size);
96 _CRTIMP errno_t __cdecl _wcsupr_s_l(wchar_t *_Str,size_t _Size,_locale_t _Locale);
97#endif
98
99#ifndef _WTIME_S_DEFINED
100#define _WTIME_S_DEFINED
101 _CRTIMP errno_t __cdecl _wasctime_s(wchar_t *_Buf,size_t _SizeInWords,const struct tm *_Tm);
102 _CRTIMP errno_t __cdecl _wctime32_s(wchar_t *_Buf,size_t _SizeInWords,const __time32_t *_Time);
103 _CRTIMP errno_t __cdecl _wstrdate_s(wchar_t *_Buf,size_t _SizeInWords);
104 _CRTIMP errno_t __cdecl _wstrtime_s(wchar_t *_Buf,size_t _SizeInWords);
105#if _INTEGRAL_MAX_BITS >= 64
106 _CRTIMP errno_t __cdecl _wctime64_s(wchar_t *_Buf,size_t _SizeInWords,const __time64_t *_Time);
107#endif
108
109#if !defined (RC_INVOKED) && !defined (_INC_WTIME_S_INL)
110#define _INC_WTIME_S_INL
111#ifdef _USE_32BIT_TIME_T
112__CRT_INLINE errno_t __cdecl _wctime_s(wchar_t *_Buffer,size_t _SizeInWords,const time_t *_Time) { return _wctime32_s(_Buffer,_SizeInWords,_Time); }
113#else
114__CRT_INLINE errno_t __cdecl _wctime_s(wchar_t *_Buffer,size_t _SizeInWords,const time_t *_Time) { return _wctime64_s(_Buffer,_SizeInWords,_Time); }
115#endif
116#endif
117#endif
118
119 _CRTIMP errno_t __cdecl mbsrtowcs_s(size_t *_Retval,wchar_t *_Dst,size_t _SizeInWords,const char **_PSrc,size_t _N,mbstate_t *_State);
120 _CRTIMP errno_t __cdecl wcrtomb_s(size_t *_Retval,char *_Dst,size_t _SizeInBytes,wchar_t _Ch,mbstate_t *_State);
121 _CRTIMP errno_t __cdecl wcsrtombs_s(size_t *_Retval,char *_Dst,size_t _SizeInBytes,const wchar_t **_Src,size_t _Size,mbstate_t *_State);
122
123#ifdef __cplusplus
124}
125#endif
126
127#endif
128#endif
win32/include/setjmp.h+141−53
@@ -1,72 +1,160 @@
1/* 1/**
2 * setjmp.h2 * This file has no copyright assigned and is placed in the Public Domain.
3 *3 * This file is part of the w64 mingw-runtime package.
4 * Declarations supporting setjmp and longjump, a method for avoiding4 * No warranty is given; refer to the file DISCLAIMER within this package.
5 * the normal function call return sequence. (Bleah!)
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 *
12 * THIS SOFTWARE IS NOT COPYRIGHTED
13 *
14 * This source code is offered for use in the public domain. You may
15 * use, modify or distribute it freely.
16 *
17 * This code is distributed in the hope that it will be useful but
18 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
19 * DISCLAIMED. This includes but is not limited to warranties of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 *
22 * $Revision: 1.2 $
23 * $Author: bellard $
24 * $Date: 2005/04/17 13:14:29 $
25 *
26 */5 */
6#ifndef _INC_SETJMP
7#define _INC_SETJMP
27 8
28#ifndef _SETJMP_H_
29#define _SETJMP_H_
30
31/* All the headers include this file. */
32#include <_mingw.h>9#include <_mingw.h>
33 10
34#ifndef RC_INVOKED11#pragma pack(push,_CRT_PACKING)
35 12
36#ifdef __cplusplus13#ifdef __cplusplus
37extern "C" {14extern "C" {
38#endif15#endif
39 16
40/*17#if (defined(_X86_) && !defined(__x86_64))
41 * The buffer used by setjmp to store the information used by longjmp18
42 * to perform it's evil goto-like work. The size of this buffer was
43 * determined through experimentation; it's contents are a mystery.
44 * NOTE: This was determined on an i386 (actually a Pentium). The
45 * contents could be different on an Alpha or something else.
46 */
47#define _JBLEN 1619#define _JBLEN 16
48#define _JBTYPE int20#define _JBTYPE int
49typedef _JBTYPE jmp_buf[_JBLEN];
50 21
51/*22 typedef struct __JUMP_BUFFER {
52 * The function provided by CRTDLL which appears to do the actual work23 unsigned long Ebp;
53 * of setjmp.24 unsigned long Ebx;
54 */25 unsigned long Edi;
55int _setjmp (jmp_buf);26 unsigned long Esi;
27 unsigned long Esp;
28 unsigned long Eip;
29 unsigned long Registration;
30 unsigned long TryLevel;
31 unsigned long Cookie;
32 unsigned long UnwindFunc;
33 unsigned long UnwindData[6];
34 } _JUMP_BUFFER;
35#elif defined(__ia64__)
36 typedef _CRT_ALIGN(16) struct _SETJMP_FLOAT128 {
37 __int64 LowPart;
38 __int64 HighPart;
39 } SETJMP_FLOAT128;
56 40
57#define setjmp(x) _setjmp(x)41#define _JBLEN 33
42 typedef SETJMP_FLOAT128 _JBTYPE;
58 43
59/*44 typedef struct __JUMP_BUFFER {
60 * Return to the last setjmp call and act as if setjmp had returned
61 * nVal (which had better be non-zero!).
62 */
63void longjmp (jmp_buf, int);
64 45
65#ifdef __cplusplus46 unsigned long iAReserved[6];
66}47
48 unsigned long Registration;
49 unsigned long TryLevel;
50 unsigned long Cookie;
51 unsigned long UnwindFunc;
52
53 unsigned long UnwindData[6];
54
55 SETJMP_FLOAT128 FltS0;
56 SETJMP_FLOAT128 FltS1;
57 SETJMP_FLOAT128 FltS2;
58 SETJMP_FLOAT128 FltS3;
59 SETJMP_FLOAT128 FltS4;
60 SETJMP_FLOAT128 FltS5;
61 SETJMP_FLOAT128 FltS6;
62 SETJMP_FLOAT128 FltS7;
63 SETJMP_FLOAT128 FltS8;
64 SETJMP_FLOAT128 FltS9;
65 SETJMP_FLOAT128 FltS10;
66 SETJMP_FLOAT128 FltS11;
67 SETJMP_FLOAT128 FltS12;
68 SETJMP_FLOAT128 FltS13;
69 SETJMP_FLOAT128 FltS14;
70 SETJMP_FLOAT128 FltS15;
71 SETJMP_FLOAT128 FltS16;
72 SETJMP_FLOAT128 FltS17;
73 SETJMP_FLOAT128 FltS18;
74 SETJMP_FLOAT128 FltS19;
75 __int64 FPSR;
76 __int64 StIIP;
77 __int64 BrS0;
78 __int64 BrS1;
79 __int64 BrS2;
80 __int64 BrS3;
81 __int64 BrS4;
82 __int64 IntS0;
83 __int64 IntS1;
84 __int64 IntS2;
85 __int64 IntS3;
86 __int64 RsBSP;
87 __int64 RsPFS;
88 __int64 ApUNAT;
89 __int64 ApLC;
90 __int64 IntSp;
91 __int64 IntNats;
92 __int64 Preds;
93
94 } _JUMP_BUFFER;
95#elif defined(__x86_64)
96 typedef _CRT_ALIGN(16) struct _SETJMP_FLOAT128 {
97 unsigned __int64 Part[2];
98 } SETJMP_FLOAT128;
99
100#define _JBLEN 16
101 typedef SETJMP_FLOAT128 _JBTYPE;
102
103 typedef struct _JUMP_BUFFER {
104 unsigned __int64 Frame;
105 unsigned __int64 Rbx;
106 unsigned __int64 Rsp;
107 unsigned __int64 Rbp;
108 unsigned __int64 Rsi;
109 unsigned __int64 Rdi;
110 unsigned __int64 R12;
111 unsigned __int64 R13;
112 unsigned __int64 R14;
113 unsigned __int64 R15;
114 unsigned __int64 Rip;
115 unsigned __int64 Spare;
116 SETJMP_FLOAT128 Xmm6;
117 SETJMP_FLOAT128 Xmm7;
118 SETJMP_FLOAT128 Xmm8;
119 SETJMP_FLOAT128 Xmm9;
120 SETJMP_FLOAT128 Xmm10;
121 SETJMP_FLOAT128 Xmm11;
122 SETJMP_FLOAT128 Xmm12;
123 SETJMP_FLOAT128 Xmm13;
124 SETJMP_FLOAT128 Xmm14;
125 SETJMP_FLOAT128 Xmm15;
126 } _JUMP_BUFFER;
127#endif
128#ifndef _JMP_BUF_DEFINED
129 typedef _JBTYPE jmp_buf[_JBLEN];
130#define _JMP_BUF_DEFINED
131#endif
132
133 void * __cdecl __attribute__ ((__nothrow__)) mingw_getsp(void);
134
135#ifdef USE_MINGW_SETJMP_TWO_ARGS
136#ifndef _INC_SETJMPEX
137#define setjmp(BUF) _setjmp((BUF),mingw_getsp())
138 int __cdecl __attribute__ ((__nothrow__)) _setjmp(jmp_buf _Buf,void *_Ctx);
139#else
140#undef setjmp
141#define setjmp(BUF) _setjmpex((BUF),mingw_getsp())
142#define setjmpex(BUF) _setjmpex((BUF),mingw_getsp())
143 int __cdecl __attribute__ ((__nothrow__)) _setjmpex(jmp_buf _Buf,void *_Ctx);
144#endif
145#else
146#ifndef _INC_SETJMPEX
147#define setjmp _setjmp
148#endif
149 int __cdecl __attribute__ ((__nothrow__)) setjmp(jmp_buf _Buf);
67#endif150#endif
68 151
69#endif /* Not RC_INVOKED */152 __declspec(noreturn) __attribute__ ((__nothrow__)) void __cdecl ms_longjmp(jmp_buf _Buf,int _Value)/* throw(...)*/;
153 __declspec(noreturn) __attribute__ ((__nothrow__)) void __cdecl longjmp(jmp_buf _Buf,int _Value);
70 154
71#endif /* Not _SETJMP_H_ */155#ifdef __cplusplus
156}
157#endif
72 158
159#pragma pack(pop)
160#endif
win32/include/share.h+23−39
@@ -1,44 +1,28 @@
1/*1/**
2 * share.h2 * This file has no copyright assigned and is placed in the Public Domain.
3 *3 * This file is part of the w64 mingw-runtime package.
4 * Constants for file sharing functions.4 * No warranty is given; refer to the file DISCLAIMER within this package.
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 */5 */
6#ifndef _INC_SHARE
7#define _INC_SHARE
26 8
27#ifndef __STRICT_ANSI__9#ifndef _WIN32
10#error Only Win32 target is supported!
11#endif
28 12
29#ifndef _SHARE_H_13#define _SH_COMPAT 0x00
30#define _SHARE_H_14#define _SH_DENYRW 0x10
15#define _SH_DENYWR 0x20
16#define _SH_DENYRD 0x30
17#define _SH_DENYNO 0x40
18#define _SH_SECURE 0x80
31 19
32/* All the headers include this file. */20#ifndef NO_OLDNAMES
33#include <_mingw.h>21#define SH_COMPAT _SH_COMPAT
34 22#define SH_DENYRW _SH_DENYRW
35#define SH_COMPAT 0x00 /* Compatibility */23#define SH_DENYWR _SH_DENYWR
36#define SH_DENYRW 0x10 /* Deny read/write */24#define SH_DENYRD _SH_DENYRD
37#define SH_DENYWR 0x20 /* Deny write */25#define SH_DENYNO _SH_DENYNO
38#define SH_DENYRD 0x30 /* Deny read */26#endif
39#define SH_DENYNO 0x40 /* Deny nothing */
40
41#endif /* Not _SHARE_H_ */
42
43#endif /* Not __STRICT_ANSI__ */
44 27
28#endif
win32/include/signal.h+46−94
@@ -1,111 +1,63 @@
1/* 1/**
2 * signal.h2 * This file has no copyright assigned and is placed in the Public Domain.
3 *3 * This file is part of the w64 mingw-runtime package.
4 * A way to set handlers for exceptional conditions (also known as signals).4 * No warranty is given; refer to the file DISCLAIMER within this package.
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 */5 */
6#ifndef _INC_SIGNAL
7#define _INC_SIGNAL
26 8
27#ifndef _SIGNAL_H_
28#define _SIGNAL_H_
29
30/* All the headers include this file. */
31#include <_mingw.h>9#include <_mingw.h>
32 10
33/*11#ifdef __cplusplus
34 * The actual signal values. Using other values with signal12extern "C" {
35 * produces a SIG_ERR return value.13#endif
36 *
37 * NOTE: SIGINT is produced when the user presses Ctrl-C.
38 * SIGILL has not been tested.
39 * SIGFPE doesn't seem to work?
40 * SIGSEGV does not catch writing to a NULL pointer (that shuts down
41 * your app; can you say "segmentation violation core dump"?).
42 * SIGTERM comes from what kind of termination request exactly?
43 * SIGBREAK is indeed produced by pressing Ctrl-Break.
44 * SIGABRT is produced by calling abort.
45 * TODO: The above results may be related to not installing an appropriate
46 * structured exception handling frame. Results may be better if I ever
47 * manage to get the SEH stuff down.
48 */
49#define SIGINT 2 /* Interactive attention */
50#define SIGILL 4 /* Illegal instruction */
51#define SIGFPE 8 /* Floating point error */
52#define SIGSEGV 11 /* Segmentation violation */
53#define SIGTERM 15 /* Termination request */
54#define SIGBREAK 21 /* Control-break */
55#define SIGABRT 22 /* Abnormal termination (abort) */
56
57#define NSIG 23 /* maximum signal number + 1 */
58
59#ifndef RC_INVOKED
60 14
61#ifndef _SIG_ATOMIC_T_DEFINED15#ifndef _SIG_ATOMIC_T_DEFINED
62typedef int sig_atomic_t;
63#define _SIG_ATOMIC_T_DEFINED16#define _SIG_ATOMIC_T_DEFINED
17 typedef int sig_atomic_t;
64#endif18#endif
65 19
66/*20#define NSIG 23
67 * The prototypes (below) are the easy part. The hard part is figuring21
68 * out what signals are available and what numbers they are assigned22#define SIGHUP 1 /* hangup */
69 * along with appropriate values of SIG_DFL and SIG_IGN.23#define SIGINT 2
70 */24#define SIGQUIT 3 /* quit */
25#define SIGILL 4
26#define SIGTRAP 5 /* trace trap (not reset when caught) */
27#define SIGIOT 6 /* IOT instruction */
28#define SIGABRT 6 /* used by abort, replace SIGIOT in the future */
29#define SIGEMT 7 /* EMT instruction */
30#define SIGFPE 8
31#define SIGKILL 9 /* kill (cannot be caught or ignored) */
32#define SIGBUS 10 /* bus error */
33#define SIGSEGV 11
34#define SIGSYS 12 /* bad argument to system call */
35#define SIGPIPE 13 /* write on a pipe with no one to read it */
36#ifdef __USE_MINGW_ALARM
37#define SIGALRM 14 /* alarm clock */
38#endif
39#define SIGTERM 15
40#define SIGBREAK 21
41#define SIGABRT2 22
71 42
72/*43#define SIGABRT_COMPAT 6
73 * A pointer to a signal handler function. A signal handler takes a
74 * single int, which is the signal it handles.
75 */
76typedef void (*__p_sig_fn_t)(int);
77 44
78/*45 typedef void (*__p_sig_fn_t)(int);
79 * These are special values of signal handler pointers which are
80 * used to send a signal to the default handler (SIG_DFL), ignore
81 * the signal (SIG_IGN), or indicate an error return (SIG_ERR).
82 */
83#define SIG_DFL ((__p_sig_fn_t) 0)
84#define SIG_IGN ((__p_sig_fn_t) 1)
85#define SIG_ERR ((__p_sig_fn_t) -1)
86 46
87#ifdef __cplusplus47#define SIG_DFL (__p_sig_fn_t)0
88extern "C" {48#define SIG_IGN (__p_sig_fn_t)1
89#endif49#define SIG_GET (__p_sig_fn_t)2
50#define SIG_SGE (__p_sig_fn_t)3
51#define SIG_ACK (__p_sig_fn_t)4
52#define SIG_ERR (__p_sig_fn_t)-1
90 53
91/*54 extern void **__cdecl __pxcptinfoptrs(void);
92 * Call signal to set the signal handler for signal sig to the55#define _pxcptinfoptrs (*__pxcptinfoptrs())
93 * function pointed to by handler. Returns a pointer to the
94 * previous handler, or SIG_ERR if an error occurs. Initially
95 * unhandled signals defined above will return SIG_DFL.
96 */
97__p_sig_fn_t signal(int, __p_sig_fn_t);
98 56
99/*57 __p_sig_fn_t __cdecl signal(int _SigNum,__p_sig_fn_t _Func);
100 * Raise the signal indicated by sig. Returns non-zero on success.58 int __cdecl raise(int _SigNum);
101 */
102int raise (int);
103 59
104#ifdef __cplusplus60#ifdef __cplusplus
105}61}
106#endif62#endif
107 63#endif
108#endif /* Not RC_INVOKED */
109
110#endif /* Not _SIGNAL_H_ */
111
win32/include/stdarg.h+0−19
@@ -1,19 +0,0 @@
1#ifndef _STDARG_H
2#define _STDARG_H
3
4#ifndef _VA_LIST
5#define _VA_LIST
6typedef char *va_list;
7#endif
8
9/* only correct for i386 */
10#define va_start(ap,last) ap = ((char *)&(last)) + ((sizeof(last)+3)&~3)
11#define va_arg(ap,type) (ap += (sizeof(type)+3)&~3, *(type *)(ap - ((sizeof(type)+3)&~3)))
12#define va_copy(dest, src) (dest) = (src)
13#define va_end(ap)
14
15/* fix a buggy dependency on GCC in libio.h */
16typedef va_list __gnuc_va_list;
17#define _VA_LIST_DEFINED
18
19#endif
win32/include/stdbool.h+0−10
@@ -1,10 +0,0 @@
1#ifndef _STDBOOL_H
2#define _STDBOOL_H
3
4/* ISOC99 boolean */
5
6#define bool _Bool
7#define true 1
8#define false 0
9
10#endif /* _STDBOOL_H */
win32/include/stddef.h+0−23
@@ -1,23 +0,0 @@
1#ifndef _STDDEF_H
2#define _STDDEF_H
3
4#define NULL ((void *)0)
5typedef __SIZE_TYPE__ size_t;
6typedef __WCHAR_TYPE__ wchar_t;
7typedef __PTRDIFF_TYPE__ ptrdiff_t;
8#define offsetof(type, field) ((size_t) &((type *)0)->field)
9
10/* need to do that because of glibc 2.1 bug (should have a way to test
11 presence of 'long long' without __GNUC__, or TCC should define
12 __GNUC__ ? */
13#if !defined(__int8_t_defined) && !defined(__dietlibc__)
14#define __int8_t_defined
15typedef char int8_t;
16typedef short int int16_t;
17typedef int int32_t;
18typedef long long int int64_t;
19#endif
20
21void *alloca(size_t);
22
23#endif
win32/include/stdint.h+41−16
@@ -1,3 +1,8 @@
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 */
1/* ISO C9x 7.18 Integer types <stdint.h>6/* ISO C9x 7.18 Integer types <stdint.h>
2 * Based on ISO/IEC SC22/WG14 9899 Committee draft (SC22 N2794)7 * Based on ISO/IEC SC22/WG14 9899 Committee draft (SC22 N2794)
3 *8 *
@@ -20,6 +25,12 @@ · 16 unmodified lines
20#ifndef _STDINT_H25#ifndef _STDINT_H
21#define _STDINT_H26#define _STDINT_H
22 27
28#include <_mingw.h>
29
30#define __need_wint_t
31#define __need_wchar_t
32#include "stddef.h"
33
23/* 7.18.1.1 Exact-width integer types */34/* 7.18.1.1 Exact-width integer types */
24typedef signed char int8_t;35typedef signed char int8_t;
25typedef unsigned char uint8_t;36typedef unsigned char uint8_t;
@@ -40,9 +51,9 @@ typedef unsigned uint_least32_t; · 14 unmodified lines
40typedef long long int_least64_t;51typedef long long int_least64_t;
41typedef unsigned long long uint_least64_t;52typedef unsigned long long uint_least64_t;
42 53
43/* 7.18.1.3 Fastest minimum-width integer types 54/* 7.18.1.3 Fastest minimum-width integer types
44 * Not actually guaranteed to be fastest for all purposes55 * Not actually guaranteed to be fastest for all purposes
45 * Here we use the exact-width types for 8 and 16-bit ints. 56 * Here we use the exact-width types for 8 and 16-bit ints.
46 */57 */
47typedef char int_fast8_t;58typedef char int_fast8_t;
48typedef unsigned char uint_fast8_t;59typedef unsigned char uint_fast8_t;
@@ -53,10 +64,6 @@ typedef unsigned int uint_fast32_t; · 4 unmodified lines
53typedef long long int_fast64_t;64typedef long long int_fast64_t;
54typedef unsigned long long uint_fast64_t;65typedef unsigned long long uint_fast64_t;
55 66
56/* 7.18.1.4 Integer types capable of holding object pointers */
57typedef int intptr_t;
58typedef unsigned uintptr_t;
59
60/* 7.18.1.5 Greatest-width integer types */67/* 7.18.1.5 Greatest-width integer types */
61typedef long long intmax_t;68typedef long long intmax_t;
62typedef unsigned long long uintmax_t;69typedef unsigned long long uintmax_t;
@@ -65,7 +72,7 @@ typedef unsigned long long uintmax_t; · 2 unmodified lines
65#if !defined ( __cplusplus) || defined (__STDC_LIMIT_MACROS)72#if !defined ( __cplusplus) || defined (__STDC_LIMIT_MACROS)
66 73
67/* 7.18.2.1 Limits of exact-width integer types */74/* 7.18.2.1 Limits of exact-width integer types */
68#define INT8_MIN (-128) 75#define INT8_MIN (-128)
69#define INT16_MIN (-32768)76#define INT16_MIN (-32768)
70#define INT32_MIN (-2147483647 - 1)77#define INT32_MIN (-2147483647 - 1)
71#define INT64_MIN (-9223372036854775807LL - 1)78#define INT64_MIN (-9223372036854775807LL - 1)
@@ -113,10 +120,16 @@ typedef unsigned long long uintmax_t; · 41 unmodified lines
113#define UINT_FAST64_MAX UINT64_MAX120#define UINT_FAST64_MAX UINT64_MAX
114 121
115/* 7.18.2.4 Limits of integer types capable of holding122/* 7.18.2.4 Limits of integer types capable of holding
116 object pointers */ 123 object pointers */
124#ifdef _WIN64
125#define INTPTR_MIN INT64_MIN
126#define INTPTR_MAX INT64_MAX
127#define UINTPTR_MAX UINT64_MAX
128#else
117#define INTPTR_MIN INT32_MIN129#define INTPTR_MIN INT32_MIN
118#define INTPTR_MAX INT32_MAX130#define INTPTR_MAX INT32_MAX
119#define UINTPTR_MAX UINT32_MAX131#define UINTPTR_MAX UINT32_MAX
132#endif
120 133
121/* 7.18.2.5 Limits of greatest-width integer types */134/* 7.18.2.5 Limits of greatest-width integer types */
122#define INTMAX_MIN INT64_MIN135#define INTMAX_MIN INT64_MIN
@@ -124,25 +137,35 @@ typedef unsigned long long uintmax_t; · 1 unmodified line
124#define UINTMAX_MAX UINT64_MAX137#define UINTMAX_MAX UINT64_MAX
125 138
126/* 7.18.3 Limits of other integer types */139/* 7.18.3 Limits of other integer types */
140#ifdef _WIN64
141#define PTRDIFF_MIN INT64_MIN
142#define PTRDIFF_MAX INT64_MAX
143#else
127#define PTRDIFF_MIN INT32_MIN144#define PTRDIFF_MIN INT32_MIN
128#define PTRDIFF_MAX INT32_MAX145#define PTRDIFF_MAX INT32_MAX
146#endif
129 147
130#define SIG_ATOMIC_MIN INT32_MIN148#define SIG_ATOMIC_MIN INT32_MIN
131#define SIG_ATOMIC_MAX INT32_MAX149#define SIG_ATOMIC_MAX INT32_MAX
132 150
151#ifndef SIZE_MAX
152#ifdef _WIN64
153#define SIZE_MAX UINT64_MAX
154#else
133#define SIZE_MAX UINT32_MAX155#define SIZE_MAX UINT32_MAX
156#endif
157#endif
134 158
135#ifndef WCHAR_MIN /* also in wchar.h */ 159#ifndef WCHAR_MIN /* also in wchar.h */
136#define WCHAR_MIN 0160#define WCHAR_MIN 0
137#define WCHAR_MAX ((wchar_t)-1) /* UINT16_MAX */161#define WCHAR_MAX ((wchar_t)-1) /* UINT16_MAX */
138#endif162#endif
139 163
140/*164/*
141 * wint_t is unsigned int in __MINGW32__,165 * wint_t is unsigned short for compatibility with MS runtime
142 * but unsigned short in MS runtime
143 */166 */
144#define WINT_MIN 0167#define WINT_MIN 0
145#define WINT_MAX UINT32_MAX168#define WINT_MAX ((wint_t)-1) /* UINT16_MAX */
146 169
147#endif /* !defined ( __cplusplus) || defined __STDC_LIMIT_MACROS */170#endif /* !defined ( __cplusplus) || defined __STDC_LIMIT_MACROS */
148 171
@@ -168,16 +191,18 @@ typedef unsigned long long uintmax_t; · 19 unmodified lines
168#define INT8_C(val) (INT_LEAST8_MAX-INT_LEAST8_MAX+(val))191#define INT8_C(val) (INT_LEAST8_MAX-INT_LEAST8_MAX+(val))
169#define INT16_C(val) (INT_LEAST16_MAX-INT_LEAST16_MAX+(val))192#define INT16_C(val) (INT_LEAST16_MAX-INT_LEAST16_MAX+(val))
170#define INT32_C(val) (INT_LEAST32_MAX-INT_LEAST32_MAX+(val))193#define INT32_C(val) (INT_LEAST32_MAX-INT_LEAST32_MAX+(val))
171#define INT64_C(val) (INT_LEAST64_MAX-INT_LEAST64_MAX+(val))194/* The 'trick' doesn't work in C89 for long long because, without
195 suffix, (val) will be evaluated as int, not intmax_t */
196#define INT64_C(val) val##LL
172 197
173#define UINT8_C(val) (UINT_LEAST8_MAX-UINT_LEAST8_MAX+(val))198#define UINT8_C(val) (UINT_LEAST8_MAX-UINT_LEAST8_MAX+(val))
174#define UINT16_C(val) (UINT_LEAST16_MAX-UINT_LEAST16_MAX+(val))199#define UINT16_C(val) (UINT_LEAST16_MAX-UINT_LEAST16_MAX+(val))
175#define UINT32_C(val) (UINT_LEAST32_MAX-UINT_LEAST32_MAX+(val))200#define UINT32_C(val) (UINT_LEAST32_MAX-UINT_LEAST32_MAX+(val))
176#define UINT64_C(val) (UINT_LEAST64_MAX-UINT_LEAST64_MAX+(val))201#define UINT64_C(val) val##ULL
177 202
178/* 7.18.4.2 Macros for greatest-width integer constants */203/* 7.18.4.2 Macros for greatest-width integer constants */
179#define INTMAX_C(val) (INTMAX_MAX-INTMAX_MAX+(val))204#define INTMAX_C(val) val##LL
180#define UINTMAX_C(val) (UINTMAX_MAX-UINTMAX_MAX+(val))205#define UINTMAX_C(val) val##ULL
181 206
182#endif /* !defined ( __cplusplus) || defined __STDC_CONSTANT_MACROS */207#endif /* !defined ( __cplusplus) || defined __STDC_CONSTANT_MACROS */
183 208
win32/include/stdio.h+371−355
@@ -1,413 +1,429 @@
1/*1/**
2 * stdio.h2 * This file has no copyright assigned and is placed in the Public Domain.
3 *3 * This file is part of the w64 mingw-runtime package.
4 * Definitions of types and prototypes of functions for standard input and4 * No warranty is given; refer to the file DISCLAIMER within this package.
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 */5 */
6#ifndef _INC_STDIO
7#define _INC_STDIO
30 8
31#ifndef _STDIO_H_
32#define _STDIO_H_
33
34/* All the headers include this file. */
35#include <_mingw.h>9#include <_mingw.h>
36 10
37#define __need_size_t11#pragma pack(push,_CRT_PACKING)
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 12
101/*13#ifdef __cplusplus
102 * The buffer size as used by setbuf such that it is equivalent to14extern "C" {
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#endif15#endif
113 16
114#ifndef SEEK_CUR17#define BUFSIZ 512
115#define SEEK_CUR (1)18#define _NFILE _NSTREAM_
116#endif19#define _NSTREAM_ 512
20#define _IOB_ENTRIES 20
21#define EOF (-1)
117 22
118#ifndef SEEK_END23#ifndef _FILE_DEFINED
119#define SEEK_END (2)24 struct _iobuf {
25 char *_ptr;
26 int _cnt;
27 char *_base;
28 int _flag;
29 int _file;
30 int _charbuf;
31 int _bufsiz;
32 char *_tmpfname;
33 };
34 typedef struct _iobuf FILE;
35#define _FILE_DEFINED
120#endif36#endif
121 37
122 38#ifdef _POSIX_
123#ifndef RC_INVOKED39#define _P_tmpdir "/"
124 40#define _wP_tmpdir L"/"
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
133typedef __builtin_va_list va_list;
134#else41#else
135typedef char* va_list;42#define _P_tmpdir "\\"
43#define _wP_tmpdir L"\\"
136#endif44#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
147typedef 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
166extern FILE (*__imp__iob)[]; /* A pointer to an array of FILE */
167 45
168#define _iob (*__imp__iob) /* An array of FILE */46#define L_tmpnam (sizeof(_P_tmpdir) + 12)
169 47
170#else /* __DECLSPEC_SUPPORTED */48#ifdef _POSIX_
49#define L_ctermid 9
50#define L_cuserid 32
51#endif
171 52
172__MINGW_IMPORT FILE _iob[]; /* An array of FILE imported from DLL. */53#define SEEK_CUR 1
54#define SEEK_END 2
55#define SEEK_SET 0
173 56
174#endif /* __DECLSPEC_SUPPORTED */57#define STDIN_FILENO 0
58#define STDOUT_FILENO 1
59#define STDERR_FILENO 2
175 60
176#define stdin (&_iob[STDIN_FILENO])61#define FILENAME_MAX 260
177#define stdout (&_iob[STDOUT_FILENO])62#define FOPEN_MAX 20
178#define stderr (&_iob[STDERR_FILENO])63#define _SYS_OPEN 20
64#define TMP_MAX 32767
179 65
66#ifndef NULL
180#ifdef __cplusplus67#ifdef __cplusplus
181extern "C" {68#define NULL 0
69#else
70#define NULL ((void *)0)
71#endif
182#endif72#endif
183 73
184/*74#ifndef _OFF_T_DEFINED
185 * File Operations75#define _OFF_T_DEFINED
186 */76#ifndef _OFF_T_
187FILE* fopen (const char*, const char*);77#define _OFF_T_
188FILE* freopen (const char*, const char*, FILE*);78 typedef long _off_t;
189int fflush (FILE*);79#if !defined(NO_OLDNAMES) || defined(_POSIX)
190int fclose (FILE*);80 typedef long off_t;
191/* MS puts remove & rename (but not wide versions) in io.h also */81#endif
192int remove (const char*);82#endif
193int rename (const char*, const char*);
194FILE* tmpfile (void);
195char* tmpnam (char*);
196char* _tempnam (const char*, const char*);
197
198#ifndef NO_OLDNAMES
199char* tempnam (const char*, const char*);
200#endif83#endif
201 84
202int setvbuf (FILE*, char*, int, size_t);85#ifndef _OFF64_T_DEFINED
86#define _OFF64_T_DEFINED
87 typedef long long _off64_t;
88#if !defined(NO_OLDNAMES) || defined(_POSIX)
89 typedef long long off64_t;
90#endif
91#endif
203 92
204void setbuf (FILE*, char*);93#ifndef _STDIO_DEFINED
94#ifdef _WIN64
95 _CRTIMP FILE *__cdecl __iob_func(void);
96#else
97#ifdef _MSVCRT_
98extern FILE _iob[]; /* A pointer to an array of FILE */
99#define __iob_func() (_iob)
100#else
101extern FILE (*_imp___iob)[]; /* A pointer to an array of FILE */
102#define __iob_func() (*_imp___iob)
103#define _iob __iob_func()
104#endif
105#endif
106#endif
205 107
206/*108#ifndef _FPOS_T_DEFINED
207 * Formatted Output109#define _FPOS_T_DEFINED
208 */110#undef _FPOSOFF
209 111
210int fprintf (FILE*, const char*, ...);112#if (!defined(NO_OLDNAMES) || defined(__GNUC__)) && _INTEGRAL_MAX_BITS >= 64
211int printf (const char*, ...);113 typedef __int64 fpos_t;
212int sprintf (char*, const char*, ...);114#define _FPOSOFF(fp) ((long)(fp))
213int _snprintf (char*, size_t, const char*, ...);115#else
214int vfprintf (FILE*, const char*, va_list);116 typedef long long fpos_t;
215int vprintf (const char*, va_list);117#define _FPOSOFF(fp) ((long)(fp))
216int vsprintf (char*, const char*, va_list);118#endif
217int _vsnprintf (char*, size_t, const char*, va_list);
218 119
219#ifndef __NO_ISOCEXT /* externs in libmingwex.a */
220int snprintf(char* s, size_t n, const char* format, ...);
221extern inline int vsnprintf (char* s, size_t n, const char* format,
222 va_list arg)
223 { return _vsnprintf ( s, n, format, arg); }
224#endif120#endif
225 121
226/*122#ifndef _STDSTREAM_DEFINED
227 * Formatted Input123#define _STDSTREAM_DEFINED
228 */
229 124
230int fscanf (FILE*, const char*, ...);125#define stdin (&__iob_func()[0])
231int scanf (const char*, ...);126#define stdout (&__iob_func()[1])
232int sscanf (const char*, const char*, ...);127#define stderr (&__iob_func()[2])
233/*128#endif
234 * Character Input and Output Functions
235 */
236 129
237int fgetc (FILE*);130#define _IOREAD 0x0001
238char* fgets (char*, int, FILE*);131#define _IOWRT 0x0002
239int fputc (int, FILE*);
240int fputs (const char*, FILE*);
241int getc (FILE*);
242int getchar (void);
243char* gets (char*);
244int putc (int, FILE*);
245int putchar (int);
246int puts (const char*);
247int ungetc (int, FILE*);
248
249/*
250 * Direct Input and Output Functions
251 */
252 132
253size_t fread (void*, size_t, size_t, FILE*);133#define _IOFBF 0x0000
254size_t fwrite (const void*, size_t, size_t, FILE*);134#define _IOLBF 0x0040
135#define _IONBF 0x0004
255 136
256/*137#define _IOMYBUF 0x0008
257 * File Positioning Functions138#define _IOEOF 0x0010
258 */139#define _IOERR 0x0020
140#define _IOSTRG 0x0040
141#define _IORW 0x0080
142#ifdef _POSIX_
143#define _IOAPPEND 0x0200
144#endif
259 145
260int fseek (FILE*, long, int);146#define _TWO_DIGIT_EXPONENT 0x1
261long ftell (FILE*);
262void rewind (FILE*);
263 147
264#ifdef __USE_MINGW_FSEEK /* These are in libmingwex.a */148#ifndef _STDIO_DEFINED
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 149
270int __mingw_fseek (FILE *, long, int);150 _CRTIMP int __cdecl _filbuf(FILE *_File);
271int __mingw_fwrite (const void*, size_t, size_t, FILE*);151 _CRTIMP int __cdecl _flsbuf(int _Ch,FILE *_File);
272#define fseek(fp, offset, whence) __mingw_fseek(fp, offset, whence)152#ifdef _POSIX_
273#define fwrite(buffer, size, count, fp) __mingw_fwrite(buffer, size, count, fp)153 _CRTIMP FILE *__cdecl _fsopen(const char *_Filename,const char *_Mode);
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__
287typedef long long fpos_t;
288#else154#else
289typedef long fpos_t;155 _CRTIMP FILE *__cdecl _fsopen(const char *_Filename,const char *_Mode,int _ShFlag);
290#endif156#endif
291 157 void __cdecl clearerr(FILE *_File);
292int fgetpos (FILE*, fpos_t*);158 int __cdecl fclose(FILE *_File);
293int fsetpos (FILE*, const fpos_t*);159 _CRTIMP int __cdecl _fcloseall(void);
294 160#ifdef _POSIX_
295/*161 FILE *__cdecl fdopen(int _FileHandle,const char *_Mode);
296 * Error Functions162#else
297 */163 _CRTIMP FILE *__cdecl _fdopen(int _FileHandle,const char *_Mode);
298 164#endif
299void clearerr (FILE*);165 int __cdecl feof(FILE *_File);
300int feof (FILE*);166 int __cdecl ferror(FILE *_File);
301int ferror (FILE*);167 int __cdecl fflush(FILE *_File);
302void perror (const char*);168 int __cdecl fgetc(FILE *_File);
303 169 _CRTIMP int __cdecl _fgetchar(void);
304 170 int __cdecl fgetpos(FILE *_File ,fpos_t *_Pos);
305#ifndef __STRICT_ANSI__171 char *__cdecl fgets(char *_Buf,int _MaxCount,FILE *_File);
306/*172#ifdef _POSIX_
307 * Pipes173 int __cdecl fileno(FILE *_File);
308 */174#else
309FILE* _popen (const char*, const char*);175 _CRTIMP int __cdecl _fileno(FILE *_File);
310int _pclose (FILE*);176#endif
311 177 _CRTIMP char *__cdecl _tempnam(const char *_DirName,const char *_FilePrefix);
178 _CRTIMP int __cdecl _flushall(void);
179 FILE *__cdecl fopen(const char *_Filename,const char *_Mode);
180 FILE *fopen64(const char *filename,const char *mode);
181 int __cdecl fprintf(FILE *_File,const char *_Format,...);
182 int __cdecl fputc(int _Ch,FILE *_File);
183 _CRTIMP int __cdecl _fputchar(int _Ch);
184 int __cdecl fputs(const char *_Str,FILE *_File);
185 size_t __cdecl fread(void *_DstBuf,size_t _ElementSize,size_t _Count,FILE *_File);
186 FILE *__cdecl freopen(const char *_Filename,const char *_Mode,FILE *_File);
187 int __cdecl fscanf(FILE *_File,const char *_Format,...);
188 int __cdecl fsetpos(FILE *_File,const fpos_t *_Pos);
189 int __cdecl fseek(FILE *_File,long _Offset,int _Origin);
190 int fseeko64(FILE* stream, _off64_t offset, int whence);
191 long __cdecl ftell(FILE *_File);
192 _off64_t ftello64(FILE * stream);
193 int __cdecl _fseeki64(FILE *_File,__int64 _Offset,int _Origin);
194 __int64 __cdecl _ftelli64(FILE *_File);
195 size_t __cdecl fwrite(const void *_Str,size_t _Size,size_t _Count,FILE *_File);
196 int __cdecl getc(FILE *_File);
197 int __cdecl getchar(void);
198 _CRTIMP int __cdecl _getmaxstdio(void);
199 char *__cdecl gets(char *_Buffer);
200 int __cdecl _getw(FILE *_File);
201#ifndef _CRT_PERROR_DEFINED
202#define _CRT_PERROR_DEFINED
203 void __cdecl perror(const char *_ErrMsg);
204#endif
205 _CRTIMP int __cdecl _pclose(FILE *_File);
206 _CRTIMP FILE *__cdecl _popen(const char *_Command,const char *_Mode);
207#if !defined(NO_OLDNAMES) && !defined(popen)
208#define popen _popen
209#define pclose _pclose
210#endif
211 int __cdecl printf(const char *_Format,...);
212 int __cdecl putc(int _Ch,FILE *_File);
213 int __cdecl putchar(int _Ch);
214 int __cdecl puts(const char *_Str);
215 _CRTIMP int __cdecl _putw(int _Word,FILE *_File);
216#ifndef _CRT_DIRECTORY_DEFINED
217#define _CRT_DIRECTORY_DEFINED
218 int __cdecl remove(const char *_Filename);
219 int __cdecl rename(const char *_OldFilename,const char *_NewFilename);
220 _CRTIMP int __cdecl _unlink(const char *_Filename);
312#ifndef NO_OLDNAMES221#ifndef NO_OLDNAMES
313FILE* popen (const char*, const char*);222 int __cdecl unlink(const char *_Filename);
314int pclose (FILE*);223#endif
224#endif
225 void __cdecl rewind(FILE *_File);
226 _CRTIMP int __cdecl _rmtmp(void);
227 int __cdecl scanf(const char *_Format,...);
228 void __cdecl setbuf(FILE *_File,char *_Buffer);
229 _CRTIMP int __cdecl _setmaxstdio(int _Max);
230 _CRTIMP unsigned int __cdecl _set_output_format(unsigned int _Format);
231 _CRTIMP unsigned int __cdecl _get_output_format(void);
232 int __cdecl setvbuf(FILE *_File,char *_Buf,int _Mode,size_t _Size);
233 _CRTIMP int __cdecl _scprintf(const char *_Format,...);
234 int __cdecl sscanf(const char *_Src,const char *_Format,...);
235 _CRTIMP int __cdecl _snscanf(const char *_Src,size_t _MaxCount,const char *_Format,...);
236 FILE *__cdecl tmpfile(void);
237 char *__cdecl tmpnam(char *_Buffer);
238 int __cdecl ungetc(int _Ch,FILE *_File);
239 int __cdecl vfprintf(FILE *_File,const char *_Format,va_list _ArgList);
240 int __cdecl vprintf(const char *_Format,va_list _ArgList);
241 /* Make sure macros are not defined. */
242#pragma push_macro("vsnprintf")
243#pragma push_macro("snprintf")
244 #undef vsnprintf
245 #undef snprintf
246 extern
247 __attribute__((format(gnu_printf, 3, 0))) __attribute__((nonnull (3)))
248 int __mingw_vsnprintf(char *_DstBuf,size_t _MaxCount,const char *_Format,va_list _ArgList);
249 extern
250 __attribute__((format(gnu_printf, 3, 4))) __attribute__((nonnull (3)))
251 int __mingw_snprintf(char* s, size_t n, const char* format, ...);
252 int __cdecl vsnprintf(char *_DstBuf,size_t _MaxCount,const char *_Format,va_list _ArgList);
253 _CRTIMP int __cdecl _snprintf(char *_Dest,size_t _Count,const char *_Format,...);
254 _CRTIMP int __cdecl _vsnprintf(char *_Dest,size_t _Count,const char *_Format,va_list _Args);
255 int __cdecl sprintf(char *_Dest,const char *_Format,...);
256 int __cdecl vsprintf(char *_Dest,const char *_Format,va_list _Args);
257#ifndef __NO_ISOCEXT /* externs in libmingwex.a */
258 int __cdecl snprintf(char* s, size_t n, const char* format, ...);
259 __CRT_INLINE int __cdecl vsnprintf (char* s, size_t n, const char* format,va_list arg) {
260 return _vsnprintf ( s, n, format, arg);
261 }
262 int __cdecl vscanf(const char * Format, va_list argp);
263 int __cdecl vfscanf (FILE * fp, const char * Format,va_list argp);
264 int __cdecl vsscanf (const char * _Str,const char * Format,va_list argp);
315#endif265#endif
266/* Restore may prior defined macros snprintf/vsnprintf. */
267#pragma pop_macro("snprintf")
268#pragma pop_macro("vsnprintf")
269/* Check if vsnprintf and snprintf are defaulting to gnu-style. */
270 #if defined(USE_MINGW_GNU_SNPRINTF) && USE_MINGW_GNU_SNPRINTF
271 #ifndef vsnprint
272 #define vsnprintf __mingw_vsnprintf
273 #endif
274 #ifndef snprintf
275 #define snprintf __mingw_snprintf
276 #endif
277 #endif
278 _CRTIMP int __cdecl _vscprintf(const char *_Format,va_list _ArgList);
279 _CRTIMP int __cdecl _set_printf_count_output(int _Value);
280 _CRTIMP int __cdecl _get_printf_count_output(void);
316 281
317/*282#ifndef _WSTDIO_DEFINED
318 * Other Non ANSI functions
319 */
320int _flushall (void);
321int _fgetchar (void);
322int _fputchar (int);
323FILE* _fdopen (int, const char*);
324int _fileno (FILE*);
325 283
326#ifndef _NO_OLDNAMES284#ifndef WEOF
327int fgetchar (void);285#define WEOF (wint_t)(0xFFFF)
328int fputchar (int);286#endif
329FILE* fdopen (int, const char*);
330int fileno (FILE*);
331#endif /* Not _NO_OLDNAMES */
332 287
333#endif /* Not __STRICT_ANSI__ */288#ifdef _POSIX_
289 _CRTIMP FILE *__cdecl _wfsopen(const wchar_t *_Filename,const wchar_t *_Mode);
290#else
291 _CRTIMP FILE *__cdecl _wfsopen(const wchar_t *_Filename,const wchar_t *_Mode,int _ShFlag);
292#endif
293 wint_t __cdecl fgetwc(FILE *_File);
294 _CRTIMP wint_t __cdecl _fgetwchar(void);
295 wint_t __cdecl fputwc(wchar_t _Ch,FILE *_File);
296 _CRTIMP wint_t __cdecl _fputwchar(wchar_t _Ch);
297 wint_t __cdecl getwc(FILE *_File);
298 wint_t __cdecl getwchar(void);
299 wint_t __cdecl putwc(wchar_t _Ch,FILE *_File);
300 wint_t __cdecl putwchar(wchar_t _Ch);
301 wint_t __cdecl ungetwc(wint_t _Ch,FILE *_File);
302 wchar_t *__cdecl fgetws(wchar_t *_Dst,int _SizeInWords,FILE *_File);
303 int __cdecl fputws(const wchar_t *_Str,FILE *_File);
304 _CRTIMP wchar_t *__cdecl _getws(wchar_t *_String);
305 _CRTIMP int __cdecl _putws(const wchar_t *_Str);
306 int __cdecl fwprintf(FILE *_File,const wchar_t *_Format,...);
307 int __cdecl wprintf(const wchar_t *_Format,...);
308 _CRTIMP int __cdecl _scwprintf(const wchar_t *_Format,...);
309 int __cdecl vfwprintf(FILE *_File,const wchar_t *_Format,va_list _ArgList);
310 int __cdecl vwprintf(const wchar_t *_Format,va_list _ArgList);
311 _CRTIMP int __cdecl swprintf(wchar_t*, const wchar_t*, ...);
312 _CRTIMP int __cdecl vswprintf(wchar_t*, const wchar_t*,va_list);
313 _CRTIMP int __cdecl _swprintf_c(wchar_t *_DstBuf,size_t _SizeInWords,const wchar_t *_Format,...);
314 _CRTIMP int __cdecl _vswprintf_c(wchar_t *_DstBuf,size_t _SizeInWords,const wchar_t *_Format,va_list _ArgList);
315 _CRTIMP int __cdecl _snwprintf(wchar_t *_Dest,size_t _Count,const wchar_t *_Format,...);
316 _CRTIMP int __cdecl _vsnwprintf(wchar_t *_Dest,size_t _Count,const wchar_t *_Format,va_list _Args);
317#ifndef __NO_ISOCEXT /* externs in libmingwex.a */
318 int __cdecl snwprintf (wchar_t* s, size_t n, const wchar_t* format, ...);
319 __CRT_INLINE int __cdecl vsnwprintf (wchar_t* s, size_t n, const wchar_t* format, va_list arg) { return _vsnwprintf(s,n,format,arg); }
320 int __cdecl vwscanf (const wchar_t *, va_list);
321 int __cdecl vfwscanf (FILE *,const wchar_t *,va_list);
322 int __cdecl vswscanf (const wchar_t *,const wchar_t *,va_list);
323#endif
324 _CRTIMP int __cdecl _swprintf(wchar_t *_Dest,const wchar_t *_Format,...);
325 _CRTIMP int __cdecl _vswprintf(wchar_t *_Dest,const wchar_t *_Format,va_list _Args);
334 326
335/* Wide versions */327#ifndef RC_INVOKED
328#include <vadefs.h>
329#endif
336 330
337#ifndef _WSTDIO_DEFINED331#ifdef _CRT_NON_CONFORMING_SWPRINTFS
338/* also in wchar.h - keep in sync */332#ifndef __cplusplus
339int fwprintf (FILE*, const wchar_t*, ...);333#define swprintf _swprintf
340int wprintf (const wchar_t*, ...);334#define vswprintf _vswprintf
341int swprintf (wchar_t*, const wchar_t*, ...);335#define _swprintf_l __swprintf_l
342int _snwprintf (wchar_t*, size_t, const wchar_t*, ...);336#define _vswprintf_l __vswprintf_l
343int vfwprintf (FILE*, const wchar_t*, va_list);337#endif
344int vwprintf (const wchar_t*, va_list);338#endif
345int vswprintf (wchar_t*, const wchar_t*, va_list);
346int _vsnwprintf (wchar_t*, size_t, const wchar_t*, va_list);
347int fwscanf (FILE*, const wchar_t*, ...);
348int wscanf (const wchar_t*, ...);
349int swscanf (const wchar_t*, const wchar_t*, ...);
350wint_t fgetwc (FILE*);
351wint_t fputwc (wchar_t, FILE*);
352wint_t ungetwc (wchar_t, FILE*);
353#ifdef __MSVCRT__
354wchar_t* fgetws (wchar_t*, int, FILE*);
355int fputws (const wchar_t*, FILE*);
356wint_t getwc (FILE*);
357wint_t getwchar (void);
358wchar_t* _getws (wchar_t*);
359wint_t putwc (wint_t, FILE*);
360int _putws (const wchar_t*);
361wint_t putwchar (wint_t);
362FILE* _wfopen (const wchar_t*, const wchar_t*);
363FILE* _wfreopen (const wchar_t*, const wchar_t*, FILE*);
364FILE* _wfsopen (const wchar_t*, const wchar_t*, int);
365wchar_t* _wtmpnam (wchar_t*);
366wchar_t* _wtempnam (const wchar_t*, const wchar_t*);
367int _wrename (const wchar_t*, const wchar_t*);
368int _wremove (const wchar_t*);
369void _wperror (const wchar_t*);
370FILE* _wpopen (const wchar_t*, const wchar_t*);
371#endif /* __MSVCRT__ */
372 339
373#ifndef __NO_ISOCEXT /* externs in libmingwex.a */340 _CRTIMP wchar_t *__cdecl _wtempnam(const wchar_t *_Directory,const wchar_t *_FilePrefix);
374int snwprintf(wchar_t* s, size_t n, const wchar_t* format, ...);341 _CRTIMP int __cdecl _vscwprintf(const wchar_t *_Format,va_list _ArgList);
375extern inline int vsnwprintf (wchar_t* s, size_t n, const wchar_t* format,342 int __cdecl fwscanf(FILE *_File,const wchar_t *_Format,...);
376 va_list arg)343 int __cdecl swscanf(const wchar_t *_Src,const wchar_t *_Format,...);
377 { return _vsnwprintf ( s, n, format, arg); }344 _CRTIMP int __cdecl _snwscanf(const wchar_t *_Src,size_t _MaxCount,const wchar_t *_Format,...);
345 int __cdecl wscanf(const wchar_t *_Format,...);
346 _CRTIMP FILE *__cdecl _wfdopen(int _FileHandle ,const wchar_t *_Mode);
347 _CRTIMP FILE *__cdecl _wfopen(const wchar_t *_Filename,const wchar_t *_Mode);
348 _CRTIMP FILE *__cdecl _wfreopen(const wchar_t *_Filename,const wchar_t *_Mode,FILE *_OldFile);
349#ifndef _CRT_WPERROR_DEFINED
350#define _CRT_WPERROR_DEFINED
351 _CRTIMP void __cdecl _wperror(const wchar_t *_ErrMsg);
352#endif
353 _CRTIMP FILE *__cdecl _wpopen(const wchar_t *_Command,const wchar_t *_Mode);
354#if !defined(NO_OLDNAMES) && !defined(wpopen)
355#define wpopen _wpopen
378#endif356#endif
357 _CRTIMP int __cdecl _wremove(const wchar_t *_Filename);
358 _CRTIMP wchar_t *__cdecl _wtmpnam(wchar_t *_Buffer);
359 _CRTIMP wint_t __cdecl _fgetwc_nolock(FILE *_File);
360 _CRTIMP wint_t __cdecl _fputwc_nolock(wchar_t _Ch,FILE *_File);
361 _CRTIMP wint_t __cdecl _ungetwc_nolock(wint_t _Ch,FILE *_File);
379 362
380#define _WSTDIO_DEFINED363#undef _CRT_GETPUTWCHAR_NOINLINE
381#endif /* _WSTDIO_DEFINED */
382 364
383#ifndef __STRICT_ANSI__365#if !defined(__cplusplus) || defined(_CRT_GETPUTWCHAR_NOINLINE)
384#ifdef __MSVCRT__366#define getwchar() fgetwc(stdin)
385#ifndef NO_OLDNAMES367#define putwchar(_c) fputwc((_c),stdout)
386FILE* wpopen (const wchar_t*, const wchar_t*);368#else
387#endif /* not NO_OLDNAMES */369 __CRT_INLINE wint_t __cdecl getwchar() { return (fgetwc(stdin)); }
388#endif /* MSVCRT runtime */370 __CRT_INLINE wint_t __cdecl putwchar(wchar_t _C) { return (fputwc(_C,stdout)); }
371#endif
389 372
390/*373#define getwc(_stm) fgetwc(_stm)
391 * Other Non ANSI wide functions374#define putwc(_c,_stm) fputwc(_c,_stm)
392 */375#define _putwc_nolock(_c,_stm) _fputwc_nolock(_c,_stm)
393wint_t _fgetwchar (void);376#define _getwc_nolock(_stm) _fgetwc_nolock(_stm)
394wint_t _fputwchar (wint_t);377
395int _getw (FILE*);378#define _WSTDIO_DEFINED
396int _putw (int, FILE*);379#endif
397 380
398#ifndef _NO_OLDNAMES381#define _STDIO_DEFINED
399wint_t fgetwchar (void);382#endif
400wint_t fputwchar (wint_t);
401int getw (FILE*);
402int putw (int, FILE*);
403#endif /* Not _NO_OLDNAMES */
404 383
405#endif /* __STRICT_ANSI */384#define _fgetc_nolock(_stream) (--(_stream)->_cnt >= 0 ? 0xff & *(_stream)->_ptr++ : _filbuf(_stream))
385#define _fputc_nolock(_c,_stream) (--(_stream)->_cnt >= 0 ? 0xff & (*(_stream)->_ptr++ = (char)(_c)) : _flsbuf((_c),(_stream)))
386#define _getc_nolock(_stream) _fgetc_nolock(_stream)
387#define _putc_nolock(_c,_stream) _fputc_nolock(_c,_stream)
388#define _getchar_nolock() _getc_nolock(stdin)
389#define _putchar_nolock(_c) _putc_nolock((_c),stdout)
390#define _getwchar_nolock() _getwc_nolock(stdin)
391#define _putwchar_nolock(_c) _putwc_nolock((_c),stdout)
392
393 _CRTIMP void __cdecl _lock_file(FILE *_File);
394 _CRTIMP void __cdecl _unlock_file(FILE *_File);
395 _CRTIMP int __cdecl _fclose_nolock(FILE *_File);
396 _CRTIMP int __cdecl _fflush_nolock(FILE *_File);
397 _CRTIMP size_t __cdecl _fread_nolock(void *_DstBuf,size_t _ElementSize,size_t _Count,FILE *_File);
398 _CRTIMP int __cdecl _fseek_nolock(FILE *_File,long _Offset,int _Origin);
399 _CRTIMP long __cdecl _ftell_nolock(FILE *_File);
400 _CRTIMP int __cdecl _fseeki64_nolock(FILE *_File,__int64 _Offset,int _Origin);
401 _CRTIMP __int64 __cdecl _ftelli64_nolock(FILE *_File);
402 _CRTIMP size_t __cdecl _fwrite_nolock(const void *_DstBuf,size_t _Size,size_t _Count,FILE *_File);
403 _CRTIMP int __cdecl _ungetc_nolock(int _Ch,FILE *_File);
404
405#if !defined(NO_OLDNAMES) || !defined(_POSIX)
406#define P_tmpdir _P_tmpdir
407#define SYS_OPEN _SYS_OPEN
408
409 char *__cdecl tempnam(const char *_Directory,const char *_FilePrefix);
410 int __cdecl fcloseall(void);
411 FILE *__cdecl fdopen(int _FileHandle,const char *_Format);
412 int __cdecl fgetchar(void);
413 int __cdecl fileno(FILE *_File);
414 int __cdecl flushall(void);
415 int __cdecl fputchar(int _Ch);
416 int __cdecl getw(FILE *_File);
417 int __cdecl putw(int _Ch,FILE *_File);
418 int __cdecl rmtmp(void);
419#endif
406 420
407#ifdef __cplusplus421#ifdef __cplusplus
408}422}
409#endif423#endif
410 424
411#endif /* Not RC_INVOKED */425#pragma pack(pop)
426
427#include <sec_api/stdio_s.h>
412 428
413#endif /* _STDIO_H_ */429#endif
win32/include/stdlib.h+502−404
@@ -1,482 +1,580 @@
1/*1/**
2 * stdlib.h2 * This file has no copyright assigned and is placed in the Public Domain.
3 *3 * This file is part of the w64 mingw-runtime package.
4 * Definitions for common types, variables, and functions.4 * No warranty is given; refer to the file DISCLAIMER within this package.
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 */5 */
6#ifndef _INC_STDLIB
7#define _INC_STDLIB
26 8
27#ifndef _STDLIB_H_
28#define _STDLIB_H_
29
30/* All the headers include this file. */
31#include <_mingw.h>9#include <_mingw.h>
10#include <limits.h>
32 11
12#pragma pack(push,_CRT_PACKING)
33 13
34#define __need_size_t14#ifdef __cplusplus
35#define __need_wchar_t15extern "C" {
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#endif16#endif
64 17
65#define _MAX_PATH MAX_PATH18#ifndef NULL
66#define _MAX_DRIVE (3)19#ifdef __cplusplus
67#define _MAX_DIR 25620#define NULL 0
68#define _MAX_FNAME 25621#else
69#define _MAX_EXT 25622#define NULL ((void *)0)
23#endif
24#endif
70 25
71#endif /* Not __STRICT_ANSI__ */26#define EXIT_SUCCESS 0
27#define EXIT_FAILURE 1
72 28
29#ifndef _ONEXIT_T_DEFINED
30#define _ONEXIT_T_DEFINED
73 31
74#ifndef RC_INVOKED32 typedef int (__cdecl *_onexit_t)(void);
75 33
76#ifdef __cplusplus34#ifndef NO_OLDNAMES
77extern "C" {35#define onexit_t _onexit_t
36#endif
78#endif37#endif
79 38
80/*39#ifndef _DIV_T_DEFINED
81 * This seems like a convenient place to declare these variables, which40#define _DIV_T_DEFINED
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 */
86extern int _argc;
87extern char** _argv;
88 41
89/* imports from runtime dll of the above variables */42 typedef struct _div_t {
90#ifdef __MSVCRT__43 int quot;
44 int rem;
45 } div_t;
91 46
92extern int* __p___argc(void);47 typedef struct _ldiv_t {
93extern char*** __p___argv(void);48 long quot;
94extern wchar_t*** __p___wargv(void);49 long rem;
50 } ldiv_t;
51#endif
95 52
96#define __argc (*__p___argc())53#ifndef _CRT_DOUBLE_DEC
97#define __argv (*__p___argv())54#define _CRT_DOUBLE_DEC
98#define __wargv (*__p___wargv())
99 55
100#else /* !MSVCRT */56#pragma pack(4)
57 typedef struct {
58 unsigned char ld[10];
59 } _LDOUBLE;
60#pragma pack()
101 61
102#ifndef __DECLSPEC_SUPPORTED62#define _PTR_LD(x) ((unsigned char *)(&(x)->ld))
103 63
104extern int* __imp___argc_dll;64 typedef struct {
105extern char*** __imp___argv_dll;65 double x;
106#define __argc (*__imp___argc_dll)66 } _CRT_DOUBLE;
107#define __argv (*__imp___argv_dll)
108 67
109#else /* __DECLSPEC_SUPPORTED */68 typedef struct {
69 float f;
70 } _CRT_FLOAT;
110 71
111__MINGW_IMPORT int __argc_dll;72#pragma push_macro("long")
112__MINGW_IMPORT char** __argv_dll;73#undef long
113#define __argc __argc_dll
114#define __argv __argv_dll
115 74
116#endif /* __DECLSPEC_SUPPORTED */75 typedef struct {
76 long double x;
77 } _LONGDOUBLE;
117 78
118#endif /* __MSVCRT */79#pragma pop_macro("long")
119 80
120/*81#pragma pack(4)
121 * Also defined in ctype.h.82 typedef struct {
122 */83 unsigned char ld12[12];
84 } _LDBL12;
85#pragma pack()
86#endif
123 87
124#ifndef MB_CUR_MAX88#define RAND_MAX 0x7fff
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 89
138#ifdef _UWIN90#ifndef MB_CUR_MAX
139#undef errno91#define MB_CUR_MAX ___mb_cur_max_func()
140extern int errno;92#ifndef __mb_cur_max
93#ifdef _MSVCRT_
94 extern int __mb_cur_max;
141#else95#else
142int* _errno(void);96#define __mb_cur_max (*_imp____mb_cur_max)
143#define errno (*_errno())97 extern int *_imp____mb_cur_max;
98#endif
99#endif
100#ifdef _MSVCRT_
101 extern int __mbcur_max;
102#define ___mb_cur_max_func() (__mb_cur_max)
103#else
104 extern int* _imp____mbcur_max;
105#define ___mb_cur_max_func() (*_imp____mb_cur_max)
106#endif
144#endif107#endif
145int* __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 108
167#define environ _environ109#define __max(a,b) (((a) > (b)) ? (a) : (b))
110#define __min(a,b) (((a) < (b)) ? (a) : (b))
168 111
169#ifdef __MSVCRT__112#define _MAX_PATH 260
170/* One of the MSVCRTxx libraries */113#define _MAX_DRIVE 3
171 114#define _MAX_DIR 256
172#ifndef __DECLSPEC_SUPPORTED115#define _MAX_FNAME 256
173 extern int* __imp__sys_nerr;116#define _MAX_EXT 256
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
197extern 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 117
211#ifdef __MSVCRT__118#define _OUT_TO_DEFAULT 0
212/* msvcrtxx.dll */119#define _OUT_TO_STDERR 1
120#define _OUT_TO_MSGBOX 2
121#define _REPORT_ERRMODE 3
213 122
214extern unsigned int* __p__osver(void);123#define _WRITE_ABORT_MSG 0x1
215extern unsigned int* __p__winver(void);124#define _CALL_REPORTFAULT 0x2
216extern unsigned int* __p__winmajor(void);
217extern unsigned int* __p__winminor(void);
218 125
219#define _osver (*__p__osver())126#define _MAX_ENV 32767
220#define _winver (*__p__winver())
221#define _winmajor (*__p__winmajor())
222#define _winminor (*__p__winminor())
223 127
224#else128 typedef void (__cdecl *_purecall_handler)(void);
225/* Not msvcrtxx.dll, thus crtdll.dll */
226
227#ifndef __DECLSPEC_SUPPORTED
228
229extern unsigned int* _imp___osver_dll;
230extern unsigned int* _imp___winver_dll;
231extern unsigned int* _imp___winmajor_dll;
232extern 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. */
258char** __p__pgmptr(void);
259#define _pgmptr (*__p__pgmptr())
260wchar_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
281double atof (const char*);
282int atoi (const char*);
283long atol (const char*);
284int _wtoi (const wchar_t *);
285long _wtol (const wchar_t *);
286
287double strtod (const char*, char**);
288#if !defined __NO_ISOCEXT /* extern stubs in static libmingwex.a */
289extern __inline__ float strtof (const char *nptr, char **endptr)
290 { return (strtod (nptr, endptr));}
291#endif /* __NO_ISOCEXT */
292 129
293long strtol (const char*, char**, int);130 _CRTIMP _purecall_handler __cdecl _set_purecall_handler(_purecall_handler _Handler);
294unsigned long strtoul (const char*, char**, int);131 _CRTIMP _purecall_handler __cdecl _get_purecall_handler(void);
295 132
296#ifndef _WSTDLIB_DEFINED133 typedef void (__cdecl *_invalid_parameter_handler)(const wchar_t *,const wchar_t *,const wchar_t *,unsigned int,uintptr_t);
297/* also declared in wchar.h */134 _invalid_parameter_handler __cdecl _set_invalid_parameter_handler(_invalid_parameter_handler _Handler);
298double wcstod (const wchar_t*, wchar_t**);135 _invalid_parameter_handler __cdecl _get_invalid_parameter_handler(void);
299#if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */
300extern __inline__ float wcstof( const wchar_t *nptr, wchar_t **endptr)
301{ return (wcstod(nptr, endptr)); }
302#endif /* __NO_ISOCEXT */
303 136
304long wcstol (const wchar_t*, wchar_t**, int);137#ifndef _CRT_ERRNO_DEFINED
305unsigned long wcstoul (const wchar_t*, wchar_t**, int);138#define _CRT_ERRNO_DEFINED
306#define _WSTDLIB_DEFINED139 _CRTIMP extern int *__cdecl _errno(void);
140#define errno (*_errno())
141 errno_t __cdecl _set_errno(int _Value);
142 errno_t __cdecl _get_errno(int *_Value);
143#endif
144 _CRTIMP unsigned long *__cdecl __doserrno(void);
145#define _doserrno (*__doserrno())
146 errno_t __cdecl _set_doserrno(unsigned long _Value);
147 errno_t __cdecl _get_doserrno(unsigned long *_Value);
148#ifdef _MSVCRT_
149 extern char *_sys_errlist[];
150 extern int _sys_nerr;
151#else
152 _CRTIMP char *_sys_errlist[1];
153 _CRTIMP int _sys_nerr;
154#endif
155#if (defined(_X86_) && !defined(__x86_64))
156 _CRTIMP int *__cdecl __p___argc(void);
157 _CRTIMP char ***__cdecl __p___argv(void);
158 _CRTIMP wchar_t ***__cdecl __p___wargv(void);
159 _CRTIMP char ***__cdecl __p__environ(void);
160 _CRTIMP wchar_t ***__cdecl __p__wenviron(void);
161 _CRTIMP char **__cdecl __p__pgmptr(void);
162 _CRTIMP wchar_t **__cdecl __p__wpgmptr(void);
163#endif
164#ifndef __argc
165#ifdef _MSVCRT_
166 extern int __argc;
167#else
168#define __argc (*_imp____argc)
169 extern int *_imp____argc;
170#endif
171#endif
172#ifndef __argv
173#ifdef _MSVCRT_
174 extern char **__argv;
175#else
176#define __argv (*_imp____argv)
177 extern char ***_imp____argv;
178#endif
179#endif
180#ifndef __wargv
181#ifdef _MSVCRT_
182 extern wchar_t **__wargv;
183#else
184#define __wargv (*_imp____wargv)
185 extern wchar_t ***_imp____wargv;
186#endif
307#endif187#endif
308 188
309size_t wcstombs (char*, const wchar_t*, size_t);189#ifdef _POSIX_
310int wctomb (char*, wchar_t);190 extern char **environ;
311 191#else
312int mblen (const char*, size_t);192#ifndef _environ
313size_t mbstowcs (wchar_t*, const char*, size_t);193#ifdef _MSVCRT_
314int mbtowc (wchar_t*, const char*, size_t);194 extern char **_environ;
195#else
196#define _environ (*_imp___environ)
197 extern char ***_imp___environ;
198#endif
199#endif
315 200
316int rand (void);201#ifndef _wenviron
317void srand (unsigned int);202#ifdef _MSVCRT_
203 extern wchar_t **_wenviron;
204#else
205#define _wenviron (*_imp___wenviron)
206 extern wchar_t ***_imp___wenviron;
207#endif
208#endif
209#endif
210#ifndef _pgmptr
211#ifdef _MSVCRT_
212 extern char *_pgmptr;
213#else
214#define _pgmptr (*_imp___pgmptr)
215 extern char **_imp___pgmptr;
216#endif
217#endif
318 218
319void* calloc (size_t, size_t);219#ifndef _wpgmptr
320void* malloc (size_t);220#ifdef _MSVCRT_
321void* realloc (void*, size_t);221 extern wchar_t *_wpgmptr;
322void free (void*);222#else
223#define _wpgmptr (*_imp___wpgmptr)
224 extern wchar_t **_imp___wpgmptr;
225#endif
226#endif
227 errno_t __cdecl _get_pgmptr(char **_Value);
228 errno_t __cdecl _get_wpgmptr(wchar_t **_Value);
229#ifndef _fmode
230#ifdef _MSVCRT_
231 extern int _fmode;
232#else
233#define _fmode (*_imp___fmode)
234 extern int *_imp___fmode;
235#endif
236#endif
237 _CRTIMP errno_t __cdecl _set_fmode(int _Mode);
238 _CRTIMP errno_t __cdecl _get_fmode(int *_PMode);
323 239
324void abort (void) _ATTRIB_NORETURN;240#ifndef _osplatform
325void exit (int) _ATTRIB_NORETURN;241#ifdef _MSVCRT_
326int atexit (void (*)(void));242 extern unsigned int _osplatform;
243#else
244#define _osplatform (*_imp___osplatform)
245 extern unsigned int *_imp___osplatform;
246#endif
247#endif
327 248
328int system (const char*);249#ifndef _osver
329char* getenv (const char*);250#ifdef _MSVCRT_
251 extern unsigned int _osver;
252#else
253#define _osver (*_imp___osver)
254 extern unsigned int *_imp___osver;
255#endif
256#endif
330 257
331void* bsearch (const void*, const void*, size_t, size_t, 258#ifndef _winver
332 int (*)(const void*, const void*));259#ifdef _MSVCRT_
333void qsort (const void*, size_t, size_t,260 extern unsigned int _winver;
334 int (*)(const void*, const void*));261#else
262#define _winver (*_imp___winver)
263 extern unsigned int *_imp___winver;
264#endif
265#endif
335 266
336int abs (int);267#ifndef _winmajor
337long labs (long);268#ifdef _MSVCRT_
269 extern unsigned int _winmajor;
270#else
271#define _winmajor (*_imp___winmajor)
272 extern unsigned int *_imp___winmajor;
273#endif
274#endif
338 275
339/*276#ifndef _winminor
340 * div_t and ldiv_t are structures used to return the results of div and277#ifdef _MSVCRT_
341 * ldiv.278 extern unsigned int _winminor;
342 *279#else
343 * NOTE: div and ldiv appear not to work correctly unless280#define _winminor (*_imp___winminor)
344 * -fno-pcc-struct-return is specified. This is included in the281 extern unsigned int *_imp___winminor;
345 * mingw32 specs file.282#endif
346 */283#endif
347typedef struct { int quot, rem; } div_t;
348typedef struct { long quot, rem; } ldiv_t;
349 284
350div_t div (int, int);285 errno_t __cdecl _get_osplatform(unsigned int *_Value);
351ldiv_t ldiv (long, long);286 errno_t __cdecl _get_osver(unsigned int *_Value);
287 errno_t __cdecl _get_winver(unsigned int *_Value);
288 errno_t __cdecl _get_winmajor(unsigned int *_Value);
289 errno_t __cdecl _get_winminor(unsigned int *_Value);
290#ifndef _countof
291#ifndef __cplusplus
292#define _countof(_Array) (sizeof(_Array) / sizeof(_Array[0]))
293#else
294 extern "C++" {
295 template <typename _CountofType,size_t _SizeOfArray> char (*__countof_helper(UNALIGNED _CountofType (&_Array)[_SizeOfArray]))[_SizeOfArray];
296#define _countof(_Array) sizeof(*__countof_helper(_Array))
297 }
298#endif
299#endif
352 300
353#ifndef __STRICT_ANSI__301#ifndef _CRT_TERMINATE_DEFINED
302#define _CRT_TERMINATE_DEFINED
303 void __cdecl __MINGW_NOTHROW exit(int _Code) __MINGW_ATTRIB_NORETURN;
304 _CRTIMP void __cdecl __MINGW_NOTHROW _exit(int _Code) __MINGW_ATTRIB_NORETURN;
305#if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */
306 /* C99 function name */
307 void __cdecl _Exit(int) __MINGW_ATTRIB_NORETURN;
308 __CRT_INLINE __MINGW_ATTRIB_NORETURN void __cdecl _Exit(int status)
309 { _exit(status); }
310#endif
354 311
355/*312#pragma push_macro("abort")
356 * NOTE: Officially the three following functions are obsolete. The Win32 API313#undef abort
357 * functions SetErrorMode, Beep and Sleep are their replacements.314 void __cdecl __declspec(noreturn) abort(void);
358 */315#pragma pop_macro("abort")
359void _beep (unsigned int, unsigned int);
360void _seterrormode (int);
361void _sleep (unsigned long);
362 316
363void _exit (int) _ATTRIB_NORETURN;
364#if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */
365/* C99 function name */
366void _Exit(int) _ATTRIB_NORETURN; /* Declare to get noreturn attribute. */
367extern __inline__ void _Exit(int status)
368 { _exit(status); }
369#endif317#endif
370/* _onexit is MS extension. Use atexit for portability. */
371typedef int (* _onexit_t)(void);
372_onexit_t _onexit( _onexit_t );
373 318
374int _putenv (const char*);319 _CRTIMP unsigned int __cdecl _set_abort_behavior(unsigned int _Flags,unsigned int _Mask);
375void _searchenv (const char*, const char*, char*);
376 320
321#ifndef _CRT_ABS_DEFINED
322#define _CRT_ABS_DEFINED
323 int __cdecl abs(int _X);
324 long __cdecl labs(long _X);
325#endif
377 326
378char* _ecvt (double, int, int*, int*);327#if _INTEGRAL_MAX_BITS >= 64
379char* _fcvt (double, int, int*, int*);328 __int64 __cdecl _abs64(__int64);
380char* _gcvt (double, int, char*);329#endif
330 int __cdecl atexit(void (__cdecl *)(void));
331#ifndef _CRT_ATOF_DEFINED
332#define _CRT_ATOF_DEFINED
333 double __cdecl atof(const char *_String);
334 double __cdecl _atof_l(const char *_String,_locale_t _Locale);
335#endif
336 int __cdecl atoi(const char *_Str);
337 _CRTIMP int __cdecl _atoi_l(const char *_Str,_locale_t _Locale);
338 long __cdecl atol(const char *_Str);
339 _CRTIMP long __cdecl _atol_l(const char *_Str,_locale_t _Locale);
340#ifndef _CRT_ALGO_DEFINED
341#define _CRT_ALGO_DEFINED
342 void *__cdecl bsearch(const void *_Key,const void *_Base,size_t _NumOfElements,size_t _SizeOfElements,int (__cdecl *_PtFuncCompare)(const void *,const void *));
343 void __cdecl qsort(void *_Base,size_t _NumOfElements,size_t _SizeOfElements,int (__cdecl *_PtFuncCompare)(const void *,const void *));
344#endif
345 unsigned short __cdecl _byteswap_ushort(unsigned short _Short);
346 /*unsigned long __cdecl _byteswap_ulong (unsigned long _Long); */
347#if _INTEGRAL_MAX_BITS >= 64
348 unsigned __int64 __cdecl _byteswap_uint64(unsigned __int64 _Int64);
349#endif
350 div_t __cdecl div(int _Numerator,int _Denominator);
351 char *__cdecl getenv(const char *_VarName);
352 _CRTIMP char *__cdecl _itoa(int _Value,char *_Dest,int _Radix);
353#if _INTEGRAL_MAX_BITS >= 64
354 _CRTIMP char *__cdecl _i64toa(__int64 _Val,char *_DstBuf,int _Radix);
355 _CRTIMP char *__cdecl _ui64toa(unsigned __int64 _Val,char *_DstBuf,int _Radix);
356 _CRTIMP __int64 __cdecl _atoi64(const char *_String);
357 _CRTIMP __int64 __cdecl _atoi64_l(const char *_String,_locale_t _Locale);
358 _CRTIMP __int64 __cdecl _strtoi64(const char *_String,char **_EndPtr,int _Radix);
359 _CRTIMP __int64 __cdecl _strtoi64_l(const char *_String,char **_EndPtr,int _Radix,_locale_t _Locale);
360 _CRTIMP unsigned __int64 __cdecl _strtoui64(const char *_String,char **_EndPtr,int _Radix);
361 _CRTIMP unsigned __int64 __cdecl _strtoui64_l(const char *_String,char **_EndPtr,int _Radix,_locale_t _Locale);
362#endif
363 ldiv_t __cdecl ldiv(long _Numerator,long _Denominator);
364 _CRTIMP char *__cdecl _ltoa(long _Value,char *_Dest,int _Radix);
365 int __cdecl mblen(const char *_Ch,size_t _MaxCount);
366 _CRTIMP int __cdecl _mblen_l(const char *_Ch,size_t _MaxCount,_locale_t _Locale);
367 _CRTIMP size_t __cdecl _mbstrlen(const char *_Str);
368 _CRTIMP size_t __cdecl _mbstrlen_l(const char *_Str,_locale_t _Locale);
369 _CRTIMP size_t __cdecl _mbstrnlen(const char *_Str,size_t _MaxCount);
370 _CRTIMP size_t __cdecl _mbstrnlen_l(const char *_Str,size_t _MaxCount,_locale_t _Locale);
371 int __cdecl mbtowc(wchar_t *_DstCh,const char *_SrcCh,size_t _SrcSizeInBytes);
372 _CRTIMP int __cdecl _mbtowc_l(wchar_t *_DstCh,const char *_SrcCh,size_t _SrcSizeInBytes,_locale_t _Locale);
373 size_t __cdecl mbstowcs(wchar_t *_Dest,const char *_Source,size_t _MaxCount);
374 _CRTIMP size_t __cdecl _mbstowcs_l(wchar_t *_Dest,const char *_Source,size_t _MaxCount,_locale_t _Locale);
375 int __cdecl rand(void);
376 _CRTIMP int __cdecl _set_error_mode(int _Mode);
377 void __cdecl srand(unsigned int _Seed);
378 double __cdecl strtod(const char *_Str,char **_EndPtr);
379 float __cdecl strtof(const char *nptr, char **endptr);
380#if !defined __NO_ISOCEXT /* in libmingwex.a */
381 float __cdecl strtof (const char * __restrict__, char ** __restrict__);
382 long double __cdecl strtold(const char * __restrict__, char ** __restrict__);
383#endif /* __NO_ISOCEXT */
384 _CRTIMP double __cdecl _strtod_l(const char *_Str,char **_EndPtr,_locale_t _Locale);
385 long __cdecl strtol(const char *_Str,char **_EndPtr,int _Radix);
386 _CRTIMP long __cdecl _strtol_l(const char *_Str,char **_EndPtr,int _Radix,_locale_t _Locale);
387 unsigned long __cdecl strtoul(const char *_Str,char **_EndPtr,int _Radix);
388 _CRTIMP unsigned long __cdecl _strtoul_l(const char *_Str,char **_EndPtr,int _Radix,_locale_t _Locale);
389#ifndef _CRT_SYSTEM_DEFINED
390#define _CRT_SYSTEM_DEFINED
391 int __cdecl system(const char *_Command);
392#endif
393 _CRTIMP char *__cdecl _ultoa(unsigned long _Value,char *_Dest,int _Radix);
394 int __cdecl wctomb(char *_MbCh,wchar_t _WCh);
395 _CRTIMP int __cdecl _wctomb_l(char *_MbCh,wchar_t _WCh,_locale_t _Locale);
396 size_t __cdecl wcstombs(char *_Dest,const wchar_t *_Source,size_t _MaxCount);
397 _CRTIMP size_t __cdecl _wcstombs_l(char *_Dest,const wchar_t *_Source,size_t _MaxCount,_locale_t _Locale);
398
399#ifndef _CRT_ALLOCATION_DEFINED
400#define _CRT_ALLOCATION_DEFINED
401 void *__cdecl calloc(size_t _NumOfElements,size_t _SizeOfElements);
402 void __cdecl free(void *_Memory);
403 void *__cdecl malloc(size_t _Size);
404 void *__cdecl realloc(void *_Memory,size_t _NewSize);
405 _CRTIMP void *__cdecl _recalloc(void *_Memory,size_t _Count,size_t _Size);
406 //_CRTIMP void __cdecl _aligned_free(void *_Memory);
407 //_CRTIMP void *__cdecl _aligned_malloc(size_t _Size,size_t _Alignment);
408 _CRTIMP void *__cdecl _aligned_offset_malloc(size_t _Size,size_t _Alignment,size_t _Offset);
409 _CRTIMP void *__cdecl _aligned_realloc(void *_Memory,size_t _Size,size_t _Alignment);
410 _CRTIMP void *__cdecl _aligned_recalloc(void *_Memory,size_t _Count,size_t _Size,size_t _Alignment);
411 _CRTIMP void *__cdecl _aligned_offset_realloc(void *_Memory,size_t _Size,size_t _Alignment,size_t _Offset);
412 _CRTIMP void *__cdecl _aligned_offset_recalloc(void *_Memory,size_t _Count,size_t _Size,size_t _Alignment,size_t _Offset);
413#endif
381 414
382void _makepath (char*, const char*, const char*, const char*, const char*);415#ifndef _WSTDLIB_DEFINED
383void _splitpath (const char*, char*, char*, char*, char*);416#define _WSTDLIB_DEFINED
384char* _fullpath (char*, const char*, size_t);
385 417
418 _CRTIMP wchar_t *__cdecl _itow(int _Value,wchar_t *_Dest,int _Radix);
419 _CRTIMP wchar_t *__cdecl _ltow(long _Value,wchar_t *_Dest,int _Radix);
420 _CRTIMP wchar_t *__cdecl _ultow(unsigned long _Value,wchar_t *_Dest,int _Radix);
421 double __cdecl wcstod(const wchar_t *_Str,wchar_t **_EndPtr);
422 float __cdecl wcstof(const wchar_t *nptr, wchar_t **endptr);
423#if !defined __NO_ISOCEXT /* in libmingwex.a */
424 float __cdecl wcstof( const wchar_t * __restrict__, wchar_t ** __restrict__);
425 long double __cdecl wcstold(const wchar_t * __restrict__, wchar_t ** __restrict__);
426#endif /* __NO_ISOCEXT */
427 _CRTIMP double __cdecl _wcstod_l(const wchar_t *_Str,wchar_t **_EndPtr,_locale_t _Locale);
428 long __cdecl wcstol(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix);
429 _CRTIMP long __cdecl _wcstol_l(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix,_locale_t _Locale);
430 unsigned long __cdecl wcstoul(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix);
431 _CRTIMP unsigned long __cdecl _wcstoul_l(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix,_locale_t _Locale);
432 _CRTIMP wchar_t *__cdecl _wgetenv(const wchar_t *_VarName);
433#ifndef _CRT_WSYSTEM_DEFINED
434#define _CRT_WSYSTEM_DEFINED
435 _CRTIMP int __cdecl _wsystem(const wchar_t *_Command);
436#endif
437 _CRTIMP double __cdecl _wtof(const wchar_t *_Str);
438 _CRTIMP double __cdecl _wtof_l(const wchar_t *_Str,_locale_t _Locale);
439 _CRTIMP int __cdecl _wtoi(const wchar_t *_Str);
440 _CRTIMP int __cdecl _wtoi_l(const wchar_t *_Str,_locale_t _Locale);
441 _CRTIMP long __cdecl _wtol(const wchar_t *_Str);
442 _CRTIMP long __cdecl _wtol_l(const wchar_t *_Str,_locale_t _Locale);
443
444#if _INTEGRAL_MAX_BITS >= 64
445 _CRTIMP wchar_t *__cdecl _i64tow(__int64 _Val,wchar_t *_DstBuf,int _Radix);
446 _CRTIMP wchar_t *__cdecl _ui64tow(unsigned __int64 _Val,wchar_t *_DstBuf,int _Radix);
447 _CRTIMP __int64 __cdecl _wtoi64(const wchar_t *_Str);
448 _CRTIMP __int64 __cdecl _wtoi64_l(const wchar_t *_Str,_locale_t _Locale);
449 _CRTIMP __int64 __cdecl _wcstoi64(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix);
450 _CRTIMP __int64 __cdecl _wcstoi64_l(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix,_locale_t _Locale);
451 _CRTIMP unsigned __int64 __cdecl _wcstoui64(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix);
452 _CRTIMP unsigned __int64 __cdecl _wcstoui64_l(const wchar_t *_Str ,wchar_t **_EndPtr,int _Radix,_locale_t _Locale);
453#endif
454#endif
386 455
387char* _itoa (int, char*, int);456#ifndef _POSIX_
388char* _ltoa (long, char*, int);457#define _CVTBUFSIZE (309+40)
389char* _ultoa(unsigned long, char*, int);458 _CRTIMP char *__cdecl _fullpath(char *_FullPath,const char *_Path,size_t _SizeInBytes);
390wchar_t* _itow (int, wchar_t*, int);459 _CRTIMP char *__cdecl _ecvt(double _Val,int _NumOfDigits,int *_PtDec,int *_PtSign);
391wchar_t* _ltow (long, wchar_t*, int);460 _CRTIMP char *__cdecl _fcvt(double _Val,int _NumOfDec,int *_PtDec,int *_PtSign);
392wchar_t* _ultow (unsigned long, wchar_t*, int);461 _CRTIMP char *__cdecl _gcvt(double _Val,int _NumOfDigits,char *_DstBuf);
462 _CRTIMP int __cdecl _atodbl(_CRT_DOUBLE *_Result,char *_Str);
463 _CRTIMP int __cdecl _atoldbl(_LDOUBLE *_Result,char *_Str);
464 _CRTIMP int __cdecl _atoflt(_CRT_FLOAT *_Result,char *_Str);
465 _CRTIMP int __cdecl _atodbl_l(_CRT_DOUBLE *_Result,char *_Str,_locale_t _Locale);
466 _CRTIMP int __cdecl _atoldbl_l(_LDOUBLE *_Result,char *_Str,_locale_t _Locale);
467 _CRTIMP int __cdecl _atoflt_l(_CRT_FLOAT *_Result,char *_Str,_locale_t _Locale);
468 unsigned long __cdecl _lrotl(unsigned long _Val,int _Shift);
469 unsigned long __cdecl _lrotr(unsigned long _Val,int _Shift);
470 _CRTIMP void __cdecl _makepath(char *_Path,const char *_Drive,const char *_Dir,const char *_Filename,const char *_Ext);
471 _onexit_t __cdecl _onexit(_onexit_t _Func);
472
473#ifndef _CRT_PERROR_DEFINED
474#define _CRT_PERROR_DEFINED
475 void __cdecl perror(const char *_ErrMsg);
476#endif
477 _CRTIMP int __cdecl _putenv(const char *_EnvString);
478 unsigned int __cdecl _rotl(unsigned int _Val,int _Shift);
479#if _INTEGRAL_MAX_BITS >= 64
480 unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val,int _Shift);
481#endif
482 unsigned int __cdecl _rotr(unsigned int _Val,int _Shift);
483#if _INTEGRAL_MAX_BITS >= 64
484 unsigned __int64 __cdecl _rotr64(unsigned __int64 _Val,int _Shift);
485#endif
486 _CRTIMP void __cdecl _searchenv(const char *_Filename,const char *_EnvVar,char *_ResultPath);
487 _CRTIMP void __cdecl _splitpath(const char *_FullPath,char *_Drive,char *_Dir,char *_Filename,char *_Ext);
488 _CRTIMP void __cdecl _swab(char *_Buf1,char *_Buf2,int _SizeInBytes);
489
490#ifndef _WSTDLIBP_DEFINED
491#define _WSTDLIBP_DEFINED
492 _CRTIMP wchar_t *__cdecl _wfullpath(wchar_t *_FullPath,const wchar_t *_Path,size_t _SizeInWords);
493 _CRTIMP void __cdecl _wmakepath(wchar_t *_ResultPath,const wchar_t *_Drive,const wchar_t *_Dir,const wchar_t *_Filename,const wchar_t *_Ext);
494#ifndef _CRT_WPERROR_DEFINED
495#define _CRT_WPERROR_DEFINED
496 _CRTIMP void __cdecl _wperror(const wchar_t *_ErrMsg);
497#endif
498 _CRTIMP int __cdecl _wputenv(const wchar_t *_EnvString);
499 _CRTIMP void __cdecl _wsearchenv(const wchar_t *_Filename,const wchar_t *_EnvVar,wchar_t *_ResultPath);
500 _CRTIMP void __cdecl _wsplitpath(const wchar_t *_FullPath,wchar_t *_Drive,wchar_t *_Dir,wchar_t *_Filename,wchar_t *_Ext);
501#endif
393 502
394#ifdef __MSVCRT__503 _CRTIMP void __cdecl _beep(unsigned _Frequency,unsigned _Duration) __MINGW_ATTRIB_DEPRECATED;
395__int64 _atoi64(const char *);504 /* Not to be confused with _set_error_mode (int). */
396char* _i64toa(__int64, char *, int);505 _CRTIMP void __cdecl _seterrormode(int _Mode) __MINGW_ATTRIB_DEPRECATED;
397char* _ui64toa(unsigned __int64, char *, int);506 _CRTIMP void __cdecl _sleep(unsigned long _Duration) __MINGW_ATTRIB_DEPRECATED;
398__int64 _wtoi64(const wchar_t *);507#endif
399wchar_t* _i64tow(__int64, wchar_t *, int);
400wchar_t* _ui64tow(unsigned __int64, wchar_t *, int);
401 508
402wchar_t* _wgetenv(const wchar_t*);509#ifndef NO_OLDNAMES
403int _wputenv(const wchar_t*);510#ifndef _POSIX_
404void _wsearchenv(const wchar_t*, const wchar_t*, wchar_t*);511#if 0
405void _wmakepath(wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*);512#ifndef __cplusplus
406void _wsplitpath (const wchar_t*, wchar_t*, wchar_t*, wchar_t*, wchar_t*);513#ifndef NOMINMAX
407wchar_t* _wfullpath (wchar_t*, const wchar_t*, size_t);514#ifndef max
515#define max(a,b) (((a) > (b)) ? (a) : (b))
516#endif
517#ifndef min
518#define min(a,b) (((a) < (b)) ? (a) : (b))
519#endif
520#endif
521#endif
408#endif522#endif
409 523
410#ifndef _NO_OLDNAMES524#define sys_errlist _sys_errlist
525#define sys_nerr _sys_nerr
526#define environ _environ
527 char *__cdecl ecvt(double _Val,int _NumOfDigits,int *_PtDec,int *_PtSign);
528 char *__cdecl fcvt(double _Val,int _NumOfDec,int *_PtDec,int *_PtSign);
529 char *__cdecl gcvt(double _Val,int _NumOfDigits,char *_DstBuf);
530 char *__cdecl itoa(int _Val,char *_DstBuf,int _Radix);
531 char *__cdecl ltoa(long _Val,char *_DstBuf,int _Radix);
532 int __cdecl putenv(const char *_EnvString);
533 void __cdecl swab(char *_Buf1,char *_Buf2,int _SizeInBytes);
534 char *__cdecl ultoa(unsigned long _Val,char *_Dstbuf,int _Radix);
535 onexit_t __cdecl onexit(onexit_t _Func);
536#endif
537#endif
411 538
412int putenv (const char*);539#if !defined __NO_ISOCEXT /* externs in static libmingwex.a */
413void searchenv (const char*, const char*, char*);
414 540
415char* itoa (int, char*, int);541 typedef struct { long long quot, rem; } lldiv_t;
416char* ltoa (long, char*, int);
417 542
418#ifndef _UWIN543 lldiv_t __cdecl lldiv(long long, long long);
419char* ecvt (double, int, int*, int*);
420char* fcvt (double, int, int*, int*);
421char* gcvt (double, int, char*);
422#endif /* _UWIN */
423#endif /* Not _NO_OLDNAMES */
424 544
425#endif /* Not __STRICT_ANSI__ */545 __CRT_INLINE long long __cdecl llabs(long long _j) { return (_j >= 0 ? _j : -_j); }
426 546
427/* C99 names */547 long long __cdecl strtoll(const char* __restrict__, char** __restrict, int);
548 unsigned long long __cdecl strtoull(const char* __restrict__, char** __restrict__, int);
428 549
429#if !defined __NO_ISOCEXT /* externs in static libmingwex.a */550 /* these are stubs for MS _i64 versions */
551 long long __cdecl atoll (const char *);
430 552
431typedef struct { long long quot, rem; } lldiv_t;553#ifndef __STRICT_ANSI__
432 554 long long __cdecl wtoll (const wchar_t *);
433lldiv_t lldiv (long long, long long);555 char *__cdecl lltoa (long long, char *, int);
434 556 char *__cdecl ulltoa (unsigned long long , char *, int);
435extern __inline__ long long llabs(long long _j)557 wchar_t *__cdecl lltow (long long, wchar_t *, int);
436 {return (_j >= 0 ? _j : -_j);}558 wchar_t *__cdecl ulltow (unsigned long long, wchar_t *, int);
437 559
438long long strtoll (const char* __restrict__, char** __restrict, int);560 /* __CRT_INLINE using non-ansi functions */
439unsigned long long strtoull (const char* __restrict__, char** __restrict__, int);561 __CRT_INLINE long long __cdecl atoll (const char * _c) { return _atoi64 (_c); }
440 562 __CRT_INLINE char *__cdecl lltoa (long long _n, char * _c, int _i) { return _i64toa (_n, _c, _i); }
441#if defined (__MSVCRT__) /* these are stubs for MS _i64 versions */ 563 __CRT_INLINE char *__cdecl ulltoa (unsigned long long _n, char * _c, int _i) { return _ui64toa (_n, _c, _i); }
442long long atoll (const char *);564 __CRT_INLINE long long __cdecl wtoll (const wchar_t * _w) { return _wtoi64 (_w); }
443 565 __CRT_INLINE wchar_t *__cdecl lltow (long long _n, wchar_t * _w, int _i) { return _i64tow (_n, _w, _i); }
444#if !defined (__STRICT_ANSI__)566 __CRT_INLINE wchar_t *__cdecl ulltow (unsigned long long _n, wchar_t * _w, int _i) { return _ui64tow (_n, _w, _i); }
445long long wtoll(const wchar_t *);
446char* lltoa(long long, char *, int);
447char* ulltoa(unsigned long long , char *, int);
448wchar_t* lltow(long long, wchar_t *, int);
449wchar_t* ulltow(unsigned long long, wchar_t *, int);
450
451 /* inline using non-ansi functions */
452extern __inline__ long long atoll (const char * _c)
453 { return _atoi64 (_c); }
454extern __inline__ char* lltoa(long long _n, char * _c, int _i)
455 { return _i64toa (_n, _c, _i); }
456extern __inline__ char* ulltoa(unsigned long long _n, char * _c, int _i)
457 { return _ui64toa (_n, _c, _i); }
458extern __inline__ long long wtoll(const wchar_t * _w)
459 { return _wtoi64 (_w); }
460extern __inline__ wchar_t* lltow(long long _n, wchar_t * _w, int _i)
461 { return _i64tow (_n, _w, _i); }
462extern __inline__ wchar_t* ulltow(unsigned long long _n, wchar_t * _w, int _i)
463 { return _ui64tow (_n, _w, _i); }
464#endif /* (__STRICT_ANSI__) */567#endif /* (__STRICT_ANSI__) */
465 568
466#endif /* __MSVCRT__ */
467
468#endif /* !__NO_ISOCEXT */569#endif /* !__NO_ISOCEXT */
469 570
470/*
471 * Undefine the no return attribute used in some function definitions
472 */
473#undef _ATTRIB_NORETURN
474
475#ifdef __cplusplus571#ifdef __cplusplus
476}572}
477#endif573#endif
478 574
479#endif /* Not RC_INVOKED */575#pragma pack(pop)
480 576
481#endif /* Not _STDLIB_H_ */577#include <sec_api/stdlib_s.h>
578#include <malloc.h>
482 579
580#endif
win32/include/string.h+146−188
@@ -1,206 +1,164 @@
1/*1/**
2 * string.h2 * This file has no copyright assigned and is placed in the Public Domain.
3 *3 * This file is part of the w64 mingw-runtime package.
4 * Definitions for memory and string functions.4 * No warranty is given; refer to the file DISCLAIMER within this package.
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 */5 */
6#ifndef _INC_STRING
7#define _INC_STRING
26 8
27#ifndef _STRING_H_
28#define _STRING_H_
29
30/* All the headers include this file. */
31#include <_mingw.h>9#include <_mingw.h>
32 10
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 __cplusplus11#ifdef __cplusplus
46extern "C" {12extern "C" {
47#endif13#endif
48 14
49/*15#ifndef _NLSCMP_DEFINED
50 * Prototypes of the ANSI Standard C library string functions.16#define _NLSCMP_DEFINED
51 */17#define _NLSCMPERROR 2147483647
52void* memchr (const void*, int, size_t);
53int memcmp (const void*, const void*, size_t);
54void* memcpy (void*, const void*, size_t);
55void* memmove (void*, const void*, size_t);
56void* memset (void*, int, size_t);
57char* strcat (char*, const char*);
58char* strchr (const char*, int);
59int strcmp (const char*, const char*);
60int strcoll (const char*, const char*); /* Compare using locale */
61char* strcpy (char*, const char*);
62size_t strcspn (const char*, const char*);
63char* strerror (int); /* NOTE: NOT an old name wrapper. */
64char* _strerror (const char *);
65size_t strlen (const char*);
66char* strncat (char*, const char*, size_t);
67int strncmp (const char*, const char*, size_t);
68char* strncpy (char*, const char*, size_t);
69char* strpbrk (const char*, const char*);
70char* strrchr (const char*, int);
71size_t strspn (const char*, const char*);
72char* strstr (const char*, const char*);
73char* strtok (char*, const char*);
74size_t strxfrm (char*, const char*, size_t);
75
76#ifndef __STRICT_ANSI__
77/*
78 * Extra non-ANSI functions provided by the CRTDLL library
79 */
80void* _memccpy (void*, const void*, int, size_t);
81int _memicmp (const void*, const void*, size_t);
82char* _strdup (const char*);
83int _strcmpi (const char*, const char*);
84int _stricmp (const char*, const char*);
85int _stricoll (const char*, const char*);
86char* _strlwr (char*);
87int _strnicmp (const char*, const char*, size_t);
88char* _strnset (char*, int, size_t);
89char* _strrev (char*);
90char* _strset (char*, int);
91char* _strupr (char*);
92void _swab (const char*, char*, size_t);
93
94/*
95 * Multi-byte character functions
96 */
97unsigned char* _mbschr (unsigned char*, unsigned char*);
98unsigned char* _mbsncat (unsigned char*, const unsigned char*, size_t);
99unsigned char* _mbstok (unsigned char*, unsigned char*);
100
101#ifdef __MSVCRT__
102int _strncoll(const char*, const char*, size_t);
103int _strnicoll(const char*, const char*, size_t);
104#endif18#endif
105 19
106#endif /* Not __STRICT_ANSI__ */20#ifndef NULL
107 21#ifdef __cplusplus
108/*22#define NULL 0
109 * Unicode versions of the standard calls.23#else
110 */24#define NULL ((void *)0)
111wchar_t* wcscat (wchar_t*, const wchar_t*);25#endif
112wchar_t* wcschr (const wchar_t*, wchar_t);
113int wcscmp (const wchar_t*, const wchar_t*);
114int wcscoll (const wchar_t*, const wchar_t*);
115wchar_t* wcscpy (wchar_t*, const wchar_t*);
116size_t wcscspn (const wchar_t*, const wchar_t*);
117/* Note: No wcserror in CRTDLL. */
118size_t wcslen (const wchar_t*);
119wchar_t* wcsncat (wchar_t*, const wchar_t*, size_t);
120int wcsncmp(const wchar_t*, const wchar_t*, size_t);
121wchar_t* wcsncpy(wchar_t*, const wchar_t*, size_t);
122wchar_t* wcspbrk(const wchar_t*, const wchar_t*);
123wchar_t* wcsrchr(const wchar_t*, wchar_t);
124size_t wcsspn(const wchar_t*, const wchar_t*);
125wchar_t* wcsstr(const wchar_t*, const wchar_t*);
126wchar_t* wcstok(wchar_t*, const wchar_t*);
127size_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
137wchar_t* _wcsdup (wchar_t*);
138int _wcsicmp (const wchar_t*, const wchar_t*);
139int _wcsicoll (const wchar_t*, const wchar_t*);
140wchar_t* _wcslwr (wchar_t*);
141int _wcsnicmp (const wchar_t*, const wchar_t*, size_t);
142wchar_t* _wcsnset (wchar_t*, wchar_t, size_t);
143wchar_t* _wcsrev (wchar_t*);
144wchar_t* _wcsset (wchar_t*, wchar_t);
145wchar_t* _wcsupr (wchar_t*);
146
147#ifdef __MSVCRT__
148int _wcsncoll(const wchar_t*, const wchar_t*, size_t);
149int _wcsnicoll(const wchar_t*, const wchar_t*, size_t);
150#endif26#endif
151 27
28#define _WConst_return _CONST_RETURN
29
30#ifndef _CRT_MEMORY_DEFINED
31#define _CRT_MEMORY_DEFINED
32 _CRTIMP void *__cdecl _memccpy(void *_Dst,const void *_Src,int _Val,size_t _MaxCount);
33 _CONST_RETURN void *__cdecl memchr(const void *_Buf ,int _Val,size_t _MaxCount);
34 _CRTIMP int __cdecl _memicmp(const void *_Buf1,const void *_Buf2,size_t _Size);
35 _CRTIMP int __cdecl _memicmp_l(const void *_Buf1,const void *_Buf2,size_t _Size,_locale_t _Locale);
36 int __cdecl memcmp(const void *_Buf1,const void *_Buf2,size_t _Size);
37 void *__cdecl memcpy(void *_Dst,const void *_Src,size_t _Size);
38 void *__cdecl memset(void *_Dst,int _Val,size_t _Size);
39#ifndef NO_OLDNAMES
40 void *__cdecl memccpy(void *_Dst,const void *_Src,int _Val,size_t _Size);
41 int __cdecl memicmp(const void *_Buf1,const void *_Buf2,size_t _Size);
42#endif
43#endif
44 char *__cdecl _strset(char *_Str,int _Val);
45 char *__cdecl strcpy(char *_Dest,const char *_Source);
46 char *__cdecl strcat(char *_Dest,const char *_Source);
47 int __cdecl strcmp(const char *_Str1,const char *_Str2);
48 size_t __cdecl strlen(const char *_Str);
49#if 0
50 size_t __cdecl strnlen(const char *_Str,size_t _MaxCount);
51#endif
52 void *__cdecl memmove(void *_Dst,const void *_Src,size_t _Size);
53 _CRTIMP char *__cdecl _strdup(const char *_Src);
54 _CONST_RETURN char *__cdecl strchr(const char *_Str,int _Val);
55 _CRTIMP int __cdecl _stricmp(const char *_Str1,const char *_Str2);
56 _CRTIMP int __cdecl _strcmpi(const char *_Str1,const char *_Str2);
57 _CRTIMP int __cdecl _stricmp_l(const char *_Str1,const char *_Str2,_locale_t _Locale);
58 int __cdecl strcoll(const char *_Str1,const char *_Str2);
59 _CRTIMP int __cdecl _strcoll_l(const char *_Str1,const char *_Str2,_locale_t _Locale);
60 _CRTIMP int __cdecl _stricoll(const char *_Str1,const char *_Str2);
61 _CRTIMP int __cdecl _stricoll_l(const char *_Str1,const char *_Str2,_locale_t _Locale);
62 _CRTIMP int __cdecl _strncoll (const char *_Str1,const char *_Str2,size_t _MaxCount);
63 _CRTIMP int __cdecl _strncoll_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale);
64 _CRTIMP int __cdecl _strnicoll (const char *_Str1,const char *_Str2,size_t _MaxCount);
65 _CRTIMP int __cdecl _strnicoll_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale);
66 size_t __cdecl strcspn(const char *_Str,const char *_Control);
67 _CRTIMP char *__cdecl _strerror(const char *_ErrMsg);
68 char *__cdecl strerror(int);
69 _CRTIMP char *__cdecl _strlwr(char *_String);
70 char *strlwr_l(char *_String,_locale_t _Locale);
71 char *__cdecl strncat(char *_Dest,const char *_Source,size_t _Count);
72 int __cdecl strncmp(const char *_Str1,const char *_Str2,size_t _MaxCount);
73 _CRTIMP int __cdecl _strnicmp(const char *_Str1,const char *_Str2,size_t _MaxCount);
74 _CRTIMP int __cdecl _strnicmp_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale);
75 char *strncpy(char *_Dest,const char *_Source,size_t _Count);
76 _CRTIMP char *__cdecl _strnset(char *_Str,int _Val,size_t _MaxCount);
77 _CONST_RETURN char *__cdecl strpbrk(const char *_Str,const char *_Control);
78 _CONST_RETURN char *__cdecl strrchr(const char *_Str,int _Ch);
79 _CRTIMP char *__cdecl _strrev(char *_Str);
80 size_t __cdecl strspn(const char *_Str,const char *_Control);
81 _CONST_RETURN char *__cdecl strstr(const char *_Str,const char *_SubStr);
82 char *__cdecl strtok(char *_Str,const char *_Delim);
83 _CRTIMP char *__cdecl _strupr(char *_String);
84 _CRTIMP char *_strupr_l(char *_String,_locale_t _Locale);
85 size_t __cdecl strxfrm(char *_Dst,const char *_Src,size_t _MaxCount);
86 _CRTIMP size_t __cdecl _strxfrm_l(char *_Dst,const char *_Src,size_t _MaxCount,_locale_t _Locale);
87
88#ifndef NO_OLDNAMES
89 char *__cdecl strdup(const char *_Src);
90 int __cdecl strcmpi(const char *_Str1,const char *_Str2);
91 int __cdecl stricmp(const char *_Str1,const char *_Str2);
92 char *__cdecl strlwr(char *_Str);
93 int __cdecl strnicmp(const char *_Str1,const char *_Str,size_t _MaxCount);
94 __CRT_INLINE int __cdecl strncasecmp (const char *__sz1, const char *__sz2, size_t __sizeMaxCompare) { return _strnicmp (__sz1, __sz2, __sizeMaxCompare); }
95 __CRT_INLINE int __cdecl strcasecmp (const char *__sz1, const char *__sz2) { return _stricmp (__sz1, __sz2); }
96 char *__cdecl strnset(char *_Str,int _Val,size_t _MaxCount);
97 char *__cdecl strrev(char *_Str);
98 char *__cdecl strset(char *_Str,int _Val);
99 char *__cdecl strupr(char *_Str);
100#endif
152 101
153#endif /* Not __STRICT_ANSI__ */102#ifndef _WSTRING_DEFINED
154 103#define _WSTRING_DEFINED
155 104
156#ifndef __STRICT_ANSI__105 _CRTIMP wchar_t *__cdecl _wcsdup(const wchar_t *_Str);
157#ifndef _NO_OLDNAMES106 wchar_t *__cdecl wcscat(wchar_t *_Dest,const wchar_t *_Source);
158 107 _CONST_RETURN wchar_t *__cdecl wcschr(const wchar_t *_Str,wchar_t _Ch);
159/*108 int __cdecl wcscmp(const wchar_t *_Str1,const wchar_t *_Str2);
160 * Non-underscored versions of non-ANSI functions. They live in liboldnames.a109 wchar_t *__cdecl wcscpy(wchar_t *_Dest,const wchar_t *_Source);
161 * and provide a little extra portability. Also a few extra UNIX-isms like110 size_t __cdecl wcscspn(const wchar_t *_Str,const wchar_t *_Control);
162 * strcasecmp.111 size_t __cdecl wcslen(const wchar_t *_Str);
163 */112 size_t __cdecl wcsnlen(const wchar_t *_Src,size_t _MaxCount);
164 113 wchar_t *wcsncat(wchar_t *_Dest,const wchar_t *_Source,size_t _Count);
165void* memccpy (void*, const void*, int, size_t);114 int __cdecl wcsncmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount);
166int memicmp (const void*, const void*, size_t);115 wchar_t *wcsncpy(wchar_t *_Dest,const wchar_t *_Source,size_t _Count);
167char* strdup (const char*);116 _CONST_RETURN wchar_t *__cdecl wcspbrk(const wchar_t *_Str,const wchar_t *_Control);
168int strcmpi (const char*, const char*);117 _CONST_RETURN wchar_t *__cdecl wcsrchr(const wchar_t *_Str,wchar_t _Ch);
169int stricmp (const char*, const char*);118 size_t __cdecl wcsspn(const wchar_t *_Str,const wchar_t *_Control);
170int strcasecmp (const char*, const char*);119 _CONST_RETURN wchar_t *__cdecl wcsstr(const wchar_t *_Str,const wchar_t *_SubStr);
171int stricoll (const char*, const char*);120 wchar_t *__cdecl wcstok(wchar_t *_Str,const wchar_t *_Delim);
172char* strlwr (char*);121 _CRTIMP wchar_t *__cdecl _wcserror(int _ErrNum);
173int strnicmp (const char*, const char*, size_t);122 _CRTIMP wchar_t *__cdecl __wcserror(const wchar_t *_Str);
174int strncasecmp (const char*, const char*, size_t);123 _CRTIMP int __cdecl _wcsicmp(const wchar_t *_Str1,const wchar_t *_Str2);
175char* strnset (char*, int, size_t);124 _CRTIMP int __cdecl _wcsicmp_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale);
176char* strrev (char*);125 _CRTIMP int __cdecl _wcsnicmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount);
177char* strset (char*, int);126 _CRTIMP int __cdecl _wcsnicmp_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale);
178char* strupr (char*);127 _CRTIMP wchar_t *__cdecl _wcsnset(wchar_t *_Str,wchar_t _Val,size_t _MaxCount);
179#ifndef _UWIN128 _CRTIMP wchar_t *__cdecl _wcsrev(wchar_t *_Str);
180void swab (const char*, char*, size_t);129 _CRTIMP wchar_t *__cdecl _wcsset(wchar_t *_Str,wchar_t _Val);
181#endif /* _UWIN */130 _CRTIMP wchar_t *__cdecl _wcslwr(wchar_t *_String);
182 131 _CRTIMP wchar_t *_wcslwr_l(wchar_t *_String,_locale_t _Locale);
183/* NOTE: There is no _wcscmpi, but this is for compatibility. */132 _CRTIMP wchar_t *__cdecl _wcsupr(wchar_t *_String);
184int wcscmpi (const wchar_t*, const wchar_t*);133 _CRTIMP wchar_t *_wcsupr_l(wchar_t *_String,_locale_t _Locale);
185wchar_t* wcsdup (wchar_t*);134 size_t __cdecl wcsxfrm(wchar_t *_Dst,const wchar_t *_Src,size_t _MaxCount);
186int wcsicmp (const wchar_t*, const wchar_t*);135 _CRTIMP size_t __cdecl _wcsxfrm_l(wchar_t *_Dst,const wchar_t *_Src,size_t _MaxCount,_locale_t _Locale);
187int wcsicoll (const wchar_t*, const wchar_t*);136 int __cdecl wcscoll(const wchar_t *_Str1,const wchar_t *_Str2);
188wchar_t* wcslwr (wchar_t*);137 _CRTIMP int __cdecl _wcscoll_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale);
189int wcsnicmp (const wchar_t*, const wchar_t*, size_t);138 _CRTIMP int __cdecl _wcsicoll(const wchar_t *_Str1,const wchar_t *_Str2);
190wchar_t* wcsnset (wchar_t*, wchar_t, size_t);139 _CRTIMP int __cdecl _wcsicoll_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale);
191wchar_t* wcsrev (wchar_t*);140 _CRTIMP int __cdecl _wcsncoll(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount);
192wchar_t* wcsset (wchar_t*, wchar_t);141 _CRTIMP int __cdecl _wcsncoll_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale);
193wchar_t* wcsupr (wchar_t*);142 _CRTIMP int __cdecl _wcsnicoll(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount);
194 143 _CRTIMP int __cdecl _wcsnicoll_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale);
195#endif /* Not _NO_OLDNAMES */144
196#endif /* Not strict ANSI */145#ifndef NO_OLDNAMES
197 146 wchar_t *__cdecl wcsdup(const wchar_t *_Str);
147#define wcswcs wcsstr
148 int __cdecl wcsicmp(const wchar_t *_Str1,const wchar_t *_Str2);
149 int __cdecl wcsnicmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount);
150 wchar_t *__cdecl wcsnset(wchar_t *_Str,wchar_t _Val,size_t _MaxCount);
151 wchar_t *__cdecl wcsrev(wchar_t *_Str);
152 wchar_t *__cdecl wcsset(wchar_t *_Str,wchar_t _Val);
153 wchar_t *__cdecl wcslwr(wchar_t *_Str);
154 wchar_t *__cdecl wcsupr(wchar_t *_Str);
155 int __cdecl wcsicoll(const wchar_t *_Str1,const wchar_t *_Str2);
156#endif
157#endif
198 158
199#ifdef __cplusplus159#ifdef __cplusplus
200}160}
201#endif161#endif
202 162
203#endif /* Not RC_INVOKED */163#include <sec_api/string_s.h>
204 164#endif
205#endif /* Not _STRING_H_ */
206
win32/include/sys/fcntl.h+5−0
@@ -1,3 +1,8 @@
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 */
1/*6/*
2 * This file is part of the Mingw32 package.7 * This file is part of the Mingw32 package.
3 *8 *
win32/include/sys/file.h+5−0
@@ -1,3 +1,8 @@
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 */
1/*6/*
2 * This file is part of the Mingw32 package.7 * This file is part of the Mingw32 package.
3 *8 *
win32/include/sys/locking.h+22−44
@@ -1,52 +1,30 @@
1/*1/**
2 * locking.h2 * This file has no copyright assigned and is placed in the Public Domain.
3 *3 * This file is part of the w64 mingw-runtime package.
4 * Constants for the mode parameter of the locking function.4 * No warranty is given; refer to the file DISCLAIMER within this package.
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 */5 */
6#ifndef _INC_LOCKING
7#define _INC_LOCKING
26 8
27#ifndef __STRICT_ANSI__9#ifndef _WIN32
28 10#error Only Win32 target is supported!
29#ifndef _LOCKING_H_11#endif
30#define _LOCKING_H_
31 12
32/* All the headers include this file. */13/* All the headers include this file. */
33#include <_mingw.h>14#include <_mingw.h>
34 15
35#define _LK_UNLCK 0 /* Unlock */16#define _LK_UNLCK 0
36#define _LK_LOCK 1 /* Lock */17#define _LK_LOCK 1
37#define _LK_NBLCK 2 /* Non-blocking lock */18#define _LK_NBLCK 2
38#define _LK_RLCK 3 /* Lock for read only */19#define _LK_RLCK 3
39#define _LK_NBRLCK 4 /* Non-blocking lock for read only */20#define _LK_NBRLCK 4
40 21
41#ifndef NO_OLDNAMES22#ifndef NO_OLDNAMES
42#define LK_UNLCK _LK_UNLCK23#define LK_UNLCK _LK_UNLCK
43#define LK_LOCK _LK_LOCK24#define LK_LOCK _LK_LOCK
44#define LK_NBLCK _LK_NBLCK25#define LK_NBLCK _LK_NBLCK
45#define LK_RLCK _LK_RLCK26#define LK_RLCK _LK_RLCK
46#define LK_NBRLCK _LK_NBRLCK27#define LK_NBRLCK _LK_NBRLCK
47#endif /* Not NO_OLDNAMES */28#endif
48 29
49#endif /* Not _LOCKING_H_ */30#endif
50
51#endif /* Not __STRICT_ANSI__ */
52
win32/include/sys/stat.h+247−149
@@ -1,139 +1,106 @@
1/*1/**
2 * stat.h2 * This file has no copyright assigned and is placed in the Public Domain.
3 *3 * This file is part of the w64 mingw-runtime package.
4 * Symbolic constants for opening and creating files, also stat, fstat and4 * No warranty is given; refer to the file DISCLAIMER within this package.
5 * chmod functions.
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 *
12 * THIS SOFTWARE IS NOT COPYRIGHTED
13 *
14 * This source code is offered for use in the public domain. You may
15 * use, modify or distribute it freely.
16 *
17 * This code is distributed in the hope that it will be useful but
18 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
19 * DISCLAIMED. This includes but is not limited to warranties of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 *
22 * $Revision: 1.2 $
23 * $Author: bellard $
24 * $Date: 2005/04/17 13:14:29 $
25 *
26 */5 */
6#ifndef _INC_STAT
7#define _INC_STAT
27 8
28#ifndef __STRICT_ANSI__9#ifndef _WIN32
29 10#error Only Win32 target is supported!
30#ifndef _STAT_H_11#endif
31#define _STAT_H_
32 12
33/* All the headers include this file. */
34#include <_mingw.h>13#include <_mingw.h>
14#include <io.h>
35 15
36#define __need_size_t16#pragma pack(push,_CRT_PACKING)
37#define __need_wchar_t
38#ifndef RC_INVOKED
39#include <stddef.h>
40#endif /* Not RC_INVOKED */
41 17
42#include <sys/types.h>18#ifdef __cplusplus
19extern "C" {
20#endif
43 21
44/*22#ifndef _CRTIMP
45 * Constants for the stat st_mode member.23#define _CRTIMP __declspec(dllimport)
46 */24#endif
47#define _S_IFIFO 0x1000 /* FIFO */
48#define _S_IFCHR 0x2000 /* Character */
49#define _S_IFBLK 0x3000 /* Block: Is this ever set under w32? */
50#define _S_IFDIR 0x4000 /* Directory */
51#define _S_IFREG 0x8000 /* Regular */
52 25
53#define _S_IFMT 0xF000 /* File type mask */26#include <sys/types.h>
54 27
55#define _S_IEXEC 0x004028#ifdef _USE_32BIT_TIME_T
56#define _S_IWRITE 0x008029#ifdef _WIN64
57#define _S_IREAD 0x010030#undef _USE_32BIT_TIME_T
31#endif
32#else
33#if _INTEGRAL_MAX_BITS < 64
34#define _USE_32BIT_TIME_T
35#endif
36#endif
58 37
59#define _S_IRWXU (_S_IREAD | _S_IWRITE | _S_IEXEC)38#ifndef _TIME32_T_DEFINED
60#define _S_IXUSR _S_IEXEC39 typedef long __time32_t;
61#define _S_IWUSR _S_IWRITE40#define _TIME32_T_DEFINED
62#define _S_IRUSR _S_IREAD41#endif
63 42
64#define _S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR)43#ifndef _TIME64_T_DEFINED
65#define _S_ISFIFO(m) (((m) & _S_IFMT) == _S_IFIFO)44#if _INTEGRAL_MAX_BITS >= 64
66#define _S_ISCHR(m) (((m) & _S_IFMT) == _S_IFCHR)45 typedef __int64 __time64_t;
67#define _S_ISBLK(m) (((m) & _S_IFMT) == _S_IFBLK)46#endif
68#define _S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)47#define _TIME64_T_DEFINED
48#endif
69 49
70#ifndef _NO_OLDNAMES50#ifndef _TIME_T_DEFINED
51#ifdef _USE_32BIT_TIME_T
52 typedef __time32_t time_t;
53#else
54 typedef __time64_t time_t;
55#endif
56#define _TIME_T_DEFINED
57#endif
71 58
72#define S_IFIFO _S_IFIFO59#ifndef _WCHAR_T_DEFINED
73#define S_IFCHR _S_IFCHR60 typedef unsigned short wchar_t;
74#define S_IFBLK _S_IFBLK61#define _WCHAR_T_DEFINED
75#define S_IFDIR _S_IFDIR62#endif
76#define S_IFREG _S_IFREG
77#define S_IFMT _S_IFMT
78#define S_IEXEC _S_IEXEC
79#define S_IWRITE _S_IWRITE
80#define S_IREAD _S_IREAD
81#define S_IRWXU _S_IRWXU
82#define S_IXUSR _S_IXUSR
83#define S_IWUSR _S_IWUSR
84#define S_IRUSR _S_IRUSR
85 63
86#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)64#ifndef _STAT_DEFINED
87#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
88#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
89#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
90#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
91 65
92#endif /* Not _NO_OLDNAMES */66#ifdef _USE_32BIT_TIME_T
67#ifndef _WIN64
68#define _fstat32 _fstat
69#define _stat32 _stat
70#define _wstat32 _wstat
71#else
72#define _fstat _fstat32
73#define _stat _stat32
74#define _wstat _wstat32
75#endif
76#define _fstati64 _fstat32i64
77#define _stati64 _stat32i64
78#define _wstati64 _wstat32i64
79#else
80#define _fstat _fstat64i32
81#define _fstati64 _fstat64
82#define _stat _stat64i32
83#define _stati64 _stat64
84#define _wstat _wstat64i32
85#define _wstati64 _wstat64
86#endif
93 87
94#ifndef RC_INVOKED88 struct _stat32 {
89 _dev_t st_dev;
90 _ino_t st_ino;
91 unsigned short st_mode;
92 short st_nlink;
93 short st_uid;
94 short st_gid;
95 _dev_t st_rdev;
96 _off_t st_size;
97 __time32_t st_atime;
98 __time32_t st_mtime;
99 __time32_t st_ctime;
100 };
95 101
96#ifndef _STAT_DEFINED102#ifndef NO_OLDNAMES
97/*103 struct stat {
98 * The structure manipulated and returned by stat and fstat.
99 *
100 * NOTE: If called on a directory the values in the time fields are not only
101 * invalid, they will cause localtime et. al. to return NULL. And calling
102 * asctime with a NULL pointer causes an Invalid Page Fault. So watch it!
103 */
104struct _stat
105{
106 _dev_t st_dev; /* Equivalent to drive number 0=A 1=B ... */
107 _ino_t st_ino; /* Always zero ? */
108 _mode_t st_mode; /* See above constants */
109 short st_nlink; /* Number of links. */
110 short st_uid; /* User: Maybe significant on NT ? */
111 short st_gid; /* Group: Ditto */
112 _dev_t st_rdev; /* Seems useless (not even filled in) */
113 _off_t st_size; /* File size in bytes */
114 time_t st_atime; /* Accessed date (always 00:00 hrs local
115 * on FAT) */
116 time_t st_mtime; /* Modified time */
117 time_t st_ctime; /* Creation time */
118};
119
120struct stat
121{
122 _dev_t st_dev; /* Equivalent to drive number 0=A 1=B ... */
123 _ino_t st_ino; /* Always zero ? */
124 _mode_t st_mode; /* See above constants */
125 short st_nlink; /* Number of links. */
126 short st_uid; /* User: Maybe significant on NT ? */
127 short st_gid; /* Group: Ditto */
128 _dev_t st_rdev; /* Seems useless (not even filled in) */
129 _off_t st_size; /* File size in bytes */
130 time_t st_atime; /* Accessed date (always 00:00 hrs local
131 * on FAT) */
132 time_t st_mtime; /* Modified time */
133 time_t st_ctime; /* Creation time */
134};
135#if defined (__MSVCRT__)
136struct _stati64 {
137 _dev_t st_dev;104 _dev_t st_dev;
138 _ino_t st_ino;105 _ino_t st_ino;
139 unsigned short st_mode;106 unsigned short st_mode;
@@ -141,50 +108,181 @@ struct _stati64 { · 1 unmodified line
141 short st_uid;108 short st_uid;
142 short st_gid;109 short st_gid;
143 _dev_t st_rdev;110 _dev_t st_rdev;
144 __int64 st_size;111 _off_t st_size;
145 time_t st_atime;112 time_t st_atime;
146 time_t st_mtime;113 time_t st_mtime;
147 time_t st_ctime;114 time_t st_ctime;
148};115 };
149#endif /* __MSVCRT__ */116#endif
150#define _STAT_DEFINED
151#endif /* _STAT_DEFINED */
152 117
153#ifdef __cplusplus118#if _INTEGRAL_MAX_BITS >= 64
154extern "C" {119 struct _stat32i64 {
120 _dev_t st_dev;
121 _ino_t st_ino;
122 unsigned short st_mode;
123 short st_nlink;
124 short st_uid;
125 short st_gid;
126 _dev_t st_rdev;
127 __int64 st_size;
128 __time32_t st_atime;
129 __time32_t st_mtime;
130 __time32_t st_ctime;
131 };
132
133 struct _stat64i32 {
134 _dev_t st_dev;
135 _ino_t st_ino;
136 unsigned short st_mode;
137 short st_nlink;
138 short st_uid;
139 short st_gid;
140 _dev_t st_rdev;
141 _off_t st_size;
142 __time64_t st_atime;
143 __time64_t st_mtime;
144 __time64_t st_ctime;
145 };
146
147 struct _stat64 {
148 _dev_t st_dev;
149 _ino_t st_ino;
150 unsigned short st_mode;
151 short st_nlink;
152 short st_uid;
153 short st_gid;
154 _dev_t st_rdev;
155 __int64 st_size;
156 __time64_t st_atime;
157 __time64_t st_mtime;
158 __time64_t st_ctime;
159 };
160#endif
161
162#define __stat64 _stat64
163
164#define _STAT_DEFINED
155#endif165#endif
156 166
157int _fstat (int, struct _stat*);167#define _S_IFMT 0xF000
158int _chmod (const char*, int);168#define _S_IFDIR 0x4000
159int _stat (const char*, struct _stat*);169#define _S_IFCHR 0x2000
170#define _S_IFIFO 0x1000
171#define _S_IFREG 0x8000
172#define _S_IREAD 0x0100
173#define _S_IWRITE 0x0080
174#define _S_IEXEC 0x0040
175
176 _CRTIMP int __cdecl _fstat32(int _FileDes,struct _stat32 *_Stat);
177 _CRTIMP int __cdecl _stat32(const char *_Name,struct _stat32 *_Stat);
178#if _INTEGRAL_MAX_BITS >= 64
179 _CRTIMP int __cdecl _fstat64(int _FileDes,struct _stat64 *_Stat);
180 _CRTIMP int __cdecl _fstat32i64(int _FileDes,struct _stat32i64 *_Stat);
181 int __cdecl _fstat64i32(int _FileDes,struct _stat64i32 *_Stat);
182 __CRT_INLINE int __cdecl _fstat64i32(int _FileDes,struct _stat64i32 *_Stat)
183 {
184 struct _stat64 st;
185 int ret=_fstat64(_FileDes,&st);
186 _Stat->st_dev=st.st_dev;
187 _Stat->st_ino=st.st_ino;
188 _Stat->st_mode=st.st_mode;
189 _Stat->st_nlink=st.st_nlink;
190 _Stat->st_uid=st.st_uid;
191 _Stat->st_gid=st.st_gid;
192 _Stat->st_rdev=st.st_rdev;
193 _Stat->st_size=(_off_t) st.st_size;
194 _Stat->st_atime=st.st_atime;
195 _Stat->st_mtime=st.st_mtime;
196 _Stat->st_ctime=st.st_ctime;
197 return ret;
198 }
199 _CRTIMP int __cdecl _stat64(const char *_Name,struct _stat64 *_Stat);
200 _CRTIMP int __cdecl _stat32i64(const char *_Name,struct _stat32i64 *_Stat);
201 int __cdecl _stat64i32(const char *_Name,struct _stat64i32 *_Stat);
202 __CRT_INLINE int __cdecl _stat64i32(const char *_Name,struct _stat64i32 *_Stat)
203 {
204 struct _stat64 st;
205 int ret=_stat64(_Name,&st);
206 _Stat->st_dev=st.st_dev;
207 _Stat->st_ino=st.st_ino;
208 _Stat->st_mode=st.st_mode;
209 _Stat->st_nlink=st.st_nlink;
210 _Stat->st_uid=st.st_uid;
211 _Stat->st_gid=st.st_gid;
212 _Stat->st_rdev=st.st_rdev;
213 _Stat->st_size=(_off_t) st.st_size;
214 _Stat->st_atime=st.st_atime;
215 _Stat->st_mtime=st.st_mtime;
216 _Stat->st_ctime=st.st_ctime;
217 return ret;
218 }
219#endif
160 220
161#if defined (__MSVCRT__)221#ifndef _WSTAT_DEFINED
162int _fstati64(int, struct _stati64 *);
163int _stati64(const char *, struct _stati64 *);
164#if !defined ( _WSTAT_DEFINED) /* also declared in wchar.h */
165int _wstat(const wchar_t*, struct _stat*);
166int _wstati64 (const wchar_t*, struct _stati64*);
167#define _WSTAT_DEFINED222#define _WSTAT_DEFINED
168#endif /* _WSTAT_DEFIND */223 _CRTIMP int __cdecl _wstat32(const wchar_t *_Name,struct _stat32 *_Stat);
169#endif /* __MSVCRT__ */224#if _INTEGRAL_MAX_BITS >= 64
225 _CRTIMP int __cdecl _wstat32i64(const wchar_t *_Name,struct _stat32i64 *_Stat);
226 int __cdecl _wstat64i32(const wchar_t *_Name,struct _stat64i32 *_Stat);
227 _CRTIMP int __cdecl _wstat64(const wchar_t *_Name,struct _stat64 *_Stat);
228#endif
229#endif
170 230
171#ifndef _NO_OLDNAMES231#ifndef NO_OLDNAMES
232#define _S_IFBLK 0x3000 /* Block: Is this ever set under w32? */
172 233
173/* These functions live in liboldnames.a. */234#define S_IFMT _S_IFMT
174int fstat (int, struct stat*);235#define S_IFDIR _S_IFDIR
175int chmod (const char*, int);236#define S_IFCHR _S_IFCHR
176int stat (const char*, struct stat*);237#define S_IFREG _S_IFREG
238#define S_IREAD _S_IREAD
239#define S_IWRITE _S_IWRITE
240#define S_IEXEC _S_IEXEC
241#define S_IFIFO _S_IFIFO
242#define S_IFBLK _S_IFBLK
177 243
178#endif /* Not _NO_OLDNAMES */244#define _S_IRWXU (_S_IREAD | _S_IWRITE | _S_IEXEC)
245#define _S_IXUSR _S_IEXEC
246#define _S_IWUSR _S_IWRITE
179 247
248#define S_IRWXU _S_IRWXU
249#define S_IXUSR _S_IXUSR
250#define S_IWUSR _S_IWUSR
251#define S_IRUSR _S_IRUSR
252#define _S_IRUSR _S_IREAD
180 253
181#ifdef __cplusplus254#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
182}255#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
183#endif256#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
257#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
258#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
184 259
185#endif /* Not RC_INVOKED */260#endif
186 261
187#endif /* Not _STAT_H_ */262#if !defined (RC_INVOKED) && !defined (NO_OLDNAMES)
263int __cdecl stat(const char *_Filename,struct stat *_Stat);
264int __cdecl fstat(int _Desc,struct stat *_Stat);
265int __cdecl wstat(const wchar_t *_Filename,struct stat *_Stat);
266#ifdef _USE_32BIT_TIME_T
267__CRT_INLINE int __cdecl fstat(int _Desc,struct stat *_Stat) {
268 return _fstat32(_Desc,(struct _stat32 *)_Stat);
269}
270__CRT_INLINE int __cdecl stat(const char *_Filename,struct stat *_Stat) {
271 return _stat32(_Filename,(struct _stat32 *)_Stat);
272}
273#else
274__CRT_INLINE int __cdecl fstat(int _Desc,struct stat *_Stat) {
275 return _fstat64i32(_Desc,(struct _stat64i32 *)_Stat);
276}
277__CRT_INLINE int __cdecl stat(const char *_Filename,struct stat *_Stat) {
278 return _stat64i32(_Filename,(struct _stat64i32 *)_Stat);
279}
280#endif
281#endif
188 282
189#endif /* Not __STRICT_ANSI__ */283#ifdef __cplusplus
284}
285#endif
190 286
287#pragma pack(pop)
288#endif
win32/include/sys/time.h+66−0
@@ -1,3 +1,69 @@
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
7#ifndef _SYS_TIME_H_
8#define _SYS_TIME_H_
1 9
2#include <time.h>10#include <time.h>
3 11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16#ifndef __STRICT_ANSI__
17#ifndef _TIMEVAL_DEFINED /* also in winsock[2].h */
18#define _TIMEVAL_DEFINED
19struct timeval {
20 long tv_sec;
21 long tv_usec;
22};
23#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
24#define timercmp(tvp, uvp, cmp) \
25 (((tvp)->tv_sec != (uvp)->tv_sec) ? \
26 ((tvp)->tv_sec cmp (uvp)->tv_sec) : \
27 ((tvp)->tv_usec cmp (uvp)->tv_usec))
28#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
29#endif /* _TIMEVAL_DEFINED */
30
31#ifndef _TIMEZONE_DEFINED /* also in sys/time.h */
32#define _TIMEZONE_DEFINED
33/* Provided for compatibility with code that assumes that
34 the presence of gettimeofday function implies a definition
35 of struct timezone. */
36struct timezone
37{
38 int tz_minuteswest; /* of Greenwich */
39 int tz_dsttime; /* type of dst correction to apply */
40};
41
42 extern int __cdecl mingw_gettimeofday (struct timeval *p, struct timezone *z);
43
44#endif
45
46/*
47 Implementation as per:
48 The Open Group Base Specifications, Issue 6
49 IEEE Std 1003.1, 2004 Edition
50
51 The timezone pointer arg is ignored. Errors are ignored.
52*/
53#ifndef _GETTIMEOFDAY_DEFINED
54#define _GETTIMEOFDAY_DEFINED
55int __cdecl gettimeofday(struct timeval *__restrict__,
56 void *__restrict__ /* tzp (unused) */);
57#endif
58
59#endif /* __STRICT_ANSI__ */
60
61#ifdef __cplusplus
62}
63#endif
64
65/* Adding timespec definition. */
66#include <sys/timeb.h>
67
68
69#endif /* _SYS_TIME_H_ */
win32/include/sys/timeb.h+111−63
@@ -1,82 +1,130 @@
1/*1/**
2 * timeb.h2 * This file has no copyright assigned and is placed in the Public Domain.
3 *3 * This file is part of the w64 mingw-runtime package.
4 * Support for the UNIX System V ftime system call.4 * No warranty is given; refer to the file DISCLAIMER within this package.
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 */5 */
6#ifndef _TIMEB_H_
7#define _TIMEB_H_
26 8
27#ifndef __STRICT_ANSI__9#include <_mingw.h>
28 10
29#ifndef _TIMEB_H_11#ifndef _WIN32
30#define _TIMEB_H_12#error Only Win32 target is supported!
13#endif
31 14
32/* All the headers include this file. */15#pragma pack(push,_CRT_PACKING)
33#include <_mingw.h>
34 16
35#ifndef RC_INVOKED17#ifdef __cplusplus
18extern "C" {
19#endif
36 20
37/*21#ifndef _CRTIMP
38 * TODO: Structure not tested.22#define _CRTIMP __declspec(dllimport)
39 */23#endif
40struct _timeb
41{
42 long time;
43 short millitm;
44 short timezone;
45 short dstflag;
46};
47 24
48#ifndef _NO_OLDNAMES25#ifdef _USE_32BIT_TIME_T
49/*26#ifdef _WIN64
50 * TODO: Structure not tested.27#undef _USE_32BIT_TIME_T
51 */28#endif
52struct timeb29#else
53{30#if _INTEGRAL_MAX_BITS < 64
54 long time;31#define _USE_32BIT_TIME_T
55 short millitm;32#endif
56 short timezone;
57 short dstflag;
58};
59#endif33#endif
60 34
35#ifndef _TIME32_T_DEFINED
36 typedef long __time32_t;
37#define _TIME32_T_DEFINED
38#endif
61 39
62#ifdef __cplusplus40#ifndef _TIME64_T_DEFINED
63extern "C" {41#if _INTEGRAL_MAX_BITS >= 64
42 typedef __int64 __time64_t;
43#endif
44#define _TIME64_T_DEFINED
64#endif45#endif
65 46
66/* TODO: Not tested. */47#ifndef _TIME_T_DEFINED
67void _ftime (struct _timeb*);48#ifdef _USE_32BIT_TIME_T
49 typedef __time32_t time_t;
50#else
51 typedef __time64_t time_t;
52#endif
53#define _TIME_T_DEFINED
54#endif
68 55
69#ifndef _NO_OLDNAMES56#ifndef _TIMEB_DEFINED
70void ftime (struct timeb*);57#define _TIMEB_DEFINED
71#endif /* Not _NO_OLDNAMES */
72 58
73#ifdef __cplusplus59 struct __timeb32 {
74}60 __time32_t time;
61 unsigned short millitm;
62 short timezone;
63 short dstflag;
64 };
65
66#ifndef NO_OLDNAMES
67 struct timeb {
68 time_t time;
69 unsigned short millitm;
70 short timezone;
71 short dstflag;
72 };
75#endif73#endif
76 74
77#endif /* Not RC_INVOKED */75#if _INTEGRAL_MAX_BITS >= 64
76 struct __timeb64 {
77 __time64_t time;
78 unsigned short millitm;
79 short timezone;
80 short dstflag;
81 };
82#endif
83
84#ifdef _USE_32BIT_TIME_T
85#define _timeb __timeb32
86#define _ftime _ftime32
87#else
88#define _timeb __timeb64
89#define _ftime _ftime64
90#endif
91#endif
92
93 _CRTIMP void __cdecl _ftime32(struct __timeb32 *_Time);
94#if _INTEGRAL_MAX_BITS >= 64
95 _CRTIMP void __cdecl _ftime64(struct __timeb64 *_Time);
96#endif
78 97
79#endif /* Not _TIMEB_H_ */98#ifndef _TIMESPEC_DEFINED
99#define _TIMESPEC_DEFINED
100struct timespec {
101 time_t tv_sec; /* Seconds */
102 long tv_nsec; /* Nanoseconds */
103};
80 104
81#endif /* Not __STRICT_ANSI__ */105struct itimerspec {
106 struct timespec it_interval; /* Timer period */
107 struct timespec it_value; /* Timer expiration */
108};
109#endif
82 110
111#if !defined (RC_INVOKED) && !defined (NO_OLDNAMES)
112#ifdef _USE_32BIT_TIME_T
113__CRT_INLINE void __cdecl ftime(struct timeb *_Tmb) {
114 _ftime32((struct __timeb32 *)_Tmb);
115}
116#else
117__CRT_INLINE void __cdecl ftime(struct timeb *_Tmb) {
118 _ftime64((struct __timeb64 *)_Tmb);
119}
120#endif
121#endif
122
123#ifdef __cplusplus
124}
125#endif
126
127#pragma pack(pop)
128
129#include <sec_api/sys/timeb_s.h>
130#endif
win32/include/sys/types.h+79−81
@@ -1,118 +1,116 @@
1/*1/**
2 * types.h2 * This file has no copyright assigned and is placed in the Public Domain.
3 *3 * This file is part of the w64 mingw-runtime package.
4 * The definition of constants, data types and global variables.4 * No warranty is given; refer to the file DISCLAIMER within this package.
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 * Lots of types supplied by Pedro A. Aranda <paag@tid.es>
11 *
12 * THIS SOFTWARE IS NOT COPYRIGHTED
13 *
14 * This source code is offered for use in the public domain. You may
15 * use, modify or distribute it freely.
16 *
17 * This code is distributed in the hope that it will be useful but
18 * WITHOUT ANY WARRANTY. ALL WARRENTIES, EXPRESS OR IMPLIED ARE HEREBY
19 * DISCLAIMED. This includes but is not limited to warrenties of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 *
22 * $Revision: 1.2 $
23 * $Author: bellard $
24 * $Date: 2005/04/17 13:14:29 $
25 *
26 */5 */
6#ifndef _INC_TYPES
7#define _INC_TYPES
27 8
28#ifndef _TYPES_H_9#ifndef _WIN32
29#define _TYPES_H_10#error Only Win32 target is supported!
11#endif
30 12
31/* All the headers include this file. */
32#include <_mingw.h>13#include <_mingw.h>
33 14
34#define __need_wchar_t15#ifdef _USE_32BIT_TIME_T
35#define __need_size_t16#ifdef _WIN64
36#define __need_ptrdiff_t17#undef _USE_32BIT_TIME_T
37#ifndef RC_INVOKED18#endif
38#include <stddef.h>19#else
39#endif /* Not RC_INVOKED */20#if _INTEGRAL_MAX_BITS < 64
40 21#define _USE_32BIT_TIME_T
41#ifndef RC_INVOKED22#endif
42
43#ifndef _TIME_T_DEFINED
44typedef long time_t;
45#define _TIME_T_DEFINED
46#endif23#endif
47 24
48 25#ifndef _TIME32_T_DEFINED
49#ifndef __STRICT_ANSI__26#define _TIME32_T_DEFINED
50 27typedef long __time32_t;
51#ifndef _OFF_T_
52#define _OFF_T_
53typedef long _off_t;
54
55#ifndef _NO_OLDNAMES
56typedef _off_t off_t;
57#endif28#endif
58#endif /* Not _OFF_T_ */
59 29
30#ifndef _TIME64_T_DEFINED
31#define _TIME64_T_DEFINED
32#if _INTEGRAL_MAX_BITS >= 64
33typedef __int64 __time64_t;
34#endif
35#endif
60 36
61#ifndef _DEV_T_37#ifndef _TIME_T_DEFINED
62#define _DEV_T_38#define _TIME_T_DEFINED
63#ifdef __MSVCRT__39#ifdef _USE_32BIT_TIME_T
64typedef unsigned int _dev_t;40typedef __time32_t time_t;
65#else41#else
66typedef short _dev_t;42typedef __time64_t time_t;
67#endif43#endif
68
69#ifndef _NO_OLDNAMES
70typedef _dev_t dev_t;
71#endif44#endif
72#endif /* Not _DEV_T_ */
73
74 45
75#ifndef _INO_T_46#ifndef _INO_T_DEFINED
76#define _INO_T_47#define _INO_T_DEFINED
77typedef short _ino_t;48typedef unsigned short _ino_t;
78 49#ifndef NO_OLDNAMES
79#ifndef _NO_OLDNAMES50typedef unsigned short ino_t;
80typedef _ino_t ino_t;51#endif
81#endif52#endif
82#endif /* Not _INO_T_ */
83 53
54#ifndef _DEV_T_DEFINED
55#define _DEV_T_DEFINED
56typedef unsigned int _dev_t;
57#ifndef NO_OLDNAMES
58typedef unsigned int dev_t;
59#endif
60#endif
84 61
85#ifndef _PID_T_62#ifndef _PID_T_
86#define _PID_T_63#define _PID_T_
64#ifndef _WIN64
87typedef int _pid_t;65typedef int _pid_t;
66#else
67typedef __int64 _pid_t;
68#endif
88 69
89#ifndef _NO_OLDNAMES70#ifndef NO_OLDNAMES
90typedef _pid_t pid_t;71typedef _pid_t pid_t;
91#endif72#endif
92#endif /* Not _PID_T_ */73#endif /* Not _PID_T_ */
93 74
94
95#ifndef _MODE_T_75#ifndef _MODE_T_
96#define _MODE_T_76#define _MODE_T_
97typedef unsigned short _mode_t;77typedef unsigned short _mode_t;
98 78
99#ifndef _NO_OLDNAMES79#ifndef NO_OLDNAMES
100typedef _mode_t mode_t;80typedef _mode_t mode_t;
101#endif81#endif
102#endif /* Not _MODE_T_ */82#endif /* Not _MODE_T_ */
103 83
104 84#ifndef _OFF_T_DEFINED
105#ifndef _SIGSET_T_85#define _OFF_T_DEFINED
106#define _SIGSET_T_86#ifndef _OFF_T_
107typedef int _sigset_t;87#define _OFF_T_
108 88 typedef long _off_t;
109#ifndef _NO_OLDNAMES89#if !defined(NO_OLDNAMES) || defined(_POSIX)
110typedef _sigset_t sigset_t;90 typedef long off_t;
91#endif
92#endif
111#endif93#endif
112#endif /* Not _SIGSET_T_ */
113 94
114#endif /* Not __STRICT_ANSI__ */95#ifndef _OFF64_T_DEFINED
96#define _OFF64_T_DEFINED
97 typedef long long _off64_t;
98#if !defined(NO_OLDNAMES) || defined(_POSIX)
99 typedef long long off64_t;
100#endif
101#endif
115 102
116#endif /* Not RC_INVOKED */103#ifndef _TIMESPEC_DEFINED
104#define _TIMESPEC_DEFINED
105struct timespec {
106 time_t tv_sec; /* Seconds */
107 long tv_nsec; /* Nanoseconds */
108};
109
110struct itimerspec {
111 struct timespec it_interval; /* Timer period */
112 struct timespec it_value; /* Timer expiration */
113};
114#endif
117 115
118#endif /* Not _TYPES_H_ */116#endif
win32/include/sys/unistd.h+5−0
@@ -1,3 +1,8 @@
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 */
1/*6/*
2 * This file is part of the Mingw32 package.7 * This file is part of the Mingw32 package.
3 *8 *
win32/include/sys/utime.h+124−69
@@ -1,89 +1,144 @@
1/*1/**
2 * utime.h2 * This file has no copyright assigned and is placed in the Public Domain.
3 *3 * This file is part of the w64 mingw-runtime package.
4 * Support for the utime function.4 * No warranty is given; refer to the file DISCLAIMER within this package.
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 */5 */
6#ifndef _INC_UTIME
7#define _INC_UTIME
26 8
27#ifndef __STRICT_ANSI__9#ifndef _WIN32
28 10#error Only Win32 target is supported!
29#ifndef _UTIME_H_11#endif
30#define _UTIME_H_
31 12
32/* All the headers include this file. */
33#include <_mingw.h>13#include <_mingw.h>
34 14
35#define __need_wchar_t15#pragma pack(push,_CRT_PACKING)
36#define __need_size_t
37#ifndef RC_INVOKED
38#include <stddef.h>
39#endif /* Not RC_INVOKED */
40#include <sys/types.h>
41 16
42#ifndef RC_INVOKED17#ifdef __cplusplus
18extern "C" {
19#endif
43 20
44/*21#ifndef _CRTIMP
45 * Structure used by _utime function.22#define _CRTIMP __declspec(dllimport)
46 */23#endif
47struct _utimbuf
48{
49 time_t actime; /* Access time */
50 time_t modtime; /* Modification time */
51};
52 24
25#ifndef _WCHAR_T_DEFINED
26 typedef unsigned short wchar_t;
27#define _WCHAR_T_DEFINED
28#endif
53 29
54#ifndef _NO_OLDNAMES30#ifdef _USE_32BIT_TIME_T
55/* NOTE: Must be the same as _utimbuf above. */31#ifdef _WIN64
56struct utimbuf32#undef _USE_32BIT_TIME_T
57{33#endif
58 time_t actime;34#else
59 time_t modtime;35#if _INTEGRAL_MAX_BITS < 64
60};36#define _USE_32BIT_TIME_T
61#endif /* Not _NO_OLDNAMES */37#endif
38#endif
62 39
40#ifndef _TIME32_T_DEFINED
41#define _TIME32_T_DEFINED
42 typedef long __time32_t;
43#endif
63 44
64#ifdef __cplusplus45#ifndef _TIME64_T_DEFINED
65extern "C" {46#define _TIME64_T_DEFINED
47#if _INTEGRAL_MAX_BITS >= 64
48 typedef __int64 __time64_t;
49#endif
50#endif
51
52#ifndef _TIME_T_DEFINED
53#define _TIME_T_DEFINED
54#ifdef _USE_32BIT_TIME_T
55 typedef __time32_t time_t;
56#else
57 typedef __time64_t time_t;
58#endif
66#endif59#endif
67 60
68int _utime (const char*, struct _utimbuf*);61#ifndef _UTIMBUF_DEFINED
69int _futime (int, struct _utimbuf*);62#define _UTIMBUF_DEFINED
70 63
71/* The wide character version, only available for MSVCRT versions of the64 struct _utimbuf {
72 * C runtime library. */65 time_t actime;
73#ifdef __MSVCRT__66 time_t modtime;
74int _wutime (const wchar_t*, struct _utimbuf*);67 };
75#endif /* MSVCRT runtime */
76#ifndef _NO_OLDNAMES
77int utime (const char*, struct utimbuf*);
78#endif /* Not _NO_OLDNAMES */
79 68
80#ifdef __cplusplus69 struct __utimbuf32 {
81}70 __time32_t actime;
71 __time32_t modtime;
72 };
73
74#if _INTEGRAL_MAX_BITS >= 64
75 struct __utimbuf64 {
76 __time64_t actime;
77 __time64_t modtime;
78 };
82#endif79#endif
83 80
84#endif /* Not RC_INVOKED */81#ifndef NO_OLDNAMES
82 struct utimbuf {
83 time_t actime;
84 time_t modtime;
85 };
85 86
86#endif /* Not _UTIME_H_ */87 struct utimbuf32 {
88 __time32_t actime;
89 __time32_t modtime;
90 };
91#endif
92#endif
87 93
88#endif /* Not __STRICT_ANSI__ */94 _CRTIMP int __cdecl _utime32(const char *_Filename,struct __utimbuf32 *_Time);
95 _CRTIMP int __cdecl _futime32(int _FileDes,struct __utimbuf32 *_Time);
96 _CRTIMP int __cdecl _wutime32(const wchar_t *_Filename,struct __utimbuf32 *_Time);
97#if _INTEGRAL_MAX_BITS >= 64
98 _CRTIMP int __cdecl _utime64(const char *_Filename,struct __utimbuf64 *_Time);
99 _CRTIMP int __cdecl _futime64(int _FileDes,struct __utimbuf64 *_Time);
100 _CRTIMP int __cdecl _wutime64(const wchar_t *_Filename,struct __utimbuf64 *_Time);
101#endif
102
103#ifndef RC_INVOKED
104#ifdef _USE_32BIT_TIME_T
105__CRT_INLINE int __cdecl _utime(const char *_Filename,struct _utimbuf *_Utimbuf) {
106 return _utime32(_Filename,(struct __utimbuf32 *)_Utimbuf);
107}
108__CRT_INLINE int __cdecl _futime(int _Desc,struct _utimbuf *_Utimbuf) {
109 return _futime32(_Desc,(struct __utimbuf32 *)_Utimbuf);
110}
111__CRT_INLINE int __cdecl _wutime(const wchar_t *_Filename,struct _utimbuf *_Utimbuf) {
112 return _wutime32(_Filename,(struct __utimbuf32 *)_Utimbuf);
113}
114#else
115__CRT_INLINE int __cdecl _utime(const char *_Filename,struct _utimbuf *_Utimbuf) {
116 return _utime64(_Filename,(struct __utimbuf64 *)_Utimbuf);
117}
118__CRT_INLINE int __cdecl _futime(int _Desc,struct _utimbuf *_Utimbuf) {
119 return _futime64(_Desc,(struct __utimbuf64 *)_Utimbuf);
120}
121__CRT_INLINE int __cdecl _wutime(const wchar_t *_Filename,struct _utimbuf *_Utimbuf) {
122 return _wutime64(_Filename,(struct __utimbuf64 *)_Utimbuf);
123}
124#endif
89 125
126#ifndef NO_OLDNAMES
127#ifdef _USE_32BIT_TIME_T
128__CRT_INLINE int __cdecl utime(const char *_Filename,struct utimbuf *_Utimbuf) {
129 return _utime32(_Filename,(struct __utimbuf32 *)_Utimbuf);
130}
131#else
132__CRT_INLINE int __cdecl utime(const char *_Filename,struct utimbuf *_Utimbuf) {
133 return _utime64(_Filename,(struct __utimbuf64 *)_Utimbuf);
134}
135#endif
136#endif
137#endif
138
139#ifdef __cplusplus
140}
141#endif
142
143#pragma pack(pop)
144#endif
win32/include/tchar.h+1069−334
@@ -1,367 +1,1102 @@
1/* 1/**
2 * tchar.h2 * This file has no copyright assigned and is placed in the Public Domain.
3 *3 * This file is part of the w64 mingw-runtime package.
4 * Unicode mapping layer for the standard C library. By including this4 * No warranty is given; refer to the file DISCLAIMER within this package.
5 * file and using the 't' names for string functions
6 * (eg. _tprintf) you can make code which can be easily adapted to both
7 * Unicode and non-unicode environments. In a unicode enabled compile define
8 * _UNICODE before including tchar.h, otherwise the standard non-unicode
9 * library functions will be used.
10 *
11 * Note that you still need to include string.h or stdlib.h etc. to define
12 * the appropriate functions. Also note that there are several defines
13 * included for non-ANSI functions which are commonly available (but using
14 * the convention of prepending an underscore to non-ANSI library function
15 * names).
16 *
17 * This file is part of the Mingw32 package.
18 *
19 * Contributors:
20 * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
21 *
22 * THIS SOFTWARE IS NOT COPYRIGHTED
23 *
24 * This source code is offered for use in the public domain. You may
25 * use, modify or distribute it freely.
26 *
27 * This code is distributed in the hope that it will be useful but
28 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
29 * DISCLAIMED. This includes but is not limited to warranties of
30 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
31 *
32 * $Revision: 1.2 $
33 * $Author: bellard $
34 * $Date: 2005/04/17 13:14:29 $
35 *
36 */5 */
6#include <_mingw.h>
37 7
38#ifndef _TCHAR_H_8#ifndef _INC_TCHAR
39#define _TCHAR_H_9#define _INC_TCHAR
40 10
41/* All the headers include this file. */11#ifdef _STRSAFE_H_INCLUDED_
42#include <_mingw.h>12#error Need to include strsafe.h after tchar.h
13#endif
43 14
44/*15#ifdef __cplusplus
45 * NOTE: This tests _UNICODE, which is different from the UNICODE define16extern "C" {
46 * used to differentiate Win32 API calls.17#endif
47 */
48#ifdef _UNICODE
49 18
19#define _ftcscat _tcscat
20#define _ftcschr _tcschr
21#define _ftcscpy _tcscpy
22#define _ftcscspn _tcscspn
23#define _ftcslen _tcslen
24#define _ftcsncat _tcsncat
25#define _ftcsncpy _tcsncpy
26#define _ftcspbrk _tcspbrk
27#define _ftcsrchr _tcsrchr
28#define _ftcsspn _tcsspn
29#define _ftcsstr _tcsstr
30#define _ftcstok _tcstok
31
32#define _ftcsdup _tcsdup
33#define _ftcsnset _tcsnset
34#define _ftcsrev _tcsrev
35#define _ftcsset _tcsset
36
37#define _ftcscmp _tcscmp
38#define _ftcsicmp _tcsicmp
39#define _ftcsnccmp _tcsnccmp
40#define _ftcsncmp _tcsncmp
41#define _ftcsncicmp _tcsncicmp
42#define _ftcsnicmp _tcsnicmp
43
44#define _ftcscoll _tcscoll
45#define _ftcsicoll _tcsicoll
46#define _ftcsnccoll _tcsnccoll
47#define _ftcsncoll _tcsncoll
48#define _ftcsncicoll _tcsncicoll
49#define _ftcsnicoll _tcsnicoll
50
51#define _ftcsclen _tcsclen
52#define _ftcsnccat _tcsnccat
53#define _ftcsnccpy _tcsnccpy
54#define _ftcsncset _tcsncset
55
56#define _ftcsdec _tcsdec
57#define _ftcsinc _tcsinc
58#define _ftcsnbcnt _tcsnbcnt
59#define _ftcsnccnt _tcsnccnt
60#define _ftcsnextc _tcsnextc
61#define _ftcsninc _tcsninc
62#define _ftcsspnp _tcsspnp
63
64#define _ftcslwr _tcslwr
65#define _ftcsupr _tcsupr
66
67#define _ftclen _tclen
68#define _ftccpy _tccpy
69#define _ftccmp _tccmp
70
71#ifndef _CONST_RETURN
72#ifdef __cplusplus
73#define _CONST_RETURN const
74#define _CRT_CONST_CORRECT_OVERLOADS
75#else
76#define _CONST_RETURN
77#endif
78#endif
79
80#define _WConst_return _CONST_RETURN
81
82#ifdef _UNICODE
83
84#ifdef __cplusplus
85}
86#endif
87
88#include <wchar.h>
89
90#ifdef __cplusplus
91extern "C" {
92#endif
93
94#ifndef _WCTYPE_T_DEFINED
95#define _WCTYPE_T_DEFINED
96 typedef unsigned short wint_t;
97 typedef unsigned short wctype_t;
98#endif
99
100#ifndef __TCHAR_DEFINED
101#define __TCHAR_DEFINED
102 typedef wchar_t _TCHAR;
103 typedef wchar_t _TSCHAR;
104 typedef wchar_t _TUCHAR;
105 typedef wchar_t _TXCHAR;
106 typedef wint_t _TINT;
107#endif
50 108
51/*
52 * Use TCHAR instead of char or wchar_t. It will be appropriately translated
53 * if _UNICODE is correctly defined (or not).
54 */
55#ifndef _TCHAR_DEFINED109#ifndef _TCHAR_DEFINED
56#ifndef RC_INVOKED
57typedef wchar_t TCHAR;
58typedef wchar_t _TCHAR;
59#endif /* Not RC_INVOKED */
60#define _TCHAR_DEFINED110#define _TCHAR_DEFINED
111#ifndef NO_OLDNAMES
112 typedef wchar_t TCHAR;
113#endif
61#endif114#endif
62 115
116#define _TEOF WEOF
63 117
64/*118#define __T(x) L##x
65 * __TEXT is a private macro whose specific use is to force the expansion of a
66 * macro passed as an argument to the macros _T or _TEXT. DO NOT use this
67 * macro within your programs. It's name and function could change without
68 * notice.
69 */
70#define __TEXT(x) L##x
71 119
72/* for porting from other Windows compilers */120#define _tmain wmain
73#if 0 // no wide startup module121#define _tWinMain wWinMain
74#define _tmain wmain122#define _tenviron _wenviron
75#define _tWinMain wWinMain123#define __targv __wargv
76#define _tenviron _wenviron
77#define __targv __wargv
78#endif
79 124
80/*125#define _tprintf wprintf
81 * Unicode functions126#define _tprintf_l _wprintf_l
82 */127#define _tprintf_p _wprintf_p
83#define _tprintf wprintf128#define _tprintf_p_l _wprintf_p_l
84#define _ftprintf fwprintf129#define _tcprintf _cwprintf
85#define _stprintf swprintf130#define _tcprintf_l _cwprintf_l
86#define _sntprintf _snwprintf131#define _tcprintf_p _cwprintf_p
87#define _vtprintf vwprintf132#define _tcprintf_p_l _cwprintf_p_l
88#define _vftprintf vfwprintf133#define _vtcprintf _vcwprintf
89#define _vstprintf vswprintf134#define _vtcprintf_l _vcwprintf_l
90#define _vsntprintf _vsnwprintf135#define _vtcprintf_p _vcwprintf_p
91#define _tscanf wscanf136#define _vtcprintf_p_l _vcwprintf_p_l
92#define _ftscanf fwscanf137#define _ftprintf fwprintf
93#define _stscanf swscanf138#define _ftprintf_l _fwprintf_l
94#define _fgettc fgetwc139#define _ftprintf_p _fwprintf_p
95#define _fgettchar _fgetwchar140#define _ftprintf_p_l _fwprintf_p_l
96#define _fgetts fgetws141#define _stprintf swprintf
97#define _fputtc fputwc142#define _stprintf_l __swprintf_l
98#define _fputtchar _fputwchar143#define _stprintf_p _swprintf_p
99#define _fputts fputws144#define _stprintf_p_l _swprintf_p_l
100#define _gettc getwc145#define _sctprintf _scwprintf
101#define _getts getws146#define _sctprintf_l _scwprintf_l
102#define _puttc putwc147#define _sctprintf_p _scwprintf_p
103#define _putts putws148#define _sctprintf_p_l _scwprintf_p_l
104#define _ungettc ungetwc149#define _sntprintf _snwprintf
105#define _tcstod wcstod150#define _sntprintf_l _snwprintf_l
106#define _tcstol wcstol151#define _vtprintf vwprintf
107#define _tcstoul wcstoul152#define _vtprintf_l _vwprintf_l
108#define _itot _itow153#define _vtprintf_p _vwprintf_p
109#define _ltot _ltow154#define _vtprintf_p_l _vwprintf_p_l
110#define _ultot _ultow155#define _vftprintf vfwprintf
111#define _ttoi _wtoi156#define _vftprintf_l _vfwprintf_l
112#define _ttol _wtol157#define _vftprintf_p _vfwprintf_p
113#define _tcscat wcscat158#define _vftprintf_p_l _vfwprintf_p_l
114#define _tcschr wcschr159#define _vstprintf vswprintf
115#define _tcscmp wcscmp160#define _vstprintf_l _vswprintf_l
116#define _tcscpy wcscpy161#define _vstprintf_p _vswprintf_p
117#define _tcscspn wcscspn162#define _vstprintf_p_l _vswprintf_p_l
118#define _tcslen wcslen163#define _vsctprintf _vscwprintf
119#define _tcsncat wcsncat164#define _vsctprintf_l _vscwprintf_l
120#define _tcsncmp wcsncmp165#define _vsctprintf_p _vscwprintf_p
121#define _tcsncpy wcsncpy166#define _vsctprintf_p_l _vscwprintf_p_l
122#define _tcspbrk wcspbrk167#define _vsntprintf _vsnwprintf
123#define _tcsrchr wcsrchr168#define _vsntprintf_l _vsnwprintf_l
124#define _tcsspn wcsspn169
125#define _tcsstr wcsstr170#define _tscanf wscanf
126#define _tcstok wcstok171#define _tscanf_l _wscanf_l
127#define _tcsdup _wcsdup172#define _tcscanf _cwscanf
128#define _tcsicmp _wcsicmp173#define _tcscanf_l _cwscanf_l
129#define _tcsnicmp _wcsnicmp174#define _ftscanf fwscanf
130#define _tcsnset _wcsnset175#define _ftscanf_l _fwscanf_l
131#define _tcsrev _wcsrev176#define _stscanf swscanf
132#define _tcsset _wcsset177#define _stscanf_l _swscanf_l
133#define _tcslwr _wcslwr178#define _sntscanf _snwscanf
134#define _tcsupr _wcsupr179#define _sntscanf_l _snwscanf_l
135#define _tcsxfrm wcsxfrm180
136#define _tcscoll wcscoll181#define _fgettc fgetwc
137#define _tcsicoll _wcsicoll182#define _fgettc_nolock _fgetwc_nolock
138#define _istalpha iswalpha183#define _fgettchar _fgetwchar
139#define _istupper iswupper184#define _fgetts fgetws
140#define _istlower iswlower185#define _fputtc fputwc
141#define _istdigit iswdigit186#define _fputtc_nolock _fputwc_nolock
142#define _istxdigit iswxdigit187#define _fputtchar _fputwchar
143#define _istspace iswspace188#define _fputts fputws
144#define _istpunct iswpunct189#define _cputts _cputws
145#define _istalnum iswalnum190#define _cgetts _cgetws
146#define _istprint iswprint191#define _gettc getwc
147#define _istgraph iswgraph192#define _gettc_nolock _getwc_nolock
148#define _istcntrl iswcntrl193#define _gettch _getwch
149#define _istascii iswascii194#define _gettch_nolock _getwch_nolock
150#define _totupper towupper195#define _gettche _getwche
151#define _totlower towlower196#define _gettche_nolock _getwche_nolock
152#define _tcsftime wcsftime197#define _gettchar getwchar
153/* Macro functions */ 198#define _gettchar_nolock _getwchar_nolock
154#define _tcsdec _wcsdec199#define _getts _getws
155#define _tcsinc _wcsinc200#define _puttc putwc
156#define _tcsnbcnt _wcsncnt201#define _puttc_nolock _putwc_nolock
157#define _tcsnccnt _wcsncnt202#define _puttchar putwchar
158#define _tcsnextc _wcsnextc203#define _puttchar_nolock _putwchar_nolock
159#define _tcsninc _wcsninc204#define _puttch _putwch
160#define _tcsspnp _wcsspnp205#define _puttch_nolock _putwch_nolock
161#define _wcsdec(_wcs1, _wcs2) ((_wcs1)>=(_wcs2) ? NULL : (_wcs2)-1)206#define _putts _putws
162#define _wcsinc(_wcs) ((_wcs)+1)207#define _ungettc ungetwc
163#define _wcsnextc(_wcs) ((unsigned int) *(_wcs))208#define _ungettc_nolock _ungetwc_nolock
164#define _wcsninc(_wcs, _inc) (((_wcs)+(_inc)))209#define _ungettch _ungetwch
165#define _wcsncnt(_wcs, _cnt) ((wcslen(_wcs)>_cnt) ? _count : wcslen(_wcs))210#define _ungettch_nolock _ungetwch_nolock
166#define _wcsspnp(_wcs1, _wcs2) ((*((_wcs1)+wcsspn(_wcs1,_wcs2))) ? ((_wcs1)+wcsspn(_wcs1,_wcs2)) : NULL)211
167 212#define _tcstod wcstod
168#if 1 // defined __MSVCRT__213#define _tcstol wcstol
169/*214#define _tcstoul wcstoul
170 * These wide functions not in crtdll.dll.215#define _tcstoi64 _wcstoi64
171 * Define macros anyway so that _wfoo rather than _tfoo is undefined216#define _tcstoui64 _wcstoui64
172 */217#define _tstof _wtof
173#define _ttoi64 _wtoi64218#define _tstol _wtol
174#define _i64tot _i64tow219#define _tstoi _wtoi
175#define _ui64tot _ui64tow220#define _tstoi64 _wtoi64
176#define _tasctime _wasctime221#define _tcstod_l _wcstod_l
177#define _tctime _wctime222#define _tcstol_l _wcstol_l
178#define _tstrdate _wstrdate223#define _tcstoul_l _wcstoul_l
179#define _tstrtime _wstrtime224#define _tcstoi64_l _wcstoi64_l
180#define _tutime _wutime225#define _tcstoui64_l _wcstoui64_l
181#define _tcsnccoll _wcsncoll226#define _tstof_l _wtof_l
182#define _tcsncoll _wcsncoll227#define _tstol_l _wtol_l
228#define _tstoi_l _wtoi_l
229#define _tstoi64_l _wtoi64_l
230
231#define _itot _itow
232#define _ltot _ltow
233#define _ultot _ultow
234#define _ttoi _wtoi
235#define _ttol _wtol
236
237#define _ttoi64 _wtoi64
238#define _i64tot _i64tow
239#define _ui64tot _ui64tow
240
241#define _tcscat wcscat
242#define _tcschr wcschr
243#define _tcscpy wcscpy
244#define _tcscspn wcscspn
245#define _tcslen wcslen
246#define _tcsnlen wcsnlen
247#define _tcsncat wcsncat
248#define _tcsncat_l _wcsncat_l
249#define _tcsncpy wcsncpy
250#define _tcsncpy_l _wcsncpy_l
251#define _tcspbrk wcspbrk
252#define _tcsrchr wcsrchr
253#define _tcsspn wcsspn
254#define _tcsstr wcsstr
255#define _tcstok wcstok
256#define _tcstok_l _wcstok_l
257#define _tcserror _wcserror
258#define __tcserror __wcserror
259
260#define _tcsdup _wcsdup
261#define _tcsnset _wcsnset
262#define _tcsnset_l _wcsnset_l
263#define _tcsrev _wcsrev
264#define _tcsset _wcsset
265#define _tcsset_l _wcsset_l
266
267#define _tcscmp wcscmp
268#define _tcsicmp _wcsicmp
269#define _tcsicmp_l _wcsicmp_l
270#define _tcsnccmp wcsncmp
271#define _tcsncmp wcsncmp
272#define _tcsncicmp _wcsnicmp
273#define _tcsncicmp_l _wcsnicmp_l
274#define _tcsnicmp _wcsnicmp
275#define _tcsnicmp_l _wcsnicmp_l
276
277#define _tcscoll wcscoll
278#define _tcscoll_l _wcscoll_l
279#define _tcsicoll _wcsicoll
280#define _tcsicoll_l _wcsicoll_l
281#define _tcsnccoll _wcsncoll
282#define _tcsnccoll_l _wcsncoll_l
283#define _tcsncoll _wcsncoll
284#define _tcsncoll_l _wcsncoll_l
183#define _tcsncicoll _wcsnicoll285#define _tcsncicoll _wcsnicoll
184#define _tcsnicoll _wcsnicoll286#define _tcsncicoll_l _wcsnicoll_l
185#define _taccess _waccess287#define _tcsnicoll _wcsnicoll
186#define _tchmod _wchmod288#define _tcsnicoll_l _wcsnicoll_l
187#define _tcreat _wcreat289
290#define _texecl _wexecl
291#define _texecle _wexecle
292#define _texeclp _wexeclp
293#define _texeclpe _wexeclpe
294#define _texecv _wexecv
295#define _texecve _wexecve
296#define _texecvp _wexecvp
297#define _texecvpe _wexecvpe
298
299#define _tspawnl _wspawnl
300#define _tspawnle _wspawnle
301#define _tspawnlp _wspawnlp
302#define _tspawnlpe _wspawnlpe
303#define _tspawnv _wspawnv
304#define _tspawnve _wspawnve
305#define _tspawnvp _wspawnvp
306#define _tspawnvp _wspawnvp
307#define _tspawnvpe _wspawnvpe
308
309#define _tsystem _wsystem
310
311#define _tasctime _wasctime
312#define _tctime _wctime
313#define _tctime32 _wctime32
314#define _tctime64 _wctime64
315#define _tstrdate _wstrdate
316#define _tstrtime _wstrtime
317#define _tutime _wutime
318#define _tutime32 _wutime32
319#define _tutime64 _wutime64
320#define _tcsftime wcsftime
321#define _tcsftime_l _wcsftime_l
322
323#define _tchdir _wchdir
324#define _tgetcwd _wgetcwd
325#define _tgetdcwd _wgetdcwd
326#define _tgetdcwd_nolock _wgetdcwd_nolock
327#define _tmkdir _wmkdir
328#define _trmdir _wrmdir
329
330#define _tfullpath _wfullpath
331#define _tgetenv _wgetenv
332#define _tmakepath _wmakepath
333#define _tpgmptr _wpgmptr
334#define _get_tpgmptr _get_wpgmptr
335#define _tputenv _wputenv
336#define _tsearchenv _wsearchenv
337#define _tsplitpath _wsplitpath
338
339#define _tfdopen _wfdopen
340#define _tfsopen _wfsopen
341#define _tfopen _wfopen
342#define _tfreopen _wfreopen
343#define _tperror _wperror
344#define _tpopen _wpopen
345#define _ttempnam _wtempnam
346#define _ttmpnam _wtmpnam
347
348#define _taccess _waccess
349#define _tchmod _wchmod
350#define _tcreat _wcreat
188#define _tfindfirst _wfindfirst351#define _tfindfirst _wfindfirst
189#define _tfindnext _wfindnext352#define _tfindfirst32 _wfindfirst32
190#define _tfopen _wfopen353#define _tfindfirst64 _wfindfirst64
191#define _tgetenv _wgetenv354#define _tfindfirsti64 _wfindfirsti64
192#define _tmktemp _wmktemp355#define _tfindfirst32i64 _wfindfirst32i64
193#define _topen _wopen356#define _tfindfirst64i32 _wfindfirst64i32
194#define _tremove _wremove357#define _tfindnext _wfindnext
195#define _trename _wrename358#define _tfindnext32 _wfindnext32
196#define _tsopen _wsopen359#define _tfindnext64 _wfindnext64
197#define _tsetlocale _wsetlocale360#define _tfindnexti64 _wfindnexti64
198#define _tunlink _wunlink361#define _tfindnext32i64 _wfindnext32i64
199#define _tfinddata_t _wfinddata_t362#define _tfindnext64i32 _wfindnext64i32
200#define _tfindfirsti64 _wfindfirsti64363#define _tmktemp _wmktemp
201#define _tfindnexti64 _wfindnexti64364#define _topen _wopen
365#define _tremove _wremove
366#define _trename _wrename
367#define _tsopen _wsopen
368#define _tunlink _wunlink
369
370#define _tfinddata_t _wfinddata_t
371#define _tfinddata32_t _wfinddata32_t
372#define _tfinddata64_t _wfinddata64_t
202#define _tfinddatai64_t _wfinddatai64_t373#define _tfinddatai64_t _wfinddatai64_t
203#endif /* __MSVCRT__ */374#define _tfinddata32i64_t _wfinddata32i64_t
375#define _tfinddata64i32_t _wfinddata64i32_t
204 376
205#else /* Not _UNICODE */377#define _tstat _wstat
378#define _tstat32 _wstat32
379#define _tstat32i64 _wstat32i64
380#define _tstat64 _wstat64
381#define _tstat64i32 _wstat64i32
382#define _tstati64 _wstati64
206 383
207/*384#define _tsetlocale _wsetlocale
208 * TCHAR, the type you should use instead of char.385
209 */386#define _tcsclen wcslen
210#ifndef _TCHAR_DEFINED387#define _tcscnlen wcsnlen
211#ifndef RC_INVOKED388#define _tcsclen_l(_String,_Locale) wcslen(_String)
212typedef char TCHAR;389#define _tcscnlen_l(_String,_Max_count,_Locale) wcsnlen_l((_String),(_Max_count))
213typedef char _TCHAR;390#define _tcsnccat wcsncat
391#define _tcsnccat_l _wcsncat_l
392#define _tcsnccpy wcsncpy
393#define _tcsnccpy_l _wcsncpy_l
394#define _tcsncset _wcsnset
395
396#define _tcsdec _wcsdec
397#define _tcsinc _wcsinc
398#define _tcsnbcnt _wcsncnt
399#define _tcsnccnt _wcsncnt
400#define _tcsnextc _wcsnextc
401#define _tcsninc _wcsninc
402#define _tcsspnp _wcsspnp
403
404#define _tcslwr _wcslwr
405#define _tcslwr_l _wcslwr_l
406#define _tcsupr _wcsupr
407#define _tcsupr_l _wcsupr_l
408#define _tcsxfrm wcsxfrm
409#define _tcsxfrm_l _wcsxfrm_l
410
411#define _tclen(_pc) (1)
412#define _tccpy(_pc1,_cpc2) ((*(_pc1) = *(_cpc2)))
413#define _tccmp(_cpc1,_cpc2) ((*(_cpc1))-(*(_cpc2)))
414
415#define _istalnum iswalnum
416#define _istalnum_l _iswalnum_l
417#define _istalpha iswalpha
418#define _istalpha_l _iswalpha_l
419#define _istascii iswascii
420#define _istcntrl iswcntrl
421#define _istcntrl_l _iswcntrl_l
422#define _istdigit iswdigit
423#define _istdigit_l _iswdigit_l
424#define _istgraph iswgraph
425#define _istgraph_l _iswgraph_l
426#define _istlower iswlower
427#define _istlower_l _iswlower_l
428#define _istprint iswprint
429#define _istprint_l _iswprint_l
430#define _istpunct iswpunct
431#define _istpunct_l _iswpunct_l
432#define _istspace iswspace
433#define _istspace_l _iswspace_l
434#define _istupper iswupper
435#define _istupper_l _iswupper_l
436#define _istxdigit iswxdigit
437#define _istxdigit_l _iswxdigit_l
438
439#define _totupper towupper
440#define _totupper_l _towupper_l
441#define _totlower towlower
442#define _totlower_l _towlower_l
443
444#define _istlegal(_Char) (1)
445#define _istlead(_Char) (0)
446#define _istleadbyte(_Char) (0)
447#define _istleadbyte_l(_Char,_Locale) (0)
448
449#define _wcsdec(_cpc1,_cpc2) ((_cpc1)>=(_cpc2) ? NULL : (_cpc2)-1)
450#define _wcsinc(_pc) ((_pc)+1)
451#define _wcsnextc(_cpc) ((unsigned int) *(_cpc))
452#define _wcsninc(_pc,_sz) (((_pc)+(_sz)))
453 _CRTIMP size_t __cdecl __wcsncnt(const wchar_t *_Str,size_t _MaxCount);
454#define _wcsncnt(_cpc,_sz) (__wcsncnt(_cpc,_sz))
455#define _wcsspnp(_cpc1,_cpc2) (!_cpc1 ? NULL : ((*((_cpc1)+wcsspn(_cpc1,_cpc2))) ? ((_cpc1)+wcsspn(_cpc1,_cpc2)) : NULL))
456#define _wcsncpy_l(_Destination,_Source,_Count,_Locale) (wcsncpy(_Destination,_Source,_Count))
457#define _wcsncat_l(_Destination,_Source,_Count,_Locale) (wcsncat(_Destination,_Source,_Count))
458#define _wcstok_l(_String,_Delimiters,_Locale) (wcstok(_String,_Delimiters))
459#define _wcsnset_l(_Destination,_Value,_Count,_Locale) (_wcsnset(_Destination,_Value,_Count))
460#define _wcsset_l(_Destination,_Value,_Locale) (_wcsset(_Destination,_Value))
461
462 /* dirent structures and functions */
463#define _tdirent _wdirent
464#define _TDIR _WDIR
465#define _topendir _wopendir
466#define _tclosedir _wclosedir
467#define _treaddir _wreaddir
468#define _trewinddir _wrewinddir
469#define _ttelldir _wtelldir
470#define _tseekdir _wseekdir
471
472#else
473
474#ifdef __cplusplus
475}
214#endif476#endif
215#define _TCHAR_DEFINED477
478#include <string.h>
479
480#ifdef __cplusplus
481extern "C" {
216#endif482#endif
217 483
218/*484#define _TEOF EOF
219 * __TEXT is a private macro whose specific use is to force the expansion of a
220 * macro passed as an argument to the macros _T or _TEXT. DO NOT use this
221 * macro within your programs. It's name and function could change without
222 * notice.
223 */
224#define __TEXT(x) x
225 485
226/* for porting from other Windows compilers */486#define __T(x) x
227#define _tmain main
228#define _tWinMain WinMain
229#define _tenviron _environ
230#define __targv __argv
231 487
232/*488#define _tmain main
233 * Non-unicode (standard) functions489#define _tWinMain WinMain
234 */490#ifdef _POSIX_
491#define _tenviron environ
492#else
493#define _tenviron _environ
494#endif
495#define __targv __argv
496
497#define _tprintf printf
498#define _tprintf_l _printf_l
499#define _tprintf_p _printf_p
500#define _tprintf_p_l _printf_p_l
501#define _tcprintf _cprintf
502#define _tcprintf_l _cprintf_l
503#define _tcprintf_p _cprintf_p
504#define _tcprintf_p_l _cprintf_p_l
505#define _vtcprintf _vcprintf
506#define _vtcprintf_l _vcprintf_l
507#define _vtcprintf_p _vcprintf_p
508#define _vtcprintf_p_l _vcprintf_p_l
509#define _ftprintf fprintf
510#define _ftprintf_l _fprintf_l
511#define _ftprintf_p _fprintf_p
512#define _ftprintf_p_l _fprintf_p_l
513#define _stprintf sprintf
514#define _stprintf_l _sprintf_l
515#define _stprintf_p _sprintf_p
516#define _stprintf_p_l _sprintf_p_l
517#define _sctprintf _scprintf
518#define _sctprintf_l _scprintf_l
519#define _sctprintf_p _scprintf_p
520#define _sctprintf_p_l _scprintf_p_l
521#define _sntprintf _snprintf
522#define _sntprintf_l _snprintf_l
523#define _vtprintf vprintf
524#define _vtprintf_l _vprintf_l
525#define _vtprintf_p _vprintf_p
526#define _vtprintf_p_l _vprintf_p_l
527#define _vftprintf vfprintf
528#define _vftprintf_l _vfprintf_l
529#define _vftprintf_p _vfprintf_p
530#define _vftprintf_p_l _vfprintf_p_l
531#define _vstprintf vsprintf
532#define _vstprintf_l _vsprintf_l
533#define _vstprintf_p _vsprintf_p
534#define _vstprintf_p_l _vsprintf_p_l
535#define _vsctprintf _vscprintf
536#define _vsctprintf_l _vscprintf_l
537#define _vsctprintf_p _vscprintf_p
538#define _vsctprintf_p_l _vscprintf_p_l
539#define _vsntprintf _vsnprintf
540#define _vsntprintf_l _vsnprintf_l
541
542#define _tscanf scanf
543#define _tscanf_l _scanf_l
544#define _tcscanf _cscanf
545#define _tcscanf_l _cscanf_l
546#define _ftscanf fscanf
547#define _ftscanf_l _fscanf_l
548#define _stscanf sscanf
549#define _stscanf_l _sscanf_l
550#define _sntscanf _snscanf
551#define _sntscanf_l _snscanf_l
552
553#define _fgettc fgetc
554#define _fgettc_nolock _fgetc_nolock
555#define _fgettchar _fgetchar
556#define _fgetts fgets
557#define _fputtc fputc
558#define _fputtc_nolock _fputc_nolock
559#define _fputtchar _fputchar
560#define _fputts fputs
561#define _cputts _cputs
562#define _gettc getc
563#define _gettc_nolock _getc_nolock
564#define _gettch _getch
565#define _gettch_nolock _getch_nolock
566#define _gettche _getche
567#define _gettche_nolock _getche_nolock
568#define _gettchar getchar
569#define _gettchar_nolock _getchar_nolock
570#define _getts gets
571#define _cgetts _cgets
572#define _puttc putc
573#define _puttc_nolock _putc_nolock
574#define _puttchar putchar
575#define _puttchar_nolock _putchar_nolock
576#define _puttch _putch
577#define _puttch_nolock _putch_nolock
578#define _putts puts
579#define _ungettc ungetc
580#define _ungettc_nolock _ungetc_nolock
581#define _ungettch _ungetch
582#define _ungettch_nolock _ungetch_nolock
583
584#define _tcstod strtod
585#define _tcstol strtol
586#define _tcstoul strtoul
587#define _tstof atof
588#define _tstol atol
589#define _tstoi atoi
590#define _tstoi64 _atoi64
591#define _tcstod_l _strtod_l
592#define _tcstol_l _strtol_l
593#define _tcstoul_l _strtoul_l
594#define _tstof_l _atof_l
595#define _tstol_l _atol_l
596#define _tstoi_l _atoi_l
597#define _tstoi64_l _atoi64_l
598
599#define _itot _itoa
600#define _ltot _ltoa
601#define _ultot _ultoa
602#define _ttoi atoi
603#define _ttol atol
604
605#define _ttoi64 _atoi64
606#define _tcstoi64 _strtoi64
607#define _tcstoi64_l _strtoi64_l
608#define _tcstoui64 _strtoui64
609#define _tcstoui64_l _strtoui64_l
610#define _i64tot _i64toa
611#define _ui64tot _ui64toa
235 612
236#define _tprintf printf613#define _tcscat strcat
237#define _ftprintf fprintf614#define _tcscpy strcpy
238#define _stprintf sprintf615#define _tcsdup _strdup
239#define _sntprintf _snprintf616#define _tcslen strlen
240#define _vtprintf vprintf617#if 0
241#define _vftprintf vfprintf618#define _tcsnlen strnlen
242#define _vstprintf vsprintf619#endif
243#define _vsntprintf _vsnprintf620#define _tcsxfrm strxfrm
244#define _tscanf scanf621#define _tcsxfrm_l _strxfrm_l
245#define _ftscanf fscanf622#define _tcserror strerror
246#define _stscanf sscanf623#define __tcserror _strerror
247#define _fgettc fgetc624
248#define _fgettchar _fgetchar625#define _texecl _execl
249#define _fgetts fgets626#define _texecle _execle
250#define _fputtc fputc627#define _texeclp _execlp
251#define _fputtchar _fputchar628#define _texeclpe _execlpe
252#define _fputts fputs629#define _texecv _execv
253#define _tfopen fopen630#define _texecve _execve
254#define _tgetenv getenv631#define _texecvp _execvp
255#define _gettc getc632#define _texecvpe _execvpe
256#define _getts gets633
257#define _puttc putc634#define _tspawnl _spawnl
258#define _putts puts635#define _tspawnle _spawnle
259#define _ungettc ungetc636#define _tspawnlp _spawnlp
260#define _tcstod strtod637#define _tspawnlpe _spawnlpe
261#define _tcstol strtol638#define _tspawnv _spawnv
262#define _tcstoul strtoul639#define _tspawnve _spawnve
263#define _itot _itoa640#define _tspawnvp _spawnvp
264#define _ltot _ltoa641#define _tspawnvpe _spawnvpe
265#define _ultot _ultoa642
266#define _ttoi atoi643#define _tsystem system
267#define _ttol atol644
268#define _tcscat strcat645#define _tasctime asctime
269#define _tcschr strchr646#define _tctime ctime
270#define _tcscmp strcmp647#define _tctime32 _ctime32
271#define _tcscpy strcpy648#define _tctime64 _ctime64
272#define _tcscspn strcspn649#define _tstrdate _strdate
273#define _tcslen strlen650#define _tstrtime _strtime
274#define _tcsncat strncat651#define _tutime _utime
275#define _tcsncmp strncmp652#define _tutime32 _utime32
276#define _tcsncpy strncpy653#define _tutime64 _utime64
277#define _tcspbrk strpbrk654#define _tcsftime strftime
278#define _tcsrchr strrchr655#define _tcsftime_l _strftime_l
279#define _tcsspn strspn656
280#define _tcsstr strstr657#define _tchdir _chdir
281#define _tcstok strtok658#define _tgetcwd _getcwd
282#define _tcsdup _strdup659#define _tgetdcwd _getdcwd
283#define _tcsicmp _stricmp660#define _tgetdcwd_nolock _getdcwd_nolock
284#define _tcsnicmp _strnicmp661#define _tmkdir _mkdir
285#define _tcsnset _strnset662#define _trmdir _rmdir
286#define _tcsrev _strrev663
287#define _tcsset _strset664#define _tfullpath _fullpath
288#define _tcslwr _strlwr665#define _tgetenv getenv
289#define _tcsupr _strupr666#define _tmakepath _makepath
290#define _tcsxfrm strxfrm667#define _tpgmptr _pgmptr
291#define _tcscoll strcoll668#define _get_tpgmptr _get_pgmptr
292#define _tcsicoll _stricoll669#define _tputenv _putenv
293#define _istalpha isalpha670#define _tsearchenv _searchenv
294#define _istupper isupper671#define _tsplitpath _splitpath
295#define _istlower islower672
296#define _istdigit isdigit673#ifdef _POSIX_
297#define _istxdigit isxdigit674#define _tfdopen fdopen
298#define _istspace isspace675#else
299#define _istpunct ispunct676#define _tfdopen _fdopen
300#define _istalnum isalnum677#endif
301#define _istprint isprint678#define _tfsopen _fsopen
302#define _istgraph isgraph679#define _tfopen fopen
303#define _istcntrl iscntrl680#define _tfreopen freopen
304#define _istascii isascii681#define _tperror perror
305#define _totupper toupper682#define _tpopen _popen
306#define _totlower tolower683#define _ttempnam _tempnam
307#define _tasctime asctime684#define _ttmpnam tmpnam
308#define _tctime ctime685
309#define _tstrdate _strdate686#define _tchmod _chmod
310#define _tstrtime _strtime687#define _tcreat _creat
311#define _tutime _utime
312#define _tcsftime strftime
313/* Macro functions */
314#define _tcsdec _strdec
315#define _tcsinc _strinc
316#define _tcsnbcnt _strncnt
317#define _tcsnccnt _strncnt
318#define _tcsnextc _strnextc
319#define _tcsninc _strninc
320#define _tcsspnp _strspnp
321#define _strdec(_str1, _str2) ((_str1)>=(_str2) ? NULL : (_str2)-1)
322#define _strinc(_str) ((_str)+1)
323#define _strnextc(_str) ((unsigned int) *(_str))
324#define _strninc(_str, _inc) (((_str)+(_inc)))
325#define _strncnt(_str, _cnt) ((strlen(_str)>_cnt) ? _count : strlen(_str))
326#define _strspnp(_str1, _str2) ((*((_str1)+strspn(_str1,_str2))) ? ((_str1)+strspn(_str1,_str2)) : NULL)
327
328#define _tchmod _chmod
329#define _tcreat _creat
330#define _tfindfirst _findfirst688#define _tfindfirst _findfirst
331#define _tfindnext _findnext689#define _tfindfirst32 _findfirst32
332#define _tmktemp _mktemp690#define _tfindfirst64 _findfirst64
333#define _topen _open691#define _tfindfirsti64 _findfirsti64
334#define _taccess _access692#define _tfindfirst32i64 _findfirst32i64
335#define _tremove remove693#define _tfindfirst64i32 _findfirst64i32
336#define _trename rename694#define _tfindnext _findnext
337#define _tsopen _sopen695#define _tfindnext32 _findnext32
696#define _tfindnext64 _findnext64
697#define _tfindnexti64 _findnexti64
698#define _tfindnext32i64 _findnext32i64
699#define _tfindnext64i32 _findnext64i32
700#define _tmktemp _mktemp
701
702#ifdef _POSIX_
703#define _topen open
704#define _taccess access
705#else
706#define _topen _open
707#define _taccess _access
708#endif
709
710#define _tremove remove
711#define _trename rename
712#define _tsopen _sopen
713#define _tunlink _unlink
714
715#define _tfinddata_t _finddata_t
716#define _tfinddata32_t _finddata32_t
717#define _tfinddata64_t __finddata64_t
718#define _tfinddatai64_t _finddatai64_t
719#define _tfinddata32i64_t _finddata32i64_t
720#define _tfinddata64i32_t _finddata64i32_t
721
722#define _istascii __isascii
723#define _istcntrl iscntrl
724#define _istcntrl_l _iscntrl_l
725#define _istxdigit isxdigit
726#define _istxdigit_l _isxdigit_l
727
728#define _tstat _stat
729#define _tstat32 _stat32
730#define _tstat32i64 _stat32i64
731#define _tstat64 _stat64
732#define _tstat64i32 _stat64i32
733#define _tstati64 _stati64
734
338#define _tsetlocale setlocale735#define _tsetlocale setlocale
339#define _tunlink _unlink
340#define _tfinddata_t _finddata_t
341 736
737#ifdef _MBCS
738
739#ifdef __cplusplus
740}
741#endif
742
743#include <mbstring.h>
744
745#ifdef __cplusplus
746extern "C" {
747#endif
748
749#ifndef __TCHAR_DEFINED
750 typedef char _TCHAR;
751 typedef signed char _TSCHAR;
752 typedef unsigned char _TUCHAR;
753 typedef unsigned char _TXCHAR;
754 typedef unsigned int _TINT;
755#define __TCHAR_DEFINED
756#endif
757
758#ifndef _TCHAR_DEFINED
759#ifndef NO_OLDNAMES
760 typedef char TCHAR;
761#endif
762#define _TCHAR_DEFINED
763#endif
764
765#ifdef _MB_MAP_DIRECT
766
767#define _tcschr _mbschr
768#define _tcscspn _mbscspn
769#define _tcsncat _mbsnbcat
770#define _tcsncat_l _mbsnbcat_l
771#define _tcsncpy _mbsnbcpy
772#define _tcsncpy_l _mbsnbcpy_l
773#define _tcspbrk _mbspbrk
774#define _tcsrchr _mbsrchr
775#define _tcsspn _mbsspn
776#define _tcsstr _mbsstr
777#define _tcstok _mbstok
778#define _tcstok_l _mbstok_l
779
780#define _tcsnset _mbsnbset
781#define _tcsnset_l _mbsnbset_l
782#define _tcsrev _mbsrev
783#define _tcsset _mbsset
784#define _tcsset_l _mbsset_l
785
786#define _tcscmp _mbscmp
787#define _tcsicmp _mbsicmp
788#define _tcsicmp_l _mbsicmp_l
789#define _tcsnccmp _mbsncmp
790#define _tcsncmp _mbsnbcmp
791#define _tcsncicmp _mbsnicmp
792#define _tcsncicmp_l _mbsnicmp_l
793#define _tcsnicmp _mbsnbicmp
794#define _tcsnicmp_l _mbsnbicmp_l
795
796#define _tcscoll _mbscoll
797#define _tcscoll_l _mbscoll_l
798#define _tcsicoll _mbsicoll
799#define _tcsicoll_l _mbsicoll_l
800#define _tcsnccoll _mbsncoll
801#define _tcsnccoll_l _mbsncoll_l
802#define _tcsncoll _mbsnbcoll
803#define _tcsncoll_l _mbsnbcoll_l
804#define _tcsncicoll _mbsnicoll
805#define _tcsncicoll_l _mbsnicoll_l
806#define _tcsnicoll _mbsnbicoll
807#define _tcsnicoll_l _mbsnbicoll_l
808
809#define _tcsclen _mbslen
810#define _tcscnlen _mbsnlen
811#define _tcsclen_l _mbslen_l
812#define _tcscnlen_l _mbsnlen_l
813#define _tcsnccat _mbsncat
814#define _tcsnccat_l _mbsncat_l
815#define _tcsnccpy _mbsncpy
816#define _tcsnccpy_l _mbsncpy_l
817#define _tcsncset _mbsnset
818#define _tcsncset_l _mbsnset_l
819
820#define _tcsdec _mbsdec
821#define _tcsinc _mbsinc
822#define _tcsnbcnt _mbsnbcnt
823#define _tcsnccnt _mbsnccnt
824#define _tcsnextc _mbsnextc
825#define _tcsninc _mbsninc
826#define _tcsspnp _mbsspnp
827
828#define _tcslwr _mbslwr
829#define _tcslwr_l _mbslwr_l
830#define _tcsupr _mbsupr
831#define _tcsupr_l _mbsupr_l
832
833#define _tclen _mbclen
834#define _tccpy _mbccpy
835#define _tccpy_l _mbccpy_l
836#else
342 837
343#if 1 // defined __MSVCRT__838 _CRTIMP _CONST_RETURN char *__cdecl _tcschr(const char *_Str,unsigned int _Val);
344/* Not in crtdll.dll. Define macros anyway? */839 _CRTIMP size_t __cdecl _tcscspn(const char *_Str,const char *_Control);
345#define _ttoi64 _atoi64840 _CRTIMP char *__cdecl _tcsncat(char *_Dst,const char *_Src,size_t _MaxCount);
346#define _i64tot _i64toa841 _CRTIMP char *__cdecl _tcsncat_l(char *_Dst,const char *_Src,size_t _MaxCount,_locale_t _Locale);
347#define _ui64tot _ui64toa842 _CRTIMP char *__cdecl _tcsncpy(char *_Dst,const char *_Src,size_t _MaxCount);
348#define _tcsnccoll _strncoll843 _CRTIMP char *__cdecl _tcsncpy_l(char *_Dst,const char *_Src,size_t _MaxCount,_locale_t _Locale);
349#define _tcsncoll _strncoll844 _CRTIMP _CONST_RETURN char *__cdecl _tcspbrk(const char *_Str,const char *_Control);
845 _CRTIMP _CONST_RETURN char *__cdecl _tcsrchr(const char *_Str,unsigned int _Ch);
846 _CRTIMP size_t __cdecl _tcsspn(const char *_Str,const char *_Control);
847 _CRTIMP _CONST_RETURN char *__cdecl _tcsstr(const char *_Str,const char *_Substr);
848 _CRTIMP char *__cdecl _tcstok(char *_Str,const char *_Delim);
849 _CRTIMP char *__cdecl _tcstok_l(char *_Str,const char *_Delim,_locale_t _Locale);
850 _CRTIMP char *__cdecl _tcsnset(char *_Str,unsigned int _Val,size_t _MaxCount);
851 _CRTIMP char *__cdecl _tcsrev(char *_Str);
852 _CRTIMP char *__cdecl _tcsset(char *_Str,unsigned int _Val);
853 _CRTIMP char *__cdecl _tcsset_l(char *_Str,unsigned int _Val,_locale_t _Locale);
854 _CRTIMP int __cdecl _tcscmp(const char *_Str1,const char *_Str);
855 _CRTIMP int __cdecl _tcsicmp(const char *_Str1,const char *_Str2);
856 _CRTIMP int __cdecl _tcsicmp_l(const char *_Str1,const char *_Str2,_locale_t _Locale);
857 _CRTIMP int __cdecl _tcsnccmp(const char *_Str1,const char *_Str2,size_t _MaxCount);
858 _CRTIMP int __cdecl _tcsncmp(const char *_Str1,const char *_Str2,size_t _MaxCount);
859 _CRTIMP int __cdecl _tcsncicmp(const char *_Str1,const char *_Str2,size_t _MaxCount);
860 _CRTIMP int __cdecl _tcsncicmp_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale);
861 _CRTIMP int __cdecl _tcsnicmp(const char *_Str1,const char *_Str2,size_t _MaxCount);
862 _CRTIMP int __cdecl _tcsnicmp_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale);
863 _CRTIMP int __cdecl _tcscoll(const char *_Str1,const char *_Str2);
864 _CRTIMP int __cdecl _tcscoll_l(const char *_Str1,const char *_Str2,_locale_t _Locale);
865 _CRTIMP int __cdecl _tcsicoll(const char *_Str1,const char *_Str2);
866 _CRTIMP int __cdecl _tcsicoll_l(const char *_Str1,const char *_Str2,_locale_t _Locale);
867 _CRTIMP int __cdecl _tcsnccoll(const char *_Str1,const char *_Str2,size_t _MaxCount);
868 _CRTIMP int __cdecl _tcsnccoll_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale);
869 _CRTIMP int __cdecl _tcsncoll(const char *_Str1,const char *_Str2,size_t _MaxCount);
870 _CRTIMP int __cdecl _tcsncoll_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale);
871 _CRTIMP int __cdecl _tcsncicoll(const char *_Str1,const char *_Str2,size_t _MaxCount);
872 _CRTIMP int __cdecl _tcsncicoll_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale);
873 _CRTIMP int __cdecl _tcsnicoll(const char *_Str1,const char *_Str2,size_t _MaxCount);
874 _CRTIMP int __cdecl _tcsnicoll_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale);
875 _CRTIMP size_t __cdecl _tcsclen(const char *_Str);
876 _CRTIMP size_t __cdecl _tcscnlen(const char *_Str,size_t _MaxCount);
877 _CRTIMP size_t __cdecl _tcsclen_l(const char *_Str,_locale_t _Locale);
878 _CRTIMP size_t __cdecl _tcscnlen_l(const char *_Str,size_t _MaxCount,_locale_t _Locale);
879 _CRTIMP char *__cdecl _tcsnccat(char *_Dst,const char *_Src,size_t _MaxCount);
880 _CRTIMP char *__cdecl _tcsnccat_l(char *_Dst,const char *_Src,size_t _MaxCount,_locale_t _Locale);
881 _CRTIMP char *__cdecl _tcsnccpy(char *_Dst,const char *_Src,size_t _MaxCount);
882 _CRTIMP char *__cdecl _tcsnccpy_l(char *_Dst,const char *_Src,size_t _MaxCount,_locale_t _Locale);
883 _CRTIMP char *__cdecl _tcsncset(char *_Str,unsigned int _Val,size_t _MaxCount);
884 _CRTIMP char *__cdecl _tcsdec(const char *_Start,const char *_Pos);
885 _CRTIMP char *__cdecl _tcsinc(const char *_Ptr);
886 _CRTIMP size_t __cdecl _tcsnbcnt(const char *_Str,size_t _MaxCount);
887 _CRTIMP size_t __cdecl _tcsnccnt(const char *_Str,size_t _MaxCount);
888 _CRTIMP unsigned int __cdecl _tcsnextc (const char *_Str);
889 _CRTIMP char *__cdecl _tcsninc(const char *_Ptr,size_t _Count);
890 _CRTIMP char *__cdecl _tcsspnp(const char *_Str1,const char *_Str2);
891 _CRTIMP char *__cdecl _tcslwr(char *_Str);
892 _CRTIMP char *__cdecl _tcslwr_l(char *_Str,_locale_t _Locale);
893 _CRTIMP char *__cdecl _tcsupr(char *_Str);
894 _CRTIMP char *__cdecl _tcsupr_l(char *_Str,_locale_t _Locale);
895 _CRTIMP size_t __cdecl _tclen(const char *_Str);
896 _CRTIMP void __cdecl _tccpy(char *_DstCh,const char *_SrcCh);
897
898#ifdef __cplusplus
899#ifndef _CPP_TCHAR_INLINES_DEFINED
900#define _CPP_TCHAR_INLINES_DEFINED
901 extern "C++" {
902 extern inline char *__cdecl _tcschr(char *_S,unsigned int _C) { return ((char *)_tcschr((const char *)_S,_C)); }
903 extern inline char *__cdecl _tcspbrk(char *_S,const char *_P) { return ((char *)_tcspbrk((const char *)_S,_P)); }
904 extern inline char *__cdecl _tcsrchr(char *_S,unsigned int _C) { return ((char *)_tcsrchr((const char *)_S,_C)); }
905 extern inline char *__cdecl _tcsstr(char *_S,const char *_P) { return ((char *)_tcsstr((const char *)_S,_P)); }
906 }
907#endif
908#endif
909#endif
910
911#define _tccmp(_cp1,_cp2) _tcsnccmp(_cp1,_cp2,1)
912
913#define _istalnum _ismbcalnum
914#define _istalnum_l _ismbcalnum_l
915#define _istalpha _ismbcalpha
916#define _istalpha_l _ismbcalpha_l
917#define _istdigit _ismbcdigit
918#define _istdigit_l _ismbcdigit_l
919#define _istgraph _ismbcgraph
920#define _istgraph_l _ismbcgraph_l
921#define _istlegal _ismbclegal
922#define _istlegal_l _ismbclegal_l
923#define _istlower _ismbclower
924#define _istlower_l _ismbclower_l
925#define _istprint _ismbcprint
926#define _istprint_l _ismbcprint_l
927#define _istpunct _ismbcpunct
928#define _istpunct_l _ismbcpunct_l
929#define _istspace _ismbcspace
930#define _istspace_l _ismbcspace_l
931#define _istupper _ismbcupper
932#define _istupper_l _ismbcupper_l
933
934#define _totupper _mbctoupper
935#define _totupper_l _mbctoupper_l
936#define _totlower _mbctolower
937#define _totlower_l _mbctolower_l
938
939#define _istlead _ismbblead
940#define _istleadbyte isleadbyte
941#define _istleadbyte_l _isleadbyte_l
942#else
943
944#ifndef __TCHAR_DEFINED
945#define __TCHAR_DEFINED
946 typedef char _TCHAR;
947 typedef signed char _TSCHAR;
948 typedef unsigned char _TUCHAR;
949 typedef char _TXCHAR;
950 typedef int _TINT;
951#endif
952
953#ifndef _TCHAR_DEFINED
954#define _TCHAR_DEFINED
955#ifndef NO_OLDNAMES
956 typedef char TCHAR;
957#endif
958#endif
959
960#define _tcschr strchr
961#define _tcscspn strcspn
962#define _tcsncat strncat
963#define _tcsncat_l _strncat_l
964#define _tcsncpy strncpy
965#define _tcsncpy_l _strncpy_l
966#define _tcspbrk strpbrk
967#define _tcsrchr strrchr
968#define _tcsspn strspn
969#define _tcsstr strstr
970#define _tcstok strtok
971#define _tcstok_l _strtok_l
972
973#define _tcsnset _strnset
974#define _tcsnset_l _strnset_l
975#define _tcsrev _strrev
976#define _tcsset _strset
977
978#define _tcscmp strcmp
979#define _tcsicmp _stricmp
980#define _tcsicmp_l _stricmp_l
981#define _tcsnccmp strncmp
982#define _tcsncmp strncmp
983#define _tcsncicmp _strnicmp
984#define _tcsncicmp_l _strnicmp_l
985#define _tcsnicmp _strnicmp
986#define _tcsnicmp_l _strnicmp_l
987
988#define _tcscoll strcoll
989#define _tcscoll_l _strcoll_l
990#define _tcsicoll _stricoll
991#define _tcsicoll_l _stricoll_l
992#define _tcsnccoll _strncoll
993#define _tcsnccoll_l _strncoll_l
994#define _tcsncoll _strncoll
995#define _tcsncoll_l _strncoll_l
350#define _tcsncicoll _strnicoll996#define _tcsncicoll _strnicoll
351#define _tcsnicoll _strnicoll997#define _tcsncicoll_l _strnicoll_l
352#define _tfindfirsti64 _findfirsti64998#define _tcsnicoll _strnicoll
353#define _tfindnexti64 _findnexti64999#define _tcsnicoll_l _strnicoll_l
354#define _tfinddatai64_t _finddatai64_t
355#endif /* __MSVCRT__ */
356 1000
357#endif /* Not _UNICODE */1001#define _tcsclen strlen
1002#define _tcscnlen strnlen
1003#define _tcsclen_l(_String,_Locale) strlen(_String)
1004#define _tcscnlen_l(_String,_Max_count,_Locale) strnlen_l((_String),(_Max_count))
1005#define _tcsnccat strncat
1006#define _tcsnccat_l _strncat_l
1007#define _tcsnccpy strncpy
1008#define _tcsnccpy_l _strncpy_l
1009#define _tcsncset _strnset
358 1010
359/*1011#define _tcsdec _strdec
360 * UNICODE a constant string when _UNICODE is defined else returns the string1012#define _tcsinc _strinc
361 * unmodified. Also defined in w32api/winnt.h.1013#define _tcsnbcnt _strncnt
362 */1014#define _tcsnccnt _strncnt
363#define _TEXT(x) __TEXT(x)1015#define _tcsnextc _strnextc
364#define _T(x) __TEXT(x)1016#define _tcsninc _strninc
1017#define _tcsspnp _strspnp
1018
1019#define _tcslwr _strlwr
1020#define _tcslwr_l _strlwr_l
1021#define _tcsupr _strupr
1022#define _tcsupr_l _strupr_l
1023#define _tcsxfrm strxfrm
1024#define _tcsxfrm_l _strxfrm_l
1025
1026#define _istlead(_Char) (0)
1027#define _istleadbyte(_Char) (0)
1028#define _istleadbyte_l(_Char,_Locale) (0)
1029
1030#define _tclen(_pc) (1)
1031#define _tccpy(_pc1,_cpc2) (*(_pc1) = *(_cpc2))
1032#define _tccmp(_cpc1,_cpc2) (((unsigned char)*(_cpc1))-((unsigned char)*(_cpc2)))
365 1033
366#endif /* Not _TCHAR_H_ */1034 /* dirent structures and functions */
1035#define _tdirent dirent
1036#define _TDIR DIR
1037#define _topendir opendir
1038#define _tclosedir closedir
1039#define _treaddir readdir
1040#define _trewinddir rewinddir
1041#define _ttelldir telldir
1042#define _tseekdir seekdir
367 1043
1044#define _istalnum isalnum
1045#define _istalnum_l _isalnum_l
1046#define _istalpha isalpha
1047#define _istalpha_l _isalpha_l
1048#define _istdigit isdigit
1049#define _istdigit_l _isdigit_l
1050#define _istgraph isgraph
1051#define _istgraph_l _isgraph_l
1052#define _istlower islower
1053#define _istlower_l _islower_l
1054#define _istprint isprint
1055#define _istprint_l _isprint_l
1056#define _istpunct ispunct
1057#define _istpunct_l _ispunct_l
1058#define _istspace isspace
1059#define _istspace_l _isspace_l
1060#define _istupper isupper
1061#define _istupper_l _isupper_l
1062
1063#define _totupper toupper
1064#define _totupper_l _toupper_l
1065#define _totlower tolower
1066#define _totlower_l _tolower_l
1067
1068#define _istlegal(_c) (1)
1069
1070#ifndef NULL
1071#ifdef __cplusplus
1072#define NULL 0
1073#else
1074#define NULL ((void *)0)
1075#endif
1076#endif
1077
1078#define _strdec(_cpc1,_cpc2) ((_cpc1)>=(_cpc2) ? NULL : (_cpc2)-1)
1079#define _strinc(_pc) ((_pc)+1)
1080#define _strnextc(_cpc) ((unsigned int) *(const unsigned char *)(_cpc))
1081#define _strninc(_pc,_sz) (((_pc)+(_sz)))
1082 _CRTIMP size_t __cdecl __strncnt(const char *_Str,size_t _Cnt);
1083#define _strncnt(_cpc,_sz) (__strncnt(_cpc,_sz))
1084#define _strspnp(_cpc1,_cpc2) (!_cpc1 ? NULL : ((*((_cpc1)+strspn(_cpc1,_cpc2))) ? ((_cpc1)+strspn(_cpc1,_cpc2)) : NULL))
1085
1086#define _strncpy_l(_Destination,_Source,_Count,_Locale) (strncpy(_Destination,_Source,_Count))
1087#define _strncat_l(_Destination,_Source,_Count,_Locale) (strncat(_Destination,_Source,_Count))
1088#define _strtok_l(_String,_Delimiters,_Locale) (strtok(_String,_Delimiters))
1089#define _strnset_l(_Destination,_Value,_Count,_Locale) (_strnset(_Destination,_Value,_Count))
1090#define _strset_l(_Destination,_Value,_Locale) (_strset(_Destination,_Value))
1091#endif
1092#endif
1093
1094#define _T(x) __T(x)
1095#define _TEXT(x) __T(x)
1096
1097#ifdef __cplusplus
1098}
1099#endif
1100
1101#include <sec_api/tchar_s.h>
1102#endif
win32/include/time.h+243−176
@@ -1,219 +1,286 @@
1/* 1/**
2 * time.h2 * This file has no copyright assigned and is placed in the Public Domain.
3 *3 * This file is part of the w64 mingw-runtime package.
4 * Date and time functions and types.4 * No warranty is given; refer to the file DISCLAIMER within this package.
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 */5 */
6#ifndef _TIME_H_
7#define _TIME_H_
26 8
27#ifndef _TIME_H_
28#define _TIME_H_
29
30/* All the headers include this file. */
31#include <_mingw.h>9#include <_mingw.h>
32 10
33#define __need_wchar_t11#ifndef _WIN32
34#define __need_size_t12#error Only Win32 target is supported!
35#ifndef RC_INVOKED13#endif
36#include <stddef.h>
37#endif /* Not RC_INVOKED */
38 14
39/*15#pragma pack(push,_CRT_PACKING)
40 * Need a definition of time_t.
41 */
42#include <sys/types.h>
43 16
44/*17#ifdef __cplusplus
45 * Number of clock ticks per second. A clock tick is the unit by which18extern "C" {
46 * processor time is measured and is returned by 'clock'.19#endif
47 */
48#define CLOCKS_PER_SEC ((clock_t)1000)
49#define CLK_TCK CLOCKS_PER_SEC
50 20
21#ifndef _CRTIMP
22#define _CRTIMP __declspec(dllimport)
23#endif
51 24
52#ifndef RC_INVOKED25#ifndef _WCHAR_T_DEFINED
26#define _WCHAR_T_DEFINED
27 typedef unsigned short wchar_t;
28#endif
29
30#ifndef _TIME32_T_DEFINED
31#define _TIME32_T_DEFINED
32 typedef long __time32_t;
33#endif
34
35#ifndef _TIME64_T_DEFINED
36#define _TIME64_T_DEFINED
37#if _INTEGRAL_MAX_BITS >= 64
38#if defined(__GNUC__) && defined(__STRICT_ANSI__)
39 typedef int _time64_t __attribute__ ((mode (DI)));
40#else
41 typedef __int64 __time64_t;
42#endif
43#endif
44#endif
53 45
54/*
55 * A type for storing the current time and date. This is the number of
56 * seconds since midnight Jan 1, 1970.
57 * NOTE: Normally this is defined by the above include of sys/types.h
58 */
59#ifndef _TIME_T_DEFINED46#ifndef _TIME_T_DEFINED
60typedef long time_t;
61#define _TIME_T_DEFINED47#define _TIME_T_DEFINED
48#ifdef _USE_32BIT_TIME_T
49 typedef __time32_t time_t;
50#else
51 typedef __time64_t time_t;
52#endif
62#endif53#endif
63 54
64/*
65 * A type for measuring processor time (in clock ticks).
66 */
67#ifndef _CLOCK_T_DEFINED55#ifndef _CLOCK_T_DEFINED
68typedef long clock_t;
69#define _CLOCK_T_DEFINED56#define _CLOCK_T_DEFINED
57 typedef long clock_t;
70#endif58#endif
71 59
72 60#ifndef _SIZE_T_DEFINED
73/*61#define _SIZE_T_DEFINED
74 * A structure for storing all kinds of useful information about the62#undef size_t
75 * current (or another) time.63#ifdef _WIN64
76 */64#if defined(__GNUC__) && defined(__STRICT_ANSI__)
77struct tm65 typedef unsigned int size_t __attribute__ ((mode (DI)));
78{66#else
79 int tm_sec; /* Seconds: 0-59 (K&R says 0-61?) */67 typedef unsigned __int64 size_t;
80 int tm_min; /* Minutes: 0-59 */68#endif
81 int tm_hour; /* Hours since midnight: 0-23 */69#else
82 int tm_mday; /* Day of the month: 1-31 */70 typedef unsigned int size_t;
83 int tm_mon; /* Months *since* january: 0-11 */
84 int tm_year; /* Years since 1900 */
85 int tm_wday; /* Days since Sunday (0-6) */
86 int tm_yday; /* Days since Jan. 1: 0-365 */
87 int tm_isdst; /* +1 Daylight Savings Time, 0 No DST,
88 * -1 don't know */
89};
90
91#ifdef __cplusplus
92extern "C" {
93#endif71#endif
94
95clock_t clock (void);
96time_t time (time_t*);
97double difftime (time_t, time_t);
98time_t mktime (struct tm*);
99
100/*
101 * These functions write to and return pointers to static buffers that may
102 * be overwritten by other function calls. Yikes!
103 *
104 * NOTE: localtime, and perhaps the others of the four functions grouped
105 * below may return NULL if their argument is not 'acceptable'. Also note
106 * that calling asctime with a NULL pointer will produce an Invalid Page
107 * Fault and crap out your program. Guess how I know. Hint: stat called on
108 * a directory gives 'invalid' times in st_atime etc...
109 */
110char* asctime (const struct tm*);
111char* ctime (const time_t*);
112struct tm* gmtime (const time_t*);
113struct tm* localtime (const time_t*);
114
115
116size_t strftime (char*, size_t, const char*, const struct tm*);
117
118size_t wcsftime (wchar_t*, size_t, const wchar_t*, const struct tm*);
119
120#ifndef __STRICT_ANSI__
121extern void _tzset (void);
122
123#ifndef _NO_OLDNAMES
124extern void tzset (void);
125#endif72#endif
126 73
127size_t strftime(char*, size_t, const char*, const struct tm*);74#ifndef _SSIZE_T_DEFINED
128char* _strdate(char*);75#define _SSIZE_T_DEFINED
129char* _strtime(char*);76#undef ssize_t
130 77#ifdef _WIN64
131#endif /* Not __STRICT_ANSI__ */78#if defined(__GNUC__) && defined(__STRICT_ANSI__)
132 79 typedef int ssize_t __attribute__ ((mode (DI)));
133/*80#else
134 * _daylight: non zero if daylight savings time is used.81 typedef __int64 ssize_t;
135 * _timezone: difference in seconds between GMT and local time.82#endif
136 * _tzname: standard/daylight savings time zone names (an array with two83#else
137 * elements).84 typedef int ssize_t;
138 */85#endif
139#ifdef __MSVCRT__86#endif
140
141/* These are for compatibility with pre-VC 5.0 suppied MSVCRT. */
142extern int* __p__daylight (void);
143extern long* __p__timezone (void);
144extern char** __p__tzname (void);
145
146__MINGW_IMPORT int _daylight;
147__MINGW_IMPORT long _timezone;
148__MINGW_IMPORT char *_tzname[2];
149
150#else /* not __MSVCRT (ie. crtdll) */
151
152#ifndef __DECLSPEC_SUPPORTED
153
154extern int* __imp__daylight_dll;
155extern long* __imp__timezone_dll;
156extern char** __imp__tzname;
157
158#define _daylight (*__imp__daylight_dll)
159#define _timezone (*__imp__timezone_dll)
160#define _tzname (__imp__tzname)
161
162#else /* __DECLSPEC_SUPPORTED */
163
164__MINGW_IMPORT int _daylight_dll;
165__MINGW_IMPORT long _timezone_dll;
166__MINGW_IMPORT char* _tzname[2];
167 87
168#define _daylight _daylight_dll88#ifndef NULL
169#define _timezone _timezone_dll89#ifdef __cplusplus
90#define NULL 0
91#else
92#define NULL ((void *)0)
93#endif
94#endif
170 95
171#endif /* __DECLSPEC_SUPPORTED */96#ifdef _USE_32BIT_TIME_T
97#define _localtime32 localtime
98#define _difftime32 difftime
99#define _ctime32 ctime
100#define _gmtime32 gmtime
101#define _mktime32 mktime
102#define _time32 time
103#endif
172 104
173#endif /* not __MSVCRT__ */105#ifndef _TM_DEFINED
106#define _TM_DEFINED
107 struct tm {
108 int tm_sec;
109 int tm_min;
110 int tm_hour;
111 int tm_mday;
112 int tm_mon;
113 int tm_year;
114 int tm_wday;
115 int tm_yday;
116 int tm_isdst;
117 };
118#endif
174 119
175#ifndef _NO_OLDNAMES120#define CLOCKS_PER_SEC 1000
121
122//!__TINYC__: __MINGW_IMPORT int _daylight;
123//!__TINYC__: __MINGW_IMPORT long _dstbias;
124//!__TINYC__: __MINGW_IMPORT long _timezone;
125//!__TINYC__: __MINGW_IMPORT char * _tzname[2];
126 _CRTIMP errno_t __cdecl _get_daylight(int *_Daylight);
127 _CRTIMP errno_t __cdecl _get_dstbias(long *_Daylight_savings_bias);
128 _CRTIMP errno_t __cdecl _get_timezone(long *_Timezone);
129 _CRTIMP errno_t __cdecl _get_tzname(size_t *_ReturnValue,char *_Buffer,size_t _SizeInBytes,int _Index);
130 char *__cdecl asctime(const struct tm *_Tm);
131 _CRTIMP char *__cdecl _ctime32(const __time32_t *_Time);
132 clock_t __cdecl clock(void);
133 _CRTIMP double __cdecl _difftime32(__time32_t _Time1,__time32_t _Time2);
134 _CRTIMP struct tm *__cdecl _gmtime32(const __time32_t *_Time);
135 _CRTIMP struct tm *__cdecl _localtime32(const __time32_t *_Time);
136 size_t __cdecl strftime(char *_Buf,size_t _SizeInBytes,const char *_Format,const struct tm *_Tm);
137 _CRTIMP size_t __cdecl _strftime_l(char *_Buf,size_t _Max_size,const char *_Format,const struct tm *_Tm,_locale_t _Locale);
138 _CRTIMP char *__cdecl _strdate(char *_Buffer);
139 _CRTIMP char *__cdecl _strtime(char *_Buffer);
140 _CRTIMP __time32_t __cdecl _time32(__time32_t *_Time);
141 _CRTIMP __time32_t __cdecl _mktime32(struct tm *_Tm);
142 _CRTIMP __time32_t __cdecl _mkgmtime32(struct tm *_Tm);
143#if defined (_POSIX_) || defined(__GNUC__)
144 void __cdecl tzset(void);
145#else
146 _CRTIMP void __cdecl _tzset(void);
147#endif
176 148
177#ifdef __MSVCRT__149#if _INTEGRAL_MAX_BITS >= 64
150 double __cdecl _difftime64(__time64_t _Time1,__time64_t _Time2);
151 _CRTIMP char *__cdecl _ctime64(const __time64_t *_Time);
152 _CRTIMP struct tm *__cdecl _gmtime64(const __time64_t *_Time);
153 _CRTIMP struct tm *__cdecl _localtime64(const __time64_t *_Time);
154 _CRTIMP __time64_t __cdecl _mktime64(struct tm *_Tm);
155 _CRTIMP __time64_t __cdecl _mkgmtime64(struct tm *_Tm);
156 _CRTIMP __time64_t __cdecl _time64(__time64_t *_Time);
157#endif
158 unsigned __cdecl _getsystime(struct tm *_Tm);
159 unsigned __cdecl _setsystime(struct tm *_Tm,unsigned _MilliSec);
160
161#ifndef _SIZE_T_DEFINED
162#define _SIZE_T_DEFINED
163#ifdef _WIN64
164#if defined(__GNUC__) && defined(__STRICT_ANSI__)
165 typedef unsigned int size_t __attribute__ ((mode (DI)));
166#else
167 typedef unsigned __int64 size_t;
168#endif
169#else
170 typedef unsigned long size_t;
171#endif
172#endif
178 173
179/* These go in the oldnames import library for MSVCRT. */174#ifndef _SSIZE_T_DEFINED
180__MINGW_IMPORT int daylight;175#define _SSIZE_T_DEFINED
181__MINGW_IMPORT long timezone;176#ifdef _WIN64
182__MINGW_IMPORT char *tzname[2];177#if defined(__GNUC__) && defined(__STRICT_ANSI__)
178 typedef int ssize_t __attribute__ ((mode (DI)));
179#else
180 typedef __int64 ssize_t;
181#endif
182#else
183 typedef long ssize_t;
184#endif
185#endif
183 186
184#ifndef _WTIME_DEFINED187#ifndef _WTIME_DEFINED
188 _CRTIMP wchar_t *__cdecl _wasctime(const struct tm *_Tm);
189 _CRTIMP wchar_t *__cdecl _wctime32(const __time32_t *_Time);
190 size_t __cdecl wcsftime(wchar_t *_Buf,size_t _SizeInWords,const wchar_t *_Format,const struct tm *_Tm);
191 _CRTIMP size_t __cdecl _wcsftime_l(wchar_t *_Buf,size_t _SizeInWords,const wchar_t *_Format,const struct tm *_Tm,_locale_t _Locale);
192 _CRTIMP wchar_t *__cdecl _wstrdate(wchar_t *_Buffer);
193 _CRTIMP wchar_t *__cdecl _wstrtime(wchar_t *_Buffer);
194#if _INTEGRAL_MAX_BITS >= 64
195 _CRTIMP wchar_t *__cdecl _wctime64(const __time64_t *_Time);
196#endif
185 197
186/* wide function prototypes, also declared in wchar.h */198#if !defined (RC_INVOKED) && !defined (_INC_WTIME_INL)
187 199#define _INC_WTIME_INL
188wchar_t * _wasctime(const struct tm*);200#ifdef _USE_32BIT_TIME_T
189wchar_t * _wctime(const time_t*);201__CRT_INLINE wchar_t *__cdecl _wctime(const time_t *_Time) { return _wctime32(_Time); }
190wchar_t* _wstrdate(wchar_t*);202#else
191wchar_t* _wstrtime(wchar_t*);203__CRT_INLINE wchar_t *__cdecl _wctime(const time_t *_Time) { return _wctime64(_Time); }
204#endif
205#endif
192 206
193#define _WTIME_DEFINED207#define _WTIME_DEFINED
194#endif /* _WTIME_DEFINED */ 208#endif
195 209
210#ifndef RC_INVOKED
211double __cdecl difftime(time_t _Time1,time_t _Time2);
212char *__cdecl ctime(const time_t *_Time);
213struct tm *__cdecl gmtime(const time_t *_Time);
214struct tm *__cdecl localtime(const time_t *_Time);
215struct tm *__cdecl localtime_r(const time_t *_Time,struct tm *);
216
217time_t __cdecl mktime(struct tm *_Tm);
218time_t __cdecl _mkgmtime(struct tm *_Tm);
219time_t __cdecl time(time_t *_Time);
220
221#ifdef _USE_32BIT_TIME_T
222#if 0
223__CRT_INLINE double __cdecl difftime(time_t _Time1,time_t _Time2) { return _difftime32(_Time1,_Time2); }
224__CRT_INLINE char *__cdecl ctime(const time_t *_Time) { return _ctime32(_Time); }
225__CRT_INLINE struct tm *__cdecl gmtime(const time_t *_Time) { return _gmtime32(_Time); }
226__CRT_INLINE struct tm *__cdecl localtime(const time_t *_Time) { return _localtime32(_Time); }
227__CRT_INLINE time_t __cdecl mktime(struct tm *_Tm) { return _mktime32(_Tm); }
228__CRT_INLINE time_t __cdecl _mkgmtime(struct tm *_Tm) { return _mkgmtime32(_Tm); }
229__CRT_INLINE time_t __cdecl time(time_t *_Time) { return _time32(_Time); }
230#endif
231#else
232__CRT_INLINE double __cdecl difftime(time_t _Time1,time_t _Time2) { return _difftime64(_Time1,_Time2); }
233__CRT_INLINE char *__cdecl ctime(const time_t *_Time) { return _ctime64(_Time); }
234__CRT_INLINE struct tm *__cdecl gmtime(const time_t *_Time) { return _gmtime64(_Time); }
235__CRT_INLINE struct tm *__cdecl localtime(const time_t *_Time) { return _localtime64(_Time); }
236__CRT_INLINE time_t __cdecl mktime(struct tm *_Tm) { return _mktime64(_Tm); }
237__CRT_INLINE time_t __cdecl _mkgmtime(struct tm *_Tm) { return _mkgmtime64(_Tm); }
238__CRT_INLINE time_t __cdecl time(time_t *_Time) { return _time64(_Time); }
239#endif
240#endif
196 241
197#else /* not __MSVCRT__ */242#if !defined(NO_OLDNAMES) || defined(_POSIX)
243#define CLK_TCK CLOCKS_PER_SEC
198 244
199/* CRTDLL is royally messed up when it comes to these macros.245 _CRTIMP extern int daylight;
200 TODO: import and alias these via oldnames import library instead 246 _CRTIMP extern long timezone;
201 of macros. */247 _CRTIMP extern char *tzname[2];
248 void __cdecl tzset(void);
249#endif
202 250
203#define daylight _daylight251#ifndef _TIMEVAL_DEFINED /* also in winsock[2].h */
204/* NOTE: timezone not defined because it would conflict with sys/timeb.h.252#define _TIMEVAL_DEFINED
205 Also, tzname used to a be macro, but now it's in moldname. */253struct timeval {
206__MINGW_IMPORT char *tzname[2];254 long tv_sec;
255 long tv_usec;
256};
257#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
258#define timercmp(tvp,uvp,cmp) ((tvp)->tv_sec cmp (uvp)->tv_sec || (tvp)->tv_sec==(uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec)
259#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
260#endif /* _TIMEVAL_DEFINED */
207 261
208#endif /* not __MSVCRT__ */262#ifndef __STRICT_ANSI__
263#ifndef _TIMEZONE_DEFINED /* also in sys/time.h */
264#define _TIMEZONE_DEFINED
265struct timezone {
266 int tz_minuteswest;
267 int tz_dsttime;
268};
209 269
210#endif /* Not _NO_OLDNAMES */270 extern int __cdecl mingw_gettimeofday (struct timeval *p, struct timezone *z);
271#endif
272#endif /* __STRICT_ANSI__ */
211 273
212#ifdef __cplusplus274#ifdef __cplusplus
213}275}
214#endif276#endif
215 277
216#endif /* Not RC_INVOKED */278#pragma pack(pop)
279
280#include <sec_api/time_s.h>
281
282/* Adding timespec definition. */
283#include <sys/timeb.h>
217 284
218#endif /* Not _TIME_H_ */285#endif /* End _TIME_H_ */
219 286
win32/include/unistd.h+30−0
@@ -1,3 +1,8 @@
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 */
1/*6/*
2 * This file is part of the Mingw32 package.7 * This file is part of the Mingw32 package.
3 *8 *
@@ -5,6 +10,31 @@ · 1 unmodified line
5 */10 */
6 11
7#ifndef __STRICT_ANSI__12#ifndef __STRICT_ANSI__
13
8#include <io.h>14#include <io.h>
15#include <process.h>
16
17#define __UNISTD_GETOPT__
18#include <getopt.h>
19#undef __UNISTD_GETOPT__
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
25#ifndef FTRUNCATE_DEFINED
26#define FTRUNCATE_DEFINED
27/* This is defined as a real library function to allow autoconf
28 to verify its existence. */
29int ftruncate(int, off_t);
30__CRT_INLINE int ftruncate(int __fd, off_t __length)
31{
32 return _chsize (__fd, __length);
33}
34#endif
35
36#ifdef __cplusplus
37}
9#endif38#endif
10 39
40#endif
win32/include/vadefs.h+11−0
@@ -0,0 +1,11 @@
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_VADEFS
7#define _INC_VADEFS
8
9//!__TINYC__: GNUC specific stuff removed
10
11#endif
win32/include/varargs.h+0−11
@@ -1,11 +0,0 @@
1#ifndef _VARARGS_H
2#define _VARARGS_H
3
4#include <stdarg.h>
5
6#define va_dcl
7#define va_alist __va_alist
8#undef va_start
9#define va_start(ap) ap = __builtin_varargs_start
10
11#endif
win32/include/wchar.h+813−260
@@ -1,206 +1,429 @@
1/*1/**
2 * wchar.h2 * This file has no copyright assigned and is placed in the Public Domain.
3 *3 * This file is part of the w64 mingw-runtime package.
4 * Defines of all functions for supporting wide characters. Actually it4 * No warranty is given; refer to the file DISCLAIMER within this package.
5 * just includes all those headers, which is not a good thing to do from a
6 * processing time point of view, but it does mean that everything will be
7 * in sync.
8 *
9 * This file is part of the Mingw32 package.
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 */5 */
6#ifndef _INC_WCHAR
7#define _INC_WCHAR
26 8
27#ifndef _WCHAR_H_
28#define _WCHAR_H_
29
30/* All the headers include this file. */
31#include <_mingw.h>9#include <_mingw.h>
32 10
33#include <ctype.h>11#pragma pack(push,_CRT_PACKING)
34#include <stdio.h>
35#include <stdlib.h>
36#include <string.h>
37#include <time.h>
38#include <sys/types.h>
39 12
40#define __need_size_t13#ifdef __cplusplus
41#define __need_wint_t14extern "C" {
42#define __need_wchar_t15#endif
43#ifndef RC_INVOKED
44#include <stddef.h>
45#endif /* Not RC_INVOKED */
46 16
47#define WCHAR_MIN 017#define WCHAR_MIN 0
48#define WCHAR_MAX ((wchar_t)-1)18#define WCHAR_MAX ((wchar_t) -1) /* UINT16_MAX */
49 19
50#ifndef RC_INVOKED20#ifndef __GNUC_VA_LIST
21#define __GNUC_VA_LIST
22 typedef __builtin_va_list __gnuc_va_list;
23#endif
51 24
52#ifdef __cplusplus 25#ifndef _VA_LIST_DEFINED
53extern "C" {26#define _VA_LIST_DEFINED
27 typedef __gnuc_va_list va_list;
28#endif
29
30#ifndef WEOF
31#define WEOF (wint_t)(0xFFFF)
54#endif32#endif
55 33
56#ifndef __STRICT_ANSI__34#ifndef _FILE_DEFINED
35 struct _iobuf {
36 char *_ptr;
37 int _cnt;
38 char *_base;
39 int _flag;
40 int _file;
41 int _charbuf;
42 int _bufsiz;
43 char *_tmpfname;
44 };
45 typedef struct _iobuf FILE;
46#define _FILE_DEFINED
47#endif
57 48
58#ifndef _FSIZE_T_DEFINED49#ifndef _STDIO_DEFINED
59typedef unsigned long _fsize_t;50#ifdef _WIN64
51 _CRTIMP FILE *__cdecl __iob_func(void);
52#else
53#ifdef _MSVCRT_
54extern FILE _iob[]; /* A pointer to an array of FILE */
55#define __iob_func() (_iob)
56#else
57extern FILE (*_imp___iob)[]; /* A pointer to an array of FILE */
58#define __iob_func() (*_imp___iob)
59#define _iob __iob_func()
60#endif
61#endif
62
63#define _iob __iob_func()
64#endif
65
66#ifndef _STDSTREAM_DEFINED
67#define stdin (&__iob_func()[0])
68#define stdout (&__iob_func()[1])
69#define stderr (&__iob_func()[2])
70#define _STDSTREAM_DEFINED
71#endif
72
73#ifndef _FSIZE_T_DEFINED
74 typedef unsigned long _fsize_t;
60#define _FSIZE_T_DEFINED75#define _FSIZE_T_DEFINED
61#endif76#endif
62 77
63#ifndef _WFINDDATA_T_DEFINED78#ifndef _WFINDDATA_T_DEFINED
64struct _wfinddata_t {79 struct _wfinddata32_t {
65 unsigned attrib;80 unsigned attrib;
66 time_t time_create; /* -1 for FAT file systems */81 __time32_t time_create;
67 time_t time_access; /* -1 for FAT file systems */82 __time32_t time_access;
68 time_t time_write;83 __time32_t time_write;
69 _fsize_t size;84 _fsize_t size;
70 wchar_t name[FILENAME_MAX]; /* may include spaces. */85 wchar_t name[260];
71};86 };
72struct _wfinddatai64_t {87
73 unsigned attrib;88/* #if _INTEGRAL_MAX_BITS >= 64 */
74 time_t time_create;89
75 time_t time_access;90 struct _wfinddata32i64_t {
76 time_t time_write;91 unsigned attrib;
77 __int64 size;92 __time32_t time_create;
78 wchar_t name[FILENAME_MAX];93 __time32_t time_access;
79};94 __time32_t time_write;
95 __int64 size;
96 wchar_t name[260];
97 };
98
99 struct _wfinddata64i32_t {
100 unsigned attrib;
101 __time64_t time_create;
102 __time64_t time_access;
103 __time64_t time_write;
104 _fsize_t size;
105 wchar_t name[260];
106 };
107
108 struct _wfinddata64_t {
109 unsigned attrib;
110 __time64_t time_create;
111 __time64_t time_access;
112 __time64_t time_write;
113 __int64 size;
114 wchar_t name[260];
115 };
116/* #endif */
117
118#ifdef _USE_32BIT_TIME_T
119#define _wfinddata_t _wfinddata32_t
120#define _wfinddatai64_t _wfinddata32i64_t
121
122#define _wfindfirst _wfindfirst32
123#define _wfindnext _wfindnext32
124#define _wfindfirsti64 _wfindfirst32i64
125#define _wfindnexti64 _wfindnext32i64
126#else
127#define _wfinddata_t _wfinddata64i32_t
128#define _wfinddatai64_t _wfinddata64_t
129
130#define _wfindfirst _wfindfirst64i32
131#define _wfindnext _wfindnext64i32
132#define _wfindfirsti64 _wfindfirst64
133#define _wfindnexti64 _wfindnext64
134#endif
135
80#define _WFINDDATA_T_DEFINED136#define _WFINDDATA_T_DEFINED
81#endif137#endif
82 138
83/* Wide character versions. Also defined in io.h. */139#ifndef NULL
84/* CHECK: I believe these only exist in MSVCRT, and not in CRTDLL. Also140#ifdef __cplusplus
85 applies to other wide character versions? */141#define NULL 0
86#if !defined (_WIO_DEFINED)142#else
87#if defined (__MSVCRT__)143#define NULL ((void *)0)
88int _waccess (const wchar_t*, int);144#endif
89int _wchmod (const wchar_t*, int);145#endif
90int _wcreat (const wchar_t*, int);
91long _wfindfirst (wchar_t*, struct _wfinddata_t *);
92int _wfindnext (long, struct _wfinddata_t *);
93int _wunlink (const wchar_t*);
94int _wopen (const wchar_t*, int, ...);
95int _wsopen (const wchar_t*, int, int, ...);
96wchar_t* _wmktemp (wchar_t*);
97long _wfindfirsti64 (const wchar_t*, struct _wfinddatai64_t*);
98int _wfindnexti64 (long, struct _wfinddatai64_t*);
99#endif /* defined (__MSVCRT__) */
100#define _WIO_DEFINED
101#endif /* _WIO_DEFINED */
102 146
103#ifndef _WSTDIO_DEFINED147#ifndef _CONST_RETURN
104/* also in stdio.h - keep in sync */148#define _CONST_RETURN
105int fwprintf (FILE*, const wchar_t*, ...);149#endif
106int wprintf (const wchar_t*, ...);
107int swprintf (wchar_t*, const wchar_t*, ...);
108int _snwprintf (wchar_t*, size_t, const wchar_t*, ...);
109int vfwprintf (FILE*, const wchar_t*, va_list);
110int vwprintf (const wchar_t*, va_list);
111int vswprintf (wchar_t*, const wchar_t*, va_list);
112int _vsnwprintf (wchar_t*, size_t, const wchar_t*, va_list);
113int fwscanf (FILE*, const wchar_t*, ...);
114int wscanf (const wchar_t*, ...);
115int swscanf (const wchar_t*, const wchar_t*, ...);
116wint_t fgetwc (FILE*);
117wint_t fputwc (wchar_t, FILE*);
118wint_t ungetwc (wchar_t, FILE*);
119 150
120#ifndef __NO_ISOCEXT /* externs in libmingwex.a */151#define _WConst_return _CONST_RETURN
121int snwprintf(wchar_t* s, size_t n, const wchar_t* format, ...);152
122extern inline int vsnwprintf (wchar_t* s, size_t n, const wchar_t* format,153#ifndef _CRT_CTYPEDATA_DEFINED
123 va_list arg)154#define _CRT_CTYPEDATA_DEFINED
124 { return _vsnwprintf ( s, n, format, arg); }155#ifndef _CTYPE_DISABLE_MACROS
125#endif156
126 157#ifndef __PCTYPE_FUNC
127#ifdef __MSVCRT__ 158#define __PCTYPE_FUNC __pctype_func()
128wchar_t* fgetws (wchar_t*, int, FILE*);159#ifdef _MSVCRT_
129int fputws (const wchar_t*, FILE*);160#define __pctype_func() (_pctype)
130wint_t getwc (FILE*);161#else
131wint_t getwchar (void);162#define __pctype_func() (*_imp___pctype)
132wchar_t* _getws (wchar_t*);163#endif
133wint_t putwc (wint_t, FILE*);164#endif
134int _putws (const wchar_t*);165
135wint_t putwchar (wint_t);166#ifndef _pctype
136 167#ifdef _MSVCRT_
137FILE* _wfopen (const wchar_t*, const wchar_t*);168 extern unsigned short *_pctype;
138FILE* _wfreopen (const wchar_t*, const wchar_t*, FILE*);169#else
139FILE* _wfsopen (const wchar_t*, const wchar_t*, int);170 extern unsigned short **_imp___pctype;
140wchar_t* _wtmpnam (wchar_t*);171#define _pctype (*_imp___pctype)
141wchar_t* _wtempnam (const wchar_t*, const wchar_t*);172#endif
142int _wrename (const wchar_t*, const wchar_t*);173#endif
143int _wremove (const wchar_t*)174#endif
144 175#endif
145FILE* _wpopen (const wchar_t*, const wchar_t*)176
146void _wperror (const wchar_t*);177#ifndef _CRT_WCTYPEDATA_DEFINED
147#endif /* __MSVCRT__ */178#define _CRT_WCTYPEDATA_DEFINED
148#define _WSTDIO_DEFINED179#ifndef _CTYPE_DISABLE_MACROS
149#endif /* _WSTDIO_DEFINED */180#ifndef _wctype
181#ifdef _MSVCRT_
182 extern unsigned short *_wctype;
183#else
184 extern unsigned short **_imp___wctype;
185#define _wctype (*_imp___wctype)
186#endif
187#endif
188
189#ifdef _MSVCRT_
190#define __pwctype_func() (_pwctype)
191#else
192#define __pwctype_func() (*_imp___pwctype)
193#endif
194
195#ifndef _pwctype
196#ifdef _MSVCRT_
197 extern unsigned short *_pwctype;
198#else
199 extern unsigned short **_imp___pwctype;
200#define _pwctype (*_imp___pwctype)
201#endif
202#endif
203
204#endif
205#endif
206
207#define _UPPER 0x1
208#define _LOWER 0x2
209#define _DIGIT 0x4
210#define _SPACE 0x8
211
212#define _PUNCT 0x10
213#define _CONTROL 0x20
214#define _BLANK 0x40
215#define _HEX 0x80
216
217#define _LEADBYTE 0x8000
218#define _ALPHA (0x0100|_UPPER|_LOWER)
219
220#ifndef _WCTYPE_DEFINED
221#define _WCTYPE_DEFINED
222
223 int __cdecl iswalpha(wint_t _C);
224 _CRTIMP int __cdecl _iswalpha_l(wint_t _C,_locale_t _Locale);
225 int __cdecl iswupper(wint_t _C);
226 _CRTIMP int __cdecl _iswupper_l(wint_t _C,_locale_t _Locale);
227 int __cdecl iswlower(wint_t _C);
228 _CRTIMP int __cdecl _iswlower_l(wint_t _C,_locale_t _Locale);
229 int __cdecl iswdigit(wint_t _C);
230 _CRTIMP int __cdecl _iswdigit_l(wint_t _C,_locale_t _Locale);
231 int __cdecl iswxdigit(wint_t _C);
232 _CRTIMP int __cdecl _iswxdigit_l(wint_t _C,_locale_t _Locale);
233 int __cdecl iswspace(wint_t _C);
234 _CRTIMP int __cdecl _iswspace_l(wint_t _C,_locale_t _Locale);
235 int __cdecl iswpunct(wint_t _C);
236 _CRTIMP int __cdecl _iswpunct_l(wint_t _C,_locale_t _Locale);
237 int __cdecl iswalnum(wint_t _C);
238 _CRTIMP int __cdecl _iswalnum_l(wint_t _C,_locale_t _Locale);
239 int __cdecl iswprint(wint_t _C);
240 _CRTIMP int __cdecl _iswprint_l(wint_t _C,_locale_t _Locale);
241 int __cdecl iswgraph(wint_t _C);
242 _CRTIMP int __cdecl _iswgraph_l(wint_t _C,_locale_t _Locale);
243 int __cdecl iswcntrl(wint_t _C);
244 _CRTIMP int __cdecl _iswcntrl_l(wint_t _C,_locale_t _Locale);
245 int __cdecl iswascii(wint_t _C);
246 int __cdecl isleadbyte(int _C);
247 _CRTIMP int __cdecl _isleadbyte_l(int _C,_locale_t _Locale);
248 wint_t __cdecl towupper(wint_t _C);
249 _CRTIMP wint_t __cdecl _towupper_l(wint_t _C,_locale_t _Locale);
250 wint_t __cdecl towlower(wint_t _C);
251 _CRTIMP wint_t __cdecl _towlower_l(wint_t _C,_locale_t _Locale);
252 int __cdecl iswctype(wint_t _C,wctype_t _Type);
253 _CRTIMP int __cdecl _iswctype_l(wint_t _C,wctype_t _Type,_locale_t _Locale);
254 _CRTIMP int __cdecl __iswcsymf(wint_t _C);
255 _CRTIMP int __cdecl _iswcsymf_l(wint_t _C,_locale_t _Locale);
256 _CRTIMP int __cdecl __iswcsym(wint_t _C);
257 _CRTIMP int __cdecl _iswcsym_l(wint_t _C,_locale_t _Locale);
258 int __cdecl is_wctype(wint_t _C,wctype_t _Type);
259#endif
150 260
151#ifndef _WDIRECT_DEFINED261#ifndef _WDIRECT_DEFINED
152/* Also in direct.h */
153#ifdef __MSVCRT__
154int _wchdir (const wchar_t*);
155wchar_t* _wgetcwd (wchar_t*, int);
156wchar_t* _wgetdcwd (int, wchar_t*, int);
157int _wmkdir (const wchar_t*);
158int _wrmdir (const wchar_t*);
159#endif /* __MSVCRT__ */
160#define _WDIRECT_DEFINED262#define _WDIRECT_DEFINED
161#endif /* _WDIRECT_DEFINED */263
264 _CRTIMP wchar_t *__cdecl _wgetcwd(wchar_t *_DstBuf,int _SizeInWords);
265 _CRTIMP wchar_t *__cdecl _wgetdcwd(int _Drive,wchar_t *_DstBuf,int _SizeInWords);
266 wchar_t *__cdecl _wgetdcwd_nolock(int _Drive,wchar_t *_DstBuf,int _SizeInWords);
267 _CRTIMP int __cdecl _wchdir(const wchar_t *_Path);
268 _CRTIMP int __cdecl _wmkdir(const wchar_t *_Path);
269 _CRTIMP int __cdecl _wrmdir(const wchar_t *_Path);
270#endif
271
272#ifndef _WIO_DEFINED
273#define _WIO_DEFINED
274
275 _CRTIMP int __cdecl _waccess(const wchar_t *_Filename,int _AccessMode);
276 _CRTIMP int __cdecl _wchmod(const wchar_t *_Filename,int _Mode);
277 _CRTIMP int __cdecl _wcreat(const wchar_t *_Filename,int _PermissionMode);
278 _CRTIMP intptr_t __cdecl _wfindfirst32(const wchar_t *_Filename,struct _wfinddata32_t *_FindData);
279 _CRTIMP int __cdecl _wfindnext32(intptr_t _FindHandle,struct _wfinddata32_t *_FindData);
280 _CRTIMP int __cdecl _wunlink(const wchar_t *_Filename);
281 _CRTIMP int __cdecl _wrename(const wchar_t *_NewFilename,const wchar_t *_OldFilename);
282 _CRTIMP wchar_t *__cdecl _wmktemp(wchar_t *_TemplateName);
283#if _INTEGRAL_MAX_BITS >= 64
284 _CRTIMP intptr_t __cdecl _wfindfirst32i64(const wchar_t *_Filename,struct _wfinddata32i64_t *_FindData);
285 intptr_t __cdecl _wfindfirst64i32(const wchar_t *_Filename,struct _wfinddata64i32_t *_FindData);
286 _CRTIMP intptr_t __cdecl _wfindfirst64(const wchar_t *_Filename,struct _wfinddata64_t *_FindData);
287 _CRTIMP int __cdecl _wfindnext32i64(intptr_t _FindHandle,struct _wfinddata32i64_t *_FindData);
288 int __cdecl _wfindnext64i32(intptr_t _FindHandle,struct _wfinddata64i32_t *_FindData);
289 _CRTIMP int __cdecl _wfindnext64(intptr_t _FindHandle,struct _wfinddata64_t *_FindData);
290#endif
291 _CRTIMP errno_t __cdecl _wsopen_s(int *_FileHandle,const wchar_t *_Filename,int _OpenFlag,int _ShareFlag,int _PermissionFlag);
292#if !defined(__cplusplus) || !(defined(_X86_) && !defined(__x86_64))
293 _CRTIMP int __cdecl _wopen(const wchar_t *_Filename,int _OpenFlag,...);
294 _CRTIMP int __cdecl _wsopen(const wchar_t *_Filename,int _OpenFlag,int _ShareFlag,...);
295#else
296 extern "C++" _CRTIMP int __cdecl _wopen(const wchar_t *_Filename,int _OpenFlag,int _PermissionMode = 0);
297 extern "C++" _CRTIMP int __cdecl _wsopen(const wchar_t *_Filename,int _OpenFlag,int _ShareFlag,int _PermissionMode = 0);
298#endif
299#endif
300
301#ifndef _WLOCALE_DEFINED
302#define _WLOCALE_DEFINED
303 _CRTIMP wchar_t *__cdecl _wsetlocale(int _Category,const wchar_t *_Locale);
304#endif
305
306#ifndef _WPROCESS_DEFINED
307#define _WPROCESS_DEFINED
308
309 _CRTIMP intptr_t __cdecl _wexecl(const wchar_t *_Filename,const wchar_t *_ArgList,...);
310 _CRTIMP intptr_t __cdecl _wexecle(const wchar_t *_Filename,const wchar_t *_ArgList,...);
311 _CRTIMP intptr_t __cdecl _wexeclp(const wchar_t *_Filename,const wchar_t *_ArgList,...);
312 _CRTIMP intptr_t __cdecl _wexeclpe(const wchar_t *_Filename,const wchar_t *_ArgList,...);
313 _CRTIMP intptr_t __cdecl _wexecv(const wchar_t *_Filename,const wchar_t *const *_ArgList);
314 _CRTIMP intptr_t __cdecl _wexecve(const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env);
315 _CRTIMP intptr_t __cdecl _wexecvp(const wchar_t *_Filename,const wchar_t *const *_ArgList);
316 _CRTIMP intptr_t __cdecl _wexecvpe(const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env);
317 _CRTIMP intptr_t __cdecl _wspawnl(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...);
318 _CRTIMP intptr_t __cdecl _wspawnle(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...);
319 _CRTIMP intptr_t __cdecl _wspawnlp(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...);
320 _CRTIMP intptr_t __cdecl _wspawnlpe(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...);
321 _CRTIMP intptr_t __cdecl _wspawnv(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList);
322 _CRTIMP intptr_t __cdecl _wspawnve(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env);
323 _CRTIMP intptr_t __cdecl _wspawnvp(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList);
324 _CRTIMP intptr_t __cdecl _wspawnvpe(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env);
325#ifndef _CRT_WSYSTEM_DEFINED
326#define _CRT_WSYSTEM_DEFINED
327 _CRTIMP int __cdecl _wsystem(const wchar_t *_Command);
328#endif
329#endif
330
331#ifndef _WCTYPE_INLINE_DEFINED
332#undef _CRT_WCTYPE_NOINLINE
333#if !defined(__cplusplus) || defined(_CRT_WCTYPE_NOINLINE)
334#define iswalpha(_c) (iswctype(_c,_ALPHA))
335#define iswupper(_c) (iswctype(_c,_UPPER))
336#define iswlower(_c) (iswctype(_c,_LOWER))
337#define iswdigit(_c) (iswctype(_c,_DIGIT))
338#define iswxdigit(_c) (iswctype(_c,_HEX))
339#define iswspace(_c) (iswctype(_c,_SPACE))
340#define iswpunct(_c) (iswctype(_c,_PUNCT))
341#define iswalnum(_c) (iswctype(_c,_ALPHA|_DIGIT))
342#define iswprint(_c) (iswctype(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT))
343#define iswgraph(_c) (iswctype(_c,_PUNCT|_ALPHA|_DIGIT))
344#define iswcntrl(_c) (iswctype(_c,_CONTROL))
345#define iswascii(_c) ((unsigned)(_c) < 0x80)
346
347#define _iswalpha_l(_c,_p) (_iswctype_l(_c,_ALPHA,_p))
348#define _iswupper_l(_c,_p) (_iswctype_l(_c,_UPPER,_p))
349#define _iswlower_l(_c,_p) (_iswctype_l(_c,_LOWER,_p))
350#define _iswdigit_l(_c,_p) (_iswctype_l(_c,_DIGIT,_p))
351#define _iswxdigit_l(_c,_p) (_iswctype_l(_c,_HEX,_p))
352#define _iswspace_l(_c,_p) (_iswctype_l(_c,_SPACE,_p))
353#define _iswpunct_l(_c,_p) (_iswctype_l(_c,_PUNCT,_p))
354#define _iswalnum_l(_c,_p) (_iswctype_l(_c,_ALPHA|_DIGIT,_p))
355#define _iswprint_l(_c,_p) (_iswctype_l(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT,_p))
356#define _iswgraph_l(_c,_p) (_iswctype_l(_c,_PUNCT|_ALPHA|_DIGIT,_p))
357#define _iswcntrl_l(_c,_p) (_iswctype_l(_c,_CONTROL,_p))
358#ifndef _CTYPE_DISABLE_MACROS
359#define isleadbyte(_c) (__PCTYPE_FUNC[(unsigned char)(_c)] & _LEADBYTE)
360#endif
361#endif
362#define _WCTYPE_INLINE_DEFINED
363#endif
364
365#if !defined(_POSIX_) || defined(__GNUC__)
366#ifndef _INO_T_DEFINED
367#define _INO_T_DEFINED
368 typedef unsigned short _ino_t;
369#ifndef NO_OLDNAMES
370 typedef unsigned short ino_t;
371#endif
372#endif
373
374#ifndef _DEV_T_DEFINED
375#define _DEV_T_DEFINED
376 typedef unsigned int _dev_t;
377#ifndef NO_OLDNAMES
378 typedef unsigned int dev_t;
379#endif
380#endif
381
382#ifndef _OFF_T_DEFINED
383#define _OFF_T_DEFINED
384#ifndef _OFF_T_
385#define _OFF_T_
386 typedef long _off_t;
387#if !defined(NO_OLDNAMES) || defined(_POSIX)
388 typedef long off_t;
389#endif
390#endif
391#endif
392
393#ifndef _OFF64_T_DEFINED
394#define _OFF64_T_DEFINED
395 typedef long long _off64_t;
396#if !defined(NO_OLDNAMES) || defined(_POSIX)
397 typedef long long off64_t;
398#endif
399#endif
162 400
163#ifndef _STAT_DEFINED401#ifndef _STAT_DEFINED
164/*402#define _STAT_DEFINED
165 * The structure manipulated and returned by stat and fstat.403
166 *404#ifdef _USE_32BIT_TIME_T
167 * NOTE: If called on a directory the values in the time fields are not only405#ifdef WIN64
168 * invalid, they will cause localtime et. al. to return NULL. And calling406#define _fstat _fstat32
169 * asctime with a NULL pointer causes an Invalid Page Fault. So watch it!407#define _stat _stat32
170 */408#define _wstat _wstat32
171struct _stat409#else
172{410#define _fstat32 _fstat
173 _dev_t st_dev; /* Equivalent to drive number 0=A 1=B ... */411#define _stat32 _stat
174 _ino_t st_ino; /* Always zero ? */412#define _wstat32 _wstat
175 _mode_t st_mode; /* See above constants */413#endif
176 short st_nlink; /* Number of links. */414#define _fstati64 _fstat32i64
177 short st_uid; /* User: Maybe significant on NT ? */415#define _stati64 _stat32i64
178 short st_gid; /* Group: Ditto */416#define _wstati64 _wstat32i64
179 _dev_t st_rdev; /* Seems useless (not even filled in) */417#else
180 _off_t st_size; /* File size in bytes */418#define _fstat _fstat64i32
181 time_t st_atime; /* Accessed date (always 00:00 hrs local419#define _fstati64 _fstat64
182 * on FAT) */420#define _stat _stat64i32
183 time_t st_mtime; /* Modified time */421#define _stati64 _stat64
184 time_t st_ctime; /* Creation time */422#define _wstat _wstat64i32
185};423#define _wstati64 _wstat64
186 424#endif
187struct stat425
188{426 struct _stat32 {
189 _dev_t st_dev; /* Equivalent to drive number 0=A 1=B ... */
190 _ino_t st_ino; /* Always zero ? */
191 _mode_t st_mode; /* See above constants */
192 short st_nlink; /* Number of links. */
193 short st_uid; /* User: Maybe significant on NT ? */
194 short st_gid; /* Group: Ditto */
195 _dev_t st_rdev; /* Seems useless (not even filled in) */
196 _off_t st_size; /* File size in bytes */
197 time_t st_atime; /* Accessed date (always 00:00 hrs local
198 * on FAT) */
199 time_t st_mtime; /* Modified time */
200 time_t st_ctime; /* Creation time */
201};
202#if defined (__MSVCRT__)
203struct _stati64 {
204 _dev_t st_dev;427 _dev_t st_dev;
205 _ino_t st_ino;428 _ino_t st_ino;
206 unsigned short st_mode;429 unsigned short st_mode;
@@ -208,111 +431,441 @@ struct _stati64 { · 1 unmodified line
208 short st_uid;431 short st_uid;
209 short st_gid;432 short st_gid;
210 _dev_t st_rdev;433 _dev_t st_rdev;
211 __int64 st_size;434 _off_t st_size;
435 __time32_t st_atime;
436 __time32_t st_mtime;
437 __time32_t st_ctime;
438 };
439
440#ifndef NO_OLDNAMES
441 struct stat {
442 _dev_t st_dev;
443 _ino_t st_ino;
444 unsigned short st_mode;
445 short st_nlink;
446 short st_uid;
447 short st_gid;
448 _dev_t st_rdev;
449 _off_t st_size;
212 time_t st_atime;450 time_t st_atime;
213 time_t st_mtime;451 time_t st_mtime;
214 time_t st_ctime;452 time_t st_ctime;
215 };453 };
216#endif /* __MSVCRT__ */454#endif
217#define _STAT_DEFINED455
218#endif /* _STAT_DEFINED */456#if _INTEGRAL_MAX_BITS >= 64
219 457
220#if !defined ( _WSTAT_DEFINED)458 struct _stat32i64 {
221/* also declared in sys/stat.h */459 _dev_t st_dev;
222#if defined __MSVCRT__460 _ino_t st_ino;
223int _wstat (const wchar_t*, struct _stat*);461 unsigned short st_mode;
224int _wstati64 (const wchar_t*, struct _stati64*);462 short st_nlink;
225#endif /* __MSVCRT__ */463 short st_uid;
464 short st_gid;
465 _dev_t st_rdev;
466 __int64 st_size;
467 __time32_t st_atime;
468 __time32_t st_mtime;
469 __time32_t st_ctime;
470 };
471
472 struct _stat64i32 {
473 _dev_t st_dev;
474 _ino_t st_ino;
475 unsigned short st_mode;
476 short st_nlink;
477 short st_uid;
478 short st_gid;
479 _dev_t st_rdev;
480 _off_t st_size;
481 __time64_t st_atime;
482 __time64_t st_mtime;
483 __time64_t st_ctime;
484 };
485
486 struct _stat64 {
487 _dev_t st_dev;
488 _ino_t st_ino;
489 unsigned short st_mode;
490 short st_nlink;
491 short st_uid;
492 short st_gid;
493 _dev_t st_rdev;
494 __int64 st_size;
495 __time64_t st_atime;
496 __time64_t st_mtime;
497 __time64_t st_ctime;
498 };
499#endif
500
501#define __stat64 _stat64
502
503#endif
504
505#ifndef _WSTAT_DEFINED
226#define _WSTAT_DEFINED506#define _WSTAT_DEFINED
227#endif /* ! _WSTAT_DEFIND */
228 507
229#ifndef _WTIME_DEFINED508 _CRTIMP int __cdecl _wstat32(const wchar_t *_Name,struct _stat32 *_Stat);
230#ifdef __MSVCRT__509#if _INTEGRAL_MAX_BITS >= 64
231/* wide function prototypes, also declared in time.h */510 _CRTIMP int __cdecl _wstat32i64(const wchar_t *_Name,struct _stat32i64 *_Stat);
232wchar_t* _wasctime (const struct tm*);511 int __cdecl _wstat64i32(const wchar_t *_Name,struct _stat64i32 *_Stat);
233wchar_t* _wctime (const time_t*);512 _CRTIMP int __cdecl _wstat64(const wchar_t *_Name,struct _stat64 *_Stat);
234wchar_t* _wstrdate (wchar_t*);513#endif
235wchar_t* _wstrtime (wchar_t*);514#endif
236#endif /* __MSVCRT__ */515#endif
237size_t wcsftime (wchar_t*, size_t, const wchar_t*, const struct tm*);
238#define _WTIME_DEFINED
239#endif /* _WTIME_DEFINED */
240 516
241#ifndef _WLOCALE_DEFINED /* also declared in locale.h */517#ifndef _WCONIO_DEFINED
242wchar_t* _wsetlocale (int, const wchar_t*);518#define _WCONIO_DEFINED
243#define _WLOCALE_DEFINED519
520#ifndef WEOF
521#define WEOF (wint_t)(0xFFFF)
522#endif
523
524 _CRTIMP wchar_t *_cgetws(wchar_t *_Buffer);
525 _CRTIMP wint_t __cdecl _getwch(void);
526 _CRTIMP wint_t __cdecl _getwche(void);
527 _CRTIMP wint_t __cdecl _putwch(wchar_t _WCh);
528 _CRTIMP wint_t __cdecl _ungetwch(wint_t _WCh);
529 _CRTIMP int __cdecl _cputws(const wchar_t *_String);
530 _CRTIMP int __cdecl _cwprintf(const wchar_t *_Format,...);
531 _CRTIMP int __cdecl _cwscanf(const wchar_t *_Format,...);
532 _CRTIMP int __cdecl _cwscanf_l(const wchar_t *_Format,_locale_t _Locale,...);
533 _CRTIMP int __cdecl _vcwprintf(const wchar_t *_Format,va_list _ArgList);
534 _CRTIMP int __cdecl _cwprintf_p(const wchar_t *_Format,...);
535 _CRTIMP int __cdecl _vcwprintf_p(const wchar_t *_Format,va_list _ArgList);
536
537 _CRTIMP int __cdecl _cwprintf_l(const wchar_t *_Format,_locale_t _Locale,...);
538 _CRTIMP int __cdecl _vcwprintf_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
539 _CRTIMP int __cdecl _cwprintf_p_l(const wchar_t *_Format,_locale_t _Locale,...);
540 _CRTIMP int __cdecl _vcwprintf_p_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
541 wint_t __cdecl _putwch_nolock(wchar_t _WCh);
542 wint_t __cdecl _getwch_nolock(void);
543 wint_t __cdecl _getwche_nolock(void);
544 wint_t __cdecl _ungetwch_nolock(wint_t _WCh);
545#endif
546
547#ifndef _WSTDIO_DEFINED
548#define _WSTDIO_DEFINED
549
550#ifndef WEOF
551#define WEOF (wint_t)(0xFFFF)
552#endif
553
554#ifdef _POSIX_
555 _CRTIMP FILE *__cdecl _wfsopen(const wchar_t *_Filename,const wchar_t *_Mode);
556#else
557 _CRTIMP FILE *__cdecl _wfsopen(const wchar_t *_Filename,const wchar_t *_Mode,int _ShFlag);
558#endif
559
560 wint_t __cdecl fgetwc(FILE *_File);
561 _CRTIMP wint_t __cdecl _fgetwchar(void);
562 wint_t __cdecl fputwc(wchar_t _Ch,FILE *_File);
563 _CRTIMP wint_t __cdecl _fputwchar(wchar_t _Ch);
564 wint_t __cdecl getwc(FILE *_File);
565 wint_t __cdecl getwchar(void);
566 wint_t __cdecl putwc(wchar_t _Ch,FILE *_File);
567 wint_t __cdecl putwchar(wchar_t _Ch);
568 wint_t __cdecl ungetwc(wint_t _Ch,FILE *_File);
569 wchar_t *__cdecl fgetws(wchar_t *_Dst,int _SizeInWords,FILE *_File);
570 int __cdecl fputws(const wchar_t *_Str,FILE *_File);
571 _CRTIMP wchar_t *__cdecl _getws(wchar_t *_String);
572 _CRTIMP int __cdecl _putws(const wchar_t *_Str);
573 int __cdecl fwprintf(FILE *_File,const wchar_t *_Format,...);
574 int __cdecl wprintf(const wchar_t *_Format,...);
575 _CRTIMP int __cdecl _scwprintf(const wchar_t *_Format,...);
576 int __cdecl vfwprintf(FILE *_File,const wchar_t *_Format,va_list _ArgList);
577 int __cdecl vwprintf(const wchar_t *_Format,va_list _ArgList);
578 _CRTIMP int __cdecl swprintf(wchar_t*, const wchar_t*, ...);
579 _CRTIMP int __cdecl vswprintf(wchar_t*, const wchar_t*,va_list);
580 _CRTIMP int __cdecl _swprintf_c(wchar_t *_DstBuf,size_t _SizeInWords,const wchar_t *_Format,...);
581 _CRTIMP int __cdecl _vswprintf_c(wchar_t *_DstBuf,size_t _SizeInWords,const wchar_t *_Format,va_list _ArgList);
582 _CRTIMP int __cdecl _snwprintf(wchar_t *_Dest,size_t _Count,const wchar_t *_Format,...);
583 _CRTIMP int __cdecl _vsnwprintf(wchar_t *_Dest,size_t _Count,const wchar_t *_Format,va_list _Args);
584#ifndef __NO_ISOCEXT /* externs in libmingwex.a */
585 int __cdecl snwprintf (wchar_t *s, size_t n, const wchar_t * format, ...);
586 __CRT_INLINE int __cdecl vsnwprintf (wchar_t *s, size_t n, const wchar_t *format, va_list arg) { return _vsnwprintf(s,n,format,arg); }
587 int __cdecl vwscanf (const wchar_t *, va_list);
588 int __cdecl vfwscanf (FILE *,const wchar_t *,va_list);
589 int __cdecl vswscanf (const wchar_t *,const wchar_t *,va_list);
590#endif
591 _CRTIMP int __cdecl _fwprintf_p(FILE *_File,const wchar_t *_Format,...);
592 _CRTIMP int __cdecl _wprintf_p(const wchar_t *_Format,...);
593 _CRTIMP int __cdecl _vfwprintf_p(FILE *_File,const wchar_t *_Format,va_list _ArgList);
594 _CRTIMP int __cdecl _vwprintf_p(const wchar_t *_Format,va_list _ArgList);
595 _CRTIMP int __cdecl _swprintf_p(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,...);
596 _CRTIMP int __cdecl _vswprintf_p(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,va_list _ArgList);
597 _CRTIMP int __cdecl _scwprintf_p(const wchar_t *_Format,...);
598 _CRTIMP int __cdecl _vscwprintf_p(const wchar_t *_Format,va_list _ArgList);
599 _CRTIMP int __cdecl _wprintf_l(const wchar_t *_Format,_locale_t _Locale,...);
600 _CRTIMP int __cdecl _wprintf_p_l(const wchar_t *_Format,_locale_t _Locale,...);
601 _CRTIMP int __cdecl _vwprintf_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
602 _CRTIMP int __cdecl _vwprintf_p_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
603 _CRTIMP int __cdecl _fwprintf_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,...);
604 _CRTIMP int __cdecl _fwprintf_p_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,...);
605 _CRTIMP int __cdecl _vfwprintf_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
606 _CRTIMP int __cdecl _vfwprintf_p_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
607 _CRTIMP int __cdecl _swprintf_c_l(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,...);
608 _CRTIMP int __cdecl _swprintf_p_l(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,...);
609 _CRTIMP int __cdecl _vswprintf_c_l(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
610 _CRTIMP int __cdecl _vswprintf_p_l(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
611 _CRTIMP int __cdecl _scwprintf_l(const wchar_t *_Format,_locale_t _Locale,...);
612 _CRTIMP int __cdecl _scwprintf_p_l(const wchar_t *_Format,_locale_t _Locale,...);
613 _CRTIMP int __cdecl _vscwprintf_p_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
614 _CRTIMP int __cdecl _snwprintf_l(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,...);
615 _CRTIMP int __cdecl _vsnwprintf_l(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
616 _CRTIMP int __cdecl _swprintf(wchar_t *_Dest,const wchar_t *_Format,...);
617 _CRTIMP int __cdecl _vswprintf(wchar_t *_Dest,const wchar_t *_Format,va_list _Args);
618 _CRTIMP int __cdecl __swprintf_l(wchar_t *_Dest,const wchar_t *_Format,_locale_t _Plocinfo,...);
619 _CRTIMP int __cdecl __vswprintf_l(wchar_t *_Dest,const wchar_t *_Format,_locale_t _Plocinfo,va_list _Args);
620#ifndef RC_INVOKED
621#include <vadefs.h>
622#endif
623
624#ifdef _CRT_NON_CONFORMING_SWPRINTFS
625#ifndef __cplusplus
626#define swprintf _swprintf
627#define vswprintf _vswprintf
628#define _swprintf_l __swprintf_l
629#define _vswprintf_l __vswprintf_l
630#endif
631#endif
632
633 _CRTIMP wchar_t *__cdecl _wtempnam(const wchar_t *_Directory,const wchar_t *_FilePrefix);
634 _CRTIMP int __cdecl _vscwprintf(const wchar_t *_Format,va_list _ArgList);
635 _CRTIMP int __cdecl _vscwprintf_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList);
636 int __cdecl fwscanf(FILE *_File,const wchar_t *_Format,...);
637 _CRTIMP int __cdecl _fwscanf_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,...);
638 int __cdecl swscanf(const wchar_t *_Src,const wchar_t *_Format,...);
639 _CRTIMP int __cdecl _swscanf_l(const wchar_t *_Src,const wchar_t *_Format,_locale_t _Locale,...);
640 _CRTIMP int __cdecl _snwscanf(const wchar_t *_Src,size_t _MaxCount,const wchar_t *_Format,...);
641 _CRTIMP int __cdecl _snwscanf_l(const wchar_t *_Src,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,...);
642 int __cdecl wscanf(const wchar_t *_Format,...);
643 _CRTIMP int __cdecl _wscanf_l(const wchar_t *_Format,_locale_t _Locale,...);
644 _CRTIMP FILE *__cdecl _wfdopen(int _FileHandle ,const wchar_t *_Mode);
645 _CRTIMP FILE *__cdecl _wfopen(const wchar_t *_Filename,const wchar_t *_Mode);
646 _CRTIMP FILE *__cdecl _wfreopen(const wchar_t *_Filename,const wchar_t *_Mode,FILE *_OldFile);
647
648#ifndef _CRT_WPERROR_DEFINED
649#define _CRT_WPERROR_DEFINED
650 _CRTIMP void __cdecl _wperror(const wchar_t *_ErrMsg);
651#endif
652 _CRTIMP FILE *__cdecl _wpopen(const wchar_t *_Command,const wchar_t *_Mode);
653#if !defined(NO_OLDNAMES) && !defined(wpopen)
654#define wpopen _wpopen
655#endif
656 _CRTIMP int __cdecl _wremove(const wchar_t *_Filename);
657 _CRTIMP wchar_t *__cdecl _wtmpnam(wchar_t *_Buffer);
658 _CRTIMP wint_t __cdecl _fgetwc_nolock(FILE *_File);
659 _CRTIMP wint_t __cdecl _fputwc_nolock(wchar_t _Ch,FILE *_File);
660 _CRTIMP wint_t __cdecl _ungetwc_nolock(wint_t _Ch,FILE *_File);
661
662#undef _CRT_GETPUTWCHAR_NOINLINE
663
664#if !defined(__cplusplus) || defined(_CRT_GETPUTWCHAR_NOINLINE)
665#define getwchar() fgetwc(stdin)
666#define putwchar(_c) fputwc((_c),stdout)
667#else
668 __CRT_INLINE wint_t __cdecl getwchar() {return (fgetwc(stdin)); }
669 __CRT_INLINE wint_t __cdecl putwchar(wchar_t _C) {return (fputwc(_C,stdout)); }
670#endif
671
672#define getwc(_stm) fgetwc(_stm)
673#define putwc(_c,_stm) fputwc(_c,_stm)
674#define _putwc_nolock(_c,_stm) _fputwc_nolock(_c,_stm)
675#define _getwc_nolock(_c) _fgetwc_nolock(_c)
244#endif676#endif
245 677
246#ifndef _WSTDLIB_DEFINED /* also declared in stdlib.h */678#ifndef _WSTDLIB_DEFINED
247long wcstol (const wchar_t*, wchar_t**, int);679#define _WSTDLIB_DEFINED
248unsigned long wcstoul (const wchar_t*, wchar_t**, int);680
249double wcstod (const wchar_t*, wchar_t**);681 _CRTIMP wchar_t *__cdecl _itow(int _Value,wchar_t *_Dest,int _Radix);
250#if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */682 _CRTIMP wchar_t *__cdecl _ltow(long _Value,wchar_t *_Dest,int _Radix);
251extern __inline__ float wcstof( const wchar_t *nptr, wchar_t **endptr)683 _CRTIMP wchar_t *__cdecl _ultow(unsigned long _Value,wchar_t *_Dest,int _Radix);
252{ return (wcstod(nptr, endptr)); }684 double __cdecl wcstod(const wchar_t *_Str,wchar_t **_EndPtr);
685 _CRTIMP double __cdecl _wcstod_l(const wchar_t *_Str,wchar_t **_EndPtr,_locale_t _Locale);
686 float __cdecl wcstof( const wchar_t *nptr, wchar_t **endptr);
687#if !defined __NO_ISOCEXT /* in libmingwex.a */
688 float __cdecl wcstof (const wchar_t * __restrict__, wchar_t ** __restrict__);
689 long double __cdecl wcstold (const wchar_t * __restrict__, wchar_t ** __restrict__);
253#endif /* __NO_ISOCEXT */690#endif /* __NO_ISOCEXT */
254#define _WSTDLIB_DEFINED691 long __cdecl wcstol(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix);
692 _CRTIMP long __cdecl _wcstol_l(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix,_locale_t _Locale);
693 unsigned long __cdecl wcstoul(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix);
694 _CRTIMP unsigned long __cdecl _wcstoul_l(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix,_locale_t _Locale);
695 _CRTIMP wchar_t *__cdecl _wgetenv(const wchar_t *_VarName);
696#ifndef _CRT_WSYSTEM_DEFINED
697#define _CRT_WSYSTEM_DEFINED
698 _CRTIMP int __cdecl _wsystem(const wchar_t *_Command);
699#endif
700 _CRTIMP double __cdecl _wtof(const wchar_t *_Str);
701 _CRTIMP double __cdecl _wtof_l(const wchar_t *_Str,_locale_t _Locale);
702 _CRTIMP int __cdecl _wtoi(const wchar_t *_Str);
703 _CRTIMP int __cdecl _wtoi_l(const wchar_t *_Str,_locale_t _Locale);
704 _CRTIMP long __cdecl _wtol(const wchar_t *_Str);
705 _CRTIMP long __cdecl _wtol_l(const wchar_t *_Str,_locale_t _Locale);
706
707#if _INTEGRAL_MAX_BITS >= 64
708 _CRTIMP wchar_t *__cdecl _i64tow(__int64 _Val,wchar_t *_DstBuf,int _Radix);
709 _CRTIMP wchar_t *__cdecl _ui64tow(unsigned __int64 _Val,wchar_t *_DstBuf,int _Radix);
710 _CRTIMP __int64 __cdecl _wtoi64(const wchar_t *_Str);
711 _CRTIMP __int64 __cdecl _wtoi64_l(const wchar_t *_Str,_locale_t _Locale);
712 _CRTIMP __int64 __cdecl _wcstoi64(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix);
713 _CRTIMP __int64 __cdecl _wcstoi64_l(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix,_locale_t _Locale);
714 _CRTIMP unsigned __int64 __cdecl _wcstoui64(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix);
715 _CRTIMP unsigned __int64 __cdecl _wcstoui64_l(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix,_locale_t _Locale);
716#endif
255#endif717#endif
256 718
719#ifndef _POSIX_
720#ifndef _WSTDLIBP_DEFINED
721#define _WSTDLIBP_DEFINED
722 _CRTIMP wchar_t *__cdecl _wfullpath(wchar_t *_FullPath,const wchar_t *_Path,size_t _SizeInWords);
723 _CRTIMP void __cdecl _wmakepath(wchar_t *_ResultPath,const wchar_t *_Drive,const wchar_t *_Dir,const wchar_t *_Filename,const wchar_t *_Ext);
724#ifndef _CRT_WPERROR_DEFINED
725#define _CRT_WPERROR_DEFINED
726 _CRTIMP void __cdecl _wperror(const wchar_t *_ErrMsg);
727#endif
728 _CRTIMP int __cdecl _wputenv(const wchar_t *_EnvString);
729 _CRTIMP void __cdecl _wsearchenv(const wchar_t *_Filename,const wchar_t *_EnvVar,wchar_t *_ResultPath);
730 _CRTIMP void __cdecl _wsplitpath(const wchar_t *_FullPath,wchar_t *_Drive,wchar_t *_Dir,wchar_t *_Filename,wchar_t *_Ext);
731#endif
732#endif
257 733
258#ifndef _NO_OLDNAMES734#ifndef _WSTRING_DEFINED
735#define _WSTRING_DEFINED
736 _CRTIMP wchar_t *__cdecl _wcsdup(const wchar_t *_Str);
737 wchar_t *__cdecl wcscat(wchar_t *_Dest,const wchar_t *_Source);
738 _CONST_RETURN wchar_t *__cdecl wcschr(const wchar_t *_Str,wchar_t _Ch);
739 int __cdecl wcscmp(const wchar_t *_Str1,const wchar_t *_Str2);
740 wchar_t *__cdecl wcscpy(wchar_t *_Dest,const wchar_t *_Source);
741 size_t __cdecl wcscspn(const wchar_t *_Str,const wchar_t *_Control);
742 size_t __cdecl wcslen(const wchar_t *_Str);
743 size_t __cdecl wcsnlen(const wchar_t *_Src,size_t _MaxCount);
744 wchar_t *__cdecl wcsncat(wchar_t *_Dest,const wchar_t *_Source,size_t _Count);
745 int __cdecl wcsncmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount);
746 wchar_t *__cdecl wcsncpy(wchar_t *_Dest,const wchar_t *_Source,size_t _Count);
747 _CONST_RETURN wchar_t *__cdecl wcspbrk(const wchar_t *_Str,const wchar_t *_Control);
748 _CONST_RETURN wchar_t *__cdecl wcsrchr(const wchar_t *_Str,wchar_t _Ch);
749 size_t __cdecl wcsspn(const wchar_t *_Str,const wchar_t *_Control);
750 _CONST_RETURN wchar_t *__cdecl wcsstr(const wchar_t *_Str,const wchar_t *_SubStr);
751 wchar_t *__cdecl wcstok(wchar_t *_Str,const wchar_t *_Delim);
752 _CRTIMP wchar_t *__cdecl _wcserror(int _ErrNum);
753 _CRTIMP wchar_t *__cdecl __wcserror(const wchar_t *_Str);
754 _CRTIMP int __cdecl _wcsicmp(const wchar_t *_Str1,const wchar_t *_Str2);
755 _CRTIMP int __cdecl _wcsicmp_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale);
756 _CRTIMP int __cdecl _wcsnicmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount);
757 _CRTIMP int __cdecl _wcsnicmp_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale);
758 _CRTIMP wchar_t *__cdecl _wcsnset(wchar_t *_Str,wchar_t _Val,size_t _MaxCount);
759 _CRTIMP wchar_t *__cdecl _wcsrev(wchar_t *_Str);
760 _CRTIMP wchar_t *__cdecl _wcsset(wchar_t *_Str,wchar_t _Val);
761 _CRTIMP wchar_t *__cdecl _wcslwr(wchar_t *_String);
762 _CRTIMP wchar_t *_wcslwr_l(wchar_t *_String,_locale_t _Locale);
763 _CRTIMP wchar_t *__cdecl _wcsupr(wchar_t *_String);
764 _CRTIMP wchar_t *_wcsupr_l(wchar_t *_String,_locale_t _Locale);
765 size_t __cdecl wcsxfrm(wchar_t *_Dst,const wchar_t *_Src,size_t _MaxCount);
766 _CRTIMP size_t __cdecl _wcsxfrm_l(wchar_t *_Dst,const wchar_t *_Src,size_t _MaxCount,_locale_t _Locale);
767 int __cdecl wcscoll(const wchar_t *_Str1,const wchar_t *_Str2);
768 _CRTIMP int __cdecl _wcscoll_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale);
769 _CRTIMP int __cdecl _wcsicoll(const wchar_t *_Str1,const wchar_t *_Str2);
770 _CRTIMP int __cdecl _wcsicoll_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale);
771 _CRTIMP int __cdecl _wcsncoll(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount);
772 _CRTIMP int __cdecl _wcsncoll_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale);
773 _CRTIMP int __cdecl _wcsnicoll(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount);
774 _CRTIMP int __cdecl _wcsnicoll_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale);
775
776#ifndef NO_OLDNAMES
777 wchar_t *__cdecl wcsdup(const wchar_t *_Str);
778#define wcswcs wcsstr
779 int __cdecl wcsicmp(const wchar_t *_Str1,const wchar_t *_Str2);
780 int __cdecl wcsnicmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount);
781 wchar_t *__cdecl wcsnset(wchar_t *_Str,wchar_t _Val,size_t _MaxCount);
782 wchar_t *__cdecl wcsrev(wchar_t *_Str);
783 wchar_t *__cdecl wcsset(wchar_t *_Str,wchar_t _Val);
784 wchar_t *__cdecl wcslwr(wchar_t *_Str);
785 wchar_t *__cdecl wcsupr(wchar_t *_Str);
786 int __cdecl wcsicoll(const wchar_t *_Str1,const wchar_t *_Str2);
787#endif
788#endif
259 789
260/* Wide character versions. Also declared in io.h. */790#ifndef _TM_DEFINED
261/* CHECK: Are these in the oldnames??? NO! */791#define _TM_DEFINED
262#if (0)792 struct tm {
263int waccess (const wchar_t *, int);793 int tm_sec;
264int wchmod (const wchar_t *, int);794 int tm_min;
265int wcreat (const wchar_t *, int);795 int tm_hour;
266long wfindfirst (wchar_t *, struct _wfinddata_t *);796 int tm_mday;
267int wfindnext (long, struct _wfinddata_t *);797 int tm_mon;
268int wunlink (const wchar_t *);798 int tm_year;
269int wrename (const wchar_t *, const wchar_t *);799 int tm_wday;
270int wremove (const wchar_t *);800 int tm_yday;
271int wopen (const wchar_t *, int, ...);801 int tm_isdst;
272int wsopen (const wchar_t *, int, int, ...);802 };
273wchar_t* wmktemp (wchar_t *);
274#endif803#endif
275#endif /* _NO_OLDNAMES */
276 804
277#endif /* not __STRICT_ANSI__ */805#ifndef _WTIME_DEFINED
806#define _WTIME_DEFINED
278 807
279/* These are resolved by -lmsvcp60 */808 _CRTIMP wchar_t *__cdecl _wasctime(const struct tm *_Tm);
280/* If you don't have msvcp60.dll in your windows system directory, you can809 _CRTIMP wchar_t *__cdecl _wctime32(const __time32_t *_Time);
281 easily obtain it with a search from your favorite search engine. */810 size_t __cdecl wcsftime(wchar_t *_Buf,size_t _SizeInWords,const wchar_t *_Format,const struct tm *_Tm);
282typedef int mbstate_t;811 _CRTIMP size_t __cdecl _wcsftime_l(wchar_t *_Buf,size_t _SizeInWords,const wchar_t *_Format,const struct tm *_Tm,_locale_t _Locale);
283typedef wchar_t _Wint_t;812 _CRTIMP wchar_t *__cdecl _wstrdate(wchar_t *_Buffer);
813 _CRTIMP wchar_t *__cdecl _wstrtime(wchar_t *_Buffer);
814#if _INTEGRAL_MAX_BITS >= 64
815 _CRTIMP wchar_t *__cdecl _wctime64(const __time64_t *_Time);
816#endif
284 817
285wint_t btowc(int);818#if !defined (RC_INVOKED) && !defined (_INC_WTIME_INL)
286size_t mbrlen(const char *, size_t, mbstate_t *);819#define _INC_WTIME_INL
287size_t mbrtowc(wchar_t *, const char *, size_t, mbstate_t *);820#ifdef _USE_32BIT_TIME_T
288size_t mbsrtowcs(wchar_t *, const char **, size_t, mbstate_t *);821__CRT_INLINE wchar_t *__cdecl _wctime(const time_t *_Time) { return _wctime32(_Time); }
822#else
823__CRT_INLINE wchar_t *__cdecl _wctime(const time_t *_Time) { return _wctime64(_Time); }
824#endif
825#endif
826#endif
289 827
290size_t wcrtomb(char *, wchar_t, mbstate_t *);828 typedef int mbstate_t;
291size_t wcsrtombs(char *, const wchar_t **, size_t, mbstate_t *);829 typedef wchar_t _Wint_t;
292int wctob(wint_t);
293 830
294#ifndef __NO_ISOCEXT /* these need static lib libmingwex.a */831 wint_t __cdecl btowc(int);
295extern inline int fwide(FILE* stream, int mode) {return -1;} /* limited to byte orientation */ 832 size_t __cdecl mbrlen(const char *_Ch,size_t _SizeInBytes,mbstate_t *_State);
296extern inline int mbsinit(const mbstate_t* ps) {return 1;}833 size_t __cdecl mbrtowc(wchar_t *_DstCh,const char *_SrcCh,size_t _SizeInBytes,mbstate_t *_State);
297wchar_t* wmemset(wchar_t* s, wchar_t c, size_t n);834 size_t __cdecl mbsrtowcs(wchar_t *_Dest,const char **_PSrc,size_t _Count,mbstate_t *_State);
298wchar_t* wmemchr(const wchar_t* s, wchar_t c, size_t n);835 size_t __cdecl wcrtomb(char *_Dest,wchar_t _Source,mbstate_t *_State);
299int wmemcmp(const wchar_t* s1, const wchar_t * s2, size_t n);836 size_t __cdecl wcsrtombs(char *_Dest,const wchar_t **_PSource,size_t _Count,mbstate_t *_State);
300wchar_t* wmemcpy(wchar_t* __restrict__ s1, const wchar_t* __restrict__ s2,837 int __cdecl wctob(wint_t _WCh);
301 size_t n);
302wchar_t* wmemmove(wchar_t* s1, const wchar_t* s2, size_t n);
303long long wcstoll(const wchar_t* __restrict__ nptr,
304 wchar_t** __restrict__ endptr, int base);
305unsigned long long wcstoull(const wchar_t* __restrict__ nptr,
306 wchar_t ** __restrict__ endptr, int base);
307 838
839#ifndef __NO_ISOCEXT /* these need static lib libmingwex.a */
840 wchar_t *__cdecl wmemset(wchar_t *s, wchar_t c, size_t n);
841 _CONST_RETURN wchar_t *__cdecl wmemchr(const wchar_t *s, wchar_t c, size_t n);
842 int wmemcmp(const wchar_t *s1, const wchar_t *s2,size_t n);
843 wchar_t *__cdecl wmemcpy(wchar_t *s1,const wchar_t *s2,size_t n);
844 wchar_t *__cdecl wmemmove(wchar_t *s1, const wchar_t *s2, size_t n);
845 long long __cdecl wcstoll(const wchar_t *nptr,wchar_t **endptr, int base);
846 unsigned long long __cdecl wcstoull(const wchar_t *nptr,wchar_t **endptr, int base);
308#endif /* __NO_ISOCEXT */847#endif /* __NO_ISOCEXT */
309 848
310 849 void *__cdecl memmove(void *_Dst,const void *_Src,size_t _MaxCount);
850 void *__cdecl memcpy(void *_Dst,const void *_Src,size_t _MaxCount);
851 __CRT_INLINE int __cdecl fwide(FILE *_F,int _M) { (void)_F; return (_M); }
852 __CRT_INLINE int __cdecl mbsinit(const mbstate_t *_P) { return (!_P || *_P==0); }
853 __CRT_INLINE _CONST_RETURN wchar_t *__cdecl wmemchr(const wchar_t *_S,wchar_t _C,size_t _N) { for (;0<_N;++_S,--_N) if (*_S==_C) return (_CONST_RETURN wchar_t *)(_S); return (0); }
854 __CRT_INLINE int __cdecl wmemcmp(const wchar_t *_S1,const wchar_t *_S2,size_t _N) { for (; 0 < _N; ++_S1,++_S2,--_N) if (*_S1!=*_S2) return (*_S1 < *_S2 ? -1 : +1); return (0); }
855 __CRT_INLINE wchar_t *__cdecl wmemcpy(wchar_t *_S1,const wchar_t *_S2,size_t _N) { return (wchar_t *)memcpy(_S1,_S2,_N*sizeof(wchar_t)); }
856 __CRT_INLINE wchar_t *__cdecl wmemmove(wchar_t *_S1,const wchar_t *_S2,size_t _N) { return (wchar_t *)memmove(_S1,_S2,_N*sizeof(wchar_t)); }
857 __CRT_INLINE wchar_t *__cdecl wmemset(wchar_t *_S,wchar_t _C,size_t _N) {
858 wchar_t *_Su = _S;
859 for (;0<_N;++_Su,--_N) {
860 *_Su = _C;
861 }
862 return (_S);
863 }
311#ifdef __cplusplus864#ifdef __cplusplus
312} /* end of extern "C" */865}
313#endif866#endif
314 867
315#endif /* Not RC_INVOKED */868#pragma pack(pop)
316
317#endif /* not _WCHAR_H_ */
318 869
870#include <sec_api/wchar_s.h>
871#endif
win32/include/wctype.h+150−105
@@ -1,127 +1,172 @@
1/* 1/**
2 * wctype.h2 * This file has no copyright assigned and is placed in the Public Domain.
3 *3 * This file is part of the w64 mingw-runtime package.
4 * Functions for testing wide character types and converting characters.4 * No warranty is given; refer to the file DISCLAIMER within this package.
5 *
6 * This file is part of the Mingw32 package.
7 *
8 * Contributors:
9 * Created by Mumit Khan <khan@xraylith.wisc.edu>
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 */5 */
6#ifndef _INC_WCTYPE
7#define _INC_WCTYPE
22 8
23#ifndef _WCTYPE_H_9#ifndef _WIN32
24#define _WCTYPE_H_10#error Only Win32 target is supported!
11#endif
25 12
26/* All the headers include this file. */
27#include <_mingw.h>13#include <_mingw.h>
28 14
29#define __need_wchar_t15#pragma pack(push,_CRT_PACKING)
30#define __need_wint_t
31#ifndef RC_INVOKED
32#include <stddef.h>
33#endif /* Not RC_INVOKED */
34
35/*
36 * The following flags are used to tell iswctype and _isctype what character
37 * types you are looking for.
38 */
39#define _UPPER 0x0001
40#define _LOWER 0x0002
41#define _DIGIT 0x0004
42#define _SPACE 0x0008
43#define _PUNCT 0x0010
44#define _CONTROL 0x0020
45#define _BLANK 0x0040
46#define _HEX 0x0080
47#define _LEADBYTE 0x8000
48
49#define _ALPHA 0x0103
50
51#ifndef RC_INVOKED
52 16
53#ifdef __cplusplus17#ifdef __cplusplus
54extern "C" {18extern "C" {
55#endif19#endif
56 20
57#ifndef WEOF21#ifndef _CRTIMP
58#define WEOF (wchar_t)(0xFFFF)22#define _CRTIMP __declspec(dllimport)
23#endif
24
25#ifndef _WCHAR_T_DEFINED
26 typedef unsigned short wchar_t;
27#define _WCHAR_T_DEFINED
59#endif28#endif
60 29
61#ifndef _WCTYPE_T_DEFINED30#ifndef _WCTYPE_T_DEFINED
62typedef wchar_t wctype_t;31 typedef unsigned short wint_t;
32 typedef unsigned short wctype_t;
63#define _WCTYPE_T_DEFINED33#define _WCTYPE_T_DEFINED
64#endif34#endif
65 35
66/* Wide character equivalents - also in ctype.h */36#ifndef WEOF
67int iswalnum(wint_t);37#define WEOF (wint_t)(0xFFFF)
68int iswalpha(wint_t);38#endif
69int iswascii(wint_t);39
70int iswcntrl(wint_t);40#ifndef _CRT_CTYPEDATA_DEFINED
71int iswctype(wint_t, wctype_t);41#define _CRT_CTYPEDATA_DEFINED
72int is_wctype(wint_t, wctype_t); /* Obsolete! */42#ifndef _CTYPE_DISABLE_MACROS
73int iswdigit(wint_t);43
74int iswgraph(wint_t);44#ifndef __PCTYPE_FUNC
75int iswlower(wint_t);45#define __PCTYPE_FUNC __pctype_func()
76int iswprint(wint_t);46#ifdef _MSVCRT_
77int iswpunct(wint_t);47#define __pctype_func() (_pctype)
78int iswspace(wint_t);
79int iswupper(wint_t);
80int iswxdigit(wint_t);
81
82wchar_t towlower(wchar_t);
83wchar_t towupper(wchar_t);
84
85int isleadbyte (int);
86
87/* Also in ctype.h */
88
89__MINGW_IMPORT unsigned short _ctype[];
90#ifdef __MSVCRT__
91__MINGW_IMPORT unsigned short* _pctype;
92#else48#else
93__MINGW_IMPORT unsigned short* _pctype_dll;49#define __pctype_func() (*_imp___pctype)
94#define _pctype _pctype_dll50#endif
95#endif51#endif
96
97#if !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED))
98#define __WCTYPE_INLINES_DEFINED
99extern inline int iswalnum(wint_t wc) {return (iswctype(wc,_ALPHA|_DIGIT));}
100extern inline int iswalpha(wint_t wc) {return (iswctype(wc,_ALPHA));}
101extern inline int iswascii(wint_t wc) {return (((unsigned)wc & 0x7F) ==0);}
102extern inline int iswcntrl(wint_t wc) {return (iswctype(wc,_CONTROL));}
103extern inline int iswdigit(wint_t wc) {return (iswctype(wc,_DIGIT));}
104extern inline int iswgraph(wint_t wc) {return (iswctype(wc,_PUNCT|_ALPHA|_DIGIT));}
105extern inline int iswlower(wint_t wc) {return (iswctype(wc,_LOWER));}
106extern inline int iswprint(wint_t wc) {return (iswctype(wc,_BLANK|_PUNCT|_ALPHA|_DIGIT));}
107extern inline int iswpunct(wint_t wc) {return (iswctype(wc,_PUNCT));}
108extern inline int iswspace(wint_t wc) {return (iswctype(wc,_SPACE));}
109extern inline int iswupper(wint_t wc) {return (iswctype(wc,_UPPER));}
110extern inline int iswxdigit(wint_t wc) {return (iswctype(wc,_HEX));}
111extern inline int isleadbyte(int c) {return (_pctype[(unsigned char)(c)] & _LEADBYTE);}
112#endif /* !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED)) */
113
114
115typedef wchar_t wctrans_t;
116wint_t towctrans(wint_t, wctrans_t);
117wctrans_t wctrans(const char*);
118wctype_t wctype(const char*);
119 52
120#ifdef __cplusplus53#ifndef _pctype
121}54#ifdef _MSVCRT_
55 extern unsigned short *_pctype;
56#else
57 extern unsigned short **_imp___pctype;
58#define _pctype (*_imp___pctype)
59#endif
60#endif
61
62#endif
122#endif63#endif
123 64
124#endif /* Not RC_INVOKED */65#ifndef _CRT_WCTYPEDATA_DEFINED
66#define _CRT_WCTYPEDATA_DEFINED
67#ifndef _CTYPE_DISABLE_MACROS
68#ifndef _wctype
69#ifdef _MSVCRT_
70 extern unsigned short *_wctype;
71#else
72 extern unsigned short **_imp___wctype;
73#define _wctype (*_imp___wctype)
74#endif
75#endif
125 76
126#endif /* Not _WCTYPE_H_ */77#ifndef _pwctype
78#ifdef _MSVCRT_
79 extern unsigned short *_pwctype;
80#else
81 extern unsigned short **_imp___pwctype;
82#define _pwctype (*_imp___pwctype)
83#define __pwctype_func() (*_imp___pwctype)
84#endif
85#endif
86#endif
87#endif
88
89#define _UPPER 0x1
90#define _LOWER 0x2
91#define _DIGIT 0x4
92#define _SPACE 0x8
93
94#define _PUNCT 0x10
95#define _CONTROL 0x20
96#define _BLANK 0x40
97#define _HEX 0x80
98
99#define _LEADBYTE 0x8000
100#define _ALPHA (0x0100|_UPPER|_LOWER)
101
102#ifndef _WCTYPE_DEFINED
103#define _WCTYPE_DEFINED
104
105 int __cdecl iswalpha(wint_t);
106 int __cdecl iswupper(wint_t);
107 int __cdecl iswlower(wint_t);
108 int __cdecl iswdigit(wint_t);
109 int __cdecl iswxdigit(wint_t);
110 int __cdecl iswspace(wint_t);
111 int __cdecl iswpunct(wint_t);
112 int __cdecl iswalnum(wint_t);
113 int __cdecl iswprint(wint_t);
114 int __cdecl iswgraph(wint_t);
115 int __cdecl iswcntrl(wint_t);
116 int __cdecl iswascii(wint_t);
117 int __cdecl isleadbyte(int);
118 wint_t __cdecl towupper(wint_t);
119 wint_t __cdecl towlower(wint_t);
120 int __cdecl iswctype(wint_t,wctype_t);
121 _CRTIMP int __cdecl __iswcsymf(wint_t);
122 _CRTIMP int __cdecl __iswcsym(wint_t);
123 int __cdecl is_wctype(wint_t,wctype_t);
124#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || !defined (NO_OLDNAMES)
125int __cdecl isblank(int _C);
126#endif
127#endif
127 128
129#ifndef _WCTYPE_INLINE_DEFINED
130#define _WCTYPE_INLINE_DEFINED
131#ifndef __cplusplus
132#define iswalpha(_c) (iswctype(_c,_ALPHA))
133#define iswupper(_c) (iswctype(_c,_UPPER))
134#define iswlower(_c) (iswctype(_c,_LOWER))
135#define iswdigit(_c) (iswctype(_c,_DIGIT))
136#define iswxdigit(_c) (iswctype(_c,_HEX))
137#define iswspace(_c) (iswctype(_c,_SPACE))
138#define iswpunct(_c) (iswctype(_c,_PUNCT))
139#define iswalnum(_c) (iswctype(_c,_ALPHA|_DIGIT))
140#define iswprint(_c) (iswctype(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT))
141#define iswgraph(_c) (iswctype(_c,_PUNCT|_ALPHA|_DIGIT))
142#define iswcntrl(_c) (iswctype(_c,_CONTROL))
143#define iswascii(_c) ((unsigned)(_c) < 0x80)
144#define isleadbyte(c) (__pctype_func()[(unsigned char)(c)] & _LEADBYTE)
145#else
146 __CRT_INLINE int __cdecl iswalpha(wint_t _C) {return (iswctype(_C,_ALPHA)); }
147 __CRT_INLINE int __cdecl iswupper(wint_t _C) {return (iswctype(_C,_UPPER)); }
148 __CRT_INLINE int __cdecl iswlower(wint_t _C) {return (iswctype(_C,_LOWER)); }
149 __CRT_INLINE int __cdecl iswdigit(wint_t _C) {return (iswctype(_C,_DIGIT)); }
150 __CRT_INLINE int __cdecl iswxdigit(wint_t _C) {return (iswctype(_C,_HEX)); }
151 __CRT_INLINE int __cdecl iswspace(wint_t _C) {return (iswctype(_C,_SPACE)); }
152 __CRT_INLINE int __cdecl iswpunct(wint_t _C) {return (iswctype(_C,_PUNCT)); }
153 __CRT_INLINE int __cdecl iswalnum(wint_t _C) {return (iswctype(_C,_ALPHA|_DIGIT)); }
154 __CRT_INLINE int __cdecl iswprint(wint_t _C) {return (iswctype(_C,_BLANK|_PUNCT|_ALPHA|_DIGIT)); }
155 __CRT_INLINE int __cdecl iswgraph(wint_t _C) {return (iswctype(_C,_PUNCT|_ALPHA|_DIGIT)); }
156 __CRT_INLINE int __cdecl iswcntrl(wint_t _C) {return (iswctype(_C,_CONTROL)); }
157 __CRT_INLINE int __cdecl iswascii(wint_t _C) {return ((unsigned)(_C) < 0x80); }
158 __CRT_INLINE int __cdecl isleadbyte(int _C) {return (__pctype_func()[(unsigned char)(_C)] & _LEADBYTE); }
159#endif
160#endif
161
162 typedef wchar_t wctrans_t;
163 wint_t __cdecl towctrans(wint_t,wctrans_t);
164 wctrans_t __cdecl wctrans(const char *);
165 wctype_t __cdecl wctype(const char *);
166
167#ifdef __cplusplus
168}
169#endif
170
171#pragma pack(pop)
172#endif
win32/include/winapi/basetsd.h+134−104
@@ -1,119 +1,149 @@
1#ifndef _BASETSD_H1/**
2#define _BASETSD_H2 * This file has no copyright assigned and is placed in the Public Domain.
3#if __GNUC__ >=33 * This file is part of the w64 mingw-runtime package.
4#pragma GCC system_header4 * No warranty is given; refer to the file DISCLAIMER within this package.
5 */
6#ifndef _BASETSD_H_
7#define _BASETSD_H_
8
9#if (defined(__x86_64) || defined(__ia64__)) && !defined(RC_INVOKED)
10typedef unsigned __int64 POINTER_64_INT;
11#else
12typedef unsigned long POINTER_64_INT;
5#endif13#endif
6 14
7#ifdef __GNUC__15#define POINTER_32
8#ifndef __int6416#define POINTER_64
9#define __int64 long long17#define FIRMWARE_PTR
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23 typedef signed char INT8,*PINT8;
24 typedef signed short INT16,*PINT16;
25 typedef signed int INT32,*PINT32;
26 typedef signed __int64 INT64,*PINT64;
27 typedef unsigned char UINT8,*PUINT8;
28 typedef unsigned short UINT16,*PUINT16;
29 typedef unsigned int UINT32,*PUINT32;
30 typedef unsigned __int64 UINT64,*PUINT64;
31 typedef signed int LONG32,*PLONG32;
32 typedef unsigned int ULONG32,*PULONG32;
33 typedef unsigned int DWORD32,*PDWORD32;
34
35#ifndef _W64
36#define _W64
10#endif37#endif
38
39#ifdef _WIN64
40 typedef __int64 INT_PTR,*PINT_PTR;
41 typedef unsigned __int64 UINT_PTR,*PUINT_PTR;
42 typedef __int64 LONG_PTR,*PLONG_PTR;
43 typedef unsigned __int64 ULONG_PTR,*PULONG_PTR;
44#define __int3264 __int64
45#else
46 typedef int INT_PTR,*PINT_PTR;
47 typedef unsigned int UINT_PTR,*PUINT_PTR;
48 typedef long LONG_PTR,*PLONG_PTR;
49 typedef unsigned long ULONG_PTR,*PULONG_PTR;
50#define __int3264 __int32
11#endif51#endif
12 52
13#if defined(_WIN64)53#ifdef _WIN64
14#define __int3264 __int6454#define ADDRESS_TAG_BIT 0x40000000000ULL
15#define ADDRESS_TAG_BIT 0x40000000000UI6455 typedef __int64 SHANDLE_PTR;
16#else /* !_WIN64 */56 typedef unsigned __int64 HANDLE_PTR;
17#define __int3264 __int3257 typedef unsigned int UHALF_PTR,*PUHALF_PTR;
58 typedef int HALF_PTR,*PHALF_PTR;
59
60 static __inline unsigned long HandleToULong(const void *h) { return((unsigned long) (ULONG_PTR) h); }
61 static __inline long HandleToLong(const void *h) { return((long) (LONG_PTR) h); }
62 static __inline void *ULongToHandle(const unsigned long h) { return((void *) (UINT_PTR) h); }
63 static __inline void *LongToHandle(const long h) { return((void *) (INT_PTR) h); }
64 static __inline unsigned long PtrToUlong(const void *p) { return((unsigned long) (ULONG_PTR) p); }
65 static __inline unsigned int PtrToUint(const void *p) { return((unsigned int) (UINT_PTR) p); }
66 static __inline unsigned short PtrToUshort(const void *p) { return((unsigned short) (unsigned long) (ULONG_PTR) p); }
67 static __inline long PtrToLong(const void *p) { return((long) (LONG_PTR) p); }
68 static __inline int PtrToInt(const void *p) { return((int) (INT_PTR) p); }
69 static __inline short PtrToShort(const void *p) { return((short) (long) (LONG_PTR) p); }
70 static __inline void *IntToPtr(const int i) { return((void *)(INT_PTR)i); }
71 static __inline void *UIntToPtr(const unsigned int ui) { return((void *)(UINT_PTR)ui); }
72 static __inline void *LongToPtr(const long l) { return((void *)(LONG_PTR)l); }
73 static __inline void *ULongToPtr(const unsigned long ul) { return((void *)(ULONG_PTR)ul); }
74
75#define PtrToPtr64(p) ((void *) p)
76#define Ptr64ToPtr(p) ((void *) p)
77#define HandleToHandle64(h) (PtrToPtr64(h))
78#define Handle64ToHandle(h) (Ptr64ToPtr(h))
79
80 static __inline void *Ptr32ToPtr(const void *p) { return (void *)p; }
81 static __inline void *Handle32ToHandle(const void *h) { return((void *) h); }
82 static __inline void *PtrToPtr32(const void *p) { return((void *) (ULONG_PTR) p); }
83
84#define HandleToHandle32(h) (PtrToPtr32(h))
85#else
86
18#define ADDRESS_TAG_BIT 0x80000000UL87#define ADDRESS_TAG_BIT 0x80000000UL
19#define HandleToUlong( h ) ((ULONG)(ULONG_PTR)(h) )
20#define HandleToLong( h ) ((LONG)(LONG_PTR) (h) )
21#define LongToHandle( h) ((HANDLE)(LONG_PTR) (h))
22#define PtrToUlong( p ) ((ULONG)(ULONG_PTR) (p) )
23#define PtrToLong( p ) ((LONG)(LONG_PTR) (p) )
24#define PtrToUint( p ) ((UINT)(UINT_PTR) (p) )
25#define PtrToInt( p ) ((INT)(INT_PTR) (p) )
26#define PtrToUshort( p ) ((unsigned short)(ULONG_PTR)(p) )
27#define PtrToShort( p ) ((short)(LONG_PTR)(p) )
28#define IntToPtr( i ) ((VOID*)(INT_PTR)((int)i))
29#define UIntToPtr( ui ) ((VOID*)(UINT_PTR)((unsigned int)ui))
30#define LongToPtr( l ) ((VOID*)(LONG_PTR)((long)l))
31#define ULongToPtr( ul ) ((VOID*)(ULONG_PTR)((unsigned long)ul))
32#endif /* !_WIN64 */
33 88
89 typedef unsigned short UHALF_PTR,*PUHALF_PTR;
90 typedef short HALF_PTR,*PHALF_PTR;
91 typedef long SHANDLE_PTR;
92 typedef unsigned long HANDLE_PTR;
93
94#define HandleToULong(h) ((ULONG)(ULONG_PTR)(h))
95#define HandleToLong(h) ((LONG)(LONG_PTR) (h))
96#define ULongToHandle(ul) ((HANDLE)(ULONG_PTR) (ul))
97#define LongToHandle(h) ((HANDLE)(LONG_PTR) (h))
98#define PtrToUlong(p) ((ULONG)(ULONG_PTR) (p))
99#define PtrToLong(p) ((LONG)(LONG_PTR) (p))
100#define PtrToUint(p) ((UINT)(UINT_PTR) (p))
101#define PtrToInt(p) ((INT)(INT_PTR) (p))
102#define PtrToUshort(p) ((unsigned short)(ULONG_PTR)(p))
103#define PtrToShort(p) ((short)(LONG_PTR)(p))
104#define IntToPtr(i) ((VOID *)(INT_PTR)((int)i))
105#define UIntToPtr(ui) ((VOID *)(UINT_PTR)((unsigned int)ui))
106#define LongToPtr(l) ((VOID *)(LONG_PTR)((long)l))
107#define ULongToPtr(ul) ((VOID *)(ULONG_PTR)((unsigned long)ul))
108
109 static __inline void *PtrToPtr64(const void *p) { return((void *) (ULONG_PTR)p); }
110 static __inline void *Ptr64ToPtr(const void *p) { return((void *) (ULONG_PTR) p); }
111 static __inline void *HandleToHandle64(const void *h) { return((void *) h); }
112 static __inline void *Handle64ToHandle(const void *h) { return((void *) (ULONG_PTR) h); }
113
114#define Ptr32ToPtr(p) ((void *) p)
115#define Handle32ToHandle(h) (Ptr32ToPtr(h))
116#define PtrToPtr32(p) ((void *) p)
117#define HandleToHandle32(h) (PtrToPtr32(h))
118#endif
119
120#define HandleToUlong(h) HandleToULong(h)
121#define UlongToHandle(ul) ULongToHandle(ul)
34#define UlongToPtr(ul) ULongToPtr(ul)122#define UlongToPtr(ul) ULongToPtr(ul)
35#define UintToPtr(ui) UIntToPtr(ui)123#define UintToPtr(ui) UIntToPtr(ui)
36#define MAXUINT_PTR (~((UINT_PTR)0))124
37#define MAXINT_PTR ((INT_PTR)(MAXUINT_PTR >> 1))125#define MAXUINT_PTR (~((UINT_PTR)0))
38#define MININT_PTR (~MAXINT_PTR)126#define MAXINT_PTR ((INT_PTR)(MAXUINT_PTR >> 1))
127#define MININT_PTR (~MAXINT_PTR)
128
39#define MAXULONG_PTR (~((ULONG_PTR)0))129#define MAXULONG_PTR (~((ULONG_PTR)0))
40#define MAXLONG_PTR ((LONG_PTR)(MAXULONG_PTR >> 1))130#define MAXLONG_PTR ((LONG_PTR)(MAXULONG_PTR >> 1))
41#define MINLONG_PTR (~MAXLONG_PTR)131#define MINLONG_PTR (~MAXLONG_PTR)
132
42#define MAXUHALF_PTR ((UHALF_PTR)~0)133#define MAXUHALF_PTR ((UHALF_PTR)~0)
43#define MAXHALF_PTR ((HALF_PTR)(MAXUHALF_PTR >> 1))134#define MAXHALF_PTR ((HALF_PTR)(MAXUHALF_PTR >> 1))
44#define MINHALF_PTR (~MAXHALF_PTR)135#define MINHALF_PTR (~MAXHALF_PTR)
136
137 typedef ULONG_PTR SIZE_T,*PSIZE_T;
138 typedef LONG_PTR SSIZE_T,*PSSIZE_T;
139 typedef ULONG_PTR DWORD_PTR,*PDWORD_PTR;
140 typedef __int64 LONG64,*PLONG64;
141 typedef unsigned __int64 ULONG64,*PULONG64;
142 typedef unsigned __int64 DWORD64,*PDWORD64;
143 typedef ULONG_PTR KAFFINITY;
144 typedef KAFFINITY *PKAFFINITY;
45 145
46#ifndef RC_INVOKED
47#ifdef __cplusplus
48extern "C" {
49#endif
50typedef int LONG32, *PLONG32;
51#ifndef XFree86Server
52typedef int INT32, *PINT32;
53#endif /* ndef XFree86Server */
54typedef unsigned int ULONG32, *PULONG32;
55typedef unsigned int DWORD32, *PDWORD32;
56typedef unsigned int UINT32, *PUINT32;
57
58#if defined(_WIN64)
59typedef __int64 INT_PTR, *PINT_PTR;
60typedef unsigned __int64 UINT_PTR, *PUINT_PTR;
61typedef __int64 LONG_PTR, *PLONG_PTR;
62typedef unsigned __int64 ULONG_PTR, *PULONG_PTR;
63typedef unsigned __int64 HANDLE_PTR;
64typedef unsigned int UHALF_PTR, *PUHALF_PTR;
65typedef int HALF_PTR, *PHALF_PTR;
66
67#if 0 /* TODO when WIN64 is here */
68inline unsigned long HandleToUlong(const void* h )
69 { return((unsigned long) h ); }
70inline long HandleToLong( const void* h )
71 { return((long) h ); }
72inline void* LongToHandle( const long h )
73 { return((void*) (INT_PTR) h ); }
74inline unsigned long PtrToUlong( const void* p)
75 { return((unsigned long) p ); }
76inline unsigned int PtrToUint( const void* p )
77 { return((unsigned int) p ); }
78inline unsigned short PtrToUshort( const void* p )
79 { return((unsigned short) p ); }
80inline long PtrToLong( const void* p )
81 { return((long) p ); }
82inline int PtrToInt( const void* p )
83 { return((int) p ); }
84inline short PtrToShort( const void* p )
85 { return((short) p ); }
86inline void* IntToPtr( const int i )
87 { return( (void*)(INT_PTR)i ); }
88inline void* UIntToPtr(const unsigned int ui)
89 { return( (void*)(UINT_PTR)ui ); }
90inline void* LongToPtr( const long l )
91 { return( (void*)(LONG_PTR)l ); }
92inline void* ULongToPtr( const unsigned long ul )
93 { return( (void*)(ULONG_PTR)ul ); }
94#endif /* 0_ */
95
96#else /* !_WIN64 */
97typedef int INT_PTR, *PINT_PTR;
98typedef unsigned int UINT_PTR, *PUINT_PTR;
99typedef long LONG_PTR, *PLONG_PTR;
100typedef unsigned long ULONG_PTR, *PULONG_PTR;
101typedef unsigned short UHALF_PTR, *PUHALF_PTR;
102typedef short HALF_PTR, *PHALF_PTR;
103typedef unsigned long HANDLE_PTR;
104#endif /* !_WIN64 */
105
106typedef ULONG_PTR SIZE_T, *PSIZE_T;
107typedef LONG_PTR SSIZE_T, *PSSIZE_T;
108typedef ULONG_PTR DWORD_PTR, *PDWORD_PTR;
109typedef __int64 LONG64, *PLONG64;
110typedef __int64 INT64, *PINT64;
111typedef unsigned __int64 ULONG64, *PULONG64;
112typedef unsigned __int64 DWORD64, *PDWORD64;
113typedef unsigned __int64 UINT64, *PUINT64;
114#ifdef __cplusplus146#ifdef __cplusplus
115}147}
116#endif148#endif
117#endif /* !RC_INVOKED */149#endif
118
119#endif /* _BASETSD_H */
win32/include/winapi/basetyps.h+67−126
@@ -1,144 +1,85 @@
1#ifndef _BASETYPS_H1/**
2#define _BASETYPS_H2 * This file has no copyright assigned and is placed in the Public Domain.
3#if __GNUC__ >=33 * This file is part of the w64 mingw-runtime package.
4#pragma GCC system_header4 * No warranty is given; refer to the file DISCLAIMER within this package.
5#endif5 */
6#if !defined(_BASETYPS_H_)
7#define _BASETYPS_H_
6 8
7#ifndef __OBJC__
8#ifdef __cplusplus9#ifdef __cplusplus
9#define EXTERN_C extern "C"10#define EXTERN_C extern "C"
10#else11#else
11#define EXTERN_C extern12#define EXTERN_C extern
12#endif /* __cplusplus */
13#define STDMETHODCALLTYPE __stdcall
14#define STDMETHODVCALLTYPE __cdecl
15#define STDAPICALLTYPE __stdcall
16#define STDAPIVCALLTYPE __cdecl
17#define STDAPI EXTERN_C HRESULT STDAPICALLTYPE
18#define STDAPI_(t) EXTERN_C t STDAPICALLTYPE
19#define STDMETHODIMP HRESULT STDMETHODCALLTYPE
20#define STDMETHODIMP_(t) t STDMETHODCALLTYPE
21#define STDAPIV EXTERN_C HRESULT STDAPIVCALLTYPE
22#define STDAPIV_(t) EXTERN_C t STDAPIVCALLTYPE
23#define STDMETHODIMPV HRESULT STDMETHODVCALLTYPE
24#define STDMETHODIMPV_(t) t STDMETHODVCALLTYPE
25#define interface struct
26#if defined(__cplusplus) && !defined(CINTERFACE)
27#define STDMETHOD(m) virtual HRESULT STDMETHODCALLTYPE m
28#define STDMETHOD_(t,m) virtual t STDMETHODCALLTYPE m
29#define PURE =0
30#define THIS_
31#define THIS void
32/*
33 __attribute__((com_interface)) is obsolete in __GNUC__ >= 3
34 g++ vtables are now COM-compatible by default
35*/
36#if defined(__GNUC__) && __GNUC__ < 3 && !defined(NOCOMATTRIBUTE)
37#define DECLARE_INTERFACE(i) interface __attribute__((com_interface)) i
38#define DECLARE_INTERFACE_(i,b) interface __attribute__((com_interface)) i : public b
39#else
40#define DECLARE_INTERFACE(i) interface i
41#define DECLARE_INTERFACE_(i,b) interface i : public b
42#endif
43#else
44#define STDMETHOD(m) HRESULT(STDMETHODCALLTYPE *m)
45#define STDMETHOD_(t,m) t(STDMETHODCALLTYPE *m)
46#define PURE
47#define THIS_ INTERFACE *,
48#define THIS INTERFACE *
49#ifndef CONST_VTABLE
50#define CONST_VTABLE
51#endif13#endif
52#define DECLARE_INTERFACE(i) \
53typedef interface i { CONST_VTABLE struct i##Vtbl *lpVtbl; } i; \
54typedef CONST_VTABLE struct i##Vtbl i##Vtbl; \
55CONST_VTABLE struct i##Vtbl
56#define DECLARE_INTERFACE_(i,b) DECLARE_INTERFACE(i)
57#endif
58#define BEGIN_INTERFACE
59#define END_INTERFACE
60 14
61#define FWD_DECL(i) typedef interface i i15#define STDMETHODCALLTYPE WINAPI
16#define STDMETHODVCALLTYPE __cdecl
17
18#define STDAPICALLTYPE WINAPI
19#define STDAPIVCALLTYPE __cdecl
20
21#define STDAPI EXTERN_C HRESULT WINAPI
22#define STDAPI_(type) EXTERN_C type WINAPI
23
24#define STDMETHODIMP HRESULT WINAPI
25#define STDMETHODIMP_(type) type WINAPI
26
27#define STDAPIV EXTERN_C HRESULT STDAPIVCALLTYPE
28#define STDAPIV_(type) EXTERN_C type STDAPIVCALLTYPE
29
30#define STDMETHODIMPV HRESULT STDMETHODVCALLTYPE
31#define STDMETHODIMPV_(type) type STDMETHODVCALLTYPE
32
62#if defined(__cplusplus) && !defined(CINTERFACE)33#if defined(__cplusplus) && !defined(CINTERFACE)
63#define IENUM_THIS(T)34
64#define IENUM_THIS_(T)35#define __STRUCT__ struct
36#define STDMETHOD(method) virtual HRESULT WINAPI method
37#define STDMETHOD_(type,method) virtual type WINAPI method
38#define STDMETHODV(method) virtual HRESULT STDMETHODVCALLTYPE method
39#define STDMETHODV_(type,method) virtual type STDMETHODVCALLTYPE method
40#define PURE = 0
41#define THIS_
42#define THIS void
43#define DECLARE_INTERFACE(iface) __STRUCT__ iface
44#define DECLARE_INTERFACE_(iface,baseiface) __STRUCT__ iface : public baseiface
65#else45#else
66#define IENUM_THIS(T) T*
67#define IENUM_THIS_(T) T*,
68#endif
69#define DECLARE_ENUMERATOR_(I,T) \
70DECLARE_INTERFACE_(I,IUnknown) \
71{ \
72 STDMETHOD(QueryInterface)(IENUM_THIS_(I) REFIID,PVOID*) PURE; \
73 STDMETHOD_(ULONG,AddRef)(IENUM_THIS(I)) PURE; \
74 STDMETHOD_(ULONG,Release)(IENUM_THIS(I)) PURE; \
75 STDMETHOD(Next)(IENUM_THIS_(I) ULONG,T*,ULONG*) PURE; \
76 STDMETHOD(Skip)(IENUM_THIS_(I) ULONG) PURE; \
77 STDMETHOD(Reset)(IENUM_THIS(I)) PURE; \
78 STDMETHOD(Clone)(IENUM_THIS_(I) I**) PURE; \
79}
80#define DECLARE_ENUMERATOR(T) DECLARE_ENUMERATOR_(IEnum##T,T)
81 46
82#endif /* __OBJC__ */47#ifndef __OBJC__
48#define interface struct
49#endif
83 50
84#ifndef _GUID_DEFINED /* also defined in winnt.h */51#define STDMETHOD(method) HRESULT (WINAPI *method)
85#define _GUID_DEFINED52#define STDMETHOD_(type,method) type (WINAPI *method)
86typedef struct _GUID53#define STDMETHODV(method) HRESULT (STDMETHODVCALLTYPE *method)
87{54#define STDMETHODV_(type,method) type (STDMETHODVCALLTYPE *method)
88 unsigned long Data1;
89 unsigned short Data2;
90 unsigned short Data3;
91 unsigned char Data4[8];
92} GUID,*REFGUID,*LPGUID;
93#endif /* _GUID_DEFINED */
94#ifndef UUID_DEFINED
95#define UUID_DEFINED
96typedef GUID UUID;
97#endif /* UUID_DEFINED */
98typedef GUID IID;
99typedef GUID CLSID;
100typedef CLSID *LPCLSID;
101typedef IID *LPIID;
102typedef IID *REFIID;
103typedef CLSID *REFCLSID;
104typedef GUID FMTID;
105typedef FMTID *REFFMTID;
106typedef unsigned long error_status_t;
107#define uuid_t UUID
108typedef unsigned long PROPID;
109 55
110#ifndef _REFGUID_DEFINED56#define PURE
111#if defined (__cplusplus) && !defined (CINTERFACE)57#define THIS_ INTERFACE *This,
112#define REFGUID const GUID&58#define THIS INTERFACE *This
113#define REFIID const IID&59#ifdef CONST_VTABLE
114#define REFCLSID const CLSID&60#define DECLARE_INTERFACE(iface) typedef struct iface { \
61 const struct iface##Vtbl *lpVtbl; } iface; \
62 typedef const struct iface##Vtbl iface##Vtbl; \
63 const struct iface##Vtbl
115#else64#else
116#define REFGUID const GUID* const65#define DECLARE_INTERFACE(iface) typedef struct iface { \
117#define REFIID const IID* const66 struct iface##Vtbl *lpVtbl; \
118#define REFCLSID const CLSID* const67 } iface; \
68 typedef struct iface##Vtbl iface##Vtbl; \
69 struct iface##Vtbl
119#endif70#endif
120#define _REFGUID_DEFINED71#define DECLARE_INTERFACE_(iface,baseiface) DECLARE_INTERFACE(iface)
121#define _REFGIID_DEFINED
122#define _REFCLSID_DEFINED
123#endif72#endif
124#ifndef GUID_SECTION73
125#define GUID_SECTION ".text"74#include <guiddef.h>
126#endif75
127#ifdef __GNUC__76#ifndef _ERROR_STATUS_T_DEFINED
128#define GUID_SECT __attribute__ ((section (GUID_SECTION)))77#define _ERROR_STATUS_T_DEFINED
129#else78typedef unsigned long error_status_t;
130#define GUID_SECT
131#endif
132#if !defined(INITGUID) || (defined(INITGUID) && defined(__cplusplus))
133#define GUID_EXT EXTERN_C
134#else
135#define GUID_EXT
136#endif79#endif
137#ifdef INITGUID80
138#define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) GUID_EXT const GUID n GUID_SECT = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}81#ifndef _WCHAR_T_DEFINED
139#define DEFINE_OLEGUID(n,l,w1,w2) DEFINE_GUID(n,l,w1,w2,0xC0,0,0,0,0,0,0,0x46)82typedef unsigned short wchar_t;
140#else83#define _WCHAR_T_DEFINED
141#define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) GUID_EXT const GUID n
142#define DEFINE_OLEGUID(n,l,w1,w2) DEFINE_GUID(n,l,w1,w2,0xC0,0,0,0,0,0,0,0x46)
143#endif84#endif
144#endif85#endif
win32/include/winapi/guiddef.h+151−0
@@ -0,0 +1,151 @@
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 GUID_DEFINED
7#define GUID_DEFINED
8typedef struct _GUID {
9 unsigned long Data1;
10 unsigned short Data2;
11 unsigned short Data3;
12 unsigned char Data4[8 ];
13} GUID;
14#endif
15
16#ifndef FAR
17#define FAR
18#endif
19
20#ifndef DECLSPEC_SELECTANY
21#define DECLSPEC_SELECTANY __declspec(selectany)
22#endif
23
24#ifndef EXTERN_C
25#ifdef __cplusplus
26#define EXTERN_C extern "C"
27#else
28#define EXTERN_C extern
29#endif
30#endif
31
32#ifdef DEFINE_GUID
33#undef DEFINE_GUID
34#endif
35
36#ifdef INITGUID
37#ifdef __cplusplus
38#define DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) EXTERN_C const GUID DECLSPEC_SELECTANY name = { l,w1,w2,{ b1,b2,b3,b4,b5,b6,b7,b8 } }
39#else
40#define DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) const GUID DECLSPEC_SELECTANY name = { l,w1,w2,{ b1,b2,b3,b4,b5,b6,b7,b8 } }
41#endif
42#else
43#define DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) EXTERN_C const GUID name
44#endif
45
46#define DEFINE_OLEGUID(name,l,w1,w2) DEFINE_GUID(name,l,w1,w2,0xC0,0,0,0,0,0,0,0x46)
47
48#ifndef _GUIDDEF_H_
49#define _GUIDDEF_H_
50
51#ifndef __LPGUID_DEFINED__
52#define __LPGUID_DEFINED__
53typedef GUID *LPGUID;
54#endif
55
56#ifndef __LPCGUID_DEFINED__
57#define __LPCGUID_DEFINED__
58typedef const GUID *LPCGUID;
59#endif
60
61#ifndef __IID_DEFINED__
62#define __IID_DEFINED__
63
64typedef GUID IID;
65typedef IID *LPIID;
66#define IID_NULL GUID_NULL
67#define IsEqualIID(riid1,riid2) IsEqualGUID(riid1,riid2)
68typedef GUID CLSID;
69typedef CLSID *LPCLSID;
70#define CLSID_NULL GUID_NULL
71#define IsEqualCLSID(rclsid1,rclsid2) IsEqualGUID(rclsid1,rclsid2)
72typedef GUID FMTID;
73typedef FMTID *LPFMTID;
74#define FMTID_NULL GUID_NULL
75#define IsEqualFMTID(rfmtid1,rfmtid2) IsEqualGUID(rfmtid1,rfmtid2)
76
77#ifdef __midl_proxy
78#define __MIDL_CONST
79#else
80#define __MIDL_CONST const
81#endif
82
83#ifndef _REFGUID_DEFINED
84#define _REFGUID_DEFINED
85#ifdef __cplusplus
86#define REFGUID const GUID &
87#else
88#define REFGUID const GUID *__MIDL_CONST
89#endif
90#endif
91
92#ifndef _REFIID_DEFINED
93#define _REFIID_DEFINED
94#ifdef __cplusplus
95#define REFIID const IID &
96#else
97#define REFIID const IID *__MIDL_CONST
98#endif
99#endif
100
101#ifndef _REFCLSID_DEFINED
102#define _REFCLSID_DEFINED
103#ifdef __cplusplus
104#define REFCLSID const IID &
105#else
106#define REFCLSID const IID *__MIDL_CONST
107#endif
108#endif
109
110#ifndef _REFFMTID_DEFINED
111#define _REFFMTID_DEFINED
112#ifdef __cplusplus
113#define REFFMTID const IID &
114#else
115#define REFFMTID const IID *__MIDL_CONST
116#endif
117#endif
118#endif
119
120#ifndef _SYS_GUID_OPERATORS_
121#define _SYS_GUID_OPERATORS_
122#include <string.h>
123
124#ifdef __cplusplus
125__inline int InlineIsEqualGUID(REFGUID rguid1,REFGUID rguid2) {
126 return (((unsigned long *) &rguid1)[0]==((unsigned long *) &rguid2)[0] && ((unsigned long *) &rguid1)[1]==((unsigned long *) &rguid2)[1] &&
127 ((unsigned long *) &rguid1)[2]==((unsigned long *) &rguid2)[2] && ((unsigned long *) &rguid1)[3]==((unsigned long *) &rguid2)[3]);
128}
129__inline int IsEqualGUID(REFGUID rguid1,REFGUID rguid2) { return !memcmp(&rguid1,&rguid2,sizeof(GUID)); }
130#else
131#define InlineIsEqualGUID(rguid1,rguid2) (((unsigned long *) rguid1)[0]==((unsigned long *) rguid2)[0] && ((unsigned long *) rguid1)[1]==((unsigned long *) rguid2)[1] && ((unsigned long *) rguid1)[2]==((unsigned long *) rguid2)[2] && ((unsigned long *) rguid1)[3]==((unsigned long *) rguid2)[3])
132#define IsEqualGUID(rguid1,rguid2) (!memcmp(rguid1,rguid2,sizeof(GUID)))
133#endif
134
135#ifdef __INLINE_ISEQUAL_GUID
136#undef IsEqualGUID
137#define IsEqualGUID(rguid1,rguid2) InlineIsEqualGUID(rguid1,rguid2)
138#endif
139
140#define IsEqualIID(riid1,riid2) IsEqualGUID(riid1,riid2)
141#define IsEqualCLSID(rclsid1,rclsid2) IsEqualGUID(rclsid1,rclsid2)
142
143#if !defined _SYS_GUID_OPERATOR_EQ_ && !defined _NO_SYS_GUID_OPERATOR_EQ_
144#define _SYS_GUID_OPERATOR_EQ_
145#ifdef __cplusplus
146__inline int operator==(REFGUID guidOne,REFGUID guidOther) { return IsEqualGUID(guidOne,guidOther); }
147__inline int operator!=(REFGUID guidOne,REFGUID guidOther) { return !(guidOne==guidOther); }
148#endif
149#endif
150#endif
151#endif
win32/include/winapi/intrin.h+11−0
@@ -0,0 +1,11 @@
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 __INTRIN_H_
7#define __INTRIN_H_
8
9//!__TINYC__: intrinsic stuff removed
10
11#endif /* end __INTRIN_H_ */
win32/include/winapi/poppack.h+8−0
@@ -0,0 +1,8 @@
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#if !(defined(lint) || defined(RC_INVOKED))
7#pragma pack(pop)
8#endif
win32/include/winapi/pshpack1.h+8−0
@@ -0,0 +1,8 @@
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#if !(defined(lint) || defined(RC_INVOKED))
7#pragma pack(push,1)
8#endif
win32/include/winapi/pshpack2.h+8−0
@@ -0,0 +1,8 @@
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#if !(defined(lint) || defined(RC_INVOKED))
7#pragma pack(push,2)
8#endif
win32/include/winapi/pshpack4.h+8−0
@@ -0,0 +1,8 @@
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#if !(defined(lint) || defined(RC_INVOKED))
7#pragma pack(push,4)
8#endif
win32/include/winapi/pshpack8.h+8−0
@@ -0,0 +1,8 @@
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#if !(defined(lint) || defined(RC_INVOKED))
7#pragma pack(push,8)
8#endif
win32/include/winapi/reason.h+80−0
@@ -0,0 +1,80 @@
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#if !defined SENTINEL_Reason
7#define SENTINEL_Reason
8
9#define SHTDN_REASON_FLAG_COMMENT_REQUIRED 0x01000000
10#define SHTDN_REASON_FLAG_DIRTY_PROBLEM_ID_REQUIRED 0x02000000
11#define SHTDN_REASON_FLAG_CLEAN_UI 0x04000000
12#define SHTDN_REASON_FLAG_DIRTY_UI 0x08000000
13#define SHTDN_REASON_FLAG_USER_DEFINED 0x40000000
14#define SHTDN_REASON_FLAG_PLANNED 0x80000000
15#define SHTDN_REASON_MAJOR_OTHER 0x00000000
16#define SHTDN_REASON_MAJOR_NONE 0x00000000
17#define SHTDN_REASON_MAJOR_HARDWARE 0x00010000
18#define SHTDN_REASON_MAJOR_OPERATINGSYSTEM 0x00020000
19#define SHTDN_REASON_MAJOR_SOFTWARE 0x00030000
20#define SHTDN_REASON_MAJOR_APPLICATION 0x00040000
21#define SHTDN_REASON_MAJOR_SYSTEM 0x00050000
22#define SHTDN_REASON_MAJOR_POWER 0x00060000
23#define SHTDN_REASON_MAJOR_LEGACY_API 0x00070000
24#define SHTDN_REASON_MINOR_OTHER 0x00000000
25#define SHTDN_REASON_MINOR_NONE 0x000000ff
26#define SHTDN_REASON_MINOR_MAINTENANCE 0x00000001
27#define SHTDN_REASON_MINOR_INSTALLATION 0x00000002
28#define SHTDN_REASON_MINOR_UPGRADE 0x00000003
29#define SHTDN_REASON_MINOR_RECONFIG 0x00000004
30#define SHTDN_REASON_MINOR_HUNG 0x00000005
31#define SHTDN_REASON_MINOR_UNSTABLE 0x00000006
32#define SHTDN_REASON_MINOR_DISK 0x00000007
33#define SHTDN_REASON_MINOR_PROCESSOR 0x00000008
34#define SHTDN_REASON_MINOR_NETWORKCARD 0x00000009
35#define SHTDN_REASON_MINOR_POWER_SUPPLY 0x0000000a
36#define SHTDN_REASON_MINOR_CORDUNPLUGGED 0x0000000b
37#define SHTDN_REASON_MINOR_ENVIRONMENT 0x0000000c
38#define SHTDN_REASON_MINOR_HARDWARE_DRIVER 0x0000000d
39#define SHTDN_REASON_MINOR_OTHERDRIVER 0x0000000e
40#define SHTDN_REASON_MINOR_BLUESCREEN 0x0000000F
41#define SHTDN_REASON_MINOR_SERVICEPACK 0x00000010
42#define SHTDN_REASON_MINOR_HOTFIX 0x00000011
43#define SHTDN_REASON_MINOR_SECURITYFIX 0x00000012
44#define SHTDN_REASON_MINOR_SECURITY 0x00000013
45#define SHTDN_REASON_MINOR_NETWORK_CONNECTIVITY 0x00000014
46#define SHTDN_REASON_MINOR_WMI 0x00000015
47#define SHTDN_REASON_MINOR_SERVICEPACK_UNINSTALL 0x00000016
48#define SHTDN_REASON_MINOR_HOTFIX_UNINSTALL 0x00000017
49#define SHTDN_REASON_MINOR_SECURITYFIX_UNINSTALL 0x00000018
50#define SHTDN_REASON_MINOR_MMC 0x00000019
51#define SHTDN_REASON_MINOR_SYSTEMRESTORE 0x0000001a
52#define SHTDN_REASON_MINOR_TERMSRV 0x00000020
53#define SHTDN_REASON_MINOR_DC_PROMOTION 0x00000021
54#define SHTDN_REASON_MINOR_DC_DEMOTION 0x00000022
55#define SHTDN_REASON_UNKNOWN SHTDN_REASON_MINOR_NONE
56#define SHTDN_REASON_LEGACY_API (SHTDN_REASON_MAJOR_LEGACY_API | SHTDN_REASON_FLAG_PLANNED)
57#define SHTDN_REASON_VALID_BIT_MASK 0xc0ffffff
58
59#define PCLEANUI (SHTDN_REASON_FLAG_PLANNED | SHTDN_REASON_FLAG_CLEAN_UI)
60#define UCLEANUI (SHTDN_REASON_FLAG_CLEAN_UI)
61#define PDIRTYUI (SHTDN_REASON_FLAG_PLANNED | SHTDN_REASON_FLAG_DIRTY_UI)
62#define UDIRTYUI (SHTDN_REASON_FLAG_DIRTY_UI)
63
64#define MAX_REASON_NAME_LEN 64
65#define MAX_REASON_DESC_LEN 256
66#define MAX_REASON_BUGID_LEN 32
67#define MAX_REASON_COMMENT_LEN 512
68#define SHUTDOWN_TYPE_LEN 32
69
70#define POLICY_SHOWREASONUI_NEVER 0
71#define POLICY_SHOWREASONUI_ALWAYS 1
72#define POLICY_SHOWREASONUI_WORKSTATIONONLY 2
73#define POLICY_SHOWREASONUI_SERVERONLY 3
74
75#define SNAPSHOT_POLICY_NEVER 0
76#define SNAPSHOT_POLICY_ALWAYS 1
77#define SNAPSHOT_POLICY_UNPLANNED 2
78
79#define MAX_NUM_REASONS 256
80#endif
win32/include/winapi/specstrings.h+7−0
@@ -0,0 +1,7 @@
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
7#define __specstrings
win32/include/winapi/stralign.h+154−0
@@ -0,0 +1,154 @@
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 __STRALIGN_H_
7#define __STRALIGN_H_
8
9#ifndef _STRALIGN_USE_SECURE_CRT
10#define _STRALIGN_USE_SECURE_CRT 0
11#endif
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17#if defined(I_X86_)
18#define WSTR_ALIGNED(s) TRUE
19#define ua_CharUpperW CharUpperW
20#define ua_lstrcmpiW lstrcmpiW
21#define ua_lstrcmpW lstrcmpW
22#define ua_lstrlenW lstrlenW
23#define ua_wcschr wcschr
24#define ua_wcsicmp wcsicmp
25#define ua_wcslen wcslen
26#define ua_wcsrchr wcsrchr
27 static __inline PUWSTR ua_wcscpy(PUWSTR Destination,PCUWSTR Source) { return wcscpy(Destination,Source); }
28#else
29#define WSTR_ALIGNED(s) (((DWORD_PTR)(s) & (sizeof(WCHAR)-1))==0)
30
31 LPUWSTR WINAPI uaw_CharUpperW(LPUWSTR String);
32 int WINAPI uaw_lstrcmpW(PCUWSTR String1,PCUWSTR String2);
33 int WINAPI uaw_lstrcmpiW(PCUWSTR String1,PCUWSTR String2);
34 int WINAPI uaw_lstrlenW(LPCUWSTR String);
35 PUWSTR __cdecl uaw_wcschr(PCUWSTR String,WCHAR Character);
36 PUWSTR __cdecl uaw_wcscpy(PUWSTR Destination,PCUWSTR Source);
37 int __cdecl uaw_wcsicmp(PCUWSTR String1,PCUWSTR String2);
38 size_t __cdecl uaw_wcslen(PCUWSTR String);
39 PUWSTR __cdecl uaw_wcsrchr(PCUWSTR String,WCHAR Character);
40#ifdef CharUpper
41 static __inline LPUWSTR ua_CharUpperW(LPUWSTR String) {
42 if(WSTR_ALIGNED(String)) return CharUpperW((PWSTR)String);
43 return uaw_CharUpperW(String);
44 }
45#endif
46
47#ifdef lstrcmp
48 static __inline int ua_lstrcmpW(LPCUWSTR String1,LPCUWSTR String2) {
49 if(WSTR_ALIGNED(String1) && WSTR_ALIGNED(String2)) return lstrcmpW((LPCWSTR)String1,(LPCWSTR)String2);
50 return uaw_lstrcmpW(String1,String2);
51 }
52#endif
53
54#ifdef lstrcmpi
55 static __inline int ua_lstrcmpiW(LPCUWSTR String1,LPCUWSTR String2) {
56 if(WSTR_ALIGNED(String1) && WSTR_ALIGNED(String2)) return lstrcmpiW((LPCWSTR)String1,(LPCWSTR)String2);
57 return uaw_lstrcmpiW(String1,String2);
58 }
59#endif
60
61#ifdef lstrlen
62 static __inline int ua_lstrlenW(LPCUWSTR String) {
63 if(WSTR_ALIGNED(String)) return lstrlenW((PCWSTR)String);
64 return uaw_lstrlenW(String);
65 }
66#endif
67
68#if defined(_WSTRING_DEFINED)
69#ifdef _WConst_return
70 typedef _WConst_return WCHAR UNALIGNED *PUWSTR_C;
71#else
72 typedef WCHAR UNALIGNED *PUWSTR_C;
73#endif
74 static __inline PUWSTR_C ua_wcschr(PCUWSTR String,WCHAR Character) {
75 if(WSTR_ALIGNED(String)) return wcschr((PCWSTR)String,Character);
76 return (PUWSTR_C)uaw_wcschr(String,Character);
77 }
78 static __inline PUWSTR_C ua_wcsrchr(PCUWSTR String,WCHAR Character) {
79 if(WSTR_ALIGNED(String)) return wcsrchr((PCWSTR)String,Character);
80 return (PUWSTR_C)uaw_wcsrchr(String,Character);
81 }
82#if defined(__cplusplus) && defined(_WConst_Return)
83 static __inline PUWSTR ua_wcschr(PUWSTR String,WCHAR Character) {
84 if(WSTR_ALIGNED(String)) return wcscpy((PWSTR)Destination,(PCWSTR)Source);
85 return uaw_wcscpy(Destination,Source);
86 }
87 static __inline PUWSTR ua_wcsrchr(PUWSTR String,WCHAR Character) {
88 if(WSTR_ALIGNED(String)) return wcsrchr(String,Character);
89 return uaw_wcsrchr((PCUWSTR)String,Character);
90 }
91#endif
92
93 static __inline PUWSTR ua_wcscpy(PUWSTR Destination,PCUWSTR Source) {
94 if(WSTR_ALIGNED(Source) && WSTR_ALIGNED(Destination)) return wcscpy((PWSTR)Destination,(PCWSTR)Source);
95 return uaw_wcscpy(Destination,Source);
96 }
97 static __inline size_t ua_wcslen(PCUWSTR String) {
98 if(WSTR_ALIGNED(String)) return wcslen((PCWSTR)String);
99 return uaw_wcslen(String);
100 }
101#endif
102
103 static __inline int ua_wcsicmp(LPCUWSTR String1,LPCUWSTR String2) {
104 if(WSTR_ALIGNED(String1) && WSTR_ALIGNED(String2)) return _wcsicmp((LPCWSTR)String1,(LPCWSTR)String2);
105 return uaw_wcsicmp(String1,String2);
106 }
107#endif
108
109#ifndef __UA_WCSLEN
110#define __UA_WCSLEN ua_wcslen
111#endif
112
113#define __UA_WSTRSIZE(s) ((__UA_WCSLEN(s)+1)*sizeof(WCHAR))
114#define __UA_STACKCOPY(p,s) memcpy(_alloca(s),p,s)
115
116#ifdef I_X86_
117#define WSTR_ALIGNED_STACK_COPY(d,s) (*(d) = (PCWSTR)(s))
118#else
119#define WSTR_ALIGNED_STACK_COPY(d,s) { PCUWSTR __ua_src; ULONG __ua_size; PWSTR __ua_dst; __ua_src = (s); if(WSTR_ALIGNED(__ua_src)) { __ua_dst = (PWSTR)__ua_src; } else { __ua_size = __UA_WSTRSIZE(__ua_src); __ua_dst = (PWSTR)_alloca(__ua_size); memcpy(__ua_dst,__ua_src,__ua_size); } *(d) = (PCWSTR)__ua_dst; }
120#endif
121
122#define ASTR_ALIGNED_STACK_COPY(d,s) (*(d) = (PCSTR)(s))
123
124#ifndef I_X86_
125#define __UA_STRUC_ALIGNED(t,s) (((DWORD_PTR)(s) & (TYPE_ALIGNMENT(t)-1))==0)
126#define STRUC_ALIGNED_STACK_COPY(t,s) __UA_STRUC_ALIGNED(t,s) ? ((t const *)(s)) : ((t const *)__UA_STACKCOPY((s),sizeof(t)))
127#else
128#define STRUC_ALIGNED_STACK_COPY(t,s) ((CONST t *)(s))
129#endif
130
131#ifdef UNICODE
132#define TSTR_ALIGNED_STACK_COPY(d,s) WSTR_ALIGNED_STACK_COPY(d,s)
133#define TSTR_ALIGNED(x) WSTR_ALIGNED(x)
134#define ua_CharUpper ua_CharUpperW
135#define ua_lstrcmp ua_lstrcmpW
136#define ua_lstrcmpi ua_lstrcmpiW
137#define ua_lstrlen ua_lstrlenW
138#define ua_tcscpy ua_wcscpy
139#else
140#define TSTR_ALIGNED_STACK_COPY(d,s) ASTR_ALIGNED_STACK_COPY(d,s)
141#define TSTR_ALIGNED(x) TRUE
142#define ua_CharUpper CharUpperA
143#define ua_lstrcmp lstrcmpA
144#define ua_lstrcmpi lstrcmpiA
145#define ua_lstrlen lstrlenA
146#define ua_tcscpy strcpy
147#endif
148
149#ifdef __cplusplus
150}
151#endif
152
153#include <sec_api/stralign_s.h>
154#endif
win32/include/winapi/tvout.h+79−0
@@ -0,0 +1,79 @@
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 __TVOUT__
7#define __TVOUT__
8
9#include <guiddef.h>
10
11typedef struct _VIDEOPARAMETERS {
12 GUID Guid;
13 ULONG dwOffset;
14 ULONG dwCommand;
15 ULONG dwFlags;
16 ULONG dwMode;
17 ULONG dwTVStandard;
18 ULONG dwAvailableModes;
19 ULONG dwAvailableTVStandard;
20 ULONG dwFlickerFilter;
21 ULONG dwOverScanX;
22 ULONG dwOverScanY;
23 ULONG dwMaxUnscaledX;
24 ULONG dwMaxUnscaledY;
25 ULONG dwPositionX;
26 ULONG dwPositionY;
27 ULONG dwBrightness;
28 ULONG dwContrast;
29 ULONG dwCPType;
30 ULONG dwCPCommand;
31 ULONG dwCPStandard;
32 ULONG dwCPKey;
33 ULONG bCP_APSTriggerBits;
34 UCHAR bOEMCopyProtection[256];
35} VIDEOPARAMETERS,*PVIDEOPARAMETERS,*LPVIDEOPARAMETERS;
36
37#define VP_COMMAND_GET 0x0001
38#define VP_COMMAND_SET 0x0002
39
40#define VP_FLAGS_TV_MODE 0x0001
41#define VP_FLAGS_TV_STANDARD 0x0002
42#define VP_FLAGS_FLICKER 0x0004
43#define VP_FLAGS_OVERSCAN 0x0008
44#define VP_FLAGS_MAX_UNSCALED 0x0010
45#define VP_FLAGS_POSITION 0x0020
46#define VP_FLAGS_BRIGHTNESS 0x0040
47#define VP_FLAGS_CONTRAST 0x0080
48#define VP_FLAGS_COPYPROTECT 0x0100
49
50#define VP_MODE_WIN_GRAPHICS 0x0001
51#define VP_MODE_TV_PLAYBACK 0x0002
52
53#define VP_TV_STANDARD_NTSC_M 0x0001
54#define VP_TV_STANDARD_NTSC_M_J 0x0002
55#define VP_TV_STANDARD_PAL_B 0x0004
56#define VP_TV_STANDARD_PAL_D 0x0008
57#define VP_TV_STANDARD_PAL_H 0x0010
58#define VP_TV_STANDARD_PAL_I 0x0020
59#define VP_TV_STANDARD_PAL_M 0x0040
60#define VP_TV_STANDARD_PAL_N 0x0080
61#define VP_TV_STANDARD_SECAM_B 0x0100
62#define VP_TV_STANDARD_SECAM_D 0x0200
63#define VP_TV_STANDARD_SECAM_G 0x0400
64#define VP_TV_STANDARD_SECAM_H 0x0800
65#define VP_TV_STANDARD_SECAM_K 0x1000
66#define VP_TV_STANDARD_SECAM_K1 0x2000
67#define VP_TV_STANDARD_SECAM_L 0x4000
68#define VP_TV_STANDARD_WIN_VGA 0x8000
69#define VP_TV_STANDARD_NTSC_433 0x00010000
70#define VP_TV_STANDARD_PAL_G 0x00020000
71#define VP_TV_STANDARD_PAL_60 0x00040000
72#define VP_TV_STANDARD_SECAM_L1 0x00080000
73
74#define VP_CP_TYPE_APS_TRIGGER 0x0001
75#define VP_CP_TYPE_MACROVISION 0x0002
76#define VP_CP_CMD_ACTIVATE 0x0001
77#define VP_CP_CMD_DEACTIVATE 0x0002
78#define VP_CP_CMD_CHANGE 0x0004
79#endif
win32/include/winapi/winbase.h+2894−1795
@@ -1,1852 +1,2951 @@
1#ifndef _WINBASE_H1/**
2#define _WINBASE_H2 * This file has no copyright assigned and is placed in the Public Domain.
3#if __GNUC__ >=33 * This file is part of the w64 mingw-runtime package.
4#pragma GCC system_header4 * No warranty is given; refer to the file DISCLAIMER within this package.
5#endif5 */
6#ifndef _WINBASE_
7#define _WINBASE_
6 8
9#define WINADVAPI DECLSPEC_IMPORT
7#define WINBASEAPI DECLSPEC_IMPORT10#define WINBASEAPI DECLSPEC_IMPORT
11#define ZAWPROXYAPI DECLSPEC_IMPORT
12
8#ifdef __cplusplus13#ifdef __cplusplus
9extern "C" {14extern "C" {
10#endif15#endif
11 16
12#define SP_SERIALCOMM 117#define DefineHandleTable(w) ((w),TRUE)
13#define PST_UNSPECIFIED 018#define LimitEmsPages(dw)
14#define PST_RS232 119#define SetSwapAreaSize(w) (w)
15#define PST_PARALLELPORT 220#define LockSegment(w) GlobalFix((HANDLE)(w))
16#define PST_RS422 321#define UnlockSegment(w) GlobalUnfix((HANDLE)(w))
17#define PST_RS423 422#define GetCurrentTime() GetTickCount()
18#define PST_RS449 523
19#define PST_MODEM 624#define Yield()
20#define PST_FAX 0x2125
21#define PST_SCANNER 0x2226#define INVALID_HANDLE_VALUE ((HANDLE)(LONG_PTR)-1)
22#define PST_NETWORK_BRIDGE 0x10027#define INVALID_FILE_SIZE ((DWORD)0xffffffff)
23#define PST_LAT 0x10128#define INVALID_SET_FILE_POINTER ((DWORD)-1)
24#define PST_TCPIP_TELNET 0x10229#define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
25#define PST_X25 0x10330
26#define BAUD_075 131#define FILE_BEGIN 0
27#define BAUD_110 232#define FILE_CURRENT 1
28#define BAUD_134_5 433#define FILE_END 2
29#define BAUD_150 834
30#define BAUD_300 1635#define TIME_ZONE_ID_INVALID ((DWORD)0xffffffff)
31#define BAUD_600 3236
32#define BAUD_1200 6437#define WAIT_FAILED ((DWORD)0xffffffff)
33#define BAUD_1800 12838#define WAIT_OBJECT_0 ((STATUS_WAIT_0) + 0)
34#define BAUD_2400 25639#define WAIT_ABANDONED ((STATUS_ABANDONED_WAIT_0) + 0)
35#define BAUD_4800 51240#define WAIT_ABANDONED_0 ((STATUS_ABANDONED_WAIT_0) + 0)
36#define BAUD_7200 102441#define WAIT_IO_COMPLETION STATUS_USER_APC
37#define BAUD_9600 204842#define STILL_ACTIVE STATUS_PENDING
38#define BAUD_14400 409643#define EXCEPTION_ACCESS_VIOLATION STATUS_ACCESS_VIOLATION
39#define BAUD_19200 819244#define EXCEPTION_DATATYPE_MISALIGNMENT STATUS_DATATYPE_MISALIGNMENT
40#define BAUD_38400 1638445#define EXCEPTION_BREAKPOINT STATUS_BREAKPOINT
41#define BAUD_56K 3276846#define EXCEPTION_SINGLE_STEP STATUS_SINGLE_STEP
42#define BAUD_128K 6553647#define EXCEPTION_ARRAY_BOUNDS_EXCEEDED STATUS_ARRAY_BOUNDS_EXCEEDED
43#define BAUD_115200 13107248#define EXCEPTION_FLT_DENORMAL_OPERAND STATUS_FLOAT_DENORMAL_OPERAND
44#define BAUD_57600 26214449#define EXCEPTION_FLT_DIVIDE_BY_ZERO STATUS_FLOAT_DIVIDE_BY_ZERO
45#define BAUD_USER 0x1000000050#define EXCEPTION_FLT_INEXACT_RESULT STATUS_FLOAT_INEXACT_RESULT
46#define PCF_DTRDSR 151#define EXCEPTION_FLT_INVALID_OPERATION STATUS_FLOAT_INVALID_OPERATION
47#define PCF_RTSCTS 252#define EXCEPTION_FLT_OVERFLOW STATUS_FLOAT_OVERFLOW
48#define PCF_RLSD 453#define EXCEPTION_FLT_STACK_CHECK STATUS_FLOAT_STACK_CHECK
49#define PCF_PARITY_CHECK 854#define EXCEPTION_FLT_UNDERFLOW STATUS_FLOAT_UNDERFLOW
50#define PCF_XONXOFF 1655#define EXCEPTION_INT_DIVIDE_BY_ZERO STATUS_INTEGER_DIVIDE_BY_ZERO
51#define PCF_SETXCHAR 3256#define EXCEPTION_INT_OVERFLOW STATUS_INTEGER_OVERFLOW
52#define PCF_TOTALTIMEOUTS 6457#define EXCEPTION_PRIV_INSTRUCTION STATUS_PRIVILEGED_INSTRUCTION
53#define PCF_INTTIMEOUTS 12858#define EXCEPTION_IN_PAGE_ERROR STATUS_IN_PAGE_ERROR
54#define PCF_SPECIALCHARS 25659#define EXCEPTION_ILLEGAL_INSTRUCTION STATUS_ILLEGAL_INSTRUCTION
55#define PCF_16BITMODE 51260#define EXCEPTION_NONCONTINUABLE_EXCEPTION STATUS_NONCONTINUABLE_EXCEPTION
56#define SP_PARITY 161#define EXCEPTION_STACK_OVERFLOW STATUS_STACK_OVERFLOW
57#define SP_BAUD 262#define EXCEPTION_INVALID_DISPOSITION STATUS_INVALID_DISPOSITION
58#define SP_DATABITS 463#define EXCEPTION_GUARD_PAGE STATUS_GUARD_PAGE_VIOLATION
59#define SP_STOPBITS 864#define EXCEPTION_INVALID_HANDLE STATUS_INVALID_HANDLE
60#define SP_HANDSHAKING 1665#define EXCEPTION_POSSIBLE_DEADLOCK STATUS_POSSIBLE_DEADLOCK
61#define SP_PARITY_CHECK 3266#define CONTROL_C_EXIT STATUS_CONTROL_C_EXIT
62#define SP_RLSD 6467#define MoveMemory RtlMoveMemory
63#define DATABITS_5 168#define CopyMemory RtlCopyMemory
64#define DATABITS_6 269#define FillMemory RtlFillMemory
65#define DATABITS_7 470#define ZeroMemory RtlZeroMemory
66#define DATABITS_8 871#define SecureZeroMemory RtlSecureZeroMemory
67#define DATABITS_16 1672
68#define DATABITS_16X 3273#define FILE_FLAG_WRITE_THROUGH 0x80000000
69#define STOPBITS_10 174#define FILE_FLAG_OVERLAPPED 0x40000000
70#define STOPBITS_15 275#define FILE_FLAG_NO_BUFFERING 0x20000000
71#define STOPBITS_20 476#define FILE_FLAG_RANDOM_ACCESS 0x10000000
72#define PARITY_NONE 25677#define FILE_FLAG_SEQUENTIAL_SCAN 0x8000000
73#define PARITY_ODD 51278#define FILE_FLAG_DELETE_ON_CLOSE 0x4000000
74#define PARITY_EVEN 102479#define FILE_FLAG_BACKUP_SEMANTICS 0x2000000
75#define PARITY_MARK 204880#define FILE_FLAG_POSIX_SEMANTICS 0x1000000
76#define PARITY_SPACE 409681#define FILE_FLAG_OPEN_REPARSE_POINT 0x200000
77#define EXCEPTION_DEBUG_EVENT 182#define FILE_FLAG_OPEN_NO_RECALL 0x100000
78#define CREATE_THREAD_DEBUG_EVENT 283#define FILE_FLAG_FIRST_PIPE_INSTANCE 0x80000
79#define CREATE_PROCESS_DEBUG_EVENT 384
80#define EXIT_THREAD_DEBUG_EVENT 485#define CREATE_NEW 1
81#define EXIT_PROCESS_DEBUG_EVENT 586#define CREATE_ALWAYS 2
82#define LOAD_DLL_DEBUG_EVENT 687#define OPEN_EXISTING 3
83#define UNLOAD_DLL_DEBUG_EVENT 788#define OPEN_ALWAYS 4
84#define OUTPUT_DEBUG_STRING_EVENT 889#define TRUNCATE_EXISTING 5
85#define RIP_EVENT 990
86#define HFILE_ERROR ((HFILE)-1)91#define PROGRESS_CONTINUE 0
87#define FILE_BEGIN 092#define PROGRESS_CANCEL 1
88#define FILE_CURRENT 193#define PROGRESS_STOP 2
89#define FILE_END 294#define PROGRESS_QUIET 3
90#define INVALID_SET_FILE_POINTER ((DWORD)-1)95
91#define OF_READ 096#define CALLBACK_CHUNK_FINISHED 0x0
92#define OF_READWRITE 297#define CALLBACK_STREAM_SWITCH 0x1
93#define OF_WRITE 198
94#define OF_SHARE_COMPAT 099#define COPY_FILE_FAIL_IF_EXISTS 0x1
95#define OF_SHARE_DENY_NONE 64100#define COPY_FILE_RESTARTABLE 0x2
96#define OF_SHARE_DENY_READ 48101#define COPY_FILE_OPEN_SOURCE_FOR_WRITE 0x4
97#define OF_SHARE_DENY_WRITE 32102#define COPY_FILE_ALLOW_DECRYPTED_DESTINATION 0x8
98#define OF_SHARE_EXCLUSIVE 16103
99#define OF_CANCEL 2048104#define REPLACEFILE_WRITE_THROUGH 0x1
100#define OF_CREATE 4096105#define REPLACEFILE_IGNORE_MERGE_ERRORS 0x2
101#define OF_DELETE 512106
102#define OF_EXIST 16384107#define PIPE_ACCESS_INBOUND 0x1
103#define OF_PARSE 256108#define PIPE_ACCESS_OUTBOUND 0x2
104#define OF_PROMPT 8192109#define PIPE_ACCESS_DUPLEX 0x3
105#define OF_REOPEN 32768110
106#define OF_VERIFY 1024111#define PIPE_CLIENT_END 0x0
107#define NMPWAIT_NOWAIT 1112#define PIPE_SERVER_END 0x1
108#define NMPWAIT_WAIT_FOREVER (-1)113
109#define NMPWAIT_USE_DEFAULT_WAIT 0114#define PIPE_WAIT 0x0
110#define CE_BREAK 16115#define PIPE_NOWAIT 0x1
111#define CE_DNS 2048116#define PIPE_READMODE_BYTE 0x0
112#define CE_FRAME 8117#define PIPE_READMODE_MESSAGE 0x2
113#define CE_IOE 1024118#define PIPE_TYPE_BYTE 0x0
114#define CE_MODE 32768119#define PIPE_TYPE_MESSAGE 0x4
115#define CE_OOP 4096120
116#define CE_OVERRUN 2
117#define CE_PTO 512
118#define CE_RXOVER 1
119#define CE_RXPARITY 4
120#define CE_TXFULL 256
121#define PROGRESS_CONTINUE 0
122#define PROGRESS_CANCEL 1
123#define PROGRESS_STOP 2
124#define PROGRESS_QUIET 3
125#define CALLBACK_CHUNK_FINISHED 0
126#define CALLBACK_STREAM_SWITCH 1
127#define COPY_FILE_FAIL_IF_EXISTS 1
128#define COPY_FILE_RESTARTABLE 2
129#define OFS_MAXPATHNAME 128
130#define DUPLICATE_CLOSE_SOURCE 1
131#define DUPLICATE_SAME_ACCESS 2
132#define FILE_MAP_ALL_ACCESS 0xf001f
133#define FILE_MAP_READ 4
134#define FILE_MAP_WRITE 2
135#define FILE_MAP_COPY 1
136#define MUTEX_ALL_ACCESS 0x1f0001
137#define MUTEX_MODIFY_STATE 1
138#define SEMAPHORE_ALL_ACCESS 0x1f0003
139#define SEMAPHORE_MODIFY_STATE 2
140#define EVENT_ALL_ACCESS 0x1f0003
141#define EVENT_MODIFY_STATE 2
142#define PIPE_ACCESS_DUPLEX 3
143#define PIPE_ACCESS_INBOUND 1
144#define PIPE_ACCESS_OUTBOUND 2
145#define PIPE_TYPE_BYTE 0
146#define PIPE_TYPE_MESSAGE 4
147#define PIPE_READMODE_BYTE 0
148#define PIPE_READMODE_MESSAGE 2
149#define PIPE_WAIT 0
150#define PIPE_NOWAIT 1
151#define PIPE_CLIENT_END 0
152#define PIPE_SERVER_END 1
153#define PIPE_UNLIMITED_INSTANCES 255121#define PIPE_UNLIMITED_INSTANCES 255
154#define CREATE_DEFAULT_ERROR_MODE 67108864122
155#define DEBUG_PROCESS 1123#define SECURITY_ANONYMOUS (SecurityAnonymous << 16)
156#define DEBUG_ONLY_THIS_PROCESS 2124#define SECURITY_IDENTIFICATION (SecurityIdentification << 16)
157#define CREATE_SUSPENDED 4125#define SECURITY_IMPERSONATION (SecurityImpersonation << 16)
158#define DETACHED_PROCESS 8126#define SECURITY_DELEGATION (SecurityDelegation << 16)
159#define CREATE_NEW_CONSOLE 16127
160#define NORMAL_PRIORITY_CLASS 32128#define SECURITY_CONTEXT_TRACKING 0x40000
161#define IDLE_PRIORITY_CLASS 64129#define SECURITY_EFFECTIVE_ONLY 0x80000
162#define HIGH_PRIORITY_CLASS 128130
163#define REALTIME_PRIORITY_CLASS 256131#define SECURITY_SQOS_PRESENT 0x100000
164#define CREATE_NEW_PROCESS_GROUP 512132#define SECURITY_VALID_SQOS_FLAGS 0x1f0000
165#define CREATE_UNICODE_ENVIRONMENT 1024133
166#define CREATE_SEPARATE_WOW_VDM 2048134 typedef struct _OVERLAPPED {
167#define CREATE_SHARED_WOW_VDM 4096135 ULONG_PTR Internal;
168#define CREATE_FORCEDOS 8192136 ULONG_PTR InternalHigh;
137 union {
138 struct {
139 DWORD Offset;
140 DWORD OffsetHigh;
141 };
142 PVOID Pointer;
143 };
144 HANDLE hEvent;
145 } OVERLAPPED,*LPOVERLAPPED;
146
147 typedef struct _SECURITY_ATTRIBUTES {
148 DWORD nLength;
149 LPVOID lpSecurityDescriptor;
150 WINBOOL bInheritHandle;
151 } SECURITY_ATTRIBUTES,*PSECURITY_ATTRIBUTES,*LPSECURITY_ATTRIBUTES;
152
153 typedef struct _PROCESS_INFORMATION {
154 HANDLE hProcess;
155 HANDLE hThread;
156 DWORD dwProcessId;
157 DWORD dwThreadId;
158 } PROCESS_INFORMATION,*PPROCESS_INFORMATION,*LPPROCESS_INFORMATION;
159
160#ifndef _FILETIME_
161#define _FILETIME_
162 typedef struct _FILETIME {
163 DWORD dwLowDateTime;
164 DWORD dwHighDateTime;
165 } FILETIME,*PFILETIME,*LPFILETIME;
166#endif
167
168 typedef struct _SYSTEMTIME {
169 WORD wYear;
170 WORD wMonth;
171 WORD wDayOfWeek;
172 WORD wDay;
173 WORD wHour;
174 WORD wMinute;
175 WORD wSecond;
176 WORD wMilliseconds;
177 } SYSTEMTIME,*PSYSTEMTIME,*LPSYSTEMTIME;
178
179 typedef DWORD (WINAPI *PTHREAD_START_ROUTINE)(LPVOID lpThreadParameter);
180 typedef PTHREAD_START_ROUTINE LPTHREAD_START_ROUTINE;
181 typedef VOID (WINAPI *PFIBER_START_ROUTINE)(LPVOID lpFiberParameter);
182 typedef PFIBER_START_ROUTINE LPFIBER_START_ROUTINE;
183
184 typedef RTL_CRITICAL_SECTION CRITICAL_SECTION;
185 typedef PRTL_CRITICAL_SECTION PCRITICAL_SECTION;
186 typedef PRTL_CRITICAL_SECTION LPCRITICAL_SECTION;
187 typedef RTL_CRITICAL_SECTION_DEBUG CRITICAL_SECTION_DEBUG;
188 typedef PRTL_CRITICAL_SECTION_DEBUG PCRITICAL_SECTION_DEBUG;
189 typedef PRTL_CRITICAL_SECTION_DEBUG LPCRITICAL_SECTION_DEBUG;
190
191 WINBASEAPI PVOID WINAPI EncodePointer(PVOID Ptr);
192 WINBASEAPI PVOID WINAPI DecodePointer(PVOID Ptr);
193 WINBASEAPI PVOID WINAPI EncodeSystemPointer(PVOID Ptr);
194 WINBASEAPI PVOID WINAPI DecodeSystemPointer(PVOID Ptr);
195
196#ifdef I_X86_
197 typedef PLDT_ENTRY LPLDT_ENTRY;
198#else
199 typedef LPVOID LPLDT_ENTRY;
200#endif
201
202#define MUTEX_MODIFY_STATE MUTANT_QUERY_STATE
203#define MUTEX_ALL_ACCESS MUTANT_ALL_ACCESS
204
205#define SP_SERIALCOMM ((DWORD)0x1)
206
207#define PST_UNSPECIFIED ((DWORD)0x0)
208#define PST_RS232 ((DWORD)0x1)
209#define PST_PARALLELPORT ((DWORD)0x2)
210#define PST_RS422 ((DWORD)0x3)
211#define PST_RS423 ((DWORD)0x4)
212#define PST_RS449 ((DWORD)0x5)
213#define PST_MODEM ((DWORD)0x6)
214#define PST_FAX ((DWORD)0x21)
215#define PST_SCANNER ((DWORD)0x22)
216#define PST_NETWORK_BRIDGE ((DWORD)0x100)
217#define PST_LAT ((DWORD)0x101)
218#define PST_TCPIP_TELNET ((DWORD)0x102)
219#define PST_X25 ((DWORD)0x103)
220
221#define PCF_DTRDSR ((DWORD)0x1)
222#define PCF_RTSCTS ((DWORD)0x2)
223#define PCF_RLSD ((DWORD)0x4)
224#define PCF_PARITY_CHECK ((DWORD)0x8)
225#define PCF_XONXOFF ((DWORD)0x10)
226#define PCF_SETXCHAR ((DWORD)0x20)
227#define PCF_TOTALTIMEOUTS ((DWORD)0x40)
228#define PCF_INTTIMEOUTS ((DWORD)0x80)
229#define PCF_SPECIALCHARS ((DWORD)0x100)
230#define PCF_16BITMODE ((DWORD)0x200)
231
232#define SP_PARITY ((DWORD)0x1)
233#define SP_BAUD ((DWORD)0x2)
234#define SP_DATABITS ((DWORD)0x4)
235#define SP_STOPBITS ((DWORD)0x8)
236#define SP_HANDSHAKING ((DWORD)0x10)
237#define SP_PARITY_CHECK ((DWORD)0x20)
238#define SP_RLSD ((DWORD)0x40)
239
240#define BAUD_075 ((DWORD)0x1)
241#define BAUD_110 ((DWORD)0x2)
242#define BAUD_134_5 ((DWORD)0x4)
243#define BAUD_150 ((DWORD)0x8)
244#define BAUD_300 ((DWORD)0x10)
245#define BAUD_600 ((DWORD)0x20)
246#define BAUD_1200 ((DWORD)0x40)
247#define BAUD_1800 ((DWORD)0x80)
248#define BAUD_2400 ((DWORD)0x100)
249#define BAUD_4800 ((DWORD)0x200)
250#define BAUD_7200 ((DWORD)0x400)
251#define BAUD_9600 ((DWORD)0x800)
252#define BAUD_14400 ((DWORD)0x1000)
253#define BAUD_19200 ((DWORD)0x2000)
254#define BAUD_38400 ((DWORD)0x4000)
255#define BAUD_56K ((DWORD)0x8000)
256#define BAUD_128K ((DWORD)0x10000)
257#define BAUD_115200 ((DWORD)0x20000)
258#define BAUD_57600 ((DWORD)0x40000)
259#define BAUD_USER ((DWORD)0x10000000)
260
261#define DATABITS_5 ((WORD)0x1)
262#define DATABITS_6 ((WORD)0x2)
263#define DATABITS_7 ((WORD)0x4)
264#define DATABITS_8 ((WORD)0x8)
265#define DATABITS_16 ((WORD)0x10)
266#define DATABITS_16X ((WORD)0x20)
267
268#define STOPBITS_10 ((WORD)0x1)
269#define STOPBITS_15 ((WORD)0x2)
270#define STOPBITS_20 ((WORD)0x4)
271#define PARITY_NONE ((WORD)0x100)
272#define PARITY_ODD ((WORD)0x200)
273#define PARITY_EVEN ((WORD)0x400)
274#define PARITY_MARK ((WORD)0x800)
275#define PARITY_SPACE ((WORD)0x1000)
276
277 typedef struct _COMMPROP {
278 WORD wPacketLength;
279 WORD wPacketVersion;
280 DWORD dwServiceMask;
281 DWORD dwReserved1;
282 DWORD dwMaxTxQueue;
283 DWORD dwMaxRxQueue;
284 DWORD dwMaxBaud;
285 DWORD dwProvSubType;
286 DWORD dwProvCapabilities;
287 DWORD dwSettableParams;
288 DWORD dwSettableBaud;
289 WORD wSettableData;
290 WORD wSettableStopParity;
291 DWORD dwCurrentTxQueue;
292 DWORD dwCurrentRxQueue;
293 DWORD dwProvSpec1;
294 DWORD dwProvSpec2;
295 WCHAR wcProvChar[1];
296 } COMMPROP,*LPCOMMPROP;
297
298#define COMMPROP_INITIALIZED ((DWORD)0xE73CF52E)
299
300 typedef struct _COMSTAT {
301 DWORD fCtsHold : 1;
302 DWORD fDsrHold : 1;
303 DWORD fRlsdHold : 1;
304 DWORD fXoffHold : 1;
305 DWORD fXoffSent : 1;
306 DWORD fEof : 1;
307 DWORD fTxim : 1;
308 DWORD fReserved : 25;
309 DWORD cbInQue;
310 DWORD cbOutQue;
311 } COMSTAT,*LPCOMSTAT;
312
313#define DTR_CONTROL_DISABLE 0x0
314#define DTR_CONTROL_ENABLE 0x1
315#define DTR_CONTROL_HANDSHAKE 0x2
316
317#define RTS_CONTROL_DISABLE 0x0
318#define RTS_CONTROL_ENABLE 0x1
319#define RTS_CONTROL_HANDSHAKE 0x2
320#define RTS_CONTROL_TOGGLE 0x3
321
322 typedef struct _DCB {
323 DWORD DCBlength;
324 DWORD BaudRate;
325 DWORD fBinary: 1;
326 DWORD fParity: 1;
327 DWORD fOutxCtsFlow:1;
328 DWORD fOutxDsrFlow:1;
329 DWORD fDtrControl:2;
330 DWORD fDsrSensitivity:1;
331 DWORD fTXContinueOnXoff: 1;
332 DWORD fOutX: 1;
333 DWORD fInX: 1;
334 DWORD fErrorChar: 1;
335 DWORD fNull: 1;
336 DWORD fRtsControl:2;
337 DWORD fAbortOnError:1;
338 DWORD fDummy2:17;
339 WORD wReserved;
340 WORD XonLim;
341 WORD XoffLim;
342 BYTE ByteSize;
343 BYTE Parity;
344 BYTE StopBits;
345 char XonChar;
346 char XoffChar;
347 char ErrorChar;
348 char EofChar;
349 char EvtChar;
350 WORD wReserved1;
351 } DCB,*LPDCB;
352
353 typedef struct _COMMTIMEOUTS {
354 DWORD ReadIntervalTimeout;
355 DWORD ReadTotalTimeoutMultiplier;
356 DWORD ReadTotalTimeoutConstant;
357 DWORD WriteTotalTimeoutMultiplier;
358 DWORD WriteTotalTimeoutConstant;
359 } COMMTIMEOUTS,*LPCOMMTIMEOUTS;
360
361 typedef struct _COMMCONFIG {
362 DWORD dwSize;
363 WORD wVersion;
364 WORD wReserved;
365 DCB dcb;
366 DWORD dwProviderSubType;
367 DWORD dwProviderOffset;
368 DWORD dwProviderSize;
369 WCHAR wcProviderData[1];
370 } COMMCONFIG,*LPCOMMCONFIG;
371
372 typedef struct _SYSTEM_INFO {
373 union {
374 DWORD dwOemId;
375 struct {
376 WORD wProcessorArchitecture;
377 WORD wReserved;
378 };
379 };
380 DWORD dwPageSize;
381 LPVOID lpMinimumApplicationAddress;
382 LPVOID lpMaximumApplicationAddress;
383 DWORD_PTR dwActiveProcessorMask;
384 DWORD dwNumberOfProcessors;
385 DWORD dwProcessorType;
386 DWORD dwAllocationGranularity;
387 WORD wProcessorLevel;
388 WORD wProcessorRevision;
389 } SYSTEM_INFO,*LPSYSTEM_INFO;
390
391#define FreeModule(hLibModule) FreeLibrary((hLibModule))
392#define MakeProcInstance(lpProc,hInstance) (lpProc)
393#define FreeProcInstance(lpProc) (lpProc)
394
395#define GMEM_FIXED 0x0
396#define GMEM_MOVEABLE 0x2
397#define GMEM_NOCOMPACT 0x10
398#define GMEM_NODISCARD 0x20
399#define GMEM_ZEROINIT 0x40
400#define GMEM_MODIFY 0x80
401#define GMEM_DISCARDABLE 0x100
402#define GMEM_NOT_BANKED 0x1000
403#define GMEM_SHARE 0x2000
404#define GMEM_DDESHARE 0x2000
405#define GMEM_NOTIFY 0x4000
406#define GMEM_LOWER GMEM_NOT_BANKED
407#define GMEM_VALID_FLAGS 0x7F72
408#define GMEM_INVALID_HANDLE 0x8000
409
410#define GHND (GMEM_MOVEABLE | GMEM_ZEROINIT)
411#define GPTR (GMEM_FIXED | GMEM_ZEROINIT)
412
413#define GlobalLRUNewest(h) ((HANDLE)(h))
414#define GlobalLRUOldest(h) ((HANDLE)(h))
415#define GlobalDiscard(h) GlobalReAlloc((h),0,GMEM_MOVEABLE)
416
417#define GMEM_DISCARDED 0x4000
418#define GMEM_LOCKCOUNT 0xff
419
420 typedef struct _MEMORYSTATUS {
421 DWORD dwLength;
422 DWORD dwMemoryLoad;
423 SIZE_T dwTotalPhys;
424 SIZE_T dwAvailPhys;
425 SIZE_T dwTotalPageFile;
426 SIZE_T dwAvailPageFile;
427 SIZE_T dwTotalVirtual;
428 SIZE_T dwAvailVirtual;
429 } MEMORYSTATUS,*LPMEMORYSTATUS;
430
431#define LMEM_FIXED 0x0
432#define LMEM_MOVEABLE 0x2
433#define LMEM_NOCOMPACT 0x10
434#define LMEM_NODISCARD 0x20
435#define LMEM_ZEROINIT 0x40
436#define LMEM_MODIFY 0x80
437#define LMEM_DISCARDABLE 0xf00
438#define LMEM_VALID_FLAGS 0xf72
439#define LMEM_INVALID_HANDLE 0x8000
440
441#define LHND (LMEM_MOVEABLE | LMEM_ZEROINIT)
442#define LPTR (LMEM_FIXED | LMEM_ZEROINIT)
443
444#define NONZEROLHND (LMEM_MOVEABLE)
445#define NONZEROLPTR (LMEM_FIXED)
446
447#define LocalDiscard(h) LocalReAlloc((h),0,LMEM_MOVEABLE)
448
449#define LMEM_DISCARDED 0x4000
450#define LMEM_LOCKCOUNT 0xff
451
452#define DEBUG_PROCESS 0x1
453#define DEBUG_ONLY_THIS_PROCESS 0x2
454#define CREATE_SUSPENDED 0x4
455#define DETACHED_PROCESS 0x8
456#define CREATE_NEW_CONSOLE 0x10
457#define NORMAL_PRIORITY_CLASS 0x20
458#define IDLE_PRIORITY_CLASS 0x40
459#define HIGH_PRIORITY_CLASS 0x80
460#define REALTIME_PRIORITY_CLASS 0x100
461#define CREATE_NEW_PROCESS_GROUP 0x200
462#define CREATE_UNICODE_ENVIRONMENT 0x400
463#define CREATE_SEPARATE_WOW_VDM 0x800
464#define CREATE_SHARED_WOW_VDM 0x1000
465#define CREATE_FORCEDOS 0x2000
466#define BELOW_NORMAL_PRIORITY_CLASS 0x4000
467#define ABOVE_NORMAL_PRIORITY_CLASS 0x8000
468#define STACK_SIZE_PARAM_IS_A_RESERVATION 0x10000
469
470#define CREATE_BREAKAWAY_FROM_JOB 0x1000000
471#define CREATE_PRESERVE_CODE_AUTHZ_LEVEL 0x2000000
472
473#define CREATE_DEFAULT_ERROR_MODE 0x4000000
169#define CREATE_NO_WINDOW 0x8000000474#define CREATE_NO_WINDOW 0x8000000
170#define CONSOLE_TEXTMODE_BUFFER 1475
171#define CREATE_NEW 1476#define PROFILE_USER 0x10000000
172#define CREATE_ALWAYS 2477#define PROFILE_KERNEL 0x20000000
173#define OPEN_EXISTING 3478#define PROFILE_SERVER 0x40000000
174#define OPEN_ALWAYS 4479
175#define TRUNCATE_EXISTING 5480#define CREATE_IGNORE_SYSTEM_DEFAULT 0x80000000
176#define FILE_FLAG_WRITE_THROUGH 0x80000000481
177#define FILE_FLAG_OVERLAPPED 1073741824482#define THREAD_PRIORITY_LOWEST THREAD_BASE_PRIORITY_MIN
178#define FILE_FLAG_NO_BUFFERING 536870912483#define THREAD_PRIORITY_BELOW_NORMAL (THREAD_PRIORITY_LOWEST+1)
179#define FILE_FLAG_RANDOM_ACCESS 268435456484#define THREAD_PRIORITY_NORMAL 0
180#define FILE_FLAG_SEQUENTIAL_SCAN 134217728485#define THREAD_PRIORITY_HIGHEST THREAD_BASE_PRIORITY_MAX
181#define FILE_FLAG_DELETE_ON_CLOSE 67108864486#define THREAD_PRIORITY_ABOVE_NORMAL (THREAD_PRIORITY_HIGHEST-1)
182#define FILE_FLAG_BACKUP_SEMANTICS 33554432487#define THREAD_PRIORITY_ERROR_RETURN (MAXLONG)
183#define FILE_FLAG_POSIX_SEMANTICS 16777216488
184#define FILE_FLAG_OPEN_REPARSE_POINT 2097152489#define THREAD_PRIORITY_TIME_CRITICAL THREAD_BASE_PRIORITY_LOWRT
185#define FILE_FLAG_OPEN_NO_RECALL 1048576490#define THREAD_PRIORITY_IDLE THREAD_BASE_PRIORITY_IDLE
186#define CLRDTR 6491
187#define CLRRTS 4492#define EXCEPTION_DEBUG_EVENT 1
188#define SETDTR 5493#define CREATE_THREAD_DEBUG_EVENT 2
189#define SETRTS 3494#define CREATE_PROCESS_DEBUG_EVENT 3
190#define SETXOFF 1495#define EXIT_THREAD_DEBUG_EVENT 4
191#define SETXON 2496#define EXIT_PROCESS_DEBUG_EVENT 5
192#define SETBREAK 8497#define LOAD_DLL_DEBUG_EVENT 6
193#define CLRBREAK 9498#define UNLOAD_DLL_DEBUG_EVENT 7
194#define STILL_ACTIVE 0x103499#define OUTPUT_DEBUG_STRING_EVENT 8
195#define FIND_FIRST_EX_CASE_SENSITIVE 1500#define RIP_EVENT 9
196#define SCS_32BIT_BINARY 0501
197#define SCS_DOS_BINARY 1502 typedef struct _EXCEPTION_DEBUG_INFO {
198#define SCS_OS216_BINARY 5503 EXCEPTION_RECORD ExceptionRecord;
199#define SCS_PIF_BINARY 3504 DWORD dwFirstChance;
200#define SCS_POSIX_BINARY 4505 } EXCEPTION_DEBUG_INFO,*LPEXCEPTION_DEBUG_INFO;
201#define SCS_WOW_BINARY 2506
202#define MAX_COMPUTERNAME_LENGTH 15507 typedef struct _CREATE_THREAD_DEBUG_INFO {
203#define HW_PROFILE_GUIDLEN 39508 HANDLE hThread;
204#define MAX_PROFILE_LEN 80509 LPVOID lpThreadLocalBase;
205#define DOCKINFO_UNDOCKED 1510 LPTHREAD_START_ROUTINE lpStartAddress;
206#define DOCKINFO_DOCKED 2511 } CREATE_THREAD_DEBUG_INFO,*LPCREATE_THREAD_DEBUG_INFO;
207#define DOCKINFO_USER_SUPPLIED 4512
208#define DOCKINFO_USER_UNDOCKED (DOCKINFO_USER_SUPPLIED|DOCKINFO_UNDOCKED)513 typedef struct _CREATE_PROCESS_DEBUG_INFO {
209#define DOCKINFO_USER_DOCKED (DOCKINFO_USER_SUPPLIED|DOCKINFO_DOCKED)514 HANDLE hFile;
515 HANDLE hProcess;
516 HANDLE hThread;
517 LPVOID lpBaseOfImage;
518 DWORD dwDebugInfoFileOffset;
519 DWORD nDebugInfoSize;
520 LPVOID lpThreadLocalBase;
521 LPTHREAD_START_ROUTINE lpStartAddress;
522 LPVOID lpImageName;
523 WORD fUnicode;
524 } CREATE_PROCESS_DEBUG_INFO,*LPCREATE_PROCESS_DEBUG_INFO;
525
526 typedef struct _EXIT_THREAD_DEBUG_INFO {
527 DWORD dwExitCode;
528 } EXIT_THREAD_DEBUG_INFO,*LPEXIT_THREAD_DEBUG_INFO;
529
530 typedef struct _EXIT_PROCESS_DEBUG_INFO {
531 DWORD dwExitCode;
532 } EXIT_PROCESS_DEBUG_INFO,*LPEXIT_PROCESS_DEBUG_INFO;
533
534 typedef struct _LOAD_DLL_DEBUG_INFO {
535 HANDLE hFile;
536 LPVOID lpBaseOfDll;
537 DWORD dwDebugInfoFileOffset;
538 DWORD nDebugInfoSize;
539 LPVOID lpImageName;
540 WORD fUnicode;
541 } LOAD_DLL_DEBUG_INFO,*LPLOAD_DLL_DEBUG_INFO;
542
543 typedef struct _UNLOAD_DLL_DEBUG_INFO {
544 LPVOID lpBaseOfDll;
545 } UNLOAD_DLL_DEBUG_INFO,*LPUNLOAD_DLL_DEBUG_INFO;
546
547 typedef struct _OUTPUT_DEBUG_STRING_INFO {
548 LPSTR lpDebugStringData;
549 WORD fUnicode;
550 WORD nDebugStringLength;
551 } OUTPUT_DEBUG_STRING_INFO,*LPOUTPUT_DEBUG_STRING_INFO;
552
553 typedef struct _RIP_INFO {
554 DWORD dwError;
555 DWORD dwType;
556 } RIP_INFO,*LPRIP_INFO;
557
558 typedef struct _DEBUG_EVENT {
559 DWORD dwDebugEventCode;
560 DWORD dwProcessId;
561 DWORD dwThreadId;
562 union {
563 EXCEPTION_DEBUG_INFO Exception;
564 CREATE_THREAD_DEBUG_INFO CreateThread;
565 CREATE_PROCESS_DEBUG_INFO CreateProcessInfo;
566 EXIT_THREAD_DEBUG_INFO ExitThread;
567 EXIT_PROCESS_DEBUG_INFO ExitProcess;
568 LOAD_DLL_DEBUG_INFO LoadDll;
569 UNLOAD_DLL_DEBUG_INFO UnloadDll;
570 OUTPUT_DEBUG_STRING_INFO DebugString;
571 RIP_INFO RipInfo;
572 } u;
573 } DEBUG_EVENT,*LPDEBUG_EVENT;
574
575 typedef PCONTEXT LPCONTEXT;
576 typedef PEXCEPTION_RECORD LPEXCEPTION_RECORD;
577 typedef PEXCEPTION_POINTERS LPEXCEPTION_POINTERS;
578
579#define DRIVE_UNKNOWN 0
580#define DRIVE_NO_ROOT_DIR 1
210#define DRIVE_REMOVABLE 2581#define DRIVE_REMOVABLE 2
211#define DRIVE_FIXED 3582#define DRIVE_FIXED 3
212#define DRIVE_REMOTE 4583#define DRIVE_REMOTE 4
213#define DRIVE_CDROM 5584#define DRIVE_CDROM 5
214#define DRIVE_RAMDISK 6585#define DRIVE_RAMDISK 6
215#define DRIVE_UNKNOWN 0586
216#define DRIVE_NO_ROOT_DIR 1587#define GetFreeSpace(w) (0x100000L)
217#define FILE_TYPE_UNKNOWN 0588#define FILE_TYPE_UNKNOWN 0x0
218#define FILE_TYPE_DISK 1589#define FILE_TYPE_DISK 0x1
219#define FILE_TYPE_CHAR 2590#define FILE_TYPE_CHAR 0x2
220#define FILE_TYPE_PIPE 3591#define FILE_TYPE_PIPE 0x3
221#define FILE_TYPE_REMOTE 0x8000592#define FILE_TYPE_REMOTE 0x8000
222#define HANDLE_FLAG_INHERIT 1
223#define HANDLE_FLAG_PROTECT_FROM_CLOSE 2
224#define STD_INPUT_HANDLE (DWORD)(0xfffffff6)
225#define STD_OUTPUT_HANDLE (DWORD)(0xfffffff5)
226#define STD_ERROR_HANDLE (DWORD)(0xfffffff4)
227#define INVALID_HANDLE_VALUE (HANDLE)(-1)
228#define GET_TAPE_MEDIA_INFORMATION 0
229#define GET_TAPE_DRIVE_INFORMATION 1
230#define SET_TAPE_MEDIA_INFORMATION 0
231#define SET_TAPE_DRIVE_INFORMATION 1
232#define THREAD_PRIORITY_ABOVE_NORMAL 1
233#define THREAD_PRIORITY_BELOW_NORMAL (-1)
234#define THREAD_PRIORITY_HIGHEST 2
235#define THREAD_PRIORITY_IDLE (-15)
236#define THREAD_PRIORITY_LOWEST (-2)
237#define THREAD_PRIORITY_NORMAL 0
238#define THREAD_PRIORITY_TIME_CRITICAL 15
239#define THREAD_PRIORITY_ERROR_RETURN 2147483647
240#define TIME_ZONE_ID_UNKNOWN 0
241#define TIME_ZONE_ID_STANDARD 1
242#define TIME_ZONE_ID_DAYLIGHT 2
243#define TIME_ZONE_ID_INVALID 0xFFFFFFFF
244#define FS_CASE_IS_PRESERVED 2
245#define FS_CASE_SENSITIVE 1
246#define FS_UNICODE_STORED_ON_DISK 4
247#define FS_PERSISTENT_ACLS 8
248#define FS_FILE_COMPRESSION 16
249#define FS_VOL_IS_COMPRESSED 32768
250#define GMEM_FIXED 0
251#define GMEM_MOVEABLE 2
252#define GMEM_MODIFY 128
253#define GPTR 64
254#define GHND 66
255#define GMEM_DDESHARE 8192
256#define GMEM_DISCARDABLE 256
257#define GMEM_LOWER 4096
258#define GMEM_NOCOMPACT 16
259#define GMEM_NODISCARD 32
260#define GMEM_NOT_BANKED 4096
261#define GMEM_NOTIFY 16384
262#define GMEM_SHARE 8192
263#define GMEM_ZEROINIT 64
264#define GMEM_DISCARDED 16384
265#define GMEM_INVALID_HANDLE 32768
266#define GMEM_LOCKCOUNT 255
267#define STATUS_WAIT_0 0
268#define STATUS_ABANDONED_WAIT_0 0x80
269#define STATUS_USER_APC 0xC0
270#define STATUS_TIMEOUT 0x102
271#define STATUS_PENDING 0x103
272#define STATUS_SEGMENT_NOTIFICATION 0x40000005
273#define STATUS_GUARD_PAGE_VIOLATION 0x80000001
274#define STATUS_DATATYPE_MISALIGNMENT 0x80000002
275#define STATUS_BREAKPOINT 0x80000003
276#define STATUS_SINGLE_STEP 0x80000004
277#define STATUS_ACCESS_VIOLATION 0xC0000005
278#define STATUS_IN_PAGE_ERROR 0xC0000006
279#define STATUS_INVALID_HANDLE 0xC0000008L
280#define STATUS_NO_MEMORY 0xC0000017
281#define STATUS_ILLEGAL_INSTRUCTION 0xC000001D
282#define STATUS_NONCONTINUABLE_EXCEPTION 0xC0000025
283#define STATUS_INVALID_DISPOSITION 0xC0000026
284#define STATUS_ARRAY_BOUNDS_EXCEEDED 0xC000008C
285#define STATUS_FLOAT_DENORMAL_OPERAND 0xC000008D
286#define STATUS_FLOAT_DIVIDE_BY_ZERO 0xC000008E
287#define STATUS_FLOAT_INEXACT_RESULT 0xC000008F
288#define STATUS_FLOAT_INVALID_OPERATION 0xC0000090
289#define STATUS_FLOAT_OVERFLOW 0xC0000091
290#define STATUS_FLOAT_STACK_CHECK 0xC0000092
291#define STATUS_FLOAT_UNDERFLOW 0xC0000093
292#define STATUS_INTEGER_DIVIDE_BY_ZERO 0xC0000094
293#define STATUS_INTEGER_OVERFLOW 0xC0000095
294#define STATUS_PRIVILEGED_INSTRUCTION 0xC0000096
295#define STATUS_STACK_OVERFLOW 0xC00000FD
296#define STATUS_CONTROL_C_EXIT 0xC000013A
297#define EXCEPTION_ACCESS_VIOLATION STATUS_ACCESS_VIOLATION
298#define EXCEPTION_DATATYPE_MISALIGNMENT STATUS_DATATYPE_MISALIGNMENT
299#define EXCEPTION_BREAKPOINT STATUS_BREAKPOINT
300#define EXCEPTION_SINGLE_STEP STATUS_SINGLE_STEP
301#define EXCEPTION_ARRAY_BOUNDS_EXCEEDED STATUS_ARRAY_BOUNDS_EXCEEDED
302#define EXCEPTION_FLT_DENORMAL_OPERAND STATUS_FLOAT_DENORMAL_OPERAND
303#define EXCEPTION_FLT_DIVIDE_BY_ZERO STATUS_FLOAT_DIVIDE_BY_ZERO
304#define EXCEPTION_FLT_INEXACT_RESULT STATUS_FLOAT_INEXACT_RESULT
305#define EXCEPTION_FLT_INVALID_OPERATION STATUS_FLOAT_INVALID_OPERATION
306#define EXCEPTION_FLT_OVERFLOW STATUS_FLOAT_OVERFLOW
307#define EXCEPTION_FLT_STACK_CHECK STATUS_FLOAT_STACK_CHECK
308#define EXCEPTION_FLT_UNDERFLOW STATUS_FLOAT_UNDERFLOW
309#define EXCEPTION_INT_DIVIDE_BY_ZERO STATUS_INTEGER_DIVIDE_BY_ZERO
310#define EXCEPTION_INT_OVERFLOW STATUS_INTEGER_OVERFLOW
311#define EXCEPTION_PRIV_INSTRUCTION STATUS_PRIVILEGED_INSTRUCTION
312#define EXCEPTION_IN_PAGE_ERROR STATUS_IN_PAGE_ERROR
313#define EXCEPTION_ILLEGAL_INSTRUCTION STATUS_ILLEGAL_INSTRUCTION
314#define EXCEPTION_NONCONTINUABLE_EXCEPTION STATUS_NONCONTINUABLE_EXCEPTION
315#define EXCEPTION_STACK_OVERFLOW STATUS_STACK_OVERFLOW
316#define EXCEPTION_INVALID_DISPOSITION STATUS_INVALID_DISPOSITION
317#define EXCEPTION_GUARD_PAGE STATUS_GUARD_PAGE_VIOLATION
318#define EXCEPTION_INVALID_HANDLE STATUS_INVALID_HANDLE
319#define CONTROL_C_EXIT STATUS_CONTROL_C_EXIT
320#define PROCESS_HEAP_REGION 1
321#define PROCESS_HEAP_UNCOMMITTED_RANGE 2
322#define PROCESS_HEAP_ENTRY_BUSY 4
323#define PROCESS_HEAP_ENTRY_MOVEABLE 16
324#define PROCESS_HEAP_ENTRY_DDESHARE 32
325#define DONT_RESOLVE_DLL_REFERENCES 1
326#define LOAD_LIBRARY_AS_DATAFILE 2
327#define LOAD_WITH_ALTERED_SEARCH_PATH 8
328#define LMEM_FIXED 0
329#define LMEM_MOVEABLE 2
330#define LMEM_NONZEROLHND 2
331#define LMEM_NONZEROLPTR 0
332#define LMEM_DISCARDABLE 3840
333#define LMEM_NOCOMPACT 16
334#define LMEM_NODISCARD 32
335#define LMEM_ZEROINIT 64
336#define LMEM_DISCARDED 16384
337#define LMEM_MODIFY 128
338#define LMEM_INVALID_HANDLE 32768
339#define LMEM_LOCKCOUNT 255
340#define LPTR 64
341#define LHND 66
342#define NONZEROLHND 2
343#define NONZEROLPTR 0
344#define LOCKFILE_FAIL_IMMEDIATELY 1
345#define LOCKFILE_EXCLUSIVE_LOCK 2
346#define LOGON32_PROVIDER_DEFAULT 0
347#define LOGON32_PROVIDER_WINNT35 1
348#define LOGON32_LOGON_INTERACTIVE 2
349#define LOGON32_LOGON_BATCH 4
350#define LOGON32_LOGON_SERVICE 5
351#define MOVEFILE_REPLACE_EXISTING 1
352#define MOVEFILE_COPY_ALLOWED 2
353#define MOVEFILE_DELAY_UNTIL_REBOOT 4
354#define MOVEFILE_WRITE_THROUGH 8
355#define MAXIMUM_WAIT_OBJECTS 64
356#define MAXIMUM_SUSPEND_COUNT 0x7F
357#define WAIT_OBJECT_0 0
358#define WAIT_ABANDONED_0 128
359#define WAIT_TIMEOUT 0x102
360#define WAIT_IO_COMPLETION 0xC0
361#define WAIT_ABANDONED 128
362#define WAIT_FAILED 0xFFFFFFFF
363#define PURGE_TXABORT 1
364#define PURGE_RXABORT 2
365#define PURGE_TXCLEAR 4
366#define PURGE_RXCLEAR 8
367#define EVENTLOG_FORWARDS_READ 4
368#define EVENTLOG_BACKWARDS_READ 8
369#define EVENTLOG_SEEK_READ 2
370#define EVENTLOG_SEQUENTIAL_READ 1
371#define EVENTLOG_ERROR_TYPE 1
372#define EVENTLOG_WARNING_TYPE 2
373#define EVENTLOG_INFORMATION_TYPE 4
374#define EVENTLOG_AUDIT_SUCCESS 8
375#define EVENTLOG_AUDIT_FAILURE 16
376#define FORMAT_MESSAGE_ALLOCATE_BUFFER 256
377#define FORMAT_MESSAGE_IGNORE_INSERTS 512
378#define FORMAT_MESSAGE_FROM_STRING 1024
379#define FORMAT_MESSAGE_FROM_HMODULE 2048
380#define FORMAT_MESSAGE_FROM_SYSTEM 4096
381#define FORMAT_MESSAGE_ARGUMENT_ARRAY 8192
382#define FORMAT_MESSAGE_MAX_WIDTH_MASK 255
383#define EV_BREAK 64
384#define EV_CTS 8
385#define EV_DSR 16
386#define EV_ERR 128
387#define EV_EVENT1 2048
388#define EV_EVENT2 4096
389#define EV_PERR 512
390#define EV_RING 256
391#define EV_RLSD 32
392#define EV_RX80FULL 1024
393#define EV_RXCHAR 1
394#define EV_RXFLAG 2
395#define EV_TXEMPTY 4
396#define SEM_FAILCRITICALERRORS 1
397#define SEM_NOALIGNMENTFAULTEXCEPT 4
398#define SEM_NOGPFAULTERRORBOX 2
399#define SEM_NOOPENFILEERRORBOX 32768
400#define SLE_ERROR 1
401#define SLE_MINORERROR 2
402#define SLE_WARNING 3
403#define SHUTDOWN_NORETRY 1
404#define EXCEPTION_EXECUTE_HANDLER 1
405#define EXCEPTION_CONTINUE_EXECUTION (-1)
406#define EXCEPTION_CONTINUE_SEARCH 0
407#define MAXINTATOM 0xC000
408#define INVALID_ATOM ((ATOM)0)
409#define IGNORE 0
410#define INFINITE 0xFFFFFFFF
411#define NOPARITY 0
412#define ODDPARITY 1
413#define EVENPARITY 2
414#define MARKPARITY 3
415#define SPACEPARITY 4
416#define ONESTOPBIT 0
417#define ONE5STOPBITS 1
418#define TWOSTOPBITS 2
419#define CBR_110 110
420#define CBR_300 300
421#define CBR_600 600
422#define CBR_1200 1200
423#define CBR_2400 2400
424#define CBR_4800 4800
425#define CBR_9600 9600
426#define CBR_14400 14400
427#define CBR_19200 19200
428#define CBR_38400 38400
429#define CBR_56000 56000
430#define CBR_57600 57600
431#define CBR_115200 115200
432#define CBR_128000 128000
433#define CBR_256000 256000
434#define BACKUP_INVALID 0
435#define BACKUP_DATA 1
436#define BACKUP_EA_DATA 2
437#define BACKUP_SECURITY_DATA 3
438#define BACKUP_ALTERNATE_DATA 4
439#define BACKUP_LINK 5
440#define BACKUP_PROPERTY_DATA 6
441#define BACKUP_OBJECT_ID 7
442#define BACKUP_REPARSE_DATA 8
443#define BACKUP_SPARSE_BLOCK 9
444#define STREAM_NORMAL_ATTRIBUTE 0
445#define STREAM_MODIFIED_WHEN_READ 1
446#define STREAM_CONTAINS_SECURITY 2
447#define STREAM_CONTAINS_PROPERTIES 4
448#define STARTF_USESHOWWINDOW 1
449#define STARTF_USESIZE 2
450#define STARTF_USEPOSITION 4
451#define STARTF_USECOUNTCHARS 8
452#define STARTF_USEFILLATTRIBUTE 16
453#define STARTF_RUNFULLSCREEN 32
454#define STARTF_FORCEONFEEDBACK 64
455#define STARTF_FORCEOFFFEEDBACK 128
456#define STARTF_USESTDHANDLES 256
457#define STARTF_USEHOTKEY 512
458#define TC_NORMAL 0
459#define TC_HARDERR 1
460#define TC_GP_TRAP 2
461#define TC_SIGNAL 3
462#define AC_LINE_OFFLINE 0
463#define AC_LINE_ONLINE 1
464#define AC_LINE_BACKUP_POWER 2
465#define AC_LINE_UNKNOWN 255
466#define BATTERY_FLAG_HIGH 1
467#define BATTERY_FLAG_LOW 2
468#define BATTERY_FLAG_CRITICAL 4
469#define BATTERY_FLAG_CHARGING 8
470#define BATTERY_FLAG_NO_BATTERY 128
471#define BATTERY_FLAG_UNKNOWN 255
472#define BATTERY_PERCENTAGE_UNKNOWN 255
473#define BATTERY_LIFE_UNKNOWN 0xFFFFFFFF
474#define DDD_RAW_TARGET_PATH 1
475#define DDD_REMOVE_DEFINITION 2
476#define DDD_EXACT_MATCH_ON_REMOVE 4
477#define HINSTANCE_ERROR 32
478#define MS_CTS_ON 16
479#define MS_DSR_ON 32
480#define MS_RING_ON 64
481#define MS_RLSD_ON 128
482#define PROFILE_USER 0x10000000
483#define PROFILE_KERNEL 0x20000000
484#define PROFILE_SERVER 0x40000000
485#define DTR_CONTROL_DISABLE 0
486#define DTR_CONTROL_ENABLE 1
487#define DTR_CONTROL_HANDSHAKE 2
488#define RTS_CONTROL_DISABLE 0
489#define RTS_CONTROL_ENABLE 1
490#define RTS_CONTROL_HANDSHAKE 2
491#define RTS_CONTROL_TOGGLE 3
492#define SECURITY_ANONYMOUS (SecurityAnonymous<<16)
493#define SECURITY_IDENTIFICATION (SecurityIdentification<<16)
494#define SECURITY_IMPERSONATION (SecurityImpersonation<<16)
495#define SECURITY_DELEGATION (SecurityDelegation<<16)
496#define SECURITY_CONTEXT_TRACKING 0x40000
497#define SECURITY_EFFECTIVE_ONLY 0x80000
498#define SECURITY_SQOS_PRESENT 0x100000
499#define SECURITY_VALID_SQOS_FLAGS 0x1F0000
500#define INVALID_FILE_SIZE 0xFFFFFFFF
501#define TLS_OUT_OF_INDEXES (DWORD)0xFFFFFFFF
502 593
503#ifndef RC_INVOKED594#define STD_INPUT_HANDLE ((DWORD)-10)
504typedef struct _FILETIME {595#define STD_OUTPUT_HANDLE ((DWORD)-11)
505 DWORD dwLowDateTime;596#define STD_ERROR_HANDLE ((DWORD)-12)
506 DWORD dwHighDateTime;597
507} FILETIME,*PFILETIME,*LPFILETIME;598#define NOPARITY 0
508typedef struct _BY_HANDLE_FILE_INFORMATION {599#define ODDPARITY 1
509 DWORD dwFileAttributes;600#define EVENPARITY 2
510 FILETIME ftCreationTime;601#define MARKPARITY 3
511 FILETIME ftLastAccessTime;602#define SPACEPARITY 4
512 FILETIME ftLastWriteTime;603
513 DWORD dwVolumeSerialNumber;604#define ONESTOPBIT 0
514 DWORD nFileSizeHigh;605#define ONE5STOPBITS 1
515 DWORD nFileSizeLow;606#define TWOSTOPBITS 2
516 DWORD nNumberOfLinks;607
517 DWORD nFileIndexHigh;608#define IGNORE 0
518 DWORD nFileIndexLow;609#define INFINITE 0xffffffff
519} BY_HANDLE_FILE_INFORMATION,*LPBY_HANDLE_FILE_INFORMATION;610
520typedef struct _DCB {611#define CBR_110 110
521 DWORD DCBlength;612#define CBR_300 300
522 DWORD BaudRate;613#define CBR_600 600
523 DWORD fBinary:1;614#define CBR_1200 1200
524 DWORD fParity:1;615#define CBR_2400 2400
525 DWORD fOutxCtsFlow:1;616#define CBR_4800 4800
526 DWORD fOutxDsrFlow:1;617#define CBR_9600 9600
527 DWORD fDtrControl:2;618#define CBR_14400 14400
528 DWORD fDsrSensitivity:1;619#define CBR_19200 19200
529 DWORD fTXContinueOnXoff:1;620#define CBR_38400 38400
530 DWORD fOutX:1;621#define CBR_56000 56000
531 DWORD fInX:1;622#define CBR_57600 57600
532 DWORD fErrorChar:1;623#define CBR_115200 115200
533 DWORD fNull:1;624#define CBR_128000 128000
534 DWORD fRtsControl:2;625#define CBR_256000 256000
535 DWORD fAbortOnError:1;626
536 DWORD fDummy2:17;627#define CE_RXOVER 0x1
537 WORD wReserved;628#define CE_OVERRUN 0x2
538 WORD XonLim;629#define CE_RXPARITY 0x4
539 WORD XoffLim;630#define CE_FRAME 0x8
540 BYTE ByteSize;631#define CE_BREAK 0x10
541 BYTE Parity;632#define CE_TXFULL 0x100
542 BYTE StopBits;633#define CE_PTO 0x200
543 char XonChar;634#define CE_IOE 0x400
544 char XoffChar;635#define CE_DNS 0x800
545 char ErrorChar;636#define CE_OOP 0x1000
546 char EofChar;637#define CE_MODE 0x8000
547 char EvtChar;638
548 WORD wReserved1;639#define IE_BADID (-1)
549} DCB,*LPDCB;640#define IE_OPEN (-2)
550typedef struct _COMM_CONFIG {641#define IE_NOPEN (-3)
551 DWORD dwSize;642#define IE_MEMORY (-4)
552 WORD wVersion;643#define IE_DEFAULT (-5)
553 WORD wReserved;644#define IE_HARDWARE (-10)
554 DCB dcb;645#define IE_BYTESIZE (-11)
555 DWORD dwProviderSubType;646#define IE_BAUDRATE (-12)
556 DWORD dwProviderOffset;647
557 DWORD dwProviderSize;648#define EV_RXCHAR 0x1
558 WCHAR wcProviderData[1];649#define EV_RXFLAG 0x2
559} COMMCONFIG,*LPCOMMCONFIG;650#define EV_TXEMPTY 0x4
560typedef struct _COMMPROP {651#define EV_CTS 0x8
561 WORD wPacketLength;652#define EV_DSR 0x10
562 WORD wPacketVersion;653#define EV_RLSD 0x20
563 DWORD dwServiceMask;654#define EV_BREAK 0x40
564 DWORD dwReserved1;655#define EV_ERR 0x80
565 DWORD dwMaxTxQueue;656#define EV_RING 0x100
566 DWORD dwMaxRxQueue;657#define EV_PERR 0x200
567 DWORD dwMaxBaud;658#define EV_RX80FULL 0x400
568 DWORD dwProvSubType;659#define EV_EVENT1 0x800
569 DWORD dwProvCapabilities;660#define EV_EVENT2 0x1000
570 DWORD dwSettableParams;661
571 DWORD dwSettableBaud;662#define SETXOFF 1
572 WORD wSettableData;663#define SETXON 2
573 WORD wSettableStopParity;664#define SETRTS 3
574 DWORD dwCurrentTxQueue;665#define CLRRTS 4
575 DWORD dwCurrentRxQueue;666#define SETDTR 5
576 DWORD dwProvSpec1;667#define CLRDTR 6
577 DWORD dwProvSpec2;668#define RESETDEV 7
578 WCHAR wcProvChar[1];669#define SETBREAK 8
579} COMMPROP,*LPCOMMPROP;670#define CLRBREAK 9
580typedef struct _COMMTIMEOUTS {671
581 DWORD ReadIntervalTimeout;672#define PURGE_TXABORT 0x1
582 DWORD ReadTotalTimeoutMultiplier;673#define PURGE_RXABORT 0x2
583 DWORD ReadTotalTimeoutConstant;674#define PURGE_TXCLEAR 0x4
584 DWORD WriteTotalTimeoutMultiplier;675#define PURGE_RXCLEAR 0x8
585 DWORD WriteTotalTimeoutConstant;676
586} COMMTIMEOUTS,*LPCOMMTIMEOUTS;677#define LPTx 0x80
587typedef struct _COMSTAT {678
588 DWORD fCtsHold:1;679#define MS_CTS_ON ((DWORD)0x10)
589 DWORD fDsrHold:1;680#define MS_DSR_ON ((DWORD)0x20)
590 DWORD fRlsdHold:1;681#define MS_RING_ON ((DWORD)0x40)
591 DWORD fXoffHold:1;682#define MS_RLSD_ON ((DWORD)0x80)
592 DWORD fXoffSent:1;683
593 DWORD fEof:1;684#define S_QUEUEEMPTY 0
594 DWORD fTxim:1;685#define S_THRESHOLD 1
595 DWORD fReserved:25;686#define S_ALLTHRESHOLD 2
596 DWORD cbInQue;687
597 DWORD cbOutQue;688#define S_NORMAL 0
598} COMSTAT,*LPCOMSTAT;689#define S_LEGATO 1
599typedef DWORD (WINAPI *LPTHREAD_START_ROUTINE)(LPVOID);690#define S_STACCATO 2
600typedef struct _CREATE_PROCESS_DEBUG_INFO {691
601 HANDLE hFile;692#define S_PERIOD512 0
602 HANDLE hProcess;693#define S_PERIOD1024 1
603 HANDLE hThread;694#define S_PERIOD2048 2
604 LPVOID lpBaseOfImage;695#define S_PERIODVOICE 3
605 DWORD dwDebugInfoFileOffset;696#define S_WHITE512 4
606 DWORD nDebugInfoSize;697#define S_WHITE1024 5
607 LPVOID lpThreadLocalBase;698#define S_WHITE2048 6
608 LPTHREAD_START_ROUTINE lpStartAddress;699#define S_WHITEVOICE 7
609 LPVOID lpImageName;700
610 WORD fUnicode;701#define S_SERDVNA (-1)
611} CREATE_PROCESS_DEBUG_INFO,*LPCREATE_PROCESS_DEBUG_INFO;702#define S_SEROFM (-2)
612typedef struct _CREATE_THREAD_DEBUG_INFO {703#define S_SERMACT (-3)
613 HANDLE hThread;704#define S_SERQFUL (-4)
614 LPVOID lpThreadLocalBase;705#define S_SERBDNT (-5)
615 LPTHREAD_START_ROUTINE lpStartAddress;706#define S_SERDLN (-6)
616} CREATE_THREAD_DEBUG_INFO,*LPCREATE_THREAD_DEBUG_INFO;707#define S_SERDCC (-7)
617typedef struct _EXCEPTION_DEBUG_INFO {708#define S_SERDTP (-8)
618 EXCEPTION_RECORD ExceptionRecord;709#define S_SERDVL (-9)
619 DWORD dwFirstChance;710#define S_SERDMD (-10)
620} EXCEPTION_DEBUG_INFO,*LPEXCEPTION_DEBUG_INFO;711#define S_SERDSH (-11)
621typedef struct _EXIT_THREAD_DEBUG_INFO {712#define S_SERDPT (-12)
622 DWORD dwExitCode;713#define S_SERDFQ (-13)
623} EXIT_THREAD_DEBUG_INFO,*LPEXIT_THREAD_DEBUG_INFO;714#define S_SERDDR (-14)
624typedef struct _EXIT_PROCESS_DEBUG_INFO {715#define S_SERDSR (-15)
625 DWORD dwExitCode;716#define S_SERDST (-16)
626} EXIT_PROCESS_DEBUG_INFO,*LPEXIT_PROCESS_DEBUG_INFO;717
627typedef struct _LOAD_DLL_DEBUG_INFO {718#define NMPWAIT_WAIT_FOREVER 0xffffffff
628 HANDLE hFile;719#define NMPWAIT_NOWAIT 0x1
629 LPVOID lpBaseOfDll;720#define NMPWAIT_USE_DEFAULT_WAIT 0x0
630 DWORD dwDebugInfoFileOffset;721
631 DWORD nDebugInfoSize;722#define FS_CASE_IS_PRESERVED FILE_CASE_PRESERVED_NAMES
632 LPVOID lpImageName;723#define FS_CASE_SENSITIVE FILE_CASE_SENSITIVE_SEARCH
633 WORD fUnicode;724#define FS_UNICODE_STORED_ON_DISK FILE_UNICODE_ON_DISK
634} LOAD_DLL_DEBUG_INFO,*LPLOAD_DLL_DEBUG_INFO;725#define FS_PERSISTENT_ACLS FILE_PERSISTENT_ACLS
635typedef struct _UNLOAD_DLL_DEBUG_INFO {726#define FS_VOL_IS_COMPRESSED FILE_VOLUME_IS_COMPRESSED
636 LPVOID lpBaseOfDll;727#define FS_FILE_COMPRESSION FILE_FILE_COMPRESSION
637} UNLOAD_DLL_DEBUG_INFO,*LPUNLOAD_DLL_DEBUG_INFO;728#define FS_FILE_ENCRYPTION FILE_SUPPORTS_ENCRYPTION
638typedef struct _OUTPUT_DEBUG_STRING_INFO {729
639 LPSTR lpDebugStringData;730#define FILE_MAP_COPY SECTION_QUERY
640 WORD fUnicode;731#define FILE_MAP_WRITE SECTION_MAP_WRITE
641 WORD nDebugStringLength;732#define FILE_MAP_READ SECTION_MAP_READ
642} OUTPUT_DEBUG_STRING_INFO,*LPOUTPUT_DEBUG_STRING_INFO;733#define FILE_MAP_ALL_ACCESS SECTION_ALL_ACCESS
643typedef struct _RIP_INFO {734#define FILE_MAP_EXECUTE SECTION_MAP_EXECUTE_EXPLICIT
644 DWORD dwError;735
645 DWORD dwType;736#define OF_READ 0x0
646} RIP_INFO,*LPRIP_INFO;737#define OF_WRITE 0x1
647typedef struct _DEBUG_EVENT {738#define OF_READWRITE 0x2
648 DWORD dwDebugEventCode;739#define OF_SHARE_COMPAT 0x0
649 DWORD dwProcessId;740#define OF_SHARE_EXCLUSIVE 0x10
650 DWORD dwThreadId;741#define OF_SHARE_DENY_WRITE 0x20
651 union {742#define OF_SHARE_DENY_READ 0x30
652 EXCEPTION_DEBUG_INFO Exception;743#define OF_SHARE_DENY_NONE 0x40
653 CREATE_THREAD_DEBUG_INFO CreateThread;744#define OF_PARSE 0x100
654 CREATE_PROCESS_DEBUG_INFO CreateProcessInfo;745#define OF_DELETE 0x200
655 EXIT_THREAD_DEBUG_INFO ExitThread;746#define OF_VERIFY 0x400
656 EXIT_PROCESS_DEBUG_INFO ExitProcess;747#define OF_CANCEL 0x800
657 LOAD_DLL_DEBUG_INFO LoadDll;748#define OF_CREATE 0x1000
658 UNLOAD_DLL_DEBUG_INFO UnloadDll;749#define OF_PROMPT 0x2000
659 OUTPUT_DEBUG_STRING_INFO DebugString;750#define OF_EXIST 0x4000
660 RIP_INFO RipInfo;751#define OF_REOPEN 0x8000
661 } u;752
662} DEBUG_EVENT,*LPDEBUG_EVENT;753#define OFS_MAXPATHNAME 128
663typedef struct _OVERLAPPED {754 typedef struct _OFSTRUCT {
664 DWORD Internal;755 BYTE cBytes;
665 DWORD InternalHigh;756 BYTE fFixedDisk;
666 DWORD Offset;757 WORD nErrCode;
667 DWORD OffsetHigh;758 WORD Reserved1;
668 HANDLE hEvent;759 WORD Reserved2;
669} OVERLAPPED,*POVERLAPPED,*LPOVERLAPPED;760 CHAR szPathName[OFS_MAXPATHNAME];
670typedef struct _STARTUPINFOA {761 } OFSTRUCT,*LPOFSTRUCT,*POFSTRUCT;
671 DWORD cb;762
672 LPSTR lpReserved;763#ifndef NOWINBASEINTERLOCK
673 LPSTR lpDesktop;764
674 LPSTR lpTitle;765#ifndef _NTOS_
675 DWORD dwX;766
676 DWORD dwY;767#if defined(__ia64__) && !defined(RC_INVOKED)
677 DWORD dwXSize;768
678 DWORD dwYSize;769#define InterlockedIncrement _InterlockedIncrement
679 DWORD dwXCountChars;770#define InterlockedIncrementAcquire _InterlockedIncrement_acq
680 DWORD dwYCountChars;771#define InterlockedIncrementRelease _InterlockedIncrement_rel
681 DWORD dwFillAttribute;772#define InterlockedDecrement _InterlockedDecrement
682 DWORD dwFlags;773#define InterlockedDecrementAcquire _InterlockedDecrement_acq
683 WORD wShowWindow;774#define InterlockedDecrementRelease _InterlockedDecrement_rel
684 WORD cbReserved2;775#define InterlockedExchange _InterlockedExchange
685 PBYTE lpReserved2;776#define InterlockedExchangeAdd _InterlockedExchangeAdd
686 HANDLE hStdInput;777#define InterlockedCompareExchange _InterlockedCompareExchange
687 HANDLE hStdOutput;778#define InterlockedCompareExchangeAcquire _InterlockedCompareExchange_acq
688 HANDLE hStdError;779#define InterlockedCompareExchangeRelease _InterlockedCompareExchange_rel
689} STARTUPINFOA,*LPSTARTUPINFOA;780#define InterlockedExchangePointer _InterlockedExchangePointer
690typedef struct _STARTUPINFOW {781#define InterlockedCompareExchangePointer _InterlockedCompareExchangePointer
691 DWORD cb;782#define InterlockedCompareExchangePointerRelease _InterlockedCompareExchangePointer_rel
692 LPWSTR lpReserved;783#define InterlockedCompareExchangePointerAcquire _InterlockedCompareExchangePointer_acq
693 LPWSTR lpDesktop;784
694 LPWSTR lpTitle;785#define InterlockedIncrement64 _InterlockedIncrement64
695 DWORD dwX;786#define InterlockedDecrement64 _InterlockedDecrement64
696 DWORD dwY;787#define InterlockedExchange64 _InterlockedExchange64
697 DWORD dwXSize;788#define InterlockedExchangeAcquire64 _InterlockedExchange64_acq
698 DWORD dwYSize;789#define InterlockedExchangeAdd64 _InterlockedExchangeAdd64
699 DWORD dwXCountChars;790#define InterlockedCompareExchange64 _InterlockedCompareExchange64
700 DWORD dwYCountChars;791#define InterlockedCompareExchangeAcquire64 _InterlockedCompareExchange64_acq
701 DWORD dwFillAttribute;792#define InterlockedCompareExchangeRelease64 _InterlockedCompareExchange64_rel
702 DWORD dwFlags;793
703 WORD wShowWindow;794 LONGLONG __cdecl InterlockedIncrement64(LONGLONG volatile *Addend);
704 WORD cbReserved2;795 LONGLONG __cdecl InterlockedDecrement64(LONGLONG volatile *Addend);
705 PBYTE lpReserved2;796 LONG __cdecl InterlockedIncrementAcquire(LONG volatile *Addend);
706 HANDLE hStdInput;797 LONG __cdecl InterlockedDecrementAcquire(LONG volatile *Addend);
707 HANDLE hStdOutput;798 LONG __cdecl InterlockedIncrementRelease(LONG volatile *Addend);
708 HANDLE hStdError;799 LONG __cdecl InterlockedDecrementRelease(LONG volatile *Addend);
709} STARTUPINFOW,*LPSTARTUPINFOW;800 LONGLONG __cdecl InterlockedExchange64 (LONGLONG volatile *Target,LONGLONG Value);
710typedef struct _PROCESS_INFORMATION {801 LONGLONG __cdecl InterlockedExchangeAcquire64 (LONGLONG volatile *Target,LONGLONG Value);
711 HANDLE hProcess;802 LONGLONG __cdecl InterlockedExchangeAdd64 (LONGLONG volatile *Addend,LONGLONG Value);
712 HANDLE hThread;803 LONGLONG __cdecl InterlockedCompareExchange64 (LONGLONG volatile *Destination,LONGLONG ExChange,LONGLONG Comperand);
713 DWORD dwProcessId;804 LONGLONG __cdecl InterlockedCompareExchangeAcquire64 (LONGLONG volatile *Destination,LONGLONG ExChange,LONGLONG Comperand);
714 DWORD dwThreadId;805 LONGLONG __cdecl InterlockedCompareExchangeRelease64 (LONGLONG volatile *Destination,LONGLONG ExChange,LONGLONG Comperand);
715} PROCESS_INFORMATION,*LPPROCESS_INFORMATION;806 LONG __cdecl InterlockedIncrement(LONG volatile *lpAddend);
716typedef struct _CRITICAL_SECTION_DEBUG {807 LONG __cdecl InterlockedDecrement(LONG volatile *lpAddend);
717 WORD Type;808 LONG __cdecl InterlockedExchange(LONG volatile *Target,LONG Value);
718 WORD CreatorBackTraceIndex;809 LONG __cdecl InterlockedExchangeAdd(LONG volatile *Addend,LONG Value);
719 struct _CRITICAL_SECTION *CriticalSection;810 LONG __cdecl InterlockedCompareExchange(LONG volatile *Destination,LONG ExChange,LONG Comperand);
720 LIST_ENTRY ProcessLocksList;811 LONG __cdecl InterlockedCompareExchangeRelease(LONG volatile *Destination,LONG ExChange,LONG Comperand);
721 DWORD EntryCount;812 LONG __cdecl InterlockedCompareExchangeAcquire(LONG volatile *Destination,LONG ExChange,LONG Comperand);
722 DWORD ContentionCount;813 PVOID __cdecl InterlockedExchangePointer(PVOID volatile *Target,PVOID Value);
723 DWORD Spare [2];814 PVOID __cdecl InterlockedCompareExchangePointer(PVOID volatile *Destination,PVOID ExChange,PVOID Comperand);
724} CRITICAL_SECTION_DEBUG,*PCRITICAL_SECTION_DEBUG;815 PVOID __cdecl InterlockedCompareExchangePointerAcquire(PVOID volatile *Destination,PVOID Exchange,PVOID Comperand);
725typedef struct _CRITICAL_SECTION {816 PVOID __cdecl InterlockedCompareExchangePointerRelease(PVOID volatile *Destination,PVOID Exchange,PVOID Comperand);
726 PCRITICAL_SECTION_DEBUG DebugInfo;817
727 LONG LockCount;818#ifndef InterlockedAnd
728 LONG RecursionCount;819#define InterlockedAnd InterlockedAnd_Inline
729 HANDLE OwningThread;820 __CRT_INLINE LONG InterlockedAnd_Inline(LONG volatile *Target,LONG Set) {
730 HANDLE LockSemaphore;821 LONG i;
731 DWORD SpinCount;822 LONG j;
732} CRITICAL_SECTION,*PCRITICAL_SECTION,*LPCRITICAL_SECTION;823 j = *Target;
733typedef struct _SYSTEMTIME {824 do {
734 WORD wYear;825 i = j;
735 WORD wMonth;826 j = InterlockedCompareExchange(Target,i & Set,i);
736 WORD wDayOfWeek;827 } while(i!=j);
737 WORD wDay;828 return j;
738 WORD wHour;829 }
739 WORD wMinute;830#endif
740 WORD wSecond;831
741 WORD wMilliseconds;832#ifndef InterlockedOr
742} SYSTEMTIME,*LPSYSTEMTIME;833#define InterlockedOr InterlockedOr_Inline
743typedef struct _WIN32_FILE_ATTRIBUTE_DATA {834
744 DWORD dwFileAttributes;835 __CRT_INLINE LONG InterlockedOr_Inline(LONG volatile *Target,LONG Set) {
745 FILETIME ftCreationTime;836 LONG i;
746 FILETIME ftLastAccessTime;837 LONG j;
747 FILETIME ftLastWriteTime;838 j = *Target;
748 DWORD nFileSizeHigh;839 do {
749 DWORD nFileSizeLow;840 i = j;
750} WIN32_FILE_ATTRIBUTE_DATA,*LPWIN32_FILE_ATTRIBUTE_DATA;841 j = InterlockedCompareExchange(Target,i | Set,i);
751typedef struct _WIN32_FIND_DATAA {842 } while(i!=j);
752 DWORD dwFileAttributes;843 return j;
753 FILETIME ftCreationTime;844 }
754 FILETIME ftLastAccessTime;845#endif
755 FILETIME ftLastWriteTime;846
756 DWORD nFileSizeHigh;847#ifndef InterlockedXor
757 DWORD nFileSizeLow;848#define InterlockedXor InterlockedXor_Inline
758 DWORD dwReserved0;849
759 DWORD dwReserved1;850 __CRT_INLINE LONG InterlockedXor_Inline(LONG volatile *Target,LONG Set) {
760 CHAR cFileName[MAX_PATH];851 LONG i;
761 CHAR cAlternateFileName[14];852 LONG j;
762} WIN32_FIND_DATAA,*LPWIN32_FIND_DATAA;853 j = *Target;
763typedef struct _WIN32_FIND_DATAW {854 do {
764 DWORD dwFileAttributes;855 i = j;
765 FILETIME ftCreationTime;856 j = InterlockedCompareExchange(Target,i ^ Set,i);
766 FILETIME ftLastAccessTime;857 } while(i!=j);
767 FILETIME ftLastWriteTime;858 return j;
768 DWORD nFileSizeHigh;859 }
769 DWORD nFileSizeLow;860#endif
770 DWORD dwReserved0;861
771 DWORD dwReserved1;862#ifndef !defined (InterlockedAnd64)
772 WCHAR cFileName[MAX_PATH];863#define InterlockedAnd64 InterlockedAnd64_Inline
773 WCHAR cAlternateFileName[14];864
774} WIN32_FIND_DATAW,*LPWIN32_FIND_DATAW;865 __CRT_INLINE LONGLONG InterlockedAnd64_Inline (LONGLONG volatile *Destination,LONGLONG Value) {
775typedef struct _WIN32_STREAM_ID {866 LONGLONG Old;
776 DWORD dwStreamId;867 do {
777 DWORD dwStreamAttributes;868 Old = *Destination;
778 LARGE_INTEGER Size;869 } while(InterlockedCompareExchange64(Destination,Old & Value,Old)!=Old);
779 DWORD dwStreamNameSize;870 return Old;
780 WCHAR cStreamName[ANYSIZE_ARRAY];871 }
781} WIN32_STREAM_ID;872#endif
782typedef enum _FINDEX_INFO_LEVELS {873
783 FindExInfoStandard,874#ifndef InterlockedOr64
784 FindExInfoMaxInfoLevel875#define InterlockedOr64 InterlockedOr64_Inline
785} FINDEX_INFO_LEVELS;876
786typedef enum _FINDEX_SEARCH_OPS {877 __CRT_INLINE LONGLONG InterlockedOr64_Inline (LONGLONG volatile *Destination,LONGLONG Value) {
787 FindExSearchNameMatch,878 LONGLONG Old;
788 FindExSearchLimitToDirectories,879 do {
789 FindExSearchLimitToDevices,880 Old = *Destination;
790 FindExSearchMaxSearchOp881 } while(InterlockedCompareExchange64(Destination,Old | Value,Old)!=Old);
791} FINDEX_SEARCH_OPS;882 return Old;
792typedef enum _ACL_INFORMATION_CLASS {883 }
793 AclRevisionInformation=1,884#endif
794 AclSizeInformation885
795} ACL_INFORMATION_CLASS;886#ifndef InterlockedXor64
796typedef struct tagHW_PROFILE_INFOA {887#define InterlockedXor64 InterlockedXor64_Inline
797 DWORD dwDockInfo;888
798 CHAR szHwProfileGuid[HW_PROFILE_GUIDLEN];889 __CRT_INLINE LONGLONG InterlockedXor64_Inline (LONGLONG volatile *Destination,LONGLONG Value) {
799 CHAR szHwProfileName[MAX_PROFILE_LEN];890 LONGLONG Old;
800} HW_PROFILE_INFOA,*LPHW_PROFILE_INFOA;891 do {
801typedef struct tagHW_PROFILE_INFOW {892 Old = *Destination;
802 DWORD dwDockInfo;893 } while(InterlockedCompareExchange64(Destination,Old ^ Value,Old)!=Old);
803 WCHAR szHwProfileGuid[HW_PROFILE_GUIDLEN];894 return Old;
804 WCHAR szHwProfileName[MAX_PROFILE_LEN];895 }
805} HW_PROFILE_INFOW,*LPHW_PROFILE_INFOW;896#endif
806typedef enum _GET_FILEEX_INFO_LEVELS {897
807 GetFileExInfoStandard,898#ifndef InterlockedBitTestAndSet
808 GetFileExMaxInfoLevel899#define InterlockedBitTestAndSet InterlockedBitTestAndSet_Inline
809} GET_FILEEX_INFO_LEVELS;900
810typedef struct _SYSTEM_INFO {901 __CRT_INLINE BOOLEAN InterlockedBitTestAndSet_Inline(LONG *Base,LONG Bit) {
811 _ANONYMOUS_UNION union {902 LONG tBit;
812 DWORD dwOemId;903 tBit = 1<<(Bit & (sizeof (*Base)*8-1));
813 _ANONYMOUS_STRUCT struct {904 return (BOOLEAN)((InterlockedOr(&Base[Bit/(sizeof(*Base)*8)],tBit)&tBit)!=0);
814 WORD wProcessorArchitecture;905 }
815 WORD wReserved;906#endif
816 } DUMMYSTRUCTNAME;907
817 } DUMMYUNIONNAME;908#ifndef InterlockedBitTestAndReset
818 DWORD dwPageSize;909#define InterlockedBitTestAndReset InterlockedBitTestAndReset_Inline
819 PVOID lpMinimumApplicationAddress;910
820 PVOID lpMaximumApplicationAddress;911 __CRT_INLINE BOOLEAN InterlockedBitTestAndReset_Inline(LONG *Base,LONG Bit) {
821 DWORD dwActiveProcessorMask;912 LONG tBit;
822 DWORD dwNumberOfProcessors;913 tBit = 1<<(Bit & (sizeof (*Base)*8-1));
823 DWORD dwProcessorType;914 return (BOOLEAN)((InterlockedAnd(&Base[Bit/(sizeof(*Base)*8)],~tBit)&tBit)!=0);
824 DWORD dwAllocationGranularity;915 }
825 WORD wProcessorLevel;916#endif
826 WORD wProcessorRevision;917
827} SYSTEM_INFO,*LPSYSTEM_INFO;918#ifndef InterlockedBitTestAndComplement
828typedef struct _SYSTEM_POWER_STATUS {919#define InterlockedBitTestAndComplement InterlockedBitTestAndComplement_Inline
829 BYTE ACLineStatus;920
830 BYTE BatteryFlag;921 __CRT_INLINE BOOLEAN InterlockedBitTestAndComplement_Inline(LONG *Base,LONG Bit) {
831 BYTE BatteryLifePercent;922 LONG tBit;
832 BYTE Reserved1;923 tBit = 1<<(Bit & (sizeof (*Base)*8-1));
833 DWORD BatteryLifeTime;924 return (BOOLEAN)((InterlockedXor(&Base[Bit/(sizeof(*Base)*8)],tBit)&tBit)!=0);
834 DWORD BatteryFullLifeTime;925 }
835} SYSTEM_POWER_STATUS,*LPSYSTEM_POWER_STATUS;926#endif
836typedef struct _TIME_ZONE_INFORMATION {927#elif defined(__x86_64) && !defined(RC_INVOKED)
837 LONG Bias;928
838 WCHAR StandardName[32];929#define InterlockedIncrement _InterlockedIncrement
839 SYSTEMTIME StandardDate;930#define InterlockedIncrementAcquire InterlockedIncrement
840 LONG StandardBias;931#define InterlockedIncrementRelease InterlockedIncrement
841 WCHAR DaylightName[32];932#define InterlockedDecrement _InterlockedDecrement
842 SYSTEMTIME DaylightDate;933#define InterlockedDecrementAcquire InterlockedDecrement
843 LONG DaylightBias;934#define InterlockedDecrementRelease InterlockedDecrement
844} TIME_ZONE_INFORMATION,*LPTIME_ZONE_INFORMATION;935#define InterlockedExchange _InterlockedExchange
845typedef struct _MEMORYSTATUS {936#define InterlockedExchangeAdd _InterlockedExchangeAdd
846 DWORD dwLength;937#define InterlockedCompareExchange _InterlockedCompareExchange
847 DWORD dwMemoryLoad;938#define InterlockedCompareExchangeAcquire InterlockedCompareExchange
848 DWORD dwTotalPhys;939#define InterlockedCompareExchangeRelease InterlockedCompareExchange
849 DWORD dwAvailPhys;940#define InterlockedExchangePointer _InterlockedExchangePointer
850 DWORD dwTotalPageFile;941#define InterlockedCompareExchangePointer _InterlockedCompareExchangePointer
851 DWORD dwAvailPageFile;942#define InterlockedCompareExchangePointerAcquire _InterlockedCompareExchangePointer
852 DWORD dwTotalVirtual;943#define InterlockedCompareExchangePointerRelease _InterlockedCompareExchangePointer
853 DWORD dwAvailVirtual;944#define InterlockedAnd64 _InterlockedAnd64
854} MEMORYSTATUS,*LPMEMORYSTATUS;945#define InterlockedOr64 _InterlockedOr64
855typedef struct _LDT_ENTRY {946#define InterlockedXor64 _InterlockedXor64
856 WORD LimitLow;947#define InterlockedIncrement64 _InterlockedIncrement64
857 WORD BaseLow;948#define InterlockedDecrement64 _InterlockedDecrement64
858 union {949#define InterlockedExchange64 _InterlockedExchange64
859 struct {950#define InterlockedExchangeAdd64 _InterlockedExchangeAdd64
860 BYTE BaseMid;951#define InterlockedCompareExchange64 _InterlockedCompareExchange64
861 BYTE Flags1;952#define InterlockedCompareExchangeAcquire64 InterlockedCompareExchange64
862 BYTE Flags2;953#define InterlockedCompareExchangeRelease64 InterlockedCompareExchange64
863 BYTE BaseHi;954
864 } Bytes;955 LONG InterlockedIncrement(LONG volatile *Addend);
865 struct {956 LONG InterlockedDecrement(LONG volatile *Addend);
866 DWORD BaseMid:8;957 LONG InterlockedExchange(LONG volatile *Target,LONG Value);
867 DWORD Type:5;958 LONG InterlockedExchangeAdd(LONG volatile *Addend,LONG Value);
868 DWORD Dpl:2;959 LONG InterlockedCompareExchange(LONG volatile *Destination,LONG ExChange,LONG Comperand);
869 DWORD Pres:1;960 PVOID InterlockedCompareExchangePointer(PVOID volatile *Destination,PVOID Exchange,PVOID Comperand);
870 DWORD LimitHi:4;961 PVOID InterlockedExchangePointer(PVOID volatile *Target,PVOID Value);
871 DWORD Sys:1;962 LONG64 InterlockedAnd64(LONG64 volatile *Destination,LONG64 Value);
872 DWORD Reserved_0:1;963 LONG64 InterlockedOr64(LONG64 volatile *Destination,LONG64 Value);
873 DWORD Default_Big:1;964 LONG64 InterlockedXor64(LONG64 volatile *Destination,LONG64 Value);
874 DWORD Granularity:1;965 LONG64 InterlockedIncrement64(LONG64 volatile *Addend);
875 DWORD BaseHi:8;966 LONG64 InterlockedDecrement64(LONG64 volatile *Addend);
876 } Bits;967 LONG64 InterlockedExchange64(LONG64 volatile *Target,LONG64 Value);
877 } HighWord;968 LONG64 InterlockedExchangeAdd64(LONG64 volatile *Addend,LONG64 Value);
878} LDT_ENTRY,*PLDT_ENTRY,*LPLDT_ENTRY;969 LONG64 InterlockedCompareExchange64(LONG64 volatile *Destination,LONG64 ExChange,LONG64 Comperand);
879typedef struct _PROCESS_HEAP_ENTRY {970#else
880 PVOID lpData;971 LONG InterlockedIncrement(LONG volatile *lpAddend);
881 DWORD cbData;972 LONG InterlockedDecrement(LONG volatile *lpAddend);
882 BYTE cbOverhead;973 LONG InterlockedExchange(LONG volatile *Target,LONG Value);
883 BYTE iRegionIndex;974
884 WORD wFlags;975#define InterlockedExchangePointer(Target,Value) (PVOID)InterlockedExchange((PLONG)(Target),(LONG)(Value))
885 _ANONYMOUS_UNION union {976
886 struct {977 LONG InterlockedExchangeAdd(LONG volatile *Addend,LONG Value);
887 HANDLE hMem;978 LONG InterlockedCompareExchange(LONG volatile *Destination,LONG Exchange,LONG Comperand);
888 DWORD dwReserved[3];979 LONGLONG InterlockedCompareExchange64(LONGLONG volatile *Destination,LONGLONG Exchange,LONGLONG Comperand);
889 } Block;980
890 struct {981 __CRT_INLINE LONGLONG InterlockedAnd64 (LONGLONG volatile *Destination,LONGLONG Value) {
891 DWORD dwCommittedSize;982 LONGLONG Old;
892 DWORD dwUnCommittedSize;983 do {
893 LPVOID lpFirstBlock;984 Old = *Destination;
894 LPVOID lpLastBlock;985 } while(InterlockedCompareExchange64(Destination,Old & Value,Old)!=Old);
895 } Region;986 return Old;
896 } DUMMYUNIONNAME;987 }
897} PROCESS_HEAP_ENTRY,*LPPROCESS_HEAP_ENTRY;988
898typedef struct _OFSTRUCT {989 __CRT_INLINE LONGLONG InterlockedOr64 (LONGLONG volatile *Destination,LONGLONG Value) {
899 BYTE cBytes;990 LONGLONG Old;
900 BYTE fFixedDisk;991 do {
901 WORD nErrCode;992 Old = *Destination;
902 WORD Reserved1;993 } while(InterlockedCompareExchange64(Destination,Old | Value,Old)!=Old);
903 WORD Reserved2;994 return Old;
904 CHAR szPathName[OFS_MAXPATHNAME];995 }
905} OFSTRUCT,*LPOFSTRUCT,*POFSTRUCT;996
906typedef struct _WIN_CERTIFICATE {997 __CRT_INLINE LONGLONG InterlockedXor64 (LONGLONG volatile *Destination,LONGLONG Value) {
907 DWORD dwLength;998 LONGLONG Old;
908 WORD wRevision;999 do {
909 WORD wCertificateType;1000 Old = *Destination;
910 BYTE bCertificate[1];1001 } while(InterlockedCompareExchange64(Destination,Old ^ Value,Old)!=Old);
911} WIN_CERTIFICATE, *LPWIN_CERTIFICATE;1002
912 1003 return Old;
913typedef DWORD(WINAPI *LPPROGRESS_ROUTINE)(LARGE_INTEGER,LARGE_INTEGER,LARGE_INTEGER,LARGE_INTEGER,DWORD,DWORD,HANDLE,HANDLE,LPVOID);1004 }
914typedef void(WINAPI *LPFIBER_START_ROUTINE)(PVOID);1005
915typedef BOOL(CALLBACK *ENUMRESLANGPROC)(HMODULE,LPCTSTR,LPCTSTR,WORD,LONG);1006 __CRT_INLINE LONGLONG InterlockedIncrement64(LONGLONG volatile *Addend) {
916typedef BOOL(CALLBACK *ENUMRESNAMEPROC)(HMODULE,LPCTSTR,LPTSTR,LONG);1007 LONGLONG Old;
917typedef BOOL(CALLBACK *ENUMRESTYPEPROC)(HMODULE,LPTSTR,LONG);1008 do {
918typedef void(CALLBACK *LPOVERLAPPED_COMPLETION_ROUTINE)(DWORD,DWORD,LPOVERLAPPED);1009 Old = *Addend;
919typedef LONG(CALLBACK *PTOP_LEVEL_EXCEPTION_FILTER)(LPEXCEPTION_POINTERS);1010 } while(InterlockedCompareExchange64(Addend,Old + 1,Old)!=Old);
920typedef PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER;1011 return Old + 1;
921typedef void(APIENTRY *PAPCFUNC)(DWORD);1012 }
922typedef void(CALLBACK *PTIMERAPCROUTINE)(PVOID,DWORD,DWORD);1013
923#define MAKEINTATOM(i) (LPTSTR)((DWORD)((WORD)(i)))1014 __CRT_INLINE LONGLONG InterlockedDecrement64(LONGLONG volatile *Addend) {
924/* Functions */1015 LONGLONG Old;
925#ifndef UNDER_CE1016 do {
926int APIENTRY WinMain(HINSTANCE,HINSTANCE,LPSTR,int);1017 Old = *Addend;
1018 } while(InterlockedCompareExchange64(Addend,Old - 1,Old)!=Old);
1019 return Old - 1;
1020 }
1021
1022 __CRT_INLINE LONGLONG InterlockedExchange64(LONGLONG volatile *Target,LONGLONG Value) {
1023 LONGLONG Old;
1024 do {
1025 Old = *Target;
1026 } while(InterlockedCompareExchange64(Target,Value,Old)!=Old);
1027 return Old;
1028 }
1029
1030 __CRT_INLINE LONGLONG InterlockedExchangeAdd64(LONGLONG volatile *Addend,LONGLONG Value) {
1031 LONGLONG Old;
1032 do {
1033 Old = *Addend;
1034 } while(InterlockedCompareExchange64(Addend,Old + Value,Old)!=Old);
1035 return Old;
1036 }
1037
1038#ifdef __cplusplus
1039 __CRT_INLINE PVOID __cdecl __InlineInterlockedCompareExchangePointer(PVOID volatile *Destination,PVOID ExChange,PVOID Comperand) {
1040 return((PVOID)(LONG_PTR)InterlockedCompareExchange((LONG volatile *)Destination,(LONG)(LONG_PTR)ExChange,(LONG)(LONG_PTR)Comperand));
1041 }
1042#define InterlockedCompareExchangePointer __InlineInterlockedCompareExchangePointer
927#else1043#else
928int APIENTRY WinMain(HINSTANCE,HINSTANCE,LPWSTR,int);1044#define InterlockedCompareExchangePointer(Destination,ExChange,Comperand)(PVOID)(LONG_PTR)InterlockedCompareExchange((LONG volatile *)(Destination),(LONG)(LONG_PTR)(ExChange),(LONG)(LONG_PTR)(Comperand))
929#endif1045#endif
930int APIENTRY wWinMain(HINSTANCE,HINSTANCE,LPWSTR,int);1046
931long WINAPI _hread(HFILE,LPVOID,long);1047#define InterlockedIncrementAcquire InterlockedIncrement
932long WINAPI _hwrite(HFILE,LPCSTR,long);1048#define InterlockedIncrementRelease InterlockedIncrement
933HFILE WINAPI _lclose(HFILE);1049#define InterlockedDecrementAcquire InterlockedDecrement
934HFILE WINAPI _lcreat(LPCSTR,int);1050#define InterlockedDecrementRelease InterlockedDecrement
935LONG WINAPI _llseek(HFILE,LONG,int);1051#define InterlockedIncrementAcquire InterlockedIncrement
936HFILE WINAPI _lopen(LPCSTR,int);1052#define InterlockedIncrementRelease InterlockedIncrement
937UINT WINAPI _lread(HFILE,LPVOID,UINT);1053#define InterlockedCompareExchangeAcquire InterlockedCompareExchange
938UINT WINAPI _lwrite(HFILE,LPCSTR,UINT);1054#define InterlockedCompareExchangeRelease InterlockedCompareExchange
939#define AbnormalTermination() FALSE1055#define InterlockedCompareExchangeAcquire64 InterlockedCompareExchange64
940BOOL WINAPI AccessCheck(PSECURITY_DESCRIPTOR,HANDLE,DWORD,PGENERIC_MAPPING,PPRIVILEGE_SET,PDWORD,PDWORD,PBOOL);1056#define InterlockedCompareExchangeRelease64 InterlockedCompareExchange64
941BOOL WINAPI AccessCheckAndAuditAlarmA(LPCSTR,LPVOID,LPSTR,LPSTR,PSECURITY_DESCRIPTOR,DWORD,PGENERIC_MAPPING,BOOL,PDWORD,PBOOL,PBOOL);1057#define InterlockedCompareExchangePointerAcquire InterlockedCompareExchangePointer
942BOOL WINAPI AccessCheckAndAuditAlarmW(LPCWSTR,LPVOID,LPWSTR,LPWSTR,PSECURITY_DESCRIPTOR,DWORD,PGENERIC_MAPPING,BOOL,PDWORD,PBOOL,PBOOL);1058#define InterlockedCompareExchangePointerRelease InterlockedCompareExchangePointer
943BOOL WINAPI AddAccessAllowedAce(PACL,DWORD,DWORD,PSID);
944BOOL WINAPI AddAccessDeniedAce(PACL,DWORD,DWORD,PSID);
945BOOL WINAPI AddAce(PACL,DWORD,DWORD,PVOID,DWORD);
946ATOM WINAPI AddAtomA(LPCSTR);
947ATOM WINAPI AddAtomW(LPCWSTR);
948BOOL WINAPI AddAuditAccessAce(PACL,DWORD,DWORD,PSID,BOOL,BOOL);
949BOOL WINAPI AdjustTokenGroups(HANDLE,BOOL,PTOKEN_GROUPS,DWORD,PTOKEN_GROUPS,PDWORD);
950BOOL WINAPI AdjustTokenPrivileges(HANDLE,BOOL,PTOKEN_PRIVILEGES,DWORD,PTOKEN_PRIVILEGES,PDWORD);
951BOOL WINAPI AllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY,BYTE,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,PSID*);
952BOOL WINAPI AllocateLocallyUniqueId(PLUID);
953BOOL WINAPI AreAllAccessesGranted(DWORD,DWORD);
954BOOL WINAPI AreAnyAccessesGranted(DWORD,DWORD);
955BOOL WINAPI AreFileApisANSI(void);
956BOOL WINAPI BackupEventLogA(HANDLE,LPCSTR);
957BOOL WINAPI BackupEventLogW(HANDLE,LPCWSTR);
958BOOL WINAPI BackupRead(HANDLE,PBYTE,DWORD,PDWORD,BOOL,BOOL,PVOID);
959BOOL WINAPI BackupSeek(HANDLE,DWORD,DWORD,PDWORD,PDWORD,PVOID);
960BOOL WINAPI BackupWrite(HANDLE,PBYTE,DWORD,PDWORD,BOOL,BOOL,PVOID);
961BOOL WINAPI Beep(DWORD,DWORD);
962HANDLE WINAPI BeginUpdateResourceA(LPCSTR,BOOL);
963HANDLE WINAPI BeginUpdateResourceW(LPCWSTR,BOOL);
964BOOL WINAPI BuildCommDCBA(LPCSTR,LPDCB);
965BOOL WINAPI BuildCommDCBW(LPCWSTR,LPDCB);
966BOOL WINAPI BuildCommDCBAndTimeoutsA(LPCSTR,LPDCB,LPCOMMTIMEOUTS);
967BOOL WINAPI BuildCommDCBAndTimeoutsW(LPCWSTR,LPDCB,LPCOMMTIMEOUTS);
968BOOL WINAPI CallNamedPipeA(LPCSTR,PVOID,DWORD,PVOID,DWORD,PDWORD,DWORD);
969BOOL WINAPI CallNamedPipeW(LPCWSTR,PVOID,DWORD,PVOID,DWORD,PDWORD,DWORD);
970BOOL WINAPI CancelIo(HANDLE);
971BOOL WINAPI CancelWaitableTimer(HANDLE);
972BOOL WINAPI ClearCommBreak(HANDLE);
973BOOL WINAPI ClearCommError(HANDLE,PDWORD,LPCOMSTAT);
974BOOL WINAPI ClearEventLogA(HANDLE,LPCSTR);
975BOOL WINAPI ClearEventLogW(HANDLE,LPCWSTR);
976BOOL WINAPI CloseEventLog(HANDLE);
977BOOL WINAPI CloseHandle(HANDLE);
978BOOL WINAPI CommConfigDialogA(LPCSTR,HWND,LPCOMMCONFIG);
979BOOL WINAPI CommConfigDialogW(LPCWSTR,HWND,LPCOMMCONFIG);
980LONG WINAPI CompareFileTime(CONST FILETIME*,CONST FILETIME*);
981BOOL WINAPI ConnectNamedPipe(HANDLE,LPOVERLAPPED);
982BOOL WINAPI ContinueDebugEvent(DWORD,DWORD,DWORD);
983PVOID WINAPI ConvertThreadToFiber(PVOID);
984BOOL WINAPI CopyFileA(LPCSTR,LPCSTR,BOOL);
985BOOL WINAPI CopyFileW(LPCWSTR,LPCWSTR,BOOL);
986BOOL WINAPI CopyFileExA(LPCSTR,LPCSTR,LPPROGRESS_ROUTINE,LPVOID,LPBOOL,DWORD);
987BOOL WINAPI CopyFileExW(LPCWSTR,LPCWSTR,LPPROGRESS_ROUTINE,LPVOID,LPBOOL,DWORD);
988#define RtlMoveMemory memmove
989#define RtlCopyMemory memcpy
990#define RtlFillMemory(d,l,f) memset((d), (f), (l))
991#define RtlZeroMemory(d,l) RtlFillMemory((d),(l),0)
992#define MoveMemory RtlMoveMemory
993#define CopyMemory RtlCopyMemory
994#define FillMemory RtlFillMemory
995#define ZeroMemory RtlZeroMemory
996BOOL WINAPI CopySid(DWORD,PSID,PSID);
997BOOL WINAPI CreateDirectoryA(LPCSTR,LPSECURITY_ATTRIBUTES);
998BOOL WINAPI CreateDirectoryW(LPCWSTR,LPSECURITY_ATTRIBUTES);
999BOOL WINAPI CreateDirectoryExA(LPCSTR,LPCSTR,LPSECURITY_ATTRIBUTES);
1000BOOL WINAPI CreateDirectoryExW(LPCWSTR,LPCWSTR,LPSECURITY_ATTRIBUTES);
1001HANDLE WINAPI CreateEventA(LPSECURITY_ATTRIBUTES,BOOL,BOOL,LPCSTR);
1002HANDLE WINAPI CreateEventW(LPSECURITY_ATTRIBUTES,BOOL,BOOL,LPCWSTR);
1003LPVOID WINAPI CreateFiber(DWORD,LPFIBER_START_ROUTINE,LPVOID);
1004HANDLE WINAPI CreateFileA(LPCSTR,DWORD,DWORD,LPSECURITY_ATTRIBUTES,DWORD,DWORD,HANDLE);
1005HANDLE WINAPI CreateFileW(LPCWSTR,DWORD,DWORD,LPSECURITY_ATTRIBUTES,DWORD,DWORD,HANDLE);
1006HANDLE WINAPI CreateFileMappingA(HANDLE,LPSECURITY_ATTRIBUTES,DWORD,DWORD,DWORD,LPCSTR);
1007HANDLE WINAPI CreateFileMappingW(HANDLE,LPSECURITY_ATTRIBUTES,DWORD,DWORD,DWORD,LPCWSTR);
1008HANDLE WINAPI CreateHardLinkA(LPCSTR,LPCSTR,LPSECURITY_ATTRIBUTES);
1009HANDLE WINAPI CreateHardLinkW(LPCWSTR,LPCWSTR,LPSECURITY_ATTRIBUTES);
1010HANDLE WINAPI CreateIoCompletionPort(HANDLE,HANDLE,DWORD,DWORD);
1011HANDLE WINAPI CreateMailslotA(LPCSTR,DWORD,DWORD,LPSECURITY_ATTRIBUTES);
1012HANDLE WINAPI CreateMailslotW(LPCWSTR,DWORD,DWORD,LPSECURITY_ATTRIBUTES);
1013HANDLE WINAPI CreateMutexA(LPSECURITY_ATTRIBUTES,BOOL,LPCSTR);
1014HANDLE WINAPI CreateMutexW(LPSECURITY_ATTRIBUTES,BOOL,LPCWSTR);
1015HANDLE WINAPI CreateNamedPipeA(LPCSTR,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,LPSECURITY_ATTRIBUTES);
1016HANDLE WINAPI CreateNamedPipeW(LPCWSTR,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,LPSECURITY_ATTRIBUTES);
1017BOOL WINAPI CreatePipe(PHANDLE,PHANDLE,LPSECURITY_ATTRIBUTES,DWORD);
1018BOOL WINAPI CreatePrivateObjectSecurity(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR*,BOOL,HANDLE,PGENERIC_MAPPING);
1019BOOL WINAPI CreateProcessA(LPCSTR,LPSTR,LPSECURITY_ATTRIBUTES,LPSECURITY_ATTRIBUTES,BOOL,DWORD,PVOID,LPCSTR,LPSTARTUPINFOA,LPPROCESS_INFORMATION);
1020BOOL WINAPI CreateProcessW(LPCWSTR,LPWSTR,LPSECURITY_ATTRIBUTES,LPSECURITY_ATTRIBUTES,BOOL,DWORD,PVOID,LPCWSTR,LPSTARTUPINFOW,LPPROCESS_INFORMATION);
1021BOOL WINAPI CreateProcessAsUserA(HANDLE,LPCSTR,LPSTR,LPSECURITY_ATTRIBUTES,LPSECURITY_ATTRIBUTES,BOOL,DWORD,PVOID,LPCSTR,LPSTARTUPINFOA,LPPROCESS_INFORMATION);
1022BOOL WINAPI CreateProcessAsUserW(HANDLE,LPCWSTR,LPWSTR,LPSECURITY_ATTRIBUTES,LPSECURITY_ATTRIBUTES,BOOL,DWORD,PVOID,LPCWSTR,LPSTARTUPINFOW,LPPROCESS_INFORMATION);
1023HANDLE WINAPI CreateRemoteThread(HANDLE,LPSECURITY_ATTRIBUTES,DWORD,LPTHREAD_START_ROUTINE,LPVOID,DWORD,LPDWORD);
1024HANDLE WINAPI CreateSemaphoreA(LPSECURITY_ATTRIBUTES,LONG,LONG,LPCSTR);
1025HANDLE WINAPI CreateSemaphoreW(LPSECURITY_ATTRIBUTES,LONG,LONG,LPCWSTR);
1026DWORD WINAPI CreateTapePartition(HANDLE,DWORD,DWORD,DWORD);
1027HANDLE WINAPI CreateThread(LPSECURITY_ATTRIBUTES,DWORD,LPTHREAD_START_ROUTINE,PVOID,DWORD,PDWORD);
1028HANDLE WINAPI CreateWaitableTimerA(LPSECURITY_ATTRIBUTES,BOOL,LPCSTR);
1029HANDLE WINAPI CreateWaitableTimerW(LPSECURITY_ATTRIBUTES,BOOL,LPCWSTR);
1030BOOL WINAPI DebugActiveProcess(DWORD);
1031void WINAPI DebugBreak(void);
1032BOOL WINAPI DefineDosDeviceA(DWORD,LPCSTR,LPCSTR);
1033BOOL WINAPI DefineDosDeviceW(DWORD,LPCWSTR,LPCWSTR);
1034#define DefineHandleTable(w) ((w),TRUE)
1035BOOL WINAPI DeleteAce(PACL,DWORD);
1036ATOM WINAPI DeleteAtom(ATOM);
1037void WINAPI DeleteCriticalSection(PCRITICAL_SECTION);
1038void WINAPI DeleteFiber(PVOID);
1039BOOL WINAPI DeleteFileA(LPCSTR);
1040BOOL WINAPI DeleteFileW(LPCWSTR);
1041BOOL WINAPI DeregisterEventSource(HANDLE);
1042BOOL WINAPI DestroyPrivateObjectSecurity(PSECURITY_DESCRIPTOR*);
1043BOOL WINAPI DeviceIoControl(HANDLE,DWORD,PVOID,DWORD,PVOID,DWORD,PDWORD,POVERLAPPED);
1044BOOL WINAPI DisableThreadLibraryCalls(HMODULE);
1045BOOL WINAPI DisconnectNamedPipe(HANDLE);
1046BOOL WINAPI DosDateTimeToFileTime(WORD,WORD,LPFILETIME);
1047BOOL WINAPI DuplicateHandle(HANDLE,HANDLE,HANDLE,PHANDLE,DWORD,BOOL,DWORD);
1048BOOL WINAPI DuplicateToken(HANDLE,SECURITY_IMPERSONATION_LEVEL,PHANDLE);
1049BOOL WINAPI DuplicateTokenEx(HANDLE,DWORD,LPSECURITY_ATTRIBUTES,SECURITY_IMPERSONATION_LEVEL,TOKEN_TYPE,PHANDLE);
1050BOOL WINAPI EndUpdateResourceA(HANDLE,BOOL);
1051BOOL WINAPI EndUpdateResourceW(HANDLE,BOOL);
1052void WINAPI EnterCriticalSection(LPCRITICAL_SECTION);
1053BOOL WINAPI EnumResourceLanguagesA(HINSTANCE,LPCSTR,LPCSTR,ENUMRESLANGPROC,LONG);
1054BOOL WINAPI EnumResourceLanguagesW(HINSTANCE,LPCWSTR,LPCWSTR,ENUMRESLANGPROC,LONG);
1055BOOL WINAPI EnumResourceNamesA(HINSTANCE,LPCSTR,ENUMRESNAMEPROC,LONG);
1056BOOL WINAPI EnumResourceNamesW(HINSTANCE,LPCWSTR,ENUMRESNAMEPROC,LONG);
1057BOOL WINAPI EnumResourceTypesA(HINSTANCE,ENUMRESTYPEPROC,LONG);
1058BOOL WINAPI EnumResourceTypesW(HINSTANCE,ENUMRESTYPEPROC,LONG);
1059BOOL WINAPI EqualPrefixSid(PSID,PSID);
1060BOOL WINAPI EqualSid(PSID,PSID);
1061DWORD WINAPI EraseTape(HANDLE,DWORD,BOOL);
1062BOOL WINAPI EscapeCommFunction(HANDLE,DWORD);
1063DECLSPEC_NORETURN void WINAPI ExitProcess(UINT);
1064DECLSPEC_NORETURN void WINAPI ExitThread(DWORD);
1065DWORD WINAPI ExpandEnvironmentStringsA(LPCSTR,LPSTR,DWORD);
1066DWORD WINAPI ExpandEnvironmentStringsW(LPCWSTR,LPWSTR,DWORD);
1067void WINAPI FatalAppExitA(UINT,LPCSTR);
1068void WINAPI FatalAppExitW(UINT,LPCWSTR);
1069void WINAPI FatalExit(int);
1070BOOL WINAPI FileTimeToDosDateTime(CONST FILETIME *,LPWORD,LPWORD);
1071BOOL WINAPI FileTimeToLocalFileTime(FILETIME *,LPFILETIME);
1072BOOL WINAPI FileTimeToSystemTime(CONST FILETIME *,LPSYSTEMTIME);
1073ATOM WINAPI FindAtomA(LPCSTR);
1074ATOM WINAPI FindAtomW(LPCWSTR);
1075BOOL WINAPI FindClose(HANDLE);
1076BOOL WINAPI FindCloseChangeNotification(HANDLE);
1077HANDLE WINAPI FindFirstChangeNotificationA(LPCSTR,BOOL,DWORD);
1078HANDLE WINAPI FindFirstChangeNotificationW(LPCWSTR,BOOL,DWORD);
1079HANDLE WINAPI FindFirstFileA(LPCSTR,LPWIN32_FIND_DATAA);
1080HANDLE WINAPI FindFirstFileW(LPCWSTR,LPWIN32_FIND_DATAW);
1081HANDLE WINAPI FindFirstFileExA(LPCSTR,FINDEX_INFO_LEVELS,PVOID,FINDEX_SEARCH_OPS,PVOID,DWORD);
1082HANDLE WINAPI FindFirstFileExW(LPCWSTR,FINDEX_INFO_LEVELS,PVOID,FINDEX_SEARCH_OPS,PVOID,DWORD);
1083BOOL WINAPI FindFirstFreeAce(PACL,PVOID*);
1084BOOL WINAPI FindNextChangeNotification(HANDLE);
1085BOOL WINAPI FindNextFileA(HANDLE,LPWIN32_FIND_DATAA);
1086BOOL WINAPI FindNextFileW(HANDLE,LPWIN32_FIND_DATAW);
1087HRSRC WINAPI FindResourceA(HMODULE,LPCSTR,LPCSTR);
1088HRSRC WINAPI FindResourceW(HINSTANCE,LPCWSTR,LPCWSTR);
1089HRSRC WINAPI FindResourceExA(HINSTANCE,LPCSTR,LPCSTR,WORD);
1090HRSRC WINAPI FindResourceExW(HINSTANCE,LPCWSTR,LPCWSTR,WORD);
1091BOOL WINAPI FlushFileBuffers(HANDLE);
1092BOOL WINAPI FlushInstructionCache(HANDLE,PCVOID,DWORD);
1093BOOL WINAPI FlushViewOfFile(PCVOID,DWORD);
1094DWORD WINAPI FormatMessageA(DWORD,PCVOID,DWORD,DWORD,LPSTR,DWORD,va_list*);
1095DWORD WINAPI FormatMessageW(DWORD,PCVOID,DWORD,DWORD,LPWSTR,DWORD,va_list*);
1096BOOL WINAPI FreeEnvironmentStringsA(LPSTR);
1097BOOL WINAPI FreeEnvironmentStringsW(LPWSTR);
1098BOOL WINAPI FreeLibrary(HMODULE);
1099DECLSPEC_NORETURN void WINAPI FreeLibraryAndExitThread(HMODULE,DWORD);
1100#define FreeModule(m) FreeLibrary(m)
1101#define FreeProcInstance(p) (void)(p)
1102#ifndef XFree86Server
1103BOOL WINAPI FreeResource(HGLOBAL);
1104#endif /* ndef XFree86Server */
1105PVOID WINAPI FreeSid(PSID);
1106BOOL WINAPI GetAce(PACL,DWORD,PVOID);
1107BOOL WINAPI GetAclInformation(PACL,PVOID,DWORD,ACL_INFORMATION_CLASS);
1108UINT WINAPI GetAtomNameA(ATOM,LPSTR,int);
1109UINT WINAPI GetAtomNameW(ATOM,LPWSTR,int);
1110BOOL WINAPI GetBinaryTypeA(LPCSTR,PDWORD);
1111BOOL WINAPI GetBinaryTypeW(LPCWSTR,PDWORD);
1112LPSTR WINAPI GetCommandLineA(VOID);
1113LPWSTR WINAPI GetCommandLineW(VOID);
1114BOOL WINAPI GetCommConfig(HANDLE,LPCOMMCONFIG,PDWORD);
1115BOOL WINAPI GetCommMask(HANDLE,PDWORD);
1116BOOL WINAPI GetCommModemStatus(HANDLE,PDWORD);
1117BOOL WINAPI GetCommProperties(HANDLE,LPCOMMPROP);
1118BOOL WINAPI GetCommState(HANDLE,LPDCB);
1119BOOL WINAPI GetCommTimeouts(HANDLE,LPCOMMTIMEOUTS);
1120DWORD WINAPI GetCompressedFileSizeA(LPCSTR,PDWORD);
1121DWORD WINAPI GetCompressedFileSizeW(LPCWSTR,PDWORD);
1122BOOL WINAPI GetComputerNameA(LPSTR,PDWORD);
1123BOOL WINAPI GetComputerNameW(LPWSTR,PDWORD);
1124DWORD WINAPI GetCurrentDirectoryA(DWORD,LPSTR);
1125DWORD WINAPI GetCurrentDirectoryW(DWORD,LPWSTR);
1126BOOL WINAPI GetCurrentHwProfileA(LPHW_PROFILE_INFOA);
1127BOOL WINAPI GetCurrentHwProfileW(LPHW_PROFILE_INFOW);
1128HANDLE WINAPI GetCurrentProcess(void);
1129DWORD WINAPI GetCurrentProcessId(void);
1130HANDLE WINAPI GetCurrentThread(void);
1131DWORD WINAPI GetCurrentThreadId(void);
1132#define GetCurrentTime GetTickCount
1133BOOL WINAPI GetDefaultCommConfigA(LPCSTR,LPCOMMCONFIG,PDWORD);
1134BOOL WINAPI GetDefaultCommConfigW(LPCWSTR,LPCOMMCONFIG,PDWORD);
1135BOOL WINAPI GetDiskFreeSpaceA(LPCSTR,PDWORD,PDWORD,PDWORD,PDWORD);
1136BOOL WINAPI GetDiskFreeSpaceW(LPCWSTR,PDWORD,PDWORD,PDWORD,PDWORD);
1137BOOL WINAPI GetDiskFreeSpaceExA(LPCSTR,PULARGE_INTEGER,PULARGE_INTEGER,PULARGE_INTEGER);
1138BOOL WINAPI GetDiskFreeSpaceExW(LPCWSTR,PULARGE_INTEGER,PULARGE_INTEGER,PULARGE_INTEGER);
1139UINT WINAPI GetDriveTypeA(LPCSTR);
1140UINT WINAPI GetDriveTypeW(LPCWSTR);
1141LPSTR WINAPI GetEnvironmentStrings(void);
1142LPSTR WINAPI GetEnvironmentStringsA(void);
1143LPWSTR WINAPI GetEnvironmentStringsW(void);
1144DWORD WINAPI GetEnvironmentVariableA(LPCSTR,LPSTR,DWORD);
1145DWORD WINAPI GetEnvironmentVariableW(LPCWSTR,LPWSTR,DWORD);
1146BOOL WINAPI GetExitCodeProcess(HANDLE,PDWORD);
1147BOOL WINAPI GetExitCodeThread(HANDLE,PDWORD);
1148DWORD WINAPI GetFileAttributesA(LPCSTR);
1149DWORD WINAPI GetFileAttributesW(LPCWSTR);
1150BOOL WINAPI GetFileAttributesExA(LPCSTR,GET_FILEEX_INFO_LEVELS,PVOID);
1151BOOL WINAPI GetFileAttributesExW(LPCWSTR,GET_FILEEX_INFO_LEVELS,PVOID);
1152BOOL WINAPI GetFileInformationByHandle(HANDLE,LPBY_HANDLE_FILE_INFORMATION);
1153BOOL WINAPI GetFileSecurityA(LPCSTR,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,DWORD,PDWORD);
1154BOOL WINAPI GetFileSecurityW(LPCWSTR,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,DWORD,PDWORD);
1155DWORD WINAPI GetFileSize(HANDLE,PDWORD);
1156BOOL WINAPI GetFileTime(HANDLE,LPFILETIME,LPFILETIME,LPFILETIME);
1157DWORD WINAPI GetFileType(HANDLE);
1158#define GetFreeSpace(w) (0x100000L)
1159DWORD WINAPI GetFullPathNameA(LPCSTR,DWORD,LPSTR,LPSTR*);
1160DWORD WINAPI GetFullPathNameW(LPCWSTR,DWORD,LPWSTR,LPWSTR*);
1161BOOL WINAPI GetHandleInformation(HANDLE,PDWORD);
1162BOOL WINAPI GetKernelObjectSecurity(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,DWORD,PDWORD);
1163DWORD WINAPI GetLengthSid(PSID);
1164void WINAPI GetLocalTime(LPSYSTEMTIME);
1165DWORD WINAPI GetLogicalDrives(void);
1166DWORD WINAPI GetLogicalDriveStringsA(DWORD,LPSTR);
1167DWORD WINAPI GetLogicalDriveStringsW(DWORD,LPWSTR);
1168DWORD WINAPI GetLongPathNameA(LPCSTR,LPSTR,DWORD);
1169DWORD WINAPI GetLongPathNameW(LPCWSTR,LPWSTR,DWORD);
1170BOOL WINAPI GetMailslotInfo(HANDLE,PDWORD,PDWORD,PDWORD,PDWORD);
1171DWORD WINAPI GetModuleFileNameA(HINSTANCE,LPSTR,DWORD);
1172DWORD WINAPI GetModuleFileNameW(HINSTANCE,LPWSTR,DWORD);
1173HMODULE WINAPI GetModuleHandleA(LPCSTR);
1174HMODULE WINAPI GetModuleHandleW(LPCWSTR);
1175BOOL WINAPI GetNamedPipeHandleStateA(HANDLE,PDWORD,PDWORD,PDWORD,PDWORD,LPSTR,DWORD);
1176BOOL WINAPI GetNamedPipeHandleStateW(HANDLE,PDWORD,PDWORD,PDWORD,PDWORD,LPWSTR,DWORD);
1177BOOL WINAPI GetNamedPipeInfo(HANDLE,PDWORD,PDWORD,PDWORD,PDWORD);
1178BOOL WINAPI GetNumberOfEventLogRecords(HANDLE,PDWORD);
1179BOOL WINAPI GetOldestEventLogRecord(HANDLE,PDWORD);
1180BOOL WINAPI GetOverlappedResult(HANDLE,LPOVERLAPPED,PDWORD,BOOL);
1181DWORD WINAPI GetPriorityClass(HANDLE);
1182BOOL WINAPI GetPrivateObjectSecurity(PSECURITY_DESCRIPTOR,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,DWORD,PDWORD);
1183UINT WINAPI GetPrivateProfileIntA(LPCSTR,LPCSTR,INT,LPCSTR);
1184UINT WINAPI GetPrivateProfileIntW(LPCWSTR,LPCWSTR,INT,LPCWSTR);
1185DWORD WINAPI GetPrivateProfileSectionA(LPCSTR,LPSTR,DWORD,LPCSTR);
1186DWORD WINAPI GetPrivateProfileSectionW(LPCWSTR,LPWSTR,DWORD,LPCWSTR);
1187DWORD WINAPI GetPrivateProfileSectionNamesA(LPSTR,DWORD,LPCSTR);
1188DWORD WINAPI GetPrivateProfileSectionNamesW(LPWSTR,DWORD,LPCWSTR);
1189DWORD WINAPI GetPrivateProfileStringA(LPCSTR,LPCSTR,LPCSTR,LPSTR,DWORD,LPCSTR);
1190DWORD WINAPI GetPrivateProfileStringW(LPCWSTR,LPCWSTR,LPCWSTR,LPWSTR,DWORD,LPCWSTR);
1191BOOL WINAPI GetPrivateProfileStructA(LPCSTR,LPCSTR,PVOID,UINT,LPCSTR);
1192BOOL WINAPI GetPrivateProfileStructW(LPCWSTR,LPCWSTR,PVOID,UINT,LPCWSTR);
1193FARPROC WINAPI GetProcAddress(HINSTANCE,LPCSTR);
1194BOOL WINAPI GetProcessAffinityMask(HANDLE,PDWORD,PDWORD);
1195HANDLE WINAPI GetProcessHeap(VOID);
1196DWORD WINAPI GetProcessHeaps(DWORD,PHANDLE);
1197BOOL WINAPI GetProcessPriorityBoost(HANDLE,PBOOL);
1198BOOL WINAPI GetProcessShutdownParameters(PDWORD,PDWORD);
1199BOOL WINAPI GetProcessTimes(HANDLE,LPFILETIME,LPFILETIME,LPFILETIME,LPFILETIME);
1200DWORD WINAPI GetProcessVersion(DWORD);
1201HWINSTA WINAPI GetProcessWindowStation(void);
1202BOOL WINAPI GetProcessWorkingSetSize(HANDLE,PDWORD,PDWORD);
1203UINT WINAPI GetProfileIntA(LPCSTR,LPCSTR,INT);
1204UINT WINAPI GetProfileIntW(LPCWSTR,LPCWSTR,INT);
1205DWORD WINAPI GetProfileSectionA(LPCSTR,LPSTR,DWORD);
1206DWORD WINAPI GetProfileSectionW(LPCWSTR,LPWSTR,DWORD);
1207DWORD WINAPI GetProfileStringA(LPCSTR,LPCSTR,LPCSTR,LPSTR,DWORD);
1208DWORD WINAPI GetProfileStringW(LPCWSTR,LPCWSTR,LPCWSTR,LPWSTR,DWORD);
1209BOOL WINAPI GetQueuedCompletionStatus(HANDLE,PDWORD,PDWORD,LPOVERLAPPED*,DWORD);
1210BOOL WINAPI GetSecurityDescriptorControl(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR_CONTROL,PDWORD);
1211BOOL WINAPI GetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR,LPBOOL,PACL*,LPBOOL);
1212BOOL WINAPI GetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR,PSID*,LPBOOL);
1213DWORD WINAPI GetSecurityDescriptorLength(PSECURITY_DESCRIPTOR);
1214BOOL WINAPI GetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR,PSID*,LPBOOL);
1215BOOL WINAPI GetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR,LPBOOL,PACL*,LPBOOL);
1216DWORD WINAPI GetShortPathNameA(LPCSTR,LPSTR,DWORD);
1217DWORD WINAPI GetShortPathNameW(LPCWSTR,LPWSTR,DWORD);
1218PSID_IDENTIFIER_AUTHORITY WINAPI GetSidIdentifierAuthority(PSID);
1219DWORD WINAPI GetSidLengthRequired(UCHAR);
1220PDWORD WINAPI GetSidSubAuthority(PSID,DWORD);
1221PUCHAR WINAPI GetSidSubAuthorityCount(PSID);
1222VOID WINAPI GetStartupInfoA(LPSTARTUPINFOA);
1223VOID WINAPI GetStartupInfoW(LPSTARTUPINFOW);
1224HANDLE WINAPI GetStdHandle(DWORD);
1225UINT WINAPI GetSystemDirectoryA(LPSTR,UINT);
1226UINT WINAPI GetSystemDirectoryW(LPWSTR,UINT);
1227VOID WINAPI GetSystemInfo(LPSYSTEM_INFO);
1228BOOL WINAPI GetSystemPowerStatus(LPSYSTEM_POWER_STATUS);
1229VOID WINAPI GetSystemTime(LPSYSTEMTIME);
1230BOOL WINAPI GetSystemTimeAdjustment(PDWORD,PDWORD,PBOOL);
1231void WINAPI GetSystemTimeAsFileTime(LPFILETIME);
1232DWORD WINAPI GetTapeParameters(HANDLE,DWORD,PDWORD,PVOID);
1233DWORD WINAPI GetTapePosition(HANDLE,DWORD,PDWORD,PDWORD,PDWORD);
1234DWORD WINAPI GetTapeStatus(HANDLE);
1235UINT WINAPI GetTempFileNameA(LPCSTR,LPCSTR,UINT,LPSTR);
1236UINT WINAPI GetTempFileNameW(LPCWSTR,LPCWSTR,UINT,LPWSTR);
1237DWORD WINAPI GetTempPathA(DWORD,LPSTR);
1238DWORD WINAPI GetTempPathW(DWORD,LPWSTR);
1239BOOL WINAPI GetThreadContext(HANDLE,LPCONTEXT);
1240int WINAPI GetThreadPriority(HANDLE);
1241BOOL WINAPI GetThreadPriorityBoost(HANDLE,PBOOL);
1242BOOL WINAPI GetThreadSelectorEntry(HANDLE,DWORD,LPLDT_ENTRY);
1243BOOL WINAPI GetThreadTimes(HANDLE,LPFILETIME,LPFILETIME,LPFILETIME,LPFILETIME);
1244DWORD WINAPI GetTickCount(void);
1245DWORD WINAPI GetTimeZoneInformation(LPTIME_ZONE_INFORMATION);
1246BOOL WINAPI GetTokenInformation(HANDLE,TOKEN_INFORMATION_CLASS,PVOID,DWORD,PDWORD);
1247BOOL WINAPI GetUserNameA (LPSTR,PDWORD);
1248BOOL WINAPI GetUserNameW(LPWSTR,PDWORD);
1249DWORD WINAPI GetVersion(void);
1250BOOL WINAPI GetVersionExA(LPOSVERSIONINFOA);
1251BOOL WINAPI GetVersionExW(LPOSVERSIONINFOW);
1252BOOL WINAPI GetVolumeInformationA(LPCSTR,LPSTR,DWORD,PDWORD,PDWORD,PDWORD,LPSTR,DWORD);
1253BOOL WINAPI GetVolumeInformationW(LPCWSTR,LPWSTR,DWORD,PDWORD,PDWORD,PDWORD,LPWSTR,DWORD);
1254UINT WINAPI GetWindowsDirectoryA(LPSTR,UINT);
1255UINT WINAPI GetWindowsDirectoryW(LPWSTR,UINT);
1256DWORD WINAPI GetWindowThreadProcessId(HWND,PDWORD);
1257ATOM WINAPI GlobalAddAtomA(LPCSTR);
1258ATOM WINAPI GlobalAddAtomW( LPCWSTR);
1259HGLOBAL WINAPI GlobalAlloc(UINT,DWORD);
1260UINT WINAPI GlobalCompact(DWORD);
1261ATOM WINAPI GlobalDeleteAtom(ATOM);
1262HGLOBAL GlobalDiscard(HGLOBAL);
1263ATOM WINAPI GlobalFindAtomA(LPCSTR);
1264ATOM WINAPI GlobalFindAtomW(LPCWSTR);
1265VOID WINAPI GlobalFix(HGLOBAL);
1266UINT WINAPI GlobalFlags(HGLOBAL);
1267HGLOBAL WINAPI GlobalFree(HGLOBAL);
1268UINT WINAPI GlobalGetAtomNameA(ATOM,LPSTR,int);
1269UINT WINAPI GlobalGetAtomNameW(ATOM,LPWSTR,int);
1270HGLOBAL WINAPI GlobalHandle(PCVOID);
1271LPVOID WINAPI GlobalLock(HGLOBAL);
1272VOID WINAPI GlobalMemoryStatus(LPMEMORYSTATUS);
1273HGLOBAL WINAPI GlobalReAlloc(HGLOBAL,DWORD,UINT);
1274DWORD WINAPI GlobalSize(HGLOBAL);
1275VOID WINAPI GlobalUnfix(HGLOBAL);
1276BOOL WINAPI GlobalUnlock(HGLOBAL);
1277BOOL WINAPI GlobalUnWire(HGLOBAL);
1278PVOID WINAPI GlobalWire(HGLOBAL);
1279#define HasOverlappedIoCompleted(lpOverlapped) ((lpOverlapped)->Internal != STATUS_PENDING)
1280PVOID WINAPI HeapAlloc(HANDLE,DWORD,DWORD);
1281UINT WINAPI HeapCompact(HANDLE,DWORD);
1282HANDLE WINAPI HeapCreate(DWORD,DWORD,DWORD);
1283BOOL WINAPI HeapDestroy(HANDLE);
1284BOOL WINAPI HeapFree(HANDLE,DWORD,PVOID);
1285BOOL WINAPI HeapLock(HANDLE);
1286PVOID WINAPI HeapReAlloc(HANDLE,DWORD,PVOID,DWORD);
1287DWORD WINAPI HeapSize(HANDLE,DWORD,PCVOID);
1288BOOL WINAPI HeapUnlock(HANDLE);
1289BOOL WINAPI HeapValidate(HANDLE,DWORD,PCVOID);
1290BOOL WINAPI HeapWalk(HANDLE,LPPROCESS_HEAP_ENTRY);
1291BOOL WINAPI ImpersonateLoggedOnUser(HANDLE);
1292BOOL WINAPI ImpersonateNamedPipeClient(HANDLE);
1293BOOL WINAPI ImpersonateSelf(SECURITY_IMPERSONATION_LEVEL);
1294BOOL WINAPI InitAtomTable(DWORD);
1295BOOL WINAPI InitializeAcl(PACL,DWORD,DWORD);
1296VOID WINAPI InitializeCriticalSection(LPCRITICAL_SECTION);
1297#if (_WIN32_WINNT >= 0x0403) /* Needs NT4, SP3 or later. */
1298BOOL WINAPI InitializeCriticalSectionAndSpinCount(LPCRITICAL_SECTION,DWORD);
1299DWORD WINAPI SetCriticalSectionSpinCount(LPCRITICAL_SECTION,DWORD);
1300#endif1059#endif
1301BOOL WINAPI InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR,DWORD);1060
1302BOOL WINAPI InitializeSid (PSID,PSID_IDENTIFIER_AUTHORITY,BYTE);1061#if defined(_SLIST_HEADER_) && !defined(_NTOSP_)
1303LONG WINAPI InterlockedCompareExchange(LPLONG,LONG,LONG);1062 WINBASEAPI VOID WINAPI InitializeSListHead(PSLIST_HEADER ListHead);
1304/* PVOID WINAPI InterlockedCompareExchangePointer(PVOID*,PVOID,PVOID); */1063 WINBASEAPI PSLIST_ENTRY WINAPI InterlockedPopEntrySList(PSLIST_HEADER ListHead);
1305#define InterlockedCompareExchangePointer(d,e,c) \1064 WINBASEAPI PSLIST_ENTRY WINAPI InterlockedPushEntrySList(PSLIST_HEADER ListHead,PSLIST_ENTRY ListEntry);
1306 (PVOID)InterlockedCompareExchange((LPLONG)(d),(LONG)(e),(LONG)(c))1065 WINBASEAPI PSLIST_ENTRY WINAPI InterlockedFlushSList(PSLIST_HEADER ListHead);
1307LONG WINAPI InterlockedDecrement(LPLONG);1066 WINBASEAPI USHORT WINAPI QueryDepthSList(PSLIST_HEADER ListHead);
1308LONG WINAPI InterlockedExchange(LPLONG,LONG);1067#endif
1309/* PVOID WINAPI InterlockedExchangePointer(PVOID*,PVOID); */1068#endif
1310#define InterlockedExchangePointer(t,v) \1069#endif
1311 (PVOID)InterlockedExchange((LPLONG)(t),(LONG)(v))1070
1312LONG WINAPI InterlockedExchangeAdd(PLONG,LONG);1071 WINBASEAPI WINBOOL WINAPI FreeResource(HGLOBAL hResData);
1313LONG WINAPI InterlockedIncrement(LPLONG);1072 WINBASEAPI LPVOID WINAPI LockResource(HGLOBAL hResData);
1314BOOL WINAPI IsBadCodePtr(FARPROC);1073
1315BOOL WINAPI IsBadHugeReadPtr(PCVOID,UINT);1074#define UnlockResource(hResData) ((hResData),0)
1316BOOL WINAPI IsBadHugeWritePtr(PVOID,UINT);1075#define MAXINTATOM 0xC000
1317BOOL WINAPI IsBadReadPtr(PCVOID,UINT);1076#define MAKEINTATOM(i) (LPTSTR)((ULONG_PTR)((WORD)(i)))
1318BOOL WINAPI IsBadStringPtrA(LPCSTR,UINT);1077#define INVALID_ATOM ((ATOM)0)
1319BOOL WINAPI IsBadStringPtrW(LPCWSTR,UINT);1078
1320BOOL WINAPI IsBadWritePtr(PVOID,UINT);1079 int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nShowCmd);
1321BOOL WINAPI IsDebuggerPresent(void);1080 WINBASEAPI WINBOOL WINAPI FreeLibrary(HMODULE hLibModule);
1322BOOL WINAPI IsProcessorFeaturePresent(DWORD);1081 WINBASEAPI DECLSPEC_NORETURN VOID WINAPI FreeLibraryAndExitThread(HMODULE hLibModule,DWORD dwExitCode);
1323BOOL WINAPI IsTextUnicode(PCVOID,int,LPINT);1082 WINBASEAPI WINBOOL WINAPI DisableThreadLibraryCalls(HMODULE hLibModule);
1324BOOL WINAPI IsValidAcl(PACL);1083 WINBASEAPI FARPROC WINAPI GetProcAddress(HMODULE hModule,LPCSTR lpProcName);
1325BOOL WINAPI IsValidSecurityDescriptor(PSECURITY_DESCRIPTOR);1084 WINBASEAPI DWORD WINAPI GetVersion(VOID);
1326BOOL WINAPI IsValidSid(PSID);1085 WINBASEAPI HGLOBAL WINAPI GlobalAlloc(UINT uFlags,SIZE_T dwBytes);
1327void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION);1086 WINBASEAPI HGLOBAL WINAPI GlobalReAlloc(HGLOBAL hMem,SIZE_T dwBytes,UINT uFlags);
1328#define LimitEmsPages(n)1087 WINBASEAPI SIZE_T WINAPI GlobalSize(HGLOBAL hMem);
1329HINSTANCE WINAPI LoadLibraryA(LPCSTR);1088 WINBASEAPI UINT WINAPI GlobalFlags(HGLOBAL hMem);
1330HINSTANCE WINAPI LoadLibraryExA(LPCSTR,HANDLE,DWORD);1089 WINBASEAPI LPVOID WINAPI GlobalLock(HGLOBAL hMem);
1331HINSTANCE WINAPI LoadLibraryExW(LPCWSTR,HANDLE,DWORD);1090 WINBASEAPI HGLOBAL WINAPI GlobalHandle(LPCVOID pMem);
1332HINSTANCE WINAPI LoadLibraryW(LPCWSTR);1091 WINBASEAPI WINBOOL WINAPI GlobalUnlock(HGLOBAL hMem);
1333DWORD WINAPI LoadModule(LPCSTR,PVOID);1092 WINBASEAPI HGLOBAL WINAPI GlobalFree(HGLOBAL hMem);
1334HGLOBAL WINAPI LoadResource(HINSTANCE,HRSRC);1093 WINBASEAPI SIZE_T WINAPI GlobalCompact(DWORD dwMinFree);
1335HLOCAL WINAPI LocalAlloc(UINT,UINT);1094 WINBASEAPI VOID WINAPI GlobalFix(HGLOBAL hMem);
1336UINT WINAPI LocalCompact(UINT);1095 WINBASEAPI VOID WINAPI GlobalUnfix(HGLOBAL hMem);
1337HLOCAL LocalDiscard(HLOCAL);1096 WINBASEAPI LPVOID WINAPI GlobalWire(HGLOBAL hMem);
1338BOOL WINAPI LocalFileTimeToFileTime(CONST FILETIME *,LPFILETIME);1097 WINBASEAPI WINBOOL WINAPI GlobalUnWire(HGLOBAL hMem);
1339UINT WINAPI LocalFlags(HLOCAL);1098 WINBASEAPI VOID WINAPI GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer);
1340HLOCAL WINAPI LocalFree(HLOCAL);1099
1341HLOCAL WINAPI LocalHandle(LPCVOID);1100 typedef struct _MEMORYSTATUSEX {
1342PVOID WINAPI LocalLock(HLOCAL);1101 DWORD dwLength;
1343HLOCAL WINAPI LocalReAlloc(HLOCAL,UINT,UINT);1102 DWORD dwMemoryLoad;
1344UINT WINAPI LocalShrink(HLOCAL,UINT);1103 DWORDLONG ullTotalPhys;
1345UINT WINAPI LocalSize(HLOCAL);1104 DWORDLONG ullAvailPhys;
1346BOOL WINAPI LocalUnlock(HLOCAL);1105 DWORDLONG ullTotalPageFile;
1347BOOL WINAPI LockFile(HANDLE,DWORD,DWORD,DWORD,DWORD);1106 DWORDLONG ullAvailPageFile;
1348BOOL WINAPI LockFileEx(HANDLE,DWORD,DWORD,DWORD,DWORD,LPOVERLAPPED);1107 DWORDLONG ullTotalVirtual;
1349PVOID WINAPI LockResource(HGLOBAL);1108 DWORDLONG ullAvailVirtual;
1350#define LockSegment(w) GlobalFix((HANDLE)(w))1109 DWORDLONG ullAvailExtendedVirtual;
1351BOOL WINAPI LogonUserA(LPSTR,LPSTR,LPSTR,DWORD,DWORD,PHANDLE);1110 } MEMORYSTATUSEX,*LPMEMORYSTATUSEX;
1352BOOL WINAPI LogonUserW(LPWSTR,LPWSTR,LPWSTR,DWORD,DWORD,PHANDLE);1111
1353BOOL WINAPI LookupAccountNameA(LPCSTR,LPCSTR,PSID,PDWORD,LPSTR,PDWORD,PSID_NAME_USE);1112 WINBASEAPI WINBOOL WINAPI GlobalMemoryStatusEx(LPMEMORYSTATUSEX lpBuffer);
1354BOOL WINAPI LookupAccountNameW(LPCWSTR,LPCWSTR,PSID,PDWORD,LPWSTR,PDWORD,PSID_NAME_USE);1113 WINBASEAPI HLOCAL WINAPI LocalAlloc(UINT uFlags,SIZE_T uBytes);
1355BOOL WINAPI LookupAccountSidA(LPCSTR,PSID,LPSTR,PDWORD,LPSTR,PDWORD,PSID_NAME_USE);1114 WINBASEAPI HLOCAL WINAPI LocalReAlloc(HLOCAL hMem,SIZE_T uBytes,UINT uFlags);
1356BOOL WINAPI LookupAccountSidW(LPCWSTR,PSID,LPWSTR,PDWORD,LPWSTR,PDWORD,PSID_NAME_USE);1115 WINBASEAPI LPVOID WINAPI LocalLock(HLOCAL hMem);
1357BOOL WINAPI LookupPrivilegeDisplayNameA(LPCSTR,LPCSTR,LPSTR,PDWORD,PDWORD);1116 WINBASEAPI HLOCAL WINAPI LocalHandle(LPCVOID pMem);
1358BOOL WINAPI LookupPrivilegeDisplayNameW(LPCWSTR,LPCWSTR,LPWSTR,PDWORD,PDWORD);1117 WINBASEAPI WINBOOL WINAPI LocalUnlock(HLOCAL hMem);
1359BOOL WINAPI LookupPrivilegeNameA(LPCSTR,PLUID,LPSTR,PDWORD);1118 WINBASEAPI SIZE_T WINAPI LocalSize(HLOCAL hMem);
1360BOOL WINAPI LookupPrivilegeNameW(LPCWSTR,PLUID,LPWSTR,PDWORD);1119 WINBASEAPI UINT WINAPI LocalFlags(HLOCAL hMem);
1361BOOL WINAPI LookupPrivilegeValueA(LPCSTR,LPCSTR,PLUID);1120 WINBASEAPI HLOCAL WINAPI LocalFree(HLOCAL hMem);
1362BOOL WINAPI LookupPrivilegeValueW(LPCWSTR,LPCWSTR,PLUID);1121 WINBASEAPI SIZE_T WINAPI LocalShrink(HLOCAL hMem,UINT cbNewSize);
1363LPSTR WINAPI lstrcatA(LPSTR,LPCSTR);1122 WINBASEAPI SIZE_T WINAPI LocalCompact(UINT uMinFree);
1364LPWSTR WINAPI lstrcatW(LPWSTR,LPCWSTR);1123 WINBASEAPI WINBOOL WINAPI FlushInstructionCache(HANDLE hProcess,LPCVOID lpBaseAddress,SIZE_T dwSize);
1365int WINAPI lstrcmpA(LPCSTR,LPCSTR);1124 WINBASEAPI LPVOID WINAPI VirtualAlloc(LPVOID lpAddress,SIZE_T dwSize,DWORD flAllocationType,DWORD flProtect);
1366int WINAPI lstrcmpiA(LPCSTR,LPCSTR);1125 WINBASEAPI WINBOOL WINAPI VirtualFree(LPVOID lpAddress,SIZE_T dwSize,DWORD dwFreeType);
1367int WINAPI lstrcmpiW( LPCWSTR,LPCWSTR);1126 WINBASEAPI WINBOOL WINAPI VirtualProtect(LPVOID lpAddress,SIZE_T dwSize,DWORD flNewProtect,PDWORD lpflOldProtect);
1368int WINAPI lstrcmpW(LPCWSTR,LPCWSTR);1127 WINBASEAPI SIZE_T WINAPI VirtualQuery(LPCVOID lpAddress,PMEMORY_BASIC_INFORMATION lpBuffer,SIZE_T dwLength);
1369LPSTR WINAPI lstrcpyA(LPSTR,LPCSTR);1128 WINBASEAPI LPVOID WINAPI VirtualAllocEx(HANDLE hProcess,LPVOID lpAddress,SIZE_T dwSize,DWORD flAllocationType,DWORD flProtect);
1370LPSTR WINAPI lstrcpynA(LPSTR,LPCSTR,int);1129 WINBASEAPI UINT WINAPI GetWriteWatch(DWORD dwFlags,PVOID lpBaseAddress,SIZE_T dwRegionSize,PVOID *lpAddresses,ULONG_PTR *lpdwCount,PULONG lpdwGranularity);
1371LPWSTR WINAPI lstrcpynW(LPWSTR,LPCWSTR,int);1130 WINBASEAPI UINT WINAPI ResetWriteWatch(LPVOID lpBaseAddress,SIZE_T dwRegionSize);
1372LPWSTR WINAPI lstrcpyW(LPWSTR,LPCWSTR);1131 WINBASEAPI SIZE_T WINAPI GetLargePageMinimum(VOID);
1373int WINAPI lstrlenA(LPCSTR);1132 WINBASEAPI UINT WINAPI EnumSystemFirmwareTables(DWORD FirmwareTableProviderSignature,PVOID pFirmwareTableEnumBuffer,DWORD BufferSize);
1374int WINAPI lstrlenW(LPCWSTR);1133 WINBASEAPI UINT WINAPI GetSystemFirmwareTable(DWORD FirmwareTableProviderSignature,DWORD FirmwareTableID,PVOID pFirmwareTableBuffer,DWORD BufferSize);
1375BOOL WINAPI MakeAbsoluteSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PDWORD,PACL,PDWORD,PACL,PDWORD,PSID,PDWORD,PSID,PDWORD);1134 WINBASEAPI WINBOOL WINAPI VirtualFreeEx(HANDLE hProcess,LPVOID lpAddress,SIZE_T dwSize,DWORD dwFreeType);
1376#define MakeProcInstance(p,i) (p)1135 WINBASEAPI WINBOOL WINAPI VirtualProtectEx(HANDLE hProcess,LPVOID lpAddress,SIZE_T dwSize,DWORD flNewProtect,PDWORD lpflOldProtect);
1377BOOL WINAPI MakeSelfRelativeSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PDWORD);1136 WINBASEAPI SIZE_T WINAPI VirtualQueryEx(HANDLE hProcess,LPCVOID lpAddress,PMEMORY_BASIC_INFORMATION lpBuffer,SIZE_T dwLength);
1378VOID WINAPI MapGenericMask(PDWORD,PGENERIC_MAPPING);1137 WINBASEAPI HANDLE WINAPI HeapCreate(DWORD flOptions,SIZE_T dwInitialSize,SIZE_T dwMaximumSize);
1379PVOID WINAPI MapViewOfFile(HANDLE,DWORD,DWORD,DWORD,DWORD);1138 WINBASEAPI WINBOOL WINAPI HeapDestroy(HANDLE hHeap);
1380PVOID WINAPI MapViewOfFileEx(HANDLE,DWORD,DWORD,DWORD,DWORD,PVOID);1139 WINBASEAPI LPVOID WINAPI HeapAlloc(HANDLE hHeap,DWORD dwFlags,SIZE_T dwBytes);
1381BOOL WINAPI MoveFileA(LPCSTR,LPCSTR);1140 WINBASEAPI LPVOID WINAPI HeapReAlloc(HANDLE hHeap,DWORD dwFlags,LPVOID lpMem,SIZE_T dwBytes);
1382BOOL WINAPI MoveFileExA(LPCSTR,LPCSTR,DWORD);1141 WINBASEAPI WINBOOL WINAPI HeapFree(HANDLE hHeap,DWORD dwFlags,LPVOID lpMem);
1383BOOL WINAPI MoveFileExW(LPCWSTR,LPCWSTR,DWORD);1142 WINBASEAPI SIZE_T WINAPI HeapSize(HANDLE hHeap,DWORD dwFlags,LPCVOID lpMem);
1384BOOL WINAPI MoveFileW(LPCWSTR,LPCWSTR);1143 WINBASEAPI WINBOOL WINAPI HeapValidate(HANDLE hHeap,DWORD dwFlags,LPCVOID lpMem);
1385int WINAPI MulDiv(int,int,int);1144 WINBASEAPI SIZE_T WINAPI HeapCompact(HANDLE hHeap,DWORD dwFlags);
1386BOOL WINAPI NotifyChangeEventLog(HANDLE,HANDLE);1145 WINBASEAPI HANDLE WINAPI GetProcessHeap(VOID);
1387BOOL WINAPI ObjectCloseAuditAlarmA(LPCSTR,PVOID,BOOL);1146 WINBASEAPI DWORD WINAPI GetProcessHeaps(DWORD NumberOfHeaps,PHANDLE ProcessHeaps);
1388BOOL WINAPI ObjectCloseAuditAlarmW(LPCWSTR,PVOID,BOOL);1147
1389BOOL WINAPI ObjectDeleteAuditAlarmA(LPCSTR,PVOID,BOOL);1148 typedef struct _PROCESS_HEAP_ENTRY {
1390BOOL WINAPI ObjectDeleteAuditAlarmW(LPCWSTR,PVOID,BOOL);1149 PVOID lpData;
1391BOOL WINAPI ObjectOpenAuditAlarmA(LPCSTR,PVOID,LPSTR,LPSTR,PSECURITY_DESCRIPTOR,HANDLE,DWORD,DWORD,PPRIVILEGE_SET,BOOL,BOOL,PBOOL);1150 DWORD cbData;
1392BOOL WINAPI ObjectOpenAuditAlarmW(LPCWSTR,PVOID,LPWSTR,LPWSTR,PSECURITY_DESCRIPTOR,HANDLE,DWORD,DWORD,PPRIVILEGE_SET,BOOL,BOOL,PBOOL);1151 BYTE cbOverhead;
1393BOOL WINAPI ObjectPrivilegeAuditAlarmA(LPCSTR,PVOID,HANDLE,DWORD,PPRIVILEGE_SET,BOOL);1152 BYTE iRegionIndex;
1394BOOL WINAPI ObjectPrivilegeAuditAlarmW(LPCWSTR,PVOID,HANDLE,DWORD,PPRIVILEGE_SET,BOOL);1153 WORD wFlags;
1395HANDLE WINAPI OpenBackupEventLogA(LPCSTR,LPCSTR);1154 union {
1396HANDLE WINAPI OpenBackupEventLogW(LPCWSTR,LPCWSTR);1155 struct {
1397HANDLE WINAPI OpenEventA(DWORD,BOOL,LPCSTR);1156 HANDLE hMem;
1398HANDLE WINAPI OpenEventLogA (LPCSTR,LPCSTR);1157 DWORD dwReserved[3];
1399HANDLE WINAPI OpenEventLogW(LPCWSTR,LPCWSTR);1158 } Block;
1400HANDLE WINAPI OpenEventW(DWORD,BOOL,LPCWSTR);1159 struct {
1401HFILE WINAPI OpenFile(LPCSTR,LPOFSTRUCT,UINT);1160 DWORD dwCommittedSize;
1402HANDLE WINAPI OpenFileMappingA(DWORD,BOOL,LPCSTR);1161 DWORD dwUnCommittedSize;
1403HANDLE WINAPI OpenFileMappingW(DWORD,BOOL,LPCWSTR);1162 LPVOID lpFirstBlock;
1404HANDLE WINAPI OpenMutexA(DWORD,BOOL,LPCSTR);1163 LPVOID lpLastBlock;
1405HANDLE WINAPI OpenMutexW(DWORD,BOOL,LPCWSTR);1164 } Region;
1406HANDLE WINAPI OpenProcess(DWORD,BOOL,DWORD);1165 };
1407BOOL WINAPI OpenProcessToken(HANDLE,DWORD,PHANDLE);1166 } PROCESS_HEAP_ENTRY,*LPPROCESS_HEAP_ENTRY,*PPROCESS_HEAP_ENTRY;
1408HANDLE WINAPI OpenSemaphoreA(DWORD,BOOL,LPCSTR);1167
1409HANDLE WINAPI OpenSemaphoreW(DWORD,BOOL,LPCWSTR);1168#define PROCESS_HEAP_REGION 0x1
1410BOOL WINAPI OpenThreadToken(HANDLE,DWORD,BOOL,PHANDLE);1169#define PROCESS_HEAP_UNCOMMITTED_RANGE 0x2
1411HANDLE WINAPI OpenWaitableTimerA(DWORD,BOOL,LPCSTR);1170#define PROCESS_HEAP_ENTRY_BUSY 0x4
1412HANDLE WINAPI OpenWaitableTimerW(DWORD,BOOL,LPCWSTR);1171#define PROCESS_HEAP_ENTRY_MOVEABLE 0x10
1413void WINAPI OutputDebugStringA(LPCSTR);1172#define PROCESS_HEAP_ENTRY_DDESHARE 0x20
1414void WINAPI OutputDebugStringW(LPCWSTR);1173
1415BOOL WINAPI PeekNamedPipe(HANDLE,PVOID,DWORD,PDWORD,PDWORD,PDWORD);1174 WINBASEAPI WINBOOL WINAPI HeapLock(HANDLE hHeap);
1416BOOL WINAPI PostQueuedCompletionStatus(HANDLE,DWORD,DWORD,LPOVERLAPPED);1175 WINBASEAPI WINBOOL WINAPI HeapUnlock(HANDLE hHeap);
1417DWORD WINAPI PrepareTape(HANDLE,DWORD,BOOL);1176 WINBASEAPI WINBOOL WINAPI HeapWalk(HANDLE hHeap,LPPROCESS_HEAP_ENTRY lpEntry);
1418BOOL WINAPI PrivilegeCheck (HANDLE,PPRIVILEGE_SET,PBOOL);1177 WINBASEAPI WINBOOL WINAPI HeapSetInformation(HANDLE HeapHandle,HEAP_INFORMATION_CLASS HeapInformationClass,PVOID HeapInformation,SIZE_T HeapInformationLength);
1419BOOL WINAPI PrivilegedServiceAuditAlarmA(LPCSTR,LPCSTR,HANDLE,PPRIVILEGE_SET,BOOL);1178 WINBASEAPI WINBOOL WINAPI HeapQueryInformation(HANDLE HeapHandle,HEAP_INFORMATION_CLASS HeapInformationClass,PVOID HeapInformation,SIZE_T HeapInformationLength,PSIZE_T ReturnLength);
1420BOOL WINAPI PrivilegedServiceAuditAlarmW(LPCWSTR,LPCWSTR,HANDLE,PPRIVILEGE_SET,BOOL);1179
1421BOOL WINAPI PulseEvent(HANDLE);1180#define SCS_32BIT_BINARY 0
1422BOOL WINAPI PurgeComm(HANDLE,DWORD);1181#define SCS_DOS_BINARY 1
1423DWORD WINAPI QueryDosDeviceA(LPCSTR,LPSTR,DWORD);1182#define SCS_WOW_BINARY 2
1424DWORD WINAPI QueryDosDeviceW(LPCWSTR,LPWSTR,DWORD);1183#define SCS_PIF_BINARY 3
1425BOOL WINAPI QueryPerformanceCounter(PLARGE_INTEGER);1184#define SCS_POSIX_BINARY 4
1426BOOL WINAPI QueryPerformanceFrequency(PLARGE_INTEGER);1185#define SCS_OS216_BINARY 5
1427DWORD WINAPI QueueUserAPC(PAPCFUNC,HANDLE,DWORD);1186#define SCS_64BIT_BINARY 6
1428void WINAPI RaiseException(DWORD,DWORD,DWORD,const DWORD*);1187
1429BOOL WINAPI ReadDirectoryChangesW(HANDLE,PVOID,DWORD,BOOL,DWORD,PDWORD,LPOVERLAPPED,LPOVERLAPPED_COMPLETION_ROUTINE);1188#ifdef UNICODE
1430BOOL WINAPI ReadEventLogA(HANDLE,DWORD,DWORD,PVOID,DWORD,DWORD *,DWORD *);1189#define GetBinaryType GetBinaryTypeW
1431BOOL WINAPI ReadEventLogW(HANDLE,DWORD,DWORD,PVOID,DWORD,DWORD *,DWORD *);1190#define GetShortPathName GetShortPathNameW
1432BOOL WINAPI ReadFile(HANDLE,PVOID,DWORD,PDWORD,LPOVERLAPPED);1191#define GetLongPathName GetLongPathNameW
1433BOOL WINAPI ReadFileEx(HANDLE,PVOID,DWORD,LPOVERLAPPED,LPOVERLAPPED_COMPLETION_ROUTINE);1192#define GetEnvironmentStrings GetEnvironmentStringsW
1434BOOL WINAPI ReadProcessMemory(HANDLE,PCVOID,PVOID,DWORD,PDWORD);1193#define SetEnvironmentStrings SetEnvironmentStringsW
1435HANDLE WINAPI RegisterEventSourceA (LPCSTR,LPCSTR);1194#define FreeEnvironmentStrings FreeEnvironmentStringsW
1436HANDLE WINAPI RegisterEventSourceW(LPCWSTR,LPCWSTR);1195#else
1437BOOL WINAPI ReleaseMutex(HANDLE);1196#define GetBinaryType GetBinaryTypeA
1438BOOL WINAPI ReleaseSemaphore(HANDLE,LONG,LPLONG);1197#define GetShortPathName GetShortPathNameA
1439BOOL WINAPI RemoveDirectoryA(LPCSTR);1198#define GetLongPathName GetLongPathNameA
1440BOOL WINAPI RemoveDirectoryW(LPCWSTR);1199#define GetEnvironmentStringsA GetEnvironmentStrings
1441BOOL WINAPI ReportEventA(HANDLE,WORD,WORD,DWORD,PSID,WORD,DWORD,LPCSTR*,PVOID);1200#define SetEnvironmentStrings SetEnvironmentStringsA
1442BOOL WINAPI ReportEventW(HANDLE,WORD,WORD,DWORD,PSID,WORD,DWORD,LPCWSTR*,PVOID);1201#define FreeEnvironmentStrings FreeEnvironmentStringsA
1443BOOL WINAPI ResetEvent(HANDLE);1202#endif
1444DWORD WINAPI ResumeThread(HANDLE);1203
1445BOOL WINAPI RevertToSelf(void);1204#ifdef _WIN64
1446DWORD WINAPI SearchPathA(LPCSTR,LPCSTR,LPCSTR,DWORD,LPSTR,LPSTR*);1205#define SCS_THIS_PLATFORM_BINARY SCS_64BIT_BINARY
1447DWORD WINAPI SearchPathW(LPCWSTR,LPCWSTR,LPCWSTR,DWORD,LPWSTR,LPWSTR*);1206#else
1448BOOL WINAPI SetAclInformation(PACL,PVOID,DWORD,ACL_INFORMATION_CLASS);1207#define SCS_THIS_PLATFORM_BINARY SCS_32BIT_BINARY
1449BOOL WINAPI SetCommBreak(HANDLE);1208#endif
1450BOOL WINAPI SetCommConfig(HANDLE,LPCOMMCONFIG,DWORD);1209
1451BOOL WINAPI SetCommMask(HANDLE,DWORD);1210 WINBASEAPI WINBOOL WINAPI GetBinaryTypeA(LPCSTR lpApplicationName,LPDWORD lpBinaryType);
1452BOOL WINAPI SetCommState(HANDLE,LPDCB);1211 WINBASEAPI WINBOOL WINAPI GetBinaryTypeW(LPCWSTR lpApplicationName,LPDWORD lpBinaryType);
1453BOOL WINAPI SetCommTimeouts(HANDLE,LPCOMMTIMEOUTS);1212 WINBASEAPI DWORD WINAPI GetShortPathNameA(LPCSTR lpszLongPath,LPSTR lpszShortPath,DWORD cchBuffer);
1454BOOL WINAPI SetComputerNameA(LPCSTR);1213 WINBASEAPI DWORD WINAPI GetShortPathNameW(LPCWSTR lpszLongPath,LPWSTR lpszShortPath,DWORD cchBuffer);
1455BOOL WINAPI SetComputerNameW(LPCWSTR);1214 WINBASEAPI DWORD WINAPI GetLongPathNameA(LPCSTR lpszShortPath,LPSTR lpszLongPath,DWORD cchBuffer);
1456BOOL WINAPI SetCurrentDirectoryA(LPCSTR);1215 WINBASEAPI DWORD WINAPI GetLongPathNameW(LPCWSTR lpszShortPath,LPWSTR lpszLongPath,DWORD cchBuffer);
1457BOOL WINAPI SetCurrentDirectoryW(LPCWSTR);1216 WINBASEAPI WINBOOL WINAPI GetProcessAffinityMask(HANDLE hProcess,PDWORD_PTR lpProcessAffinityMask,PDWORD_PTR lpSystemAffinityMask);
1458BOOL WINAPI SetDefaultCommConfigA(LPCSTR,LPCOMMCONFIG,DWORD);1217 WINBASEAPI WINBOOL WINAPI SetProcessAffinityMask(HANDLE hProcess,DWORD_PTR dwProcessAffinityMask);
1459BOOL WINAPI SetDefaultCommConfigW(LPCWSTR,LPCOMMCONFIG,DWORD);1218 WINBASEAPI WINBOOL WINAPI GetProcessHandleCount(HANDLE hProcess,PDWORD pdwHandleCount);
1460BOOL WINAPI SetEndOfFile(HANDLE);1219 WINBASEAPI WINBOOL WINAPI GetProcessTimes(HANDLE hProcess,LPFILETIME lpCreationTime,LPFILETIME lpExitTime,LPFILETIME lpKernelTime,LPFILETIME lpUserTime);
1461BOOL WINAPI SetEnvironmentVariableA(LPCSTR,LPCSTR);1220 WINBASEAPI WINBOOL WINAPI GetProcessIoCounters(HANDLE hProcess,PIO_COUNTERS lpIoCounters);
1462BOOL WINAPI SetEnvironmentVariableW(LPCWSTR,LPCWSTR);1221 WINBASEAPI WINBOOL WINAPI GetProcessWorkingSetSize(HANDLE hProcess,PSIZE_T lpMinimumWorkingSetSize,PSIZE_T lpMaximumWorkingSetSize);
1463UINT WINAPI SetErrorMode(UINT);1222 WINBASEAPI WINBOOL WINAPI GetProcessWorkingSetSizeEx(HANDLE hProcess,PSIZE_T lpMinimumWorkingSetSize,PSIZE_T lpMaximumWorkingSetSize,PDWORD Flags);
1464BOOL WINAPI SetEvent(HANDLE);1223 WINBASEAPI WINBOOL WINAPI SetProcessWorkingSetSize(HANDLE hProcess,SIZE_T dwMinimumWorkingSetSize,SIZE_T dwMaximumWorkingSetSize);
1465VOID WINAPI SetFileApisToANSI(void);1224 WINBASEAPI WINBOOL WINAPI SetProcessWorkingSetSizeEx(HANDLE hProcess,SIZE_T dwMinimumWorkingSetSize,SIZE_T dwMaximumWorkingSetSize,DWORD Flags);
1466VOID WINAPI SetFileApisToOEM(void);1225 WINBASEAPI HANDLE WINAPI OpenProcess(DWORD dwDesiredAccess,WINBOOL bInheritHandle,DWORD dwProcessId);
1467BOOL WINAPI SetFileAttributesA(LPCSTR,DWORD);1226 WINBASEAPI HANDLE WINAPI GetCurrentProcess(VOID);
1468BOOL WINAPI SetFileAttributesW(LPCWSTR,DWORD);1227 WINBASEAPI DWORD WINAPI GetCurrentProcessId(VOID);
1469DWORD WINAPI SetFilePointer(HANDLE,LONG,PLONG,DWORD);1228 WINBASEAPI DECLSPEC_NORETURN VOID WINAPI ExitProcess(UINT uExitCode);
1470BOOL WINAPI SetFileSecurityA(LPCSTR,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);1229 WINBASEAPI WINBOOL WINAPI TerminateProcess(HANDLE hProcess,UINT uExitCode);
1471BOOL WINAPI SetFileSecurityW(LPCWSTR,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);1230 WINBASEAPI WINBOOL WINAPI GetExitCodeProcess(HANDLE hProcess,LPDWORD lpExitCode);
1472BOOL WINAPI SetFileTime(HANDLE,const FILETIME*,const FILETIME*,const FILETIME*);1231 WINBASEAPI VOID WINAPI FatalExit(int ExitCode);
1473UINT WINAPI SetHandleCount(UINT);1232 /* WINBASEAPI LPCH WINAPI GetEnvironmentStrings(VOID); */
1474BOOL WINAPI SetHandleInformation(HANDLE,DWORD,DWORD);1233 WINBASEAPI LPWCH WINAPI GetEnvironmentStringsW(VOID);
1475BOOL WINAPI SetKernelObjectSecurity(HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);1234 WINBASEAPI WINBOOL WINAPI SetEnvironmentStringsA(LPCH NewEnvironment);
1476void WINAPI SetLastError(DWORD);1235 WINBASEAPI WINBOOL WINAPI SetEnvironmentStringsW(LPWCH NewEnvironment);
1477void WINAPI SetLastErrorEx(DWORD,DWORD);1236 WINBASEAPI WINBOOL WINAPI FreeEnvironmentStringsA(LPCH);
1478BOOL WINAPI SetLocalTime(const SYSTEMTIME*);1237 WINBASEAPI WINBOOL WINAPI FreeEnvironmentStringsW(LPWCH);
1479BOOL WINAPI SetMailslotInfo(HANDLE,DWORD);1238 WINBASEAPI VOID WINAPI RaiseException(DWORD dwExceptionCode,DWORD dwExceptionFlags,DWORD nNumberOfArguments,CONST ULONG_PTR *lpArguments);
1480BOOL WINAPI SetNamedPipeHandleState(HANDLE,PDWORD,PDWORD,PDWORD);1239 WINBASEAPI LONG WINAPI UnhandledExceptionFilter(struct _EXCEPTION_POINTERS *ExceptionInfo);
1481BOOL WINAPI SetPriorityClass(HANDLE,DWORD);1240
1482BOOL WINAPI SetPrivateObjectSecurity(SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR *,PGENERIC_MAPPING,HANDLE);1241 typedef LONG (WINAPI *PTOP_LEVEL_EXCEPTION_FILTER)(struct _EXCEPTION_POINTERS *ExceptionInfo);
1483BOOL WINAPI SetProcessAffinityMask(HANDLE,DWORD);1242 typedef PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER;
1484BOOL WINAPI SetProcessPriorityBoost(HANDLE,BOOL);1243
1485BOOL WINAPI SetProcessShutdownParameters(DWORD,DWORD);1244 WINBASEAPI LPTOP_LEVEL_EXCEPTION_FILTER WINAPI SetUnhandledExceptionFilter(LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter);
1486BOOL WINAPI SetProcessWorkingSetSize(HANDLE,DWORD,DWORD);1245
1487BOOL WINAPI SetSecurityDescriptorControl(PSECURITY_DESCRIPTOR,SECURITY_DESCRIPTOR_CONTROL,SECURITY_DESCRIPTOR_CONTROL);1246#define FIBER_FLAG_FLOAT_SWITCH 0x1
1488BOOL WINAPI SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR,BOOL,PACL,BOOL);1247
1489BOOL WINAPI SetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR,PSID,BOOL);1248 WINBASEAPI LPVOID WINAPI CreateFiber(SIZE_T dwStackSize,LPFIBER_START_ROUTINE lpStartAddress,LPVOID lpParameter);
1490BOOL WINAPI SetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR,PSID,BOOL);1249 WINBASEAPI LPVOID WINAPI CreateFiberEx(SIZE_T dwStackCommitSize,SIZE_T dwStackReserveSize,DWORD dwFlags,LPFIBER_START_ROUTINE lpStartAddress,LPVOID lpParameter);
1491BOOL WINAPI SetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR,BOOL,PACL,BOOL);1250 WINBASEAPI VOID WINAPI DeleteFiber(LPVOID lpFiber);
1492BOOL WINAPI SetStdHandle(DWORD,HANDLE);1251 WINBASEAPI LPVOID WINAPI ConvertThreadToFiber(LPVOID lpParameter);
1493#define SetSwapAreaSize(w) (w)1252 WINBASEAPI LPVOID WINAPI ConvertThreadToFiberEx(LPVOID lpParameter,DWORD dwFlags);
1494BOOL WINAPI SetSystemPowerState(BOOL,BOOL);1253 WINBASEAPI WINBOOL WINAPI ConvertFiberToThread(VOID);
1495BOOL WINAPI SetSystemTime(const SYSTEMTIME*);1254 WINBASEAPI VOID WINAPI SwitchToFiber(LPVOID lpFiber);
1496BOOL WINAPI SetSystemTimeAdjustment(DWORD,BOOL);1255 WINBASEAPI WINBOOL WINAPI SwitchToThread(VOID);
1497DWORD WINAPI SetTapeParameters(HANDLE,DWORD,PVOID);1256 WINBASEAPI HANDLE WINAPI CreateThread(LPSECURITY_ATTRIBUTES lpThreadAttributes,SIZE_T dwStackSize,LPTHREAD_START_ROUTINE lpStartAddress,LPVOID lpParameter,DWORD dwCreationFlags,LPDWORD lpThreadId);
1498DWORD WINAPI SetTapePosition(HANDLE,DWORD,DWORD,DWORD,DWORD,BOOL);1257 WINBASEAPI HANDLE WINAPI CreateRemoteThread(HANDLE hProcess,LPSECURITY_ATTRIBUTES lpThreadAttributes,SIZE_T dwStackSize,LPTHREAD_START_ROUTINE lpStartAddress,LPVOID lpParameter,DWORD dwCreationFlags,LPDWORD lpThreadId);
1499DWORD WINAPI SetThreadAffinityMask(HANDLE,DWORD);1258 WINBASEAPI HANDLE WINAPI GetCurrentThread(VOID);
1500BOOL WINAPI SetThreadContext(HANDLE,const CONTEXT*);1259 WINBASEAPI DWORD WINAPI GetCurrentThreadId(VOID);
1501DWORD WINAPI SetThreadIdealProcessor(HANDLE,DWORD);1260 WINBASEAPI WINBOOL WINAPI SetThreadStackGuarantee (PULONG StackSizeInBytes);
1502BOOL WINAPI SetThreadPriority(HANDLE,int);1261 WINBASEAPI DWORD WINAPI GetProcessIdOfThread(HANDLE Thread);
1503BOOL WINAPI SetThreadPriorityBoost(HANDLE,BOOL);1262 WINBASEAPI DWORD WINAPI GetThreadId(HANDLE Thread);
1504BOOL WINAPI SetThreadToken (PHANDLE,HANDLE);1263 WINBASEAPI DWORD WINAPI GetProcessId(HANDLE Process);
1505BOOL WINAPI SetTimeZoneInformation(const TIME_ZONE_INFORMATION *);1264 WINBASEAPI DWORD WINAPI GetCurrentProcessorNumber(VOID);
1506BOOL WINAPI SetTokenInformation(HANDLE,TOKEN_INFORMATION_CLASS,PVOID,DWORD);1265 WINBASEAPI DWORD_PTR WINAPI SetThreadAffinityMask(HANDLE hThread,DWORD_PTR dwThreadAffinityMask);
1507LPTOP_LEVEL_EXCEPTION_FILTER WINAPI SetUnhandledExceptionFilter(LPTOP_LEVEL_EXCEPTION_FILTER);1266 WINBASEAPI DWORD WINAPI SetThreadIdealProcessor(HANDLE hThread,DWORD dwIdealProcessor);
1508BOOL WINAPI SetupComm(HANDLE,DWORD,DWORD);1267 WINBASEAPI WINBOOL WINAPI SetProcessPriorityBoost(HANDLE hProcess,WINBOOL bDisablePriorityBoost);
1509BOOL WINAPI SetVolumeLabelA(LPCSTR,LPCSTR);1268 WINBASEAPI WINBOOL WINAPI GetProcessPriorityBoost(HANDLE hProcess,PBOOL pDisablePriorityBoost);
1510BOOL WINAPI SetVolumeLabelW(LPCWSTR,LPCWSTR);1269 WINBASEAPI WINBOOL WINAPI RequestWakeupLatency(LATENCY_TIME latency);
1511BOOL WINAPI SetWaitableTimer(HANDLE,const LARGE_INTEGER*,LONG,PTIMERAPCROUTINE,PVOID,BOOL);1270 WINBASEAPI WINBOOL WINAPI IsSystemResumeAutomatic(VOID);
1512BOOL WINAPI SignalObjectAndWait(HANDLE,HANDLE,DWORD,BOOL);1271 WINBASEAPI HANDLE WINAPI OpenThread(DWORD dwDesiredAccess,WINBOOL bInheritHandle,DWORD dwThreadId);
1513DWORD WINAPI SizeofResource(HINSTANCE,HRSRC);1272 WINBASEAPI WINBOOL WINAPI SetThreadPriority(HANDLE hThread,int nPriority);
1514void WINAPI Sleep(DWORD);1273 WINBASEAPI WINBOOL WINAPI SetThreadPriorityBoost(HANDLE hThread,WINBOOL bDisablePriorityBoost);
1515DWORD WINAPI SleepEx(DWORD,BOOL);1274 WINBASEAPI WINBOOL WINAPI GetThreadPriorityBoost(HANDLE hThread,PBOOL pDisablePriorityBoost);
1516DWORD WINAPI SuspendThread(HANDLE);1275 WINBASEAPI int WINAPI GetThreadPriority(HANDLE hThread);
1517void WINAPI SwitchToFiber(PVOID);1276 WINBASEAPI WINBOOL WINAPI GetThreadTimes(HANDLE hThread,LPFILETIME lpCreationTime,LPFILETIME lpExitTime,LPFILETIME lpKernelTime,LPFILETIME lpUserTime);
1518BOOL WINAPI SwitchToThread(void);1277 WINBASEAPI WINBOOL WINAPI GetThreadIOPendingFlag(HANDLE hThread,PBOOL lpIOIsPending);
1519BOOL WINAPI SystemTimeToFileTime(const SYSTEMTIME*,LPFILETIME);1278 WINBASEAPI DECLSPEC_NORETURN VOID WINAPI ExitThread(DWORD dwExitCode);
1520BOOL WINAPI SystemTimeToTzSpecificLocalTime(LPTIME_ZONE_INFORMATION,LPSYSTEMTIME,LPSYSTEMTIME);1279 WINBASEAPI WINBOOL WINAPI TerminateThread(HANDLE hThread,DWORD dwExitCode);
1521BOOL WINAPI TerminateProcess(HANDLE,UINT);1280 WINBASEAPI WINBOOL WINAPI GetExitCodeThread(HANDLE hThread,LPDWORD lpExitCode);
1522BOOL WINAPI TerminateThread(HANDLE,DWORD);1281 WINBASEAPI WINBOOL WINAPI GetThreadSelectorEntry(HANDLE hThread,DWORD dwSelector,LPLDT_ENTRY lpSelectorEntry);
1523DWORD WINAPI TlsAlloc(VOID);1282 WINBASEAPI EXECUTION_STATE WINAPI SetThreadExecutionState(EXECUTION_STATE esFlags);
1524BOOL WINAPI TlsFree(DWORD);1283 WINBASEAPI DWORD WINAPI GetLastError(VOID);
1525PVOID WINAPI TlsGetValue(DWORD);1284 WINBASEAPI VOID WINAPI SetLastError(DWORD dwErrCode);
1526BOOL WINAPI TlsSetValue(DWORD,PVOID);1285
1527BOOL WINAPI TransactNamedPipe(HANDLE,PVOID,DWORD,PVOID,DWORD,PDWORD,LPOVERLAPPED);1286#ifndef RC_INVOKED
1528BOOL WINAPI TransmitCommChar(HANDLE,char);1287#ifdef WINBASE_DECLARE_RESTORE_LAST_ERROR
1529BOOL WINAPI TryEnterCriticalSection(LPCRITICAL_SECTION);1288 WINBASEAPI VOID WINAPI RestoreLastError(DWORD dwErrCode);
1530LONG WINAPI UnhandledExceptionFilter(LPEXCEPTION_POINTERS);1289
1531BOOL WINAPI UnlockFile(HANDLE,DWORD,DWORD,DWORD,DWORD);1290 typedef VOID (WINAPI *PRESTORE_LAST_ERROR)(DWORD);
1532BOOL WINAPI UnlockFileEx(HANDLE,DWORD,DWORD,DWORD,LPOVERLAPPED);1291
1533#define UnlockResource(h) (h)1292#define RESTORE_LAST_ERROR_NAME_A "RestoreLastError"
1534#define UnlockSegment(w) GlobalUnfix((HANDLE)(w))1293#define RESTORE_LAST_ERROR_NAME_W L"RestoreLastError"
1535BOOL WINAPI UnmapViewOfFile(PVOID);1294#define RESTORE_LAST_ERROR_NAME TEXT("RestoreLastError")
1536BOOL WINAPI UpdateResourceA(HANDLE,LPCSTR,LPCSTR,WORD,PVOID,DWORD);1295#endif
1537BOOL WINAPI UpdateResourceW(HANDLE,LPCWSTR,LPCWSTR,WORD,PVOID,DWORD);1296#endif
1538BOOL WINAPI VerifyVersionInfoA(LPOSVERSIONINFOEXA,DWORD,DWORDLONG);1297
1539BOOL WINAPI VerifyVersionInfoW(LPOSVERSIONINFOEXW,DWORD,DWORDLONG);1298#define HasOverlappedIoCompleted(lpOverlapped) (((DWORD)(lpOverlapped)->Internal)!=STATUS_PENDING)
1540PVOID WINAPI VirtualAlloc(PVOID,DWORD,DWORD,DWORD);1299
1541PVOID WINAPI VirtualAllocEx(HANDLE,PVOID,DWORD,DWORD,DWORD);1300 WINBASEAPI WINBOOL WINAPI GetOverlappedResult(HANDLE hFile,LPOVERLAPPED lpOverlapped,LPDWORD lpNumberOfBytesTransferred,WINBOOL bWait);
1542BOOL WINAPI VirtualFree(PVOID,DWORD,DWORD);1301 WINBASEAPI HANDLE WINAPI CreateIoCompletionPort(HANDLE FileHandle,HANDLE ExistingCompletionPort,ULONG_PTR CompletionKey,DWORD NumberOfConcurrentThreads);
1543BOOL WINAPI VirtualFreeEx(HANDLE,PVOID,DWORD,DWORD);1302 WINBASEAPI WINBOOL WINAPI GetQueuedCompletionStatus(HANDLE CompletionPort,LPDWORD lpNumberOfBytesTransferred,PULONG_PTR lpCompletionKey,LPOVERLAPPED *lpOverlapped,DWORD dwMilliseconds);
1544BOOL WINAPI VirtualLock(PVOID,DWORD);1303 WINBASEAPI WINBOOL WINAPI PostQueuedCompletionStatus(HANDLE CompletionPort,DWORD dwNumberOfBytesTransferred,ULONG_PTR dwCompletionKey,LPOVERLAPPED lpOverlapped);
1545BOOL WINAPI VirtualProtect(PVOID,DWORD,DWORD,PDWORD);1304
1546BOOL WINAPI VirtualProtectEx(HANDLE,PVOID,DWORD,DWORD,PDWORD);1305#define SEM_FAILCRITICALERRORS 0x1
1547DWORD WINAPI VirtualQuery(LPCVOID,PMEMORY_BASIC_INFORMATION,DWORD);1306#define SEM_NOGPFAULTERRORBOX 0x2
1548DWORD WINAPI VirtualQueryEx(HANDLE,LPCVOID,PMEMORY_BASIC_INFORMATION,DWORD);1307#define SEM_NOALIGNMENTFAULTEXCEPT 0x4
1549BOOL WINAPI VirtualUnlock(PVOID,DWORD);1308#define SEM_NOOPENFILEERRORBOX 0x8000
1550BOOL WINAPI WaitCommEvent(HANDLE,PDWORD,LPOVERLAPPED);1309
1551BOOL WINAPI WaitForDebugEvent(LPDEBUG_EVENT,DWORD);1310 WINBASEAPI UINT WINAPI SetErrorMode(UINT uMode);
1552DWORD WINAPI WaitForMultipleObjects(DWORD,const HANDLE*,BOOL,DWORD);1311 WINBASEAPI WINBOOL WINAPI ReadProcessMemory(HANDLE hProcess,LPCVOID lpBaseAddress,LPVOID lpBuffer,SIZE_T nSize,SIZE_T *lpNumberOfBytesRead);
1553DWORD WINAPI WaitForMultipleObjectsEx(DWORD,const HANDLE*,BOOL,DWORD,BOOL);1312 WINBASEAPI WINBOOL WINAPI WriteProcessMemory(HANDLE hProcess,LPVOID lpBaseAddress,LPCVOID lpBuffer,SIZE_T nSize,SIZE_T *lpNumberOfBytesWritten);
1554DWORD WINAPI WaitForSingleObject(HANDLE,DWORD);1313 WINBASEAPI WINBOOL WINAPI GetThreadContext(HANDLE hThread,LPCONTEXT lpContext);
1555DWORD WINAPI WaitForSingleObjectEx(HANDLE,DWORD,BOOL);1314 WINBASEAPI WINBOOL WINAPI SetThreadContext(HANDLE hThread,CONST CONTEXT *lpContext);
1556BOOL WINAPI WaitNamedPipeA(LPCSTR,DWORD);1315 WINBASEAPI DWORD WINAPI SuspendThread(HANDLE hThread);
1557BOOL WINAPI WaitNamedPipeW(LPCWSTR,DWORD);1316 WINBASEAPI DWORD WINAPI ResumeThread(HANDLE hThread);
1558BOOL WINAPI WinLoadTrustProvider(GUID*);1317
1559BOOL WINAPI WriteFile(HANDLE,PCVOID,DWORD,PDWORD,LPOVERLAPPED);1318 typedef VOID (WINAPI *PAPCFUNC)(ULONG_PTR dwParam);
1560BOOL WINAPI WriteFileEx(HANDLE,PCVOID,DWORD,LPOVERLAPPED,LPOVERLAPPED_COMPLETION_ROUTINE);1319
1561BOOL WINAPI WritePrivateProfileSectionA(LPCSTR,LPCSTR,LPCSTR);1320 WINBASEAPI DWORD WINAPI QueueUserAPC(PAPCFUNC pfnAPC,HANDLE hThread,ULONG_PTR dwData);
1562BOOL WINAPI WritePrivateProfileSectionW(LPCWSTR,LPCWSTR,LPCWSTR);1321 WINBASEAPI WINBOOL WINAPI IsDebuggerPresent(VOID);
1563BOOL WINAPI WritePrivateProfileStringA(LPCSTR,LPCSTR,LPCSTR,LPCSTR);1322 WINBASEAPI WINBOOL WINAPI CheckRemoteDebuggerPresent(HANDLE hProcess,PBOOL pbDebuggerPresent);
1564BOOL WINAPI WritePrivateProfileStringW(LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR);1323 WINBASEAPI VOID WINAPI DebugBreak(VOID);
1565BOOL WINAPI WritePrivateProfileStructA(LPCSTR,LPCSTR,PVOID,UINT,LPCSTR);1324 WINBASEAPI WINBOOL WINAPI WaitForDebugEvent(LPDEBUG_EVENT lpDebugEvent,DWORD dwMilliseconds);
1566BOOL WINAPI WritePrivateProfileStructW(LPCWSTR,LPCWSTR,PVOID,UINT,LPCWSTR);1325 WINBASEAPI WINBOOL WINAPI ContinueDebugEvent(DWORD dwProcessId,DWORD dwThreadId,DWORD dwContinueStatus);
1567BOOL WINAPI WriteProcessMemory(HANDLE,PVOID,PVOID,DWORD,PDWORD);1326 WINBASEAPI WINBOOL WINAPI DebugActiveProcess(DWORD dwProcessId);
1568BOOL WINAPI WriteProfileSectionA(LPCSTR,LPCSTR);1327 WINBASEAPI WINBOOL WINAPI DebugActiveProcessStop(DWORD dwProcessId);
1569BOOL WINAPI WriteProfileSectionW(LPCWSTR,LPCWSTR);1328 WINBASEAPI WINBOOL WINAPI DebugSetProcessKillOnExit(WINBOOL KillOnExit);
1570BOOL WINAPI WriteProfileStringA(LPCSTR,LPCSTR,LPCSTR);1329 WINBASEAPI WINBOOL WINAPI DebugBreakProcess(HANDLE Process);
1571BOOL WINAPI WriteProfileStringW(LPCWSTR,LPCWSTR,LPCWSTR);1330 WINBASEAPI VOID WINAPI InitializeCriticalSection(LPCRITICAL_SECTION lpCriticalSection);
1572DWORD WINAPI WriteTapemark(HANDLE,DWORD,DWORD,BOOL);1331 WINBASEAPI VOID WINAPI EnterCriticalSection(LPCRITICAL_SECTION lpCriticalSection);
1573#define Yield()1332 WINBASEAPI VOID WINAPI LeaveCriticalSection(LPCRITICAL_SECTION lpCriticalSection);
1333 WINBASEAPI WINBOOL WINAPI InitializeCriticalSectionAndSpinCount(LPCRITICAL_SECTION lpCriticalSection,DWORD dwSpinCount);
1334 WINBASEAPI DWORD WINAPI SetCriticalSectionSpinCount(LPCRITICAL_SECTION lpCriticalSection,DWORD dwSpinCount);
1335 WINBASEAPI WINBOOL WINAPI TryEnterCriticalSection(LPCRITICAL_SECTION lpCriticalSection);
1336 WINBASEAPI VOID WINAPI DeleteCriticalSection(LPCRITICAL_SECTION lpCriticalSection);
1337 WINBASEAPI WINBOOL WINAPI SetEvent(HANDLE hEvent);
1338 WINBASEAPI WINBOOL WINAPI ResetEvent(HANDLE hEvent);
1339 WINBASEAPI WINBOOL WINAPI PulseEvent(HANDLE hEvent);
1340 WINBASEAPI WINBOOL WINAPI ReleaseSemaphore(HANDLE hSemaphore,LONG lReleaseCount,LPLONG lpPreviousCount);
1341 WINBASEAPI WINBOOL WINAPI ReleaseMutex(HANDLE hMutex);
1342 WINBASEAPI DWORD WINAPI WaitForSingleObject(HANDLE hHandle,DWORD dwMilliseconds);
1343 WINBASEAPI DWORD WINAPI WaitForMultipleObjects(DWORD nCount,CONST HANDLE *lpHandles,WINBOOL bWaitAll,DWORD dwMilliseconds);
1344 WINBASEAPI VOID WINAPI Sleep(DWORD dwMilliseconds);
1345 WINBASEAPI HGLOBAL WINAPI LoadResource(HMODULE hModule,HRSRC hResInfo);
1346 WINBASEAPI DWORD WINAPI SizeofResource(HMODULE hModule,HRSRC hResInfo);
1347 WINBASEAPI ATOM WINAPI GlobalDeleteAtom(ATOM nAtom);
1348 WINBASEAPI WINBOOL WINAPI InitAtomTable(DWORD nSize);
1349 WINBASEAPI ATOM WINAPI DeleteAtom(ATOM nAtom);
1350 WINBASEAPI UINT WINAPI SetHandleCount(UINT uNumber);
1351 WINBASEAPI DWORD WINAPI GetLogicalDrives(VOID);
1352 WINBASEAPI WINBOOL WINAPI LockFile(HANDLE hFile,DWORD dwFileOffsetLow,DWORD dwFileOffsetHigh,DWORD nNumberOfBytesToLockLow,DWORD nNumberOfBytesToLockHigh);
1353 WINBASEAPI WINBOOL WINAPI UnlockFile(HANDLE hFile,DWORD dwFileOffsetLow,DWORD dwFileOffsetHigh,DWORD nNumberOfBytesToUnlockLow,DWORD nNumberOfBytesToUnlockHigh);
1354 WINBASEAPI WINBOOL WINAPI LockFileEx(HANDLE hFile,DWORD dwFlags,DWORD dwReserved,DWORD nNumberOfBytesToLockLow,DWORD nNumberOfBytesToLockHigh,LPOVERLAPPED lpOverlapped);
1355
1356#define LOCKFILE_FAIL_IMMEDIATELY 0x1
1357#define LOCKFILE_EXCLUSIVE_LOCK 0x2
1358
1359 WINBASEAPI WINBOOL WINAPI UnlockFileEx(HANDLE hFile,DWORD dwReserved,DWORD nNumberOfBytesToUnlockLow,DWORD nNumberOfBytesToUnlockHigh,LPOVERLAPPED lpOverlapped);
1360
1361 typedef struct _BY_HANDLE_FILE_INFORMATION {
1362 DWORD dwFileAttributes;
1363 FILETIME ftCreationTime;
1364 FILETIME ftLastAccessTime;
1365 FILETIME ftLastWriteTime;
1366 DWORD dwVolumeSerialNumber;
1367 DWORD nFileSizeHigh;
1368 DWORD nFileSizeLow;
1369 DWORD nNumberOfLinks;
1370 DWORD nFileIndexHigh;
1371 DWORD nFileIndexLow;
1372 } BY_HANDLE_FILE_INFORMATION,*PBY_HANDLE_FILE_INFORMATION,*LPBY_HANDLE_FILE_INFORMATION;
1373
1374#ifdef UNICODE
1375#define SetFileShortName SetFileShortNameW
1376#else
1377#define SetFileShortName SetFileShortNameA
1378#endif
1379
1380 WINBASEAPI WINBOOL WINAPI GetFileInformationByHandle(HANDLE hFile,LPBY_HANDLE_FILE_INFORMATION lpFileInformation);
1381 WINBASEAPI DWORD WINAPI GetFileType(HANDLE hFile);
1382 WINBASEAPI DWORD WINAPI GetFileSize(HANDLE hFile,LPDWORD lpFileSizeHigh);
1383 WINBASEAPI WINBOOL WINAPI GetFileSizeEx(HANDLE hFile,PLARGE_INTEGER lpFileSize);
1384 WINBASEAPI HANDLE WINAPI GetStdHandle(DWORD nStdHandle);
1385 WINBASEAPI WINBOOL WINAPI SetStdHandle(DWORD nStdHandle,HANDLE hHandle);
1386 WINBASEAPI WINBOOL WINAPI WriteFile(HANDLE hFile,LPCVOID lpBuffer,DWORD nNumberOfBytesToWrite,LPDWORD lpNumberOfBytesWritten,LPOVERLAPPED lpOverlapped);
1387 WINBASEAPI WINBOOL WINAPI ReadFile(HANDLE hFile,LPVOID lpBuffer,DWORD nNumberOfBytesToRead,LPDWORD lpNumberOfBytesRead,LPOVERLAPPED lpOverlapped);
1388 WINBASEAPI WINBOOL WINAPI FlushFileBuffers(HANDLE hFile);
1389 WINBASEAPI WINBOOL WINAPI DeviceIoControl(HANDLE hDevice,DWORD dwIoControlCode,LPVOID lpInBuffer,DWORD nInBufferSize,LPVOID lpOutBuffer,DWORD nOutBufferSize,LPDWORD lpBytesReturned,LPOVERLAPPED lpOverlapped);
1390 WINBASEAPI WINBOOL WINAPI RequestDeviceWakeup(HANDLE hDevice);
1391 WINBASEAPI WINBOOL WINAPI CancelDeviceWakeupRequest(HANDLE hDevice);
1392 WINBASEAPI WINBOOL WINAPI GetDevicePowerState(HANDLE hDevice,WINBOOL *pfOn);
1393 WINBASEAPI WINBOOL WINAPI SetMessageWaitingIndicator(HANDLE hMsgIndicator,ULONG ulMsgCount);
1394 WINBASEAPI WINBOOL WINAPI SetEndOfFile(HANDLE hFile);
1395 WINBASEAPI DWORD WINAPI SetFilePointer(HANDLE hFile,LONG lDistanceToMove,PLONG lpDistanceToMoveHigh,DWORD dwMoveMethod);
1396 WINBASEAPI WINBOOL WINAPI SetFilePointerEx(HANDLE hFile,LARGE_INTEGER liDistanceToMove,PLARGE_INTEGER lpNewFilePointer,DWORD dwMoveMethod);
1397 WINBASEAPI WINBOOL WINAPI FindClose(HANDLE hFindFile);
1398 WINBASEAPI WINBOOL WINAPI GetFileTime(HANDLE hFile,LPFILETIME lpCreationTime,LPFILETIME lpLastAccessTime,LPFILETIME lpLastWriteTime);
1399 WINBASEAPI WINBOOL WINAPI SetFileTime(HANDLE hFile,CONST FILETIME *lpCreationTime,CONST FILETIME *lpLastAccessTime,CONST FILETIME *lpLastWriteTime);
1400 WINBASEAPI WINBOOL WINAPI SetFileValidData(HANDLE hFile,LONGLONG ValidDataLength);
1401 WINBASEAPI WINBOOL WINAPI SetFileShortNameA(HANDLE hFile,LPCSTR lpShortName);
1402 WINBASEAPI WINBOOL WINAPI SetFileShortNameW(HANDLE hFile,LPCWSTR lpShortName);
1403 WINBASEAPI WINBOOL WINAPI CloseHandle(HANDLE hObject);
1404 WINBASEAPI WINBOOL WINAPI DuplicateHandle(HANDLE hSourceProcessHandle,HANDLE hSourceHandle,HANDLE hTargetProcessHandle,LPHANDLE lpTargetHandle,DWORD dwDesiredAccess,WINBOOL bInheritHandle,DWORD dwOptions);
1405 WINBASEAPI WINBOOL WINAPI GetHandleInformation(HANDLE hObject,LPDWORD lpdwFlags);
1406 WINBASEAPI WINBOOL WINAPI SetHandleInformation(HANDLE hObject,DWORD dwMask,DWORD dwFlags);
1407
1408#define HANDLE_FLAG_INHERIT 0x1
1409#define HANDLE_FLAG_PROTECT_FROM_CLOSE 0x2
1410
1411#define HINSTANCE_ERROR 32
1412
1413 WINBASEAPI DWORD WINAPI LoadModule(LPCSTR lpModuleName,LPVOID lpParameterBlock);
1414 WINBASEAPI UINT WINAPI WinExec(LPCSTR lpCmdLine,UINT uCmdShow);
1415 WINBASEAPI WINBOOL WINAPI ClearCommBreak(HANDLE hFile);
1416 WINBASEAPI WINBOOL WINAPI ClearCommError(HANDLE hFile,LPDWORD lpErrors,LPCOMSTAT lpStat);
1417 WINBASEAPI WINBOOL WINAPI SetupComm(HANDLE hFile,DWORD dwInQueue,DWORD dwOutQueue);
1418 WINBASEAPI WINBOOL WINAPI EscapeCommFunction(HANDLE hFile,DWORD dwFunc);
1419 WINBASEAPI WINBOOL WINAPI GetCommConfig(HANDLE hCommDev,LPCOMMCONFIG lpCC,LPDWORD lpdwSize);
1420 WINBASEAPI WINBOOL WINAPI GetCommMask(HANDLE hFile,LPDWORD lpEvtMask);
1421 WINBASEAPI WINBOOL WINAPI GetCommProperties(HANDLE hFile,LPCOMMPROP lpCommProp);
1422 WINBASEAPI WINBOOL WINAPI GetCommModemStatus(HANDLE hFile,LPDWORD lpModemStat);
1423 WINBASEAPI WINBOOL WINAPI GetCommState(HANDLE hFile,LPDCB lpDCB);
1424 WINBASEAPI WINBOOL WINAPI GetCommTimeouts(HANDLE hFile,LPCOMMTIMEOUTS lpCommTimeouts);
1425 WINBASEAPI WINBOOL WINAPI PurgeComm(HANDLE hFile,DWORD dwFlags);
1426 WINBASEAPI WINBOOL WINAPI SetCommBreak(HANDLE hFile);
1427 WINBASEAPI WINBOOL WINAPI SetCommConfig(HANDLE hCommDev,LPCOMMCONFIG lpCC,DWORD dwSize);
1428 WINBASEAPI WINBOOL WINAPI SetCommMask(HANDLE hFile,DWORD dwEvtMask);
1429 WINBASEAPI WINBOOL WINAPI SetCommState(HANDLE hFile,LPDCB lpDCB);
1430 WINBASEAPI WINBOOL WINAPI SetCommTimeouts(HANDLE hFile,LPCOMMTIMEOUTS lpCommTimeouts);
1431 WINBASEAPI WINBOOL WINAPI TransmitCommChar(HANDLE hFile,char cChar);
1432 WINBASEAPI WINBOOL WINAPI WaitCommEvent(HANDLE hFile,LPDWORD lpEvtMask,LPOVERLAPPED lpOverlapped);
1433 WINBASEAPI DWORD WINAPI SetTapePosition(HANDLE hDevice,DWORD dwPositionMethod,DWORD dwPartition,DWORD dwOffsetLow,DWORD dwOffsetHigh,WINBOOL bImmediate);
1434 WINBASEAPI DWORD WINAPI GetTapePosition(HANDLE hDevice,DWORD dwPositionType,LPDWORD lpdwPartition,LPDWORD lpdwOffsetLow,LPDWORD lpdwOffsetHigh);
1435 WINBASEAPI DWORD WINAPI PrepareTape(HANDLE hDevice,DWORD dwOperation,WINBOOL bImmediate);
1436 WINBASEAPI DWORD WINAPI EraseTape(HANDLE hDevice,DWORD dwEraseType,WINBOOL bImmediate);
1437 WINBASEAPI DWORD WINAPI CreateTapePartition(HANDLE hDevice,DWORD dwPartitionMethod,DWORD dwCount,DWORD dwSize);
1438 WINBASEAPI DWORD WINAPI WriteTapemark(HANDLE hDevice,DWORD dwTapemarkType,DWORD dwTapemarkCount,WINBOOL bImmediate);
1439 WINBASEAPI DWORD WINAPI GetTapeStatus(HANDLE hDevice);
1440 WINBASEAPI DWORD WINAPI GetTapeParameters(HANDLE hDevice,DWORD dwOperation,LPDWORD lpdwSize,LPVOID lpTapeInformation);
1441
1442#define GET_TAPE_MEDIA_INFORMATION 0
1443#define GET_TAPE_DRIVE_INFORMATION 1
1444
1445 WINBASEAPI DWORD WINAPI SetTapeParameters(HANDLE hDevice,DWORD dwOperation,LPVOID lpTapeInformation);
1446
1447#define SET_TAPE_MEDIA_INFORMATION 0
1448#define SET_TAPE_DRIVE_INFORMATION 1
1449
1450 WINBASEAPI WINBOOL WINAPI Beep(DWORD dwFreq,DWORD dwDuration);
1451 WINBASEAPI int WINAPI MulDiv(int nNumber,int nNumerator,int nDenominator);
1452 WINBASEAPI VOID WINAPI GetSystemTime(LPSYSTEMTIME lpSystemTime);
1453 WINBASEAPI VOID WINAPI GetSystemTimeAsFileTime(LPFILETIME lpSystemTimeAsFileTime);
1454 WINBASEAPI WINBOOL WINAPI SetSystemTime(CONST SYSTEMTIME *lpSystemTime);
1455 WINBASEAPI VOID WINAPI GetLocalTime(LPSYSTEMTIME lpSystemTime);
1456 WINBASEAPI WINBOOL WINAPI SetLocalTime(CONST SYSTEMTIME *lpSystemTime);
1457 WINBASEAPI VOID WINAPI GetSystemInfo(LPSYSTEM_INFO lpSystemInfo);
1458 WINBASEAPI WINBOOL WINAPI SetSystemFileCacheSize(SIZE_T MinimumFileCacheSize,SIZE_T MaximumFileCacheSize,DWORD Flags);
1459 WINBASEAPI WINBOOL WINAPI GetSystemFileCacheSize(PSIZE_T lpMinimumFileCacheSize,PSIZE_T lpMaximumFileCacheSize,PDWORD lpFlags);
1460 WINBASEAPI WINBOOL WINAPI GetSystemRegistryQuota(PDWORD pdwQuotaAllowed,PDWORD pdwQuotaUsed);
1461 WINBOOL WINAPI GetSystemTimes(LPFILETIME lpIdleTime,LPFILETIME lpKernelTime,LPFILETIME lpUserTime);
1462 WINBASEAPI VOID WINAPI GetNativeSystemInfo(LPSYSTEM_INFO lpSystemInfo);
1463 WINBASEAPI WINBOOL WINAPI IsProcessorFeaturePresent(DWORD ProcessorFeature);
1464
1465 typedef struct _TIME_ZONE_INFORMATION {
1466 LONG Bias;
1467 WCHAR StandardName[32];
1468 SYSTEMTIME StandardDate;
1469 LONG StandardBias;
1470 WCHAR DaylightName[32];
1471 SYSTEMTIME DaylightDate;
1472 LONG DaylightBias;
1473 } TIME_ZONE_INFORMATION,*PTIME_ZONE_INFORMATION,*LPTIME_ZONE_INFORMATION;
1474
1475#ifdef UNICODE
1476#define FormatMessage FormatMessageW
1477#else
1478#define FormatMessage FormatMessageA
1479#endif
1480
1481 WINBASEAPI WINBOOL WINAPI SystemTimeToTzSpecificLocalTime(LPTIME_ZONE_INFORMATION lpTimeZoneInformation,LPSYSTEMTIME lpUniversalTime,LPSYSTEMTIME lpLocalTime);
1482 WINBASEAPI WINBOOL WINAPI TzSpecificLocalTimeToSystemTime(LPTIME_ZONE_INFORMATION lpTimeZoneInformation,LPSYSTEMTIME lpLocalTime,LPSYSTEMTIME lpUniversalTime);
1483 WINBASEAPI DWORD WINAPI GetTimeZoneInformation(LPTIME_ZONE_INFORMATION lpTimeZoneInformation);
1484 WINBASEAPI WINBOOL WINAPI SetTimeZoneInformation(CONST TIME_ZONE_INFORMATION *lpTimeZoneInformation);
1485 WINBASEAPI WINBOOL WINAPI SystemTimeToFileTime(CONST SYSTEMTIME *lpSystemTime,LPFILETIME lpFileTime);
1486 WINBASEAPI WINBOOL WINAPI FileTimeToLocalFileTime(CONST FILETIME *lpFileTime,LPFILETIME lpLocalFileTime);
1487 WINBASEAPI WINBOOL WINAPI LocalFileTimeToFileTime(CONST FILETIME *lpLocalFileTime,LPFILETIME lpFileTime);
1488 WINBASEAPI WINBOOL WINAPI FileTimeToSystemTime(CONST FILETIME *lpFileTime,LPSYSTEMTIME lpSystemTime);
1489 WINBASEAPI LONG WINAPI CompareFileTime(CONST FILETIME *lpFileTime1,CONST FILETIME *lpFileTime2);
1490 WINBASEAPI WINBOOL WINAPI FileTimeToDosDateTime(CONST FILETIME *lpFileTime,LPWORD lpFatDate,LPWORD lpFatTime);
1491 WINBASEAPI WINBOOL WINAPI DosDateTimeToFileTime(WORD wFatDate,WORD wFatTime,LPFILETIME lpFileTime);
1492 WINBASEAPI DWORD WINAPI GetTickCount(VOID);
1493 WINBASEAPI WINBOOL WINAPI SetSystemTimeAdjustment(DWORD dwTimeAdjustment,WINBOOL bTimeAdjustmentDisabled);
1494 WINBASEAPI WINBOOL WINAPI GetSystemTimeAdjustment(PDWORD lpTimeAdjustment,PDWORD lpTimeIncrement,PBOOL lpTimeAdjustmentDisabled);
1495 WINBASEAPI DWORD WINAPI FormatMessageA(DWORD dwFlags,LPCVOID lpSource,DWORD dwMessageId,DWORD dwLanguageId,LPSTR lpBuffer,DWORD nSize,va_list *Arguments);
1496 WINBASEAPI DWORD WINAPI FormatMessageW(DWORD dwFlags,LPCVOID lpSource,DWORD dwMessageId,DWORD dwLanguageId,LPWSTR lpBuffer,DWORD nSize,va_list *Arguments);
1497
1498#define FORMAT_MESSAGE_ALLOCATE_BUFFER 0x100
1499#define FORMAT_MESSAGE_IGNORE_INSERTS 0x200
1500#define FORMAT_MESSAGE_FROM_STRING 0x400
1501#define FORMAT_MESSAGE_FROM_HMODULE 0x800
1502#define FORMAT_MESSAGE_FROM_SYSTEM 0x1000
1503#define FORMAT_MESSAGE_ARGUMENT_ARRAY 0x2000
1504#define FORMAT_MESSAGE_MAX_WIDTH_MASK 0xff
1574 1505
1575#ifdef UNICODE1506#ifdef UNICODE
1576typedef STARTUPINFOW STARTUPINFO,*LPSTARTUPINFO;
1577typedef WIN32_FIND_DATAW WIN32_FIND_DATA,*LPWIN32_FIND_DATA;
1578typedef HW_PROFILE_INFOW HW_PROFILE_INFO,*LPHW_PROFILE_INFO;
1579#define AccessCheckAndAuditAlarm AccessCheckAndAuditAlarmW
1580#define AddAtom AddAtomW
1581#define BackupEventLog BackupEventLogW
1582#define BeginUpdateResource BeginUpdateResourceW
1583#define BuildCommDCB BuildCommDCBW
1584#define BuildCommDCBAndTimeouts BuildCommDCBAndTimeoutsW
1585#define CallNamedPipe CallNamedPipeW
1586#define ClearEventLog ClearEventLogW
1587#define CommConfigDialog CommConfigDialogW
1588#define CopyFile CopyFileW
1589#define CopyFileEx CopyFileExW
1590#define CreateDirectory CreateDirectoryW
1591#define CreateDirectoryEx CreateDirectoryExW
1592#define CreateEvent CreateEventW
1593#define CreateFile CreateFileW
1594#define CreateFileMapping CreateFileMappingW
1595#define CreateHardLink CreateHardLinkW
1596#define CreateMailslot CreateMailslotW1507#define CreateMailslot CreateMailslotW
1508#define EncryptFile EncryptFileW
1509#define DecryptFile DecryptFileW
1510#define FileEncryptionStatus FileEncryptionStatusW
1511#else
1512#define CreateMailslot CreateMailslotA
1513#define EncryptFile EncryptFileA
1514#define DecryptFile DecryptFileA
1515#define FileEncryptionStatus FileEncryptionStatusA
1516#endif
1517
1518 WINBASEAPI WINBOOL WINAPI CreatePipe(PHANDLE hReadPipe,PHANDLE hWritePipe,LPSECURITY_ATTRIBUTES lpPipeAttributes,DWORD nSize);
1519 WINBASEAPI WINBOOL WINAPI ConnectNamedPipe(HANDLE hNamedPipe,LPOVERLAPPED lpOverlapped);
1520 WINBASEAPI WINBOOL WINAPI DisconnectNamedPipe(HANDLE hNamedPipe);
1521 WINBASEAPI WINBOOL WINAPI SetNamedPipeHandleState(HANDLE hNamedPipe,LPDWORD lpMode,LPDWORD lpMaxCollectionCount,LPDWORD lpCollectDataTimeout);
1522 WINBASEAPI WINBOOL WINAPI GetNamedPipeInfo(HANDLE hNamedPipe,LPDWORD lpFlags,LPDWORD lpOutBufferSize,LPDWORD lpInBufferSize,LPDWORD lpMaxInstances);
1523 WINBASEAPI WINBOOL WINAPI PeekNamedPipe(HANDLE hNamedPipe,LPVOID lpBuffer,DWORD nBufferSize,LPDWORD lpBytesRead,LPDWORD lpTotalBytesAvail,LPDWORD lpBytesLeftThisMessage);
1524 WINBASEAPI WINBOOL WINAPI TransactNamedPipe(HANDLE hNamedPipe,LPVOID lpInBuffer,DWORD nInBufferSize,LPVOID lpOutBuffer,DWORD nOutBufferSize,LPDWORD lpBytesRead,LPOVERLAPPED lpOverlapped);
1525 WINBASEAPI HANDLE WINAPI CreateMailslotA(LPCSTR lpName,DWORD nMaxMessageSize,DWORD lReadTimeout,LPSECURITY_ATTRIBUTES lpSecurityAttributes);
1526 WINBASEAPI HANDLE WINAPI CreateMailslotW(LPCWSTR lpName,DWORD nMaxMessageSize,DWORD lReadTimeout,LPSECURITY_ATTRIBUTES lpSecurityAttributes);
1527 WINBASEAPI WINBOOL WINAPI GetMailslotInfo(HANDLE hMailslot,LPDWORD lpMaxMessageSize,LPDWORD lpNextSize,LPDWORD lpMessageCount,LPDWORD lpReadTimeout);
1528 WINBASEAPI WINBOOL WINAPI SetMailslotInfo(HANDLE hMailslot,DWORD lReadTimeout);
1529 WINBASEAPI LPVOID WINAPI MapViewOfFile(HANDLE hFileMappingObject,DWORD dwDesiredAccess,DWORD dwFileOffsetHigh,DWORD dwFileOffsetLow,SIZE_T dwNumberOfBytesToMap);
1530 WINBASEAPI WINBOOL WINAPI FlushViewOfFile(LPCVOID lpBaseAddress,SIZE_T dwNumberOfBytesToFlush);
1531 WINBASEAPI WINBOOL WINAPI UnmapViewOfFile(LPCVOID lpBaseAddress);
1532 WINADVAPI WINBOOL WINAPI EncryptFileA(LPCSTR lpFileName);
1533 WINADVAPI WINBOOL WINAPI EncryptFileW(LPCWSTR lpFileName);
1534 WINADVAPI WINBOOL WINAPI DecryptFileA(LPCSTR lpFileName,DWORD dwReserved);
1535 WINADVAPI WINBOOL WINAPI DecryptFileW(LPCWSTR lpFileName,DWORD dwReserved);
1536
1537#define FILE_ENCRYPTABLE 0
1538#define FILE_IS_ENCRYPTED 1
1539#define FILE_SYSTEM_ATTR 2
1540#define FILE_ROOT_DIR 3
1541#define FILE_SYSTEM_DIR 4
1542#define FILE_UNKNOWN 5
1543#define FILE_SYSTEM_NOT_SUPPORT 6
1544#define FILE_USER_DISALLOWED 7
1545#define FILE_READ_ONLY 8
1546#define FILE_DIR_DISALLOWED 9
1547
1548 WINADVAPI WINBOOL WINAPI FileEncryptionStatusA(LPCSTR lpFileName,LPDWORD lpStatus);
1549 WINADVAPI WINBOOL WINAPI FileEncryptionStatusW(LPCWSTR lpFileName,LPDWORD lpStatus);
1550
1551#define EFS_USE_RECOVERY_KEYS (0x1)
1552
1553 typedef DWORD (WINAPI *PFE_EXPORT_FUNC)(PBYTE pbData,PVOID pvCallbackContext,ULONG ulLength);
1554 typedef DWORD (WINAPI *PFE_IMPORT_FUNC)(PBYTE pbData,PVOID pvCallbackContext,PULONG ulLength);
1555
1556#define CREATE_FOR_IMPORT (1)
1557#define CREATE_FOR_DIR (2)
1558#define OVERWRITE_HIDDEN (4)
1559
1560#ifdef UNICODE
1561#define OpenEncryptedFileRaw OpenEncryptedFileRawW
1562#define lstrcmp lstrcmpW
1563#define lstrcmpi lstrcmpiW
1564#define lstrcpyn lstrcpynW
1565#define lstrcpy lstrcpyW
1566#define lstrcat lstrcatW
1567#define lstrlen lstrlenW
1568#else
1569#define OpenEncryptedFileRaw OpenEncryptedFileRawA
1570#define lstrcmp lstrcmpA
1571#define lstrcmpi lstrcmpiA
1572#define lstrcpyn lstrcpynA
1573#define lstrcpy lstrcpyA
1574#define lstrcat lstrcatA
1575#define lstrlen lstrlenA
1576#endif
1577
1578 WINADVAPI DWORD WINAPI OpenEncryptedFileRawA(LPCSTR lpFileName,ULONG ulFlags,PVOID *pvContext);
1579 WINADVAPI DWORD WINAPI OpenEncryptedFileRawW(LPCWSTR lpFileName,ULONG ulFlags,PVOID *pvContext);
1580 WINADVAPI DWORD WINAPI ReadEncryptedFileRaw(PFE_EXPORT_FUNC pfExportCallback,PVOID pvCallbackContext,PVOID pvContext);
1581 WINADVAPI DWORD WINAPI WriteEncryptedFileRaw(PFE_IMPORT_FUNC pfImportCallback,PVOID pvCallbackContext,PVOID pvContext);
1582 WINADVAPI VOID WINAPI CloseEncryptedFileRaw(PVOID pvContext);
1583 WINBASEAPI int WINAPI lstrcmpA(LPCSTR lpString1,LPCSTR lpString2);
1584 WINBASEAPI int WINAPI lstrcmpW(LPCWSTR lpString1,LPCWSTR lpString2);
1585 WINBASEAPI int WINAPI lstrcmpiA(LPCSTR lpString1,LPCSTR lpString2);
1586 WINBASEAPI int WINAPI lstrcmpiW(LPCWSTR lpString1,LPCWSTR lpString2);
1587 WINBASEAPI LPSTR WINAPI lstrcpynA(LPSTR lpString1,LPCSTR lpString2,int iMaxLength);
1588 WINBASEAPI LPWSTR WINAPI lstrcpynW(LPWSTR lpString1,LPCWSTR lpString2,int iMaxLength);
1589 WINBASEAPI LPSTR WINAPI lstrcpyA(LPSTR lpString1,LPCSTR lpString2);
1590 WINBASEAPI LPWSTR WINAPI lstrcpyW(LPWSTR lpString1,LPCWSTR lpString2);
1591 WINBASEAPI LPSTR WINAPI lstrcatA(LPSTR lpString1,LPCSTR lpString2);
1592 WINBASEAPI LPWSTR WINAPI lstrcatW(LPWSTR lpString1,LPCWSTR lpString2);
1593 WINBASEAPI int WINAPI lstrlenA(LPCSTR lpString);
1594 WINBASEAPI int WINAPI lstrlenW(LPCWSTR lpString);
1595 WINBASEAPI HFILE WINAPI OpenFile(LPCSTR lpFileName,LPOFSTRUCT lpReOpenBuff,UINT uStyle);
1596 WINBASEAPI HFILE WINAPI _lopen(LPCSTR lpPathName,int iReadWrite);
1597 WINBASEAPI HFILE WINAPI _lcreat(LPCSTR lpPathName,int iAttribute);
1598 WINBASEAPI UINT WINAPI _lread(HFILE hFile,LPVOID lpBuffer,UINT uBytes);
1599 WINBASEAPI UINT WINAPI _lwrite(HFILE hFile,LPCCH lpBuffer,UINT uBytes);
1600 WINBASEAPI long WINAPI _hread(HFILE hFile,LPVOID lpBuffer,long lBytes);
1601 WINBASEAPI long WINAPI _hwrite(HFILE hFile,LPCCH lpBuffer,long lBytes);
1602 WINBASEAPI HFILE WINAPI _lclose(HFILE hFile);
1603 WINBASEAPI LONG WINAPI _llseek(HFILE hFile,LONG lOffset,int iOrigin);
1604 WINADVAPI WINBOOL WINAPI IsTextUnicode(CONST VOID *lpv,int iSize,LPINT lpiResult);
1605
1606#define FLS_OUT_OF_INDEXES ((DWORD)0xffffffff)
1607
1608 WINBASEAPI DWORD WINAPI FlsAlloc(PFLS_CALLBACK_FUNCTION lpCallback);
1609 WINBASEAPI PVOID WINAPI FlsGetValue(DWORD dwFlsIndex);
1610 WINBASEAPI WINBOOL WINAPI FlsSetValue(DWORD dwFlsIndex,PVOID lpFlsData);
1611 WINBASEAPI WINBOOL WINAPI FlsFree(DWORD dwFlsIndex);
1612
1613#define TLS_OUT_OF_INDEXES ((DWORD)0xffffffff)
1614
1615 WINBASEAPI DWORD WINAPI TlsAlloc(VOID);
1616 WINBASEAPI LPVOID WINAPI TlsGetValue(DWORD dwTlsIndex);
1617 WINBASEAPI WINBOOL WINAPI TlsSetValue(DWORD dwTlsIndex,LPVOID lpTlsValue);
1618 WINBASEAPI WINBOOL WINAPI TlsFree(DWORD dwTlsIndex);
1619
1620 typedef VOID (WINAPI *LPOVERLAPPED_COMPLETION_ROUTINE)(DWORD dwErrorCode,DWORD dwNumberOfBytesTransfered,LPOVERLAPPED lpOverlapped);
1621
1622 WINBASEAPI DWORD WINAPI SleepEx(DWORD dwMilliseconds,WINBOOL bAlertable);
1623 WINBASEAPI DWORD WINAPI WaitForSingleObjectEx(HANDLE hHandle,DWORD dwMilliseconds,WINBOOL bAlertable);
1624 WINBASEAPI DWORD WINAPI WaitForMultipleObjectsEx(DWORD nCount,CONST HANDLE *lpHandles,WINBOOL bWaitAll,DWORD dwMilliseconds,WINBOOL bAlertable);
1625 WINBASEAPI DWORD WINAPI SignalObjectAndWait(HANDLE hObjectToSignal,HANDLE hObjectToWaitOn,DWORD dwMilliseconds,WINBOOL bAlertable);
1626 WINBASEAPI WINBOOL WINAPI ReadFileEx(HANDLE hFile,LPVOID lpBuffer,DWORD nNumberOfBytesToRead,LPOVERLAPPED lpOverlapped,LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
1627 WINBASEAPI WINBOOL WINAPI WriteFileEx(HANDLE hFile,LPCVOID lpBuffer,DWORD nNumberOfBytesToWrite,LPOVERLAPPED lpOverlapped,LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
1628 WINBASEAPI WINBOOL WINAPI BackupRead(HANDLE hFile,LPBYTE lpBuffer,DWORD nNumberOfBytesToRead,LPDWORD lpNumberOfBytesRead,WINBOOL bAbort,WINBOOL bProcessSecurity,LPVOID *lpContext);
1629 WINBASEAPI WINBOOL WINAPI BackupSeek(HANDLE hFile,DWORD dwLowBytesToSeek,DWORD dwHighBytesToSeek,LPDWORD lpdwLowByteSeeked,LPDWORD lpdwHighByteSeeked,LPVOID *lpContext);
1630 WINBASEAPI WINBOOL WINAPI BackupWrite(HANDLE hFile,LPBYTE lpBuffer,DWORD nNumberOfBytesToWrite,LPDWORD lpNumberOfBytesWritten,WINBOOL bAbort,WINBOOL bProcessSecurity,LPVOID *lpContext);
1631
1632 typedef struct _WIN32_STREAM_ID {
1633 DWORD dwStreamId;
1634 DWORD dwStreamAttributes;
1635 LARGE_INTEGER Size;
1636 DWORD dwStreamNameSize;
1637 WCHAR cStreamName[ANYSIZE_ARRAY];
1638 } WIN32_STREAM_ID,*LPWIN32_STREAM_ID;
1639
1640#define BACKUP_INVALID 0x0
1641#define BACKUP_DATA 0x1
1642#define BACKUP_EA_DATA 0x2
1643#define BACKUP_SECURITY_DATA 0x3
1644#define BACKUP_ALTERNATE_DATA 0x4
1645#define BACKUP_LINK 0x5
1646#define BACKUP_PROPERTY_DATA 0x6
1647#define BACKUP_OBJECT_ID 0x7
1648#define BACKUP_REPARSE_DATA 0x8
1649#define BACKUP_SPARSE_BLOCK 0x9
1650
1651#define STREAM_NORMAL_ATTRIBUTE 0x0
1652#define STREAM_MODIFIED_WHEN_READ 0x1
1653#define STREAM_CONTAINS_SECURITY 0x2
1654#define STREAM_CONTAINS_PROPERTIES 0x4
1655#define STREAM_SPARSE_ATTRIBUTE 0x8
1656
1657 WINBASEAPI WINBOOL WINAPI ReadFileScatter(HANDLE hFile,FILE_SEGMENT_ELEMENT aSegmentArray[],DWORD nNumberOfBytesToRead,LPDWORD lpReserved,LPOVERLAPPED lpOverlapped);
1658 WINBASEAPI WINBOOL WINAPI WriteFileGather(HANDLE hFile,FILE_SEGMENT_ELEMENT aSegmentArray[],DWORD nNumberOfBytesToWrite,LPDWORD lpReserved,LPOVERLAPPED lpOverlapped);
1659
1660#define STARTF_USESHOWWINDOW 0x1
1661#define STARTF_USESIZE 0x2
1662#define STARTF_USEPOSITION 0x4
1663#define STARTF_USECOUNTCHARS 0x8
1664#define STARTF_USEFILLATTRIBUTE 0x10
1665#define STARTF_RUNFULLSCREEN 0x20
1666#define STARTF_FORCEONFEEDBACK 0x40
1667#define STARTF_FORCEOFFFEEDBACK 0x80
1668#define STARTF_USESTDHANDLES 0x100
1669
1670#define STARTF_USEHOTKEY 0x200
1671
1672 typedef struct _STARTUPINFOA {
1673 DWORD cb;
1674 LPSTR lpReserved;
1675 LPSTR lpDesktop;
1676 LPSTR lpTitle;
1677 DWORD dwX;
1678 DWORD dwY;
1679 DWORD dwXSize;
1680 DWORD dwYSize;
1681 DWORD dwXCountChars;
1682 DWORD dwYCountChars;
1683 DWORD dwFillAttribute;
1684 DWORD dwFlags;
1685 WORD wShowWindow;
1686 WORD cbReserved2;
1687 LPBYTE lpReserved2;
1688 HANDLE hStdInput;
1689 HANDLE hStdOutput;
1690 HANDLE hStdError;
1691 } STARTUPINFOA,*LPSTARTUPINFOA;
1692
1693 typedef struct _STARTUPINFOW {
1694 DWORD cb;
1695 LPWSTR lpReserved;
1696 LPWSTR lpDesktop;
1697 LPWSTR lpTitle;
1698 DWORD dwX;
1699 DWORD dwY;
1700 DWORD dwXSize;
1701 DWORD dwYSize;
1702 DWORD dwXCountChars;
1703 DWORD dwYCountChars;
1704 DWORD dwFillAttribute;
1705 DWORD dwFlags;
1706 WORD wShowWindow;
1707 WORD cbReserved2;
1708 LPBYTE lpReserved2;
1709 HANDLE hStdInput;
1710 HANDLE hStdOutput;
1711 HANDLE hStdError;
1712 } STARTUPINFOW,*LPSTARTUPINFOW;
1713
1714#ifdef UNICODE
1715 typedef STARTUPINFOW STARTUPINFO;
1716 typedef LPSTARTUPINFOW LPSTARTUPINFO;
1717#else
1718 typedef STARTUPINFOA STARTUPINFO;
1719 typedef LPSTARTUPINFOA LPSTARTUPINFO;
1720#endif
1721
1722#define SHUTDOWN_NORETRY 0x1
1723
1724 typedef struct _WIN32_FIND_DATAA {
1725 DWORD dwFileAttributes;
1726 FILETIME ftCreationTime;
1727 FILETIME ftLastAccessTime;
1728 FILETIME ftLastWriteTime;
1729 DWORD nFileSizeHigh;
1730 DWORD nFileSizeLow;
1731 DWORD dwReserved0;
1732 DWORD dwReserved1;
1733 CHAR cFileName[MAX_PATH];
1734 CHAR cAlternateFileName[14];
1735 } WIN32_FIND_DATAA,*PWIN32_FIND_DATAA,*LPWIN32_FIND_DATAA;
1736
1737 typedef struct _WIN32_FIND_DATAW {
1738 DWORD dwFileAttributes;
1739 FILETIME ftCreationTime;
1740 FILETIME ftLastAccessTime;
1741 FILETIME ftLastWriteTime;
1742 DWORD nFileSizeHigh;
1743 DWORD nFileSizeLow;
1744 DWORD dwReserved0;
1745 DWORD dwReserved1;
1746 WCHAR cFileName[MAX_PATH];
1747 WCHAR cAlternateFileName[14];
1748 } WIN32_FIND_DATAW,*PWIN32_FIND_DATAW,*LPWIN32_FIND_DATAW;
1749
1750#ifdef UNICODE
1751 typedef WIN32_FIND_DATAW WIN32_FIND_DATA;
1752 typedef PWIN32_FIND_DATAW PWIN32_FIND_DATA;
1753 typedef LPWIN32_FIND_DATAW LPWIN32_FIND_DATA;
1754#else
1755 typedef WIN32_FIND_DATAA WIN32_FIND_DATA;
1756 typedef PWIN32_FIND_DATAA PWIN32_FIND_DATA;
1757 typedef LPWIN32_FIND_DATAA LPWIN32_FIND_DATA;
1758#endif
1759
1760 typedef struct _WIN32_FILE_ATTRIBUTE_DATA {
1761 DWORD dwFileAttributes;
1762 FILETIME ftCreationTime;
1763 FILETIME ftLastAccessTime;
1764 FILETIME ftLastWriteTime;
1765 DWORD nFileSizeHigh;
1766 DWORD nFileSizeLow;
1767 } WIN32_FILE_ATTRIBUTE_DATA,*LPWIN32_FILE_ATTRIBUTE_DATA;
1768
1769#ifdef UNICODE
1597#define CreateMutex CreateMutexW1770#define CreateMutex CreateMutexW
1598#define CreateNamedPipe CreateNamedPipeW1771#define OpenMutex OpenMutexW
1599#define CreateProcess CreateProcessW1772#define CreateEvent CreateEventW
1600#define CreateProcessAsUser CreateProcessAsUserW1773#define OpenEvent OpenEventW
1601#define CreateSemaphore CreateSemaphoreW1774#define CreateSemaphore CreateSemaphoreW
1775#define OpenSemaphore OpenSemaphoreW
1776#else
1777#define CreateMutex CreateMutexA
1778#define OpenMutex OpenMutexA
1779#define CreateEvent CreateEventA
1780#define OpenEvent OpenEventA
1781#define CreateSemaphore CreateSemaphoreA
1782#define OpenSemaphore OpenSemaphoreA
1783#endif
1784
1785 WINBASEAPI HANDLE WINAPI CreateMutexA(LPSECURITY_ATTRIBUTES lpMutexAttributes,WINBOOL bInitialOwner,LPCSTR lpName);
1786 WINBASEAPI HANDLE WINAPI CreateMutexW(LPSECURITY_ATTRIBUTES lpMutexAttributes,WINBOOL bInitialOwner,LPCWSTR lpName);
1787 WINBASEAPI HANDLE WINAPI OpenMutexA(DWORD dwDesiredAccess,WINBOOL bInheritHandle,LPCSTR lpName);
1788 WINBASEAPI HANDLE WINAPI OpenMutexW(DWORD dwDesiredAccess,WINBOOL bInheritHandle,LPCWSTR lpName);
1789 WINBASEAPI HANDLE WINAPI CreateEventA(LPSECURITY_ATTRIBUTES lpEventAttributes,WINBOOL bManualReset,WINBOOL bInitialState,LPCSTR lpName);
1790 WINBASEAPI HANDLE WINAPI CreateEventW(LPSECURITY_ATTRIBUTES lpEventAttributes,WINBOOL bManualReset,WINBOOL bInitialState,LPCWSTR lpName);
1791 WINBASEAPI HANDLE WINAPI OpenEventA(DWORD dwDesiredAccess,WINBOOL bInheritHandle,LPCSTR lpName);
1792 WINBASEAPI HANDLE WINAPI OpenEventW(DWORD dwDesiredAccess,WINBOOL bInheritHandle,LPCWSTR lpName);
1793 WINBASEAPI HANDLE WINAPI CreateSemaphoreA(LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,LONG lInitialCount,LONG lMaximumCount,LPCSTR lpName);
1794 WINBASEAPI HANDLE WINAPI CreateSemaphoreW(LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,LONG lInitialCount,LONG lMaximumCount,LPCWSTR lpName);
1795 WINBASEAPI HANDLE WINAPI OpenSemaphoreA(DWORD dwDesiredAccess,WINBOOL bInheritHandle,LPCSTR lpName);
1796 WINBASEAPI HANDLE WINAPI OpenSemaphoreW(DWORD dwDesiredAccess,WINBOOL bInheritHandle,LPCWSTR lpName);
1797
1798 typedef VOID (WINAPI *PTIMERAPCROUTINE)(LPVOID lpArgToCompletionRoutine,DWORD dwTimerLowValue,DWORD dwTimerHighValue);
1799
1800#ifdef UNICODE
1602#define CreateWaitableTimer CreateWaitableTimerW1801#define CreateWaitableTimer CreateWaitableTimerW
1603#define DefineDosDevice DefineDosDeviceW1802#define OpenWaitableTimer OpenWaitableTimerW
1604#define DeleteFile DeleteFileW1803#define CreateFileMapping CreateFileMappingW
1605#define EndUpdateResource EndUpdateResourceW1804#define OpenFileMapping OpenFileMappingW
1606#define EnumResourceLanguages EnumResourceLanguagesW1805#define GetLogicalDriveStrings GetLogicalDriveStringsW
1607#define EnumResourceNames EnumResourceNamesW1806#define LoadLibrary LoadLibraryW
1608#define EnumResourceTypes EnumResourceTypesW1807#define LoadLibraryEx LoadLibraryExW
1609#define ExpandEnvironmentStrings ExpandEnvironmentStringsW1808#define GetModuleFileName GetModuleFileNameW
1809#define GetModuleHandle GetModuleHandleW
1810#else
1811#define CreateWaitableTimer CreateWaitableTimerA
1812#define OpenWaitableTimer OpenWaitableTimerA
1813#define CreateFileMapping CreateFileMappingA
1814#define OpenFileMapping OpenFileMappingA
1815#define GetLogicalDriveStrings GetLogicalDriveStringsA
1816#define LoadLibrary LoadLibraryA
1817#define LoadLibraryEx LoadLibraryExA
1818#define GetModuleFileName GetModuleFileNameA
1819#define GetModuleHandle GetModuleHandleA
1820#endif
1821
1822 WINBASEAPI HANDLE WINAPI CreateWaitableTimerA(LPSECURITY_ATTRIBUTES lpTimerAttributes,WINBOOL bManualReset,LPCSTR lpTimerName);
1823 WINBASEAPI HANDLE WINAPI CreateWaitableTimerW(LPSECURITY_ATTRIBUTES lpTimerAttributes,WINBOOL bManualReset,LPCWSTR lpTimerName);
1824 WINBASEAPI HANDLE WINAPI OpenWaitableTimerA(DWORD dwDesiredAccess,WINBOOL bInheritHandle,LPCSTR lpTimerName);
1825 WINBASEAPI HANDLE WINAPI OpenWaitableTimerW(DWORD dwDesiredAccess,WINBOOL bInheritHandle,LPCWSTR lpTimerName);
1826 WINBASEAPI WINBOOL WINAPI SetWaitableTimer(HANDLE hTimer,const LARGE_INTEGER *lpDueTime,LONG lPeriod,PTIMERAPCROUTINE pfnCompletionRoutine,LPVOID lpArgToCompletionRoutine,WINBOOL fResume);
1827 WINBASEAPI WINBOOL WINAPI CancelWaitableTimer(HANDLE hTimer);
1828 WINBASEAPI HANDLE WINAPI CreateFileMappingA(HANDLE hFile,LPSECURITY_ATTRIBUTES lpFileMappingAttributes,DWORD flProtect,DWORD dwMaximumSizeHigh,DWORD dwMaximumSizeLow,LPCSTR lpName);
1829 WINBASEAPI HANDLE WINAPI CreateFileMappingW(HANDLE hFile,LPSECURITY_ATTRIBUTES lpFileMappingAttributes,DWORD flProtect,DWORD dwMaximumSizeHigh,DWORD dwMaximumSizeLow,LPCWSTR lpName);
1830 WINBASEAPI HANDLE WINAPI OpenFileMappingA(DWORD dwDesiredAccess,WINBOOL bInheritHandle,LPCSTR lpName);
1831 WINBASEAPI HANDLE WINAPI OpenFileMappingW(DWORD dwDesiredAccess,WINBOOL bInheritHandle,LPCWSTR lpName);
1832 WINBASEAPI DWORD WINAPI GetLogicalDriveStringsA(DWORD nBufferLength,LPSTR lpBuffer);
1833 WINBASEAPI DWORD WINAPI GetLogicalDriveStringsW(DWORD nBufferLength,LPWSTR lpBuffer);
1834
1835 typedef enum _MEMORY_RESOURCE_NOTIFICATION_TYPE {
1836 LowMemoryResourceNotification,HighMemoryResourceNotification
1837 } MEMORY_RESOURCE_NOTIFICATION_TYPE;
1838
1839 WINBASEAPI HANDLE WINAPI CreateMemoryResourceNotification(MEMORY_RESOURCE_NOTIFICATION_TYPE NotificationType);
1840 WINBASEAPI WINBOOL WINAPI QueryMemoryResourceNotification(HANDLE ResourceNotificationHandle,PBOOL ResourceState);
1841 WINBASEAPI HMODULE WINAPI LoadLibraryA(LPCSTR lpLibFileName);
1842 WINBASEAPI HMODULE WINAPI LoadLibraryW(LPCWSTR lpLibFileName);
1843 WINBASEAPI HMODULE WINAPI LoadLibraryExA(LPCSTR lpLibFileName,HANDLE hFile,DWORD dwFlags);
1844 WINBASEAPI HMODULE WINAPI LoadLibraryExW(LPCWSTR lpLibFileName,HANDLE hFile,DWORD dwFlags);
1845
1846#define DONT_RESOLVE_DLL_REFERENCES 0x1
1847#define LOAD_LIBRARY_AS_DATAFILE 0x2
1848#define LOAD_WITH_ALTERED_SEARCH_PATH 0x8
1849#define LOAD_IGNORE_CODE_AUTHZ_LEVEL 0x10
1850#define LOAD_LINRARY_AS_IMAGE_RESOURCE 0x20
1851#define LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE 0x40
1852
1853 WINBASEAPI DWORD WINAPI GetModuleFileNameA(HMODULE hModule,LPCH lpFilename,DWORD nSize);
1854 WINBASEAPI DWORD WINAPI GetModuleFileNameW(HMODULE hModule,LPWCH lpFilename,DWORD nSize);
1855 WINBASEAPI HMODULE WINAPI GetModuleHandleA(LPCSTR lpModuleName);
1856 WINBASEAPI HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName);
1857
1858#ifndef RC_INVOKED
1859#define GET_MODULE_HANDLE_EX_FLAG_PIN (0x1)
1860#define GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT (0x2)
1861#define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS (0x4)
1862
1863 typedef WINBOOL (WINAPI *PGET_MODULE_HANDLE_EXA)(DWORD dwFlags,LPCSTR lpModuleName,HMODULE *phModule);
1864 typedef WINBOOL (WINAPI *PGET_MODULE_HANDLE_EXW)(DWORD dwFlags,LPCWSTR lpModuleName,HMODULE *phModule);
1865
1866#ifdef UNICODE
1867#define PGET_MODULE_HANDLE_EX PGET_MODULE_HANDLE_EXW
1868#define GetModuleHandleEx GetModuleHandleExW
1869#else
1870#define PGET_MODULE_HANDLE_EX PGET_MODULE_HANDLE_EXA
1871#define GetModuleHandleEx GetModuleHandleExA
1872#endif
1873
1874 WINBASEAPI WINBOOL WINAPI GetModuleHandleExA(DWORD dwFlags,LPCSTR lpModuleName,HMODULE *phModule);
1875 WINBASEAPI WINBOOL WINAPI GetModuleHandleExW(DWORD dwFlags,LPCWSTR lpModuleName,HMODULE *phModule);
1876#endif
1877
1878#ifdef UNICODE
1879#define NeedCurrentDirectoryForExePath NeedCurrentDirectoryForExePathW
1880#define CreateProcess CreateProcessW
1610#define FatalAppExit FatalAppExitW1881#define FatalAppExit FatalAppExitW
1611#define FindAtom FindAtomW1882#define GetStartupInfo GetStartupInfoW
1612#define FindFirstChangeNotification FindFirstChangeNotificationW1883#define GetCommandLine GetCommandLineW
1613#define FindFirstFile FindFirstFileW1884#define GetEnvironmentVariable GetEnvironmentVariableW
1614#define FindFirstFileEx FindFirstFileExW1885#define SetEnvironmentVariable SetEnvironmentVariableW
1615#define FindNextFile FindNextFileW1886#define ExpandEnvironmentStrings ExpandEnvironmentStringsW
1887#define GetFirmwareEnvironmentVariable GetFirmwareEnvironmentVariableW
1888#define SetFirmwareEnvironmentVariable SetFirmwareEnvironmentVariableW
1889#define OutputDebugString OutputDebugStringW
1616#define FindResource FindResourceW1890#define FindResource FindResourceW
1617#define FindResourceEx FindResourceExW1891#define FindResourceEx FindResourceExW
1618#define FormatMessage FormatMessageW1892#else
1619#define FreeEnvironmentStrings FreeEnvironmentStringsW1893#define NeedCurrentDirectoryForExePath NeedCurrentDirectoryForExePathA
1894#define CreateProcess CreateProcessA
1895#define FatalAppExit FatalAppExitA
1896#define GetStartupInfo GetStartupInfoA
1897#define GetCommandLine GetCommandLineA
1898#define GetEnvironmentVariable GetEnvironmentVariableA
1899#define SetEnvironmentVariable SetEnvironmentVariableA
1900#define ExpandEnvironmentStrings ExpandEnvironmentStringsA
1901#define GetFirmwareEnvironmentVariable GetFirmwareEnvironmentVariableA
1902#define SetFirmwareEnvironmentVariable SetFirmwareEnvironmentVariableA
1903#define OutputDebugString OutputDebugStringA
1904#define FindResource FindResourceA
1905#define FindResourceEx FindResourceExA
1906#endif
1907
1908 WINBASEAPI WINBOOL WINAPI NeedCurrentDirectoryForExePathA(LPCSTR ExeName);
1909 WINBASEAPI WINBOOL WINAPI NeedCurrentDirectoryForExePathW(LPCWSTR ExeName);
1910 WINBASEAPI WINBOOL WINAPI CreateProcessA(LPCSTR lpApplicationName,LPSTR lpCommandLine,LPSECURITY_ATTRIBUTES lpProcessAttributes,LPSECURITY_ATTRIBUTES lpThreadAttributes,WINBOOL bInheritHandles,DWORD dwCreationFlags,LPVOID lpEnvironment,LPCSTR lpCurrentDirectory,LPSTARTUPINFOA lpStartupInfo,LPPROCESS_INFORMATION lpProcessInformation);
1911 WINBASEAPI WINBOOL WINAPI CreateProcessW(LPCWSTR lpApplicationName,LPWSTR lpCommandLine,LPSECURITY_ATTRIBUTES lpProcessAttributes,LPSECURITY_ATTRIBUTES lpThreadAttributes,WINBOOL bInheritHandles,DWORD dwCreationFlags,LPVOID lpEnvironment,LPCWSTR lpCurrentDirectory,LPSTARTUPINFOW lpStartupInfo,LPPROCESS_INFORMATION lpProcessInformation);
1912 WINBASEAPI DWORD WINAPI AddLocalAlternateComputerNameA(LPCSTR lpDnsFQHostname,ULONG ulFlags);
1913 WINBASEAPI DWORD WINAPI AddLocalAlternateComputerNameW(LPCWSTR lpDnsFQHostname,ULONG ulFlags);
1914 WINBASEAPI WINBOOL WINAPI SetProcessShutdownParameters(DWORD dwLevel,DWORD dwFlags);
1915 WINBASEAPI WINBOOL WINAPI GetProcessShutdownParameters(LPDWORD lpdwLevel,LPDWORD lpdwFlags);
1916 WINBASEAPI DWORD WINAPI GetProcessVersion(DWORD ProcessId);
1917 WINBASEAPI VOID WINAPI FatalAppExitA(UINT uAction,LPCSTR lpMessageText);
1918 WINBASEAPI VOID WINAPI FatalAppExitW(UINT uAction,LPCWSTR lpMessageText);
1919 WINBASEAPI VOID WINAPI GetStartupInfoA(LPSTARTUPINFOA lpStartupInfo);
1920 WINBASEAPI VOID WINAPI GetStartupInfoW(LPSTARTUPINFOW lpStartupInfo);
1921 WINBASEAPI LPSTR WINAPI GetCommandLineA(VOID);
1922 WINBASEAPI LPWSTR WINAPI GetCommandLineW(VOID);
1923 WINBASEAPI DWORD WINAPI GetEnvironmentVariableA(LPCSTR lpName,LPSTR lpBuffer,DWORD nSize);
1924 WINBASEAPI DWORD WINAPI GetEnvironmentVariableW(LPCWSTR lpName,LPWSTR lpBuffer,DWORD nSize);
1925 WINBASEAPI WINBOOL WINAPI SetEnvironmentVariableA(LPCSTR lpName,LPCSTR lpValue);
1926 WINBASEAPI WINBOOL WINAPI SetEnvironmentVariableW(LPCWSTR lpName,LPCWSTR lpValue);
1927 WINBASEAPI DWORD WINAPI ExpandEnvironmentStringsA(LPCSTR lpSrc,LPSTR lpDst,DWORD nSize);
1928 WINBASEAPI DWORD WINAPI ExpandEnvironmentStringsW(LPCWSTR lpSrc,LPWSTR lpDst,DWORD nSize);
1929 WINBASEAPI DWORD WINAPI GetFirmwareEnvironmentVariableA(LPCSTR lpName,LPCSTR lpGuid,PVOID pBuffer,DWORD nSize);
1930 WINBASEAPI DWORD WINAPI GetFirmwareEnvironmentVariableW(LPCWSTR lpName,LPCWSTR lpGuid,PVOID pBuffer,DWORD nSize);
1931 WINBASEAPI WINBOOL WINAPI SetFirmwareEnvironmentVariableA(LPCSTR lpName,LPCSTR lpGuid,PVOID pValue,DWORD nSize);
1932 WINBASEAPI WINBOOL WINAPI SetFirmwareEnvironmentVariableW(LPCWSTR lpName,LPCWSTR lpGuid,PVOID pValue,DWORD nSize);
1933 WINBASEAPI VOID WINAPI OutputDebugStringA(LPCSTR lpOutputString);
1934 WINBASEAPI VOID WINAPI OutputDebugStringW(LPCWSTR lpOutputString);
1935 WINBASEAPI HRSRC WINAPI FindResourceA(HMODULE hModule,LPCSTR lpName,LPCSTR lpType);
1936 WINBASEAPI HRSRC WINAPI FindResourceW(HMODULE hModule,LPCWSTR lpName,LPCWSTR lpType);
1937 WINBASEAPI HRSRC WINAPI FindResourceExA(HMODULE hModule,LPCSTR lpType,LPCSTR lpName,WORD wLanguage);
1938 WINBASEAPI HRSRC WINAPI FindResourceExW(HMODULE hModule,LPCWSTR lpType,LPCWSTR lpName,WORD wLanguage);
1939
1940#ifdef UNICODE
1941#define ENUMRESTYPEPROC ENUMRESTYPEPROCW
1942#define ENUMRESNAMEPROC ENUMRESNAMEPROCW
1943#define ENUMRESLANGPROC ENUMRESLANGPROCW
1944#define EnumResourceTypes EnumResourceTypesW
1945#define EnumResourceNames EnumResourceNamesW
1946#define EnumResourceLanguages EnumResourceLanguagesW
1947#define BeginUpdateResource BeginUpdateResourceW
1948#define UpdateResource UpdateResourceW
1949#define EndUpdateResource EndUpdateResourceW
1950#define GlobalAddAtom GlobalAddAtomW
1951#define GlobalFindAtom GlobalFindAtomW
1952#define GlobalGetAtomName GlobalGetAtomNameW
1953#define AddAtom AddAtomW
1954#define FindAtom FindAtomW
1620#define GetAtomName GetAtomNameW1955#define GetAtomName GetAtomNameW
1621#define GetBinaryType GetBinaryTypeW1956#define GetProfileInt GetProfileIntW
1622#define GetCommandLine GetCommandLineW1957#define GetProfileString GetProfileStringW
1623#define GetCompressedFileSize GetCompressedFileSizeW1958#define WriteProfileString WriteProfileStringW
1624#define GetComputerName GetComputerNameW1959#define GetProfileSection GetProfileSectionW
1625#define GetCurrentDirectory GetCurrentDirectoryW1960#define WriteProfileSection WriteProfileSectionW
1626#define GetDefaultCommConfig GetDefaultCommConfigW
1627#define GetDiskFreeSpace GetDiskFreeSpaceW
1628#define GetDiskFreeSpaceEx GetDiskFreeSpaceExW
1629#define GetDriveType GetDriveTypeW
1630#define GetEnvironmentStrings GetEnvironmentStringsW
1631#define GetEnvironmentVariable GetEnvironmentVariableW
1632#define GetFileAttributes GetFileAttributesW
1633#define GetFileSecurity GetFileSecurityW
1634#define GetFileAttributesEx GetFileAttributesExW
1635#define GetFullPathName GetFullPathNameW
1636#define GetLogicalDriveStrings GetLogicalDriveStringsW
1637#define GetLongPathName GetLongPathNameW
1638#define GetModuleFileName GetModuleFileNameW
1639#define GetModuleHandle GetModuleHandleW
1640#define GetNamedPipeHandleState GetNamedPipeHandleStateW
1641#define GetPrivateProfileInt GetPrivateProfileIntW1961#define GetPrivateProfileInt GetPrivateProfileIntW
1962#define GetPrivateProfileString GetPrivateProfileStringW
1963#define WritePrivateProfileString WritePrivateProfileStringW
1642#define GetPrivateProfileSection GetPrivateProfileSectionW1964#define GetPrivateProfileSection GetPrivateProfileSectionW
1965#define WritePrivateProfileSection WritePrivateProfileSectionW
1643#define GetPrivateProfileSectionNames GetPrivateProfileSectionNamesW1966#define GetPrivateProfileSectionNames GetPrivateProfileSectionNamesW
1644#define GetPrivateProfileString GetPrivateProfileStringW
1645#define GetPrivateProfileStruct GetPrivateProfileStructW1967#define GetPrivateProfileStruct GetPrivateProfileStructW
1646#define GetProfileInt GetProfileIntW1968#define WritePrivateProfileStruct WritePrivateProfileStructW
1647#define GetProfileSection GetProfileSectionW1969#define GetDriveType GetDriveTypeW
1648#define GetProfileString GetProfileStringW
1649#define GetShortPathName GetShortPathNameW
1650#define GetStartupInfo GetStartupInfoW
1651#define GetSystemDirectory GetSystemDirectoryW1970#define GetSystemDirectory GetSystemDirectoryW
1652#define GetTempFileName GetTempFileNameW
1653#define GetTempPath GetTempPathW1971#define GetTempPath GetTempPathW
1654#define GetUserName GetUserNameW1972#define GetTempFileName GetTempFileNameW
1655#define GetVersionEx GetVersionExW
1656#define GetVolumeInformation GetVolumeInformationW
1657#define GetWindowsDirectory GetWindowsDirectoryW1973#define GetWindowsDirectory GetWindowsDirectoryW
1658#define GlobalAddAtom GlobalAddAtomW1974#define GetSystemWindowsDirectory GetSystemWindowsDirectoryW
1659#define GlobalFindAtom GlobalFindAtomW1975#define AddLocalAlternateComputerName AddLocalAlternateComputerNameW
1660#define GlobalGetAtomName GlobalGetAtomNameW1976#else
1661#define IsBadStringPtr IsBadStringPtrW1977#define ENUMRESTYPEPROC ENUMRESTYPEPROCA
1662#define LoadLibrary LoadLibraryW1978#define ENUMRESNAMEPROC ENUMRESNAMEPROCA
1663#define LoadLibraryEx LoadLibraryExW1979#define ENUMRESLANGPROC ENUMRESLANGPROCA
1664#define LogonUser LogonUserW1980#define EnumResourceTypes EnumResourceTypesA
1665#define LookupAccountName LookupAccountNameW1981#define EnumResourceNames EnumResourceNamesA
1666#define LookupAccountSid LookupAccountSidW1982#define EnumResourceLanguages EnumResourceLanguagesA
1667#define LookupPrivilegeDisplayName LookupPrivilegeDisplayNameW1983#define BeginUpdateResource BeginUpdateResourceA
1668#define LookupPrivilegeName LookupPrivilegeNameW1984#define UpdateResource UpdateResourceA
1669#define LookupPrivilegeValue LookupPrivilegeValueW1985#define EndUpdateResource EndUpdateResourceA
1670#define lstrcat lstrcatW1986#define GlobalAddAtom GlobalAddAtomA
1671#define lstrcmp lstrcmpW1987#define GlobalFindAtom GlobalFindAtomA
1672#define lstrcmpi lstrcmpiW1988#define GlobalGetAtomName GlobalGetAtomNameA
1673#define lstrcpy lstrcpyW1989#define AddAtom AddAtomA
1674#define lstrcpyn lstrcpynW1990#define FindAtom FindAtomA
1675#define lstrlen lstrlenW1991#define GetAtomName GetAtomNameA
1992#define GetProfileInt GetProfileIntA
1993#define GetProfileString GetProfileStringA
1994#define WriteProfileString WriteProfileStringA
1995#define GetProfileSection GetProfileSectionA
1996#define WriteProfileSection WriteProfileSectionA
1997#define GetPrivateProfileInt GetPrivateProfileIntA
1998#define GetPrivateProfileString GetPrivateProfileStringA
1999#define WritePrivateProfileString WritePrivateProfileStringA
2000#define GetPrivateProfileSection GetPrivateProfileSectionA
2001#define WritePrivateProfileSection WritePrivateProfileSectionA
2002#define GetPrivateProfileSectionNames GetPrivateProfileSectionNamesA
2003#define GetPrivateProfileStruct GetPrivateProfileStructA
2004#define WritePrivateProfileStruct WritePrivateProfileStructA
2005#define GetDriveType GetDriveTypeA
2006#define GetSystemDirectory GetSystemDirectoryA
2007#define GetTempPath GetTempPathA
2008#define GetTempFileName GetTempFileNameA
2009#define GetWindowsDirectory GetWindowsDirectoryA
2010#define GetSystemWindowsDirectory GetSystemWindowsDirectoryA
2011#define AddLocalAlternateComputerName AddLocalAlternateComputerNameA
2012#endif
2013
2014 typedef WINBOOL (CALLBACK *ENUMRESTYPEPROCA)(HMODULE hModule,LPSTR lpType,LONG_PTR lParam);
2015 typedef WINBOOL (CALLBACK *ENUMRESTYPEPROCW)(HMODULE hModule,LPWSTR lpType,LONG_PTR lParam);
2016 typedef WINBOOL (CALLBACK *ENUMRESNAMEPROCA)(HMODULE hModule,LPCSTR lpType,LPSTR lpName,LONG_PTR lParam);
2017 typedef WINBOOL (CALLBACK *ENUMRESNAMEPROCW)(HMODULE hModule,LPCWSTR lpType,LPWSTR lpName,LONG_PTR lParam);
2018 typedef WINBOOL (CALLBACK *ENUMRESLANGPROCA)(HMODULE hModule,LPCSTR lpType,LPCSTR lpName,WORD wLanguage,LONG_PTR lParam);
2019 typedef WINBOOL (CALLBACK *ENUMRESLANGPROCW)(HMODULE hModule,LPCWSTR lpType,LPCWSTR lpName,WORD wLanguage,LONG_PTR lParam);
2020
2021 WINBASEAPI WINBOOL WINAPI EnumResourceTypesA(HMODULE hModule,ENUMRESTYPEPROCA lpEnumFunc,LONG_PTR lParam);
2022 WINBASEAPI WINBOOL WINAPI EnumResourceTypesW(HMODULE hModule,ENUMRESTYPEPROCW lpEnumFunc,LONG_PTR lParam);
2023 WINBASEAPI WINBOOL WINAPI EnumResourceNamesA(HMODULE hModule,LPCSTR lpType,ENUMRESNAMEPROCA lpEnumFunc,LONG_PTR lParam);
2024 WINBASEAPI WINBOOL WINAPI EnumResourceNamesW(HMODULE hModule,LPCWSTR lpType,ENUMRESNAMEPROCW lpEnumFunc,LONG_PTR lParam);
2025 WINBASEAPI WINBOOL WINAPI EnumResourceLanguagesA(HMODULE hModule,LPCSTR lpType,LPCSTR lpName,ENUMRESLANGPROCA lpEnumFunc,LONG_PTR lParam);
2026 WINBASEAPI WINBOOL WINAPI EnumResourceLanguagesW(HMODULE hModule,LPCWSTR lpType,LPCWSTR lpName,ENUMRESLANGPROCW lpEnumFunc,LONG_PTR lParam);
2027 WINBASEAPI HANDLE WINAPI BeginUpdateResourceA(LPCSTR pFileName,WINBOOL bDeleteExistingResources);
2028 WINBASEAPI HANDLE WINAPI BeginUpdateResourceW(LPCWSTR pFileName,WINBOOL bDeleteExistingResources);
2029 WINBASEAPI WINBOOL WINAPI UpdateResourceA(HANDLE hUpdate,LPCSTR lpType,LPCSTR lpName,WORD wLanguage,LPVOID lpData,DWORD cb);
2030 WINBASEAPI WINBOOL WINAPI UpdateResourceW(HANDLE hUpdate,LPCWSTR lpType,LPCWSTR lpName,WORD wLanguage,LPVOID lpData,DWORD cb);
2031 WINBASEAPI WINBOOL WINAPI EndUpdateResourceA(HANDLE hUpdate,WINBOOL fDiscard);
2032 WINBASEAPI WINBOOL WINAPI EndUpdateResourceW(HANDLE hUpdate,WINBOOL fDiscard);
2033 WINBASEAPI ATOM WINAPI GlobalAddAtomA(LPCSTR lpString);
2034 WINBASEAPI ATOM WINAPI GlobalAddAtomW(LPCWSTR lpString);
2035 WINBASEAPI ATOM WINAPI GlobalFindAtomA(LPCSTR lpString);
2036 WINBASEAPI ATOM WINAPI GlobalFindAtomW(LPCWSTR lpString);
2037 WINBASEAPI UINT WINAPI GlobalGetAtomNameA(ATOM nAtom,LPSTR lpBuffer,int nSize);
2038 WINBASEAPI UINT WINAPI GlobalGetAtomNameW(ATOM nAtom,LPWSTR lpBuffer,int nSize);
2039 WINBASEAPI ATOM WINAPI AddAtomA(LPCSTR lpString);
2040 WINBASEAPI ATOM WINAPI AddAtomW(LPCWSTR lpString);
2041 WINBASEAPI ATOM WINAPI FindAtomA(LPCSTR lpString);
2042 WINBASEAPI ATOM WINAPI FindAtomW(LPCWSTR lpString);
2043 WINBASEAPI UINT WINAPI GetAtomNameA(ATOM nAtom,LPSTR lpBuffer,int nSize);
2044 WINBASEAPI UINT WINAPI GetAtomNameW(ATOM nAtom,LPWSTR lpBuffer,int nSize);
2045 WINBASEAPI UINT WINAPI GetProfileIntA(LPCSTR lpAppName,LPCSTR lpKeyName,INT nDefault);
2046 WINBASEAPI UINT WINAPI GetProfileIntW(LPCWSTR lpAppName,LPCWSTR lpKeyName,INT nDefault);
2047 WINBASEAPI DWORD WINAPI GetProfileStringA(LPCSTR lpAppName,LPCSTR lpKeyName,LPCSTR lpDefault,LPSTR lpReturnedString,DWORD nSize);
2048 WINBASEAPI DWORD WINAPI GetProfileStringW(LPCWSTR lpAppName,LPCWSTR lpKeyName,LPCWSTR lpDefault,LPWSTR lpReturnedString,DWORD nSize);
2049 WINBASEAPI WINBOOL WINAPI WriteProfileStringA(LPCSTR lpAppName,LPCSTR lpKeyName,LPCSTR lpString);
2050 WINBASEAPI WINBOOL WINAPI WriteProfileStringW(LPCWSTR lpAppName,LPCWSTR lpKeyName,LPCWSTR lpString);
2051 WINBASEAPI DWORD WINAPI GetProfileSectionA(LPCSTR lpAppName,LPSTR lpReturnedString,DWORD nSize);
2052 WINBASEAPI DWORD WINAPI GetProfileSectionW(LPCWSTR lpAppName,LPWSTR lpReturnedString,DWORD nSize);
2053 WINBASEAPI WINBOOL WINAPI WriteProfileSectionA(LPCSTR lpAppName,LPCSTR lpString);
2054 WINBASEAPI WINBOOL WINAPI WriteProfileSectionW(LPCWSTR lpAppName,LPCWSTR lpString);
2055 WINBASEAPI UINT WINAPI GetPrivateProfileIntA(LPCSTR lpAppName,LPCSTR lpKeyName,INT nDefault,LPCSTR lpFileName);
2056 WINBASEAPI UINT WINAPI GetPrivateProfileIntW(LPCWSTR lpAppName,LPCWSTR lpKeyName,INT nDefault,LPCWSTR lpFileName);
2057 WINBASEAPI DWORD WINAPI GetPrivateProfileStringA(LPCSTR lpAppName,LPCSTR lpKeyName,LPCSTR lpDefault,LPSTR lpReturnedString,DWORD nSize,LPCSTR lpFileName);
2058 WINBASEAPI DWORD WINAPI GetPrivateProfileStringW(LPCWSTR lpAppName,LPCWSTR lpKeyName,LPCWSTR lpDefault,LPWSTR lpReturnedString,DWORD nSize,LPCWSTR lpFileName);
2059 WINBASEAPI WINBOOL WINAPI WritePrivateProfileStringA(LPCSTR lpAppName,LPCSTR lpKeyName,LPCSTR lpString,LPCSTR lpFileName);
2060 WINBASEAPI WINBOOL WINAPI WritePrivateProfileStringW(LPCWSTR lpAppName,LPCWSTR lpKeyName,LPCWSTR lpString,LPCWSTR lpFileName);
2061 WINBASEAPI DWORD WINAPI GetPrivateProfileSectionA(LPCSTR lpAppName,LPSTR lpReturnedString,DWORD nSize,LPCSTR lpFileName);
2062 WINBASEAPI DWORD WINAPI GetPrivateProfileSectionW(LPCWSTR lpAppName,LPWSTR lpReturnedString,DWORD nSize,LPCWSTR lpFileName);
2063 WINBASEAPI WINBOOL WINAPI WritePrivateProfileSectionA(LPCSTR lpAppName,LPCSTR lpString,LPCSTR lpFileName);
2064 WINBASEAPI WINBOOL WINAPI WritePrivateProfileSectionW(LPCWSTR lpAppName,LPCWSTR lpString,LPCWSTR lpFileName);
2065 WINBASEAPI DWORD WINAPI GetPrivateProfileSectionNamesA(LPSTR lpszReturnBuffer,DWORD nSize,LPCSTR lpFileName);
2066 WINBASEAPI DWORD WINAPI GetPrivateProfileSectionNamesW(LPWSTR lpszReturnBuffer,DWORD nSize,LPCWSTR lpFileName);
2067 WINBASEAPI WINBOOL WINAPI GetPrivateProfileStructA(LPCSTR lpszSection,LPCSTR lpszKey,LPVOID lpStruct,UINT uSizeStruct,LPCSTR szFile);
2068 WINBASEAPI WINBOOL WINAPI GetPrivateProfileStructW(LPCWSTR lpszSection,LPCWSTR lpszKey,LPVOID lpStruct,UINT uSizeStruct,LPCWSTR szFile);
2069 WINBASEAPI WINBOOL WINAPI WritePrivateProfileStructA(LPCSTR lpszSection,LPCSTR lpszKey,LPVOID lpStruct,UINT uSizeStruct,LPCSTR szFile);
2070 WINBASEAPI WINBOOL WINAPI WritePrivateProfileStructW(LPCWSTR lpszSection,LPCWSTR lpszKey,LPVOID lpStruct,UINT uSizeStruct,LPCWSTR szFile);
2071 WINBASEAPI UINT WINAPI GetDriveTypeA(LPCSTR lpRootPathName);
2072 WINBASEAPI UINT WINAPI GetDriveTypeW(LPCWSTR lpRootPathName);
2073 WINBASEAPI UINT WINAPI GetSystemDirectoryA(LPSTR lpBuffer,UINT uSize);
2074 WINBASEAPI UINT WINAPI GetSystemDirectoryW(LPWSTR lpBuffer,UINT uSize);
2075 WINBASEAPI DWORD WINAPI GetTempPathA(DWORD nBufferLength,LPSTR lpBuffer);
2076 WINBASEAPI DWORD WINAPI GetTempPathW(DWORD nBufferLength,LPWSTR lpBuffer);
2077 WINBASEAPI UINT WINAPI GetTempFileNameA(LPCSTR lpPathName,LPCSTR lpPrefixString,UINT uUnique,LPSTR lpTempFileName);
2078 WINBASEAPI UINT WINAPI GetTempFileNameW(LPCWSTR lpPathName,LPCWSTR lpPrefixString,UINT uUnique,LPWSTR lpTempFileName);
2079 WINBASEAPI UINT WINAPI GetWindowsDirectoryA(LPSTR lpBuffer,UINT uSize);
2080 WINBASEAPI UINT WINAPI GetWindowsDirectoryW(LPWSTR lpBuffer,UINT uSize);
2081 WINBASEAPI UINT WINAPI GetSystemWindowsDirectoryA(LPSTR lpBuffer,UINT uSize);
2082 WINBASEAPI UINT WINAPI GetSystemWindowsDirectoryW(LPWSTR lpBuffer,UINT uSize);
2083
2084#ifndef RC_INVOKED
2085#ifdef UNICODE
2086#define GetSystemWow64Directory GetSystemWow64DirectoryW
2087#else
2088#define GetSystemWow64Directory GetSystemWow64DirectoryA
2089#endif
2090
2091 WINBASEAPI UINT WINAPI GetSystemWow64DirectoryA(LPSTR lpBuffer,UINT uSize);
2092 WINBASEAPI UINT WINAPI GetSystemWow64DirectoryW(LPWSTR lpBuffer,UINT uSize);
2093 WINBASEAPI BOOLEAN WINAPI Wow64EnableWow64FsRedirection(BOOLEAN Wow64FsEnableRedirection);
2094 WINBASEAPI WINBOOL WINAPI Wow64DisableWow64FsRedirection(PVOID *OldValue);
2095 WINBASEAPI WINBOOL WINAPI Wow64RevertWow64FsRedirection(PVOID OlValue);
2096
2097 typedef UINT (WINAPI *PGET_SYSTEM_WOW64_DIRECTORY_A)(LPSTR lpBuffer,UINT uSize);
2098 typedef UINT (WINAPI *PGET_SYSTEM_WOW64_DIRECTORY_W)(LPWSTR lpBuffer,UINT uSize);
2099
2100#define GET_SYSTEM_WOW64_DIRECTORY_NAME_A_A "GetSystemWow64DirectoryA"
2101#define GET_SYSTEM_WOW64_DIRECTORY_NAME_A_W L"GetSystemWow64DirectoryA"
2102#define GET_SYSTEM_WOW64_DIRECTORY_NAME_A_T TEXT("GetSystemWow64DirectoryA")
2103#define GET_SYSTEM_WOW64_DIRECTORY_NAME_W_A "GetSystemWow64DirectoryW"
2104#define GET_SYSTEM_WOW64_DIRECTORY_NAME_W_W L"GetSystemWow64DirectoryW"
2105#define GET_SYSTEM_WOW64_DIRECTORY_NAME_W_T TEXT("GetSystemWow64DirectoryW")
2106
2107#ifdef UNICODE
2108#define GET_SYSTEM_WOW64_DIRECTORY_NAME_T_A GET_SYSTEM_WOW64_DIRECTORY_NAME_W_A
2109#define GET_SYSTEM_WOW64_DIRECTORY_NAME_T_W GET_SYSTEM_WOW64_DIRECTORY_NAME_W_W
2110#define GET_SYSTEM_WOW64_DIRECTORY_NAME_T_T GET_SYSTEM_WOW64_DIRECTORY_NAME_W_T
2111#else
2112#define GET_SYSTEM_WOW64_DIRECTORY_NAME_T_A GET_SYSTEM_WOW64_DIRECTORY_NAME_A_A
2113#define GET_SYSTEM_WOW64_DIRECTORY_NAME_T_W GET_SYSTEM_WOW64_DIRECTORY_NAME_A_W
2114#define GET_SYSTEM_WOW64_DIRECTORY_NAME_T_T GET_SYSTEM_WOW64_DIRECTORY_NAME_A_T
2115#endif
2116#endif
2117
2118#ifdef UNICODE
2119#define SetCurrentDirectory SetCurrentDirectoryW
2120#define GetCurrentDirectory GetCurrentDirectoryW
2121#define SetDllDirectory SetDllDirectoryW
2122#define GetDllDirectory GetDllDirectoryW
2123#define GetDiskFreeSpace GetDiskFreeSpaceW
2124#define GetDiskFreeSpaceEx GetDiskFreeSpaceExW
2125#define CreateDirectory CreateDirectoryW
2126#define CreateDirectoryEx CreateDirectoryExW
2127#define RemoveDirectory RemoveDirectoryW
2128#define GetFullPathName GetFullPathNameW
2129#define DefineDosDevice DefineDosDeviceW
2130#define QueryDosDevice QueryDosDeviceW
2131#define CreateFile CreateFileW
2132#define SetFileAttributes SetFileAttributesW
2133#define GetFileAttributes GetFileAttributesW
2134#else
2135#define SetCurrentDirectory SetCurrentDirectoryA
2136#define GetCurrentDirectory GetCurrentDirectoryA
2137#define SetDllDirectory SetDllDirectoryA
2138#define GetDllDirectory GetDllDirectoryA
2139#define GetDiskFreeSpace GetDiskFreeSpaceA
2140#define GetDiskFreeSpaceEx GetDiskFreeSpaceExA
2141#define CreateDirectory CreateDirectoryA
2142#define CreateDirectoryEx CreateDirectoryExA
2143#define RemoveDirectory RemoveDirectoryA
2144#define GetFullPathName GetFullPathNameA
2145#define DefineDosDevice DefineDosDeviceA
2146#define QueryDosDevice QueryDosDeviceA
2147#define CreateFile CreateFileA
2148#define SetFileAttributes SetFileAttributesA
2149#define GetFileAttributes GetFileAttributesA
2150#endif
2151
2152 WINBASEAPI WINBOOL WINAPI SetCurrentDirectoryA(LPCSTR lpPathName);
2153 WINBASEAPI WINBOOL WINAPI SetCurrentDirectoryW(LPCWSTR lpPathName);
2154 WINBASEAPI DWORD WINAPI GetCurrentDirectoryA(DWORD nBufferLength,LPSTR lpBuffer);
2155 WINBASEAPI DWORD WINAPI GetCurrentDirectoryW(DWORD nBufferLength,LPWSTR lpBuffer);
2156 WINBASEAPI WINBOOL WINAPI SetDllDirectoryA(LPCSTR lpPathName);
2157 WINBASEAPI WINBOOL WINAPI SetDllDirectoryW(LPCWSTR lpPathName);
2158 WINBASEAPI DWORD WINAPI GetDllDirectoryA(DWORD nBufferLength,LPSTR lpBuffer);
2159 WINBASEAPI DWORD WINAPI GetDllDirectoryW(DWORD nBufferLength,LPWSTR lpBuffer);
2160 WINBASEAPI WINBOOL WINAPI GetDiskFreeSpaceA(LPCSTR lpRootPathName,LPDWORD lpSectorsPerCluster,LPDWORD lpBytesPerSector,LPDWORD lpNumberOfFreeClusters,LPDWORD lpTotalNumberOfClusters);
2161 WINBASEAPI WINBOOL WINAPI GetDiskFreeSpaceW(LPCWSTR lpRootPathName,LPDWORD lpSectorsPerCluster,LPDWORD lpBytesPerSector,LPDWORD lpNumberOfFreeClusters,LPDWORD lpTotalNumberOfClusters);
2162 WINBASEAPI WINBOOL WINAPI GetDiskFreeSpaceExA(LPCSTR lpDirectoryName,PULARGE_INTEGER lpFreeBytesAvailableToCaller,PULARGE_INTEGER lpTotalNumberOfBytes,PULARGE_INTEGER lpTotalNumberOfFreeBytes);
2163 WINBASEAPI WINBOOL WINAPI GetDiskFreeSpaceExW(LPCWSTR lpDirectoryName,PULARGE_INTEGER lpFreeBytesAvailableToCaller,PULARGE_INTEGER lpTotalNumberOfBytes,PULARGE_INTEGER lpTotalNumberOfFreeBytes);
2164 WINBASEAPI WINBOOL WINAPI CreateDirectoryA(LPCSTR lpPathName,LPSECURITY_ATTRIBUTES lpSecurityAttributes);
2165 WINBASEAPI WINBOOL WINAPI CreateDirectoryW(LPCWSTR lpPathName,LPSECURITY_ATTRIBUTES lpSecurityAttributes);
2166 WINBASEAPI WINBOOL WINAPI CreateDirectoryExA(LPCSTR lpTemplateDirectory,LPCSTR lpNewDirectory,LPSECURITY_ATTRIBUTES lpSecurityAttributes);
2167 WINBASEAPI WINBOOL WINAPI CreateDirectoryExW(LPCWSTR lpTemplateDirectory,LPCWSTR lpNewDirectory,LPSECURITY_ATTRIBUTES lpSecurityAttributes);
2168 WINBASEAPI WINBOOL WINAPI RemoveDirectoryA(LPCSTR lpPathName);
2169 WINBASEAPI WINBOOL WINAPI RemoveDirectoryW(LPCWSTR lpPathName);
2170 WINBASEAPI DWORD WINAPI GetFullPathNameA(LPCSTR lpFileName,DWORD nBufferLength,LPSTR lpBuffer,LPSTR *lpFilePart);
2171 WINBASEAPI DWORD WINAPI GetFullPathNameW(LPCWSTR lpFileName,DWORD nBufferLength,LPWSTR lpBuffer,LPWSTR *lpFilePart);
2172
2173#define DDD_RAW_TARGET_PATH 0x1
2174#define DDD_REMOVE_DEFINITION 0x2
2175#define DDD_EXACT_MATCH_ON_REMOVE 0x4
2176#define DDD_NO_BROADCAST_SYSTEM 0x8
2177#define DDD_LUID_BROADCAST_DRIVE 0x10
2178
2179 WINBASEAPI WINBOOL WINAPI DefineDosDeviceA(DWORD dwFlags,LPCSTR lpDeviceName,LPCSTR lpTargetPath);
2180 WINBASEAPI WINBOOL WINAPI DefineDosDeviceW(DWORD dwFlags,LPCWSTR lpDeviceName,LPCWSTR lpTargetPath);
2181 WINBASEAPI DWORD WINAPI QueryDosDeviceA(LPCSTR lpDeviceName,LPSTR lpTargetPath,DWORD ucchMax);
2182 WINBASEAPI DWORD WINAPI QueryDosDeviceW(LPCWSTR lpDeviceName,LPWSTR lpTargetPath,DWORD ucchMax);
2183
2184#define EXPAND_LOCAL_DRIVES
2185
2186 WINBASEAPI HANDLE WINAPI CreateFileA(LPCSTR lpFileName,DWORD dwDesiredAccess,DWORD dwShareMode,LPSECURITY_ATTRIBUTES lpSecurityAttributes,DWORD dwCreationDisposition,DWORD dwFlagsAndAttributes,HANDLE hTemplateFile);
2187 WINBASEAPI HANDLE WINAPI CreateFileW(LPCWSTR lpFileName,DWORD dwDesiredAccess,DWORD dwShareMode,LPSECURITY_ATTRIBUTES lpSecurityAttributes,DWORD dwCreationDisposition,DWORD dwFlagsAndAttributes,HANDLE hTemplateFile);
2188 WINBASEAPI HANDLE WINAPI ReOpenFile(HANDLE hOriginalFile,DWORD dwDesiredAccess,DWORD dwShareMode,DWORD dwFlagsAndAttributes);
2189 WINBASEAPI WINBOOL WINAPI SetFileAttributesA(LPCSTR lpFileName,DWORD dwFileAttributes);
2190 WINBASEAPI WINBOOL WINAPI SetFileAttributesW(LPCWSTR lpFileName,DWORD dwFileAttributes);
2191 WINBASEAPI DWORD WINAPI GetFileAttributesA(LPCSTR lpFileName);
2192 WINBASEAPI DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName);
2193
2194 typedef enum _GET_FILEEX_INFO_LEVELS {
2195 GetFileExInfoStandard,GetFileExMaxInfoLevel
2196 } GET_FILEEX_INFO_LEVELS;
2197
2198#ifdef UNICODE
2199#define GetFileAttributesEx GetFileAttributesExW
2200#define GetCompressedFileSize GetCompressedFileSizeW
2201#define DeleteFile DeleteFileW
2202#define CheckNameLegalDOS8Dot3 CheckNameLegalDOS8Dot3W
2203#else
2204#define GetFileAttributesEx GetFileAttributesExA
2205#define GetCompressedFileSize GetCompressedFileSizeA
2206#define DeleteFile DeleteFileA
2207#define CheckNameLegalDOS8Dot3 CheckNameLegalDOS8Dot3A
2208#endif
2209
2210 WINBASEAPI WINBOOL WINAPI GetFileAttributesExA(LPCSTR lpFileName,GET_FILEEX_INFO_LEVELS fInfoLevelId,LPVOID lpFileInformation);
2211 WINBASEAPI WINBOOL WINAPI GetFileAttributesExW(LPCWSTR lpFileName,GET_FILEEX_INFO_LEVELS fInfoLevelId,LPVOID lpFileInformation);
2212 WINBASEAPI DWORD WINAPI GetCompressedFileSizeA(LPCSTR lpFileName,LPDWORD lpFileSizeHigh);
2213 WINBASEAPI DWORD WINAPI GetCompressedFileSizeW(LPCWSTR lpFileName,LPDWORD lpFileSizeHigh);
2214 WINBASEAPI WINBOOL WINAPI DeleteFileA(LPCSTR lpFileName);
2215 WINBASEAPI WINBOOL WINAPI DeleteFileW(LPCWSTR lpFileName);
2216 WINBASEAPI WINBOOL WINAPI CheckNameLegalDOS8Dot3A(LPCSTR lpName,LPSTR lpOemName,DWORD OemNameSize,PBOOL pbNameContainsSpaces,PBOOL pbNameLegal);
2217 WINBASEAPI WINBOOL WINAPI CheckNameLegalDOS8Dot3W(LPCWSTR lpName,LPSTR lpOemName,DWORD OemNameSize,PBOOL pbNameContainsSpaces,PBOOL pbNameLegal);
2218
2219 typedef enum _FINDEX_INFO_LEVELS {
2220 FindExInfoStandard,FindExInfoMaxInfoLevel
2221 } FINDEX_INFO_LEVELS;
2222
2223 typedef enum _FINDEX_SEARCH_OPS {
2224 FindExSearchNameMatch,FindExSearchLimitToDirectories,FindExSearchLimitToDevices,FindExSearchMaxSearchOp
2225 } FINDEX_SEARCH_OPS;
2226
2227#define FIND_FIRST_EX_CASE_SENSITIVE 0x1
2228
2229#ifdef UNICODE
2230#define FindFirstFileEx FindFirstFileExW
2231#define FindFirstFile FindFirstFileW
2232#define FindNextFile FindNextFileW
2233#define SearchPath SearchPathW
2234#define CopyFile CopyFileW
2235#define CopyFileEx CopyFileExW
1676#define MoveFile MoveFileW2236#define MoveFile MoveFileW
1677#define MoveFileEx MoveFileExW2237#define MoveFileEx MoveFileExW
1678#define ObjectCloseAuditAlarm ObjectCloseAuditAlarmW2238#define MoveFileWithProgress MoveFileWithProgressW
1679#define ObjectDeleteAuditAlarm ObjectDeleteAuditAlarmW2239#define ReplaceFile ReplaceFileW
1680#define ObjectOpenAuditAlarm ObjectOpenAuditAlarmW2240#define CreateHardLink CreateHardLinkW
1681#define ObjectPrivilegeAuditAlarm ObjectPrivilegeAuditAlarmW2241#define CreateNamedPipe CreateNamedPipeW
1682#define OpenBackupEventLog OpenBackupEventLogW2242#define GetNamedPipeHandleState GetNamedPipeHandleStateW
1683#define OpenEvent OpenEventW2243#define CallNamedPipe CallNamedPipeW
2244#define WaitNamedPipe WaitNamedPipeW
2245#define SetVolumeLabel SetVolumeLabelW
2246#define GetVolumeInformation GetVolumeInformationW
2247#define ClearEventLog ClearEventLogW
2248#define BackupEventLog BackupEventLogW
1684#define OpenEventLog OpenEventLogW2249#define OpenEventLog OpenEventLogW
1685#define OpenFileMapping OpenFileMappingW
1686#define OpenMutex OpenMutexW
1687#define OpenSemaphore OpenSemaphoreW
1688#define OutputDebugString OutputDebugStringW
1689#define PrivilegedServiceAuditAlarm PrivilegedServiceAuditAlarmW
1690#define QueryDosDevice QueryDosDeviceW
1691#define ReadEventLog ReadEventLogW
1692#define RegisterEventSource RegisterEventSourceW2250#define RegisterEventSource RegisterEventSourceW
1693#define RemoveDirectory RemoveDirectoryW2251#define OpenBackupEventLog OpenBackupEventLogW
2252#define ReadEventLog ReadEventLogW
1694#define ReportEvent ReportEventW2253#define ReportEvent ReportEventW
1695#define SearchPath SearchPathW2254#define AccessCheckAndAuditAlarm AccessCheckAndAuditAlarmW
1696#define SetComputerName SetComputerNameW2255#define AccessCheckByTypeAndAuditAlarm AccessCheckByTypeAndAuditAlarmW
1697#define SetCurrentDirectory SetCurrentDirectoryW2256#define AccessCheckByTypeResultListAndAuditAlarm AccessCheckByTypeResultListAndAuditAlarmW
1698#define SetDefaultCommConfig SetDefaultCommConfigW2257#define AccessCheckByTypeResultListAndAuditAlarmByHandle AccessCheckByTypeResultListAndAuditAlarmByHandleW
1699#define SetEnvironmentVariable SetEnvironmentVariableW2258#define ObjectOpenAuditAlarm ObjectOpenAuditAlarmW
1700#define SetFileAttributes SetFileAttributesW2259#define ObjectPrivilegeAuditAlarm ObjectPrivilegeAuditAlarmW
2260#define ObjectCloseAuditAlarm ObjectCloseAuditAlarmW
2261#define ObjectDeleteAuditAlarm ObjectDeleteAuditAlarmW
2262#define PrivilegedServiceAuditAlarm PrivilegedServiceAuditAlarmW
1701#define SetFileSecurity SetFileSecurityW2263#define SetFileSecurity SetFileSecurityW
1702#define SetVolumeLabel SetVolumeLabelW2264#define GetFileSecurity GetFileSecurityW
1703#define UpdateResource UpdateResourceW2265#define FindFirstChangeNotification FindFirstChangeNotificationW
1704#define VerifyVersionInfo VerifyVersionInfoW2266#define IsBadStringPtr IsBadStringPtrW
1705#define WaitNamedPipe WaitNamedPipeW2267#define LookupAccountSid LookupAccountSidW
1706#define WritePrivateProfileSection WritePrivateProfileSectionW2268#define LookupAccountName LookupAccountNameW
1707#define WritePrivateProfileString WritePrivateProfileStringW2269#define LookupPrivilegeValue LookupPrivilegeValueW
1708#define WritePrivateProfileStruct WritePrivateProfileStructW2270#define LookupPrivilegeName LookupPrivilegeNameW
1709#define WriteProfileSection WriteProfileSectionW2271#define LookupPrivilegeDisplayName LookupPrivilegeDisplayNameW
1710#define WriteProfileString WriteProfileStringW2272#define BuildCommDCB BuildCommDCBW
1711#else2273#define BuildCommDCBAndTimeouts BuildCommDCBAndTimeoutsW
1712typedef STARTUPINFOA STARTUPINFO,*LPSTARTUPINFO;2274#define CommConfigDialog CommConfigDialogW
1713typedef WIN32_FIND_DATAA WIN32_FIND_DATA,*LPWIN32_FIND_DATA;2275#define GetDefaultCommConfig GetDefaultCommConfigW
1714typedef HW_PROFILE_INFOA HW_PROFILE_INFO,*LPHW_PROFILE_INFO;2276#define SetDefaultCommConfig SetDefaultCommConfigW
1715#define AccessCheckAndAuditAlarm AccessCheckAndAuditAlarmA2277#define GetComputerName GetComputerNameW
1716#define AddAtom AddAtomA2278#define SetComputerName SetComputerNameW
1717#define BackupEventLog BackupEventLogA2279#define GetComputerNameEx GetComputerNameExW
1718#define BeginUpdateResource BeginUpdateResourceA2280#define SetComputerNameEx SetComputerNameExW
1719#define BuildCommDCB BuildCommDCBA2281#define DnsHostnameToComputerName DnsHostnameToComputerNameW
1720#define BuildCommDCBAndTimeouts BuildCommDCBAndTimeoutsA2282#define GetUserName GetUserNameW
1721#define CallNamedPipe CallNamedPipeA2283#else
1722#define ClearEventLog ClearEventLogA2284#define FindFirstFileEx FindFirstFileExA
1723#define CommConfigDialog CommConfigDialogA2285#define FindFirstFile FindFirstFileA
2286#define FindNextFile FindNextFileA
2287#define SearchPath SearchPathA
1724#define CopyFile CopyFileA2288#define CopyFile CopyFileA
1725#define CopyFileEx CopyFileExA2289#define CopyFileEx CopyFileExA
1726#define CreateDirectory CreateDirectoryA2290#define MoveFile MoveFileA
1727#define CreateDirectoryEx CreateDirectoryExA2291#define MoveFileEx MoveFileExA
1728#define CreateEvent CreateEventA2292#define MoveFileWithProgress MoveFileWithProgressA
1729#define CreateFile CreateFileA2293#define ReplaceFile ReplaceFileA
1730#define CreateFileMapping CreateFileMappingA
1731#define CreateHardLink CreateHardLinkA2294#define CreateHardLink CreateHardLinkA
1732#define CreateMailslot CreateMailslotA
1733#define CreateMutex CreateMutexA
1734#define CreateNamedPipe CreateNamedPipeA2295#define CreateNamedPipe CreateNamedPipeA
1735#define CreateProcess CreateProcessA
1736#define CreateProcessAsUser CreateProcessAsUserA
1737#define CreateSemaphore CreateSemaphoreA
1738#define CreateWaitableTimer CreateWaitableTimerA
1739#define DefineDosDevice DefineDosDeviceA
1740#define DeleteFile DeleteFileA
1741#define EndUpdateResource EndUpdateResourceA
1742#define EnumResourceLanguages EnumResourceLanguagesA
1743#define EnumResourceNames EnumResourceNamesA
1744#define EnumResourceTypes EnumResourceTypesA
1745#define ExpandEnvironmentStrings ExpandEnvironmentStringsA
1746#define FatalAppExit FatalAppExitA
1747#define FindAtom FindAtomA
1748#define FindFirstChangeNotification FindFirstChangeNotificationA
1749#define FindFirstFile FindFirstFileA
1750#define FindFirstFileEx FindFirstFileExW
1751#define FindNextFile FindNextFileA
1752#define FindResource FindResourceA
1753#define FindResourceEx FindResourceExA
1754#define FormatMessage FormatMessageA
1755#define FreeEnvironmentStrings FreeEnvironmentStringsA
1756#define GetAtomName GetAtomNameA
1757#define GetBinaryType GetBinaryTypeA
1758#define GetCommandLine GetCommandLineA
1759#define GetComputerName GetComputerNameA
1760#define GetCompressedFileSize GetCompressedFileSizeA
1761#define GetCurrentDirectory GetCurrentDirectoryA
1762#define GetDefaultCommConfig GetDefaultCommConfigA
1763#define GetDiskFreeSpace GetDiskFreeSpaceA
1764#define GetDiskFreeSpaceEx GetDiskFreeSpaceExA
1765#define GetDriveType GetDriveTypeA
1766#define GetEnvironmentStringsA GetEnvironmentStrings
1767#define GetEnvironmentVariable GetEnvironmentVariableA
1768#define GetFileAttributes GetFileAttributesA
1769#define GetFileSecurity GetFileSecurityA
1770#define GetFileAttributesEx GetFileAttributesExA
1771#define GetFullPathName GetFullPathNameA
1772#define GetLogicalDriveStrings GetLogicalDriveStringsA
1773#define GetLongPathName GetLongPathNameA
1774#define GetNamedPipeHandleState GetNamedPipeHandleStateA2296#define GetNamedPipeHandleState GetNamedPipeHandleStateA
1775#define GetModuleHandle GetModuleHandleA2297#define CallNamedPipe CallNamedPipeA
1776#define GetModuleFileName GetModuleFileNameA2298#define WaitNamedPipe WaitNamedPipeA
1777#define GetPrivateProfileInt GetPrivateProfileIntA2299#define SetVolumeLabel SetVolumeLabelA
1778#define GetPrivateProfileSection GetPrivateProfileSectionA
1779#define GetPrivateProfileSectionNames GetPrivateProfileSectionNamesA
1780#define GetPrivateProfileString GetPrivateProfileStringA
1781#define GetPrivateProfileStruct GetPrivateProfileStructA
1782#define GetProfileInt GetProfileIntA
1783#define GetProfileSection GetProfileSectionA
1784#define GetProfileString GetProfileStringA
1785#define GetShortPathName GetShortPathNameA
1786#define GetStartupInfo GetStartupInfoA
1787#define GetSystemDirectory GetSystemDirectoryA
1788#define GetTempFileName GetTempFileNameA
1789#define GetTempPath GetTempPathA
1790#define GetUserName GetUserNameA
1791#define GetVersionEx GetVersionExA
1792#define GetVolumeInformation GetVolumeInformationA2300#define GetVolumeInformation GetVolumeInformationA
1793#define GetWindowsDirectory GetWindowsDirectoryA2301#define ClearEventLog ClearEventLogA
1794#define GlobalAddAtom GlobalAddAtomA2302#define BackupEventLog BackupEventLogA
1795#define GlobalFindAtom GlobalFindAtomA
1796#define GlobalGetAtomName GlobalGetAtomNameA
1797#define IsBadStringPtr IsBadStringPtrA
1798#define LoadLibrary LoadLibraryA
1799#define LoadLibraryEx LoadLibraryExA
1800#define LogonUser LogonUserA
1801#define LookupAccountName LookupAccountNameA
1802#define LookupAccountSid LookupAccountSidA
1803#define LookupPrivilegeDisplayName LookupPrivilegeDisplayNameA
1804#define LookupPrivilegeName LookupPrivilegeNameA
1805#define LookupPrivilegeValue LookupPrivilegeValueA
1806#define lstrcat lstrcatA
1807#define lstrcmp lstrcmpA
1808#define lstrcmpi lstrcmpiA
1809#define lstrcpy lstrcpyA
1810#define lstrcpyn lstrcpynA
1811#define lstrlen lstrlenA
1812#define MoveFile MoveFileA
1813#define MoveFileEx MoveFileExA
1814#define ObjectCloseAuditAlarm ObjectCloseAuditAlarmA
1815#define ObjectDeleteAuditAlarm ObjectDeleteAuditAlarmA
1816#define ObjectOpenAuditAlarm ObjectOpenAuditAlarmA
1817#define ObjectPrivilegeAuditAlarm ObjectPrivilegeAuditAlarmA
1818#define OpenBackupEventLog OpenBackupEventLogA
1819#define OpenEvent OpenEventA
1820#define OpenEventLog OpenEventLogA2303#define OpenEventLog OpenEventLogA
1821#define OpenFileMapping OpenFileMappingA
1822#define OpenMutex OpenMutexA
1823#define OpenSemaphore OpenSemaphoreA
1824#define OutputDebugString OutputDebugStringA
1825#define PrivilegedServiceAuditAlarm PrivilegedServiceAuditAlarmA
1826#define QueryDosDevice QueryDosDeviceA
1827#define ReadEventLog ReadEventLogA
1828#define RegisterEventSource RegisterEventSourceA2304#define RegisterEventSource RegisterEventSourceA
1829#define RemoveDirectory RemoveDirectoryA2305#define OpenBackupEventLog OpenBackupEventLogA
2306#define ReadEventLog ReadEventLogA
1830#define ReportEvent ReportEventA2307#define ReportEvent ReportEventA
1831#define SearchPath SearchPathA2308#define AccessCheckAndAuditAlarm AccessCheckAndAuditAlarmA
1832#define SetComputerName SetComputerNameA2309#define AccessCheckByTypeAndAuditAlarm AccessCheckByTypeAndAuditAlarmA
1833#define SetCurrentDirectory SetCurrentDirectoryA2310#define AccessCheckByTypeResultListAndAuditAlarm AccessCheckByTypeResultListAndAuditAlarmA
1834#define SetDefaultCommConfig SetDefaultCommConfigA2311#define AccessCheckByTypeResultListAndAuditAlarmByHandle AccessCheckByTypeResultListAndAuditAlarmByHandleA
1835#define SetEnvironmentVariable SetEnvironmentVariableA2312#define ObjectOpenAuditAlarm ObjectOpenAuditAlarmA
1836#define SetFileAttributes SetFileAttributesA2313#define ObjectPrivilegeAuditAlarm ObjectPrivilegeAuditAlarmA
2314#define ObjectCloseAuditAlarm ObjectCloseAuditAlarmA
2315#define ObjectDeleteAuditAlarm ObjectDeleteAuditAlarmA
2316#define PrivilegedServiceAuditAlarm PrivilegedServiceAuditAlarmA
1837#define SetFileSecurity SetFileSecurityA2317#define SetFileSecurity SetFileSecurityA
1838#define SetVolumeLabel SetVolumeLabelA2318#define GetFileSecurity GetFileSecurityA
1839#define UpdateResource UpdateResourceA2319#define FindFirstChangeNotification FindFirstChangeNotificationA
2320#define IsBadStringPtr IsBadStringPtrA
2321#define LookupAccountSid LookupAccountSidA
2322#define LookupAccountName LookupAccountNameA
2323#define LookupPrivilegeValue LookupPrivilegeValueA
2324#define LookupPrivilegeName LookupPrivilegeNameA
2325#define LookupPrivilegeDisplayName LookupPrivilegeDisplayNameA
2326#define BuildCommDCB BuildCommDCBA
2327#define BuildCommDCBAndTimeouts BuildCommDCBAndTimeoutsA
2328#define CommConfigDialog CommConfigDialogA
2329#define GetDefaultCommConfig GetDefaultCommConfigA
2330#define SetDefaultCommConfig SetDefaultCommConfigA
2331#define GetComputerName GetComputerNameA
2332#define SetComputerName SetComputerNameA
2333#define GetComputerNameEx GetComputerNameExA
2334#define SetComputerNameEx SetComputerNameExA
2335#define DnsHostnameToComputerName DnsHostnameToComputerNameA
2336#define GetUserName GetUserNameA
2337#endif
2338
2339 WINBASEAPI HANDLE WINAPI FindFirstFileExA(LPCSTR lpFileName,FINDEX_INFO_LEVELS fInfoLevelId,LPVOID lpFindFileData,FINDEX_SEARCH_OPS fSearchOp,LPVOID lpSearchFilter,DWORD dwAdditionalFlags);
2340 WINBASEAPI HANDLE WINAPI FindFirstFileExW(LPCWSTR lpFileName,FINDEX_INFO_LEVELS fInfoLevelId,LPVOID lpFindFileData,FINDEX_SEARCH_OPS fSearchOp,LPVOID lpSearchFilter,DWORD dwAdditionalFlags);
2341 WINBASEAPI HANDLE WINAPI FindFirstFileA(LPCSTR lpFileName,LPWIN32_FIND_DATAA lpFindFileData);
2342 WINBASEAPI HANDLE WINAPI FindFirstFileW(LPCWSTR lpFileName,LPWIN32_FIND_DATAW lpFindFileData);
2343 WINBASEAPI WINBOOL WINAPI FindNextFileA(HANDLE hFindFile,LPWIN32_FIND_DATAA lpFindFileData);
2344 WINBASEAPI WINBOOL WINAPI FindNextFileW(HANDLE hFindFile,LPWIN32_FIND_DATAW lpFindFileData);
2345 WINBASEAPI DWORD WINAPI SearchPathA(LPCSTR lpPath,LPCSTR lpFileName,LPCSTR lpExtension,DWORD nBufferLength,LPSTR lpBuffer,LPSTR *lpFilePart);
2346 WINBASEAPI DWORD WINAPI SearchPathW(LPCWSTR lpPath,LPCWSTR lpFileName,LPCWSTR lpExtension,DWORD nBufferLength,LPWSTR lpBuffer,LPWSTR *lpFilePart);
2347 WINBASEAPI WINBOOL WINAPI CopyFileA(LPCSTR lpExistingFileName,LPCSTR lpNewFileName,WINBOOL bFailIfExists);
2348 WINBASEAPI WINBOOL WINAPI CopyFileW(LPCWSTR lpExistingFileName,LPCWSTR lpNewFileName,WINBOOL bFailIfExists);
2349
2350 typedef DWORD (WINAPI *LPPROGRESS_ROUTINE)(LARGE_INTEGER TotalFileSize,LARGE_INTEGER TotalBytesTransferred,LARGE_INTEGER StreamSize,LARGE_INTEGER StreamBytesTransferred,DWORD dwStreamNumber,DWORD dwCallbackReason,HANDLE hSourceFile,HANDLE hDestinationFile,LPVOID lpData);
2351
2352 WINBASEAPI WINBOOL WINAPI CopyFileExA(LPCSTR lpExistingFileName,LPCSTR lpNewFileName,LPPROGRESS_ROUTINE lpProgressRoutine,LPVOID lpData,LPBOOL pbCancel,DWORD dwCopyFlags);
2353 WINBASEAPI WINBOOL WINAPI CopyFileExW(LPCWSTR lpExistingFileName,LPCWSTR lpNewFileName,LPPROGRESS_ROUTINE lpProgressRoutine,LPVOID lpData,LPBOOL pbCancel,DWORD dwCopyFlags);
2354 WINBASEAPI WINBOOL WINAPI MoveFileA(LPCSTR lpExistingFileName,LPCSTR lpNewFileName);
2355 WINBASEAPI WINBOOL WINAPI MoveFileW(LPCWSTR lpExistingFileName,LPCWSTR lpNewFileName);
2356 WINBASEAPI WINBOOL WINAPI MoveFileExA(LPCSTR lpExistingFileName,LPCSTR lpNewFileName,DWORD dwFlags);
2357 WINBASEAPI WINBOOL WINAPI MoveFileExW(LPCWSTR lpExistingFileName,LPCWSTR lpNewFileName,DWORD dwFlags);
2358 WINBASEAPI WINBOOL WINAPI MoveFileWithProgressA(LPCSTR lpExistingFileName,LPCSTR lpNewFileName,LPPROGRESS_ROUTINE lpProgressRoutine,LPVOID lpData,DWORD dwFlags);
2359 WINBASEAPI WINBOOL WINAPI MoveFileWithProgressW(LPCWSTR lpExistingFileName,LPCWSTR lpNewFileName,LPPROGRESS_ROUTINE lpProgressRoutine,LPVOID lpData,DWORD dwFlags);
2360
2361#define MOVEFILE_REPLACE_EXISTING 0x1
2362#define MOVEFILE_COPY_ALLOWED 0x2
2363#define MOVEFILE_DELAY_UNTIL_REBOOT 0x4
2364#define MOVEFILE_WRITE_THROUGH 0x8
2365#define MOVEFILE_CREATE_HARDLINK 0x10
2366#define MOVEFILE_FAIL_IF_NOT_TRACKABLE 0x20
2367
2368 WINBASEAPI WINBOOL WINAPI ReplaceFileA(LPCSTR lpReplacedFileName,LPCSTR lpReplacementFileName,LPCSTR lpBackupFileName,DWORD dwReplaceFlags,LPVOID lpExclude,LPVOID lpReserved);
2369 WINBASEAPI WINBOOL WINAPI ReplaceFileW(LPCWSTR lpReplacedFileName,LPCWSTR lpReplacementFileName,LPCWSTR lpBackupFileName,DWORD dwReplaceFlags,LPVOID lpExclude,LPVOID lpReserved);
2370 WINBASEAPI WINBOOL WINAPI CreateHardLinkA(LPCSTR lpFileName,LPCSTR lpExistingFileName,LPSECURITY_ATTRIBUTES lpSecurityAttributes);
2371 WINBASEAPI WINBOOL WINAPI CreateHardLinkW(LPCWSTR lpFileName,LPCWSTR lpExistingFileName,LPSECURITY_ATTRIBUTES lpSecurityAttributes);
2372
2373 typedef enum _STREAM_INFO_LEVELS {
2374 FindStreamInfoStandard,FindStreamInfoMaxInfoLevel
2375 } STREAM_INFO_LEVELS;
2376
2377 typedef struct _WIN32_FIND_STREAM_DATA {
2378 LARGE_INTEGER StreamSize;
2379 WCHAR cStreamName[MAX_PATH + 36];
2380 } WIN32_FIND_STREAM_DATA,*PWIN32_FIND_STREAM_DATA;
2381
2382 HANDLE WINAPI FindFirstStreamW(LPCWSTR lpFileName,STREAM_INFO_LEVELS InfoLevel,LPVOID lpFindStreamData,DWORD dwFlags);
2383 WINBOOL WINAPI FindNextStreamW(HANDLE hFindStream,LPVOID lpFindStreamData);
2384 WINBASEAPI HANDLE WINAPI CreateNamedPipeA(LPCSTR lpName,DWORD dwOpenMode,DWORD dwPipeMode,DWORD nMaxInstances,DWORD nOutBufferSize,DWORD nInBufferSize,DWORD nDefaultTimeOut,LPSECURITY_ATTRIBUTES lpSecurityAttributes);
2385 WINBASEAPI HANDLE WINAPI CreateNamedPipeW(LPCWSTR lpName,DWORD dwOpenMode,DWORD dwPipeMode,DWORD nMaxInstances,DWORD nOutBufferSize,DWORD nInBufferSize,DWORD nDefaultTimeOut,LPSECURITY_ATTRIBUTES lpSecurityAttributes);
2386 WINBASEAPI WINBOOL WINAPI GetNamedPipeHandleStateA(HANDLE hNamedPipe,LPDWORD lpState,LPDWORD lpCurInstances,LPDWORD lpMaxCollectionCount,LPDWORD lpCollectDataTimeout,LPSTR lpUserName,DWORD nMaxUserNameSize);
2387 WINBASEAPI WINBOOL WINAPI GetNamedPipeHandleStateW(HANDLE hNamedPipe,LPDWORD lpState,LPDWORD lpCurInstances,LPDWORD lpMaxCollectionCount,LPDWORD lpCollectDataTimeout,LPWSTR lpUserName,DWORD nMaxUserNameSize);
2388 WINBASEAPI WINBOOL WINAPI CallNamedPipeA(LPCSTR lpNamedPipeName,LPVOID lpInBuffer,DWORD nInBufferSize,LPVOID lpOutBuffer,DWORD nOutBufferSize,LPDWORD lpBytesRead,DWORD nTimeOut);
2389 WINBASEAPI WINBOOL WINAPI CallNamedPipeW(LPCWSTR lpNamedPipeName,LPVOID lpInBuffer,DWORD nInBufferSize,LPVOID lpOutBuffer,DWORD nOutBufferSize,LPDWORD lpBytesRead,DWORD nTimeOut);
2390 WINBASEAPI WINBOOL WINAPI WaitNamedPipeA(LPCSTR lpNamedPipeName,DWORD nTimeOut);
2391 WINBASEAPI WINBOOL WINAPI WaitNamedPipeW(LPCWSTR lpNamedPipeName,DWORD nTimeOut);
2392 WINBASEAPI WINBOOL WINAPI SetVolumeLabelA(LPCSTR lpRootPathName,LPCSTR lpVolumeName);
2393 WINBASEAPI WINBOOL WINAPI SetVolumeLabelW(LPCWSTR lpRootPathName,LPCWSTR lpVolumeName);
2394 WINBASEAPI VOID WINAPI SetFileApisToOEM(VOID);
2395 WINBASEAPI VOID WINAPI SetFileApisToANSI(VOID);
2396 WINBASEAPI WINBOOL WINAPI AreFileApisANSI(VOID);
2397 WINBASEAPI WINBOOL WINAPI GetVolumeInformationA(LPCSTR lpRootPathName,LPSTR lpVolumeNameBuffer,DWORD nVolumeNameSize,LPDWORD lpVolumeSerialNumber,LPDWORD lpMaximumComponentLength,LPDWORD lpFileSystemFlags,LPSTR lpFileSystemNameBuffer,DWORD nFileSystemNameSize);
2398 WINBASEAPI WINBOOL WINAPI GetVolumeInformationW(LPCWSTR lpRootPathName,LPWSTR lpVolumeNameBuffer,DWORD nVolumeNameSize,LPDWORD lpVolumeSerialNumber,LPDWORD lpMaximumComponentLength,LPDWORD lpFileSystemFlags,LPWSTR lpFileSystemNameBuffer,DWORD nFileSystemNameSize);
2399 WINBASEAPI WINBOOL WINAPI CancelIo(HANDLE hFile);
2400 WINADVAPI WINBOOL WINAPI ClearEventLogA(HANDLE hEventLog,LPCSTR lpBackupFileName);
2401 WINADVAPI WINBOOL WINAPI ClearEventLogW(HANDLE hEventLog,LPCWSTR lpBackupFileName);
2402 WINADVAPI WINBOOL WINAPI BackupEventLogA(HANDLE hEventLog,LPCSTR lpBackupFileName);
2403 WINADVAPI WINBOOL WINAPI BackupEventLogW(HANDLE hEventLog,LPCWSTR lpBackupFileName);
2404 WINADVAPI WINBOOL WINAPI CloseEventLog(HANDLE hEventLog);
2405 WINADVAPI WINBOOL WINAPI DeregisterEventSource(HANDLE hEventLog);
2406 WINADVAPI WINBOOL WINAPI NotifyChangeEventLog(HANDLE hEventLog,HANDLE hEvent);
2407 WINADVAPI WINBOOL WINAPI GetNumberOfEventLogRecords(HANDLE hEventLog,PDWORD NumberOfRecords);
2408 WINADVAPI WINBOOL WINAPI GetOldestEventLogRecord(HANDLE hEventLog,PDWORD OldestRecord);
2409 WINADVAPI HANDLE WINAPI OpenEventLogA(LPCSTR lpUNCServerName,LPCSTR lpSourceName);
2410 WINADVAPI HANDLE WINAPI OpenEventLogW(LPCWSTR lpUNCServerName,LPCWSTR lpSourceName);
2411 WINADVAPI HANDLE WINAPI RegisterEventSourceA(LPCSTR lpUNCServerName,LPCSTR lpSourceName);
2412 WINADVAPI HANDLE WINAPI RegisterEventSourceW(LPCWSTR lpUNCServerName,LPCWSTR lpSourceName);
2413 WINADVAPI HANDLE WINAPI OpenBackupEventLogA(LPCSTR lpUNCServerName,LPCSTR lpFileName);
2414 WINADVAPI HANDLE WINAPI OpenBackupEventLogW(LPCWSTR lpUNCServerName,LPCWSTR lpFileName);
2415 WINADVAPI WINBOOL WINAPI ReadEventLogA(HANDLE hEventLog,DWORD dwReadFlags,DWORD dwRecordOffset,LPVOID lpBuffer,DWORD nNumberOfBytesToRead,DWORD *pnBytesRead,DWORD *pnMinNumberOfBytesNeeded);
2416 WINADVAPI WINBOOL WINAPI ReadEventLogW(HANDLE hEventLog,DWORD dwReadFlags,DWORD dwRecordOffset,LPVOID lpBuffer,DWORD nNumberOfBytesToRead,DWORD *pnBytesRead,DWORD *pnMinNumberOfBytesNeeded);
2417 WINADVAPI WINBOOL WINAPI ReportEventA(HANDLE hEventLog,WORD wType,WORD wCategory,DWORD dwEventID,PSID lpUserSid,WORD wNumStrings,DWORD dwDataSize,LPCSTR *lpStrings,LPVOID lpRawData);
2418 WINADVAPI WINBOOL WINAPI ReportEventW(HANDLE hEventLog,WORD wType,WORD wCategory,DWORD dwEventID,PSID lpUserSid,WORD wNumStrings,DWORD dwDataSize,LPCWSTR *lpStrings,LPVOID lpRawData);
2419
2420#define EVENTLOG_FULL_INFO 0
2421
2422 typedef struct _EVENTLOG_FULL_INFORMATION {
2423 DWORD dwFull;
2424 } EVENTLOG_FULL_INFORMATION,*LPEVENTLOG_FULL_INFORMATION;
2425
2426 WINADVAPI WINBOOL WINAPI GetEventLogInformation(HANDLE hEventLog,DWORD dwInfoLevel,LPVOID lpBuffer,DWORD cbBufSize,LPDWORD pcbBytesNeeded);
2427 WINADVAPI WINBOOL WINAPI DuplicateToken(HANDLE ExistingTokenHandle,SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,PHANDLE DuplicateTokenHandle);
2428 WINADVAPI WINBOOL WINAPI GetKernelObjectSecurity(HANDLE Handle,SECURITY_INFORMATION RequestedInformation,PSECURITY_DESCRIPTOR pSecurityDescriptor,DWORD nLength,LPDWORD lpnLengthNeeded);
2429 WINADVAPI WINBOOL WINAPI ImpersonateNamedPipeClient(HANDLE hNamedPipe);
2430 WINADVAPI WINBOOL WINAPI ImpersonateSelf(SECURITY_IMPERSONATION_LEVEL ImpersonationLevel);
2431 WINADVAPI WINBOOL WINAPI RevertToSelf(VOID);
2432 WINADVAPI WINBOOL WINAPI SetThreadToken (PHANDLE Thread,HANDLE Token);
2433 WINADVAPI WINBOOL WINAPI AccessCheck(PSECURITY_DESCRIPTOR pSecurityDescriptor,HANDLE ClientToken,DWORD DesiredAccess,PGENERIC_MAPPING GenericMapping,PPRIVILEGE_SET PrivilegeSet,LPDWORD PrivilegeSetLength,LPDWORD GrantedAccess,LPBOOL AccessStatus);
2434 WINADVAPI WINBOOL WINAPI AccessCheckByType(PSECURITY_DESCRIPTOR pSecurityDescriptor,PSID PrincipalSelfSid,HANDLE ClientToken,DWORD DesiredAccess,POBJECT_TYPE_LIST ObjectTypeList,DWORD ObjectTypeListLength,PGENERIC_MAPPING GenericMapping,PPRIVILEGE_SET PrivilegeSet,LPDWORD PrivilegeSetLength,LPDWORD GrantedAccess,LPBOOL AccessStatus);
2435 WINADVAPI WINBOOL WINAPI AccessCheckByTypeResultList(PSECURITY_DESCRIPTOR pSecurityDescriptor,PSID PrincipalSelfSid,HANDLE ClientToken,DWORD DesiredAccess,POBJECT_TYPE_LIST ObjectTypeList,DWORD ObjectTypeListLength,PGENERIC_MAPPING GenericMapping,PPRIVILEGE_SET PrivilegeSet,LPDWORD PrivilegeSetLength,LPDWORD GrantedAccessList,LPDWORD AccessStatusList);
2436 WINADVAPI WINBOOL WINAPI OpenProcessToken(HANDLE ProcessHandle,DWORD DesiredAccess,PHANDLE TokenHandle);
2437 WINADVAPI WINBOOL WINAPI OpenThreadToken(HANDLE ThreadHandle,DWORD DesiredAccess,WINBOOL OpenAsSelf,PHANDLE TokenHandle);
2438 WINADVAPI WINBOOL WINAPI GetTokenInformation(HANDLE TokenHandle,TOKEN_INFORMATION_CLASS TokenInformationClass,LPVOID TokenInformation,DWORD TokenInformationLength,PDWORD ReturnLength);
2439 WINADVAPI WINBOOL WINAPI SetTokenInformation(HANDLE TokenHandle,TOKEN_INFORMATION_CLASS TokenInformationClass,LPVOID TokenInformation,DWORD TokenInformationLength);
2440 WINADVAPI WINBOOL WINAPI AdjustTokenPrivileges(HANDLE TokenHandle,WINBOOL DisableAllPrivileges,PTOKEN_PRIVILEGES NewState,DWORD BufferLength,PTOKEN_PRIVILEGES PreviousState,PDWORD ReturnLength);
2441 WINADVAPI WINBOOL WINAPI AdjustTokenGroups(HANDLE TokenHandle,WINBOOL ResetToDefault,PTOKEN_GROUPS NewState,DWORD BufferLength,PTOKEN_GROUPS PreviousState,PDWORD ReturnLength);
2442 WINADVAPI WINBOOL WINAPI PrivilegeCheck(HANDLE ClientToken,PPRIVILEGE_SET RequiredPrivileges,LPBOOL pfResult);
2443 WINADVAPI WINBOOL WINAPI AccessCheckAndAuditAlarmA(LPCSTR SubsystemName,LPVOID HandleId,LPSTR ObjectTypeName,LPSTR ObjectName,PSECURITY_DESCRIPTOR SecurityDescriptor,DWORD DesiredAccess,PGENERIC_MAPPING GenericMapping,WINBOOL ObjectCreation,LPDWORD GrantedAccess,LPBOOL AccessStatus,LPBOOL pfGenerateOnClose);
2444 WINADVAPI WINBOOL WINAPI AccessCheckAndAuditAlarmW(LPCWSTR SubsystemName,LPVOID HandleId,LPWSTR ObjectTypeName,LPWSTR ObjectName,PSECURITY_DESCRIPTOR SecurityDescriptor,DWORD DesiredAccess,PGENERIC_MAPPING GenericMapping,WINBOOL ObjectCreation,LPDWORD GrantedAccess,LPBOOL AccessStatus,LPBOOL pfGenerateOnClose);
2445 WINADVAPI WINBOOL WINAPI AccessCheckByTypeAndAuditAlarmA(LPCSTR SubsystemName,LPVOID HandleId,LPCSTR ObjectTypeName,LPCSTR ObjectName,PSECURITY_DESCRIPTOR SecurityDescriptor,PSID PrincipalSelfSid,DWORD DesiredAccess,AUDIT_EVENT_TYPE AuditType,DWORD Flags,POBJECT_TYPE_LIST ObjectTypeList,DWORD ObjectTypeListLength,PGENERIC_MAPPING GenericMapping,WINBOOL ObjectCreation,LPDWORD GrantedAccess,LPBOOL AccessStatus,LPBOOL pfGenerateOnClose);
2446 WINADVAPI WINBOOL WINAPI AccessCheckByTypeAndAuditAlarmW(LPCWSTR SubsystemName,LPVOID HandleId,LPCWSTR ObjectTypeName,LPCWSTR ObjectName,PSECURITY_DESCRIPTOR SecurityDescriptor,PSID PrincipalSelfSid,DWORD DesiredAccess,AUDIT_EVENT_TYPE AuditType,DWORD Flags,POBJECT_TYPE_LIST ObjectTypeList,DWORD ObjectTypeListLength,PGENERIC_MAPPING GenericMapping,WINBOOL ObjectCreation,LPDWORD GrantedAccess,LPBOOL AccessStatus,LPBOOL pfGenerateOnClose);
2447 WINADVAPI WINBOOL WINAPI AccessCheckByTypeResultListAndAuditAlarmA(LPCSTR SubsystemName,LPVOID HandleId,LPCSTR ObjectTypeName,LPCSTR ObjectName,PSECURITY_DESCRIPTOR SecurityDescriptor,PSID PrincipalSelfSid,DWORD DesiredAccess,AUDIT_EVENT_TYPE AuditType,DWORD Flags,POBJECT_TYPE_LIST ObjectTypeList,DWORD ObjectTypeListLength,PGENERIC_MAPPING GenericMapping,WINBOOL ObjectCreation,LPDWORD GrantedAccess,LPDWORD AccessStatusList,LPBOOL pfGenerateOnClose);
2448 WINADVAPI WINBOOL WINAPI AccessCheckByTypeResultListAndAuditAlarmW(LPCWSTR SubsystemName,LPVOID HandleId,LPCWSTR ObjectTypeName,LPCWSTR ObjectName,PSECURITY_DESCRIPTOR SecurityDescriptor,PSID PrincipalSelfSid,DWORD DesiredAccess,AUDIT_EVENT_TYPE AuditType,DWORD Flags,POBJECT_TYPE_LIST ObjectTypeList,DWORD ObjectTypeListLength,PGENERIC_MAPPING GenericMapping,WINBOOL ObjectCreation,LPDWORD GrantedAccess,LPDWORD AccessStatusList,LPBOOL pfGenerateOnClose);
2449 WINADVAPI WINBOOL WINAPI AccessCheckByTypeResultListAndAuditAlarmByHandleA(LPCSTR SubsystemName,LPVOID HandleId,HANDLE ClientToken,LPCSTR ObjectTypeName,LPCSTR ObjectName,PSECURITY_DESCRIPTOR SecurityDescriptor,PSID PrincipalSelfSid,DWORD DesiredAccess,AUDIT_EVENT_TYPE AuditType,DWORD Flags,POBJECT_TYPE_LIST ObjectTypeList,DWORD ObjectTypeListLength,PGENERIC_MAPPING GenericMapping,WINBOOL ObjectCreation,LPDWORD GrantedAccess,LPDWORD AccessStatusList,LPBOOL pfGenerateOnClose);
2450 WINADVAPI WINBOOL WINAPI AccessCheckByTypeResultListAndAuditAlarmByHandleW(LPCWSTR SubsystemName,LPVOID HandleId,HANDLE ClientToken,LPCWSTR ObjectTypeName,LPCWSTR ObjectName,PSECURITY_DESCRIPTOR SecurityDescriptor,PSID PrincipalSelfSid,DWORD DesiredAccess,AUDIT_EVENT_TYPE AuditType,DWORD Flags,POBJECT_TYPE_LIST ObjectTypeList,DWORD ObjectTypeListLength,PGENERIC_MAPPING GenericMapping,WINBOOL ObjectCreation,LPDWORD GrantedAccess,LPDWORD AccessStatusList,LPBOOL pfGenerateOnClose);
2451 WINADVAPI WINBOOL WINAPI ObjectOpenAuditAlarmA(LPCSTR SubsystemName,LPVOID HandleId,LPSTR ObjectTypeName,LPSTR ObjectName,PSECURITY_DESCRIPTOR pSecurityDescriptor,HANDLE ClientToken,DWORD DesiredAccess,DWORD GrantedAccess,PPRIVILEGE_SET Privileges,WINBOOL ObjectCreation,WINBOOL AccessGranted,LPBOOL GenerateOnClose);
2452 WINADVAPI WINBOOL WINAPI ObjectOpenAuditAlarmW(LPCWSTR SubsystemName,LPVOID HandleId,LPWSTR ObjectTypeName,LPWSTR ObjectName,PSECURITY_DESCRIPTOR pSecurityDescriptor,HANDLE ClientToken,DWORD DesiredAccess,DWORD GrantedAccess,PPRIVILEGE_SET Privileges,WINBOOL ObjectCreation,WINBOOL AccessGranted,LPBOOL GenerateOnClose);
2453 WINADVAPI WINBOOL WINAPI ObjectPrivilegeAuditAlarmA(LPCSTR SubsystemName,LPVOID HandleId,HANDLE ClientToken,DWORD DesiredAccess,PPRIVILEGE_SET Privileges,WINBOOL AccessGranted);
2454 WINADVAPI WINBOOL WINAPI ObjectPrivilegeAuditAlarmW(LPCWSTR SubsystemName,LPVOID HandleId,HANDLE ClientToken,DWORD DesiredAccess,PPRIVILEGE_SET Privileges,WINBOOL AccessGranted);
2455 WINADVAPI WINBOOL WINAPI ObjectCloseAuditAlarmA(LPCSTR SubsystemName,LPVOID HandleId,WINBOOL GenerateOnClose);
2456 WINADVAPI WINBOOL WINAPI ObjectCloseAuditAlarmW(LPCWSTR SubsystemName,LPVOID HandleId,WINBOOL GenerateOnClose);
2457 WINADVAPI WINBOOL WINAPI ObjectDeleteAuditAlarmA(LPCSTR SubsystemName,LPVOID HandleId,WINBOOL GenerateOnClose);
2458 WINADVAPI WINBOOL WINAPI ObjectDeleteAuditAlarmW(LPCWSTR SubsystemName,LPVOID HandleId,WINBOOL GenerateOnClose);
2459 WINADVAPI WINBOOL WINAPI PrivilegedServiceAuditAlarmA(LPCSTR SubsystemName,LPCSTR ServiceName,HANDLE ClientToken,PPRIVILEGE_SET Privileges,WINBOOL AccessGranted);
2460 WINADVAPI WINBOOL WINAPI PrivilegedServiceAuditAlarmW(LPCWSTR SubsystemName,LPCWSTR ServiceName,HANDLE ClientToken,PPRIVILEGE_SET Privileges,WINBOOL AccessGranted);
2461 WINADVAPI WINBOOL WINAPI IsWellKnownSid(PSID pSid,WELL_KNOWN_SID_TYPE WellKnownSidType);
2462 WINADVAPI WINBOOL WINAPI CreateWellKnownSid(WELL_KNOWN_SID_TYPE WellKnownSidType,PSID DomainSid,PSID pSid,DWORD *cbSid);
2463 WINADVAPI WINBOOL WINAPI EqualDomainSid(PSID pSid1,PSID pSid2,WINBOOL *pfEqual);
2464 WINADVAPI WINBOOL WINAPI GetWindowsAccountDomainSid(PSID pSid,PSID pDomainSid,DWORD *cbDomainSid);
2465 WINADVAPI WINBOOL WINAPI IsValidSid(PSID pSid);
2466 WINADVAPI WINBOOL WINAPI EqualSid(PSID pSid1,PSID pSid2);
2467 WINADVAPI WINBOOL WINAPI EqualPrefixSid(PSID pSid1,PSID pSid2);
2468 WINADVAPI DWORD WINAPI GetSidLengthRequired (UCHAR nSubAuthorityCount);
2469 WINADVAPI WINBOOL WINAPI AllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,BYTE nSubAuthorityCount,DWORD nSubAuthority0,DWORD nSubAuthority1,DWORD nSubAuthority2,DWORD nSubAuthority3,DWORD nSubAuthority4,DWORD nSubAuthority5,DWORD nSubAuthority6,DWORD nSubAuthority7,PSID *pSid);
2470 WINADVAPI PVOID WINAPI FreeSid(PSID pSid);
2471 WINADVAPI WINBOOL WINAPI InitializeSid(PSID Sid,PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,BYTE nSubAuthorityCount);
2472 WINADVAPI PSID_IDENTIFIER_AUTHORITY WINAPI GetSidIdentifierAuthority(PSID pSid);
2473 WINADVAPI PDWORD WINAPI GetSidSubAuthority(PSID pSid,DWORD nSubAuthority);
2474 WINADVAPI PUCHAR WINAPI GetSidSubAuthorityCount(PSID pSid);
2475 WINADVAPI DWORD WINAPI GetLengthSid(PSID pSid);
2476 WINADVAPI WINBOOL WINAPI CopySid(DWORD nDestinationSidLength,PSID pDestinationSid,PSID pSourceSid);
2477 WINADVAPI WINBOOL WINAPI AreAllAccessesGranted(DWORD GrantedAccess,DWORD DesiredAccess);
2478 WINADVAPI WINBOOL WINAPI AreAnyAccessesGranted(DWORD GrantedAccess,DWORD DesiredAccess);
2479 WINADVAPI VOID WINAPI MapGenericMask(PDWORD AccessMask,PGENERIC_MAPPING GenericMapping);
2480 WINADVAPI WINBOOL WINAPI IsValidAcl(PACL pAcl);
2481 WINADVAPI WINBOOL WINAPI InitializeAcl(PACL pAcl,DWORD nAclLength,DWORD dwAclRevision);
2482 WINADVAPI WINBOOL WINAPI GetAclInformation(PACL pAcl,LPVOID pAclInformation,DWORD nAclInformationLength,ACL_INFORMATION_CLASS dwAclInformationClass);
2483 WINADVAPI WINBOOL WINAPI SetAclInformation(PACL pAcl,LPVOID pAclInformation,DWORD nAclInformationLength,ACL_INFORMATION_CLASS dwAclInformationClass);
2484 WINADVAPI WINBOOL WINAPI AddAce(PACL pAcl,DWORD dwAceRevision,DWORD dwStartingAceIndex,LPVOID pAceList,DWORD nAceListLength);
2485 WINADVAPI WINBOOL WINAPI DeleteAce(PACL pAcl,DWORD dwAceIndex);
2486 WINADVAPI WINBOOL WINAPI GetAce(PACL pAcl,DWORD dwAceIndex,LPVOID *pAce);
2487 WINADVAPI WINBOOL WINAPI AddAccessAllowedAce(PACL pAcl,DWORD dwAceRevision,DWORD AccessMask,PSID pSid);
2488 WINADVAPI WINBOOL WINAPI AddAccessAllowedAceEx(PACL pAcl,DWORD dwAceRevision,DWORD AceFlags,DWORD AccessMask,PSID pSid);
2489 WINADVAPI WINBOOL WINAPI AddAccessDeniedAce(PACL pAcl,DWORD dwAceRevision,DWORD AccessMask,PSID pSid);
2490 WINADVAPI WINBOOL WINAPI AddAccessDeniedAceEx(PACL pAcl,DWORD dwAceRevision,DWORD AceFlags,DWORD AccessMask,PSID pSid);
2491 WINADVAPI WINBOOL WINAPI AddAuditAccessAce(PACL pAcl,DWORD dwAceRevision,DWORD dwAccessMask,PSID pSid,WINBOOL bAuditSuccess,WINBOOL bAuditFailure);
2492 WINADVAPI WINBOOL WINAPI AddAuditAccessAceEx(PACL pAcl,DWORD dwAceRevision,DWORD AceFlags,DWORD dwAccessMask,PSID pSid,WINBOOL bAuditSuccess,WINBOOL bAuditFailure);
2493 WINADVAPI WINBOOL WINAPI AddAccessAllowedObjectAce(PACL pAcl,DWORD dwAceRevision,DWORD AceFlags,DWORD AccessMask,GUID *ObjectTypeGuid,GUID *InheritedObjectTypeGuid,PSID pSid);
2494 WINADVAPI WINBOOL WINAPI AddAccessDeniedObjectAce(PACL pAcl,DWORD dwAceRevision,DWORD AceFlags,DWORD AccessMask,GUID *ObjectTypeGuid,GUID *InheritedObjectTypeGuid,PSID pSid);
2495 WINADVAPI WINBOOL WINAPI AddAuditAccessObjectAce(PACL pAcl,DWORD dwAceRevision,DWORD AceFlags,DWORD AccessMask,GUID *ObjectTypeGuid,GUID *InheritedObjectTypeGuid,PSID pSid,WINBOOL bAuditSuccess,WINBOOL bAuditFailure);
2496 WINADVAPI WINBOOL WINAPI FindFirstFreeAce(PACL pAcl,LPVOID *pAce);
2497 WINADVAPI WINBOOL WINAPI InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR pSecurityDescriptor,DWORD dwRevision);
2498 WINADVAPI WINBOOL WINAPI IsValidSecurityDescriptor(PSECURITY_DESCRIPTOR pSecurityDescriptor);
2499 WINADVAPI DWORD WINAPI GetSecurityDescriptorLength(PSECURITY_DESCRIPTOR pSecurityDescriptor);
2500 WINADVAPI WINBOOL WINAPI GetSecurityDescriptorControl(PSECURITY_DESCRIPTOR pSecurityDescriptor,PSECURITY_DESCRIPTOR_CONTROL pControl,LPDWORD lpdwRevision);
2501 WINADVAPI WINBOOL WINAPI SetSecurityDescriptorControl(PSECURITY_DESCRIPTOR pSecurityDescriptor,SECURITY_DESCRIPTOR_CONTROL ControlBitsOfInterest,SECURITY_DESCRIPTOR_CONTROL ControlBitsToSet);
2502 WINADVAPI WINBOOL WINAPI SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor,WINBOOL bDaclPresent,PACL pDacl,WINBOOL bDaclDefaulted);
2503 WINADVAPI WINBOOL WINAPI GetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor,LPBOOL lpbDaclPresent,PACL *pDacl,LPBOOL lpbDaclDefaulted);
2504 WINADVAPI WINBOOL WINAPI SetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR pSecurityDescriptor,WINBOOL bSaclPresent,PACL pSacl,WINBOOL bSaclDefaulted);
2505 WINADVAPI WINBOOL WINAPI GetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR pSecurityDescriptor,LPBOOL lpbSaclPresent,PACL *pSacl,LPBOOL lpbSaclDefaulted);
2506 WINADVAPI WINBOOL WINAPI SetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR pSecurityDescriptor,PSID pOwner,WINBOOL bOwnerDefaulted);
2507 WINADVAPI WINBOOL WINAPI GetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR pSecurityDescriptor,PSID *pOwner,LPBOOL lpbOwnerDefaulted);
2508 WINADVAPI WINBOOL WINAPI SetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR pSecurityDescriptor,PSID pGroup,WINBOOL bGroupDefaulted);
2509 WINADVAPI WINBOOL WINAPI GetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR pSecurityDescriptor,PSID *pGroup,LPBOOL lpbGroupDefaulted);
2510 WINADVAPI DWORD WINAPI SetSecurityDescriptorRMControl(PSECURITY_DESCRIPTOR SecurityDescriptor,PUCHAR RMControl);
2511 WINADVAPI DWORD WINAPI GetSecurityDescriptorRMControl(PSECURITY_DESCRIPTOR SecurityDescriptor,PUCHAR RMControl);
2512 WINADVAPI WINBOOL WINAPI CreatePrivateObjectSecurity(PSECURITY_DESCRIPTOR ParentDescriptor,PSECURITY_DESCRIPTOR CreatorDescriptor,PSECURITY_DESCRIPTOR *NewDescriptor,WINBOOL IsDirectoryObject,HANDLE Token,PGENERIC_MAPPING GenericMapping);
2513 WINADVAPI WINBOOL WINAPI ConvertToAutoInheritPrivateObjectSecurity(PSECURITY_DESCRIPTOR ParentDescriptor,PSECURITY_DESCRIPTOR CurrentSecurityDescriptor,PSECURITY_DESCRIPTOR *NewSecurityDescriptor,GUID *ObjectType,BOOLEAN IsDirectoryObject,PGENERIC_MAPPING GenericMapping);
2514 WINADVAPI WINBOOL WINAPI CreatePrivateObjectSecurityEx(PSECURITY_DESCRIPTOR ParentDescriptor,PSECURITY_DESCRIPTOR CreatorDescriptor,PSECURITY_DESCRIPTOR *NewDescriptor,GUID *ObjectType,WINBOOL IsContainerObject,ULONG AutoInheritFlags,HANDLE Token,PGENERIC_MAPPING GenericMapping);
2515 WINADVAPI WINBOOL WINAPI CreatePrivateObjectSecurityWithMultipleInheritance(PSECURITY_DESCRIPTOR ParentDescriptor,PSECURITY_DESCRIPTOR CreatorDescriptor,PSECURITY_DESCRIPTOR *NewDescriptor,GUID **ObjectTypes,ULONG GuidCount,WINBOOL IsContainerObject,ULONG AutoInheritFlags,HANDLE Token,PGENERIC_MAPPING GenericMapping);
2516 WINADVAPI WINBOOL WINAPI SetPrivateObjectSecurity (SECURITY_INFORMATION SecurityInformation,PSECURITY_DESCRIPTOR ModificationDescriptor,PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor,PGENERIC_MAPPING GenericMapping,HANDLE Token);
2517 WINADVAPI WINBOOL WINAPI SetPrivateObjectSecurityEx (SECURITY_INFORMATION SecurityInformation,PSECURITY_DESCRIPTOR ModificationDescriptor,PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor,ULONG AutoInheritFlags,PGENERIC_MAPPING GenericMapping,HANDLE Token);
2518 WINADVAPI WINBOOL WINAPI GetPrivateObjectSecurity(PSECURITY_DESCRIPTOR ObjectDescriptor,SECURITY_INFORMATION SecurityInformation,PSECURITY_DESCRIPTOR ResultantDescriptor,DWORD DescriptorLength,PDWORD ReturnLength);
2519 WINADVAPI WINBOOL WINAPI DestroyPrivateObjectSecurity(PSECURITY_DESCRIPTOR *ObjectDescriptor);
2520 WINADVAPI WINBOOL WINAPI MakeSelfRelativeSD(PSECURITY_DESCRIPTOR pAbsoluteSecurityDescriptor,PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor,LPDWORD lpdwBufferLength);
2521 WINADVAPI WINBOOL WINAPI MakeAbsoluteSD(PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor,PSECURITY_DESCRIPTOR pAbsoluteSecurityDescriptor,LPDWORD lpdwAbsoluteSecurityDescriptorSize,PACL pDacl,LPDWORD lpdwDaclSize,PACL pSacl,LPDWORD lpdwSaclSize,PSID pOwner,LPDWORD lpdwOwnerSize,PSID pPrimaryGroup,LPDWORD lpdwPrimaryGroupSize);
2522 WINADVAPI WINBOOL WINAPI MakeAbsoluteSD2(PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor,LPDWORD lpdwBufferSize);
2523 WINADVAPI WINBOOL WINAPI SetFileSecurityA(LPCSTR lpFileName,SECURITY_INFORMATION SecurityInformation,PSECURITY_DESCRIPTOR pSecurityDescriptor);
2524 WINADVAPI WINBOOL WINAPI SetFileSecurityW(LPCWSTR lpFileName,SECURITY_INFORMATION SecurityInformation,PSECURITY_DESCRIPTOR pSecurityDescriptor);
2525 WINADVAPI WINBOOL WINAPI GetFileSecurityA(LPCSTR lpFileName,SECURITY_INFORMATION RequestedInformation,PSECURITY_DESCRIPTOR pSecurityDescriptor,DWORD nLength,LPDWORD lpnLengthNeeded);
2526 WINADVAPI WINBOOL WINAPI GetFileSecurityW(LPCWSTR lpFileName,SECURITY_INFORMATION RequestedInformation,PSECURITY_DESCRIPTOR pSecurityDescriptor,DWORD nLength,LPDWORD lpnLengthNeeded);
2527 WINADVAPI WINBOOL WINAPI SetKernelObjectSecurity(HANDLE Handle,SECURITY_INFORMATION SecurityInformation,PSECURITY_DESCRIPTOR SecurityDescriptor);
2528 WINBASEAPI HANDLE WINAPI FindFirstChangeNotificationA(LPCSTR lpPathName,WINBOOL bWatchSubtree,DWORD dwNotifyFilter);
2529 WINBASEAPI HANDLE WINAPI FindFirstChangeNotificationW(LPCWSTR lpPathName,WINBOOL bWatchSubtree,DWORD dwNotifyFilter);
2530 WINBASEAPI WINBOOL WINAPI FindNextChangeNotification(HANDLE hChangeHandle);
2531 WINBASEAPI WINBOOL WINAPI FindCloseChangeNotification(HANDLE hChangeHandle);
2532 WINBASEAPI WINBOOL WINAPI ReadDirectoryChangesW(HANDLE hDirectory,LPVOID lpBuffer,DWORD nBufferLength,WINBOOL bWatchSubtree,DWORD dwNotifyFilter,LPDWORD lpBytesReturned,LPOVERLAPPED lpOverlapped,LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
2533 WINBASEAPI WINBOOL WINAPI VirtualLock(LPVOID lpAddress,SIZE_T dwSize);
2534 WINBASEAPI WINBOOL WINAPI VirtualUnlock(LPVOID lpAddress,SIZE_T dwSize);
2535 WINBASEAPI LPVOID WINAPI MapViewOfFileEx(HANDLE hFileMappingObject,DWORD dwDesiredAccess,DWORD dwFileOffsetHigh,DWORD dwFileOffsetLow,SIZE_T dwNumberOfBytesToMap,LPVOID lpBaseAddress);
2536 WINBASEAPI WINBOOL WINAPI SetPriorityClass(HANDLE hProcess,DWORD dwPriorityClass);
2537 WINBASEAPI DWORD WINAPI GetPriorityClass(HANDLE hProcess);
2538 WINBASEAPI WINBOOL WINAPI IsBadReadPtr(CONST VOID *lp,UINT_PTR ucb);
2539 WINBASEAPI WINBOOL WINAPI IsBadWritePtr(LPVOID lp,UINT_PTR ucb);
2540 WINBASEAPI WINBOOL WINAPI IsBadHugeReadPtr(CONST VOID *lp,UINT_PTR ucb);
2541 WINBASEAPI WINBOOL WINAPI IsBadHugeWritePtr(LPVOID lp,UINT_PTR ucb);
2542 WINBASEAPI WINBOOL WINAPI IsBadCodePtr(FARPROC lpfn);
2543 WINBASEAPI WINBOOL WINAPI IsBadStringPtrA(LPCSTR lpsz,UINT_PTR ucchMax);
2544 WINBASEAPI WINBOOL WINAPI IsBadStringPtrW(LPCWSTR lpsz,UINT_PTR ucchMax);
2545 WINADVAPI WINBOOL WINAPI LookupAccountSidA(LPCSTR lpSystemName,PSID Sid,LPSTR Name,LPDWORD cchName,LPSTR ReferencedDomainName,LPDWORD cchReferencedDomainName,PSID_NAME_USE peUse);
2546 WINADVAPI WINBOOL WINAPI LookupAccountSidW(LPCWSTR lpSystemName,PSID Sid,LPWSTR Name,LPDWORD cchName,LPWSTR ReferencedDomainName,LPDWORD cchReferencedDomainName,PSID_NAME_USE peUse);
2547 WINADVAPI WINBOOL WINAPI LookupAccountNameA(LPCSTR lpSystemName,LPCSTR lpAccountName,PSID Sid,LPDWORD cbSid,LPSTR ReferencedDomainName,LPDWORD cchReferencedDomainName,PSID_NAME_USE peUse);
2548 WINADVAPI WINBOOL WINAPI LookupAccountNameW(LPCWSTR lpSystemName,LPCWSTR lpAccountName,PSID Sid,LPDWORD cbSid,LPWSTR ReferencedDomainName,LPDWORD cchReferencedDomainName,PSID_NAME_USE peUse);
2549 WINADVAPI WINBOOL WINAPI LookupPrivilegeValueA(LPCSTR lpSystemName,LPCSTR lpName,PLUID lpLuid);
2550 WINADVAPI WINBOOL WINAPI LookupPrivilegeValueW(LPCWSTR lpSystemName,LPCWSTR lpName,PLUID lpLuid);
2551 WINADVAPI WINBOOL WINAPI LookupPrivilegeNameA(LPCSTR lpSystemName,PLUID lpLuid,LPSTR lpName,LPDWORD cchName);
2552 WINADVAPI WINBOOL WINAPI LookupPrivilegeNameW(LPCWSTR lpSystemName,PLUID lpLuid,LPWSTR lpName,LPDWORD cchName);
2553 WINADVAPI WINBOOL WINAPI LookupPrivilegeDisplayNameA(LPCSTR lpSystemName,LPCSTR lpName,LPSTR lpDisplayName,LPDWORD cchDisplayName,LPDWORD lpLanguageId);
2554 WINADVAPI WINBOOL WINAPI LookupPrivilegeDisplayNameW(LPCWSTR lpSystemName,LPCWSTR lpName,LPWSTR lpDisplayName,LPDWORD cchDisplayName,LPDWORD lpLanguageId);
2555 WINADVAPI WINBOOL WINAPI AllocateLocallyUniqueId(PLUID Luid);
2556 WINBASEAPI WINBOOL WINAPI BuildCommDCBA(LPCSTR lpDef,LPDCB lpDCB);
2557 WINBASEAPI WINBOOL WINAPI BuildCommDCBW(LPCWSTR lpDef,LPDCB lpDCB);
2558 WINBASEAPI WINBOOL WINAPI BuildCommDCBAndTimeoutsA(LPCSTR lpDef,LPDCB lpDCB,LPCOMMTIMEOUTS lpCommTimeouts);
2559 WINBASEAPI WINBOOL WINAPI BuildCommDCBAndTimeoutsW(LPCWSTR lpDef,LPDCB lpDCB,LPCOMMTIMEOUTS lpCommTimeouts);
2560 WINBASEAPI WINBOOL WINAPI CommConfigDialogA(LPCSTR lpszName,HWND hWnd,LPCOMMCONFIG lpCC);
2561 WINBASEAPI WINBOOL WINAPI CommConfigDialogW(LPCWSTR lpszName,HWND hWnd,LPCOMMCONFIG lpCC);
2562 WINBASEAPI WINBOOL WINAPI GetDefaultCommConfigA(LPCSTR lpszName,LPCOMMCONFIG lpCC,LPDWORD lpdwSize);
2563 WINBASEAPI WINBOOL WINAPI GetDefaultCommConfigW(LPCWSTR lpszName,LPCOMMCONFIG lpCC,LPDWORD lpdwSize);
2564 WINBASEAPI WINBOOL WINAPI SetDefaultCommConfigA(LPCSTR lpszName,LPCOMMCONFIG lpCC,DWORD dwSize);
2565 WINBASEAPI WINBOOL WINAPI SetDefaultCommConfigW(LPCWSTR lpszName,LPCOMMCONFIG lpCC,DWORD dwSize);
2566
2567#define MAX_COMPUTERNAME_LENGTH 15
2568
2569 WINBASEAPI WINBOOL WINAPI GetComputerNameA(LPSTR lpBuffer,LPDWORD nSize);
2570 WINBASEAPI WINBOOL WINAPI GetComputerNameW(LPWSTR lpBuffer,LPDWORD nSize);
2571 WINBASEAPI WINBOOL WINAPI SetComputerNameA(LPCSTR lpComputerName);
2572 WINBASEAPI WINBOOL WINAPI SetComputerNameW(LPCWSTR lpComputerName);
2573
2574 typedef enum _COMPUTER_NAME_FORMAT {
2575 ComputerNameNetBIOS,ComputerNameDnsHostname,ComputerNameDnsDomain,ComputerNameDnsFullyQualified,ComputerNamePhysicalNetBIOS,ComputerNamePhysicalDnsHostname,ComputerNamePhysicalDnsDomain,ComputerNamePhysicalDnsFullyQualified,ComputerNameMax
2576 } COMPUTER_NAME_FORMAT;
2577
2578 WINBASEAPI WINBOOL WINAPI GetComputerNameExA(COMPUTER_NAME_FORMAT NameType,LPSTR lpBuffer,LPDWORD nSize);
2579 WINBASEAPI WINBOOL WINAPI GetComputerNameExW(COMPUTER_NAME_FORMAT NameType,LPWSTR lpBuffer,LPDWORD nSize);
2580 WINBASEAPI WINBOOL WINAPI SetComputerNameExA(COMPUTER_NAME_FORMAT NameType,LPCSTR lpBuffer);
2581 WINBASEAPI WINBOOL WINAPI SetComputerNameExW(COMPUTER_NAME_FORMAT NameType,LPCWSTR lpBuffer);
2582 WINBASEAPI WINBOOL WINAPI DnsHostnameToComputerNameA(LPCSTR Hostname,LPSTR ComputerName,LPDWORD nSize);
2583 WINBASEAPI WINBOOL WINAPI DnsHostnameToComputerNameW(LPCWSTR Hostname,LPWSTR ComputerName,LPDWORD nSize);
2584 WINADVAPI WINBOOL WINAPI GetUserNameA(LPSTR lpBuffer,LPDWORD pcbBuffer);
2585 WINADVAPI WINBOOL WINAPI GetUserNameW(LPWSTR lpBuffer,LPDWORD pcbBuffer);
2586
2587#define LOGON32_LOGON_INTERACTIVE 2
2588#define LOGON32_LOGON_NETWORK 3
2589#define LOGON32_LOGON_BATCH 4
2590#define LOGON32_LOGON_SERVICE 5
2591#define LOGON32_LOGON_UNLOCK 7
2592#define LOGON32_LOGON_NETWORK_CLEARTEXT 8
2593#define LOGON32_LOGON_NEW_CREDENTIALS 9
2594
2595#define LOGON32_PROVIDER_DEFAULT 0
2596#define LOGON32_PROVIDER_WINNT35 1
2597#define LOGON32_PROVIDER_WINNT40 2
2598#define LOGON32_PROVIDER_WINNT50 3
2599
2600#ifdef UNICODE
2601#define LogonUser LogonUserW
2602#define LogonUserEx LogonUserExW
2603#define CreateProcessAsUser CreateProcessAsUserW
2604#else
2605#define LogonUser LogonUserA
2606#define LogonUserEx LogonUserExA
2607#define CreateProcessAsUser CreateProcessAsUserA
2608#endif
2609
2610 WINADVAPI WINBOOL WINAPI LogonUserA(LPCSTR lpszUsername,LPCSTR lpszDomain,LPCSTR lpszPassword,DWORD dwLogonType,DWORD dwLogonProvider,PHANDLE phToken);
2611 WINADVAPI WINBOOL WINAPI LogonUserW(LPCWSTR lpszUsername,LPCWSTR lpszDomain,LPCWSTR lpszPassword,DWORD dwLogonType,DWORD dwLogonProvider,PHANDLE phToken);
2612 WINADVAPI WINBOOL WINAPI LogonUserExA(LPCSTR lpszUsername,LPCSTR lpszDomain,LPCSTR lpszPassword,DWORD dwLogonType,DWORD dwLogonProvider,PHANDLE phToken,PSID *ppLogonSid,PVOID *ppProfileBuffer,LPDWORD pdwProfileLength,PQUOTA_LIMITS pQuotaLimits);
2613 WINADVAPI WINBOOL WINAPI LogonUserExW(LPCWSTR lpszUsername,LPCWSTR lpszDomain,LPCWSTR lpszPassword,DWORD dwLogonType,DWORD dwLogonProvider,PHANDLE phToken,PSID *ppLogonSid,PVOID *ppProfileBuffer,LPDWORD pdwProfileLength,PQUOTA_LIMITS pQuotaLimits);
2614 WINADVAPI WINBOOL WINAPI ImpersonateLoggedOnUser(HANDLE hToken);
2615 WINADVAPI WINBOOL WINAPI CreateProcessAsUserA(HANDLE hToken,LPCSTR lpApplicationName,LPSTR lpCommandLine,LPSECURITY_ATTRIBUTES lpProcessAttributes,LPSECURITY_ATTRIBUTES lpThreadAttributes,WINBOOL bInheritHandles,DWORD dwCreationFlags,LPVOID lpEnvironment,LPCSTR lpCurrentDirectory,LPSTARTUPINFOA lpStartupInfo,LPPROCESS_INFORMATION lpProcessInformation);
2616 WINADVAPI WINBOOL WINAPI CreateProcessAsUserW(HANDLE hToken,LPCWSTR lpApplicationName,LPWSTR lpCommandLine,LPSECURITY_ATTRIBUTES lpProcessAttributes,LPSECURITY_ATTRIBUTES lpThreadAttributes,WINBOOL bInheritHandles,DWORD dwCreationFlags,LPVOID lpEnvironment,LPCWSTR lpCurrentDirectory,LPSTARTUPINFOW lpStartupInfo,LPPROCESS_INFORMATION lpProcessInformation);
2617
2618#define LOGON_WITH_PROFILE 0x1
2619#define LOGON_NETCREDENTIALS_ONLY 0x2
2620#define LOGON_ZERO_PASSWORD_BUFFER 0x80000000
2621
2622 WINADVAPI WINBOOL WINAPI CreateProcessWithLogonW(LPCWSTR lpUsername,LPCWSTR lpDomain,LPCWSTR lpPassword,DWORD dwLogonFlags,LPCWSTR lpApplicationName,LPWSTR lpCommandLine,DWORD dwCreationFlags,LPVOID lpEnvironment,LPCWSTR lpCurrentDirectory,LPSTARTUPINFOW lpStartupInfo,LPPROCESS_INFORMATION lpProcessInformation);
2623 WINADVAPI WINBOOL WINAPI CreateProcessWithTokenW(HANDLE hToken,DWORD dwLogonFlags,LPCWSTR lpApplicationName,LPWSTR lpCommandLine,DWORD dwCreationFlags,LPVOID lpEnvironment,LPCWSTR lpCurrentDirectory,LPSTARTUPINFOW lpStartupInfo,LPPROCESS_INFORMATION lpProcessInformation);
2624 WINADVAPI WINBOOL WINAPI ImpersonateAnonymousToken(HANDLE ThreadHandle);
2625 WINADVAPI WINBOOL WINAPI DuplicateTokenEx(HANDLE hExistingToken,DWORD dwDesiredAccess,LPSECURITY_ATTRIBUTES lpTokenAttributes,SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,TOKEN_TYPE TokenType,PHANDLE phNewToken);
2626 WINADVAPI WINBOOL WINAPI CreateRestrictedToken(HANDLE ExistingTokenHandle,DWORD Flags,DWORD DisableSidCount,PSID_AND_ATTRIBUTES SidsToDisable,DWORD DeletePrivilegeCount,PLUID_AND_ATTRIBUTES PrivilegesToDelete,DWORD RestrictedSidCount,PSID_AND_ATTRIBUTES SidsToRestrict,PHANDLE NewTokenHandle);
2627 WINADVAPI WINBOOL WINAPI IsTokenRestricted(HANDLE TokenHandle);
2628 WINADVAPI WINBOOL WINAPI IsTokenUntrusted(HANDLE TokenHandle);
2629 WINADVAPI WINBOOL WINAPI CheckTokenMembership(HANDLE TokenHandle,PSID SidToCheck,PBOOL IsMember);
2630
2631 typedef WAITORTIMERCALLBACKFUNC WAITORTIMERCALLBACK;
2632
2633 WINBASEAPI WINBOOL WINAPI RegisterWaitForSingleObject(PHANDLE phNewWaitObject,HANDLE hObject,WAITORTIMERCALLBACK Callback,PVOID Context,ULONG dwMilliseconds,ULONG dwFlags);
2634 WINBASEAPI HANDLE WINAPI RegisterWaitForSingleObjectEx(HANDLE hObject,WAITORTIMERCALLBACK Callback,PVOID Context,ULONG dwMilliseconds,ULONG dwFlags);
2635 WINBASEAPI WINBOOL WINAPI UnregisterWait(HANDLE WaitHandle);
2636 WINBASEAPI WINBOOL WINAPI UnregisterWaitEx(HANDLE WaitHandle,HANDLE CompletionEvent);
2637 WINBASEAPI WINBOOL WINAPI QueueUserWorkItem(LPTHREAD_START_ROUTINE Function,PVOID Context,ULONG Flags);
2638 WINBASEAPI WINBOOL WINAPI BindIoCompletionCallback(HANDLE FileHandle,LPOVERLAPPED_COMPLETION_ROUTINE Function,ULONG Flags);
2639 WINBASEAPI HANDLE WINAPI CreateTimerQueue(VOID);
2640 WINBASEAPI WINBOOL WINAPI CreateTimerQueueTimer(PHANDLE phNewTimer,HANDLE TimerQueue,WAITORTIMERCALLBACK Callback,PVOID Parameter,DWORD DueTime,DWORD Period,ULONG Flags);
2641 WINBASEAPI WINBOOL WINAPI ChangeTimerQueueTimer(HANDLE TimerQueue,HANDLE Timer,ULONG DueTime,ULONG Period);
2642 WINBASEAPI WINBOOL WINAPI DeleteTimerQueueTimer(HANDLE TimerQueue,HANDLE Timer,HANDLE CompletionEvent);
2643 WINBASEAPI WINBOOL WINAPI DeleteTimerQueueEx(HANDLE TimerQueue,HANDLE CompletionEvent);
2644 WINBASEAPI HANDLE WINAPI SetTimerQueueTimer(HANDLE TimerQueue,WAITORTIMERCALLBACK Callback,PVOID Parameter,DWORD DueTime,DWORD Period,WINBOOL PreferIo);
2645 WINBASEAPI WINBOOL WINAPI CancelTimerQueueTimer(HANDLE TimerQueue,HANDLE Timer);
2646 WINBASEAPI WINBOOL WINAPI DeleteTimerQueue(HANDLE TimerQueue);
2647
2648#define HW_PROFILE_GUIDLEN 39
2649#define MAX_PROFILE_LEN 80
2650
2651#define DOCKINFO_UNDOCKED (0x1)
2652#define DOCKINFO_DOCKED (0x2)
2653#define DOCKINFO_USER_SUPPLIED (0x4)
2654#define DOCKINFO_USER_UNDOCKED (DOCKINFO_USER_SUPPLIED | DOCKINFO_UNDOCKED)
2655#define DOCKINFO_USER_DOCKED (DOCKINFO_USER_SUPPLIED | DOCKINFO_DOCKED)
2656
2657 typedef struct tagHW_PROFILE_INFOA {
2658 DWORD dwDockInfo;
2659 CHAR szHwProfileGuid[HW_PROFILE_GUIDLEN];
2660 CHAR szHwProfileName[MAX_PROFILE_LEN];
2661 } HW_PROFILE_INFOA,*LPHW_PROFILE_INFOA;
2662
2663 typedef struct tagHW_PROFILE_INFOW {
2664 DWORD dwDockInfo;
2665 WCHAR szHwProfileGuid[HW_PROFILE_GUIDLEN];
2666 WCHAR szHwProfileName[MAX_PROFILE_LEN];
2667 } HW_PROFILE_INFOW,*LPHW_PROFILE_INFOW;
2668
2669#ifdef UNICODE
2670 typedef HW_PROFILE_INFOW HW_PROFILE_INFO;
2671 typedef LPHW_PROFILE_INFOW LPHW_PROFILE_INFO;
2672#else
2673 typedef HW_PROFILE_INFOA HW_PROFILE_INFO;
2674 typedef LPHW_PROFILE_INFOA LPHW_PROFILE_INFO;
2675#endif
2676
2677#ifdef UNICODE
2678#define GetCurrentHwProfile GetCurrentHwProfileW
2679#define GetVersionEx GetVersionExW
2680#define VerifyVersionInfo VerifyVersionInfoW
2681#else
2682#define GetCurrentHwProfile GetCurrentHwProfileA
2683#define GetVersionEx GetVersionExA
1840#define VerifyVersionInfo VerifyVersionInfoA2684#define VerifyVersionInfo VerifyVersionInfoA
1841#define WaitNamedPipe WaitNamedPipeA2685#endif
1842#define WritePrivateProfileSection WritePrivateProfileSectionA2686
1843#define WritePrivateProfileString WritePrivateProfileStringA2687 WINADVAPI WINBOOL WINAPI GetCurrentHwProfileA (LPHW_PROFILE_INFOA lpHwProfileInfo);
1844#define WritePrivateProfileStruct WritePrivateProfileStructA2688 WINADVAPI WINBOOL WINAPI GetCurrentHwProfileW (LPHW_PROFILE_INFOW lpHwProfileInfo);
1845#define WriteProfileSection WriteProfileSectionA2689 WINBASEAPI WINBOOL WINAPI QueryPerformanceCounter(LARGE_INTEGER *lpPerformanceCount);
1846#define WriteProfileString WriteProfileStringA2690 WINBASEAPI WINBOOL WINAPI QueryPerformanceFrequency(LARGE_INTEGER *lpFrequency);
2691 WINBASEAPI WINBOOL WINAPI GetVersionExA(LPOSVERSIONINFOA lpVersionInformation);
2692 WINBASEAPI WINBOOL WINAPI GetVersionExW(LPOSVERSIONINFOW lpVersionInformation);
2693 WINBASEAPI WINBOOL WINAPI VerifyVersionInfoA(LPOSVERSIONINFOEXA lpVersionInformation,DWORD dwTypeMask,DWORDLONG dwlConditionMask);
2694 WINBASEAPI WINBOOL WINAPI VerifyVersionInfoW(LPOSVERSIONINFOEXW lpVersionInformation,DWORD dwTypeMask,DWORDLONG dwlConditionMask);
2695
2696#include <winerror.h>
2697
2698#define TC_NORMAL 0
2699#define TC_HARDERR 1
2700#define TC_GP_TRAP 2
2701#define TC_SIGNAL 3
2702
2703#define AC_LINE_OFFLINE 0x0
2704#define AC_LINE_ONLINE 0x1
2705#define AC_LINE_BACKUP_POWER 0x2
2706#define AC_LINE_UNKNOWN 0xff
2707
2708#define BATTERY_FLAG_HIGH 0x1
2709#define BATTERY_FLAG_LOW 0x2
2710#define BATTERY_FLAG_CRITICAL 0x4
2711#define BATTERY_FLAG_CHARGING 0x8
2712#define BATTERY_FLAG_NO_BATTERY 0x80
2713#define BATTERY_FLAG_UNKNOWN 0xff
2714
2715#define BATTERY_PERCENTAGE_UNKNOWN 0xff
2716
2717#define BATTERY_LIFE_UNKNOWN 0xffffffff
2718
2719 typedef struct _SYSTEM_POWER_STATUS {
2720 BYTE ACLineStatus;
2721 BYTE BatteryFlag;
2722 BYTE BatteryLifePercent;
2723 BYTE Reserved1;
2724 DWORD BatteryLifeTime;
2725 DWORD BatteryFullLifeTime;
2726 } SYSTEM_POWER_STATUS,*LPSYSTEM_POWER_STATUS;
2727
2728#ifdef UNICODE
2729#define CreateJobObject CreateJobObjectW
2730#define OpenJobObject OpenJobObjectW
2731#define FindFirstVolume FindFirstVolumeW
2732#define FindNextVolume FindNextVolumeW
2733#define FindFirstVolumeMountPoint FindFirstVolumeMountPointW
2734#define FindNextVolumeMountPoint FindNextVolumeMountPointW
2735#define SetVolumeMountPoint SetVolumeMountPointW
2736#define DeleteVolumeMountPoint DeleteVolumeMountPointW
2737#define GetVolumeNameForVolumeMountPoint GetVolumeNameForVolumeMountPointW
2738#define GetVolumePathName GetVolumePathNameW
2739#define GetVolumePathNamesForVolumeName GetVolumePathNamesForVolumeNameW
2740#else
2741#define CreateJobObject CreateJobObjectA
2742#define OpenJobObject OpenJobObjectA
2743#define FindFirstVolume FindFirstVolumeA
2744#define FindNextVolume FindNextVolumeA
2745#define FindFirstVolumeMountPoint FindFirstVolumeMountPointA
2746#define FindNextVolumeMountPoint FindNextVolumeMountPointA
2747#define SetVolumeMountPoint SetVolumeMountPointA
2748#define DeleteVolumeMountPoint DeleteVolumeMountPointA
2749#define GetVolumeNameForVolumeMountPoint GetVolumeNameForVolumeMountPointA
2750#define GetVolumePathName GetVolumePathNameA
2751#define GetVolumePathNamesForVolumeName GetVolumePathNamesForVolumeNameA
2752#endif
2753
2754 WINBOOL WINAPI GetSystemPowerStatus(LPSYSTEM_POWER_STATUS lpSystemPowerStatus);
2755 WINBOOL WINAPI SetSystemPowerState(WINBOOL fSuspend,WINBOOL fForce);
2756 WINBASEAPI WINBOOL WINAPI AllocateUserPhysicalPages(HANDLE hProcess,PULONG_PTR NumberOfPages,PULONG_PTR PageArray);
2757 WINBASEAPI WINBOOL WINAPI FreeUserPhysicalPages(HANDLE hProcess,PULONG_PTR NumberOfPages,PULONG_PTR PageArray);
2758 WINBASEAPI WINBOOL WINAPI MapUserPhysicalPages(PVOID VirtualAddress,ULONG_PTR NumberOfPages,PULONG_PTR PageArray);
2759 WINBASEAPI WINBOOL WINAPI MapUserPhysicalPagesScatter(PVOID *VirtualAddresses,ULONG_PTR NumberOfPages,PULONG_PTR PageArray);
2760 WINBASEAPI HANDLE WINAPI CreateJobObjectA(LPSECURITY_ATTRIBUTES lpJobAttributes,LPCSTR lpName);
2761 WINBASEAPI HANDLE WINAPI CreateJobObjectW(LPSECURITY_ATTRIBUTES lpJobAttributes,LPCWSTR lpName);
2762 WINBASEAPI HANDLE WINAPI OpenJobObjectA(DWORD dwDesiredAccess,WINBOOL bInheritHandle,LPCSTR lpName);
2763 WINBASEAPI HANDLE WINAPI OpenJobObjectW(DWORD dwDesiredAccess,WINBOOL bInheritHandle,LPCWSTR lpName);
2764 WINBASEAPI WINBOOL WINAPI AssignProcessToJobObject(HANDLE hJob,HANDLE hProcess);
2765 WINBASEAPI WINBOOL WINAPI TerminateJobObject(HANDLE hJob,UINT uExitCode);
2766 WINBASEAPI WINBOOL WINAPI QueryInformationJobObject(HANDLE hJob,JOBOBJECTINFOCLASS JobObjectInformationClass,LPVOID lpJobObjectInformation,DWORD cbJobObjectInformationLength,LPDWORD lpReturnLength);
2767 WINBASEAPI WINBOOL WINAPI SetInformationJobObject(HANDLE hJob,JOBOBJECTINFOCLASS JobObjectInformationClass,LPVOID lpJobObjectInformation,DWORD cbJobObjectInformationLength);
2768 WINBASEAPI WINBOOL WINAPI IsProcessInJob(HANDLE ProcessHandle,HANDLE JobHandle,PBOOL Result);
2769 WINBASEAPI WINBOOL WINAPI CreateJobSet(ULONG NumJob,PJOB_SET_ARRAY UserJobSet,ULONG Flags);
2770 WINBASEAPI PVOID WINAPI AddVectoredExceptionHandler (ULONG First,PVECTORED_EXCEPTION_HANDLER Handler);
2771 WINBASEAPI ULONG WINAPI RemoveVectoredExceptionHandler(PVOID Handle);
2772 WINBASEAPI PVOID WINAPI AddVectoredContinueHandler (ULONG First,PVECTORED_EXCEPTION_HANDLER Handler);
2773 WINBASEAPI ULONG WINAPI RemoveVectoredContinueHandler(PVOID Handle);
2774 WINBASEAPI HANDLE WINAPI FindFirstVolumeA(LPSTR lpszVolumeName,DWORD cchBufferLength);
2775 WINBASEAPI HANDLE WINAPI FindFirstVolumeW(LPWSTR lpszVolumeName,DWORD cchBufferLength);
2776 WINBASEAPI WINBOOL WINAPI FindNextVolumeA(HANDLE hFindVolume,LPSTR lpszVolumeName,DWORD cchBufferLength);
2777 WINBASEAPI WINBOOL WINAPI FindNextVolumeW(HANDLE hFindVolume,LPWSTR lpszVolumeName,DWORD cchBufferLength);
2778 WINBASEAPI WINBOOL WINAPI FindVolumeClose(HANDLE hFindVolume);
2779 WINBASEAPI HANDLE WINAPI FindFirstVolumeMountPointA(LPCSTR lpszRootPathName,LPSTR lpszVolumeMountPoint,DWORD cchBufferLength);
2780 WINBASEAPI HANDLE WINAPI FindFirstVolumeMountPointW(LPCWSTR lpszRootPathName,LPWSTR lpszVolumeMountPoint,DWORD cchBufferLength);
2781 WINBASEAPI WINBOOL WINAPI FindNextVolumeMountPointA(HANDLE hFindVolumeMountPoint,LPSTR lpszVolumeMountPoint,DWORD cchBufferLength);
2782 WINBASEAPI WINBOOL WINAPI FindNextVolumeMountPointW(HANDLE hFindVolumeMountPoint,LPWSTR lpszVolumeMountPoint,DWORD cchBufferLength);
2783 WINBASEAPI WINBOOL WINAPI FindVolumeMountPointClose(HANDLE hFindVolumeMountPoint);
2784 WINBASEAPI WINBOOL WINAPI SetVolumeMountPointA(LPCSTR lpszVolumeMountPoint,LPCSTR lpszVolumeName);
2785 WINBASEAPI WINBOOL WINAPI SetVolumeMountPointW(LPCWSTR lpszVolumeMountPoint,LPCWSTR lpszVolumeName);
2786 WINBASEAPI WINBOOL WINAPI DeleteVolumeMountPointA(LPCSTR lpszVolumeMountPoint);
2787 WINBASEAPI WINBOOL WINAPI DeleteVolumeMountPointW(LPCWSTR lpszVolumeMountPoint);
2788 WINBASEAPI WINBOOL WINAPI GetVolumeNameForVolumeMountPointA(LPCSTR lpszVolumeMountPoint,LPSTR lpszVolumeName,DWORD cchBufferLength);
2789 WINBASEAPI WINBOOL WINAPI GetVolumeNameForVolumeMountPointW(LPCWSTR lpszVolumeMountPoint,LPWSTR lpszVolumeName,DWORD cchBufferLength);
2790 WINBASEAPI WINBOOL WINAPI GetVolumePathNameA(LPCSTR lpszFileName,LPSTR lpszVolumePathName,DWORD cchBufferLength);
2791 WINBASEAPI WINBOOL WINAPI GetVolumePathNameW(LPCWSTR lpszFileName,LPWSTR lpszVolumePathName,DWORD cchBufferLength);
2792 WINBASEAPI WINBOOL WINAPI GetVolumePathNamesForVolumeNameA(LPCSTR lpszVolumeName,LPCH lpszVolumePathNames,DWORD cchBufferLength,PDWORD lpcchReturnLength);
2793 WINBASEAPI WINBOOL WINAPI GetVolumePathNamesForVolumeNameW(LPCWSTR lpszVolumeName,LPWCH lpszVolumePathNames,DWORD cchBufferLength,PDWORD lpcchReturnLength);
2794
2795#define ACTCTX_FLAG_PROCESSOR_ARCHITECTURE_VALID 0x1
2796#define ACTCTX_FLAG_LANGID_VALID 0x2
2797#define ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID 0x4
2798#define ACTCTX_FLAG_RESOURCE_NAME_VALID 0x8
2799#define ACTCTX_FLAG_SET_PROCESS_DEFAULT 0x10
2800#define ACTCTX_FLAG_APPLICATION_NAME_VALID 0x20
2801#define ACTCTX_FLAG_SOURCE_IS_ASSEMBLYREF 0x40
2802#define ACTCTX_FLAG_HMODULE_VALID 0x80
2803
2804 typedef struct tagACTCTXA {
2805 ULONG cbSize;
2806 DWORD dwFlags;
2807 LPCSTR lpSource;
2808 USHORT wProcessorArchitecture;
2809 LANGID wLangId;
2810 LPCSTR lpAssemblyDirectory;
2811 LPCSTR lpResourceName;
2812 LPCSTR lpApplicationName;
2813 HMODULE hModule;
2814 } ACTCTXA,*PACTCTXA;
2815
2816 typedef struct tagACTCTXW {
2817 ULONG cbSize;
2818 DWORD dwFlags;
2819 LPCWSTR lpSource;
2820 USHORT wProcessorArchitecture;
2821 LANGID wLangId;
2822 LPCWSTR lpAssemblyDirectory;
2823 LPCWSTR lpResourceName;
2824 LPCWSTR lpApplicationName;
2825 HMODULE hModule;
2826 } ACTCTXW,*PACTCTXW;
2827
2828 typedef const ACTCTXA *PCACTCTXA;
2829 typedef const ACTCTXW *PCACTCTXW;
2830
2831#ifdef UNICODE
2832 typedef ACTCTXW ACTCTX;
2833 typedef PACTCTXW PACTCTX;
2834 typedef PCACTCTXW PCACTCTX;
2835#else
2836 typedef ACTCTXA ACTCTX;
2837 typedef PACTCTXA PACTCTX;
2838 typedef PCACTCTXA PCACTCTX;
2839#endif
2840
2841#ifdef UNICODE
2842#define CreateActCtx CreateActCtxW
2843#else
2844#define CreateActCtx CreateActCtxA
2845#endif
2846
2847 WINBASEAPI HANDLE WINAPI CreateActCtxA(PCACTCTXA pActCtx);
2848 WINBASEAPI HANDLE WINAPI CreateActCtxW(PCACTCTXW pActCtx);
2849 WINBASEAPI VOID WINAPI AddRefActCtx(HANDLE hActCtx);
2850 WINBASEAPI VOID WINAPI ReleaseActCtx(HANDLE hActCtx);
2851 WINBASEAPI WINBOOL WINAPI ZombifyActCtx(HANDLE hActCtx);
2852 WINBASEAPI WINBOOL WINAPI ActivateActCtx(HANDLE hActCtx,ULONG_PTR *lpCookie);
2853
2854#define DEACTIVATE_ACTCTX_FLAG_FORCE_EARLY_DEACTIVATION (0x1)
2855
2856 WINBASEAPI WINBOOL WINAPI DeactivateActCtx(DWORD dwFlags,ULONG_PTR ulCookie);
2857 WINBASEAPI WINBOOL WINAPI GetCurrentActCtx(HANDLE *lphActCtx);
2858
2859 typedef struct tagACTCTX_SECTION_KEYED_DATA_2600 {
2860 ULONG cbSize;
2861 ULONG ulDataFormatVersion;
2862 PVOID lpData;
2863 ULONG ulLength;
2864 PVOID lpSectionGlobalData;
2865 ULONG ulSectionGlobalDataLength;
2866 PVOID lpSectionBase;
2867 ULONG ulSectionTotalLength;
2868 HANDLE hActCtx;
2869 ULONG ulAssemblyRosterIndex;
2870 } ACTCTX_SECTION_KEYED_DATA_2600,*PACTCTX_SECTION_KEYED_DATA_2600;
2871
2872 typedef const ACTCTX_SECTION_KEYED_DATA_2600 *PCACTCTX_SECTION_KEYED_DATA_2600;
2873
2874 typedef struct tagACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA {
2875 PVOID lpInformation;
2876 PVOID lpSectionBase;
2877 ULONG ulSectionLength;
2878 PVOID lpSectionGlobalDataBase;
2879 ULONG ulSectionGlobalDataLength;
2880 } ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA,*PACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA;
2881
2882 typedef const ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA *PCACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA;
2883
2884 typedef struct tagACTCTX_SECTION_KEYED_DATA {
2885 ULONG cbSize;
2886 ULONG ulDataFormatVersion;
2887 PVOID lpData;
2888 ULONG ulLength;
2889 PVOID lpSectionGlobalData;
2890 ULONG ulSectionGlobalDataLength;
2891 PVOID lpSectionBase;
2892 ULONG ulSectionTotalLength;
2893 HANDLE hActCtx;
2894 ULONG ulAssemblyRosterIndex;
2895
2896 ULONG ulFlags;
2897 ACTCTX_SECTION_KEYED_DATA_ASSEMBLY_METADATA AssemblyMetadata;
2898 } ACTCTX_SECTION_KEYED_DATA,*PACTCTX_SECTION_KEYED_DATA;
2899
2900 typedef const ACTCTX_SECTION_KEYED_DATA *PCACTCTX_SECTION_KEYED_DATA;
2901
2902#define FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX 0x1
2903#define FIND_ACTCTX_SECTION_KEY_RETURN_FLAGS 0x2
2904#define FIND_ACTCTX_SECTION_KEY_RETURN_ASSEMBLY_METADATA 0x4
2905
2906#ifdef UNICODE
2907#define FindActCtxSectionString FindActCtxSectionStringW
2908#else
2909#define FindActCtxSectionString FindActCtxSectionStringA
2910#endif
2911
2912 WINBASEAPI WINBOOL WINAPI FindActCtxSectionStringA(DWORD dwFlags,const GUID *lpExtensionGuid,ULONG ulSectionId,LPCSTR lpStringToFind,PACTCTX_SECTION_KEYED_DATA ReturnedData);
2913 WINBASEAPI WINBOOL WINAPI FindActCtxSectionStringW(DWORD dwFlags,const GUID *lpExtensionGuid,ULONG ulSectionId,LPCWSTR lpStringToFind,PACTCTX_SECTION_KEYED_DATA ReturnedData);
2914 WINBASEAPI WINBOOL WINAPI FindActCtxSectionGuid(DWORD dwFlags,const GUID *lpExtensionGuid,ULONG ulSectionId,const GUID *lpGuidToFind,PACTCTX_SECTION_KEYED_DATA ReturnedData);
2915
2916#ifndef RC_INVOKED
2917#ifndef ACTIVATION_CONTEXT_BASIC_INFORMATION_DEFINED
2918
2919 typedef struct _ACTIVATION_CONTEXT_BASIC_INFORMATION {
2920 HANDLE hActCtx;
2921 DWORD dwFlags;
2922 } ACTIVATION_CONTEXT_BASIC_INFORMATION,*PACTIVATION_CONTEXT_BASIC_INFORMATION;
2923
2924 typedef const struct _ACTIVATION_CONTEXT_BASIC_INFORMATION *PCACTIVATION_CONTEXT_BASIC_INFORMATION;
2925
2926#define ACTIVATION_CONTEXT_BASIC_INFORMATION_DEFINED 1
1847#endif2927#endif
1848#endif2928#endif
2929
2930#define QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX 0x4
2931#define QUERY_ACTCTX_FLAG_ACTCTX_IS_HMODULE 0x8
2932#define QUERY_ACTCTX_FLAG_ACTCTX_IS_ADDRESS 0x10
2933#define QUERY_ACTCTX_FLAG_NO_ADDREF 0x80000000
2934
2935 WINBASEAPI WINBOOL WINAPI QueryActCtxW(DWORD dwFlags,HANDLE hActCtx,PVOID pvSubInstance,ULONG ulInfoClass,PVOID pvBuffer,SIZE_T cbBuffer,SIZE_T *pcbWrittenOrRequired);
2936
2937 typedef WINBOOL (WINAPI *PQUERYACTCTXW_FUNC)(DWORD dwFlags,HANDLE hActCtx,PVOID pvSubInstance,ULONG ulInfoClass,PVOID pvBuffer,SIZE_T cbBuffer,SIZE_T *pcbWrittenOrRequired);
2938
2939 WINBASEAPI WINBOOL WINAPI ProcessIdToSessionId(DWORD dwProcessId,DWORD *pSessionId);
2940 WINBASEAPI DWORD WINAPI WTSGetActiveConsoleSessionId();
2941 WINBASEAPI WINBOOL WINAPI IsWow64Process(HANDLE hProcess,PBOOL Wow64Process);
2942 WINBASEAPI WINBOOL WINAPI GetLogicalProcessorInformation(PSYSTEM_LOGICAL_PROCESSOR_INFORMATION Buffer,PDWORD ReturnedLength);
2943 WINBASEAPI WINBOOL WINAPI GetNumaHighestNodeNumber(PULONG HighestNodeNumber);
2944 WINBASEAPI WINBOOL WINAPI GetNumaProcessorNode(UCHAR Processor,PUCHAR NodeNumber);
2945 WINBASEAPI WINBOOL WINAPI GetNumaNodeProcessorMask(UCHAR Node,PULONGLONG ProcessorMask);
2946 WINBASEAPI WINBOOL WINAPI GetNumaAvailableMemoryNode(UCHAR Node,PULONGLONG AvailableBytes);
2947
1849#ifdef __cplusplus2948#ifdef __cplusplus
1850}2949}
1851#endif2950#endif
1852#endif /* _WINBASE_H */2951#endif
win32/include/winapi/wincon.h+268−174
@@ -1,206 +1,300 @@
1#ifndef _WINCON_H1/**
2#define _WINCON_H2 * This file has no copyright assigned and is placed in the Public Domain.
3#if __GNUC__ >=33 * This file is part of the w64 mingw-runtime package.
4#pragma GCC system_header4 * No warranty is given; refer to the file DISCLAIMER within this package.
5#endif5 */
6 6#ifndef _WINCON_
7#define _WINCON_
7 8
8#ifdef __cplusplus9#ifdef __cplusplus
9extern "C" {10extern "C" {
10#endif11#endif
11 12
12#define FOREGROUND_BLUE 113 typedef struct _COORD {
13#define FOREGROUND_GREEN 214 SHORT X;
14#define FOREGROUND_RED 415 SHORT Y;
15#define FOREGROUND_INTENSITY 816 } COORD,*PCOORD;
16#define BACKGROUND_BLUE 1617
17#define BACKGROUND_GREEN 3218 typedef struct _SMALL_RECT {
18#define BACKGROUND_RED 6419 SHORT Left;
19#define BACKGROUND_INTENSITY 12820 SHORT Top;
21 SHORT Right;
22 SHORT Bottom;
23 } SMALL_RECT,*PSMALL_RECT;
24
25 typedef struct _KEY_EVENT_RECORD {
26 WINBOOL bKeyDown;
27 WORD wRepeatCount;
28 WORD wVirtualKeyCode;
29 WORD wVirtualScanCode;
30 union {
31 WCHAR UnicodeChar;
32 CHAR AsciiChar;
33 } uChar;
34 DWORD dwControlKeyState;
35 } KEY_EVENT_RECORD,*PKEY_EVENT_RECORD;
36
37#define RIGHT_ALT_PRESSED 0x1
38#define LEFT_ALT_PRESSED 0x2
39#define RIGHT_CTRL_PRESSED 0x4
40#define LEFT_CTRL_PRESSED 0x8
41#define SHIFT_PRESSED 0x10
42#define NUMLOCK_ON 0x20
43#define SCROLLLOCK_ON 0x40
44#define CAPSLOCK_ON 0x80
45#define ENHANCED_KEY 0x100
46#define NLS_DBCSCHAR 0x10000
47#define NLS_ALPHANUMERIC 0x0
48#define NLS_KATAKANA 0x20000
49#define NLS_HIRAGANA 0x40000
50#define NLS_ROMAN 0x400000
51#define NLS_IME_CONVERSION 0x800000
52#define NLS_IME_DISABLE 0x20000000
53
54 typedef struct _MOUSE_EVENT_RECORD {
55 COORD dwMousePosition;
56 DWORD dwButtonState;
57 DWORD dwControlKeyState;
58 DWORD dwEventFlags;
59 } MOUSE_EVENT_RECORD,*PMOUSE_EVENT_RECORD;
60
61#define FROM_LEFT_1ST_BUTTON_PRESSED 0x1
62#define RIGHTMOST_BUTTON_PRESSED 0x2
63#define FROM_LEFT_2ND_BUTTON_PRESSED 0x4
64#define FROM_LEFT_3RD_BUTTON_PRESSED 0x8
65#define FROM_LEFT_4TH_BUTTON_PRESSED 0x10
66
67#define MOUSE_MOVED 0x1
68#define DOUBLE_CLICK 0x2
69#define MOUSE_WHEELED 0x4
70
71 typedef struct _WINDOW_BUFFER_SIZE_RECORD {
72 COORD dwSize;
73 } WINDOW_BUFFER_SIZE_RECORD,*PWINDOW_BUFFER_SIZE_RECORD;
74
75 typedef struct _MENU_EVENT_RECORD {
76 UINT dwCommandId;
77 } MENU_EVENT_RECORD,*PMENU_EVENT_RECORD;
78
79 typedef struct _FOCUS_EVENT_RECORD {
80 WINBOOL bSetFocus;
81 } FOCUS_EVENT_RECORD,*PFOCUS_EVENT_RECORD;
82
83 typedef struct _INPUT_RECORD {
84 WORD EventType;
85 union {
86 KEY_EVENT_RECORD KeyEvent;
87 MOUSE_EVENT_RECORD MouseEvent;
88 WINDOW_BUFFER_SIZE_RECORD WindowBufferSizeEvent;
89 MENU_EVENT_RECORD MenuEvent;
90 FOCUS_EVENT_RECORD FocusEvent;
91 } Event;
92 } INPUT_RECORD,*PINPUT_RECORD;
93
94#define KEY_EVENT 0x1
95#define MOUSE_EVENT 0x2
96#define WINDOW_BUFFER_SIZE_EVENT 0x4
97#define MENU_EVENT 0x8
98#define FOCUS_EVENT 0x10
99
100 typedef struct _CHAR_INFO {
101 union {
102 WCHAR UnicodeChar;
103 CHAR AsciiChar;
104 } Char;
105 WORD Attributes;
106 } CHAR_INFO,*PCHAR_INFO;
107
108#define FOREGROUND_BLUE 0x1
109#define FOREGROUND_GREEN 0x2
110#define FOREGROUND_RED 0x4
111#define FOREGROUND_INTENSITY 0x8
112#define BACKGROUND_BLUE 0x10
113#define BACKGROUND_GREEN 0x20
114#define BACKGROUND_RED 0x40
115#define BACKGROUND_INTENSITY 0x80
116#define COMMON_LVB_LEADING_BYTE 0x100
117#define COMMON_LVB_TRAILING_BYTE 0x200
118#define COMMON_LVB_GRID_HORIZONTAL 0x400
119#define COMMON_LVB_GRID_LVERTICAL 0x800
120#define COMMON_LVB_GRID_RVERTICAL 0x1000
121#define COMMON_LVB_REVERSE_VIDEO 0x4000
122#define COMMON_LVB_UNDERSCORE 0x8000
123
124#define COMMON_LVB_SBCSDBCS 0x300
125
126 typedef struct _CONSOLE_SCREEN_BUFFER_INFO {
127 COORD dwSize;
128 COORD dwCursorPosition;
129 WORD wAttributes;
130 SMALL_RECT srWindow;
131 COORD dwMaximumWindowSize;
132 } CONSOLE_SCREEN_BUFFER_INFO,*PCONSOLE_SCREEN_BUFFER_INFO;
133
134 typedef struct _CONSOLE_CURSOR_INFO {
135 DWORD dwSize;
136 WINBOOL bVisible;
137 } CONSOLE_CURSOR_INFO,*PCONSOLE_CURSOR_INFO;
138
139 typedef struct _CONSOLE_FONT_INFO {
140 DWORD nFont;
141 COORD dwFontSize;
142 } CONSOLE_FONT_INFO,*PCONSOLE_FONT_INFO;
143
144 typedef struct _CONSOLE_SELECTION_INFO {
145 DWORD dwFlags;
146 COORD dwSelectionAnchor;
147 SMALL_RECT srSelection;
148 } CONSOLE_SELECTION_INFO,*PCONSOLE_SELECTION_INFO;
149
150#define CONSOLE_NO_SELECTION 0x0
151#define CONSOLE_SELECTION_IN_PROGRESS 0x1
152#define CONSOLE_SELECTION_NOT_EMPTY 0x2
153#define CONSOLE_MOUSE_SELECTION 0x4
154#define CONSOLE_MOUSE_DOWN 0x8
155
156 typedef WINBOOL (WINAPI *PHANDLER_ROUTINE)(DWORD CtrlType);
157
20#define CTRL_C_EVENT 0158#define CTRL_C_EVENT 0
21#define CTRL_BREAK_EVENT 1159#define CTRL_BREAK_EVENT 1
22#define CTRL_CLOSE_EVENT 2160#define CTRL_CLOSE_EVENT 2
161
23#define CTRL_LOGOFF_EVENT 5162#define CTRL_LOGOFF_EVENT 5
24#define CTRL_SHUTDOWN_EVENT 6163#define CTRL_SHUTDOWN_EVENT 6
25#define ENABLE_LINE_INPUT 2164
26#define ENABLE_ECHO_INPUT 4165#define ENABLE_PROCESSED_INPUT 0x1
27#define ENABLE_PROCESSED_INPUT 1166#define ENABLE_LINE_INPUT 0x2
28#define ENABLE_WINDOW_INPUT 8167#define ENABLE_ECHO_INPUT 0x4
29#define ENABLE_MOUSE_INPUT 16168#define ENABLE_WINDOW_INPUT 0x8
30#define ENABLE_PROCESSED_OUTPUT 1169#define ENABLE_MOUSE_INPUT 0x10
31#define ENABLE_WRAP_AT_EOL_OUTPUT 2170
32#define KEY_EVENT 1171#define ENABLE_PROCESSED_OUTPUT 0x1
33#define MOUSE_EVENT 2172#define ENABLE_WRAP_AT_EOL_OUTPUT 0x2
34#define WINDOW_BUFFER_SIZE_EVENT 4
35#define MENU_EVENT 8
36#define FOCUS_EVENT 16
37#define CAPSLOCK_ON 128
38#define ENHANCED_KEY 256
39#define RIGHT_ALT_PRESSED 1
40#define LEFT_ALT_PRESSED 2
41#define RIGHT_CTRL_PRESSED 4
42#define LEFT_CTRL_PRESSED 8
43#define SHIFT_PRESSED 16
44#define NUMLOCK_ON 32
45#define SCROLLLOCK_ON 64
46#define FROM_LEFT_1ST_BUTTON_PRESSED 1
47#define RIGHTMOST_BUTTON_PRESSED 2
48#define FROM_LEFT_2ND_BUTTON_PRESSED 4
49#define FROM_LEFT_3RD_BUTTON_PRESSED 8
50#define FROM_LEFT_4TH_BUTTON_PRESSED 16
51#define MOUSE_MOVED 1
52#define DOUBLE_CLICK 2
53#define MOUSE_WHEELED 4
54
55typedef struct _CHAR_INFO {
56 union {
57 WCHAR UnicodeChar;
58 CHAR AsciiChar;
59 } Char;
60 WORD Attributes;
61} CHAR_INFO,*PCHAR_INFO;
62typedef struct _SMALL_RECT {
63 SHORT Left;
64 SHORT Top;
65 SHORT Right;
66 SHORT Bottom;
67} SMALL_RECT,*PSMALL_RECT;
68typedef struct _CONSOLE_CURSOR_INFO {
69 DWORD dwSize;
70 BOOL bVisible;
71} CONSOLE_CURSOR_INFO,*PCONSOLE_CURSOR_INFO;
72typedef struct _COORD {
73 SHORT X;
74 SHORT Y;
75} COORD;
76typedef struct _CONSOLE_SCREEN_BUFFER_INFO {
77 COORD dwSize;
78 COORD dwCursorPosition;
79 WORD wAttributes;
80 SMALL_RECT srWindow;
81 COORD dwMaximumWindowSize;
82} CONSOLE_SCREEN_BUFFER_INFO,*PCONSOLE_SCREEN_BUFFER_INFO;
83typedef BOOL(CALLBACK *PHANDLER_ROUTINE)(DWORD);
84typedef struct _KEY_EVENT_RECORD {
85 BOOL bKeyDown;
86 WORD wRepeatCount;
87 WORD wVirtualKeyCode;
88 WORD wVirtualScanCode;
89 union {
90 WCHAR UnicodeChar;
91 CHAR AsciiChar;
92 } uChar;
93 DWORD dwControlKeyState;
94}
95#ifdef __GNUC__
96/* gcc's alignment is not what win32 expects */
97 PACKED
98#endif
99KEY_EVENT_RECORD;
100
101typedef struct _MOUSE_EVENT_RECORD {
102 COORD dwMousePosition;
103 DWORD dwButtonState;
104 DWORD dwControlKeyState;
105 DWORD dwEventFlags;
106} MOUSE_EVENT_RECORD;
107typedef struct _WINDOW_BUFFER_SIZE_RECORD { COORD dwSize; } WINDOW_BUFFER_SIZE_RECORD;
108typedef struct _MENU_EVENT_RECORD { UINT dwCommandId; } MENU_EVENT_RECORD,*PMENU_EVENT_RECORD;
109typedef struct _FOCUS_EVENT_RECORD { BOOL bSetFocus; } FOCUS_EVENT_RECORD;
110typedef struct _INPUT_RECORD {
111 WORD EventType;
112 union {
113 KEY_EVENT_RECORD KeyEvent;
114 MOUSE_EVENT_RECORD MouseEvent;
115 WINDOW_BUFFER_SIZE_RECORD WindowBufferSizeEvent;
116 MENU_EVENT_RECORD MenuEvent;
117 FOCUS_EVENT_RECORD FocusEvent;
118 } Event;
119} INPUT_RECORD,*PINPUT_RECORD;
120
121BOOL WINAPI AllocConsole(void);
122HANDLE WINAPI CreateConsoleScreenBuffer(DWORD,DWORD,LPSECURITY_ATTRIBUTES,DWORD,PVOID);
123BOOL WINAPI FillConsoleOutputAttribute(HANDLE,WORD,DWORD,COORD,PDWORD);
124BOOL WINAPI FillConsoleOutputCharacterA(HANDLE,CHAR,DWORD,COORD,PDWORD);
125BOOL WINAPI FillConsoleOutputCharacterW(HANDLE,WCHAR,DWORD,COORD,PDWORD);
126BOOL WINAPI FlushConsoleInputBuffer(HANDLE);
127BOOL WINAPI FreeConsole(void);
128BOOL WINAPI GenerateConsoleCtrlEvent(DWORD,DWORD);
129UINT WINAPI GetConsoleCP(void);
130BOOL WINAPI GetConsoleCursorInfo(HANDLE,PCONSOLE_CURSOR_INFO);
131BOOL WINAPI GetConsoleMode(HANDLE,PDWORD);
132UINT WINAPI GetConsoleOutputCP(void);
133BOOL WINAPI GetConsoleScreenBufferInfo(HANDLE,PCONSOLE_SCREEN_BUFFER_INFO);
134DWORD WINAPI GetConsoleTitleA(LPSTR,DWORD);
135DWORD WINAPI GetConsoleTitleW(LPWSTR,DWORD);
136COORD WINAPI GetLargestConsoleWindowSize(HANDLE);
137BOOL WINAPI GetNumberOfConsoleInputEvents(HANDLE,PDWORD);
138BOOL WINAPI GetNumberOfConsoleMouseButtons(PDWORD);
139BOOL WINAPI PeekConsoleInputA(HANDLE,PINPUT_RECORD,DWORD,PDWORD);
140BOOL WINAPI PeekConsoleInputW(HANDLE,PINPUT_RECORD,DWORD,PDWORD);
141BOOL WINAPI ReadConsoleA(HANDLE,PVOID,DWORD,PDWORD,PVOID);
142BOOL WINAPI ReadConsoleW(HANDLE,PVOID,DWORD,PDWORD,PVOID);
143BOOL WINAPI ReadConsoleInputA(HANDLE,PINPUT_RECORD,DWORD,PDWORD);
144BOOL WINAPI ReadConsoleInputW(HANDLE,PINPUT_RECORD,DWORD,PDWORD);
145BOOL WINAPI ReadConsoleOutputAttribute(HANDLE,LPWORD,DWORD,COORD,LPDWORD);
146BOOL WINAPI ReadConsoleOutputCharacterA(HANDLE,LPSTR,DWORD,COORD,PDWORD);
147BOOL WINAPI ReadConsoleOutputCharacterW(HANDLE,LPWSTR,DWORD,COORD,PDWORD);
148BOOL WINAPI ReadConsoleOutputA(HANDLE,PCHAR_INFO,COORD,COORD,PSMALL_RECT);
149BOOL WINAPI ReadConsoleOutputW(HANDLE,PCHAR_INFO,COORD,COORD,PSMALL_RECT);
150BOOL WINAPI ScrollConsoleScreenBufferA(HANDLE,const SMALL_RECT*,const SMALL_RECT*,COORD,const CHAR_INFO*);
151BOOL WINAPI ScrollConsoleScreenBufferW(HANDLE,const SMALL_RECT*,const SMALL_RECT*,COORD,const CHAR_INFO*);
152BOOL WINAPI SetConsoleActiveScreenBuffer(HANDLE);
153BOOL WINAPI SetConsoleCP(UINT);
154BOOL WINAPI SetConsoleCtrlHandler(PHANDLER_ROUTINE,BOOL);
155BOOL WINAPI SetConsoleCursorInfo(HANDLE,const CONSOLE_CURSOR_INFO*);
156BOOL WINAPI SetConsoleCursorPosition(HANDLE,COORD);
157BOOL WINAPI SetConsoleMode(HANDLE,DWORD);
158BOOL WINAPI SetConsoleOutputCP(UINT);
159BOOL WINAPI SetConsoleScreenBufferSize(HANDLE,COORD);
160BOOL WINAPI SetConsoleTextAttribute(HANDLE,WORD);
161BOOL WINAPI SetConsoleTitleA(LPCSTR);
162BOOL WINAPI SetConsoleTitleW(LPCWSTR);
163BOOL WINAPI SetConsoleWindowInfo(HANDLE,BOOL,const SMALL_RECT*);
164BOOL WINAPI WriteConsoleA(HANDLE,PCVOID,DWORD,PDWORD,PVOID);
165BOOL WINAPI WriteConsoleW(HANDLE,PCVOID,DWORD,PDWORD,PVOID);
166BOOL WINAPI WriteConsoleInputA(HANDLE,const INPUT_RECORD*,DWORD,PDWORD);
167BOOL WINAPI WriteConsoleInputW(HANDLE,const INPUT_RECORD*,DWORD,PDWORD);
168BOOL WINAPI WriteConsoleOutputA(HANDLE,const CHAR_INFO*,COORD,COORD,PSMALL_RECT);
169BOOL WINAPI WriteConsoleOutputW(HANDLE,const CHAR_INFO*,COORD,COORD,PSMALL_RECT);
170BOOL WINAPI WriteConsoleOutputAttribute(HANDLE,const WORD*,DWORD,COORD,PDWORD);
171BOOL WINAPI WriteConsoleOutputCharacterA(HANDLE,LPCSTR,DWORD,COORD,PDWORD);
172BOOL WINAPI WriteConsoleOutputCharacterW(HANDLE,LPCWSTR,DWORD,COORD,PDWORD);
173 173
174#ifdef UNICODE174#ifdef UNICODE
175#define FillConsoleOutputCharacter FillConsoleOutputCharacterW

137 more lines aren’t shown here.

win32/include/winapi/windef.h+239−186

This diff is large: its 478 lines aren’t shown here.

win32/include/winapi/windows.h+85−138

This diff is large: its 259 lines aren’t shown here.

win32/include/winapi/winerror.h+2446−334

This diff is large: its 2934 lines aren’t shown here.

win32/include/winapi/wingdi.h+3861−2624

This diff is large: its 6669 lines aren’t shown here.

win32/include/winapi/winnetwk.h+418−288

This diff is large: its 736 lines aren’t shown here.

win32/include/winapi/winnls.h+588−474

This diff is large: its 1149 lines aren’t shown here.

win32/include/winapi/winnt.h+5612−2509

This diff is large: its 8275 lines aren’t shown here.

win32/include/winapi/winreg.h+219−106

This diff is large: its 376 lines aren’t shown here.

win32/include/winapi/winsvc.h+351−263

This diff is large: its 661 lines aren’t shown here.

win32/include/winapi/winuser.h+5589−3410

This diff is large: its 9061 lines aren’t shown here.

win32/include/winapi/winver.h+132−105

This diff is large: its 265 lines aren’t shown here.

win32/lib/msvcrt.def+617−0

This diff is large: its 1233 lines aren’t shown here.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t