This commit is contained in:
bellard
2005-04-17 13:10:37 +00:00
parent 6144d43321
commit 5556cf1565
69 changed files with 23131 additions and 23131 deletions

View File

@ -1,15 +1,15 @@
//+--------------------------------------------------------------------------- //+---------------------------------------------------------------------------
// //
// dll.c - Windows DLL example - dynamically linked part // dll.c - Windows DLL example - dynamically linked part
// //
#include <windows.h> #include <windows.h>
#define DLL_EXPORT __declspec(dllexport) #define DLL_EXPORT __declspec(dllexport)
DLL_EXPORT void HelloWorld (void) DLL_EXPORT void HelloWorld (void)
{ {
MessageBox (0, "Hello World!", "From DLL", MB_ICONINFORMATION); MessageBox (0, "Hello World!", "From DLL", MB_ICONINFORMATION);
} }

View File

@ -1,6 +1,6 @@
; Windows DLL example - export definition for the DLL ; Windows DLL example - export definition for the DLL
LIBRARY dll.dll LIBRARY dll.dll
EXPORTS EXPORTS
HelloWorld HelloWorld

View File

@ -1,19 +1,19 @@
//+--------------------------------------------------------------------------- //+---------------------------------------------------------------------------
// //
// HELLO_DLL.C - Windows DLL example - main application part // HELLO_DLL.C - Windows DLL example - main application part
// //
#include <windows.h> #include <windows.h>
void HelloWorld (void); void HelloWorld (void);
int WINAPI WinMain( int WINAPI WinMain(
HINSTANCE hInstance, HINSTANCE hInstance,
HINSTANCE hPrevInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, LPSTR lpCmdLine,
int nCmdShow) int nCmdShow)
{ {
HelloWorld(); HelloWorld();
return 0; return 0;
} }

View File

@ -1,159 +1,159 @@
//+--------------------------------------------------------------------------- //+---------------------------------------------------------------------------
// //
// HELLO_WIN.C - Windows GUI 'Hello World!' Example // HELLO_WIN.C - Windows GUI 'Hello World!' Example
// //
//+--------------------------------------------------------------------------- //+---------------------------------------------------------------------------
#include <windows.h> #include <windows.h>
#define APPNAME "HELLO_WIN" #define APPNAME "HELLO_WIN"
char szAppName[] = APPNAME; // The name of this application char szAppName[] = APPNAME; // The name of this application
char szTitle[] = APPNAME; // The title bar text char szTitle[] = APPNAME; // The title bar text
char *pWindowText; char *pWindowText;
HINSTANCE g_hInst; // current instance HINSTANCE g_hInst; // current instance
void CenterWindow(HWND hWnd); void CenterWindow(HWND hWnd);
//+--------------------------------------------------------------------------- //+---------------------------------------------------------------------------
// //
// Function: WndProc // Function: WndProc
// //
// Synopsis: very unusual type of function - gets called by system to // Synopsis: very unusual type of function - gets called by system to
// process windows messages. // process windows messages.
// //
// Arguments: same as always. // Arguments: same as always.
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
switch (message) switch (message)
{ {
// ----------------------- first and last // ----------------------- first and last
case WM_CREATE: case WM_CREATE:
CenterWindow(hwnd); CenterWindow(hwnd);
break; break;
case WM_DESTROY: case WM_DESTROY:
PostQuitMessage(0); PostQuitMessage(0);
break; break;
// ----------------------- get out of it... // ----------------------- get out of it...
case WM_RBUTTONUP: case WM_RBUTTONUP:
DestroyWindow(hwnd); DestroyWindow(hwnd);
break; break;
case WM_KEYDOWN: case WM_KEYDOWN:
if (VK_ESCAPE == wParam) if (VK_ESCAPE == wParam)
DestroyWindow(hwnd); DestroyWindow(hwnd);
break; break;
// ----------------------- display our minimal info // ----------------------- display our minimal info
case WM_PAINT: case WM_PAINT:
{ {
PAINTSTRUCT ps; PAINTSTRUCT ps;
HDC hdc; HDC hdc;
RECT rc; RECT rc;
hdc = BeginPaint(hwnd, &ps); hdc = BeginPaint(hwnd, &ps);
GetClientRect(hwnd, &rc); GetClientRect(hwnd, &rc);
SetTextColor(hdc, RGB(240,240,96)); SetTextColor(hdc, RGB(240,240,96));
SetBkMode(hdc, TRANSPARENT); SetBkMode(hdc, TRANSPARENT);
DrawText(hdc, pWindowText, -1, &rc, DT_CENTER|DT_SINGLELINE|DT_VCENTER); DrawText(hdc, pWindowText, -1, &rc, DT_CENTER|DT_SINGLELINE|DT_VCENTER);
EndPaint(hwnd, &ps); EndPaint(hwnd, &ps);
break; break;
} }
// ----------------------- let windows do all other stuff // ----------------------- let windows do all other stuff
default: default:
return DefWindowProc(hwnd, message, wParam, lParam); return DefWindowProc(hwnd, message, wParam, lParam);
} }
return 0; return 0;
} }
//+--------------------------------------------------------------------------- //+---------------------------------------------------------------------------
// //
// Function: WinMain // Function: WinMain
// //
// Synopsis: standard entrypoint for GUI Win32 apps // Synopsis: standard entrypoint for GUI Win32 apps
// //
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
int APIENTRY WinMain( int APIENTRY WinMain(
HINSTANCE hInstance, HINSTANCE hInstance,
HINSTANCE hPrevInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, LPSTR lpCmdLine,
int nCmdShow) int nCmdShow)
{ {
MSG msg; MSG msg;
WNDCLASS wc; WNDCLASS wc;
HWND hwnd; HWND hwnd;
// Fill in window class structure with parameters that describe // Fill in window class structure with parameters that describe
// the main window. // the main window.
ZeroMemory(&wc, sizeof wc); ZeroMemory(&wc, sizeof wc);
wc.hInstance = hInstance; wc.hInstance = hInstance;
wc.lpszClassName = szAppName; wc.lpszClassName = szAppName;
wc.lpfnWndProc = (WNDPROC)WndProc; wc.lpfnWndProc = (WNDPROC)WndProc;
wc.style = CS_DBLCLKS|CS_VREDRAW|CS_HREDRAW; wc.style = CS_DBLCLKS|CS_VREDRAW|CS_HREDRAW;
wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hCursor = LoadCursor(NULL, IDC_ARROW);
if (FALSE == RegisterClass(&wc)) return 0; if (FALSE == RegisterClass(&wc)) return 0;
// create the browser // create the browser
hwnd = CreateWindow( hwnd = CreateWindow(
szAppName, szAppName,
szTitle, szTitle,
WS_OVERLAPPEDWINDOW|WS_VISIBLE, WS_OVERLAPPEDWINDOW|WS_VISIBLE,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
360,//CW_USEDEFAULT, 360,//CW_USEDEFAULT,
240,//CW_USEDEFAULT, 240,//CW_USEDEFAULT,
0, 0,
0, 0,
g_hInst, g_hInst,
0); 0);
if (NULL == hwnd) return 0; if (NULL == hwnd) return 0;
pWindowText = lpCmdLine[0] ? lpCmdLine : "Hello Windows!"; pWindowText = lpCmdLine[0] ? lpCmdLine : "Hello Windows!";
// Main message loop: // Main message loop:
while (GetMessage(&msg, NULL, 0, 0) > 0) while (GetMessage(&msg, NULL, 0, 0) > 0)
{ {
TranslateMessage(&msg); TranslateMessage(&msg);
DispatchMessage(&msg); DispatchMessage(&msg);
} }
return msg.wParam; return msg.wParam;
} }
//+--------------------------------------------------------------------------- //+---------------------------------------------------------------------------
//+--------------------------------------------------------------------------- //+---------------------------------------------------------------------------
void CenterWindow(HWND hwnd_self) void CenterWindow(HWND hwnd_self)
{ {
RECT rw_self, rc_parent, rw_parent; HWND hwnd_parent; RECT rw_self, rc_parent, rw_parent; HWND hwnd_parent;
hwnd_parent = GetParent(hwnd_self); hwnd_parent = GetParent(hwnd_self);
if (NULL==hwnd_parent) hwnd_parent = GetDesktopWindow(); if (NULL==hwnd_parent) hwnd_parent = GetDesktopWindow();
GetWindowRect(hwnd_parent, &rw_parent); GetWindowRect(hwnd_parent, &rw_parent);
GetClientRect(hwnd_parent, &rc_parent); GetClientRect(hwnd_parent, &rc_parent);
GetWindowRect(hwnd_self, &rw_self); GetWindowRect(hwnd_self, &rw_self);
SetWindowPos(hwnd_self, NULL, SetWindowPos(hwnd_self, NULL,
rw_parent.left + (rc_parent.right + rw_self.left - rw_self.right) / 2, rw_parent.left + (rc_parent.right + rw_self.left - rw_self.right) / 2,
rw_parent.top + (rc_parent.bottom + rw_self.top - rw_self.bottom) / 2, rw_parent.top + (rc_parent.bottom + rw_self.top - rw_self.bottom) / 2,
0, 0, 0, 0,
SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE
); );
} }
//+--------------------------------------------------------------------------- //+---------------------------------------------------------------------------

View File

@ -1,71 +1,71 @@
/* /*
* assert.h * assert.h
* *
* Define the assert macro for debug output. * Define the assert macro for debug output.
* *
* This file is part of the Mingw32 package. * This file is part of the Mingw32 package.
* *
* Contributors: * Contributors:
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp> * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
* *
* THIS SOFTWARE IS NOT COPYRIGHTED * THIS SOFTWARE IS NOT COPYRIGHTED
* *
* This source code is offered for use in the public domain. You may * This source code is offered for use in the public domain. You may
* use, modify or distribute it freely. * use, modify or distribute it freely.
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* $Author: bellard $ * $Author: bellard $
* $Date: 2005/04/14 23:49:21 $ * $Date: 2005/04/17 13:14:29 $
* *
*/ */
#ifndef _ASSERT_H_ #ifndef _ASSERT_H_
#define _ASSERT_H_ #define _ASSERT_H_
/* All the headers include this file. */ /* All the headers include this file. */
#include <_mingw.h> #include <_mingw.h>
#ifndef RC_INVOKED #ifndef RC_INVOKED
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#ifdef NDEBUG #ifdef NDEBUG
/* /*
* If not debugging, assert does nothing. * If not debugging, assert does nothing.
*/ */
#define assert(x) ((void)0) #define assert(x) ((void)0)
#else /* debugging enabled */ #else /* debugging enabled */
/* /*
* CRTDLL nicely supplies a function which does the actual output and * CRTDLL nicely supplies a function which does the actual output and
* call to abort. * call to abort.
*/ */
void _assert (const char*, const char*, int) void _assert (const char*, const char*, int)
#ifdef __GNUC__ #ifdef __GNUC__
__attribute__ ((noreturn)) __attribute__ ((noreturn))
#endif #endif
; ;
/* /*
* Definition of the assert macro. * Definition of the assert macro.
*/ */
#define assert(e) ((e) ? (void)0 : _assert(#e, __FILE__, __LINE__)) #define assert(e) ((e) ? (void)0 : _assert(#e, __FILE__, __LINE__))
#endif /* NDEBUG */ #endif /* NDEBUG */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
#endif /* Not _ASSERT_H_ */ #endif /* Not _ASSERT_H_ */

View File

@ -1,159 +1,159 @@
/* A conio implementation for Mingw/Dev-C++. /* A conio implementation for Mingw/Dev-C++.
* *
* Written by: * Written by:
* Hongli Lai <hongli@telekabel.nl> * Hongli Lai <hongli@telekabel.nl>
* tkorrovi <tkorrovi@altavista.net> on 2002/02/26. * tkorrovi <tkorrovi@altavista.net> on 2002/02/26.
* Andrew Westcott <ajwestco@users.sourceforge.net> * Andrew Westcott <ajwestco@users.sourceforge.net>
* *
* Offered for use in the public domain without any warranty. * Offered for use in the public domain without any warranty.
*/ */
#ifndef _CONIO_H_ #ifndef _CONIO_H_
#define _CONIO_H_ #define _CONIO_H_
#include <stdio.h> #include <stdio.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#define BLINK 0 #define BLINK 0
typedef enum typedef enum
{ {
BLACK, BLACK,
BLUE, BLUE,
GREEN, GREEN,
CYAN, CYAN,
RED, RED,
MAGENTA, MAGENTA,
BROWN, BROWN,
LIGHTGRAY, LIGHTGRAY,
DARKGRAY, DARKGRAY,
LIGHTBLUE, LIGHTBLUE,
LIGHTGREEN, LIGHTGREEN,
LIGHTCYAN, LIGHTCYAN,
LIGHTRED, LIGHTRED,
LIGHTMAGENTA, LIGHTMAGENTA,
YELLOW, YELLOW,
WHITE WHITE
} COLORS; } COLORS;
#define cgets _cgets #define cgets _cgets
#define cprintf _cprintf #define cprintf _cprintf
#define cputs _cputs #define cputs _cputs
#define cscanf _cscanf #define cscanf _cscanf
#define ScreenClear clrscr #define ScreenClear clrscr
/* blinkvideo */ /* blinkvideo */
void clreol (void); void clreol (void);
void clrscr (void); void clrscr (void);
int _conio_gettext (int left, int top, int right, int bottom, int _conio_gettext (int left, int top, int right, int bottom,
char *str); char *str);
/* _conio_kbhit */ /* _conio_kbhit */
void delline (void); void delline (void);
/* gettextinfo */ /* gettextinfo */
void gotoxy(int x, int y); void gotoxy(int x, int y);
/* /*
highvideo highvideo
insline insline
intensevideo intensevideo
lowvideo lowvideo
movetext movetext
normvideo normvideo
*/ */
void puttext (int left, int top, int right, int bottom, char *str); void puttext (int left, int top, int right, int bottom, char *str);
// Screen Variables // Screen Variables
/* ScreenCols /* ScreenCols
ScreenGetChar ScreenGetChar
ScreenGetCursor ScreenGetCursor
ScreenMode ScreenMode
ScreenPutChar ScreenPutChar
ScreenPutString ScreenPutString
ScreenRetrieve ScreenRetrieve
ScreenRows ScreenRows
ScreenSetCursor ScreenSetCursor
ScreenUpdate ScreenUpdate
ScreenUpdateLine ScreenUpdateLine
ScreenVisualBell ScreenVisualBell
_set_screen_lines */ _set_screen_lines */
void _setcursortype (int type); void _setcursortype (int type);
void textattr (int _attr); void textattr (int _attr);
void textbackground (int color); void textbackground (int color);
void textcolor (int color); void textcolor (int color);
/* textmode */ /* textmode */
int wherex (void); int wherex (void);
int wherey (void); int wherey (void);
/* window */ /* window */
/* The code below was part of Mingw's conio.h */ /* The code below was part of Mingw's conio.h */
/* /*
* conio.h * conio.h
* *
* Low level console I/O functions. Pretty please try to use the ANSI * Low level console I/O functions. Pretty please try to use the ANSI
* standard ones if you are writing new code. * standard ones if you are writing new code.
* *
* This file is part of the Mingw32 package. * This file is part of the Mingw32 package.
* *
* Contributors: * Contributors:
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp> * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
* *
* THIS SOFTWARE IS NOT COPYRIGHTED * THIS SOFTWARE IS NOT COPYRIGHTED
* *
* This source code is offered for use in the public domain. You may * This source code is offered for use in the public domain. You may
* use, modify or distribute it freely. * use, modify or distribute it freely.
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAMED. This includes but is not limited to warranties of * DISCLAMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* $Author: bellard $ * $Author: bellard $
* $Date: 2005/04/14 23:49:21 $ * $Date: 2005/04/17 13:14:29 $
* *
*/ */
char* _cgets (char*); char* _cgets (char*);
int _cprintf (const char*, ...); int _cprintf (const char*, ...);
int _cputs (const char*); int _cputs (const char*);
int _cscanf (char*, ...); int _cscanf (char*, ...);
int _getch (void); int _getch (void);
int _getche (void); int _getche (void);
int _kbhit (void); int _kbhit (void);
int _putch (int); int _putch (int);
int _ungetch (int); int _ungetch (int);
int getch (void); int getch (void);
int getche (void); int getche (void);
int kbhit (void); int kbhit (void);
int putch (int); int putch (int);
int ungetch (int); int ungetch (int);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* _CONIO_H_ */ #endif /* _CONIO_H_ */

View File

@ -1,232 +1,232 @@
/* /*
* ctype.h * ctype.h
* *
* Functions for testing character types and converting characters. * Functions for testing character types and converting characters.
* *
* This file is part of the Mingw32 package. * This file is part of the Mingw32 package.
* *
* Contributors: * Contributors:
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp> * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
* *
* THIS SOFTWARE IS NOT COPYRIGHTED * THIS SOFTWARE IS NOT COPYRIGHTED
* *
* This source code is offered for use in the public domain. You may * This source code is offered for use in the public domain. You may
* use, modify or distribute it freely. * use, modify or distribute it freely.
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* $Author: bellard $ * $Author: bellard $
* $Date: 2005/04/14 23:49:21 $ * $Date: 2005/04/17 13:14:29 $
* *
*/ */
#ifndef _CTYPE_H_ #ifndef _CTYPE_H_
#define _CTYPE_H_ #define _CTYPE_H_
/* All the headers include this file. */ /* All the headers include this file. */
#include <_mingw.h> #include <_mingw.h>
#define __need_wchar_t #define __need_wchar_t
#define __need_wint_t #define __need_wint_t
#ifndef RC_INVOKED #ifndef RC_INVOKED
#include <stddef.h> #include <stddef.h>
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
/* /*
* The following flags are used to tell iswctype and _isctype what character * The following flags are used to tell iswctype and _isctype what character
* types you are looking for. * types you are looking for.
*/ */
#define _UPPER 0x0001 #define _UPPER 0x0001
#define _LOWER 0x0002 #define _LOWER 0x0002
#define _DIGIT 0x0004 #define _DIGIT 0x0004
#define _SPACE 0x0008 /* HT LF VT FF CR SP */ #define _SPACE 0x0008 /* HT LF VT FF CR SP */
#define _PUNCT 0x0010 #define _PUNCT 0x0010
#define _CONTROL 0x0020 #define _CONTROL 0x0020
#define _BLANK 0x0040 /* this is SP only, not SP and HT as in C99 */ #define _BLANK 0x0040 /* this is SP only, not SP and HT as in C99 */
#define _HEX 0x0080 #define _HEX 0x0080
#define _LEADBYTE 0x8000 #define _LEADBYTE 0x8000
#define _ALPHA 0x0103 #define _ALPHA 0x0103
#ifndef RC_INVOKED #ifndef RC_INVOKED
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
int isalnum(int); int isalnum(int);
int isalpha(int); int isalpha(int);
int iscntrl(int); int iscntrl(int);
int isdigit(int); int isdigit(int);
int isgraph(int); int isgraph(int);
int islower(int); int islower(int);
int isprint(int); int isprint(int);
int ispunct(int); int ispunct(int);
int isspace(int); int isspace(int);
int isupper(int); int isupper(int);
int isxdigit(int); int isxdigit(int);
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
int _isctype (int, int); int _isctype (int, int);
#endif #endif
/* These are the ANSI versions, with correct checking of argument */ /* These are the ANSI versions, with correct checking of argument */
int tolower(int); int tolower(int);
int toupper(int); int toupper(int);
/* /*
* NOTE: The above are not old name type wrappers, but functions exported * NOTE: The above are not old name type wrappers, but functions exported
* explicitly by MSVCRT/CRTDLL. However, underscored versions are also * explicitly by MSVCRT/CRTDLL. However, underscored versions are also
* exported. * exported.
*/ */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
/* /*
* These are the cheap non-std versions: The return values are undefined * These are the cheap non-std versions: The return values are undefined
* if the argument is not ASCII char or is not of appropriate case * if the argument is not ASCII char or is not of appropriate case
*/ */
int _tolower(int); int _tolower(int);
int _toupper(int); int _toupper(int);
#endif #endif
/* Also defined in stdlib.h */ /* Also defined in stdlib.h */
#ifndef MB_CUR_MAX #ifndef MB_CUR_MAX
# ifdef __MSVCRT__ # ifdef __MSVCRT__
# define MB_CUR_MAX __mb_cur_max # define MB_CUR_MAX __mb_cur_max
__MINGW_IMPORT int __mb_cur_max; __MINGW_IMPORT int __mb_cur_max;
# else /* not __MSVCRT */ # else /* not __MSVCRT */
# define MB_CUR_MAX __mb_cur_max_dll # define MB_CUR_MAX __mb_cur_max_dll
__MINGW_IMPORT int __mb_cur_max_dll; __MINGW_IMPORT int __mb_cur_max_dll;
# endif /* not __MSVCRT */ # endif /* not __MSVCRT */
#endif /* MB_CUR_MAX */ #endif /* MB_CUR_MAX */
__MINGW_IMPORT unsigned short _ctype[]; __MINGW_IMPORT unsigned short _ctype[];
#ifdef __MSVCRT__ #ifdef __MSVCRT__
__MINGW_IMPORT unsigned short* _pctype; __MINGW_IMPORT unsigned short* _pctype;
#else /* CRTDLL */ #else /* CRTDLL */
__MINGW_IMPORT unsigned short* _pctype_dll; __MINGW_IMPORT unsigned short* _pctype_dll;
#define _pctype _pctype_dll #define _pctype _pctype_dll
#endif #endif
/* /*
* Use inlines here rather than macros, because macros will upset * Use inlines here rather than macros, because macros will upset
* C++ usage (eg, ::isalnum), and so usually get undefined * C++ usage (eg, ::isalnum), and so usually get undefined
* *
* According to standard for SB chars, these function are defined only * According to standard for SB chars, these function are defined only
* for input values representable by unsigned char or EOF. * for input values representable by unsigned char or EOF.
* Thus, there is no range test. * Thus, there is no range test.
* This reproduces behaviour of MSVCRT.dll lib implemention for SB chars. * This reproduces behaviour of MSVCRT.dll lib implemention for SB chars.
* *
* If no MB char support is needed, these can be simplified even * If no MB char support is needed, these can be simplified even
* more by command line define -DMB_CUR_MAX=1. The compiler will then * more by command line define -DMB_CUR_MAX=1. The compiler will then
* optimise away the constant condition. * optimise away the constant condition.
*/ */
#if ! (defined (__NO_CTYPE_INLINES) || defined (__STRICT_ANSI__ )) #if ! (defined (__NO_CTYPE_INLINES) || defined (__STRICT_ANSI__ ))
/* use simple lookup if SB locale, else _isctype() */ /* use simple lookup if SB locale, else _isctype() */
#define __ISCTYPE(c, mask) (MB_CUR_MAX == 1 ? (_pctype[c] & mask) : _isctype(c, mask)) #define __ISCTYPE(c, mask) (MB_CUR_MAX == 1 ? (_pctype[c] & mask) : _isctype(c, mask))
extern __inline__ int isalnum(int c) {return __ISCTYPE(c, (_ALPHA|_DIGIT));} extern __inline__ int isalnum(int c) {return __ISCTYPE(c, (_ALPHA|_DIGIT));}
extern __inline__ int isalpha(int c) {return __ISCTYPE(c, _ALPHA);} extern __inline__ int isalpha(int c) {return __ISCTYPE(c, _ALPHA);}
extern __inline__ int iscntrl(int c) {return __ISCTYPE(c, _CONTROL);} extern __inline__ int iscntrl(int c) {return __ISCTYPE(c, _CONTROL);}
extern __inline__ int isdigit(int c) {return __ISCTYPE(c, _DIGIT);} extern __inline__ int isdigit(int c) {return __ISCTYPE(c, _DIGIT);}
extern __inline__ int isgraph(int c) {return __ISCTYPE(c, (_PUNCT|_ALPHA|_DIGIT));} extern __inline__ int isgraph(int c) {return __ISCTYPE(c, (_PUNCT|_ALPHA|_DIGIT));}
extern __inline__ int islower(int c) {return __ISCTYPE(c, _LOWER);} extern __inline__ int islower(int c) {return __ISCTYPE(c, _LOWER);}
extern __inline__ int isprint(int c) {return __ISCTYPE(c, (_BLANK|_PUNCT|_ALPHA|_DIGIT));} extern __inline__ int isprint(int c) {return __ISCTYPE(c, (_BLANK|_PUNCT|_ALPHA|_DIGIT));}
extern __inline__ int ispunct(int c) {return __ISCTYPE(c, _PUNCT);} extern __inline__ int ispunct(int c) {return __ISCTYPE(c, _PUNCT);}
extern __inline__ int isspace(int c) {return __ISCTYPE(c, _SPACE);} extern __inline__ int isspace(int c) {return __ISCTYPE(c, _SPACE);}
extern __inline__ int isupper(int c) {return __ISCTYPE(c, _UPPER);} extern __inline__ int isupper(int c) {return __ISCTYPE(c, _UPPER);}
extern __inline__ int isxdigit(int c) {return __ISCTYPE(c, _HEX);} extern __inline__ int isxdigit(int c) {return __ISCTYPE(c, _HEX);}
/* these reproduce behaviour of lib underscored versions */ /* these reproduce behaviour of lib underscored versions */
extern __inline__ int _tolower(int c) {return ( c -'A'+'a');} extern __inline__ int _tolower(int c) {return ( c -'A'+'a');}
extern __inline__ int _toupper(int c) {return ( c -'a'+'A');} extern __inline__ int _toupper(int c) {return ( c -'a'+'A');}
/* TODO? Is it worth inlining ANSI tolower, toupper? Probably only /* TODO? Is it worth inlining ANSI tolower, toupper? Probably only
if we only want C-locale. */ if we only want C-locale. */
#endif /* _NO_CTYPE_INLINES */ #endif /* _NO_CTYPE_INLINES */
/* Wide character equivalents */ /* Wide character equivalents */
#ifndef WEOF #ifndef WEOF
#define WEOF (wchar_t)(0xFFFF) #define WEOF (wchar_t)(0xFFFF)
#endif #endif
#ifndef _WCTYPE_T_DEFINED #ifndef _WCTYPE_T_DEFINED
typedef wchar_t wctype_t; typedef wchar_t wctype_t;
#define _WCTYPE_T_DEFINED #define _WCTYPE_T_DEFINED
#endif #endif
int iswalnum(wint_t); int iswalnum(wint_t);
int iswalpha(wint_t); int iswalpha(wint_t);
int iswascii(wint_t); int iswascii(wint_t);
int iswcntrl(wint_t); int iswcntrl(wint_t);
int iswctype(wint_t, wctype_t); int iswctype(wint_t, wctype_t);
int is_wctype(wint_t, wctype_t); /* Obsolete! */ int is_wctype(wint_t, wctype_t); /* Obsolete! */
int iswdigit(wint_t); int iswdigit(wint_t);
int iswgraph(wint_t); int iswgraph(wint_t);
int iswlower(wint_t); int iswlower(wint_t);
int iswprint(wint_t); int iswprint(wint_t);
int iswpunct(wint_t); int iswpunct(wint_t);
int iswspace(wint_t); int iswspace(wint_t);
int iswupper(wint_t); int iswupper(wint_t);
int iswxdigit(wint_t); int iswxdigit(wint_t);
wchar_t towlower(wchar_t); wchar_t towlower(wchar_t);
wchar_t towupper(wchar_t); wchar_t towupper(wchar_t);
int isleadbyte (int); int isleadbyte (int);
/* Also in wctype.h */ /* Also in wctype.h */
#if ! (defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED)) #if ! (defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED))
#define __WCTYPE_INLINES_DEFINED #define __WCTYPE_INLINES_DEFINED
extern __inline__ int iswalnum(wint_t wc) {return (iswctype(wc,_ALPHA|_DIGIT));} extern __inline__ int iswalnum(wint_t wc) {return (iswctype(wc,_ALPHA|_DIGIT));}
extern __inline__ int iswalpha(wint_t wc) {return (iswctype(wc,_ALPHA));} extern __inline__ int iswalpha(wint_t wc) {return (iswctype(wc,_ALPHA));}
extern __inline__ int iswascii(wint_t wc) {return (((unsigned)wc & 0x7F) ==0);} extern __inline__ int iswascii(wint_t wc) {return (((unsigned)wc & 0x7F) ==0);}
extern __inline__ int iswcntrl(wint_t wc) {return (iswctype(wc,_CONTROL));} extern __inline__ int iswcntrl(wint_t wc) {return (iswctype(wc,_CONTROL));}
extern __inline__ int iswdigit(wint_t wc) {return (iswctype(wc,_DIGIT));} extern __inline__ int iswdigit(wint_t wc) {return (iswctype(wc,_DIGIT));}
extern __inline__ int iswgraph(wint_t wc) {return (iswctype(wc,_PUNCT|_ALPHA|_DIGIT));} extern __inline__ int iswgraph(wint_t wc) {return (iswctype(wc,_PUNCT|_ALPHA|_DIGIT));}
extern __inline__ int iswlower(wint_t wc) {return (iswctype(wc,_LOWER));} extern __inline__ int iswlower(wint_t wc) {return (iswctype(wc,_LOWER));}
extern __inline__ int iswprint(wint_t wc) {return (iswctype(wc,_BLANK|_PUNCT|_ALPHA|_DIGIT));} extern __inline__ int iswprint(wint_t wc) {return (iswctype(wc,_BLANK|_PUNCT|_ALPHA|_DIGIT));}
extern __inline__ int iswpunct(wint_t wc) {return (iswctype(wc,_PUNCT));} extern __inline__ int iswpunct(wint_t wc) {return (iswctype(wc,_PUNCT));}
extern __inline__ int iswspace(wint_t wc) {return (iswctype(wc,_SPACE));} extern __inline__ int iswspace(wint_t wc) {return (iswctype(wc,_SPACE));}
extern __inline__ int iswupper(wint_t wc) {return (iswctype(wc,_UPPER));} extern __inline__ int iswupper(wint_t wc) {return (iswctype(wc,_UPPER));}
extern __inline__ int iswxdigit(wint_t wc) {return (iswctype(wc,_HEX));} extern __inline__ int iswxdigit(wint_t wc) {return (iswctype(wc,_HEX));}
extern __inline__ int isleadbyte(int c) {return (_pctype[(unsigned char)(c)] & _LEADBYTE);} extern __inline__ int isleadbyte(int c) {return (_pctype[(unsigned char)(c)] & _LEADBYTE);}
#endif /* !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED)) */ #endif /* !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED)) */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
int __isascii (int); int __isascii (int);
int __toascii (int); int __toascii (int);
int __iscsymf (int); /* Valid first character in C symbol */ int __iscsymf (int); /* Valid first character in C symbol */
int __iscsym (int); /* Valid character in C symbol (after first) */ int __iscsym (int); /* Valid character in C symbol (after first) */
#ifndef __NO_CTYPE_INLINES #ifndef __NO_CTYPE_INLINES
extern __inline__ int __isascii(int c) {return (((unsigned)c & ~0x7F) == 0);} extern __inline__ int __isascii(int c) {return (((unsigned)c & ~0x7F) == 0);}
extern __inline__ int __toascii(int c) {return (c & 0x7F);} extern __inline__ int __toascii(int c) {return (c & 0x7F);}
extern __inline__ int __iscsymf(int c) {return (isalpha(c) || (c == '_'));} extern __inline__ int __iscsymf(int c) {return (isalpha(c) || (c == '_'));}
extern __inline__ int __iscsym(int c) {return (isalnum(c) || (c == '_'));} extern __inline__ int __iscsym(int c) {return (isalnum(c) || (c == '_'));}
#endif /* __NO_CTYPE_INLINES */ #endif /* __NO_CTYPE_INLINES */
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
int isascii (int); int isascii (int);
int toascii (int); int toascii (int);
int iscsymf (int); int iscsymf (int);
int iscsym (int); int iscsym (int);
#endif /* Not _NO_OLDNAMES */ #endif /* Not _NO_OLDNAMES */
#endif /* Not __STRICT_ANSI__ */ #endif /* Not __STRICT_ANSI__ */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
#endif /* Not _CTYPE_H_ */ #endif /* Not _CTYPE_H_ */

View File

@ -1,26 +1,26 @@
/* /*
* dir.h * dir.h
* *
* This file OBSOLESCENT and only provided for backward compatibility. * This file OBSOLESCENT and only provided for backward compatibility.
* Please use io.h instead. * Please use io.h instead.
* *
* This file is part of the Mingw32 package. * This file is part of the Mingw32 package.
* *
* Contributors: * Contributors:
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp> * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
* Mumit Khan <khan@xraylith.wisc.edu> * Mumit Khan <khan@xraylith.wisc.edu>
* *
* THIS SOFTWARE IS NOT COPYRIGHTED * THIS SOFTWARE IS NOT COPYRIGHTED
* *
* This source code is offered for use in the public domain. You may * This source code is offered for use in the public domain. You may
* use, modify or distribute it freely. * use, modify or distribute it freely.
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
*/ */
#include <io.h> #include <io.h>

View File

@ -1,95 +1,95 @@
/* /*
* direct.h * direct.h
* *
* Functions for manipulating paths and directories (included from io.h) * Functions for manipulating paths and directories (included from io.h)
* plus functions for setting the current drive. * plus functions for setting the current drive.
* *
* This file is part of the Mingw32 package. * This file is part of the Mingw32 package.
* *
* Contributors: * Contributors:
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp> * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
* *
* THIS SOFTWARE IS NOT COPYRIGHTED * THIS SOFTWARE IS NOT COPYRIGHTED
* *
* This source code is offered for use in the public domain. You may * This source code is offered for use in the public domain. You may
* use, modify or distribute it freely. * use, modify or distribute it freely.
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* $Author: bellard $ * $Author: bellard $
* $Date: 2005/04/14 23:49:21 $ * $Date: 2005/04/17 13:14:29 $
* *
*/ */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#ifndef _DIRECT_H_ #ifndef _DIRECT_H_
#define _DIRECT_H_ #define _DIRECT_H_
/* All the headers include this file. */ /* All the headers include this file. */
#include <_mingw.h> #include <_mingw.h>
#define __need_wchar_t #define __need_wchar_t
#ifndef RC_INVOKED #ifndef RC_INVOKED
#include <stddef.h> #include <stddef.h>
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
#include <io.h> #include <io.h>
#ifndef RC_INVOKED #ifndef RC_INVOKED
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#ifndef _DISKFREE_T_DEFINED #ifndef _DISKFREE_T_DEFINED
/* needed by _getdiskfree (also in dos.h) */ /* needed by _getdiskfree (also in dos.h) */
struct _diskfree_t { struct _diskfree_t {
unsigned total_clusters; unsigned total_clusters;
unsigned avail_clusters; unsigned avail_clusters;
unsigned sectors_per_cluster; unsigned sectors_per_cluster;
unsigned bytes_per_sector; unsigned bytes_per_sector;
}; };
#define _DISKFREE_T_DEFINED #define _DISKFREE_T_DEFINED
#endif #endif
/* /*
* You really shouldn't be using these. Use the Win32 API functions instead. * You really shouldn't be using these. Use the Win32 API functions instead.
* However, it does make it easier to port older code. * However, it does make it easier to port older code.
*/ */
int _getdrive (void); int _getdrive (void);
unsigned long _getdrives(void); unsigned long _getdrives(void);
int _chdrive (int); int _chdrive (int);
char* _getdcwd (int, char*, int); char* _getdcwd (int, char*, int);
unsigned _getdiskfree (unsigned, struct _diskfree_t *); unsigned _getdiskfree (unsigned, struct _diskfree_t *);
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
# define diskfree_t _diskfree_t # define diskfree_t _diskfree_t
#endif #endif
#ifndef _WDIRECT_DEFINED #ifndef _WDIRECT_DEFINED
/* wide character versions. Also in wchar.h */ /* wide character versions. Also in wchar.h */
#ifdef __MSVCRT__ #ifdef __MSVCRT__
int _wchdir(const wchar_t*); int _wchdir(const wchar_t*);
wchar_t* _wgetcwd(wchar_t*, int); wchar_t* _wgetcwd(wchar_t*, int);
wchar_t* _wgetdcwd(int, wchar_t*, int); wchar_t* _wgetdcwd(int, wchar_t*, int);
int _wmkdir(const wchar_t*); int _wmkdir(const wchar_t*);
int _wrmdir(const wchar_t*); int _wrmdir(const wchar_t*);
#endif /* __MSVCRT__ */ #endif /* __MSVCRT__ */
#define _WDIRECT_DEFINED #define _WDIRECT_DEFINED
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
#endif /* Not _DIRECT_H_ */ #endif /* Not _DIRECT_H_ */
#endif /* Not __STRICT_ANSI__ */ #endif /* Not __STRICT_ANSI__ */

View File

@ -1,96 +1,96 @@
/* /*
* DIRENT.H (formerly DIRLIB.H) * DIRENT.H (formerly DIRLIB.H)
* *
* by M. J. Weinstein Released to public domain 1-Jan-89 * by M. J. Weinstein Released to public domain 1-Jan-89
* *
* Because I have heard that this feature (opendir, readdir, closedir) * Because I have heard that this feature (opendir, readdir, closedir)
* it so useful for programmers coming from UNIX or attempting to port * it so useful for programmers coming from UNIX or attempting to port
* UNIX code, and because it is reasonably light weight, I have included * UNIX code, and because it is reasonably light weight, I have included
* it in the Mingw32 package. I have also added an implementation of * it in the Mingw32 package. I have also added an implementation of
* rewinddir, seekdir and telldir. * rewinddir, seekdir and telldir.
* - Colin Peters <colin@bird.fu.is.saga-u.ac.jp> * - Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
* *
* This code is distributed in the hope that is will be useful but * This code is distributed in the hope that is will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includeds but is not limited to warranties of * DISCLAIMED. This includeds but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* $Author: bellard $ * $Author: bellard $
* $Date: 2005/04/14 23:49:21 $ * $Date: 2005/04/17 13:14:29 $
* *
*/ */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#ifndef _DIRENT_H_ #ifndef _DIRENT_H_
#define _DIRENT_H_ #define _DIRENT_H_
/* All the headers include this file. */ /* All the headers include this file. */
#include <_mingw.h> #include <_mingw.h>
#include <io.h> #include <io.h>
#ifndef RC_INVOKED #ifndef RC_INVOKED
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
struct dirent struct dirent
{ {
long d_ino; /* Always zero. */ long d_ino; /* Always zero. */
unsigned short d_reclen; /* Always zero. */ unsigned short d_reclen; /* Always zero. */
unsigned short d_namlen; /* Length of name in d_name. */ unsigned short d_namlen; /* Length of name in d_name. */
char* d_name; /* File name. */ char* d_name; /* File name. */
/* NOTE: The name in the dirent structure points to the name in the /* NOTE: The name in the dirent structure points to the name in the
* finddata_t structure in the DIR. */ * finddata_t structure in the DIR. */
}; };
/* /*
* This is an internal data structure. Good programmers will not use it * This is an internal data structure. Good programmers will not use it
* except as an argument to one of the functions below. * except as an argument to one of the functions below.
*/ */
typedef struct typedef struct
{ {
/* disk transfer area for this dir */ /* disk transfer area for this dir */
struct _finddata_t dd_dta; struct _finddata_t dd_dta;
/* dirent struct to return from dir (NOTE: this makes this thread /* dirent struct to return from dir (NOTE: this makes this thread
* safe as long as only one thread uses a particular DIR struct at * safe as long as only one thread uses a particular DIR struct at
* a time) */ * a time) */
struct dirent dd_dir; struct dirent dd_dir;
/* _findnext handle */ /* _findnext handle */
long dd_handle; long dd_handle;
/* /*
* Status of search: * Status of search:
* 0 = not started yet (next entry to read is first entry) * 0 = not started yet (next entry to read is first entry)
* -1 = off the end * -1 = off the end
* positive = 0 based index of next entry * positive = 0 based index of next entry
*/ */
short dd_stat; short dd_stat;
/* given path for dir with search pattern (struct is extended) */ /* given path for dir with search pattern (struct is extended) */
char dd_name[1]; char dd_name[1];
} DIR; } DIR;
DIR* opendir (const char*); DIR* opendir (const char*);
struct dirent* readdir (DIR*); struct dirent* readdir (DIR*);
int closedir (DIR*); int closedir (DIR*);
void rewinddir (DIR*); void rewinddir (DIR*);
long telldir (DIR*); long telldir (DIR*);
void seekdir (DIR*, long); void seekdir (DIR*, long);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
#endif /* Not _DIRENT_H_ */ #endif /* Not _DIRENT_H_ */
#endif /* Not __STRICT_ANSI__ */ #endif /* Not __STRICT_ANSI__ */

View File

@ -1,110 +1,110 @@
/* /*
* dos.h * dos.h
* *
* DOS-specific functions and structures. * DOS-specific functions and structures.
* *
* This file is part of the Mingw32 package. * This file is part of the Mingw32 package.
* *
* Contributors: * Contributors:
* Created by J.J. van der Heijden <J.J.vanderHeijden@student.utwente.nl> * Created by J.J. van der Heijden <J.J.vanderHeijden@student.utwente.nl>
* *
* THIS SOFTWARE IS NOT COPYRIGHTED * THIS SOFTWARE IS NOT COPYRIGHTED
* *
* This source code is offered for use in the public domain. You may * This source code is offered for use in the public domain. You may
* use, modify or distribute it freely. * use, modify or distribute it freely.
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* $Author: bellard $ * $Author: bellard $
* $Date: 2005/04/14 23:49:21 $ * $Date: 2005/04/17 13:14:29 $
* *
*/ */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#ifndef _DOS_H_ #ifndef _DOS_H_
#define _DOS_H_ #define _DOS_H_
/* All the headers include this file. */ /* All the headers include this file. */
#include <_mingw.h> #include <_mingw.h>
#define __need_wchar_t #define __need_wchar_t
#ifndef RC_INVOKED #ifndef RC_INVOKED
#include <stddef.h> #include <stddef.h>
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
/* For DOS file attributes */ /* For DOS file attributes */
#include <io.h> #include <io.h>
#ifndef RC_INVOKED #ifndef RC_INVOKED
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#ifndef __MSVCRT__ /* these are in CRTDLL, but not MSVCRT */ #ifndef __MSVCRT__ /* these are in CRTDLL, but not MSVCRT */
#ifndef __DECLSPEC_SUPPORTED #ifndef __DECLSPEC_SUPPORTED
extern unsigned int *__imp__basemajor_dll; extern unsigned int *__imp__basemajor_dll;
extern unsigned int *__imp__baseminor_dll; extern unsigned int *__imp__baseminor_dll;
extern unsigned int *__imp__baseversion_dll; extern unsigned int *__imp__baseversion_dll;
extern unsigned int *__imp__osmajor_dll; extern unsigned int *__imp__osmajor_dll;
extern unsigned int *__imp__osminor_dll; extern unsigned int *__imp__osminor_dll;
extern unsigned int *__imp__osmode_dll; extern unsigned int *__imp__osmode_dll;
#define _basemajor (*__imp__basemajor_dll) #define _basemajor (*__imp__basemajor_dll)
#define _baseminor (*__imp__baseminor_dll) #define _baseminor (*__imp__baseminor_dll)
#define _baseversion (*__imp__baseversion_dll) #define _baseversion (*__imp__baseversion_dll)
#define _osmajor (*__imp__osmajor_dll) #define _osmajor (*__imp__osmajor_dll)
#define _osminor (*__imp__osminor_dll) #define _osminor (*__imp__osminor_dll)
#define _osmode (*__imp__osmode_dll) #define _osmode (*__imp__osmode_dll)
#else /* __DECLSPEC_SUPPORTED */ #else /* __DECLSPEC_SUPPORTED */
__MINGW_IMPORT unsigned int _basemajor_dll; __MINGW_IMPORT unsigned int _basemajor_dll;
__MINGW_IMPORT unsigned int _baseminor_dll; __MINGW_IMPORT unsigned int _baseminor_dll;
__MINGW_IMPORT unsigned int _baseversion_dll; __MINGW_IMPORT unsigned int _baseversion_dll;
__MINGW_IMPORT unsigned int _osmajor_dll; __MINGW_IMPORT unsigned int _osmajor_dll;
__MINGW_IMPORT unsigned int _osminor_dll; __MINGW_IMPORT unsigned int _osminor_dll;
__MINGW_IMPORT unsigned int _osmode_dll; __MINGW_IMPORT unsigned int _osmode_dll;
#define _basemajor _basemajor_dll #define _basemajor _basemajor_dll
#define _baseminor _baseminor_dll #define _baseminor _baseminor_dll
#define _baseversion _baseversion_dll #define _baseversion _baseversion_dll
#define _osmajor _osmajor_dll #define _osmajor _osmajor_dll
#define _osminor _osminor_dll #define _osminor _osminor_dll
#define _osmode _osmode_dll #define _osmode _osmode_dll
#endif /* __DECLSPEC_SUPPORTED */ #endif /* __DECLSPEC_SUPPORTED */
#endif /* ! __MSVCRT__ */ #endif /* ! __MSVCRT__ */
#ifndef _DISKFREE_T_DEFINED #ifndef _DISKFREE_T_DEFINED
/* needed by _getdiskfree (also in direct.h) */ /* needed by _getdiskfree (also in direct.h) */
struct _diskfree_t { struct _diskfree_t {
unsigned total_clusters; unsigned total_clusters;
unsigned avail_clusters; unsigned avail_clusters;
unsigned sectors_per_cluster; unsigned sectors_per_cluster;
unsigned bytes_per_sector; unsigned bytes_per_sector;
}; };
#define _DISKFREE_T_DEFINED #define _DISKFREE_T_DEFINED
#endif #endif
unsigned _getdiskfree (unsigned, struct _diskfree_t *); unsigned _getdiskfree (unsigned, struct _diskfree_t *);
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
# define diskfree_t _diskfree_t # define diskfree_t _diskfree_t
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
#endif /* Not _DOS_H_ */ #endif /* Not _DOS_H_ */
#endif /* Not __STRICT_ANSI__ */ #endif /* Not __STRICT_ANSI__ */

View File

@ -1,117 +1,117 @@
/* /*
* errno.h * errno.h
* *
* Error numbers and access to error reporting. * Error numbers and access to error reporting.
* *
* This file is part of the Mingw32 package. * This file is part of the Mingw32 package.
* *
* Contributors: * Contributors:
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp> * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
* *
* THIS SOFTWARE IS NOT COPYRIGHTED * THIS SOFTWARE IS NOT COPYRIGHTED
* *
* This source code is offered for use in the public domain. You may * This source code is offered for use in the public domain. You may
* use, modify or distribute it freely. * use, modify or distribute it freely.
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* $Author: bellard $ * $Author: bellard $
* $Date: 2005/04/14 23:49:21 $ * $Date: 2005/04/17 13:14:29 $
* *
*/ */
#ifndef _ERRNO_H_ #ifndef _ERRNO_H_
#define _ERRNO_H_ #define _ERRNO_H_
/* All the headers include this file. */ /* All the headers include this file. */
#include <_mingw.h> #include <_mingw.h>
/* /*
* Error numbers. * Error numbers.
* TODO: Can't be sure of some of these assignments, I guessed from the * TODO: Can't be sure of some of these assignments, I guessed from the
* names given by strerror and the defines in the Cygnus errno.h. A lot * names given by strerror and the defines in the Cygnus errno.h. A lot
* of the names from the Cygnus errno.h are not represented, and a few * of the names from the Cygnus errno.h are not represented, and a few
* of the descriptions returned by strerror do not obviously match * of the descriptions returned by strerror do not obviously match
* their error naming. * their error naming.
*/ */
#define EPERM 1 /* Operation not permitted */ #define EPERM 1 /* Operation not permitted */
#define ENOFILE 2 /* No such file or directory */ #define ENOFILE 2 /* No such file or directory */
#define ENOENT 2 #define ENOENT 2
#define ESRCH 3 /* No such process */ #define ESRCH 3 /* No such process */
#define EINTR 4 /* Interrupted function call */ #define EINTR 4 /* Interrupted function call */
#define EIO 5 /* Input/output error */ #define EIO 5 /* Input/output error */
#define ENXIO 6 /* No such device or address */ #define ENXIO 6 /* No such device or address */
#define E2BIG 7 /* Arg list too long */ #define E2BIG 7 /* Arg list too long */
#define ENOEXEC 8 /* Exec format error */ #define ENOEXEC 8 /* Exec format error */
#define EBADF 9 /* Bad file descriptor */ #define EBADF 9 /* Bad file descriptor */
#define ECHILD 10 /* No child processes */ #define ECHILD 10 /* No child processes */
#define EAGAIN 11 /* Resource temporarily unavailable */ #define EAGAIN 11 /* Resource temporarily unavailable */
#define ENOMEM 12 /* Not enough space */ #define ENOMEM 12 /* Not enough space */
#define EACCES 13 /* Permission denied */ #define EACCES 13 /* Permission denied */
#define EFAULT 14 /* Bad address */ #define EFAULT 14 /* Bad address */
/* 15 - Unknown Error */ /* 15 - Unknown Error */
#define EBUSY 16 /* strerror reports "Resource device" */ #define EBUSY 16 /* strerror reports "Resource device" */
#define EEXIST 17 /* File exists */ #define EEXIST 17 /* File exists */
#define EXDEV 18 /* Improper link (cross-device link?) */ #define EXDEV 18 /* Improper link (cross-device link?) */
#define ENODEV 19 /* No such device */ #define ENODEV 19 /* No such device */
#define ENOTDIR 20 /* Not a directory */ #define ENOTDIR 20 /* Not a directory */
#define EISDIR 21 /* Is a directory */ #define EISDIR 21 /* Is a directory */
#define EINVAL 22 /* Invalid argument */ #define EINVAL 22 /* Invalid argument */
#define ENFILE 23 /* Too many open files in system */ #define ENFILE 23 /* Too many open files in system */
#define EMFILE 24 /* Too many open files */ #define EMFILE 24 /* Too many open files */
#define ENOTTY 25 /* Inappropriate I/O control operation */ #define ENOTTY 25 /* Inappropriate I/O control operation */
/* 26 - Unknown Error */ /* 26 - Unknown Error */
#define EFBIG 27 /* File too large */ #define EFBIG 27 /* File too large */
#define ENOSPC 28 /* No space left on device */ #define ENOSPC 28 /* No space left on device */
#define ESPIPE 29 /* Invalid seek (seek on a pipe?) */ #define ESPIPE 29 /* Invalid seek (seek on a pipe?) */
#define EROFS 30 /* Read-only file system */ #define EROFS 30 /* Read-only file system */
#define EMLINK 31 /* Too many links */ #define EMLINK 31 /* Too many links */
#define EPIPE 32 /* Broken pipe */ #define EPIPE 32 /* Broken pipe */
#define EDOM 33 /* Domain error (math functions) */ #define EDOM 33 /* Domain error (math functions) */
#define ERANGE 34 /* Result too large (possibly too small) */ #define ERANGE 34 /* Result too large (possibly too small) */
/* 35 - Unknown Error */ /* 35 - Unknown Error */
#define EDEADLOCK 36 /* Resource deadlock avoided (non-Cyg) */ #define EDEADLOCK 36 /* Resource deadlock avoided (non-Cyg) */
#define EDEADLK 36 #define EDEADLK 36
/* 37 - Unknown Error */ /* 37 - Unknown Error */
#define ENAMETOOLONG 38 /* Filename too long (91 in Cyg?) */ #define ENAMETOOLONG 38 /* Filename too long (91 in Cyg?) */
#define ENOLCK 39 /* No locks available (46 in Cyg?) */ #define ENOLCK 39 /* No locks available (46 in Cyg?) */
#define ENOSYS 40 /* Function not implemented (88 in Cyg?) */ #define ENOSYS 40 /* Function not implemented (88 in Cyg?) */
#define ENOTEMPTY 41 /* Directory not empty (90 in Cyg?) */ #define ENOTEMPTY 41 /* Directory not empty (90 in Cyg?) */
#define EILSEQ 42 /* Illegal byte sequence */ #define EILSEQ 42 /* Illegal byte sequence */
/* /*
* NOTE: ENAMETOOLONG and ENOTEMPTY conflict with definitions in the * NOTE: ENAMETOOLONG and ENOTEMPTY conflict with definitions in the
* sockets.h header provided with windows32api-0.1.2. * sockets.h header provided with windows32api-0.1.2.
* You should go and put an #if 0 ... #endif around the whole block * You should go and put an #if 0 ... #endif around the whole block
* of errors (look at the comment above them). * of errors (look at the comment above them).
*/ */
#ifndef RC_INVOKED #ifndef RC_INVOKED
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* /*
* Definitions of errno. For _doserrno, sys_nerr and * sys_errlist, see * Definitions of errno. For _doserrno, sys_nerr and * sys_errlist, see
* stdlib.h. * stdlib.h.
*/ */
#ifdef _UWIN #ifdef _UWIN
#undef errno #undef errno
extern int errno; extern int errno;
#else #else
int* _errno(void); int* _errno(void);
#define errno (*_errno()) #define errno (*_errno())
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
#endif /* Not _ERRNO_H_ */ #endif /* Not _ERRNO_H_ */

View File

@ -1,20 +1,20 @@
#ifndef _EXCPT_H #ifndef _EXCPT_H
#define _EXCPT_H #define _EXCPT_H
#if __GNUC__ >=3 #if __GNUC__ >=3
#pragma GCC system_header #pragma GCC system_header
#endif #endif
/* FIXME: This will make some code compile. The programs will most /* FIXME: This will make some code compile. The programs will most
likely crash when an exception is raised, but at least they will likely crash when an exception is raised, but at least they will
compile. */ compile. */
#ifdef __GNUC__ #ifdef __GNUC__
#define __try #define __try
#define __except(x) if (0) /* don't execute handler */ #define __except(x) if (0) /* don't execute handler */
#define __finally #define __finally
#define _try __try #define _try __try
#define _except __except #define _except __except
#define _finally __finally #define _finally __finally
#endif #endif
#endif #endif

View File

@ -1,135 +1,135 @@
/* /*
* fcntl.h * fcntl.h
* *
* Access constants for _open. Note that the permissions constants are * Access constants for _open. Note that the permissions constants are
* in sys/stat.h (ick). * in sys/stat.h (ick).
* *
* This code is part of the Mingw32 package. * This code is part of the Mingw32 package.
* *
* Contributors: * Contributors:
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp> * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
* *
* THIS SOFTWARE IS NOT COPYRIGHTED * THIS SOFTWARE IS NOT COPYRIGHTED
* *
* This source code is offered for use in the public domain. You may * This source code is offered for use in the public domain. You may
* use, modify or distribute it freely. * use, modify or distribute it freely.
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* $Author: bellard $ * $Author: bellard $
* $Date: 2005/04/14 23:49:21 $ * $Date: 2005/04/17 13:14:29 $
* *
*/ */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#ifndef _FCNTL_H_ #ifndef _FCNTL_H_
#define _FCNTL_H_ #define _FCNTL_H_
/* All the headers include this file. */ /* All the headers include this file. */
#include <_mingw.h> #include <_mingw.h>
/* /*
* It appears that fcntl.h should include io.h for compatibility... * It appears that fcntl.h should include io.h for compatibility...
*/ */
#include <io.h> #include <io.h>
/* Specifiy one of these flags to define the access mode. */ /* Specifiy one of these flags to define the access mode. */
#define _O_RDONLY 0 #define _O_RDONLY 0
#define _O_WRONLY 1 #define _O_WRONLY 1
#define _O_RDWR 2 #define _O_RDWR 2
/* Mask for access mode bits in the _open flags. */ /* Mask for access mode bits in the _open flags. */
#define _O_ACCMODE (_O_RDONLY|_O_WRONLY|_O_RDWR) #define _O_ACCMODE (_O_RDONLY|_O_WRONLY|_O_RDWR)
#define _O_APPEND 0x0008 /* Writes will add to the end of the file. */ #define _O_APPEND 0x0008 /* Writes will add to the end of the file. */
#define _O_RANDOM 0x0010 #define _O_RANDOM 0x0010
#define _O_SEQUENTIAL 0x0020 #define _O_SEQUENTIAL 0x0020
#define _O_TEMPORARY 0x0040 /* Make the file dissappear after closing. #define _O_TEMPORARY 0x0040 /* Make the file dissappear after closing.
* WARNING: Even if not created by _open! */ * WARNING: Even if not created by _open! */
#define _O_NOINHERIT 0x0080 #define _O_NOINHERIT 0x0080
#define _O_CREAT 0x0100 /* Create the file if it does not exist. */ #define _O_CREAT 0x0100 /* Create the file if it does not exist. */
#define _O_TRUNC 0x0200 /* Truncate the file if it does exist. */ #define _O_TRUNC 0x0200 /* Truncate the file if it does exist. */
#define _O_EXCL 0x0400 /* Open only if the file does not exist. */ #define _O_EXCL 0x0400 /* Open only if the file does not exist. */
/* NOTE: Text is the default even if the given _O_TEXT bit is not on. */ /* NOTE: Text is the default even if the given _O_TEXT bit is not on. */
#define _O_TEXT 0x4000 /* CR-LF in file becomes LF in memory. */ #define _O_TEXT 0x4000 /* CR-LF in file becomes LF in memory. */
#define _O_BINARY 0x8000 /* Input and output is not translated. */ #define _O_BINARY 0x8000 /* Input and output is not translated. */
#define _O_RAW _O_BINARY #define _O_RAW _O_BINARY
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
/* POSIX/Non-ANSI names for increased portability */ /* POSIX/Non-ANSI names for increased portability */
#define O_RDONLY _O_RDONLY #define O_RDONLY _O_RDONLY
#define O_WRONLY _O_WRONLY #define O_WRONLY _O_WRONLY
#define O_RDWR _O_RDWR #define O_RDWR _O_RDWR
#define O_ACCMODE _O_ACCMODE #define O_ACCMODE _O_ACCMODE
#define O_APPEND _O_APPEND #define O_APPEND _O_APPEND
#define O_CREAT _O_CREAT #define O_CREAT _O_CREAT
#define O_TRUNC _O_TRUNC #define O_TRUNC _O_TRUNC
#define O_EXCL _O_EXCL #define O_EXCL _O_EXCL
#define O_TEXT _O_TEXT #define O_TEXT _O_TEXT
#define O_BINARY _O_BINARY #define O_BINARY _O_BINARY
#define O_TEMPORARY _O_TEMPORARY #define O_TEMPORARY _O_TEMPORARY
#define O_NOINHERIT _O_NOINHERIT #define O_NOINHERIT _O_NOINHERIT
#define O_SEQENTIAL _O_SEQUENTIAL #define O_SEQENTIAL _O_SEQUENTIAL
#define O_RANDOM _O_RANDOM #define O_RANDOM _O_RANDOM
#endif /* Not _NO_OLDNAMES */ #endif /* Not _NO_OLDNAMES */
#ifndef RC_INVOKED #ifndef RC_INVOKED
/* /*
* This variable determines the default file mode. * This variable determines the default file mode.
* TODO: Which flags work? * TODO: Which flags work?
*/ */
#ifndef __DECLSPEC_SUPPORTED #ifndef __DECLSPEC_SUPPORTED
#ifdef __MSVCRT__ #ifdef __MSVCRT__
extern unsigned int* __imp__fmode; extern unsigned int* __imp__fmode;
#define _fmode (*__imp__fmode) #define _fmode (*__imp__fmode)
#else #else
/* CRTDLL */ /* CRTDLL */
extern unsigned int* __imp__fmode_dll; extern unsigned int* __imp__fmode_dll;
#define _fmode (*__imp__fmode_dll) #define _fmode (*__imp__fmode_dll)
#endif #endif
#else /* __DECLSPEC_SUPPORTED */ #else /* __DECLSPEC_SUPPORTED */
#ifdef __MSVCRT__ #ifdef __MSVCRT__
__MINGW_IMPORT unsigned int _fmode; __MINGW_IMPORT unsigned int _fmode;
#else /* ! __MSVCRT__ */ #else /* ! __MSVCRT__ */
__MINGW_IMPORT unsigned int _fmode_dll; __MINGW_IMPORT unsigned int _fmode_dll;
#define _fmode _fmode_dll #define _fmode _fmode_dll
#endif /* ! __MSVCRT__ */ #endif /* ! __MSVCRT__ */
#endif /* __DECLSPEC_SUPPORTED */ #endif /* __DECLSPEC_SUPPORTED */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
int _setmode (int, int); int _setmode (int, int);
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
int setmode (int, int); int setmode (int, int);
#endif /* Not _NO_OLDNAMES */ #endif /* Not _NO_OLDNAMES */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
#endif /* Not _FCNTL_H_ */ #endif /* Not _FCNTL_H_ */
#endif /* Not __STRICT_ANSI__ */ #endif /* Not __STRICT_ANSI__ */

View File

@ -1,85 +1,85 @@
#ifndef _FENV_H #ifndef _FENV_H
#define _FENV_H #define _FENV_H
/* /*
For now, support only for the basic abstraction of flags that are For now, support only for the basic abstraction of flags that are
either set or clear. fexcept_t could be structure that holds more info either set or clear. fexcept_t could be structure that holds more info
about the fp environment. about the fp environment.
*/ */
typedef unsigned short fexcept_t; typedef unsigned short fexcept_t;
/* This 28-byte struct represents the entire floating point /* This 28-byte struct represents the entire floating point
environment as stored by fnstenv or fstenv */ environment as stored by fnstenv or fstenv */
typedef struct typedef struct
{ {
unsigned short __control_word; unsigned short __control_word;
unsigned short __unused0; unsigned short __unused0;
unsigned short __status_word; unsigned short __status_word;
unsigned short __unused1; unsigned short __unused1;
unsigned short __tag_word; unsigned short __tag_word;
unsigned short __unused2; unsigned short __unused2;
unsigned int __ip_offset; /* instruction pointer offset */ unsigned int __ip_offset; /* instruction pointer offset */
unsigned short __ip_selector; unsigned short __ip_selector;
unsigned short __opcode; unsigned short __opcode;
unsigned int __data_offset; unsigned int __data_offset;
unsigned short __data_selector; unsigned short __data_selector;
unsigned short __unused3; unsigned short __unused3;
} fenv_t; } fenv_t;
/* FPU status word exception flags */ /* FPU status word exception flags */
#define FE_INVALID 0x01 #define FE_INVALID 0x01
#define FE_DENORMAL 0x02 #define FE_DENORMAL 0x02
#define FE_DIVBYZERO 0x04 #define FE_DIVBYZERO 0x04
#define FE_OVERFLOW 0x08 #define FE_OVERFLOW 0x08
#define FE_UNDERFLOW 0x10 #define FE_UNDERFLOW 0x10
#define FE_INEXACT 0x20 #define FE_INEXACT 0x20
#define FE_ALL_EXCEPT (FE_INVALID | FE_DENORMAL | FE_DIVBYZERO \ #define FE_ALL_EXCEPT (FE_INVALID | FE_DENORMAL | FE_DIVBYZERO \
| FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT) | FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT)
/* FPU control word rounding flags */ /* FPU control word rounding flags */
#define FE_TONEAREST 0x0000 #define FE_TONEAREST 0x0000
#define FE_DOWNWARD 0x0400 #define FE_DOWNWARD 0x0400
#define FE_UPWARD 0x0800 #define FE_UPWARD 0x0800
#define FE_TOWARDZERO 0x0c00 #define FE_TOWARDZERO 0x0c00
/* The default floating point environment */ /* The default floating point environment */
#define FE_DFL_ENV ((const fenv_t *)-1) #define FE_DFL_ENV ((const fenv_t *)-1)
#ifndef RC_INVOKED #ifndef RC_INVOKED
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/*TODO: Some of these could be inlined */ /*TODO: Some of these could be inlined */
/* 7.6.2 Exception */ /* 7.6.2 Exception */
extern int feclearexcept (int); extern int feclearexcept (int);
extern int fegetexceptflag (fexcept_t * flagp, int excepts); extern int fegetexceptflag (fexcept_t * flagp, int excepts);
extern int feraiseexcept (int excepts ); extern int feraiseexcept (int excepts );
extern int fesetexceptflag (const fexcept_t *, int); extern int fesetexceptflag (const fexcept_t *, int);
extern int fetestexcept (int excepts); extern int fetestexcept (int excepts);
/* 7.6.3 Rounding */ /* 7.6.3 Rounding */
extern int fegetround (void); extern int fegetround (void);
extern int fesetround (int mode); extern int fesetround (int mode);
/* 7.6.4 Environment */ /* 7.6.4 Environment */
extern int fegetenv (fenv_t * envp); extern int fegetenv (fenv_t * envp);
extern int fesetenv (const fenv_t * ); extern int fesetenv (const fenv_t * );
extern int feupdateenv (const fenv_t *); extern int feupdateenv (const fenv_t *);
extern int feholdexcept (fenv_t *); extern int feholdexcept (fenv_t *);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
#endif /* ndef _FENV_H */ #endif /* ndef _FENV_H */

View File

@ -1,224 +1,224 @@
/* /*
* float.h * float.h
* *
* Constants related to floating point arithmetic. * Constants related to floating point arithmetic.
* *
* Also included here are some non-ANSI bits for accessing the floating * Also included here are some non-ANSI bits for accessing the floating
* point controller. * point controller.
* *
* NOTE: GCC provides float.h, and it is probably more accurate than this, * NOTE: GCC provides float.h, and it is probably more accurate than this,
* but it doesn't include the non-standard stuff for accessing the * but it doesn't include the non-standard stuff for accessing the
* fp controller. (TODO: Move those bits elsewhere?) Thus it is * fp controller. (TODO: Move those bits elsewhere?) Thus it is
* probably not a good idea to use the GCC supplied version instead * probably not a good idea to use the GCC supplied version instead
* of this header. * of this header.
* *
* This file is part of the Mingw32 package. * This file is part of the Mingw32 package.
* *
* Contributors: * Contributors:
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp> * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
* *
* THIS SOFTWARE IS NOT COPYRIGHTED * THIS SOFTWARE IS NOT COPYRIGHTED
* *
* This source code is offered for use in the public domain. You may * This source code is offered for use in the public domain. You may
* use, modify or distribute it freely. * use, modify or distribute it freely.
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* $Author: bellard $ * $Author: bellard $
* $Date: 2005/04/14 23:49:21 $ * $Date: 2005/04/17 13:14:29 $
* *
*/ */
#ifndef _FLOAT_H_ #ifndef _FLOAT_H_
#define _FLOAT_H_ #define _FLOAT_H_
/* All the headers include this file. */ /* All the headers include this file. */
#include <_mingw.h> #include <_mingw.h>
#define FLT_ROUNDS 1 #define FLT_ROUNDS 1
#define FLT_GUARD 1 #define FLT_GUARD 1
#define FLT_NORMALIZE 1 #define FLT_NORMALIZE 1
/* /*
* The characteristics of float. * The characteristics of float.
*/ */
/* The radix for floating point representation. */ /* The radix for floating point representation. */
#define FLT_RADIX 2 #define FLT_RADIX 2
/* Decimal digits of precision. */ /* Decimal digits of precision. */
#define FLT_DIG 6 #define FLT_DIG 6
/* Smallest number such that 1+x != 1 */ /* Smallest number such that 1+x != 1 */
#define FLT_EPSILON 1.19209290e-07F #define FLT_EPSILON 1.19209290e-07F
/* The number of base FLT_RADIX digits in the mantissa. */ /* The number of base FLT_RADIX digits in the mantissa. */
#define FLT_MANT_DIG 24 #define FLT_MANT_DIG 24
/* The maximum floating point number. */ /* The maximum floating point number. */
#define FLT_MAX 3.40282347e+38F #define FLT_MAX 3.40282347e+38F
/* Maximum n such that FLT_RADIX^n - 1 is representable. */ /* Maximum n such that FLT_RADIX^n - 1 is representable. */
#define FLT_MAX_EXP 128 #define FLT_MAX_EXP 128
/* Maximum n such that 10^n is representable. */ /* Maximum n such that 10^n is representable. */
#define FLT_MAX_10_EXP 38 #define FLT_MAX_10_EXP 38
/* Minimum normalized floating-point number. */ /* Minimum normalized floating-point number. */
#define FLT_MIN 1.17549435e-38F #define FLT_MIN 1.17549435e-38F
/* Minimum n such that FLT_RADIX^n is a normalized number. */ /* Minimum n such that FLT_RADIX^n is a normalized number. */
#define FLT_MIN_EXP (-125) #define FLT_MIN_EXP (-125)
/* Minimum n such that 10^n is a normalized number. */ /* Minimum n such that 10^n is a normalized number. */
#define FLT_MIN_10_EXP (-37) #define FLT_MIN_10_EXP (-37)
/* /*
* The characteristics of double. * The characteristics of double.
*/ */
#define DBL_DIG 15 #define DBL_DIG 15
#define DBL_EPSILON 1.1102230246251568e-16 #define DBL_EPSILON 1.1102230246251568e-16
#define DBL_MANT_DIG 53 #define DBL_MANT_DIG 53
#define DBL_MAX 1.7976931348623157e+308 #define DBL_MAX 1.7976931348623157e+308
#define DBL_MAX_EXP 1024 #define DBL_MAX_EXP 1024
#define DBL_MAX_10_EXP 308 #define DBL_MAX_10_EXP 308
#define DBL_MIN 2.2250738585072014e-308 #define DBL_MIN 2.2250738585072014e-308
#define DBL_MIN_EXP (-1021) #define DBL_MIN_EXP (-1021)
#define DBL_MIN_10_EXP (-307) #define DBL_MIN_10_EXP (-307)
/* /*
* The characteristics of long double. * The characteristics of long double.
* NOTE: long double is the same as double. * NOTE: long double is the same as double.
*/ */
#define LDBL_DIG 15 #define LDBL_DIG 15
#define LDBL_EPSILON 1.1102230246251568e-16L #define LDBL_EPSILON 1.1102230246251568e-16L
#define LDBL_MANT_DIG 53 #define LDBL_MANT_DIG 53
#define LDBL_MAX 1.7976931348623157e+308L #define LDBL_MAX 1.7976931348623157e+308L
#define LDBL_MAX_EXP 1024 #define LDBL_MAX_EXP 1024
#define LDBL_MAX_10_EXP 308 #define LDBL_MAX_10_EXP 308
#define LDBL_MIN 2.2250738585072014e-308L #define LDBL_MIN 2.2250738585072014e-308L
#define LDBL_MIN_EXP (-1021) #define LDBL_MIN_EXP (-1021)
#define LDBL_MIN_10_EXP (-307) #define LDBL_MIN_10_EXP (-307)
/* /*
* Functions and definitions for controlling the FPU. * Functions and definitions for controlling the FPU.
*/ */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
/* TODO: These constants are only valid for x86 machines */ /* TODO: These constants are only valid for x86 machines */
/* Control word masks for unMask */ /* Control word masks for unMask */
#define _MCW_EM 0x0008001F /* Error masks */ #define _MCW_EM 0x0008001F /* Error masks */
#define _MCW_IC 0x00040000 /* Infinity */ #define _MCW_IC 0x00040000 /* Infinity */
#define _MCW_RC 0x00000300 /* Rounding */ #define _MCW_RC 0x00000300 /* Rounding */
#define _MCW_PC 0x00030000 /* Precision */ #define _MCW_PC 0x00030000 /* Precision */
/* Control word values for unNew (use with related unMask above) */ /* Control word values for unNew (use with related unMask above) */
#define _EM_INVALID 0x00000010 #define _EM_INVALID 0x00000010
#define _EM_DENORMAL 0x00080000 #define _EM_DENORMAL 0x00080000
#define _EM_ZERODIVIDE 0x00000008 #define _EM_ZERODIVIDE 0x00000008
#define _EM_OVERFLOW 0x00000004 #define _EM_OVERFLOW 0x00000004
#define _EM_UNDERFLOW 0x00000002 #define _EM_UNDERFLOW 0x00000002
#define _EM_INEXACT 0x00000001 #define _EM_INEXACT 0x00000001
#define _IC_AFFINE 0x00040000 #define _IC_AFFINE 0x00040000
#define _IC_PROJECTIVE 0x00000000 #define _IC_PROJECTIVE 0x00000000
#define _RC_CHOP 0x00000300 #define _RC_CHOP 0x00000300
#define _RC_UP 0x00000200 #define _RC_UP 0x00000200
#define _RC_DOWN 0x00000100 #define _RC_DOWN 0x00000100
#define _RC_NEAR 0x00000000 #define _RC_NEAR 0x00000000
#define _PC_24 0x00020000 #define _PC_24 0x00020000
#define _PC_53 0x00010000 #define _PC_53 0x00010000
#define _PC_64 0x00000000 #define _PC_64 0x00000000
/* These are also defined in Mingw math.h, needed to work around /* These are also defined in Mingw math.h, needed to work around
GCC build issues. */ GCC build issues. */
/* Return values for fpclass. */ /* Return values for fpclass. */
#ifndef __MINGW_FPCLASS_DEFINED #ifndef __MINGW_FPCLASS_DEFINED
#define __MINGW_FPCLASS_DEFINED 1 #define __MINGW_FPCLASS_DEFINED 1
#define _FPCLASS_SNAN 0x0001 /* Signaling "Not a Number" */ #define _FPCLASS_SNAN 0x0001 /* Signaling "Not a Number" */
#define _FPCLASS_QNAN 0x0002 /* Quiet "Not a Number" */ #define _FPCLASS_QNAN 0x0002 /* Quiet "Not a Number" */
#define _FPCLASS_NINF 0x0004 /* Negative Infinity */ #define _FPCLASS_NINF 0x0004 /* Negative Infinity */
#define _FPCLASS_NN 0x0008 /* Negative Normal */ #define _FPCLASS_NN 0x0008 /* Negative Normal */
#define _FPCLASS_ND 0x0010 /* Negative Denormal */ #define _FPCLASS_ND 0x0010 /* Negative Denormal */
#define _FPCLASS_NZ 0x0020 /* Negative Zero */ #define _FPCLASS_NZ 0x0020 /* Negative Zero */
#define _FPCLASS_PZ 0x0040 /* Positive Zero */ #define _FPCLASS_PZ 0x0040 /* Positive Zero */
#define _FPCLASS_PD 0x0080 /* Positive Denormal */ #define _FPCLASS_PD 0x0080 /* Positive Denormal */
#define _FPCLASS_PN 0x0100 /* Positive Normal */ #define _FPCLASS_PN 0x0100 /* Positive Normal */
#define _FPCLASS_PINF 0x0200 /* Positive Infinity */ #define _FPCLASS_PINF 0x0200 /* Positive Infinity */
#endif /* __MINGW_FPCLASS_DEFINED */ #endif /* __MINGW_FPCLASS_DEFINED */
/* invalid subconditions (_SW_INVALID also set) */ /* invalid subconditions (_SW_INVALID also set) */
#define _SW_UNEMULATED 0x0040 /* unemulated instruction */ #define _SW_UNEMULATED 0x0040 /* unemulated instruction */
#define _SW_SQRTNEG 0x0080 /* square root of a neg number */ #define _SW_SQRTNEG 0x0080 /* square root of a neg number */
#define _SW_STACKOVERFLOW 0x0200 /* FP stack overflow */ #define _SW_STACKOVERFLOW 0x0200 /* FP stack overflow */
#define _SW_STACKUNDERFLOW 0x0400 /* FP stack underflow */ #define _SW_STACKUNDERFLOW 0x0400 /* FP stack underflow */
/* Floating point error signals and return codes */ /* Floating point error signals and return codes */
#define _FPE_INVALID 0x81 #define _FPE_INVALID 0x81
#define _FPE_DENORMAL 0x82 #define _FPE_DENORMAL 0x82
#define _FPE_ZERODIVIDE 0x83 #define _FPE_ZERODIVIDE 0x83
#define _FPE_OVERFLOW 0x84 #define _FPE_OVERFLOW 0x84
#define _FPE_UNDERFLOW 0x85 #define _FPE_UNDERFLOW 0x85
#define _FPE_INEXACT 0x86 #define _FPE_INEXACT 0x86
#define _FPE_UNEMULATED 0x87 #define _FPE_UNEMULATED 0x87
#define _FPE_SQRTNEG 0x88 #define _FPE_SQRTNEG 0x88
#define _FPE_STACKOVERFLOW 0x8a #define _FPE_STACKOVERFLOW 0x8a
#define _FPE_STACKUNDERFLOW 0x8b #define _FPE_STACKUNDERFLOW 0x8b
#define _FPE_EXPLICITGEN 0x8c /* raise( SIGFPE ); */ #define _FPE_EXPLICITGEN 0x8c /* raise( SIGFPE ); */
#ifndef RC_INVOKED #ifndef RC_INVOKED
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* Set the FPU control word as cw = (cw & ~unMask) | (unNew & unMask), /* Set the FPU control word as cw = (cw & ~unMask) | (unNew & unMask),
* i.e. change the bits in unMask to have the values they have in unNew, * i.e. change the bits in unMask to have the values they have in unNew,
* leaving other bits unchanged. */ * leaving other bits unchanged. */
unsigned int _controlfp (unsigned int unNew, unsigned int unMask); unsigned int _controlfp (unsigned int unNew, unsigned int unMask);
unsigned int _control87 (unsigned int unNew, unsigned int unMask); unsigned int _control87 (unsigned int unNew, unsigned int unMask);
unsigned int _clearfp (void); /* Clear the FPU status word */ unsigned int _clearfp (void); /* Clear the FPU status word */
unsigned int _statusfp (void); /* Report the FPU status word */ unsigned int _statusfp (void); /* Report the FPU status word */
#define _clear87 _clearfp #define _clear87 _clearfp
#define _status87 _statusfp #define _status87 _statusfp
void _fpreset (void); /* Reset the FPU */ void _fpreset (void); /* Reset the FPU */
void fpreset (void); void fpreset (void);
/* Global 'variable' for the current floating point error code. */ /* Global 'variable' for the current floating point error code. */
int * __fpecode(void); int * __fpecode(void);
#define _fpecode (*(__fpecode())) #define _fpecode (*(__fpecode()))
/* /*
* IEEE recommended functions * IEEE recommended functions
*/ */
double _chgsign (double); double _chgsign (double);
double _copysign (double, double); double _copysign (double, double);
double _logb (double); double _logb (double);
double _nextafter (double, double); double _nextafter (double, double);
double _scalb (double, long); double _scalb (double, long);
int _finite (double); int _finite (double);
int _fpclass (double); int _fpclass (double);
int _isnan (double); int _isnan (double);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
#endif /* Not __STRICT_ANSI__ */ #endif /* Not __STRICT_ANSI__ */
#endif /* _FLOAT_H_ */ #endif /* _FLOAT_H_ */

View File

@ -1,275 +1,275 @@
/* 7.8 Format conversion of integer types <inttypes.h> */ /* 7.8 Format conversion of integer types <inttypes.h> */
#ifndef _INTTYPES_H #ifndef _INTTYPES_H
#define _INTTYPES_H #define _INTTYPES_H
#include <stdint.h> #include <stdint.h>
#define __need_wchar_t #define __need_wchar_t
#include <stddef.h> #include <stddef.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
typedef struct { typedef struct {
intmax_t quot; intmax_t quot;
intmax_t rem; intmax_t rem;
} imaxdiv_t; } imaxdiv_t;
#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) #if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS)
/* 7.8.1 Macros for format specifiers /* 7.8.1 Macros for format specifiers
* *
* MS runtime does not yet understand C9x standard "ll" * MS runtime does not yet understand C9x standard "ll"
* length specifier. It appears to treat "ll" as "l". * length specifier. It appears to treat "ll" as "l".
* The non-standard I64 length specifier causes warning in GCC, * The non-standard I64 length specifier causes warning in GCC,
* but understood by MS runtime functions. * but understood by MS runtime functions.
*/ */
/* fprintf macros for signed types */ /* fprintf macros for signed types */
#define PRId8 "d" #define PRId8 "d"
#define PRId16 "d" #define PRId16 "d"
#define PRId32 "d" #define PRId32 "d"
#define PRId64 "I64d" #define PRId64 "I64d"
#define PRIdLEAST8 "d" #define PRIdLEAST8 "d"
#define PRIdLEAST16 "d" #define PRIdLEAST16 "d"
#define PRIdLEAST32 "d" #define PRIdLEAST32 "d"
#define PRIdLEAST64 "I64d" #define PRIdLEAST64 "I64d"
#define PRIdFAST8 "d" #define PRIdFAST8 "d"
#define PRIdFAST16 "d" #define PRIdFAST16 "d"
#define PRIdFAST32 "d" #define PRIdFAST32 "d"
#define PRIdFAST64 "I64d" #define PRIdFAST64 "I64d"
#define PRIdMAX "I64d" #define PRIdMAX "I64d"
#define PRIdPTR "d" #define PRIdPTR "d"
#define PRIi8 "i" #define PRIi8 "i"
#define PRIi16 "i" #define PRIi16 "i"
#define PRIi32 "i" #define PRIi32 "i"
#define PRIi64 "I64i" #define PRIi64 "I64i"
#define PRIiLEAST8 "i" #define PRIiLEAST8 "i"
#define PRIiLEAST16 "i" #define PRIiLEAST16 "i"
#define PRIiLEAST32 "i" #define PRIiLEAST32 "i"
#define PRIiLEAST64 "I64i" #define PRIiLEAST64 "I64i"
#define PRIiFAST8 "i" #define PRIiFAST8 "i"
#define PRIiFAST16 "i" #define PRIiFAST16 "i"
#define PRIiFAST32 "i" #define PRIiFAST32 "i"
#define PRIiFAST64 "I64i" #define PRIiFAST64 "I64i"
#define PRIiMAX "I64i" #define PRIiMAX "I64i"
#define PRIiPTR "i" #define PRIiPTR "i"
#define PRIo8 "o" #define PRIo8 "o"
#define PRIo16 "o" #define PRIo16 "o"
#define PRIo32 "o" #define PRIo32 "o"
#define PRIo64 "I64o" #define PRIo64 "I64o"
#define PRIoLEAST8 "o" #define PRIoLEAST8 "o"
#define PRIoLEAST16 "o" #define PRIoLEAST16 "o"
#define PRIoLEAST32 "o" #define PRIoLEAST32 "o"
#define PRIoLEAST64 "I64o" #define PRIoLEAST64 "I64o"
#define PRIoFAST8 "o" #define PRIoFAST8 "o"
#define PRIoFAST16 "o" #define PRIoFAST16 "o"
#define PRIoFAST32 "o" #define PRIoFAST32 "o"
#define PRIoFAST64 "I64o" #define PRIoFAST64 "I64o"
#define PRIoMAX "I64o" #define PRIoMAX "I64o"
#define PRIoPTR "o" #define PRIoPTR "o"
/* fprintf macros for unsigned types */ /* fprintf macros for unsigned types */
#define PRIu8 "u" #define PRIu8 "u"
#define PRIu16 "u" #define PRIu16 "u"
#define PRIu32 "u" #define PRIu32 "u"
#define PRIu64 "I64u" #define PRIu64 "I64u"
#define PRIuLEAST8 "u" #define PRIuLEAST8 "u"
#define PRIuLEAST16 "u" #define PRIuLEAST16 "u"
#define PRIuLEAST32 "u" #define PRIuLEAST32 "u"
#define PRIuLEAST64 "I64u" #define PRIuLEAST64 "I64u"
#define PRIuFAST8 "u" #define PRIuFAST8 "u"
#define PRIuFAST16 "u" #define PRIuFAST16 "u"
#define PRIuFAST32 "u" #define PRIuFAST32 "u"
#define PRIuFAST64 "I64u" #define PRIuFAST64 "I64u"
#define PRIuMAX "I64u" #define PRIuMAX "I64u"
#define PRIuPTR "u" #define PRIuPTR "u"
#define PRIx8 "x" #define PRIx8 "x"
#define PRIx16 "x" #define PRIx16 "x"
#define PRIx32 "x" #define PRIx32 "x"
#define PRIx64 "I64x" #define PRIx64 "I64x"
#define PRIxLEAST8 "x" #define PRIxLEAST8 "x"
#define PRIxLEAST16 "x" #define PRIxLEAST16 "x"
#define PRIxLEAST32 "x" #define PRIxLEAST32 "x"
#define PRIxLEAST64 "I64x" #define PRIxLEAST64 "I64x"
#define PRIxFAST8 "x" #define PRIxFAST8 "x"
#define PRIxFAST16 "x" #define PRIxFAST16 "x"
#define PRIxFAST32 "x" #define PRIxFAST32 "x"
#define PRIxFAST64 "I64x" #define PRIxFAST64 "I64x"
#define PRIxMAX "I64x" #define PRIxMAX "I64x"
#define PRIxPTR "x" #define PRIxPTR "x"
#define PRIX8 "X" #define PRIX8 "X"
#define PRIX16 "X" #define PRIX16 "X"
#define PRIX32 "X" #define PRIX32 "X"
#define PRIX64 "I64X" #define PRIX64 "I64X"
#define PRIXLEAST8 "X" #define PRIXLEAST8 "X"
#define PRIXLEAST16 "X" #define PRIXLEAST16 "X"
#define PRIXLEAST32 "X" #define PRIXLEAST32 "X"
#define PRIXLEAST64 "I64X" #define PRIXLEAST64 "I64X"
#define PRIXFAST8 "X" #define PRIXFAST8 "X"
#define PRIXFAST16 "X" #define PRIXFAST16 "X"
#define PRIXFAST32 "X" #define PRIXFAST32 "X"
#define PRIXFAST64 "I64X" #define PRIXFAST64 "I64X"
#define PRIXMAX "I64X" #define PRIXMAX "I64X"
#define PRIXPTR "X" #define PRIXPTR "X"
/* /*
* fscanf macros for signed int types * fscanf macros for signed int types
* NOTE: if 32-bit int is used for int_fast8_t and int_fast16_t * NOTE: if 32-bit int is used for int_fast8_t and int_fast16_t
* (see stdint.h, 7.18.1.3), FAST8 and FAST16 should have * (see stdint.h, 7.18.1.3), FAST8 and FAST16 should have
* no length identifiers * no length identifiers
*/ */
#define SCNd16 "hd" #define SCNd16 "hd"
#define SCNd32 "d" #define SCNd32 "d"
#define SCNd64 "I64d" #define SCNd64 "I64d"
#define SCNdLEAST16 "hd" #define SCNdLEAST16 "hd"
#define SCNdLEAST32 "d" #define SCNdLEAST32 "d"
#define SCNdLEAST64 "I64d" #define SCNdLEAST64 "I64d"
#define SCNdFAST16 "hd" #define SCNdFAST16 "hd"
#define SCNdFAST32 "d" #define SCNdFAST32 "d"
#define SCNdFAST64 "I64d" #define SCNdFAST64 "I64d"
#define SCNdMAX "I64d" #define SCNdMAX "I64d"
#define SCNdPTR "d" #define SCNdPTR "d"
#define SCNi16 "hi" #define SCNi16 "hi"
#define SCNi32 "i" #define SCNi32 "i"
#define SCNi64 "I64i" #define SCNi64 "I64i"
#define SCNiLEAST16 "hi" #define SCNiLEAST16 "hi"
#define SCNiLEAST32 "i" #define SCNiLEAST32 "i"
#define SCNiLEAST64 "I64i" #define SCNiLEAST64 "I64i"
#define SCNiFAST16 "hi" #define SCNiFAST16 "hi"
#define SCNiFAST32 "i" #define SCNiFAST32 "i"
#define SCNiFAST64 "I64i" #define SCNiFAST64 "I64i"
#define SCNiMAX "I64i" #define SCNiMAX "I64i"
#define SCNiPTR "i" #define SCNiPTR "i"
#define SCNo16 "ho" #define SCNo16 "ho"
#define SCNo32 "o" #define SCNo32 "o"
#define SCNo64 "I64o" #define SCNo64 "I64o"
#define SCNoLEAST16 "ho" #define SCNoLEAST16 "ho"
#define SCNoLEAST32 "o" #define SCNoLEAST32 "o"
#define SCNoLEAST64 "I64o" #define SCNoLEAST64 "I64o"
#define SCNoFAST16 "ho" #define SCNoFAST16 "ho"
#define SCNoFAST32 "o" #define SCNoFAST32 "o"
#define SCNoFAST64 "I64o" #define SCNoFAST64 "I64o"
#define SCNoMAX "I64o" #define SCNoMAX "I64o"
#define SCNoPTR "o" #define SCNoPTR "o"
#define SCNx16 "hx" #define SCNx16 "hx"
#define SCNx32 "x" #define SCNx32 "x"
#define SCNx64 "I64x" #define SCNx64 "I64x"
#define SCNxLEAST16 "hx" #define SCNxLEAST16 "hx"
#define SCNxLEAST32 "x" #define SCNxLEAST32 "x"
#define SCNxLEAST64 "I64x" #define SCNxLEAST64 "I64x"
#define SCNxFAST16 "hx" #define SCNxFAST16 "hx"
#define SCNxFAST32 "x" #define SCNxFAST32 "x"
#define SCNxFAST64 "I64x" #define SCNxFAST64 "I64x"
#define SCNxMAX "I64x" #define SCNxMAX "I64x"
#define SCNxPTR "x" #define SCNxPTR "x"
/* fscanf macros for unsigned int types */ /* fscanf macros for unsigned int types */
#define SCNu16 "hu" #define SCNu16 "hu"
#define SCNu32 "u" #define SCNu32 "u"
#define SCNu64 "I64u" #define SCNu64 "I64u"
#define SCNuLEAST16 "hu" #define SCNuLEAST16 "hu"
#define SCNuLEAST32 "u" #define SCNuLEAST32 "u"
#define SCNuLEAST64 "I64u" #define SCNuLEAST64 "I64u"
#define SCNuFAST16 "hu" #define SCNuFAST16 "hu"
#define SCNuFAST32 "u" #define SCNuFAST32 "u"
#define SCNuFAST64 "I64u" #define SCNuFAST64 "I64u"
#define SCNuMAX "I64u" #define SCNuMAX "I64u"
#define SCNuPTR "u" #define SCNuPTR "u"
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
/* /*
* no length modifier for char types prior to C9x * no length modifier for char types prior to C9x
* MS runtime scanf appears to treat "hh" as "h" * MS runtime scanf appears to treat "hh" as "h"
*/ */
/* signed char */ /* signed char */
#define SCNd8 "hhd" #define SCNd8 "hhd"
#define SCNdLEAST8 "hhd" #define SCNdLEAST8 "hhd"
#define SCNdFAST8 "hhd" #define SCNdFAST8 "hhd"
#define SCNi8 "hhi" #define SCNi8 "hhi"
#define SCNiLEAST8 "hhi" #define SCNiLEAST8 "hhi"
#define SCNiFAST8 "hhi" #define SCNiFAST8 "hhi"
#define SCNo8 "hho" #define SCNo8 "hho"
#define SCNoLEAST8 "hho" #define SCNoLEAST8 "hho"
#define SCNoFAST8 "hho" #define SCNoFAST8 "hho"
#define SCNx8 "hhx" #define SCNx8 "hhx"
#define SCNxLEAST8 "hhx" #define SCNxLEAST8 "hhx"
#define SCNxFAST8 "hhx" #define SCNxFAST8 "hhx"
/* unsigned char */ /* unsigned char */
#define SCNu8 "hhu" #define SCNu8 "hhu"
#define SCNuLEAST8 "hhu" #define SCNuLEAST8 "hhu"
#define SCNuFAST8 "hhu" #define SCNuFAST8 "hhu"
#endif /* __STDC_VERSION__ >= 199901 */ #endif /* __STDC_VERSION__ >= 199901 */
#endif /* !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) */ #endif /* !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) */
extern inline intmax_t imaxabs (intmax_t j) extern inline intmax_t imaxabs (intmax_t j)
{return (j >= 0 ? j : -j);} {return (j >= 0 ? j : -j);}
imaxdiv_t imaxdiv (intmax_t numer, intmax_t denom); imaxdiv_t imaxdiv (intmax_t numer, intmax_t denom);
/* 7.8.2 Conversion functions for greatest-width integer types */ /* 7.8.2 Conversion functions for greatest-width integer types */
intmax_t strtoimax (const char* __restrict__ nptr, char** __restrict__ endptr, int base); intmax_t strtoimax (const char* __restrict__ nptr, char** __restrict__ endptr, int base);
uintmax_t strtoumax (const char* __restrict__ nptr, char** __restrict__ endptr, int base); uintmax_t strtoumax (const char* __restrict__ nptr, char** __restrict__ endptr, int base);
intmax_t wcstoimax (const wchar_t* __restrict__ nptr, wchar_t** __restrict__ endptr, intmax_t wcstoimax (const wchar_t* __restrict__ nptr, wchar_t** __restrict__ endptr,
int base); int base);
uintmax_t wcstoumax (const wchar_t* __restrict__ nptr, wchar_t** __restrict__ endptr, uintmax_t wcstoumax (const wchar_t* __restrict__ nptr, wchar_t** __restrict__ endptr,
int base); int base);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* ndef _INTTYPES_H */ #endif /* ndef _INTTYPES_H */

View File

@ -1,296 +1,296 @@
/* /*
* io.h * io.h
* *
* System level I/O functions and types. * System level I/O functions and types.
* *
* This file is part of the Mingw32 package. * This file is part of the Mingw32 package.
* *
* Contributors: * Contributors:
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp> * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
* *
* THIS SOFTWARE IS NOT COPYRIGHTED * THIS SOFTWARE IS NOT COPYRIGHTED
* *
* This source code is offered for use in the public domain. You may * This source code is offered for use in the public domain. You may
* use, modify or distribute it freely. * use, modify or distribute it freely.
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* $Author: bellard $ * $Author: bellard $
* $Date: 2005/04/14 23:49:21 $ * $Date: 2005/04/17 13:14:29 $
* *
*/ */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#ifndef _IO_H_ #ifndef _IO_H_
#define _IO_H_ #define _IO_H_
/* All the headers include this file. */ /* All the headers include this file. */
#include <_mingw.h> #include <_mingw.h>
/* We need the definition of FILE anyway... */ /* We need the definition of FILE anyway... */
#include <stdio.h> #include <stdio.h>
/* MSVC's io.h contains the stuff from dir.h, so I will too. /* MSVC's io.h contains the stuff from dir.h, so I will too.
* NOTE: This also defines off_t, the file offset type, through * NOTE: This also defines off_t, the file offset type, through
* an inclusion of sys/types.h */ * an inclusion of sys/types.h */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#include <sys/types.h> /* To get time_t. */ #include <sys/types.h> /* To get time_t. */
/* /*
* Attributes of files as returned by _findfirst et al. * Attributes of files as returned by _findfirst et al.
*/ */
#define _A_NORMAL 0x00000000 #define _A_NORMAL 0x00000000
#define _A_RDONLY 0x00000001 #define _A_RDONLY 0x00000001
#define _A_HIDDEN 0x00000002 #define _A_HIDDEN 0x00000002
#define _A_SYSTEM 0x00000004 #define _A_SYSTEM 0x00000004
#define _A_VOLID 0x00000008 #define _A_VOLID 0x00000008
#define _A_SUBDIR 0x00000010 #define _A_SUBDIR 0x00000010
#define _A_ARCH 0x00000020 #define _A_ARCH 0x00000020
#ifndef RC_INVOKED #ifndef RC_INVOKED
#ifndef _FSIZE_T_DEFINED #ifndef _FSIZE_T_DEFINED
typedef unsigned long _fsize_t; typedef unsigned long _fsize_t;
#define _FSIZE_T_DEFINED #define _FSIZE_T_DEFINED
#endif #endif
/* /*
* The following structure is filled in by _findfirst or _findnext when * The following structure is filled in by _findfirst or _findnext when
* they succeed in finding a match. * they succeed in finding a match.
*/ */
struct _finddata_t struct _finddata_t
{ {
unsigned attrib; /* Attributes, see constants above. */ unsigned attrib; /* Attributes, see constants above. */
time_t time_create; time_t time_create;
time_t time_access; /* always midnight local time */ time_t time_access; /* always midnight local time */
time_t time_write; time_t time_write;
_fsize_t size; _fsize_t size;
char name[FILENAME_MAX]; /* may include spaces. */ char name[FILENAME_MAX]; /* may include spaces. */
}; };
struct _finddatai64_t { struct _finddatai64_t {
unsigned attrib; unsigned attrib;
time_t time_create; time_t time_create;
time_t time_access; time_t time_access;
time_t time_write; time_t time_write;
__int64 size; __int64 size;
char name[FILENAME_MAX]; char name[FILENAME_MAX];
}; };
#ifndef _WFINDDATA_T_DEFINED #ifndef _WFINDDATA_T_DEFINED
struct _wfinddata_t { struct _wfinddata_t {
unsigned attrib; unsigned attrib;
time_t time_create; /* -1 for FAT file systems */ time_t time_create; /* -1 for FAT file systems */
time_t time_access; /* -1 for FAT file systems */ time_t time_access; /* -1 for FAT file systems */
time_t time_write; time_t time_write;
_fsize_t size; _fsize_t size;
wchar_t name[FILENAME_MAX]; /* may include spaces. */ wchar_t name[FILENAME_MAX]; /* may include spaces. */
}; };
struct _wfinddatai64_t { struct _wfinddatai64_t {
unsigned attrib; unsigned attrib;
time_t time_create; time_t time_create;
time_t time_access; time_t time_access;
time_t time_write; time_t time_write;
__int64 size; __int64 size;
wchar_t name[FILENAME_MAX]; wchar_t name[FILENAME_MAX];
}; };
#define _WFINDDATA_T_DEFINED #define _WFINDDATA_T_DEFINED
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* /*
* Functions for searching for files. _findfirst returns -1 if no match * Functions for searching for files. _findfirst returns -1 if no match
* is found. Otherwise it returns a handle to be used in _findnext and * is found. Otherwise it returns a handle to be used in _findnext and
* _findclose calls. _findnext also returns -1 if no match could be found, * _findclose calls. _findnext also returns -1 if no match could be found,
* and 0 if a match was found. Call _findclose when you are finished. * and 0 if a match was found. Call _findclose when you are finished.
*/ */
int _findfirst (const char*, struct _finddata_t*); int _findfirst (const char*, struct _finddata_t*);
int _findnext (int, struct _finddata_t*); int _findnext (int, struct _finddata_t*);
int _findclose (int); int _findclose (int);
int _chdir (const char*); int _chdir (const char*);
char* _getcwd (char*, int); char* _getcwd (char*, int);
int _mkdir (const char*); int _mkdir (const char*);
char* _mktemp (char*); char* _mktemp (char*);
int _rmdir (const char*); int _rmdir (const char*);
#ifdef __MSVCRT__ #ifdef __MSVCRT__
__int64 _filelengthi64(int); __int64 _filelengthi64(int);
long _findfirsti64(const char*, struct _finddatai64_t*); long _findfirsti64(const char*, struct _finddatai64_t*);
int _findnexti64(long, struct _finddatai64_t*); int _findnexti64(long, struct _finddatai64_t*);
__int64 _lseeki64(int, __int64, int); __int64 _lseeki64(int, __int64, int);
__int64 _telli64(int); __int64 _telli64(int);
#endif /* __MSVCRT__ */ #endif /* __MSVCRT__ */
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
#ifndef _UWIN #ifndef _UWIN
int chdir (const char*); int chdir (const char*);
char* getcwd (char*, int); char* getcwd (char*, int);
int mkdir (const char*); int mkdir (const char*);
char* mktemp (char*); char* mktemp (char*);
int rmdir (const char*); int rmdir (const char*);
#endif /* _UWIN */ #endif /* _UWIN */
#endif /* Not _NO_OLDNAMES */ #endif /* Not _NO_OLDNAMES */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
#endif /* Not __STRICT_ANSI__ */ #endif /* Not __STRICT_ANSI__ */
/* TODO: Maximum number of open handles has not been tested, I just set /* TODO: Maximum number of open handles has not been tested, I just set
* it the same as FOPEN_MAX. */ * it the same as FOPEN_MAX. */
#define HANDLE_MAX FOPEN_MAX #define HANDLE_MAX FOPEN_MAX
/* Some defines for _access nAccessMode (MS doesn't define them, but /* Some defines for _access nAccessMode (MS doesn't define them, but
* it doesn't seem to hurt to add them). */ * it doesn't seem to hurt to add them). */
#define F_OK 0 /* Check for file existence */ #define F_OK 0 /* Check for file existence */
#define X_OK 1 /* Check for execute permission. */ #define X_OK 1 /* Check for execute permission. */
#define W_OK 2 /* Check for write permission */ #define W_OK 2 /* Check for write permission */
#define R_OK 4 /* Check for read permission */ #define R_OK 4 /* Check for read permission */
#ifndef RC_INVOKED #ifndef RC_INVOKED
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
int _access (const char*, int); int _access (const char*, int);
int _chsize (int, long); int _chsize (int, long);
int _close (int); int _close (int);
int _commit(int); int _commit(int);
/* NOTE: The only significant bit in unPermissions appears to be bit 7 (0x80), /* NOTE: The only significant bit in unPermissions appears to be bit 7 (0x80),
* the "owner write permission" bit (on FAT). */ * the "owner write permission" bit (on FAT). */
int _creat (const char*, unsigned); int _creat (const char*, unsigned);
int _dup (int); int _dup (int);
int _dup2 (int, int); int _dup2 (int, int);
long _filelength (int); long _filelength (int);
int _fileno (FILE*); int _fileno (FILE*);
long _get_osfhandle (int); long _get_osfhandle (int);
int _isatty (int); int _isatty (int);
/* In a very odd turn of events this function is excluded from those /* In a very odd turn of events this function is excluded from those
* files which define _STREAM_COMPAT. This is required in order to * files which define _STREAM_COMPAT. This is required in order to
* build GNU libio because of a conflict with _eof in streambuf.h * build GNU libio because of a conflict with _eof in streambuf.h
* line 107. Actually I might just be able to change the name of * line 107. Actually I might just be able to change the name of
* the enum member in streambuf.h... we'll see. TODO */ * the enum member in streambuf.h... we'll see. TODO */
#ifndef _STREAM_COMPAT #ifndef _STREAM_COMPAT
int _eof (int); int _eof (int);
#endif #endif
/* LK_... locking commands defined in sys/locking.h. */ /* LK_... locking commands defined in sys/locking.h. */
int _locking (int, int, long); int _locking (int, int, long);
long _lseek (int, long, int); long _lseek (int, long, int);
/* Optional third argument is unsigned unPermissions. */ /* Optional third argument is unsigned unPermissions. */
int _open (const char*, int, ...); int _open (const char*, int, ...);
int _open_osfhandle (long, int); int _open_osfhandle (long, int);
int _pipe (int *, unsigned int, int); int _pipe (int *, unsigned int, int);
int _read (int, void*, unsigned int); int _read (int, void*, unsigned int);
/* SH_... flags for nShFlags defined in share.h /* SH_... flags for nShFlags defined in share.h
* Optional fourth argument is unsigned unPermissions */ * Optional fourth argument is unsigned unPermissions */
int _sopen (const char*, int, int, ...); int _sopen (const char*, int, int, ...);
long _tell (int); long _tell (int);
/* Should umask be in sys/stat.h and/or sys/types.h instead? */ /* Should umask be in sys/stat.h and/or sys/types.h instead? */
int _umask (int); int _umask (int);
int _unlink (const char*); int _unlink (const char*);
int _write (int, const void*, unsigned int); int _write (int, const void*, unsigned int);
/* Wide character versions. Also declared in wchar.h. */ /* Wide character versions. Also declared in wchar.h. */
/* Not in crtdll.dll */ /* Not in crtdll.dll */
#if !defined (_WIO_DEFINED) #if !defined (_WIO_DEFINED)
#if defined (__MSVCRT__) #if defined (__MSVCRT__)
int _waccess(const wchar_t*, int); int _waccess(const wchar_t*, int);
int _wchmod(const wchar_t*, int); int _wchmod(const wchar_t*, int);
int _wcreat(const wchar_t*, int); int _wcreat(const wchar_t*, int);
long _wfindfirst(wchar_t*, struct _wfinddata_t*); long _wfindfirst(wchar_t*, struct _wfinddata_t*);
int _wfindnext(long, struct _wfinddata_t *); int _wfindnext(long, struct _wfinddata_t *);
int _wunlink(const wchar_t*); int _wunlink(const wchar_t*);
int _wopen(const wchar_t*, int, ...); int _wopen(const wchar_t*, int, ...);
int _wsopen(const wchar_t*, int, int, ...); int _wsopen(const wchar_t*, int, int, ...);
wchar_t * _wmktemp(wchar_t*); wchar_t * _wmktemp(wchar_t*);
long _wfindfirsti64(const wchar_t*, struct _wfinddatai64_t*); long _wfindfirsti64(const wchar_t*, struct _wfinddatai64_t*);
int _wfindnexti64(long, struct _wfinddatai64_t*); int _wfindnexti64(long, struct _wfinddatai64_t*);
#endif /* defined (__MSVCRT__) */ #endif /* defined (__MSVCRT__) */
#define _WIO_DEFINED #define _WIO_DEFINED
#endif /* _WIO_DEFINED */ #endif /* _WIO_DEFINED */
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
/* /*
* Non-underscored versions of non-ANSI functions to improve portability. * Non-underscored versions of non-ANSI functions to improve portability.
* These functions live in libmoldname.a. * These functions live in libmoldname.a.
*/ */
#ifndef _UWIN #ifndef _UWIN
int access (const char*, int); int access (const char*, int);
int chsize (int, long ); int chsize (int, long );
int close (int); int close (int);
int creat (const char*, int); int creat (const char*, int);
int dup (int); int dup (int);
int dup2 (int, int); int dup2 (int, int);
int eof (int); int eof (int);
long filelength (int); long filelength (int);
int fileno (FILE*); int fileno (FILE*);
int isatty (int); int isatty (int);
long lseek (int, long, int); long lseek (int, long, int);
int open (const char*, int, ...); int open (const char*, int, ...);
int read (int, void*, unsigned int); int read (int, void*, unsigned int);
int sopen (const char*, int, int, ...); int sopen (const char*, int, int, ...);
long tell (int); long tell (int);
int umask (int); int umask (int);
int unlink (const char*); int unlink (const char*);
int write (int, const void*, unsigned int); int write (int, const void*, unsigned int);
#endif /* _UWIN */ #endif /* _UWIN */
/* Wide character versions. Also declared in wchar.h. */ /* Wide character versions. Also declared in wchar.h. */
/* Where do these live? Not in libmoldname.a nor in libmsvcrt.a */ /* Where do these live? Not in libmoldname.a nor in libmsvcrt.a */
#if 0 #if 0
int waccess(const wchar_t *, int); int waccess(const wchar_t *, int);
int wchmod(const wchar_t *, int); int wchmod(const wchar_t *, int);
int wcreat(const wchar_t *, int); int wcreat(const wchar_t *, int);
long wfindfirst(wchar_t *, struct _wfinddata_t *); long wfindfirst(wchar_t *, struct _wfinddata_t *);
int wfindnext(long, struct _wfinddata_t *); int wfindnext(long, struct _wfinddata_t *);
int wunlink(const wchar_t *); int wunlink(const wchar_t *);
int wrename(const wchar_t *, const wchar_t *); int wrename(const wchar_t *, const wchar_t *);
int wopen(const wchar_t *, int, ...); int wopen(const wchar_t *, int, ...);
int wsopen(const wchar_t *, int, int, ...); int wsopen(const wchar_t *, int, int, ...);
wchar_t * wmktemp(wchar_t *); wchar_t * wmktemp(wchar_t *);
#endif #endif
#endif /* Not _NO_OLDNAMES */ #endif /* Not _NO_OLDNAMES */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
#endif /* _IO_H_ not defined */ #endif /* _IO_H_ not defined */
#endif /* Not strict ANSI */ #endif /* Not strict ANSI */

View File

@ -1,115 +1,115 @@
/* /*
* limits.h * limits.h
* *
* Defines constants for the sizes of integral types. * Defines constants for the sizes of integral types.
* *
* NOTE: GCC should supply a version of this header and it should be safe to * NOTE: GCC should supply a version of this header and it should be safe to
* use that version instead of this one (maybe safer). * use that version instead of this one (maybe safer).
* *
* This file is part of the Mingw32 package. * This file is part of the Mingw32 package.
* *
* Contributors: * Contributors:
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp> * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
* *
* THIS SOFTWARE IS NOT COPYRIGHTED * THIS SOFTWARE IS NOT COPYRIGHTED
* *
* This source code is offered for use in the public domain. You may * This source code is offered for use in the public domain. You may
* use, modify or distribute it freely. * use, modify or distribute it freely.
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* $Author: bellard $ * $Author: bellard $
* $Date: 2005/04/14 23:49:21 $ * $Date: 2005/04/17 13:14:29 $
* *
*/ */
#ifndef _LIMITS_H_ #ifndef _LIMITS_H_
#define _LIMITS_H_ #define _LIMITS_H_
/* All the headers include this file. */ /* All the headers include this file. */
#include <_mingw.h> #include <_mingw.h>
/* /*
* File system limits * File system limits
* *
* TODO: NAME_MAX and OPEN_MAX are file system limits or not? Are they the * TODO: NAME_MAX and OPEN_MAX are file system limits or not? Are they the
* same as FILENAME_MAX and FOPEN_MAX from stdio.h? * same as FILENAME_MAX and FOPEN_MAX from stdio.h?
* NOTE: Apparently the actual size of PATH_MAX is 260, but a space is * NOTE: Apparently the actual size of PATH_MAX is 260, but a space is
* required for the NUL. TODO: Test? * required for the NUL. TODO: Test?
*/ */
#define PATH_MAX (259) #define PATH_MAX (259)
/* /*
* Characteristics of the char data type. * Characteristics of the char data type.
* *
* TODO: Is MB_LEN_MAX correct? * TODO: Is MB_LEN_MAX correct?
*/ */
#define CHAR_BIT 8 #define CHAR_BIT 8
#define MB_LEN_MAX 2 #define MB_LEN_MAX 2
#define SCHAR_MIN (-128) #define SCHAR_MIN (-128)
#define SCHAR_MAX 127 #define SCHAR_MAX 127
#define UCHAR_MAX 255 #define UCHAR_MAX 255
/* TODO: Is this safe? I think it might just be testing the preprocessor, /* TODO: Is this safe? I think it might just be testing the preprocessor,
* not the compiler itself... */ * not the compiler itself... */
#if ('\x80' < 0) #if ('\x80' < 0)
#define CHAR_MIN SCHAR_MIN #define CHAR_MIN SCHAR_MIN
#define CHAR_MAX SCHAR_MAX #define CHAR_MAX SCHAR_MAX
#else #else
#define CHAR_MIN 0 #define CHAR_MIN 0
#define CHAR_MAX UCHAR_MAX #define CHAR_MAX UCHAR_MAX
#endif #endif
/* /*
* Maximum and minimum values for ints. * Maximum and minimum values for ints.
*/ */
#define INT_MAX 2147483647 #define INT_MAX 2147483647
#define INT_MIN (-INT_MAX-1) #define INT_MIN (-INT_MAX-1)
#define UINT_MAX 0xffffffff #define UINT_MAX 0xffffffff
/* /*
* Maximum and minimum values for shorts. * Maximum and minimum values for shorts.
*/ */
#define SHRT_MAX 32767 #define SHRT_MAX 32767
#define SHRT_MIN (-SHRT_MAX-1) #define SHRT_MIN (-SHRT_MAX-1)
#define USHRT_MAX 0xffff #define USHRT_MAX 0xffff
/* /*
* Maximum and minimum values for longs and unsigned longs. * Maximum and minimum values for longs and unsigned longs.
* *
* TODO: This is not correct for Alphas, which have 64 bit longs. * TODO: This is not correct for Alphas, which have 64 bit longs.
*/ */
#define LONG_MAX 2147483647L #define LONG_MAX 2147483647L
#define LONG_MIN (-LONG_MAX-1) #define LONG_MIN (-LONG_MAX-1)
#define ULONG_MAX 0xffffffffUL #define ULONG_MAX 0xffffffffUL
/* /*
* The GNU C compiler also allows 'long long int' * The GNU C compiler also allows 'long long int'
*/ */
#if !defined(__STRICT_ANSI__) && defined(__GNUC__) #if !defined(__STRICT_ANSI__) && defined(__GNUC__)
#define LONG_LONG_MAX 9223372036854775807LL #define LONG_LONG_MAX 9223372036854775807LL
#define LONG_LONG_MIN (-LONG_LONG_MAX-1) #define LONG_LONG_MIN (-LONG_LONG_MAX-1)
#define ULONG_LONG_MAX (2ULL * LONG_LONG_MAX + 1) #define ULONG_LONG_MAX (2ULL * LONG_LONG_MAX + 1)
/* ISO C9x macro names */ /* ISO C9x macro names */
#define LLONG_MAX LONG_LONG_MAX #define LLONG_MAX LONG_LONG_MAX
#define LLONG_MIN LONG_LONG_MIN #define LLONG_MIN LONG_LONG_MIN
#define ULLONG_MAX ULONG_LONG_MAX #define ULLONG_MAX ULONG_LONG_MAX
#endif /* Not Strict ANSI and GNU C compiler */ #endif /* Not Strict ANSI and GNU C compiler */
#endif /* not _LIMITS_H_ */ #endif /* not _LIMITS_H_ */

View File

@ -1,100 +1,100 @@
/* /*
* locale.h * locale.h
* *
* Functions and types for localization (ie. changing the appearance of * Functions and types for localization (ie. changing the appearance of
* output based on the standards of a certain country). * output based on the standards of a certain country).
* *
* This file is part of the Mingw32 package. * This file is part of the Mingw32 package.
* *
* Contributors: * Contributors:
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp> * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
* *
* THIS SOFTWARE IS NOT COPYRIGHTED * THIS SOFTWARE IS NOT COPYRIGHTED
* *
* This source code is offered for use in the public domain. You may * This source code is offered for use in the public domain. You may
* use, modify or distribute it freely. * use, modify or distribute it freely.
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* $Author: bellard $ * $Author: bellard $
* $Date: 2005/04/14 23:49:21 $ * $Date: 2005/04/17 13:14:29 $
* *
*/ */
#ifndef _LOCALE_H_ #ifndef _LOCALE_H_
#define _LOCALE_H_ #define _LOCALE_H_
/* All the headers include this file. */ /* All the headers include this file. */
#include <_mingw.h> #include <_mingw.h>
/* /*
* NOTE: I have tried to test this, but I am limited by my knowledge of * NOTE: I have tried to test this, but I am limited by my knowledge of
* locale issues. The structure does not bomb if you look at the * locale issues. The structure does not bomb if you look at the
* values, and 'decimal_point' even seems to be correct. But the * values, and 'decimal_point' even seems to be correct. But the
* rest of the values are, by default, not particularly useful * rest of the values are, by default, not particularly useful
* (read meaningless and not related to the international settings * (read meaningless and not related to the international settings
* of the system). * of the system).
*/ */
#define LC_ALL 0 #define LC_ALL 0
#define LC_COLLATE 1 #define LC_COLLATE 1
#define LC_CTYPE 2 #define LC_CTYPE 2
#define LC_MONETARY 3 #define LC_MONETARY 3
#define LC_NUMERIC 4 #define LC_NUMERIC 4
#define LC_TIME 5 #define LC_TIME 5
#define LC_MIN LC_ALL #define LC_MIN LC_ALL
#define LC_MAX LC_TIME #define LC_MAX LC_TIME
#ifndef RC_INVOKED #ifndef RC_INVOKED
/* /*
* The structure returned by 'localeconv'. * The structure returned by 'localeconv'.
*/ */
struct lconv struct lconv
{ {
char* decimal_point; char* decimal_point;
char* thousands_sep; char* thousands_sep;
char* grouping; char* grouping;
char* int_curr_symbol; char* int_curr_symbol;
char* currency_symbol; char* currency_symbol;
char* mon_decimal_point; char* mon_decimal_point;
char* mon_thousands_sep; char* mon_thousands_sep;
char* mon_grouping; char* mon_grouping;
char* positive_sign; char* positive_sign;
char* negative_sign; char* negative_sign;
char int_frac_digits; char int_frac_digits;
char frac_digits; char frac_digits;
char p_cs_precedes; char p_cs_precedes;
char p_sep_by_space; char p_sep_by_space;
char n_cs_precedes; char n_cs_precedes;
char n_sep_by_space; char n_sep_by_space;
char p_sign_posn; char p_sign_posn;
char n_sign_posn; char n_sign_posn;
}; };
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
char* setlocale (int, const char*); char* setlocale (int, const char*);
struct lconv* localeconv (void); struct lconv* localeconv (void);
#ifndef _WLOCALE_DEFINED /* also declared in wchar.h */ #ifndef _WLOCALE_DEFINED /* also declared in wchar.h */
# define __need_wchar_t # define __need_wchar_t
# include <stddef.h> # include <stddef.h>
wchar_t* _wsetlocale(int, const wchar_t*); wchar_t* _wsetlocale(int, const wchar_t*);
# define _WLOCALE_DEFINED # define _WLOCALE_DEFINED
#endif /* ndef _WLOCALE_DEFINED */ #endif /* ndef _WLOCALE_DEFINED */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
#endif /* Not _LOCALE_H_ */ #endif /* Not _LOCALE_H_ */

View File

@ -1,87 +1,87 @@
/* /*
* malloc.h * malloc.h
* *
* Support for programs which want to use malloc.h to get memory management * Support for programs which want to use malloc.h to get memory management
* functions. Unless you absolutely need some of these functions and they are * functions. Unless you absolutely need some of these functions and they are
* not in the ANSI headers you should use the ANSI standard header files * not in the ANSI headers you should use the ANSI standard header files
* instead. * instead.
* *
* This file is part of the Mingw32 package. * This file is part of the Mingw32 package.
* *
* Contributors: * Contributors:
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp> * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
* *
* THIS SOFTWARE IS NOT COPYRIGHTED * THIS SOFTWARE IS NOT COPYRIGHTED
* *
* This source code is offered for use in the public domain. You may * This source code is offered for use in the public domain. You may
* use, modify or distribute it freely. * use, modify or distribute it freely.
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* $Author: bellard $ * $Author: bellard $
* $Date: 2005/04/14 23:49:21 $ * $Date: 2005/04/17 13:14:29 $
* *
*/ */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#ifndef _MALLOC_H_ #ifndef _MALLOC_H_
#define _MALLOC_H_ #define _MALLOC_H_
/* All the headers include this file. */ /* All the headers include this file. */
#include <_mingw.h> #include <_mingw.h>
#include <stdlib.h> #include <stdlib.h>
#ifndef RC_INVOKED #ifndef RC_INVOKED
/* /*
* The structure used to walk through the heap with _heapwalk. * The structure used to walk through the heap with _heapwalk.
*/ */
typedef struct _heapinfo typedef struct _heapinfo
{ {
int* _pentry; int* _pentry;
size_t _size; size_t _size;
int _useflag; int _useflag;
} _HEAPINFO; } _HEAPINFO;
/* Values for _heapinfo.useflag */ /* Values for _heapinfo.useflag */
#define _USEDENTRY 0 #define _USEDENTRY 0
#define _FREEENTRY 1 #define _FREEENTRY 1
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* /*
The _heap* memory allocation functions are supported on NT The _heap* memory allocation functions are supported on NT
but not W9x. On latter, they always set errno to ENOSYS. but not W9x. On latter, they always set errno to ENOSYS.
*/ */
int _heapwalk (_HEAPINFO*); int _heapwalk (_HEAPINFO*);
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
int heapwalk (_HEAPINFO*); int heapwalk (_HEAPINFO*);
#endif /* Not _NO_OLDNAMES */ #endif /* Not _NO_OLDNAMES */
int _heapchk (void); /* Verify heap integrety. */ int _heapchk (void); /* Verify heap integrety. */
int _heapmin (void); /* Return unused heap to the OS. */ int _heapmin (void); /* Return unused heap to the OS. */
int _heapset (unsigned int); int _heapset (unsigned int);
size_t _msize (void*); size_t _msize (void*);
size_t _get_sbh_threshold (void); size_t _get_sbh_threshold (void);
int _set_sbh_threshold (size_t); int _set_sbh_threshold (size_t);
void * _expand (void*, size_t); void * _expand (void*, size_t);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* RC_INVOKED */ #endif /* RC_INVOKED */
#endif /* Not _MALLOC_H_ */ #endif /* Not _MALLOC_H_ */
#endif /* Not __STRICT_ANSI__ */ #endif /* Not __STRICT_ANSI__ */

View File

@ -1,438 +1,438 @@
/* /*
* math.h * math.h
* *
* Mathematical functions. * Mathematical functions.
* *
* This file is part of the Mingw32 package. * This file is part of the Mingw32 package.
* *
* Contributors: * Contributors:
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp> * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
* *
* THIS SOFTWARE IS NOT COPYRIGHTED * THIS SOFTWARE IS NOT COPYRIGHTED
* *
* This source code is offered for use in the public domain. You may * This source code is offered for use in the public domain. You may
* use, modify or distribute it freely. * use, modify or distribute it freely.
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* $Author: bellard $ * $Author: bellard $
* $Date: 2005/04/14 23:49:21 $ * $Date: 2005/04/17 13:14:29 $
* *
*/ */
#ifndef _MATH_H_ #ifndef _MATH_H_
#define _MATH_H_ #define _MATH_H_
/* All the headers include this file. */ /* All the headers include this file. */
#include <_mingw.h> #include <_mingw.h>
/* /*
* Types for the _exception structure. * Types for the _exception structure.
*/ */
#define _DOMAIN 1 /* domain error in argument */ #define _DOMAIN 1 /* domain error in argument */
#define _SING 2 /* singularity */ #define _SING 2 /* singularity */
#define _OVERFLOW 3 /* range overflow */ #define _OVERFLOW 3 /* range overflow */
#define _UNDERFLOW 4 /* range underflow */ #define _UNDERFLOW 4 /* range underflow */
#define _TLOSS 5 /* total loss of precision */ #define _TLOSS 5 /* total loss of precision */
#define _PLOSS 6 /* partial loss of precision */ #define _PLOSS 6 /* partial loss of precision */
/* /*
* Exception types with non-ANSI names for compatibility. * Exception types with non-ANSI names for compatibility.
*/ */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
#define DOMAIN _DOMAIN #define DOMAIN _DOMAIN
#define SING _SING #define SING _SING
#define OVERFLOW _OVERFLOW #define OVERFLOW _OVERFLOW
#define UNDERFLOW _UNDERFLOW #define UNDERFLOW _UNDERFLOW
#define TLOSS _TLOSS #define TLOSS _TLOSS
#define PLOSS _PLOSS #define PLOSS _PLOSS
#endif /* Not _NO_OLDNAMES */ #endif /* Not _NO_OLDNAMES */
#endif /* Not __STRICT_ANSI__ */ #endif /* Not __STRICT_ANSI__ */
/* These are also defined in Mingw float.h; needed here as well to work /* These are also defined in Mingw float.h; needed here as well to work
around GCC build issues. */ around GCC build issues. */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#ifndef __MINGW_FPCLASS_DEFINED #ifndef __MINGW_FPCLASS_DEFINED
#define __MINGW_FPCLASS_DEFINED 1 #define __MINGW_FPCLASS_DEFINED 1
/* IEEE 754 classication */ /* IEEE 754 classication */
#define _FPCLASS_SNAN 0x0001 /* Signaling "Not a Number" */ #define _FPCLASS_SNAN 0x0001 /* Signaling "Not a Number" */
#define _FPCLASS_QNAN 0x0002 /* Quiet "Not a Number" */ #define _FPCLASS_QNAN 0x0002 /* Quiet "Not a Number" */
#define _FPCLASS_NINF 0x0004 /* Negative Infinity */ #define _FPCLASS_NINF 0x0004 /* Negative Infinity */
#define _FPCLASS_NN 0x0008 /* Negative Normal */ #define _FPCLASS_NN 0x0008 /* Negative Normal */
#define _FPCLASS_ND 0x0010 /* Negative Denormal */ #define _FPCLASS_ND 0x0010 /* Negative Denormal */
#define _FPCLASS_NZ 0x0020 /* Negative Zero */ #define _FPCLASS_NZ 0x0020 /* Negative Zero */
#define _FPCLASS_PZ 0x0040 /* Positive Zero */ #define _FPCLASS_PZ 0x0040 /* Positive Zero */
#define _FPCLASS_PD 0x0080 /* Positive Denormal */ #define _FPCLASS_PD 0x0080 /* Positive Denormal */
#define _FPCLASS_PN 0x0100 /* Positive Normal */ #define _FPCLASS_PN 0x0100 /* Positive Normal */
#define _FPCLASS_PINF 0x0200 /* Positive Infinity */ #define _FPCLASS_PINF 0x0200 /* Positive Infinity */
#endif /* __MINGW_FPCLASS_DEFINED */ #endif /* __MINGW_FPCLASS_DEFINED */
#endif /* Not __STRICT_ANSI__ */ #endif /* Not __STRICT_ANSI__ */
#ifndef RC_INVOKED #ifndef RC_INVOKED
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* /*
* HUGE_VAL is returned by strtod when the value would overflow the * HUGE_VAL is returned by strtod when the value would overflow the
* representation of 'double'. There are other uses as well. * representation of 'double'. There are other uses as well.
* *
* __imp__HUGE is a pointer to the actual variable _HUGE in * __imp__HUGE is a pointer to the actual variable _HUGE in
* MSVCRT.DLL. If we used _HUGE directly we would get a pointer * MSVCRT.DLL. If we used _HUGE directly we would get a pointer
* to a thunk function. * to a thunk function.
* *
* NOTE: The CRTDLL version uses _HUGE_dll instead. * NOTE: The CRTDLL version uses _HUGE_dll instead.
*/ */
#ifndef __DECLSPEC_SUPPORTED #ifndef __DECLSPEC_SUPPORTED
#ifdef __MSVCRT__ #ifdef __MSVCRT__
extern double* __imp__HUGE; extern double* __imp__HUGE;
#define HUGE_VAL (*__imp__HUGE) #define HUGE_VAL (*__imp__HUGE)
#else #else
/* CRTDLL */ /* CRTDLL */
extern double* __imp__HUGE_dll; extern double* __imp__HUGE_dll;
#define HUGE_VAL (*__imp__HUGE_dll) #define HUGE_VAL (*__imp__HUGE_dll)
#endif #endif
#else /* __DECLSPEC_SUPPORTED */ #else /* __DECLSPEC_SUPPORTED */
#ifdef __MSVCRT__ #ifdef __MSVCRT__
__MINGW_IMPORT double _HUGE; __MINGW_IMPORT double _HUGE;
#define HUGE_VAL _HUGE #define HUGE_VAL _HUGE
#else #else
/* CRTDLL */ /* CRTDLL */
__MINGW_IMPORT double _HUGE_dll; __MINGW_IMPORT double _HUGE_dll;
#define HUGE_VAL _HUGE_dll #define HUGE_VAL _HUGE_dll
#endif #endif
#endif /* __DECLSPEC_SUPPORTED */ #endif /* __DECLSPEC_SUPPORTED */
struct _exception struct _exception
{ {
int type; int type;
char *name; char *name;
double arg1; double arg1;
double arg2; double arg2;
double retval; double retval;
}; };
double sin (double); double sin (double);
double cos (double); double cos (double);
double tan (double); double tan (double);
double sinh (double); double sinh (double);
double cosh (double); double cosh (double);
double tanh (double); double tanh (double);
double asin (double); double asin (double);
double acos (double); double acos (double);
double atan (double); double atan (double);
double atan2 (double, double); double atan2 (double, double);
double exp (double); double exp (double);
double log (double); double log (double);
double log10 (double); double log10 (double);
double pow (double, double); double pow (double, double);
double sqrt (double); double sqrt (double);
double ceil (double); double ceil (double);
double floor (double); double floor (double);
double fabs (double); double fabs (double);
double ldexp (double, int); double ldexp (double, int);
double frexp (double, int*); double frexp (double, int*);
double modf (double, double*); double modf (double, double*);
double fmod (double, double); double fmod (double, double);
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
/* Complex number (for cabs) */ /* Complex number (for cabs) */
struct _complex struct _complex
{ {
double x; /* Real part */ double x; /* Real part */
double y; /* Imaginary part */ double y; /* Imaginary part */
}; };
double _cabs (struct _complex); double _cabs (struct _complex);
double _hypot (double, double); double _hypot (double, double);
double _j0 (double); double _j0 (double);
double _j1 (double); double _j1 (double);
double _jn (int, double); double _jn (int, double);
double _y0 (double); double _y0 (double);
double _y1 (double); double _y1 (double);
double _yn (int, double); double _yn (int, double);
int _matherr (struct _exception *); int _matherr (struct _exception *);
/* These are also declared in Mingw float.h; needed here as well to work /* These are also declared in Mingw float.h; needed here as well to work
around GCC build issues. */ around GCC build issues. */
/* BEGIN FLOAT.H COPY */ /* BEGIN FLOAT.H COPY */
/* /*
* IEEE recommended functions * IEEE recommended functions
*/ */
double _chgsign (double); double _chgsign (double);
double _copysign (double, double); double _copysign (double, double);
double _logb (double); double _logb (double);
double _nextafter (double, double); double _nextafter (double, double);
double _scalb (double, long); double _scalb (double, long);
int _finite (double); int _finite (double);
int _fpclass (double); int _fpclass (double);
int _isnan (double); int _isnan (double);
/* END FLOAT.H COPY */ /* END FLOAT.H COPY */
#if !defined (_NO_OLDNAMES) \ #if !defined (_NO_OLDNAMES) \
|| (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L ) || (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L )
/* /*
* Non-underscored versions of non-ANSI functions. These reside in * Non-underscored versions of non-ANSI functions. These reside in
* liboldnames.a. They are now also ISO C99 standand names. * liboldnames.a. They are now also ISO C99 standand names.
* Provided for extra portability. * Provided for extra portability.
*/ */
double cabs (struct _complex); double cabs (struct _complex);
double hypot (double, double); double hypot (double, double);
double j0 (double); double j0 (double);
double j1 (double); double j1 (double);
double jn (int, double); double jn (int, double);
double y0 (double); double y0 (double);
double y1 (double); double y1 (double);
double yn (int, double); double yn (int, double);
#endif /* Not _NO_OLDNAMES */ #endif /* Not _NO_OLDNAMES */
#endif /* Not __STRICT_ANSI__ */ #endif /* Not __STRICT_ANSI__ */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
#ifndef __NO_ISOCEXT #ifndef __NO_ISOCEXT
#define INFINITY HUGE_VAL #define INFINITY HUGE_VAL
#define NAN (0.0F/0.0F) #define NAN (0.0F/0.0F)
/* /*
Return values for fpclassify. Return values for fpclassify.
These are based on Intel x87 fpu condition codes These are based on Intel x87 fpu condition codes
in the high byte of status word and differ from in the high byte of status word and differ from
the return values for MS IEEE 754 extension _fpclass() the return values for MS IEEE 754 extension _fpclass()
*/ */
#define FP_NAN 0x0100 #define FP_NAN 0x0100
#define FP_NORMAL 0x0400 #define FP_NORMAL 0x0400
#define FP_INFINITE (FP_NAN | FP_NORMAL) #define FP_INFINITE (FP_NAN | FP_NORMAL)
#define FP_ZERO 0x4000 #define FP_ZERO 0x4000
#define FP_SUBNORMAL (FP_NORMAL | FP_ZERO) #define FP_SUBNORMAL (FP_NORMAL | FP_ZERO)
/* 0x0200 is signbit mask */ /* 0x0200 is signbit mask */
#ifndef RC_INVOKED #ifndef RC_INVOKED
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
double nan(const char *tagp); double nan(const char *tagp);
float nanf(const char *tagp); float nanf(const char *tagp);
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#define nan() nan("") #define nan() nan("")
#define nanf() nanf("") #define nanf() nanf("")
#endif #endif
/* /*
We can't inline float, because we want to ensure truncation We can't inline float, because we want to ensure truncation
to semantic type before classification. If we extend to long to semantic type before classification. If we extend to long
double, we will also need to make double extern only. double, we will also need to make double extern only.
(A normal long double value might become subnormal when (A normal long double value might become subnormal when
converted to double, and zero when converted to float.) converted to double, and zero when converted to float.)
*/ */
extern __inline__ int __fpclassify (double x){ extern __inline__ int __fpclassify (double x){
unsigned short sw; unsigned short sw;
__asm__ ("fxam; fstsw %%ax;" : "=a" (sw): "t" (x)); __asm__ ("fxam; fstsw %%ax;" : "=a" (sw): "t" (x));
return sw & (FP_NAN | FP_NORMAL | FP_ZERO ); return sw & (FP_NAN | FP_NORMAL | FP_ZERO );
} }
extern int __fpclassifyf (float); extern int __fpclassifyf (float);
#define fpclassify(x) ((sizeof(x) == sizeof(float)) ? __fpclassifyf(x) \ #define fpclassify(x) ((sizeof(x) == sizeof(float)) ? __fpclassifyf(x) \
: __fpclassify(x)) : __fpclassify(x))
/* We don't need to worry about trucation here: /* We don't need to worry about trucation here:
A NaN stays a NaN. */ A NaN stays a NaN. */
extern __inline__ int __isnan (double _x) extern __inline__ int __isnan (double _x)
{ {
unsigned short sw; unsigned short sw;
__asm__ ("fxam;" __asm__ ("fxam;"
"fstsw %%ax": "=a" (sw) : "t" (_x)); "fstsw %%ax": "=a" (sw) : "t" (_x));
return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL)) return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL))
== FP_NAN; == FP_NAN;
} }
extern __inline__ int __isnanf (float _x) extern __inline__ int __isnanf (float _x)
{ {
unsigned short sw; unsigned short sw;
__asm__ ("fxam;" __asm__ ("fxam;"
"fstsw %%ax": "=a" (sw) : "t" (_x)); "fstsw %%ax": "=a" (sw) : "t" (_x));
return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL)) return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL))
== FP_NAN; == FP_NAN;
} }
#define isnan(x) ((sizeof(x) == sizeof(float)) ? __isnanf(x) \ #define isnan(x) ((sizeof(x) == sizeof(float)) ? __isnanf(x) \
: __isnan(x)) : __isnan(x))
#define isfinite(x) ((fpclassify(x) & FP_NAN) == 0) #define isfinite(x) ((fpclassify(x) & FP_NAN) == 0)
#define isinf(x) (fpclassify(x) == FP_INFINITE) #define isinf(x) (fpclassify(x) == FP_INFINITE)
#define isnormal(x) (fpclassify(x) == FP_NORMAL) #define isnormal(x) (fpclassify(x) == FP_NORMAL)
extern __inline__ int __signbit (double x) { extern __inline__ int __signbit (double x) {
unsigned short stw; unsigned short stw;
__asm__ ( "fxam; fstsw %%ax;": "=a" (stw) : "t" (x)); __asm__ ( "fxam; fstsw %%ax;": "=a" (stw) : "t" (x));
return stw & 0x0200; return stw & 0x0200;
} }
extern __inline__ int __signbitf (float x) { extern __inline__ int __signbitf (float x) {
unsigned short stw; unsigned short stw;
__asm__ ("fxam; fstsw %%ax;": "=a" (stw) : "t" (x)); __asm__ ("fxam; fstsw %%ax;": "=a" (stw) : "t" (x));
return stw & 0x0200; return stw & 0x0200;
} }
#define signbit(x) ((sizeof(x) == sizeof(float)) ? __signbitf(x) \ #define signbit(x) ((sizeof(x) == sizeof(float)) ? __signbitf(x) \
: __signbit(x)) : __signbit(x))
/* /*
* With these functions, comparisons involving quiet NaNs set the FP * With these functions, comparisons involving quiet NaNs set the FP
* condition code to "unordered". The IEEE floating-point spec * condition code to "unordered". The IEEE floating-point spec
* dictates that the result of floating-point comparisons should be * dictates that the result of floating-point comparisons should be
* false whenever a NaN is involved, with the exception of the !=, * false whenever a NaN is involved, with the exception of the !=,
* which always returns true. * which always returns true.
*/ */
#if __GNUC__ >= 3 #if __GNUC__ >= 3
#define isgreater(x, y) __builtin_isgreater(x, y) #define isgreater(x, y) __builtin_isgreater(x, y)
#define isgreaterequal(x, y) __builtin_isgreaterequal(x, y) #define isgreaterequal(x, y) __builtin_isgreaterequal(x, y)
#define isless(x, y) __builtin_isless(x, y) #define isless(x, y) __builtin_isless(x, y)
#define islessequal(x, y) __builtin_islessequal(x, y) #define islessequal(x, y) __builtin_islessequal(x, y)
#define islessgreater(x, y) __builtin_islessgreater(x, y) #define islessgreater(x, y) __builtin_islessgreater(x, y)
#define isunordered(x, y) __builtin_isunordered(x, y) #define isunordered(x, y) __builtin_isunordered(x, y)
#else #else
/* helper */ /* helper */
extern __inline__ int __fp_unordered_compare (double x, double y){ extern __inline__ int __fp_unordered_compare (double x, double y){
unsigned short retval; unsigned short retval;
__asm__ ("fucom %%st(1);" __asm__ ("fucom %%st(1);"
"fnstsw;": "=a" (retval) : "t" (x), "u" (y)); "fnstsw;": "=a" (retval) : "t" (x), "u" (y));
return retval; return retval;
} }
#define isgreater(x, y) ((__fp_unordered_compare(x, y) \ #define isgreater(x, y) ((__fp_unordered_compare(x, y) \
& 0x4500) == 0) & 0x4500) == 0)
#define isless(x, y) ((__fp_unordered_compare (y, x) \ #define isless(x, y) ((__fp_unordered_compare (y, x) \
& 0x4500) == 0) & 0x4500) == 0)
#define isgreaterequal(x, y) ((__fp_unordered_compare (x, y) \ #define isgreaterequal(x, y) ((__fp_unordered_compare (x, y) \
& FP_INFINITE) == 0) & FP_INFINITE) == 0)
#define islessequal(x, y) ((__fp_unordered_compare(y, x) \ #define islessequal(x, y) ((__fp_unordered_compare(y, x) \
& FP_INFINITE) == 0) & FP_INFINITE) == 0)
#define islessgreater(x, y) ((__fp_unordered_compare(x, y) \ #define islessgreater(x, y) ((__fp_unordered_compare(x, y) \
& FP_SUBNORMAL) == 0) & FP_SUBNORMAL) == 0)
#define isunordered(x, y) ((__fp_unordered_compare(x, y) \ #define isunordered(x, y) ((__fp_unordered_compare(x, y) \
& 0x4500) == 0x4500) & 0x4500) == 0x4500)
#endif #endif
/* round, using fpu control word settings */ /* round, using fpu control word settings */
extern __inline__ double rint (double x) extern __inline__ double rint (double x)
{ {
double retval; double retval;
__asm__ ("frndint;": "=t" (retval) : "0" (x)); __asm__ ("frndint;": "=t" (retval) : "0" (x));
return retval; return retval;
} }
extern __inline__ float rintf (float x) extern __inline__ float rintf (float x)
{ {
float retval; float retval;
__asm__ ("frndint;" : "=t" (retval) : "0" (x) ); __asm__ ("frndint;" : "=t" (retval) : "0" (x) );
return retval; return retval;
} }
/* round away from zero, regardless of fpu control word settings */ /* round away from zero, regardless of fpu control word settings */
extern double round (double); extern double round (double);
extern float roundf (float); extern float roundf (float);
/* round towards zero, regardless of fpu control word settings */ /* round towards zero, regardless of fpu control word settings */
extern double trunc (double); extern double trunc (double);
extern float truncf (float); extern float truncf (float);
/* fmax and fmin. /* fmax and fmin.
NaN arguments are treated as missing data: if one argument is a NaN and the other numeric, then the NaN arguments are treated as missing data: if one argument is a NaN and the other numeric, then the
these functions choose the numeric value. these functions choose the numeric value.
*/ */
extern double fmax (double, double); extern double fmax (double, double);
extern double fmin (double, double); extern double fmin (double, double);
extern float fmaxf (float, float); extern float fmaxf (float, float);
float fminf (float, float); float fminf (float, float);
/* return x * y + z as a ternary op */ /* return x * y + z as a ternary op */
extern double fma (double, double, double); extern double fma (double, double, double);
extern float fmaf (float, float, float); extern float fmaf (float, float, float);
/* one lonely transcendental */ /* one lonely transcendental */
extern double log2 (double _x); extern double log2 (double _x);
extern float log2f (float _x); extern float log2f (float _x);
/* The underscored versions are in MSVCRT.dll. /* The underscored versions are in MSVCRT.dll.
The stubs for these are in libmingwex.a */ The stubs for these are in libmingwex.a */
double copysign (double, double); double copysign (double, double);
float copysignf (float, float); float copysignf (float, float);
double logb (double); double logb (double);
float logbf (float); float logbf (float);
double nextafter (double, double); double nextafter (double, double);
float nextafterf (float, float); float nextafterf (float, float);
double scalb (double, long); double scalb (double, long);
float scalbf (float, long); float scalbf (float, long);
#if !defined (__STRICT_ANSI__) /* inline using non-ANSI functions */ #if !defined (__STRICT_ANSI__) /* inline using non-ANSI functions */
extern __inline__ double copysign (double x, double y) extern __inline__ double copysign (double x, double y)
{ return _copysign(x, y); } { return _copysign(x, y); }
extern __inline__ float copysignf (float x, float y) extern __inline__ float copysignf (float x, float y)
{ return _copysign(x, y); } { return _copysign(x, y); }
extern __inline__ double logb (double x) extern __inline__ double logb (double x)
{ return _logb(x); } { return _logb(x); }
extern __inline__ float logbf (float x) extern __inline__ float logbf (float x)
{ return _logb(x); } { return _logb(x); }
extern __inline__ double nextafter(double x, double y) extern __inline__ double nextafter(double x, double y)
{ return _nextafter(x, y); } { return _nextafter(x, y); }
extern __inline__ float nextafterf(float x, float y) extern __inline__ float nextafterf(float x, float y)
{ return _nextafter(x, y); } { return _nextafter(x, y); }
extern __inline__ double scalb (double x, long i) extern __inline__ double scalb (double x, long i)
{ return _scalb (x, i); } { return _scalb (x, i); }
extern __inline__ float scalbf (float x, long i) extern __inline__ float scalbf (float x, long i)
{ return _scalb(x, i); } { return _scalb(x, i); }
#endif /* (__STRICT_ANSI__) */ #endif /* (__STRICT_ANSI__) */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
#endif /* __NO_ISOCEXT */ #endif /* __NO_ISOCEXT */
#endif /* Not _MATH_H_ */ #endif /* Not _MATH_H_ */

View File

@ -1,8 +1,8 @@
/* /*
* This file is part of the Mingw32 package. * This file is part of the Mingw32 package.
* *
* mem.h maps to string.h * mem.h maps to string.h
*/ */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#include <string.h> #include <string.h>
#endif #endif

View File

@ -1,9 +1,9 @@
/* /*
* This file is part of the Mingw32 package. * This file is part of the Mingw32 package.
* *
* memory.h maps to the standard string.h header. * memory.h maps to the standard string.h header.
*/ */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#include <string.h> #include <string.h>
#endif #endif

View File

@ -1,158 +1,158 @@
/* /*
* process.h * process.h
* *
* Function calls for spawning child processes. * Function calls for spawning child processes.
* *
* This file is part of the Mingw32 package. * This file is part of the Mingw32 package.
* *
* Contributors: * Contributors:
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp> * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
* *
* THIS SOFTWARE IS NOT COPYRIGHTED * THIS SOFTWARE IS NOT COPYRIGHTED
* *
* This source code is offered for use in the public domain. You may * This source code is offered for use in the public domain. You may
* use, modify or distribute it freely. * use, modify or distribute it freely.
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* $Author: bellard $ * $Author: bellard $
* $Date: 2005/04/14 23:49:21 $ * $Date: 2005/04/17 13:14:29 $
* *
*/ */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#ifndef _PROCESS_H_ #ifndef _PROCESS_H_
#define _PROCESS_H_ #define _PROCESS_H_
/* All the headers include this file. */ /* All the headers include this file. */
#include <_mingw.h> #include <_mingw.h>
/* Includes a definition of _pid_t and pid_t */ /* Includes a definition of _pid_t and pid_t */
#include <sys/types.h> #include <sys/types.h>
/* /*
* Constants for cwait actions. * Constants for cwait actions.
* Obsolete for Win32. * Obsolete for Win32.
*/ */
#define _WAIT_CHILD 0 #define _WAIT_CHILD 0
#define _WAIT_GRANDCHILD 1 #define _WAIT_GRANDCHILD 1
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
#define WAIT_CHILD _WAIT_CHILD #define WAIT_CHILD _WAIT_CHILD
#define WAIT_GRANDCHILD _WAIT_GRANDCHILD #define WAIT_GRANDCHILD _WAIT_GRANDCHILD
#endif /* Not _NO_OLDNAMES */ #endif /* Not _NO_OLDNAMES */
/* /*
* Mode constants for spawn functions. * Mode constants for spawn functions.
*/ */
#define _P_WAIT 0 #define _P_WAIT 0
#define _P_NOWAIT 1 #define _P_NOWAIT 1
#define _P_OVERLAY 2 #define _P_OVERLAY 2
#define _OLD_P_OVERLAY _P_OVERLAY #define _OLD_P_OVERLAY _P_OVERLAY
#define _P_NOWAITO 3 #define _P_NOWAITO 3
#define _P_DETACH 4 #define _P_DETACH 4
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
#define P_WAIT _P_WAIT #define P_WAIT _P_WAIT
#define P_NOWAIT _P_NOWAIT #define P_NOWAIT _P_NOWAIT
#define P_OVERLAY _P_OVERLAY #define P_OVERLAY _P_OVERLAY
#define OLD_P_OVERLAY _OLD_P_OVERLAY #define OLD_P_OVERLAY _OLD_P_OVERLAY
#define P_NOWAITO _P_NOWAITO #define P_NOWAITO _P_NOWAITO
#define P_DETACH _P_DETACH #define P_DETACH _P_DETACH
#endif /* Not _NO_OLDNAMES */ #endif /* Not _NO_OLDNAMES */
#ifndef RC_INVOKED #ifndef RC_INVOKED
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
void _cexit(void); void _cexit(void);
void _c_exit(void); void _c_exit(void);
int _cwait (int*, _pid_t, int); int _cwait (int*, _pid_t, int);
_pid_t _getpid(void); _pid_t _getpid(void);
int _execl (const char*, const char*, ...); int _execl (const char*, const char*, ...);
int _execle (const char*, const char*, ...); int _execle (const char*, const char*, ...);
int _execlp (const char*, const char*, ...); int _execlp (const char*, const char*, ...);
int _execlpe (const char*, const char*, ...); int _execlpe (const char*, const char*, ...);
int _execv (const char*, char* const*); int _execv (const char*, char* const*);
int _execve (const char*, char* const*, char* const*); int _execve (const char*, char* const*, char* const*);
int _execvp (const char*, char* const*); int _execvp (const char*, char* const*);
int _execvpe (const char*, char* const*, char* const*); int _execvpe (const char*, char* const*, char* const*);
int _spawnl (int, const char*, const char*, ...); int _spawnl (int, const char*, const char*, ...);
int _spawnle (int, const char*, const char*, ...); int _spawnle (int, const char*, const char*, ...);
int _spawnlp (int, const char*, const char*, ...); int _spawnlp (int, const char*, const char*, ...);
int _spawnlpe (int, const char*, const char*, ...); int _spawnlpe (int, const char*, const char*, ...);
int _spawnv (int, const char*, char* const*); int _spawnv (int, const char*, char* const*);
int _spawnve (int, const char*, char* const*, char* const*); int _spawnve (int, const char*, char* const*, char* const*);
int _spawnvp (int, const char*, char* const*); int _spawnvp (int, const char*, char* const*);
int _spawnvpe (int, const char*, char* const*, char* const*); int _spawnvpe (int, const char*, char* const*, char* const*);
/* /*
* The functions _beginthreadex and _endthreadex are not provided by CRTDLL. * The functions _beginthreadex and _endthreadex are not provided by CRTDLL.
* They are provided by MSVCRT. * They are provided by MSVCRT.
* *
* NOTE: Apparently _endthread calls CloseHandle on the handle of the thread, * NOTE: Apparently _endthread calls CloseHandle on the handle of the thread,
* making for race conditions if you are not careful. Basically you have to * making for race conditions if you are not careful. Basically you have to
* make sure that no-one is going to do *anything* with the thread handle * make sure that no-one is going to do *anything* with the thread handle
* after the thread calls _endthread or returns from the thread function. * after the thread calls _endthread or returns from the thread function.
* *
* NOTE: No old names for these functions. Use the underscore. * NOTE: No old names for these functions. Use the underscore.
*/ */
unsigned long unsigned long
_beginthread (void (*)(void *), unsigned, void*); _beginthread (void (*)(void *), unsigned, void*);
void _endthread (void); void _endthread (void);
#ifdef __MSVCRT__ #ifdef __MSVCRT__
unsigned long unsigned long
_beginthreadex (void *, unsigned, unsigned (__stdcall *) (void *), _beginthreadex (void *, unsigned, unsigned (__stdcall *) (void *),
void*, unsigned, unsigned*); void*, unsigned, unsigned*);
void _endthreadex (unsigned); void _endthreadex (unsigned);
#endif #endif
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
/* /*
* Functions without the leading underscore, for portability. These functions * Functions without the leading underscore, for portability. These functions
* live in liboldnames.a. * live in liboldnames.a.
*/ */
int cwait (int*, pid_t, int); int cwait (int*, pid_t, int);
pid_t getpid (void); pid_t getpid (void);
int execl (const char*, const char*, ...); int execl (const char*, const char*, ...);
int execle (const char*, const char*, ...); int execle (const char*, const char*, ...);
int execlp (const char*, const char*, ...); int execlp (const char*, const char*, ...);
int execlpe (const char*, const char*, ...); int execlpe (const char*, const char*, ...);
int execv (const char*, char* const*); int execv (const char*, char* const*);
int execve (const char*, char* const*, char* const*); int execve (const char*, char* const*, char* const*);
int execvp (const char*, char* const*); int execvp (const char*, char* const*);
int execvpe (const char*, char* const*, char* const*); int execvpe (const char*, char* const*, char* const*);
int spawnl (int, const char*, const char*, ...); int spawnl (int, const char*, const char*, ...);
int spawnle (int, const char*, const char*, ...); int spawnle (int, const char*, const char*, ...);
int spawnlp (int, const char*, const char*, ...); int spawnlp (int, const char*, const char*, ...);
int spawnlpe (int, const char*, const char*, ...); int spawnlpe (int, const char*, const char*, ...);
int spawnv (int, const char*, char* const*); int spawnv (int, const char*, char* const*);
int spawnve (int, const char*, char* const*, char* const*); int spawnve (int, const char*, char* const*, char* const*);
int spawnvp (int, const char*, char* const*); int spawnvp (int, const char*, char* const*);
int spawnvpe (int, const char*, char* const*, char* const*); int spawnvpe (int, const char*, char* const*, char* const*);
#endif /* Not _NO_OLDNAMES */ #endif /* Not _NO_OLDNAMES */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
#endif /* _PROCESS_H_ not defined */ #endif /* _PROCESS_H_ not defined */
#endif /* Not __STRICT_ANSI__ */ #endif /* Not __STRICT_ANSI__ */

View File

@ -1,72 +1,72 @@
/* /*
* setjmp.h * setjmp.h
* *
* Declarations supporting setjmp and longjump, a method for avoiding * Declarations supporting setjmp and longjump, a method for avoiding
* the normal function call return sequence. (Bleah!) * the normal function call return sequence. (Bleah!)
* *
* This file is part of the Mingw32 package. * This file is part of the Mingw32 package.
* *
* Contributors: * Contributors:
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp> * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
* *
* THIS SOFTWARE IS NOT COPYRIGHTED * THIS SOFTWARE IS NOT COPYRIGHTED
* *
* This source code is offered for use in the public domain. You may * This source code is offered for use in the public domain. You may
* use, modify or distribute it freely. * use, modify or distribute it freely.
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* $Author: bellard $ * $Author: bellard $
* $Date: 2005/04/14 23:49:21 $ * $Date: 2005/04/17 13:14:29 $
* *
*/ */
#ifndef _SETJMP_H_ #ifndef _SETJMP_H_
#define _SETJMP_H_ #define _SETJMP_H_
/* All the headers include this file. */ /* All the headers include this file. */
#include <_mingw.h> #include <_mingw.h>
#ifndef RC_INVOKED #ifndef RC_INVOKED
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* /*
* The buffer used by setjmp to store the information used by longjmp * The buffer used by setjmp to store the information used by longjmp
* to perform it's evil goto-like work. The size of this buffer was * to perform it's evil goto-like work. The size of this buffer was
* determined through experimentation; it's contents are a mystery. * determined through experimentation; it's contents are a mystery.
* NOTE: This was determined on an i386 (actually a Pentium). The * NOTE: This was determined on an i386 (actually a Pentium). The
* contents could be different on an Alpha or something else. * contents could be different on an Alpha or something else.
*/ */
#define _JBLEN 16 #define _JBLEN 16
#define _JBTYPE int #define _JBTYPE int
typedef _JBTYPE jmp_buf[_JBLEN]; typedef _JBTYPE jmp_buf[_JBLEN];
/* /*
* The function provided by CRTDLL which appears to do the actual work * The function provided by CRTDLL which appears to do the actual work
* of setjmp. * of setjmp.
*/ */
int _setjmp (jmp_buf); int _setjmp (jmp_buf);
#define setjmp(x) _setjmp(x) #define setjmp(x) _setjmp(x)
/* /*
* Return to the last setjmp call and act as if setjmp had returned * Return to the last setjmp call and act as if setjmp had returned
* nVal (which had better be non-zero!). * nVal (which had better be non-zero!).
*/ */
void longjmp (jmp_buf, int); void longjmp (jmp_buf, int);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
#endif /* Not _SETJMP_H_ */ #endif /* Not _SETJMP_H_ */

View File

@ -1,44 +1,44 @@
/* /*
* share.h * share.h
* *
* Constants for file sharing functions. * Constants for file sharing functions.
* *
* This file is part of the Mingw32 package. * This file is part of the Mingw32 package.
* *
* Contributors: * Contributors:
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp> * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
* *
* THIS SOFTWARE IS NOT COPYRIGHTED * THIS SOFTWARE IS NOT COPYRIGHTED
* *
* This source code is offered for use in the public domain. You may * This source code is offered for use in the public domain. You may
* use, modify or distribute it freely. * use, modify or distribute it freely.
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* $Author: bellard $ * $Author: bellard $
* $Date: 2005/04/14 23:49:21 $ * $Date: 2005/04/17 13:14:29 $
* *
*/ */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#ifndef _SHARE_H_ #ifndef _SHARE_H_
#define _SHARE_H_ #define _SHARE_H_
/* All the headers include this file. */ /* All the headers include this file. */
#include <_mingw.h> #include <_mingw.h>
#define SH_COMPAT 0x00 /* Compatibility */ #define SH_COMPAT 0x00 /* Compatibility */
#define SH_DENYRW 0x10 /* Deny read/write */ #define SH_DENYRW 0x10 /* Deny read/write */
#define SH_DENYWR 0x20 /* Deny write */ #define SH_DENYWR 0x20 /* Deny write */
#define SH_DENYRD 0x30 /* Deny read */ #define SH_DENYRD 0x30 /* Deny read */
#define SH_DENYNO 0x40 /* Deny nothing */ #define SH_DENYNO 0x40 /* Deny nothing */
#endif /* Not _SHARE_H_ */ #endif /* Not _SHARE_H_ */
#endif /* Not __STRICT_ANSI__ */ #endif /* Not __STRICT_ANSI__ */

View File

@ -1,111 +1,111 @@
/* /*
* signal.h * signal.h
* *
* A way to set handlers for exceptional conditions (also known as signals). * A way to set handlers for exceptional conditions (also known as signals).
* *
* This file is part of the Mingw32 package. * This file is part of the Mingw32 package.
* *
* Contributors: * Contributors:
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp> * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
* *
* THIS SOFTWARE IS NOT COPYRIGHTED * THIS SOFTWARE IS NOT COPYRIGHTED
* *
* This source code is offered for use in the public domain. You may * This source code is offered for use in the public domain. You may
* use, modify or distribute it freely. * use, modify or distribute it freely.
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* $Author: bellard $ * $Author: bellard $
* $Date: 2005/04/14 23:49:21 $ * $Date: 2005/04/17 13:14:29 $
* *
*/ */
#ifndef _SIGNAL_H_ #ifndef _SIGNAL_H_
#define _SIGNAL_H_ #define _SIGNAL_H_
/* All the headers include this file. */ /* All the headers include this file. */
#include <_mingw.h> #include <_mingw.h>
/* /*
* The actual signal values. Using other values with signal * The actual signal values. Using other values with signal
* produces a SIG_ERR return value. * produces a SIG_ERR return value.
* *
* NOTE: SIGINT is produced when the user presses Ctrl-C. * NOTE: SIGINT is produced when the user presses Ctrl-C.
* SIGILL has not been tested. * SIGILL has not been tested.
* SIGFPE doesn't seem to work? * SIGFPE doesn't seem to work?
* SIGSEGV does not catch writing to a NULL pointer (that shuts down * SIGSEGV does not catch writing to a NULL pointer (that shuts down
* your app; can you say "segmentation violation core dump"?). * your app; can you say "segmentation violation core dump"?).
* SIGTERM comes from what kind of termination request exactly? * SIGTERM comes from what kind of termination request exactly?
* SIGBREAK is indeed produced by pressing Ctrl-Break. * SIGBREAK is indeed produced by pressing Ctrl-Break.
* SIGABRT is produced by calling abort. * SIGABRT is produced by calling abort.
* TODO: The above results may be related to not installing an appropriate * TODO: The above results may be related to not installing an appropriate
* structured exception handling frame. Results may be better if I ever * structured exception handling frame. Results may be better if I ever
* manage to get the SEH stuff down. * manage to get the SEH stuff down.
*/ */
#define SIGINT 2 /* Interactive attention */ #define SIGINT 2 /* Interactive attention */
#define SIGILL 4 /* Illegal instruction */ #define SIGILL 4 /* Illegal instruction */
#define SIGFPE 8 /* Floating point error */ #define SIGFPE 8 /* Floating point error */
#define SIGSEGV 11 /* Segmentation violation */ #define SIGSEGV 11 /* Segmentation violation */
#define SIGTERM 15 /* Termination request */ #define SIGTERM 15 /* Termination request */
#define SIGBREAK 21 /* Control-break */ #define SIGBREAK 21 /* Control-break */
#define SIGABRT 22 /* Abnormal termination (abort) */ #define SIGABRT 22 /* Abnormal termination (abort) */
#define NSIG 23 /* maximum signal number + 1 */ #define NSIG 23 /* maximum signal number + 1 */
#ifndef RC_INVOKED #ifndef RC_INVOKED
#ifndef _SIG_ATOMIC_T_DEFINED #ifndef _SIG_ATOMIC_T_DEFINED
typedef int sig_atomic_t; typedef int sig_atomic_t;
#define _SIG_ATOMIC_T_DEFINED #define _SIG_ATOMIC_T_DEFINED
#endif #endif
/* /*
* The prototypes (below) are the easy part. The hard part is figuring * The prototypes (below) are the easy part. The hard part is figuring
* out what signals are available and what numbers they are assigned * out what signals are available and what numbers they are assigned
* along with appropriate values of SIG_DFL and SIG_IGN. * along with appropriate values of SIG_DFL and SIG_IGN.
*/ */
/* /*
* A pointer to a signal handler function. A signal handler takes a * A pointer to a signal handler function. A signal handler takes a
* single int, which is the signal it handles. * single int, which is the signal it handles.
*/ */
typedef void (*__p_sig_fn_t)(int); typedef void (*__p_sig_fn_t)(int);
/* /*
* These are special values of signal handler pointers which are * These are special values of signal handler pointers which are
* used to send a signal to the default handler (SIG_DFL), ignore * used to send a signal to the default handler (SIG_DFL), ignore
* the signal (SIG_IGN), or indicate an error return (SIG_ERR). * the signal (SIG_IGN), or indicate an error return (SIG_ERR).
*/ */
#define SIG_DFL ((__p_sig_fn_t) 0) #define SIG_DFL ((__p_sig_fn_t) 0)
#define SIG_IGN ((__p_sig_fn_t) 1) #define SIG_IGN ((__p_sig_fn_t) 1)
#define SIG_ERR ((__p_sig_fn_t) -1) #define SIG_ERR ((__p_sig_fn_t) -1)
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* /*
* Call signal to set the signal handler for signal sig to the * Call signal to set the signal handler for signal sig to the
* function pointed to by handler. Returns a pointer to the * function pointed to by handler. Returns a pointer to the
* previous handler, or SIG_ERR if an error occurs. Initially * previous handler, or SIG_ERR if an error occurs. Initially
* unhandled signals defined above will return SIG_DFL. * unhandled signals defined above will return SIG_DFL.
*/ */
__p_sig_fn_t signal(int, __p_sig_fn_t); __p_sig_fn_t signal(int, __p_sig_fn_t);
/* /*
* Raise the signal indicated by sig. Returns non-zero on success. * Raise the signal indicated by sig. Returns non-zero on success.
*/ */
int raise (int); int raise (int);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
#endif /* Not _SIGNAL_H_ */ #endif /* Not _SIGNAL_H_ */

View File

@ -1,184 +1,184 @@
/* ISO C9x 7.18 Integer types <stdint.h> /* ISO C9x 7.18 Integer types <stdint.h>
* Based on ISO/IEC SC22/WG14 9899 Committee draft (SC22 N2794) * Based on ISO/IEC SC22/WG14 9899 Committee draft (SC22 N2794)
* *
* THIS SOFTWARE IS NOT COPYRIGHTED * THIS SOFTWARE IS NOT COPYRIGHTED
* *
* Contributor: Danny Smith <danny_r_smith_2001@yahoo.co.nz> * Contributor: Danny Smith <danny_r_smith_2001@yahoo.co.nz>
* *
* This source code is offered for use in the public domain. You may * This source code is offered for use in the public domain. You may
* use, modify or distribute it freely. * use, modify or distribute it freely.
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* Date: 2000-12-02 * Date: 2000-12-02
*/ */
#ifndef _STDINT_H #ifndef _STDINT_H
#define _STDINT_H #define _STDINT_H
/* 7.18.1.1 Exact-width integer types */ /* 7.18.1.1 Exact-width integer types */
typedef signed char int8_t; typedef signed char int8_t;
typedef unsigned char uint8_t; typedef unsigned char uint8_t;
typedef short int16_t; typedef short int16_t;
typedef unsigned short uint16_t; typedef unsigned short uint16_t;
typedef int int32_t; typedef int int32_t;
typedef unsigned uint32_t; typedef unsigned uint32_t;
typedef long long int64_t; typedef long long int64_t;
typedef unsigned long long uint64_t; typedef unsigned long long uint64_t;
/* 7.18.1.2 Minimum-width integer types */ /* 7.18.1.2 Minimum-width integer types */
typedef signed char int_least8_t; typedef signed char int_least8_t;
typedef unsigned char uint_least8_t; typedef unsigned char uint_least8_t;
typedef short int_least16_t; typedef short int_least16_t;
typedef unsigned short uint_least16_t; typedef unsigned short uint_least16_t;
typedef int int_least32_t; typedef int int_least32_t;
typedef unsigned uint_least32_t; typedef unsigned uint_least32_t;
typedef long long int_least64_t; typedef long long int_least64_t;
typedef unsigned long long uint_least64_t; typedef unsigned long long uint_least64_t;
/* 7.18.1.3 Fastest minimum-width integer types /* 7.18.1.3 Fastest minimum-width integer types
* Not actually guaranteed to be fastest for all purposes * Not actually guaranteed to be fastest for all purposes
* Here we use the exact-width types for 8 and 16-bit ints. * Here we use the exact-width types for 8 and 16-bit ints.
*/ */
typedef char int_fast8_t; typedef char int_fast8_t;
typedef unsigned char uint_fast8_t; typedef unsigned char uint_fast8_t;
typedef short int_fast16_t; typedef short int_fast16_t;
typedef unsigned short uint_fast16_t; typedef unsigned short uint_fast16_t;
typedef int int_fast32_t; typedef int int_fast32_t;
typedef unsigned int uint_fast32_t; typedef unsigned int uint_fast32_t;
typedef long long int_fast64_t; typedef long long int_fast64_t;
typedef unsigned long long uint_fast64_t; typedef unsigned long long uint_fast64_t;
/* 7.18.1.4 Integer types capable of holding object pointers */ /* 7.18.1.4 Integer types capable of holding object pointers */
typedef int intptr_t; typedef int intptr_t;
typedef unsigned uintptr_t; typedef unsigned uintptr_t;
/* 7.18.1.5 Greatest-width integer types */ /* 7.18.1.5 Greatest-width integer types */
typedef long long intmax_t; typedef long long intmax_t;
typedef unsigned long long uintmax_t; typedef unsigned long long uintmax_t;
/* 7.18.2 Limits of specified-width integer types */ /* 7.18.2 Limits of specified-width integer types */
#if !defined ( __cplusplus) || defined (__STDC_LIMIT_MACROS) #if !defined ( __cplusplus) || defined (__STDC_LIMIT_MACROS)
/* 7.18.2.1 Limits of exact-width integer types */ /* 7.18.2.1 Limits of exact-width integer types */
#define INT8_MIN (-128) #define INT8_MIN (-128)
#define INT16_MIN (-32768) #define INT16_MIN (-32768)
#define INT32_MIN (-2147483647 - 1) #define INT32_MIN (-2147483647 - 1)
#define INT64_MIN (-9223372036854775807LL - 1) #define INT64_MIN (-9223372036854775807LL - 1)
#define INT8_MAX 127 #define INT8_MAX 127
#define INT16_MAX 32767 #define INT16_MAX 32767
#define INT32_MAX 2147483647 #define INT32_MAX 2147483647
#define INT64_MAX 9223372036854775807LL #define INT64_MAX 9223372036854775807LL
#define UINT8_MAX 0xff /* 255U */ #define UINT8_MAX 0xff /* 255U */
#define UINT16_MAX 0xffff /* 65535U */ #define UINT16_MAX 0xffff /* 65535U */
#define UINT32_MAX 0xffffffff /* 4294967295U */ #define UINT32_MAX 0xffffffff /* 4294967295U */
#define UINT64_MAX 0xffffffffffffffffULL /* 18446744073709551615ULL */ #define UINT64_MAX 0xffffffffffffffffULL /* 18446744073709551615ULL */
/* 7.18.2.2 Limits of minimum-width integer types */ /* 7.18.2.2 Limits of minimum-width integer types */
#define INT_LEAST8_MIN INT8_MIN #define INT_LEAST8_MIN INT8_MIN
#define INT_LEAST16_MIN INT16_MIN #define INT_LEAST16_MIN INT16_MIN
#define INT_LEAST32_MIN INT32_MIN #define INT_LEAST32_MIN INT32_MIN
#define INT_LEAST64_MIN INT64_MIN #define INT_LEAST64_MIN INT64_MIN
#define INT_LEAST8_MAX INT8_MAX #define INT_LEAST8_MAX INT8_MAX
#define INT_LEAST16_MAX INT16_MAX #define INT_LEAST16_MAX INT16_MAX
#define INT_LEAST32_MAX INT32_MAX #define INT_LEAST32_MAX INT32_MAX
#define INT_LEAST64_MAX INT64_MAX #define INT_LEAST64_MAX INT64_MAX
#define UINT_LEAST8_MAX UINT8_MAX #define UINT_LEAST8_MAX UINT8_MAX
#define UINT_LEAST16_MAX UINT16_MAX #define UINT_LEAST16_MAX UINT16_MAX
#define UINT_LEAST32_MAX UINT32_MAX #define UINT_LEAST32_MAX UINT32_MAX
#define UINT_LEAST64_MAX UINT64_MAX #define UINT_LEAST64_MAX UINT64_MAX
/* 7.18.2.3 Limits of fastest minimum-width integer types */ /* 7.18.2.3 Limits of fastest minimum-width integer types */
#define INT_FAST8_MIN INT8_MIN #define INT_FAST8_MIN INT8_MIN
#define INT_FAST16_MIN INT16_MIN #define INT_FAST16_MIN INT16_MIN
#define INT_FAST32_MIN INT32_MIN #define INT_FAST32_MIN INT32_MIN
#define INT_FAST64_MIN INT64_MIN #define INT_FAST64_MIN INT64_MIN
#define INT_FAST8_MAX INT8_MAX #define INT_FAST8_MAX INT8_MAX
#define INT_FAST16_MAX INT16_MAX #define INT_FAST16_MAX INT16_MAX
#define INT_FAST32_MAX INT32_MAX #define INT_FAST32_MAX INT32_MAX
#define INT_FAST64_MAX INT64_MAX #define INT_FAST64_MAX INT64_MAX
#define UINT_FAST8_MAX UINT8_MAX #define UINT_FAST8_MAX UINT8_MAX
#define UINT_FAST16_MAX UINT16_MAX #define UINT_FAST16_MAX UINT16_MAX
#define UINT_FAST32_MAX UINT32_MAX #define UINT_FAST32_MAX UINT32_MAX
#define UINT_FAST64_MAX UINT64_MAX #define UINT_FAST64_MAX UINT64_MAX
/* 7.18.2.4 Limits of integer types capable of holding /* 7.18.2.4 Limits of integer types capable of holding
object pointers */ object pointers */
#define INTPTR_MIN INT32_MIN #define INTPTR_MIN INT32_MIN
#define INTPTR_MAX INT32_MAX #define INTPTR_MAX INT32_MAX
#define UINTPTR_MAX UINT32_MAX #define UINTPTR_MAX UINT32_MAX
/* 7.18.2.5 Limits of greatest-width integer types */ /* 7.18.2.5 Limits of greatest-width integer types */
#define INTMAX_MIN INT64_MIN #define INTMAX_MIN INT64_MIN
#define INTMAX_MAX INT64_MAX #define INTMAX_MAX INT64_MAX
#define UINTMAX_MAX UINT64_MAX #define UINTMAX_MAX UINT64_MAX
/* 7.18.3 Limits of other integer types */ /* 7.18.3 Limits of other integer types */
#define PTRDIFF_MIN INT32_MIN #define PTRDIFF_MIN INT32_MIN
#define PTRDIFF_MAX INT32_MAX #define PTRDIFF_MAX INT32_MAX
#define SIG_ATOMIC_MIN INT32_MIN #define SIG_ATOMIC_MIN INT32_MIN
#define SIG_ATOMIC_MAX INT32_MAX #define SIG_ATOMIC_MAX INT32_MAX
#define SIZE_MAX UINT32_MAX #define SIZE_MAX UINT32_MAX
#ifndef WCHAR_MIN /* also in wchar.h */ #ifndef WCHAR_MIN /* also in wchar.h */
#define WCHAR_MIN 0 #define WCHAR_MIN 0
#define WCHAR_MAX ((wchar_t)-1) /* UINT16_MAX */ #define WCHAR_MAX ((wchar_t)-1) /* UINT16_MAX */
#endif #endif
/* /*
* wint_t is unsigned int in __MINGW32__, * wint_t is unsigned int in __MINGW32__,
* but unsigned short in MS runtime * but unsigned short in MS runtime
*/ */
#define WINT_MIN 0 #define WINT_MIN 0
#define WINT_MAX UINT32_MAX #define WINT_MAX UINT32_MAX
#endif /* !defined ( __cplusplus) || defined __STDC_LIMIT_MACROS */ #endif /* !defined ( __cplusplus) || defined __STDC_LIMIT_MACROS */
/* 7.18.4 Macros for integer constants */ /* 7.18.4 Macros for integer constants */
#if !defined ( __cplusplus) || defined (__STDC_CONSTANT_MACROS) #if !defined ( __cplusplus) || defined (__STDC_CONSTANT_MACROS)
/* 7.18.4.1 Macros for minimum-width integer constants /* 7.18.4.1 Macros for minimum-width integer constants
Accoding to Douglas Gwyn <gwyn@arl.mil>: Accoding to Douglas Gwyn <gwyn@arl.mil>:
"This spec was changed in ISO/IEC 9899:1999 TC1; in ISO/IEC "This spec was changed in ISO/IEC 9899:1999 TC1; in ISO/IEC
9899:1999 as initially published, the expansion was required 9899:1999 as initially published, the expansion was required
to be an integer constant of precisely matching type, which to be an integer constant of precisely matching type, which
is impossible to accomplish for the shorter types on most is impossible to accomplish for the shorter types on most
platforms, because C99 provides no standard way to designate platforms, because C99 provides no standard way to designate
an integer constant with width less than that of type int. an integer constant with width less than that of type int.
TC1 changed this to require just an integer constant TC1 changed this to require just an integer constant
*expression* with *promoted* type." *expression* with *promoted* type."
The trick used here is from Clive D W Feather. The trick used here is from Clive D W Feather.
*/ */
#define INT8_C(val) (INT_LEAST8_MAX-INT_LEAST8_MAX+(val)) #define INT8_C(val) (INT_LEAST8_MAX-INT_LEAST8_MAX+(val))
#define INT16_C(val) (INT_LEAST16_MAX-INT_LEAST16_MAX+(val)) #define INT16_C(val) (INT_LEAST16_MAX-INT_LEAST16_MAX+(val))
#define INT32_C(val) (INT_LEAST32_MAX-INT_LEAST32_MAX+(val)) #define INT32_C(val) (INT_LEAST32_MAX-INT_LEAST32_MAX+(val))
#define INT64_C(val) (INT_LEAST64_MAX-INT_LEAST64_MAX+(val)) #define INT64_C(val) (INT_LEAST64_MAX-INT_LEAST64_MAX+(val))
#define UINT8_C(val) (UINT_LEAST8_MAX-UINT_LEAST8_MAX+(val)) #define UINT8_C(val) (UINT_LEAST8_MAX-UINT_LEAST8_MAX+(val))
#define UINT16_C(val) (UINT_LEAST16_MAX-UINT_LEAST16_MAX+(val)) #define UINT16_C(val) (UINT_LEAST16_MAX-UINT_LEAST16_MAX+(val))
#define UINT32_C(val) (UINT_LEAST32_MAX-UINT_LEAST32_MAX+(val)) #define UINT32_C(val) (UINT_LEAST32_MAX-UINT_LEAST32_MAX+(val))
#define UINT64_C(val) (UINT_LEAST64_MAX-UINT_LEAST64_MAX+(val)) #define UINT64_C(val) (UINT_LEAST64_MAX-UINT_LEAST64_MAX+(val))
/* 7.18.4.2 Macros for greatest-width integer constants */ /* 7.18.4.2 Macros for greatest-width integer constants */
#define INTMAX_C(val) (INTMAX_MAX-INTMAX_MAX+(val)) #define INTMAX_C(val) (INTMAX_MAX-INTMAX_MAX+(val))
#define UINTMAX_C(val) (UINTMAX_MAX-UINTMAX_MAX+(val)) #define UINTMAX_C(val) (UINTMAX_MAX-UINTMAX_MAX+(val))
#endif /* !defined ( __cplusplus) || defined __STDC_CONSTANT_MACROS */ #endif /* !defined ( __cplusplus) || defined __STDC_CONSTANT_MACROS */
#endif #endif

View File

@ -1,413 +1,413 @@
/* /*
* stdio.h * stdio.h
* *
* Definitions of types and prototypes of functions for standard input and * Definitions of types and prototypes of functions for standard input and
* output. * output.
* *
* NOTE: The file manipulation functions provided by Microsoft seem to * NOTE: The file manipulation functions provided by Microsoft seem to
* work with either slash (/) or backslash (\) as the path separator. * work with either slash (/) or backslash (\) as the path separator.
* *
* This file is part of the Mingw32 package. * This file is part of the Mingw32 package.
* *
* Contributors: * Contributors:
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp> * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
* *
* THIS SOFTWARE IS NOT COPYRIGHTED * THIS SOFTWARE IS NOT COPYRIGHTED
* *
* This source code is offered for use in the public domain. You may * This source code is offered for use in the public domain. You may
* use, modify or distribute it freely. * use, modify or distribute it freely.
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* $Author: bellard $ * $Author: bellard $
* $Date: 2005/04/14 23:49:21 $ * $Date: 2005/04/17 13:14:29 $
* *
*/ */
#ifndef _STDIO_H_ #ifndef _STDIO_H_
#define _STDIO_H_ #define _STDIO_H_
/* All the headers include this file. */ /* All the headers include this file. */
#include <_mingw.h> #include <_mingw.h>
#define __need_size_t #define __need_size_t
#define __need_NULL #define __need_NULL
#define __need_wchar_t #define __need_wchar_t
#define __need_wint_t #define __need_wint_t
#ifndef RC_INVOKED #ifndef RC_INVOKED
#include <stddef.h> #include <stddef.h>
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
/* Flags for the iobuf structure */ /* Flags for the iobuf structure */
#define _IOREAD 1 #define _IOREAD 1
#define _IOWRT 2 #define _IOWRT 2
#define _IORW 0x0080 /* opened as "r+w" */ #define _IORW 0x0080 /* opened as "r+w" */
/* /*
* The three standard file pointers provided by the run time library. * The three standard file pointers provided by the run time library.
* NOTE: These will go to the bit-bucket silently in GUI applications! * NOTE: These will go to the bit-bucket silently in GUI applications!
*/ */
#define STDIN_FILENO 0 #define STDIN_FILENO 0
#define STDOUT_FILENO 1 #define STDOUT_FILENO 1
#define STDERR_FILENO 2 #define STDERR_FILENO 2
/* Returned by various functions on end of file condition or error. */ /* Returned by various functions on end of file condition or error. */
#define EOF (-1) #define EOF (-1)
/* /*
* The maximum length of a file name. You should use GetVolumeInformation * The maximum length of a file name. You should use GetVolumeInformation
* instead of this constant. But hey, this works. * instead of this constant. But hey, this works.
* *
* NOTE: This is used in the structure _finddata_t (see io.h) so changing it * NOTE: This is used in the structure _finddata_t (see io.h) so changing it
* is probably not a good idea. * is probably not a good idea.
*/ */
#define FILENAME_MAX (260) #define FILENAME_MAX (260)
/* /*
* The maximum number of files that may be open at once. I have set this to * The maximum number of files that may be open at once. I have set this to
* a conservative number. The actual value may be higher. * a conservative number. The actual value may be higher.
*/ */
#define FOPEN_MAX (20) #define FOPEN_MAX (20)
/* After creating this many names, tmpnam and tmpfile return NULL */ /* After creating this many names, tmpnam and tmpfile return NULL */
#define TMP_MAX 32767 #define TMP_MAX 32767
/* /*
* Tmpnam, tmpfile and, sometimes, _tempnam try to create * Tmpnam, tmpfile and, sometimes, _tempnam try to create
* temp files in the root directory of the current drive * temp files in the root directory of the current drive
* (not in pwd, as suggested by some older MS doc's). * (not in pwd, as suggested by some older MS doc's).
* Redefining these macros does not effect the CRT functions. * Redefining these macros does not effect the CRT functions.
*/ */
#define _P_tmpdir "\\" #define _P_tmpdir "\\"
#define _wP_tmpdir L"\\" #define _wP_tmpdir L"\\"
/* /*
* The maximum size of name (including NUL) that will be put in the user * The maximum size of name (including NUL) that will be put in the user
* supplied buffer caName for tmpnam. * supplied buffer caName for tmpnam.
* Inferred from the size of the static buffer returned by tmpnam * Inferred from the size of the static buffer returned by tmpnam
* when passed a NULL argument. May actually be smaller. * when passed a NULL argument. May actually be smaller.
*/ */
#define L_tmpnam (16) #define L_tmpnam (16)
#define _IOFBF 0x0000 #define _IOFBF 0x0000
#define _IOLBF 0x0040 #define _IOLBF 0x0040
#define _IONBF 0x0004 #define _IONBF 0x0004
/* /*
* The buffer size as used by setbuf such that it is equivalent to * The buffer size as used by setbuf such that it is equivalent to
* (void) setvbuf(fileSetBuffer, caBuffer, _IOFBF, BUFSIZ). * (void) setvbuf(fileSetBuffer, caBuffer, _IOFBF, BUFSIZ).
*/ */
#define BUFSIZ 512 #define BUFSIZ 512
/* Constants for nOrigin indicating the position relative to which fseek /* Constants for nOrigin indicating the position relative to which fseek
* sets the file position. Enclosed in ifdefs because io.h could also * sets the file position. Enclosed in ifdefs because io.h could also
* define them. (Though not anymore since io.h includes this file now.) */ * define them. (Though not anymore since io.h includes this file now.) */
#ifndef SEEK_SET #ifndef SEEK_SET
#define SEEK_SET (0) #define SEEK_SET (0)
#endif #endif
#ifndef SEEK_CUR #ifndef SEEK_CUR
#define SEEK_CUR (1) #define SEEK_CUR (1)
#endif #endif
#ifndef SEEK_END #ifndef SEEK_END
#define SEEK_END (2) #define SEEK_END (2)
#endif #endif
#ifndef RC_INVOKED #ifndef RC_INVOKED
/* /*
* I used to include stdarg.h at this point, in order to allow for the * I used to include stdarg.h at this point, in order to allow for the
* functions later on in the file which use va_list. That conflicts with * functions later on in the file which use va_list. That conflicts with
* using stdio.h and varargs.h in the same file, so I do the typedef myself. * using stdio.h and varargs.h in the same file, so I do the typedef myself.
*/ */
#ifndef _VA_LIST #ifndef _VA_LIST
#define _VA_LIST #define _VA_LIST
#if defined __GNUC__ && __GNUC__ >= 3 #if defined __GNUC__ && __GNUC__ >= 3
typedef __builtin_va_list va_list; typedef __builtin_va_list va_list;
#else #else
typedef char* va_list; typedef char* va_list;
#endif #endif
#endif #endif
/* /*
* The structure underlying the FILE type. * The structure underlying the FILE type.
* *
* I still believe that nobody in their right mind should make use of the * I still believe that nobody in their right mind should make use of the
* internals of this structure. Provided by Pedro A. Aranda Gutiirrez * internals of this structure. Provided by Pedro A. Aranda Gutiirrez
* <paag@tid.es>. * <paag@tid.es>.
*/ */
#ifndef _FILE_DEFINED #ifndef _FILE_DEFINED
#define _FILE_DEFINED #define _FILE_DEFINED
typedef struct _iobuf typedef struct _iobuf
{ {
char* _ptr; char* _ptr;
int _cnt; int _cnt;
char* _base; char* _base;
int _flag; int _flag;
int _file; int _file;
int _charbuf; int _charbuf;
int _bufsiz; int _bufsiz;
char* _tmpfname; char* _tmpfname;
} FILE; } FILE;
#endif /* Not _FILE_DEFINED */ #endif /* Not _FILE_DEFINED */
/* /*
* The standard file handles * The standard file handles
*/ */
#ifndef __DECLSPEC_SUPPORTED #ifndef __DECLSPEC_SUPPORTED
extern FILE (*__imp__iob)[]; /* A pointer to an array of FILE */ extern FILE (*__imp__iob)[]; /* A pointer to an array of FILE */
#define _iob (*__imp__iob) /* An array of FILE */ #define _iob (*__imp__iob) /* An array of FILE */
#else /* __DECLSPEC_SUPPORTED */ #else /* __DECLSPEC_SUPPORTED */
__MINGW_IMPORT FILE _iob[]; /* An array of FILE imported from DLL. */ __MINGW_IMPORT FILE _iob[]; /* An array of FILE imported from DLL. */
#endif /* __DECLSPEC_SUPPORTED */ #endif /* __DECLSPEC_SUPPORTED */
#define stdin (&_iob[STDIN_FILENO]) #define stdin (&_iob[STDIN_FILENO])
#define stdout (&_iob[STDOUT_FILENO]) #define stdout (&_iob[STDOUT_FILENO])
#define stderr (&_iob[STDERR_FILENO]) #define stderr (&_iob[STDERR_FILENO])
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* /*
* File Operations * File Operations
*/ */
FILE* fopen (const char*, const char*); FILE* fopen (const char*, const char*);
FILE* freopen (const char*, const char*, FILE*); FILE* freopen (const char*, const char*, FILE*);
int fflush (FILE*); int fflush (FILE*);
int fclose (FILE*); int fclose (FILE*);
/* MS puts remove & rename (but not wide versions) in io.h also */ /* MS puts remove & rename (but not wide versions) in io.h also */
int remove (const char*); int remove (const char*);
int rename (const char*, const char*); int rename (const char*, const char*);
FILE* tmpfile (void); FILE* tmpfile (void);
char* tmpnam (char*); char* tmpnam (char*);
char* _tempnam (const char*, const char*); char* _tempnam (const char*, const char*);
#ifndef NO_OLDNAMES #ifndef NO_OLDNAMES
char* tempnam (const char*, const char*); char* tempnam (const char*, const char*);
#endif #endif
int setvbuf (FILE*, char*, int, size_t); int setvbuf (FILE*, char*, int, size_t);
void setbuf (FILE*, char*); void setbuf (FILE*, char*);
/* /*
* Formatted Output * Formatted Output
*/ */
int fprintf (FILE*, const char*, ...); int fprintf (FILE*, const char*, ...);
int printf (const char*, ...); int printf (const char*, ...);
int sprintf (char*, const char*, ...); int sprintf (char*, const char*, ...);
int _snprintf (char*, size_t, const char*, ...); int _snprintf (char*, size_t, const char*, ...);
int vfprintf (FILE*, const char*, va_list); int vfprintf (FILE*, const char*, va_list);
int vprintf (const char*, va_list); int vprintf (const char*, va_list);
int vsprintf (char*, const char*, va_list); int vsprintf (char*, const char*, va_list);
int _vsnprintf (char*, size_t, const char*, va_list); int _vsnprintf (char*, size_t, const char*, va_list);
#ifndef __NO_ISOCEXT /* externs in libmingwex.a */ #ifndef __NO_ISOCEXT /* externs in libmingwex.a */
int snprintf(char* s, size_t n, const char* format, ...); int snprintf(char* s, size_t n, const char* format, ...);
extern inline int vsnprintf (char* s, size_t n, const char* format, extern inline int vsnprintf (char* s, size_t n, const char* format,
va_list arg) va_list arg)
{ return _vsnprintf ( s, n, format, arg); } { return _vsnprintf ( s, n, format, arg); }
#endif #endif
/* /*
* Formatted Input * Formatted Input
*/ */
int fscanf (FILE*, const char*, ...); int fscanf (FILE*, const char*, ...);
int scanf (const char*, ...); int scanf (const char*, ...);
int sscanf (const char*, const char*, ...); int sscanf (const char*, const char*, ...);
/* /*
* Character Input and Output Functions * Character Input and Output Functions
*/ */
int fgetc (FILE*); int fgetc (FILE*);
char* fgets (char*, int, FILE*); char* fgets (char*, int, FILE*);
int fputc (int, FILE*); int fputc (int, FILE*);
int fputs (const char*, FILE*); int fputs (const char*, FILE*);
int getc (FILE*); int getc (FILE*);
int getchar (void); int getchar (void);
char* gets (char*); char* gets (char*);
int putc (int, FILE*); int putc (int, FILE*);
int putchar (int); int putchar (int);
int puts (const char*); int puts (const char*);
int ungetc (int, FILE*); int ungetc (int, FILE*);
/* /*
* Direct Input and Output Functions * Direct Input and Output Functions
*/ */
size_t fread (void*, size_t, size_t, FILE*); size_t fread (void*, size_t, size_t, FILE*);
size_t fwrite (const void*, size_t, size_t, FILE*); size_t fwrite (const void*, size_t, size_t, FILE*);
/* /*
* File Positioning Functions * File Positioning Functions
*/ */
int fseek (FILE*, long, int); int fseek (FILE*, long, int);
long ftell (FILE*); long ftell (FILE*);
void rewind (FILE*); void rewind (FILE*);
#ifdef __USE_MINGW_FSEEK /* These are in libmingwex.a */ #ifdef __USE_MINGW_FSEEK /* These are in libmingwex.a */
/* /*
* Workaround for limitations on win9x where a file contents are * Workaround for limitations on win9x where a file contents are
* not zero'd out if you seek past the end and then write. * not zero'd out if you seek past the end and then write.
*/ */
int __mingw_fseek (FILE *, long, int); int __mingw_fseek (FILE *, long, int);
int __mingw_fwrite (const void*, size_t, size_t, FILE*); int __mingw_fwrite (const void*, size_t, size_t, FILE*);
#define fseek(fp, offset, whence) __mingw_fseek(fp, offset, whence) #define fseek(fp, offset, whence) __mingw_fseek(fp, offset, whence)
#define fwrite(buffer, size, count, fp) __mingw_fwrite(buffer, size, count, fp) #define fwrite(buffer, size, count, fp) __mingw_fwrite(buffer, size, count, fp)
#endif /* __USE_MINGW_FSEEK */ #endif /* __USE_MINGW_FSEEK */
/* /*
* An opaque data type used for storing file positions... The contents of * An opaque data type used for storing file positions... The contents of
* this type are unknown, but we (the compiler) need to know the size * this type are unknown, but we (the compiler) need to know the size
* because the programmer using fgetpos and fsetpos will be setting aside * because the programmer using fgetpos and fsetpos will be setting aside
* storage for fpos_t structres. Actually I tested using a byte array and * storage for fpos_t structres. Actually I tested using a byte array and
* it is fairly evident that the fpos_t type is a long (in CRTDLL.DLL). * it is fairly evident that the fpos_t type is a long (in CRTDLL.DLL).
* Perhaps an unsigned long? TODO? It's definitely a 64-bit number in * Perhaps an unsigned long? TODO? It's definitely a 64-bit number in
* MSVCRT however, and for now `long long' will do. * MSVCRT however, and for now `long long' will do.
*/ */
#ifdef __MSVCRT__ #ifdef __MSVCRT__
typedef long long fpos_t; typedef long long fpos_t;
#else #else
typedef long fpos_t; typedef long fpos_t;
#endif #endif
int fgetpos (FILE*, fpos_t*); int fgetpos (FILE*, fpos_t*);
int fsetpos (FILE*, const fpos_t*); int fsetpos (FILE*, const fpos_t*);
/* /*
* Error Functions * Error Functions
*/ */
void clearerr (FILE*); void clearerr (FILE*);
int feof (FILE*); int feof (FILE*);
int ferror (FILE*); int ferror (FILE*);
void perror (const char*); void perror (const char*);
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
/* /*
* Pipes * Pipes
*/ */
FILE* _popen (const char*, const char*); FILE* _popen (const char*, const char*);
int _pclose (FILE*); int _pclose (FILE*);
#ifndef NO_OLDNAMES #ifndef NO_OLDNAMES
FILE* popen (const char*, const char*); FILE* popen (const char*, const char*);
int pclose (FILE*); int pclose (FILE*);
#endif #endif
/* /*
* Other Non ANSI functions * Other Non ANSI functions
*/ */
int _flushall (void); int _flushall (void);
int _fgetchar (void); int _fgetchar (void);
int _fputchar (int); int _fputchar (int);
FILE* _fdopen (int, const char*); FILE* _fdopen (int, const char*);
int _fileno (FILE*); int _fileno (FILE*);
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
int fgetchar (void); int fgetchar (void);
int fputchar (int); int fputchar (int);
FILE* fdopen (int, const char*); FILE* fdopen (int, const char*);
int fileno (FILE*); int fileno (FILE*);
#endif /* Not _NO_OLDNAMES */ #endif /* Not _NO_OLDNAMES */
#endif /* Not __STRICT_ANSI__ */ #endif /* Not __STRICT_ANSI__ */
/* Wide versions */ /* Wide versions */
#ifndef _WSTDIO_DEFINED #ifndef _WSTDIO_DEFINED
/* also in wchar.h - keep in sync */ /* also in wchar.h - keep in sync */
int fwprintf (FILE*, const wchar_t*, ...); int fwprintf (FILE*, const wchar_t*, ...);
int wprintf (const wchar_t*, ...); int wprintf (const wchar_t*, ...);
int swprintf (wchar_t*, const wchar_t*, ...); int swprintf (wchar_t*, const wchar_t*, ...);
int _snwprintf (wchar_t*, size_t, const wchar_t*, ...); int _snwprintf (wchar_t*, size_t, const wchar_t*, ...);
int vfwprintf (FILE*, const wchar_t*, va_list); int vfwprintf (FILE*, const wchar_t*, va_list);
int vwprintf (const wchar_t*, va_list); int vwprintf (const wchar_t*, va_list);
int vswprintf (wchar_t*, const wchar_t*, va_list); int vswprintf (wchar_t*, const wchar_t*, va_list);
int _vsnwprintf (wchar_t*, size_t, const wchar_t*, va_list); int _vsnwprintf (wchar_t*, size_t, const wchar_t*, va_list);
int fwscanf (FILE*, const wchar_t*, ...); int fwscanf (FILE*, const wchar_t*, ...);
int wscanf (const wchar_t*, ...); int wscanf (const wchar_t*, ...);
int swscanf (const wchar_t*, const wchar_t*, ...); int swscanf (const wchar_t*, const wchar_t*, ...);
wint_t fgetwc (FILE*); wint_t fgetwc (FILE*);
wint_t fputwc (wchar_t, FILE*); wint_t fputwc (wchar_t, FILE*);
wint_t ungetwc (wchar_t, FILE*); wint_t ungetwc (wchar_t, FILE*);
#ifdef __MSVCRT__ #ifdef __MSVCRT__
wchar_t* fgetws (wchar_t*, int, FILE*); wchar_t* fgetws (wchar_t*, int, FILE*);
int fputws (const wchar_t*, FILE*); int fputws (const wchar_t*, FILE*);
wint_t getwc (FILE*); wint_t getwc (FILE*);
wint_t getwchar (void); wint_t getwchar (void);
wchar_t* _getws (wchar_t*); wchar_t* _getws (wchar_t*);
wint_t putwc (wint_t, FILE*); wint_t putwc (wint_t, FILE*);
int _putws (const wchar_t*); int _putws (const wchar_t*);
wint_t putwchar (wint_t); wint_t putwchar (wint_t);
FILE* _wfopen (const wchar_t*, const wchar_t*); FILE* _wfopen (const wchar_t*, const wchar_t*);
FILE* _wfreopen (const wchar_t*, const wchar_t*, FILE*); FILE* _wfreopen (const wchar_t*, const wchar_t*, FILE*);
FILE* _wfsopen (const wchar_t*, const wchar_t*, int); FILE* _wfsopen (const wchar_t*, const wchar_t*, int);
wchar_t* _wtmpnam (wchar_t*); wchar_t* _wtmpnam (wchar_t*);
wchar_t* _wtempnam (const wchar_t*, const wchar_t*); wchar_t* _wtempnam (const wchar_t*, const wchar_t*);
int _wrename (const wchar_t*, const wchar_t*); int _wrename (const wchar_t*, const wchar_t*);
int _wremove (const wchar_t*); int _wremove (const wchar_t*);
void _wperror (const wchar_t*); void _wperror (const wchar_t*);
FILE* _wpopen (const wchar_t*, const wchar_t*); FILE* _wpopen (const wchar_t*, const wchar_t*);
#endif /* __MSVCRT__ */ #endif /* __MSVCRT__ */
#ifndef __NO_ISOCEXT /* externs in libmingwex.a */ #ifndef __NO_ISOCEXT /* externs in libmingwex.a */
int snwprintf(wchar_t* s, size_t n, const wchar_t* format, ...); int snwprintf(wchar_t* s, size_t n, const wchar_t* format, ...);
extern inline int vsnwprintf (wchar_t* s, size_t n, const wchar_t* format, extern inline int vsnwprintf (wchar_t* s, size_t n, const wchar_t* format,
va_list arg) va_list arg)
{ return _vsnwprintf ( s, n, format, arg); } { return _vsnwprintf ( s, n, format, arg); }
#endif #endif
#define _WSTDIO_DEFINED #define _WSTDIO_DEFINED
#endif /* _WSTDIO_DEFINED */ #endif /* _WSTDIO_DEFINED */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#ifdef __MSVCRT__ #ifdef __MSVCRT__
#ifndef NO_OLDNAMES #ifndef NO_OLDNAMES
FILE* wpopen (const wchar_t*, const wchar_t*); FILE* wpopen (const wchar_t*, const wchar_t*);
#endif /* not NO_OLDNAMES */ #endif /* not NO_OLDNAMES */
#endif /* MSVCRT runtime */ #endif /* MSVCRT runtime */
/* /*
* Other Non ANSI wide functions * Other Non ANSI wide functions
*/ */
wint_t _fgetwchar (void); wint_t _fgetwchar (void);
wint_t _fputwchar (wint_t); wint_t _fputwchar (wint_t);
int _getw (FILE*); int _getw (FILE*);
int _putw (int, FILE*); int _putw (int, FILE*);
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
wint_t fgetwchar (void); wint_t fgetwchar (void);
wint_t fputwchar (wint_t); wint_t fputwchar (wint_t);
int getw (FILE*); int getw (FILE*);
int putw (int, FILE*); int putw (int, FILE*);
#endif /* Not _NO_OLDNAMES */ #endif /* Not _NO_OLDNAMES */
#endif /* __STRICT_ANSI */ #endif /* __STRICT_ANSI */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
#endif /* _STDIO_H_ */ #endif /* _STDIO_H_ */

View File

@ -1,482 +1,482 @@
/* /*
* stdlib.h * stdlib.h
* *
* Definitions for common types, variables, and functions. * Definitions for common types, variables, and functions.
* *
* This file is part of the Mingw32 package. * This file is part of the Mingw32 package.
* *
* Contributors: * Contributors:
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp> * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
* *
* THIS SOFTWARE IS NOT COPYRIGHTED * THIS SOFTWARE IS NOT COPYRIGHTED
* *
* This source code is offered for use in the public domain. You may * This source code is offered for use in the public domain. You may
* use, modify or distribute it freely. * use, modify or distribute it freely.
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* $Author: bellard $ * $Author: bellard $
* $Date: 2005/04/14 23:49:21 $ * $Date: 2005/04/17 13:14:29 $
* *
*/ */
#ifndef _STDLIB_H_ #ifndef _STDLIB_H_
#define _STDLIB_H_ #define _STDLIB_H_
/* All the headers include this file. */ /* All the headers include this file. */
#include <_mingw.h> #include <_mingw.h>
#define __need_size_t #define __need_size_t
#define __need_wchar_t #define __need_wchar_t
#define __need_NULL #define __need_NULL
#ifndef RC_INVOKED #ifndef RC_INVOKED
#include <stddef.h> #include <stddef.h>
#endif /* RC_INVOKED */ #endif /* RC_INVOKED */
/* /*
* RAND_MAX is the maximum value that may be returned by rand. * RAND_MAX is the maximum value that may be returned by rand.
* The minimum is zero. * The minimum is zero.
*/ */
#define RAND_MAX 0x7FFF #define RAND_MAX 0x7FFF
/* /*
* These values may be used as exit status codes. * These values may be used as exit status codes.
*/ */
#define EXIT_SUCCESS 0 #define EXIT_SUCCESS 0
#define EXIT_FAILURE 1 #define EXIT_FAILURE 1
/* /*
* Definitions for path name functions. * Definitions for path name functions.
* NOTE: All of these values have simply been chosen to be conservatively high. * NOTE: All of these values have simply been chosen to be conservatively high.
* Remember that with long file names we can no longer depend on * Remember that with long file names we can no longer depend on
* extensions being short. * extensions being short.
*/ */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#ifndef MAX_PATH #ifndef MAX_PATH
#define MAX_PATH (260) #define MAX_PATH (260)
#endif #endif
#define _MAX_PATH MAX_PATH #define _MAX_PATH MAX_PATH
#define _MAX_DRIVE (3) #define _MAX_DRIVE (3)
#define _MAX_DIR 256 #define _MAX_DIR 256
#define _MAX_FNAME 256 #define _MAX_FNAME 256
#define _MAX_EXT 256 #define _MAX_EXT 256
#endif /* Not __STRICT_ANSI__ */ #endif /* Not __STRICT_ANSI__ */
#ifndef RC_INVOKED #ifndef RC_INVOKED
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* /*
* This seems like a convenient place to declare these variables, which * This seems like a convenient place to declare these variables, which
* give programs using WinMain (or main for that matter) access to main-ish * give programs using WinMain (or main for that matter) access to main-ish
* argc and argv. environ is a pointer to a table of environment variables. * argc and argv. environ is a pointer to a table of environment variables.
* NOTE: Strings in _argv and environ are ANSI strings. * NOTE: Strings in _argv and environ are ANSI strings.
*/ */
extern int _argc; extern int _argc;
extern char** _argv; extern char** _argv;
/* imports from runtime dll of the above variables */ /* imports from runtime dll of the above variables */
#ifdef __MSVCRT__ #ifdef __MSVCRT__
extern int* __p___argc(void); extern int* __p___argc(void);
extern char*** __p___argv(void); extern char*** __p___argv(void);
extern wchar_t*** __p___wargv(void); extern wchar_t*** __p___wargv(void);
#define __argc (*__p___argc()) #define __argc (*__p___argc())
#define __argv (*__p___argv()) #define __argv (*__p___argv())
#define __wargv (*__p___wargv()) #define __wargv (*__p___wargv())
#else /* !MSVCRT */ #else /* !MSVCRT */
#ifndef __DECLSPEC_SUPPORTED #ifndef __DECLSPEC_SUPPORTED
extern int* __imp___argc_dll; extern int* __imp___argc_dll;
extern char*** __imp___argv_dll; extern char*** __imp___argv_dll;
#define __argc (*__imp___argc_dll) #define __argc (*__imp___argc_dll)
#define __argv (*__imp___argv_dll) #define __argv (*__imp___argv_dll)
#else /* __DECLSPEC_SUPPORTED */ #else /* __DECLSPEC_SUPPORTED */
__MINGW_IMPORT int __argc_dll; __MINGW_IMPORT int __argc_dll;
__MINGW_IMPORT char** __argv_dll; __MINGW_IMPORT char** __argv_dll;
#define __argc __argc_dll #define __argc __argc_dll
#define __argv __argv_dll #define __argv __argv_dll
#endif /* __DECLSPEC_SUPPORTED */ #endif /* __DECLSPEC_SUPPORTED */
#endif /* __MSVCRT */ #endif /* __MSVCRT */
/* /*
* Also defined in ctype.h. * Also defined in ctype.h.
*/ */
#ifndef MB_CUR_MAX #ifndef MB_CUR_MAX
# ifdef __MSVCRT__ # ifdef __MSVCRT__
# define MB_CUR_MAX __mb_cur_max # define MB_CUR_MAX __mb_cur_max
__MINGW_IMPORT int __mb_cur_max; __MINGW_IMPORT int __mb_cur_max;
# else /* not __MSVCRT */ # else /* not __MSVCRT */
# define MB_CUR_MAX __mb_cur_max_dll # define MB_CUR_MAX __mb_cur_max_dll
__MINGW_IMPORT int __mb_cur_max_dll; __MINGW_IMPORT int __mb_cur_max_dll;
# endif /* not __MSVCRT */ # endif /* not __MSVCRT */
#endif /* MB_CUR_MAX */ #endif /* MB_CUR_MAX */
/* /*
* MS likes to declare errno in stdlib.h as well. * MS likes to declare errno in stdlib.h as well.
*/ */
#ifdef _UWIN #ifdef _UWIN
#undef errno #undef errno
extern int errno; extern int errno;
#else #else
int* _errno(void); int* _errno(void);
#define errno (*_errno()) #define errno (*_errno())
#endif #endif
int* __doserrno(void); int* __doserrno(void);
#define _doserrno (*__doserrno()) #define _doserrno (*__doserrno())
/* /*
* Use environ from the DLL, not as a global. * Use environ from the DLL, not as a global.
*/ */
#ifdef __MSVCRT__ #ifdef __MSVCRT__
extern char *** __p__environ(void); extern char *** __p__environ(void);
extern wchar_t *** __p__wenviron(void); extern wchar_t *** __p__wenviron(void);
# define _environ (*__p__environ()) # define _environ (*__p__environ())
# define _wenviron (*__p__wenviron()) # define _wenviron (*__p__wenviron())
#else /* ! __MSVCRT__ */ #else /* ! __MSVCRT__ */
# ifndef __DECLSPEC_SUPPORTED # ifndef __DECLSPEC_SUPPORTED
extern char *** __imp__environ_dll; extern char *** __imp__environ_dll;
# define _environ (*__imp__environ_dll) # define _environ (*__imp__environ_dll)
# else /* __DECLSPEC_SUPPORTED */ # else /* __DECLSPEC_SUPPORTED */
__MINGW_IMPORT char ** _environ_dll; __MINGW_IMPORT char ** _environ_dll;
# define _environ _environ_dll # define _environ _environ_dll
# endif /* __DECLSPEC_SUPPORTED */ # endif /* __DECLSPEC_SUPPORTED */
#endif /* ! __MSVCRT__ */ #endif /* ! __MSVCRT__ */
#define environ _environ #define environ _environ
#ifdef __MSVCRT__ #ifdef __MSVCRT__
/* One of the MSVCRTxx libraries */ /* One of the MSVCRTxx libraries */
#ifndef __DECLSPEC_SUPPORTED #ifndef __DECLSPEC_SUPPORTED
extern int* __imp__sys_nerr; extern int* __imp__sys_nerr;
# define sys_nerr (*__imp__sys_nerr) # define sys_nerr (*__imp__sys_nerr)
#else /* __DECLSPEC_SUPPORTED */ #else /* __DECLSPEC_SUPPORTED */
__MINGW_IMPORT int _sys_nerr; __MINGW_IMPORT int _sys_nerr;
# ifndef _UWIN # ifndef _UWIN
# define sys_nerr _sys_nerr # define sys_nerr _sys_nerr
# endif /* _UWIN */ # endif /* _UWIN */
#endif /* __DECLSPEC_SUPPORTED */ #endif /* __DECLSPEC_SUPPORTED */
#else /* ! __MSVCRT__ */ #else /* ! __MSVCRT__ */
/* CRTDLL run time library */ /* CRTDLL run time library */
#ifndef __DECLSPEC_SUPPORTED #ifndef __DECLSPEC_SUPPORTED
extern int* __imp__sys_nerr_dll; extern int* __imp__sys_nerr_dll;
# define sys_nerr (*__imp__sys_nerr_dll) # define sys_nerr (*__imp__sys_nerr_dll)
#else /* __DECLSPEC_SUPPORTED */ #else /* __DECLSPEC_SUPPORTED */
__MINGW_IMPORT int _sys_nerr_dll; __MINGW_IMPORT int _sys_nerr_dll;
# define sys_nerr _sys_nerr_dll # define sys_nerr _sys_nerr_dll
#endif /* __DECLSPEC_SUPPORTED */ #endif /* __DECLSPEC_SUPPORTED */
#endif /* ! __MSVCRT__ */ #endif /* ! __MSVCRT__ */
#ifndef __DECLSPEC_SUPPORTED #ifndef __DECLSPEC_SUPPORTED
extern char*** __imp__sys_errlist; extern char*** __imp__sys_errlist;
#define sys_errlist (*__imp__sys_errlist) #define sys_errlist (*__imp__sys_errlist)
#else /* __DECLSPEC_SUPPORTED */ #else /* __DECLSPEC_SUPPORTED */
__MINGW_IMPORT char* _sys_errlist[]; __MINGW_IMPORT char* _sys_errlist[];
#ifndef _UWIN #ifndef _UWIN
#define sys_errlist _sys_errlist #define sys_errlist _sys_errlist
#endif /* _UWIN */ #endif /* _UWIN */
#endif /* __DECLSPEC_SUPPORTED */ #endif /* __DECLSPEC_SUPPORTED */
/* /*
* OS version and such constants. * OS version and such constants.
*/ */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#ifdef __MSVCRT__ #ifdef __MSVCRT__
/* msvcrtxx.dll */ /* msvcrtxx.dll */
extern unsigned int* __p__osver(void); extern unsigned int* __p__osver(void);
extern unsigned int* __p__winver(void); extern unsigned int* __p__winver(void);
extern unsigned int* __p__winmajor(void); extern unsigned int* __p__winmajor(void);
extern unsigned int* __p__winminor(void); extern unsigned int* __p__winminor(void);
#define _osver (*__p__osver()) #define _osver (*__p__osver())
#define _winver (*__p__winver()) #define _winver (*__p__winver())
#define _winmajor (*__p__winmajor()) #define _winmajor (*__p__winmajor())
#define _winminor (*__p__winminor()) #define _winminor (*__p__winminor())
#else #else
/* Not msvcrtxx.dll, thus crtdll.dll */ /* Not msvcrtxx.dll, thus crtdll.dll */
#ifndef __DECLSPEC_SUPPORTED #ifndef __DECLSPEC_SUPPORTED
extern unsigned int* _imp___osver_dll; extern unsigned int* _imp___osver_dll;
extern unsigned int* _imp___winver_dll; extern unsigned int* _imp___winver_dll;
extern unsigned int* _imp___winmajor_dll; extern unsigned int* _imp___winmajor_dll;
extern unsigned int* _imp___winminor_dll; extern unsigned int* _imp___winminor_dll;
#define _osver (*_imp___osver_dll) #define _osver (*_imp___osver_dll)
#define _winver (*_imp___winver_dll) #define _winver (*_imp___winver_dll)
#define _winmajor (*_imp___winmajor_dll) #define _winmajor (*_imp___winmajor_dll)
#define _winminor (*_imp___winminor_dll) #define _winminor (*_imp___winminor_dll)
#else /* __DECLSPEC_SUPPORTED */ #else /* __DECLSPEC_SUPPORTED */
__MINGW_IMPORT unsigned int _osver_dll; __MINGW_IMPORT unsigned int _osver_dll;
__MINGW_IMPORT unsigned int _winver_dll; __MINGW_IMPORT unsigned int _winver_dll;
__MINGW_IMPORT unsigned int _winmajor_dll; __MINGW_IMPORT unsigned int _winmajor_dll;
__MINGW_IMPORT unsigned int _winminor_dll; __MINGW_IMPORT unsigned int _winminor_dll;
#define _osver _osver_dll #define _osver _osver_dll
#define _winver _winver_dll #define _winver _winver_dll
#define _winmajor _winmajor_dll #define _winmajor _winmajor_dll
#define _winminor _winminor_dll #define _winminor _winminor_dll
#endif /* __DECLSPEC_SUPPORTED */ #endif /* __DECLSPEC_SUPPORTED */
#endif #endif
#if defined __MSVCRT__ #if defined __MSVCRT__
/* although the _pgmptr is exported as DATA, /* although the _pgmptr is exported as DATA,
* be safe and use the access function __p__pgmptr() to get it. */ * be safe and use the access function __p__pgmptr() to get it. */
char** __p__pgmptr(void); char** __p__pgmptr(void);
#define _pgmptr (*__p__pgmptr()) #define _pgmptr (*__p__pgmptr())
wchar_t** __p__wpgmptr(void); wchar_t** __p__wpgmptr(void);
#define _wpgmptr (*__p__wpgmptr()) #define _wpgmptr (*__p__wpgmptr())
#else /* ! __MSVCRT__ */ #else /* ! __MSVCRT__ */
# ifndef __DECLSPEC_SUPPORTED # ifndef __DECLSPEC_SUPPORTED
extern char** __imp__pgmptr_dll; extern char** __imp__pgmptr_dll;
# define _pgmptr (*__imp__pgmptr_dll) # define _pgmptr (*__imp__pgmptr_dll)
# else /* __DECLSPEC_SUPPORTED */ # else /* __DECLSPEC_SUPPORTED */
__MINGW_IMPORT char* _pgmptr_dll; __MINGW_IMPORT char* _pgmptr_dll;
# define _pgmptr _pgmptr_dll # define _pgmptr _pgmptr_dll
# endif /* __DECLSPEC_SUPPORTED */ # endif /* __DECLSPEC_SUPPORTED */
/* no wide version in CRTDLL */ /* no wide version in CRTDLL */
#endif /* __MSVCRT__ */ #endif /* __MSVCRT__ */
#endif /* Not __STRICT_ANSI__ */ #endif /* Not __STRICT_ANSI__ */
#ifdef __GNUC__ #ifdef __GNUC__
#define _ATTRIB_NORETURN __attribute__ ((noreturn)) #define _ATTRIB_NORETURN __attribute__ ((noreturn))
#else /* Not __GNUC__ */ #else /* Not __GNUC__ */
#define _ATTRIB_NORETURN #define _ATTRIB_NORETURN
#endif /* __GNUC__ */ #endif /* __GNUC__ */
double atof (const char*); double atof (const char*);
int atoi (const char*); int atoi (const char*);
long atol (const char*); long atol (const char*);
int _wtoi (const wchar_t *); int _wtoi (const wchar_t *);
long _wtol (const wchar_t *); long _wtol (const wchar_t *);
double strtod (const char*, char**); double strtod (const char*, char**);
#if !defined __NO_ISOCEXT /* extern stubs in static libmingwex.a */ #if !defined __NO_ISOCEXT /* extern stubs in static libmingwex.a */
extern __inline__ float strtof (const char *nptr, char **endptr) extern __inline__ float strtof (const char *nptr, char **endptr)
{ return (strtod (nptr, endptr));} { return (strtod (nptr, endptr));}
#endif /* __NO_ISOCEXT */ #endif /* __NO_ISOCEXT */
long strtol (const char*, char**, int); long strtol (const char*, char**, int);
unsigned long strtoul (const char*, char**, int); unsigned long strtoul (const char*, char**, int);
#ifndef _WSTDLIB_DEFINED #ifndef _WSTDLIB_DEFINED
/* also declared in wchar.h */ /* also declared in wchar.h */
double wcstod (const wchar_t*, wchar_t**); double wcstod (const wchar_t*, wchar_t**);
#if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */ #if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */
extern __inline__ float wcstof( const wchar_t *nptr, wchar_t **endptr) extern __inline__ float wcstof( const wchar_t *nptr, wchar_t **endptr)
{ return (wcstod(nptr, endptr)); } { return (wcstod(nptr, endptr)); }
#endif /* __NO_ISOCEXT */ #endif /* __NO_ISOCEXT */
long wcstol (const wchar_t*, wchar_t**, int); long wcstol (const wchar_t*, wchar_t**, int);
unsigned long wcstoul (const wchar_t*, wchar_t**, int); unsigned long wcstoul (const wchar_t*, wchar_t**, int);
#define _WSTDLIB_DEFINED #define _WSTDLIB_DEFINED
#endif #endif
size_t wcstombs (char*, const wchar_t*, size_t); size_t wcstombs (char*, const wchar_t*, size_t);
int wctomb (char*, wchar_t); int wctomb (char*, wchar_t);
int mblen (const char*, size_t); int mblen (const char*, size_t);
size_t mbstowcs (wchar_t*, const char*, size_t); size_t mbstowcs (wchar_t*, const char*, size_t);
int mbtowc (wchar_t*, const char*, size_t); int mbtowc (wchar_t*, const char*, size_t);
int rand (void); int rand (void);
void srand (unsigned int); void srand (unsigned int);
void* calloc (size_t, size_t); void* calloc (size_t, size_t);
void* malloc (size_t); void* malloc (size_t);
void* realloc (void*, size_t); void* realloc (void*, size_t);
void free (void*); void free (void*);
void abort (void) _ATTRIB_NORETURN; void abort (void) _ATTRIB_NORETURN;
void exit (int) _ATTRIB_NORETURN; void exit (int) _ATTRIB_NORETURN;
int atexit (void (*)(void)); int atexit (void (*)(void));
int system (const char*); int system (const char*);
char* getenv (const char*); char* getenv (const char*);
void* bsearch (const void*, const void*, size_t, size_t, void* bsearch (const void*, const void*, size_t, size_t,
int (*)(const void*, const void*)); int (*)(const void*, const void*));
void qsort (const void*, size_t, size_t, void qsort (const void*, size_t, size_t,
int (*)(const void*, const void*)); int (*)(const void*, const void*));
int abs (int); int abs (int);
long labs (long); long labs (long);
/* /*
* div_t and ldiv_t are structures used to return the results of div and * div_t and ldiv_t are structures used to return the results of div and
* ldiv. * ldiv.
* *
* NOTE: div and ldiv appear not to work correctly unless * NOTE: div and ldiv appear not to work correctly unless
* -fno-pcc-struct-return is specified. This is included in the * -fno-pcc-struct-return is specified. This is included in the
* mingw32 specs file. * mingw32 specs file.
*/ */
typedef struct { int quot, rem; } div_t; typedef struct { int quot, rem; } div_t;
typedef struct { long quot, rem; } ldiv_t; typedef struct { long quot, rem; } ldiv_t;
div_t div (int, int); div_t div (int, int);
ldiv_t ldiv (long, long); ldiv_t ldiv (long, long);
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
/* /*
* NOTE: Officially the three following functions are obsolete. The Win32 API * NOTE: Officially the three following functions are obsolete. The Win32 API
* functions SetErrorMode, Beep and Sleep are their replacements. * functions SetErrorMode, Beep and Sleep are their replacements.
*/ */
void _beep (unsigned int, unsigned int); void _beep (unsigned int, unsigned int);
void _seterrormode (int); void _seterrormode (int);
void _sleep (unsigned long); void _sleep (unsigned long);
void _exit (int) _ATTRIB_NORETURN; void _exit (int) _ATTRIB_NORETURN;
#if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */ #if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */
/* C99 function name */ /* C99 function name */
void _Exit(int) _ATTRIB_NORETURN; /* Declare to get noreturn attribute. */ void _Exit(int) _ATTRIB_NORETURN; /* Declare to get noreturn attribute. */
extern __inline__ void _Exit(int status) extern __inline__ void _Exit(int status)
{ _exit(status); } { _exit(status); }
#endif #endif
/* _onexit is MS extension. Use atexit for portability. */ /* _onexit is MS extension. Use atexit for portability. */
typedef int (* _onexit_t)(void); typedef int (* _onexit_t)(void);
_onexit_t _onexit( _onexit_t ); _onexit_t _onexit( _onexit_t );
int _putenv (const char*); int _putenv (const char*);
void _searchenv (const char*, const char*, char*); void _searchenv (const char*, const char*, char*);
char* _ecvt (double, int, int*, int*); char* _ecvt (double, int, int*, int*);
char* _fcvt (double, int, int*, int*); char* _fcvt (double, int, int*, int*);
char* _gcvt (double, int, char*); char* _gcvt (double, int, char*);
void _makepath (char*, const char*, const char*, const char*, const char*); void _makepath (char*, const char*, const char*, const char*, const char*);
void _splitpath (const char*, char*, char*, char*, char*); void _splitpath (const char*, char*, char*, char*, char*);
char* _fullpath (char*, const char*, size_t); char* _fullpath (char*, const char*, size_t);
char* _itoa (int, char*, int); char* _itoa (int, char*, int);
char* _ltoa (long, char*, int); char* _ltoa (long, char*, int);
char* _ultoa(unsigned long, char*, int); char* _ultoa(unsigned long, char*, int);
wchar_t* _itow (int, wchar_t*, int); wchar_t* _itow (int, wchar_t*, int);
wchar_t* _ltow (long, wchar_t*, int); wchar_t* _ltow (long, wchar_t*, int);
wchar_t* _ultow (unsigned long, wchar_t*, int); wchar_t* _ultow (unsigned long, wchar_t*, int);
#ifdef __MSVCRT__ #ifdef __MSVCRT__
__int64 _atoi64(const char *); __int64 _atoi64(const char *);
char* _i64toa(__int64, char *, int); char* _i64toa(__int64, char *, int);
char* _ui64toa(unsigned __int64, char *, int); char* _ui64toa(unsigned __int64, char *, int);
__int64 _wtoi64(const wchar_t *); __int64 _wtoi64(const wchar_t *);
wchar_t* _i64tow(__int64, wchar_t *, int); wchar_t* _i64tow(__int64, wchar_t *, int);
wchar_t* _ui64tow(unsigned __int64, wchar_t *, int); wchar_t* _ui64tow(unsigned __int64, wchar_t *, int);
wchar_t* _wgetenv(const wchar_t*); wchar_t* _wgetenv(const wchar_t*);
int _wputenv(const wchar_t*); int _wputenv(const wchar_t*);
void _wsearchenv(const wchar_t*, const wchar_t*, wchar_t*); void _wsearchenv(const wchar_t*, const wchar_t*, wchar_t*);
void _wmakepath(wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*); void _wmakepath(wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*);
void _wsplitpath (const wchar_t*, wchar_t*, wchar_t*, wchar_t*, wchar_t*); void _wsplitpath (const wchar_t*, wchar_t*, wchar_t*, wchar_t*, wchar_t*);
wchar_t* _wfullpath (wchar_t*, const wchar_t*, size_t); wchar_t* _wfullpath (wchar_t*, const wchar_t*, size_t);
#endif #endif
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
int putenv (const char*); int putenv (const char*);
void searchenv (const char*, const char*, char*); void searchenv (const char*, const char*, char*);
char* itoa (int, char*, int); char* itoa (int, char*, int);
char* ltoa (long, char*, int); char* ltoa (long, char*, int);
#ifndef _UWIN #ifndef _UWIN
char* ecvt (double, int, int*, int*); char* ecvt (double, int, int*, int*);
char* fcvt (double, int, int*, int*); char* fcvt (double, int, int*, int*);
char* gcvt (double, int, char*); char* gcvt (double, int, char*);
#endif /* _UWIN */ #endif /* _UWIN */
#endif /* Not _NO_OLDNAMES */ #endif /* Not _NO_OLDNAMES */
#endif /* Not __STRICT_ANSI__ */ #endif /* Not __STRICT_ANSI__ */
/* C99 names */ /* C99 names */
#if !defined __NO_ISOCEXT /* externs in static libmingwex.a */ #if !defined __NO_ISOCEXT /* externs in static libmingwex.a */
typedef struct { long long quot, rem; } lldiv_t; typedef struct { long long quot, rem; } lldiv_t;
lldiv_t lldiv (long long, long long); lldiv_t lldiv (long long, long long);
extern __inline__ long long llabs(long long _j) extern __inline__ long long llabs(long long _j)
{return (_j >= 0 ? _j : -_j);} {return (_j >= 0 ? _j : -_j);}
long long strtoll (const char* __restrict__, char** __restrict, int); long long strtoll (const char* __restrict__, char** __restrict, int);
unsigned long long strtoull (const char* __restrict__, char** __restrict__, int); unsigned long long strtoull (const char* __restrict__, char** __restrict__, int);
#if defined (__MSVCRT__) /* these are stubs for MS _i64 versions */ #if defined (__MSVCRT__) /* these are stubs for MS _i64 versions */
long long atoll (const char *); long long atoll (const char *);
#if !defined (__STRICT_ANSI__) #if !defined (__STRICT_ANSI__)
long long wtoll(const wchar_t *); long long wtoll(const wchar_t *);
char* lltoa(long long, char *, int); char* lltoa(long long, char *, int);
char* ulltoa(unsigned long long , char *, int); char* ulltoa(unsigned long long , char *, int);
wchar_t* lltow(long long, wchar_t *, int); wchar_t* lltow(long long, wchar_t *, int);
wchar_t* ulltow(unsigned long long, wchar_t *, int); wchar_t* ulltow(unsigned long long, wchar_t *, int);
/* inline using non-ansi functions */ /* inline using non-ansi functions */
extern __inline__ long long atoll (const char * _c) extern __inline__ long long atoll (const char * _c)
{ return _atoi64 (_c); } { return _atoi64 (_c); }
extern __inline__ char* lltoa(long long _n, char * _c, int _i) extern __inline__ char* lltoa(long long _n, char * _c, int _i)
{ return _i64toa (_n, _c, _i); } { return _i64toa (_n, _c, _i); }
extern __inline__ char* ulltoa(unsigned long long _n, char * _c, int _i) extern __inline__ char* ulltoa(unsigned long long _n, char * _c, int _i)
{ return _ui64toa (_n, _c, _i); } { return _ui64toa (_n, _c, _i); }
extern __inline__ long long wtoll(const wchar_t * _w) extern __inline__ long long wtoll(const wchar_t * _w)
{ return _wtoi64 (_w); } { return _wtoi64 (_w); }
extern __inline__ wchar_t* lltow(long long _n, wchar_t * _w, int _i) extern __inline__ wchar_t* lltow(long long _n, wchar_t * _w, int _i)
{ return _i64tow (_n, _w, _i); } { return _i64tow (_n, _w, _i); }
extern __inline__ wchar_t* ulltow(unsigned long long _n, wchar_t * _w, int _i) extern __inline__ wchar_t* ulltow(unsigned long long _n, wchar_t * _w, int _i)
{ return _ui64tow (_n, _w, _i); } { return _ui64tow (_n, _w, _i); }
#endif /* (__STRICT_ANSI__) */ #endif /* (__STRICT_ANSI__) */
#endif /* __MSVCRT__ */ #endif /* __MSVCRT__ */
#endif /* !__NO_ISOCEXT */ #endif /* !__NO_ISOCEXT */
/* /*
* Undefine the no return attribute used in some function definitions * Undefine the no return attribute used in some function definitions
*/ */
#undef _ATTRIB_NORETURN #undef _ATTRIB_NORETURN
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
#endif /* Not _STDLIB_H_ */ #endif /* Not _STDLIB_H_ */

View File

@ -1,206 +1,206 @@
/* /*
* string.h * string.h
* *
* Definitions for memory and string functions. * Definitions for memory and string functions.
* *
* This file is part of the Mingw32 package. * This file is part of the Mingw32 package.
* *
* Contributors: * Contributors:
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp> * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
* *
* THIS SOFTWARE IS NOT COPYRIGHTED * THIS SOFTWARE IS NOT COPYRIGHTED
* *
* This source code is offered for use in the public domain. You may * This source code is offered for use in the public domain. You may
* use, modify or distribute it freely. * use, modify or distribute it freely.
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* $Author: bellard $ * $Author: bellard $
* $Date: 2005/04/14 23:49:21 $ * $Date: 2005/04/17 13:14:29 $
* *
*/ */
#ifndef _STRING_H_ #ifndef _STRING_H_
#define _STRING_H_ #define _STRING_H_
/* All the headers include this file. */ /* All the headers include this file. */
#include <_mingw.h> #include <_mingw.h>
/* /*
* Define size_t, wchar_t and NULL * Define size_t, wchar_t and NULL
*/ */
#define __need_size_t #define __need_size_t
#define __need_wchar_t #define __need_wchar_t
#define __need_NULL #define __need_NULL
#ifndef RC_INVOKED #ifndef RC_INVOKED
#include <stddef.h> #include <stddef.h>
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
#ifndef RC_INVOKED #ifndef RC_INVOKED
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* /*
* Prototypes of the ANSI Standard C library string functions. * Prototypes of the ANSI Standard C library string functions.
*/ */
void* memchr (const void*, int, size_t); void* memchr (const void*, int, size_t);
int memcmp (const void*, const void*, size_t); int memcmp (const void*, const void*, size_t);
void* memcpy (void*, const void*, size_t); void* memcpy (void*, const void*, size_t);
void* memmove (void*, const void*, size_t); void* memmove (void*, const void*, size_t);
void* memset (void*, int, size_t); void* memset (void*, int, size_t);
char* strcat (char*, const char*); char* strcat (char*, const char*);
char* strchr (const char*, int); char* strchr (const char*, int);
int strcmp (const char*, const char*); int strcmp (const char*, const char*);
int strcoll (const char*, const char*); /* Compare using locale */ int strcoll (const char*, const char*); /* Compare using locale */
char* strcpy (char*, const char*); char* strcpy (char*, const char*);
size_t strcspn (const char*, const char*); size_t strcspn (const char*, const char*);
char* strerror (int); /* NOTE: NOT an old name wrapper. */ char* strerror (int); /* NOTE: NOT an old name wrapper. */
char* _strerror (const char *); char* _strerror (const char *);
size_t strlen (const char*); size_t strlen (const char*);
char* strncat (char*, const char*, size_t); char* strncat (char*, const char*, size_t);
int strncmp (const char*, const char*, size_t); int strncmp (const char*, const char*, size_t);
char* strncpy (char*, const char*, size_t); char* strncpy (char*, const char*, size_t);
char* strpbrk (const char*, const char*); char* strpbrk (const char*, const char*);
char* strrchr (const char*, int); char* strrchr (const char*, int);
size_t strspn (const char*, const char*); size_t strspn (const char*, const char*);
char* strstr (const char*, const char*); char* strstr (const char*, const char*);
char* strtok (char*, const char*); char* strtok (char*, const char*);
size_t strxfrm (char*, const char*, size_t); size_t strxfrm (char*, const char*, size_t);
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
/* /*
* Extra non-ANSI functions provided by the CRTDLL library * Extra non-ANSI functions provided by the CRTDLL library
*/ */
void* _memccpy (void*, const void*, int, size_t); void* _memccpy (void*, const void*, int, size_t);
int _memicmp (const void*, const void*, size_t); int _memicmp (const void*, const void*, size_t);
char* _strdup (const char*); char* _strdup (const char*);
int _strcmpi (const char*, const char*); int _strcmpi (const char*, const char*);
int _stricmp (const char*, const char*); int _stricmp (const char*, const char*);
int _stricoll (const char*, const char*); int _stricoll (const char*, const char*);
char* _strlwr (char*); char* _strlwr (char*);
int _strnicmp (const char*, const char*, size_t); int _strnicmp (const char*, const char*, size_t);
char* _strnset (char*, int, size_t); char* _strnset (char*, int, size_t);
char* _strrev (char*); char* _strrev (char*);
char* _strset (char*, int); char* _strset (char*, int);
char* _strupr (char*); char* _strupr (char*);
void _swab (const char*, char*, size_t); void _swab (const char*, char*, size_t);
/* /*
* Multi-byte character functions * Multi-byte character functions
*/ */
unsigned char* _mbschr (unsigned char*, unsigned char*); unsigned char* _mbschr (unsigned char*, unsigned char*);
unsigned char* _mbsncat (unsigned char*, const unsigned char*, size_t); unsigned char* _mbsncat (unsigned char*, const unsigned char*, size_t);
unsigned char* _mbstok (unsigned char*, unsigned char*); unsigned char* _mbstok (unsigned char*, unsigned char*);
#ifdef __MSVCRT__ #ifdef __MSVCRT__
int _strncoll(const char*, const char*, size_t); int _strncoll(const char*, const char*, size_t);
int _strnicoll(const char*, const char*, size_t); int _strnicoll(const char*, const char*, size_t);
#endif #endif
#endif /* Not __STRICT_ANSI__ */ #endif /* Not __STRICT_ANSI__ */
/* /*
* Unicode versions of the standard calls. * Unicode versions of the standard calls.
*/ */
wchar_t* wcscat (wchar_t*, const wchar_t*); wchar_t* wcscat (wchar_t*, const wchar_t*);
wchar_t* wcschr (const wchar_t*, wchar_t); wchar_t* wcschr (const wchar_t*, wchar_t);
int wcscmp (const wchar_t*, const wchar_t*); int wcscmp (const wchar_t*, const wchar_t*);
int wcscoll (const wchar_t*, const wchar_t*); int wcscoll (const wchar_t*, const wchar_t*);
wchar_t* wcscpy (wchar_t*, const wchar_t*); wchar_t* wcscpy (wchar_t*, const wchar_t*);
size_t wcscspn (const wchar_t*, const wchar_t*); size_t wcscspn (const wchar_t*, const wchar_t*);
/* Note: No wcserror in CRTDLL. */ /* Note: No wcserror in CRTDLL. */
size_t wcslen (const wchar_t*); size_t wcslen (const wchar_t*);
wchar_t* wcsncat (wchar_t*, const wchar_t*, size_t); wchar_t* wcsncat (wchar_t*, const wchar_t*, size_t);
int wcsncmp(const wchar_t*, const wchar_t*, size_t); int wcsncmp(const wchar_t*, const wchar_t*, size_t);
wchar_t* wcsncpy(wchar_t*, const wchar_t*, size_t); wchar_t* wcsncpy(wchar_t*, const wchar_t*, size_t);
wchar_t* wcspbrk(const wchar_t*, const wchar_t*); wchar_t* wcspbrk(const wchar_t*, const wchar_t*);
wchar_t* wcsrchr(const wchar_t*, wchar_t); wchar_t* wcsrchr(const wchar_t*, wchar_t);
size_t wcsspn(const wchar_t*, const wchar_t*); size_t wcsspn(const wchar_t*, const wchar_t*);
wchar_t* wcsstr(const wchar_t*, const wchar_t*); wchar_t* wcsstr(const wchar_t*, const wchar_t*);
wchar_t* wcstok(wchar_t*, const wchar_t*); wchar_t* wcstok(wchar_t*, const wchar_t*);
size_t wcsxfrm(wchar_t*, const wchar_t*, size_t); size_t wcsxfrm(wchar_t*, const wchar_t*, size_t);
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
/* /*
* Unicode versions of non-ANSI functions provided by CRTDLL. * Unicode versions of non-ANSI functions provided by CRTDLL.
*/ */
/* NOTE: _wcscmpi not provided by CRTDLL, this define is for portability */ /* NOTE: _wcscmpi not provided by CRTDLL, this define is for portability */
#define _wcscmpi _wcsicmp #define _wcscmpi _wcsicmp
wchar_t* _wcsdup (wchar_t*); wchar_t* _wcsdup (wchar_t*);
int _wcsicmp (const wchar_t*, const wchar_t*); int _wcsicmp (const wchar_t*, const wchar_t*);
int _wcsicoll (const wchar_t*, const wchar_t*); int _wcsicoll (const wchar_t*, const wchar_t*);
wchar_t* _wcslwr (wchar_t*); wchar_t* _wcslwr (wchar_t*);
int _wcsnicmp (const wchar_t*, const wchar_t*, size_t); int _wcsnicmp (const wchar_t*, const wchar_t*, size_t);
wchar_t* _wcsnset (wchar_t*, wchar_t, size_t); wchar_t* _wcsnset (wchar_t*, wchar_t, size_t);
wchar_t* _wcsrev (wchar_t*); wchar_t* _wcsrev (wchar_t*);
wchar_t* _wcsset (wchar_t*, wchar_t); wchar_t* _wcsset (wchar_t*, wchar_t);
wchar_t* _wcsupr (wchar_t*); wchar_t* _wcsupr (wchar_t*);
#ifdef __MSVCRT__ #ifdef __MSVCRT__
int _wcsncoll(const wchar_t*, const wchar_t*, size_t); int _wcsncoll(const wchar_t*, const wchar_t*, size_t);
int _wcsnicoll(const wchar_t*, const wchar_t*, size_t); int _wcsnicoll(const wchar_t*, const wchar_t*, size_t);
#endif #endif
#endif /* Not __STRICT_ANSI__ */ #endif /* Not __STRICT_ANSI__ */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
/* /*
* Non-underscored versions of non-ANSI functions. They live in liboldnames.a * Non-underscored versions of non-ANSI functions. They live in liboldnames.a
* and provide a little extra portability. Also a few extra UNIX-isms like * and provide a little extra portability. Also a few extra UNIX-isms like
* strcasecmp. * strcasecmp.
*/ */
void* memccpy (void*, const void*, int, size_t); void* memccpy (void*, const void*, int, size_t);
int memicmp (const void*, const void*, size_t); int memicmp (const void*, const void*, size_t);
char* strdup (const char*); char* strdup (const char*);
int strcmpi (const char*, const char*); int strcmpi (const char*, const char*);
int stricmp (const char*, const char*); int stricmp (const char*, const char*);
int strcasecmp (const char*, const char*); int strcasecmp (const char*, const char*);
int stricoll (const char*, const char*); int stricoll (const char*, const char*);
char* strlwr (char*); char* strlwr (char*);
int strnicmp (const char*, const char*, size_t); int strnicmp (const char*, const char*, size_t);
int strncasecmp (const char*, const char*, size_t); int strncasecmp (const char*, const char*, size_t);
char* strnset (char*, int, size_t); char* strnset (char*, int, size_t);
char* strrev (char*); char* strrev (char*);
char* strset (char*, int); char* strset (char*, int);
char* strupr (char*); char* strupr (char*);
#ifndef _UWIN #ifndef _UWIN
void swab (const char*, char*, size_t); void swab (const char*, char*, size_t);
#endif /* _UWIN */ #endif /* _UWIN */
/* NOTE: There is no _wcscmpi, but this is for compatibility. */ /* NOTE: There is no _wcscmpi, but this is for compatibility. */
int wcscmpi (const wchar_t*, const wchar_t*); int wcscmpi (const wchar_t*, const wchar_t*);
wchar_t* wcsdup (wchar_t*); wchar_t* wcsdup (wchar_t*);
int wcsicmp (const wchar_t*, const wchar_t*); int wcsicmp (const wchar_t*, const wchar_t*);
int wcsicoll (const wchar_t*, const wchar_t*); int wcsicoll (const wchar_t*, const wchar_t*);
wchar_t* wcslwr (wchar_t*); wchar_t* wcslwr (wchar_t*);
int wcsnicmp (const wchar_t*, const wchar_t*, size_t); int wcsnicmp (const wchar_t*, const wchar_t*, size_t);
wchar_t* wcsnset (wchar_t*, wchar_t, size_t); wchar_t* wcsnset (wchar_t*, wchar_t, size_t);
wchar_t* wcsrev (wchar_t*); wchar_t* wcsrev (wchar_t*);
wchar_t* wcsset (wchar_t*, wchar_t); wchar_t* wcsset (wchar_t*, wchar_t);
wchar_t* wcsupr (wchar_t*); wchar_t* wcsupr (wchar_t*);
#endif /* Not _NO_OLDNAMES */ #endif /* Not _NO_OLDNAMES */
#endif /* Not strict ANSI */ #endif /* Not strict ANSI */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
#endif /* Not _STRING_H_ */ #endif /* Not _STRING_H_ */

View File

@ -1,8 +1,8 @@
/* /*
* This file is part of the Mingw32 package. * This file is part of the Mingw32 package.
* *
* This fcntl.h maps to the root fcntl.h * This fcntl.h maps to the root fcntl.h
*/ */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#include <fcntl.h> #include <fcntl.h>
#endif #endif

View File

@ -1,9 +1,9 @@
/* /*
* This file is part of the Mingw32 package. * This file is part of the Mingw32 package.
* *
* This file.h maps to the root fcntl.h * This file.h maps to the root fcntl.h
* TODO? * TODO?
*/ */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#include <fcntl.h> #include <fcntl.h>
#endif #endif

View File

@ -1,52 +1,52 @@
/* /*
* locking.h * locking.h
* *
* Constants for the mode parameter of the locking function. * Constants for the mode parameter of the locking function.
* *
* This file is part of the Mingw32 package. * This file is part of the Mingw32 package.
* *
* Contributors: * Contributors:
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp> * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
* *
* THIS SOFTWARE IS NOT COPYRIGHTED * THIS SOFTWARE IS NOT COPYRIGHTED
* *
* This source code is offered for use in the public domain. You may * This source code is offered for use in the public domain. You may
* use, modify or distribute it freely. * use, modify or distribute it freely.
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* $Author: bellard $ * $Author: bellard $
* $Date: 2005/04/14 23:49:21 $ * $Date: 2005/04/17 13:14:29 $
* *
*/ */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#ifndef _LOCKING_H_ #ifndef _LOCKING_H_
#define _LOCKING_H_ #define _LOCKING_H_
/* All the headers include this file. */ /* All the headers include this file. */
#include <_mingw.h> #include <_mingw.h>
#define _LK_UNLCK 0 /* Unlock */ #define _LK_UNLCK 0 /* Unlock */
#define _LK_LOCK 1 /* Lock */ #define _LK_LOCK 1 /* Lock */
#define _LK_NBLCK 2 /* Non-blocking lock */ #define _LK_NBLCK 2 /* Non-blocking lock */
#define _LK_RLCK 3 /* Lock for read only */ #define _LK_RLCK 3 /* Lock for read only */
#define _LK_NBRLCK 4 /* Non-blocking lock for read only */ #define _LK_NBRLCK 4 /* Non-blocking lock for read only */
#ifndef NO_OLDNAMES #ifndef NO_OLDNAMES
#define LK_UNLCK _LK_UNLCK #define LK_UNLCK _LK_UNLCK
#define LK_LOCK _LK_LOCK #define LK_LOCK _LK_LOCK
#define LK_NBLCK _LK_NBLCK #define LK_NBLCK _LK_NBLCK
#define LK_RLCK _LK_RLCK #define LK_RLCK _LK_RLCK
#define LK_NBRLCK _LK_NBRLCK #define LK_NBRLCK _LK_NBRLCK
#endif /* Not NO_OLDNAMES */ #endif /* Not NO_OLDNAMES */
#endif /* Not _LOCKING_H_ */ #endif /* Not _LOCKING_H_ */
#endif /* Not __STRICT_ANSI__ */ #endif /* Not __STRICT_ANSI__ */

View File

@ -1,190 +1,190 @@
/* /*
* stat.h * stat.h
* *
* Symbolic constants for opening and creating files, also stat, fstat and * Symbolic constants for opening and creating files, also stat, fstat and
* chmod functions. * chmod functions.
* *
* This file is part of the Mingw32 package. * This file is part of the Mingw32 package.
* *
* Contributors: * Contributors:
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp> * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
* *
* THIS SOFTWARE IS NOT COPYRIGHTED * THIS SOFTWARE IS NOT COPYRIGHTED
* *
* This source code is offered for use in the public domain. You may * This source code is offered for use in the public domain. You may
* use, modify or distribute it freely. * use, modify or distribute it freely.
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* $Author: bellard $ * $Author: bellard $
* $Date: 2005/04/14 23:49:21 $ * $Date: 2005/04/17 13:14:29 $
* *
*/ */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#ifndef _STAT_H_ #ifndef _STAT_H_
#define _STAT_H_ #define _STAT_H_
/* All the headers include this file. */ /* All the headers include this file. */
#include <_mingw.h> #include <_mingw.h>
#define __need_size_t #define __need_size_t
#define __need_wchar_t #define __need_wchar_t
#ifndef RC_INVOKED #ifndef RC_INVOKED
#include <stddef.h> #include <stddef.h>
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
#include <sys/types.h> #include <sys/types.h>
/* /*
* Constants for the stat st_mode member. * Constants for the stat st_mode member.
*/ */
#define _S_IFIFO 0x1000 /* FIFO */ #define _S_IFIFO 0x1000 /* FIFO */
#define _S_IFCHR 0x2000 /* Character */ #define _S_IFCHR 0x2000 /* Character */
#define _S_IFBLK 0x3000 /* Block: Is this ever set under w32? */ #define _S_IFBLK 0x3000 /* Block: Is this ever set under w32? */
#define _S_IFDIR 0x4000 /* Directory */ #define _S_IFDIR 0x4000 /* Directory */
#define _S_IFREG 0x8000 /* Regular */ #define _S_IFREG 0x8000 /* Regular */
#define _S_IFMT 0xF000 /* File type mask */ #define _S_IFMT 0xF000 /* File type mask */
#define _S_IEXEC 0x0040 #define _S_IEXEC 0x0040
#define _S_IWRITE 0x0080 #define _S_IWRITE 0x0080
#define _S_IREAD 0x0100 #define _S_IREAD 0x0100
#define _S_IRWXU (_S_IREAD | _S_IWRITE | _S_IEXEC) #define _S_IRWXU (_S_IREAD | _S_IWRITE | _S_IEXEC)
#define _S_IXUSR _S_IEXEC #define _S_IXUSR _S_IEXEC
#define _S_IWUSR _S_IWRITE #define _S_IWUSR _S_IWRITE
#define _S_IRUSR _S_IREAD #define _S_IRUSR _S_IREAD
#define _S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR) #define _S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR)
#define _S_ISFIFO(m) (((m) & _S_IFMT) == _S_IFIFO) #define _S_ISFIFO(m) (((m) & _S_IFMT) == _S_IFIFO)
#define _S_ISCHR(m) (((m) & _S_IFMT) == _S_IFCHR) #define _S_ISCHR(m) (((m) & _S_IFMT) == _S_IFCHR)
#define _S_ISBLK(m) (((m) & _S_IFMT) == _S_IFBLK) #define _S_ISBLK(m) (((m) & _S_IFMT) == _S_IFBLK)
#define _S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG) #define _S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
#define S_IFIFO _S_IFIFO #define S_IFIFO _S_IFIFO
#define S_IFCHR _S_IFCHR #define S_IFCHR _S_IFCHR
#define S_IFBLK _S_IFBLK #define S_IFBLK _S_IFBLK
#define S_IFDIR _S_IFDIR #define S_IFDIR _S_IFDIR
#define S_IFREG _S_IFREG #define S_IFREG _S_IFREG
#define S_IFMT _S_IFMT #define S_IFMT _S_IFMT
#define S_IEXEC _S_IEXEC #define S_IEXEC _S_IEXEC
#define S_IWRITE _S_IWRITE #define S_IWRITE _S_IWRITE
#define S_IREAD _S_IREAD #define S_IREAD _S_IREAD
#define S_IRWXU _S_IRWXU #define S_IRWXU _S_IRWXU
#define S_IXUSR _S_IXUSR #define S_IXUSR _S_IXUSR
#define S_IWUSR _S_IWUSR #define S_IWUSR _S_IWUSR
#define S_IRUSR _S_IRUSR #define S_IRUSR _S_IRUSR
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) #define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) #define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) #define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
#endif /* Not _NO_OLDNAMES */ #endif /* Not _NO_OLDNAMES */
#ifndef RC_INVOKED #ifndef RC_INVOKED
#ifndef _STAT_DEFINED #ifndef _STAT_DEFINED
/* /*
* The structure manipulated and returned by stat and fstat. * The structure manipulated and returned by stat and fstat.
* *
* NOTE: If called on a directory the values in the time fields are not only * NOTE: If called on a directory the values in the time fields are not only
* invalid, they will cause localtime et. al. to return NULL. And calling * invalid, they will cause localtime et. al. to return NULL. And calling
* asctime with a NULL pointer causes an Invalid Page Fault. So watch it! * asctime with a NULL pointer causes an Invalid Page Fault. So watch it!
*/ */
struct _stat struct _stat
{ {
_dev_t st_dev; /* Equivalent to drive number 0=A 1=B ... */ _dev_t st_dev; /* Equivalent to drive number 0=A 1=B ... */
_ino_t st_ino; /* Always zero ? */ _ino_t st_ino; /* Always zero ? */
_mode_t st_mode; /* See above constants */ _mode_t st_mode; /* See above constants */
short st_nlink; /* Number of links. */ short st_nlink; /* Number of links. */
short st_uid; /* User: Maybe significant on NT ? */ short st_uid; /* User: Maybe significant on NT ? */
short st_gid; /* Group: Ditto */ short st_gid; /* Group: Ditto */
_dev_t st_rdev; /* Seems useless (not even filled in) */ _dev_t st_rdev; /* Seems useless (not even filled in) */
_off_t st_size; /* File size in bytes */ _off_t st_size; /* File size in bytes */
time_t st_atime; /* Accessed date (always 00:00 hrs local time_t st_atime; /* Accessed date (always 00:00 hrs local
* on FAT) */ * on FAT) */
time_t st_mtime; /* Modified time */ time_t st_mtime; /* Modified time */
time_t st_ctime; /* Creation time */ time_t st_ctime; /* Creation time */
}; };
struct stat struct stat
{ {
_dev_t st_dev; /* Equivalent to drive number 0=A 1=B ... */ _dev_t st_dev; /* Equivalent to drive number 0=A 1=B ... */
_ino_t st_ino; /* Always zero ? */ _ino_t st_ino; /* Always zero ? */
_mode_t st_mode; /* See above constants */ _mode_t st_mode; /* See above constants */
short st_nlink; /* Number of links. */ short st_nlink; /* Number of links. */
short st_uid; /* User: Maybe significant on NT ? */ short st_uid; /* User: Maybe significant on NT ? */
short st_gid; /* Group: Ditto */ short st_gid; /* Group: Ditto */
_dev_t st_rdev; /* Seems useless (not even filled in) */ _dev_t st_rdev; /* Seems useless (not even filled in) */
_off_t st_size; /* File size in bytes */ _off_t st_size; /* File size in bytes */
time_t st_atime; /* Accessed date (always 00:00 hrs local time_t st_atime; /* Accessed date (always 00:00 hrs local
* on FAT) */ * on FAT) */
time_t st_mtime; /* Modified time */ time_t st_mtime; /* Modified time */
time_t st_ctime; /* Creation time */ time_t st_ctime; /* Creation time */
}; };
#if defined (__MSVCRT__) #if defined (__MSVCRT__)
struct _stati64 { struct _stati64 {
_dev_t st_dev; _dev_t st_dev;
_ino_t st_ino; _ino_t st_ino;
unsigned short st_mode; unsigned short st_mode;
short st_nlink; short st_nlink;
short st_uid; short st_uid;
short st_gid; short st_gid;
_dev_t st_rdev; _dev_t st_rdev;
__int64 st_size; __int64 st_size;
time_t st_atime; time_t st_atime;
time_t st_mtime; time_t st_mtime;
time_t st_ctime; time_t st_ctime;
}; };
#endif /* __MSVCRT__ */ #endif /* __MSVCRT__ */
#define _STAT_DEFINED #define _STAT_DEFINED
#endif /* _STAT_DEFINED */ #endif /* _STAT_DEFINED */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
int _fstat (int, struct _stat*); int _fstat (int, struct _stat*);
int _chmod (const char*, int); int _chmod (const char*, int);
int _stat (const char*, struct _stat*); int _stat (const char*, struct _stat*);
#if defined (__MSVCRT__) #if defined (__MSVCRT__)
int _fstati64(int, struct _stati64 *); int _fstati64(int, struct _stati64 *);
int _stati64(const char *, struct _stati64 *); int _stati64(const char *, struct _stati64 *);
#if !defined ( _WSTAT_DEFINED) /* also declared in wchar.h */ #if !defined ( _WSTAT_DEFINED) /* also declared in wchar.h */
int _wstat(const wchar_t*, struct _stat*); int _wstat(const wchar_t*, struct _stat*);
int _wstati64 (const wchar_t*, struct _stati64*); int _wstati64 (const wchar_t*, struct _stati64*);
#define _WSTAT_DEFINED #define _WSTAT_DEFINED
#endif /* _WSTAT_DEFIND */ #endif /* _WSTAT_DEFIND */
#endif /* __MSVCRT__ */ #endif /* __MSVCRT__ */
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
/* These functions live in liboldnames.a. */ /* These functions live in liboldnames.a. */
int fstat (int, struct stat*); int fstat (int, struct stat*);
int chmod (const char*, int); int chmod (const char*, int);
int stat (const char*, struct stat*); int stat (const char*, struct stat*);
#endif /* Not _NO_OLDNAMES */ #endif /* Not _NO_OLDNAMES */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
#endif /* Not _STAT_H_ */ #endif /* Not _STAT_H_ */
#endif /* Not __STRICT_ANSI__ */ #endif /* Not __STRICT_ANSI__ */

View File

@ -1,3 +1,3 @@
#include <time.h> #include <time.h>

View File

@ -1,82 +1,82 @@
/* /*
* timeb.h * timeb.h
* *
* Support for the UNIX System V ftime system call. * Support for the UNIX System V ftime system call.
* *
* This file is part of the Mingw32 package. * This file is part of the Mingw32 package.
* *
* Contributors: * Contributors:
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp> * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
* *
* THIS SOFTWARE IS NOT COPYRIGHTED * THIS SOFTWARE IS NOT COPYRIGHTED
* *
* This source code is offered for use in the public domain. You may * This source code is offered for use in the public domain. You may
* use, modify or distribute it freely. * use, modify or distribute it freely.
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* $Author: bellard $ * $Author: bellard $
* $Date: 2005/04/14 23:49:21 $ * $Date: 2005/04/17 13:14:29 $
* *
*/ */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#ifndef _TIMEB_H_ #ifndef _TIMEB_H_
#define _TIMEB_H_ #define _TIMEB_H_
/* All the headers include this file. */ /* All the headers include this file. */
#include <_mingw.h> #include <_mingw.h>
#ifndef RC_INVOKED #ifndef RC_INVOKED
/* /*
* TODO: Structure not tested. * TODO: Structure not tested.
*/ */
struct _timeb struct _timeb
{ {
long time; long time;
short millitm; short millitm;
short timezone; short timezone;
short dstflag; short dstflag;
}; };
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
/* /*
* TODO: Structure not tested. * TODO: Structure not tested.
*/ */
struct timeb struct timeb
{ {
long time; long time;
short millitm; short millitm;
short timezone; short timezone;
short dstflag; short dstflag;
}; };
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* TODO: Not tested. */ /* TODO: Not tested. */
void _ftime (struct _timeb*); void _ftime (struct _timeb*);
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
void ftime (struct timeb*); void ftime (struct timeb*);
#endif /* Not _NO_OLDNAMES */ #endif /* Not _NO_OLDNAMES */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
#endif /* Not _TIMEB_H_ */ #endif /* Not _TIMEB_H_ */
#endif /* Not __STRICT_ANSI__ */ #endif /* Not __STRICT_ANSI__ */

View File

@ -1,118 +1,118 @@
/* /*
* types.h * types.h
* *
* The definition of constants, data types and global variables. * The definition of constants, data types and global variables.
* *
* This file is part of the Mingw32 package. * This file is part of the Mingw32 package.
* *
* Contributors: * Contributors:
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp> * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
* Lots of types supplied by Pedro A. Aranda <paag@tid.es> * Lots of types supplied by Pedro A. Aranda <paag@tid.es>
* *
* THIS SOFTWARE IS NOT COPYRIGHTED * THIS SOFTWARE IS NOT COPYRIGHTED
* *
* This source code is offered for use in the public domain. You may * This source code is offered for use in the public domain. You may
* use, modify or distribute it freely. * use, modify or distribute it freely.
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRENTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRENTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warrenties of * DISCLAIMED. This includes but is not limited to warrenties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* $Author: bellard $ * $Author: bellard $
* $Date: 2005/04/14 23:49:21 $ * $Date: 2005/04/17 13:14:29 $
* *
*/ */
#ifndef _TYPES_H_ #ifndef _TYPES_H_
#define _TYPES_H_ #define _TYPES_H_
/* All the headers include this file. */ /* All the headers include this file. */
#include <_mingw.h> #include <_mingw.h>
#define __need_wchar_t #define __need_wchar_t
#define __need_size_t #define __need_size_t
#define __need_ptrdiff_t #define __need_ptrdiff_t
#ifndef RC_INVOKED #ifndef RC_INVOKED
#include <stddef.h> #include <stddef.h>
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
#ifndef RC_INVOKED #ifndef RC_INVOKED
#ifndef _TIME_T_DEFINED #ifndef _TIME_T_DEFINED
typedef long time_t; typedef long time_t;
#define _TIME_T_DEFINED #define _TIME_T_DEFINED
#endif #endif
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#ifndef _OFF_T_ #ifndef _OFF_T_
#define _OFF_T_ #define _OFF_T_
typedef long _off_t; typedef long _off_t;
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
typedef _off_t off_t; typedef _off_t off_t;
#endif #endif
#endif /* Not _OFF_T_ */ #endif /* Not _OFF_T_ */
#ifndef _DEV_T_ #ifndef _DEV_T_
#define _DEV_T_ #define _DEV_T_
#ifdef __MSVCRT__ #ifdef __MSVCRT__
typedef unsigned int _dev_t; typedef unsigned int _dev_t;
#else #else
typedef short _dev_t; typedef short _dev_t;
#endif #endif
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
typedef _dev_t dev_t; typedef _dev_t dev_t;
#endif #endif
#endif /* Not _DEV_T_ */ #endif /* Not _DEV_T_ */
#ifndef _INO_T_ #ifndef _INO_T_
#define _INO_T_ #define _INO_T_
typedef short _ino_t; typedef short _ino_t;
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
typedef _ino_t ino_t; typedef _ino_t ino_t;
#endif #endif
#endif /* Not _INO_T_ */ #endif /* Not _INO_T_ */
#ifndef _PID_T_ #ifndef _PID_T_
#define _PID_T_ #define _PID_T_
typedef int _pid_t; typedef int _pid_t;
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
typedef _pid_t pid_t; typedef _pid_t pid_t;
#endif #endif
#endif /* Not _PID_T_ */ #endif /* Not _PID_T_ */
#ifndef _MODE_T_ #ifndef _MODE_T_
#define _MODE_T_ #define _MODE_T_
typedef unsigned short _mode_t; typedef unsigned short _mode_t;
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
typedef _mode_t mode_t; typedef _mode_t mode_t;
#endif #endif
#endif /* Not _MODE_T_ */ #endif /* Not _MODE_T_ */
#ifndef _SIGSET_T_ #ifndef _SIGSET_T_
#define _SIGSET_T_ #define _SIGSET_T_
typedef int _sigset_t; typedef int _sigset_t;
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
typedef _sigset_t sigset_t; typedef _sigset_t sigset_t;
#endif #endif
#endif /* Not _SIGSET_T_ */ #endif /* Not _SIGSET_T_ */
#endif /* Not __STRICT_ANSI__ */ #endif /* Not __STRICT_ANSI__ */
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
#endif /* Not _TYPES_H_ */ #endif /* Not _TYPES_H_ */

View File

@ -1,9 +1,9 @@
/* /*
* This file is part of the Mingw32 package. * This file is part of the Mingw32 package.
* *
* unistd.h maps (roughly) to io.h * unistd.h maps (roughly) to io.h
*/ */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#include <io.h> #include <io.h>
#endif #endif

View File

@ -1,89 +1,89 @@
/* /*
* utime.h * utime.h
* *
* Support for the utime function. * Support for the utime function.
* *
* This file is part of the Mingw32 package. * This file is part of the Mingw32 package.
* *
* Contributors: * Contributors:
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp> * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
* *
* THIS SOFTWARE IS NOT COPYRIGHTED * THIS SOFTWARE IS NOT COPYRIGHTED
* *
* This source code is offered for use in the public domain. You may * This source code is offered for use in the public domain. You may
* use, modify or distribute it freely. * use, modify or distribute it freely.
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* $Author: bellard $ * $Author: bellard $
* $Date: 2005/04/14 23:49:21 $ * $Date: 2005/04/17 13:14:29 $
* *
*/ */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#ifndef _UTIME_H_ #ifndef _UTIME_H_
#define _UTIME_H_ #define _UTIME_H_
/* All the headers include this file. */ /* All the headers include this file. */
#include <_mingw.h> #include <_mingw.h>
#define __need_wchar_t #define __need_wchar_t
#define __need_size_t #define __need_size_t
#ifndef RC_INVOKED #ifndef RC_INVOKED
#include <stddef.h> #include <stddef.h>
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
#include <sys/types.h> #include <sys/types.h>
#ifndef RC_INVOKED #ifndef RC_INVOKED
/* /*
* Structure used by _utime function. * Structure used by _utime function.
*/ */
struct _utimbuf struct _utimbuf
{ {
time_t actime; /* Access time */ time_t actime; /* Access time */
time_t modtime; /* Modification time */ time_t modtime; /* Modification time */
}; };
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
/* NOTE: Must be the same as _utimbuf above. */ /* NOTE: Must be the same as _utimbuf above. */
struct utimbuf struct utimbuf
{ {
time_t actime; time_t actime;
time_t modtime; time_t modtime;
}; };
#endif /* Not _NO_OLDNAMES */ #endif /* Not _NO_OLDNAMES */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
int _utime (const char*, struct _utimbuf*); int _utime (const char*, struct _utimbuf*);
int _futime (int, struct _utimbuf*); int _futime (int, struct _utimbuf*);
/* The wide character version, only available for MSVCRT versions of the /* The wide character version, only available for MSVCRT versions of the
* C runtime library. */ * C runtime library. */
#ifdef __MSVCRT__ #ifdef __MSVCRT__
int _wutime (const wchar_t*, struct _utimbuf*); int _wutime (const wchar_t*, struct _utimbuf*);
#endif /* MSVCRT runtime */ #endif /* MSVCRT runtime */
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
int utime (const char*, struct utimbuf*); int utime (const char*, struct utimbuf*);
#endif /* Not _NO_OLDNAMES */ #endif /* Not _NO_OLDNAMES */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
#endif /* Not _UTIME_H_ */ #endif /* Not _UTIME_H_ */
#endif /* Not __STRICT_ANSI__ */ #endif /* Not __STRICT_ANSI__ */

View File

@ -1,367 +1,367 @@
/* /*
* tchar.h * tchar.h
* *
* Unicode mapping layer for the standard C library. By including this * Unicode mapping layer for the standard C library. By including this
* file and using the 't' names for string functions * file and using the 't' names for string functions
* (eg. _tprintf) you can make code which can be easily adapted to both * (eg. _tprintf) you can make code which can be easily adapted to both
* Unicode and non-unicode environments. In a unicode enabled compile define * Unicode and non-unicode environments. In a unicode enabled compile define
* _UNICODE before including tchar.h, otherwise the standard non-unicode * _UNICODE before including tchar.h, otherwise the standard non-unicode
* library functions will be used. * library functions will be used.
* *
* Note that you still need to include string.h or stdlib.h etc. to define * Note that you still need to include string.h or stdlib.h etc. to define
* the appropriate functions. Also note that there are several defines * the appropriate functions. Also note that there are several defines
* included for non-ANSI functions which are commonly available (but using * included for non-ANSI functions which are commonly available (but using
* the convention of prepending an underscore to non-ANSI library function * the convention of prepending an underscore to non-ANSI library function
* names). * names).
* *
* This file is part of the Mingw32 package. * This file is part of the Mingw32 package.
* *
* Contributors: * Contributors:
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp> * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
* *
* THIS SOFTWARE IS NOT COPYRIGHTED * THIS SOFTWARE IS NOT COPYRIGHTED
* *
* This source code is offered for use in the public domain. You may * This source code is offered for use in the public domain. You may
* use, modify or distribute it freely. * use, modify or distribute it freely.
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* $Author: bellard $ * $Author: bellard $
* $Date: 2005/04/14 23:49:21 $ * $Date: 2005/04/17 13:14:29 $
* *
*/ */
#ifndef _TCHAR_H_ #ifndef _TCHAR_H_
#define _TCHAR_H_ #define _TCHAR_H_
/* All the headers include this file. */ /* All the headers include this file. */
#include <_mingw.h> #include <_mingw.h>
/* /*
* NOTE: This tests _UNICODE, which is different from the UNICODE define * NOTE: This tests _UNICODE, which is different from the UNICODE define
* used to differentiate Win32 API calls. * used to differentiate Win32 API calls.
*/ */
#ifdef _UNICODE #ifdef _UNICODE
/* /*
* Use TCHAR instead of char or wchar_t. It will be appropriately translated * Use TCHAR instead of char or wchar_t. It will be appropriately translated
* if _UNICODE is correctly defined (or not). * if _UNICODE is correctly defined (or not).
*/ */
#ifndef _TCHAR_DEFINED #ifndef _TCHAR_DEFINED
#ifndef RC_INVOKED #ifndef RC_INVOKED
typedef wchar_t TCHAR; typedef wchar_t TCHAR;
typedef wchar_t _TCHAR; typedef wchar_t _TCHAR;
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
#define _TCHAR_DEFINED #define _TCHAR_DEFINED
#endif #endif
/* /*
* __TEXT is a private macro whose specific use is to force the expansion of a * __TEXT is a private macro whose specific use is to force the expansion of a
* macro passed as an argument to the macros _T or _TEXT. DO NOT use this * macro passed as an argument to the macros _T or _TEXT. DO NOT use this
* macro within your programs. It's name and function could change without * macro within your programs. It's name and function could change without
* notice. * notice.
*/ */
#define __TEXT(x) L##x #define __TEXT(x) L##x
/* for porting from other Windows compilers */ /* for porting from other Windows compilers */
#if 0 // no wide startup module #if 0 // no wide startup module
#define _tmain wmain #define _tmain wmain
#define _tWinMain wWinMain #define _tWinMain wWinMain
#define _tenviron _wenviron #define _tenviron _wenviron
#define __targv __wargv #define __targv __wargv
#endif #endif
/* /*
* Unicode functions * Unicode functions
*/ */
#define _tprintf wprintf #define _tprintf wprintf
#define _ftprintf fwprintf #define _ftprintf fwprintf
#define _stprintf swprintf #define _stprintf swprintf
#define _sntprintf _snwprintf #define _sntprintf _snwprintf
#define _vtprintf vwprintf #define _vtprintf vwprintf
#define _vftprintf vfwprintf #define _vftprintf vfwprintf
#define _vstprintf vswprintf #define _vstprintf vswprintf
#define _vsntprintf _vsnwprintf #define _vsntprintf _vsnwprintf
#define _tscanf wscanf #define _tscanf wscanf
#define _ftscanf fwscanf #define _ftscanf fwscanf
#define _stscanf swscanf #define _stscanf swscanf
#define _fgettc fgetwc #define _fgettc fgetwc
#define _fgettchar _fgetwchar #define _fgettchar _fgetwchar
#define _fgetts fgetws #define _fgetts fgetws
#define _fputtc fputwc #define _fputtc fputwc
#define _fputtchar _fputwchar #define _fputtchar _fputwchar
#define _fputts fputws #define _fputts fputws
#define _gettc getwc #define _gettc getwc
#define _getts getws #define _getts getws
#define _puttc putwc #define _puttc putwc
#define _putts putws #define _putts putws
#define _ungettc ungetwc #define _ungettc ungetwc
#define _tcstod wcstod #define _tcstod wcstod
#define _tcstol wcstol #define _tcstol wcstol
#define _tcstoul wcstoul #define _tcstoul wcstoul
#define _itot _itow #define _itot _itow
#define _ltot _ltow #define _ltot _ltow
#define _ultot _ultow #define _ultot _ultow
#define _ttoi _wtoi #define _ttoi _wtoi
#define _ttol _wtol #define _ttol _wtol
#define _tcscat wcscat #define _tcscat wcscat
#define _tcschr wcschr #define _tcschr wcschr
#define _tcscmp wcscmp #define _tcscmp wcscmp
#define _tcscpy wcscpy #define _tcscpy wcscpy
#define _tcscspn wcscspn #define _tcscspn wcscspn
#define _tcslen wcslen #define _tcslen wcslen
#define _tcsncat wcsncat #define _tcsncat wcsncat
#define _tcsncmp wcsncmp #define _tcsncmp wcsncmp
#define _tcsncpy wcsncpy #define _tcsncpy wcsncpy
#define _tcspbrk wcspbrk #define _tcspbrk wcspbrk
#define _tcsrchr wcsrchr #define _tcsrchr wcsrchr
#define _tcsspn wcsspn #define _tcsspn wcsspn
#define _tcsstr wcsstr #define _tcsstr wcsstr
#define _tcstok wcstok #define _tcstok wcstok
#define _tcsdup _wcsdup #define _tcsdup _wcsdup
#define _tcsicmp _wcsicmp #define _tcsicmp _wcsicmp
#define _tcsnicmp _wcsnicmp #define _tcsnicmp _wcsnicmp
#define _tcsnset _wcsnset #define _tcsnset _wcsnset
#define _tcsrev _wcsrev #define _tcsrev _wcsrev
#define _tcsset _wcsset #define _tcsset _wcsset
#define _tcslwr _wcslwr #define _tcslwr _wcslwr
#define _tcsupr _wcsupr #define _tcsupr _wcsupr
#define _tcsxfrm wcsxfrm #define _tcsxfrm wcsxfrm
#define _tcscoll wcscoll #define _tcscoll wcscoll
#define _tcsicoll _wcsicoll #define _tcsicoll _wcsicoll
#define _istalpha iswalpha #define _istalpha iswalpha
#define _istupper iswupper #define _istupper iswupper
#define _istlower iswlower #define _istlower iswlower
#define _istdigit iswdigit #define _istdigit iswdigit
#define _istxdigit iswxdigit #define _istxdigit iswxdigit
#define _istspace iswspace #define _istspace iswspace
#define _istpunct iswpunct #define _istpunct iswpunct
#define _istalnum iswalnum #define _istalnum iswalnum
#define _istprint iswprint #define _istprint iswprint
#define _istgraph iswgraph #define _istgraph iswgraph
#define _istcntrl iswcntrl #define _istcntrl iswcntrl
#define _istascii iswascii #define _istascii iswascii
#define _totupper towupper #define _totupper towupper
#define _totlower towlower #define _totlower towlower
#define _tcsftime wcsftime #define _tcsftime wcsftime
/* Macro functions */ /* Macro functions */
#define _tcsdec _wcsdec #define _tcsdec _wcsdec
#define _tcsinc _wcsinc #define _tcsinc _wcsinc
#define _tcsnbcnt _wcsncnt #define _tcsnbcnt _wcsncnt
#define _tcsnccnt _wcsncnt #define _tcsnccnt _wcsncnt
#define _tcsnextc _wcsnextc #define _tcsnextc _wcsnextc
#define _tcsninc _wcsninc #define _tcsninc _wcsninc
#define _tcsspnp _wcsspnp #define _tcsspnp _wcsspnp
#define _wcsdec(_wcs1, _wcs2) ((_wcs1)>=(_wcs2) ? NULL : (_wcs2)-1) #define _wcsdec(_wcs1, _wcs2) ((_wcs1)>=(_wcs2) ? NULL : (_wcs2)-1)
#define _wcsinc(_wcs) ((_wcs)+1) #define _wcsinc(_wcs) ((_wcs)+1)
#define _wcsnextc(_wcs) ((unsigned int) *(_wcs)) #define _wcsnextc(_wcs) ((unsigned int) *(_wcs))
#define _wcsninc(_wcs, _inc) (((_wcs)+(_inc))) #define _wcsninc(_wcs, _inc) (((_wcs)+(_inc)))
#define _wcsncnt(_wcs, _cnt) ((wcslen(_wcs)>_cnt) ? _count : wcslen(_wcs)) #define _wcsncnt(_wcs, _cnt) ((wcslen(_wcs)>_cnt) ? _count : wcslen(_wcs))
#define _wcsspnp(_wcs1, _wcs2) ((*((_wcs1)+wcsspn(_wcs1,_wcs2))) ? ((_wcs1)+wcsspn(_wcs1,_wcs2)) : NULL) #define _wcsspnp(_wcs1, _wcs2) ((*((_wcs1)+wcsspn(_wcs1,_wcs2))) ? ((_wcs1)+wcsspn(_wcs1,_wcs2)) : NULL)
#if 1 // defined __MSVCRT__ #if 1 // defined __MSVCRT__
/* /*
* These wide functions not in crtdll.dll. * These wide functions not in crtdll.dll.
* Define macros anyway so that _wfoo rather than _tfoo is undefined * Define macros anyway so that _wfoo rather than _tfoo is undefined
*/ */
#define _ttoi64 _wtoi64 #define _ttoi64 _wtoi64
#define _i64tot _i64tow #define _i64tot _i64tow
#define _ui64tot _ui64tow #define _ui64tot _ui64tow
#define _tasctime _wasctime #define _tasctime _wasctime
#define _tctime _wctime #define _tctime _wctime
#define _tstrdate _wstrdate #define _tstrdate _wstrdate
#define _tstrtime _wstrtime #define _tstrtime _wstrtime
#define _tutime _wutime #define _tutime _wutime
#define _tcsnccoll _wcsncoll #define _tcsnccoll _wcsncoll
#define _tcsncoll _wcsncoll #define _tcsncoll _wcsncoll
#define _tcsncicoll _wcsnicoll #define _tcsncicoll _wcsnicoll
#define _tcsnicoll _wcsnicoll #define _tcsnicoll _wcsnicoll
#define _taccess _waccess #define _taccess _waccess
#define _tchmod _wchmod #define _tchmod _wchmod
#define _tcreat _wcreat #define _tcreat _wcreat
#define _tfindfirst _wfindfirst #define _tfindfirst _wfindfirst
#define _tfindnext _wfindnext #define _tfindnext _wfindnext
#define _tfopen _wfopen #define _tfopen _wfopen
#define _tgetenv _wgetenv #define _tgetenv _wgetenv
#define _tmktemp _wmktemp #define _tmktemp _wmktemp
#define _topen _wopen #define _topen _wopen
#define _tremove _wremove #define _tremove _wremove
#define _trename _wrename #define _trename _wrename
#define _tsopen _wsopen #define _tsopen _wsopen
#define _tsetlocale _wsetlocale #define _tsetlocale _wsetlocale
#define _tunlink _wunlink #define _tunlink _wunlink
#define _tfinddata_t _wfinddata_t #define _tfinddata_t _wfinddata_t
#define _tfindfirsti64 _wfindfirsti64 #define _tfindfirsti64 _wfindfirsti64
#define _tfindnexti64 _wfindnexti64 #define _tfindnexti64 _wfindnexti64
#define _tfinddatai64_t _wfinddatai64_t #define _tfinddatai64_t _wfinddatai64_t
#endif /* __MSVCRT__ */ #endif /* __MSVCRT__ */
#else /* Not _UNICODE */ #else /* Not _UNICODE */
/* /*
* TCHAR, the type you should use instead of char. * TCHAR, the type you should use instead of char.
*/ */
#ifndef _TCHAR_DEFINED #ifndef _TCHAR_DEFINED
#ifndef RC_INVOKED #ifndef RC_INVOKED
typedef char TCHAR; typedef char TCHAR;
typedef char _TCHAR; typedef char _TCHAR;
#endif #endif
#define _TCHAR_DEFINED #define _TCHAR_DEFINED
#endif #endif
/* /*
* __TEXT is a private macro whose specific use is to force the expansion of a * __TEXT is a private macro whose specific use is to force the expansion of a
* macro passed as an argument to the macros _T or _TEXT. DO NOT use this * macro passed as an argument to the macros _T or _TEXT. DO NOT use this
* macro within your programs. It's name and function could change without * macro within your programs. It's name and function could change without
* notice. * notice.
*/ */
#define __TEXT(x) x #define __TEXT(x) x
/* for porting from other Windows compilers */ /* for porting from other Windows compilers */
#define _tmain main #define _tmain main
#define _tWinMain WinMain #define _tWinMain WinMain
#define _tenviron _environ #define _tenviron _environ
#define __targv __argv #define __targv __argv
/* /*
* Non-unicode (standard) functions * Non-unicode (standard) functions
*/ */
#define _tprintf printf #define _tprintf printf
#define _ftprintf fprintf #define _ftprintf fprintf
#define _stprintf sprintf #define _stprintf sprintf
#define _sntprintf _snprintf #define _sntprintf _snprintf
#define _vtprintf vprintf #define _vtprintf vprintf
#define _vftprintf vfprintf #define _vftprintf vfprintf
#define _vstprintf vsprintf #define _vstprintf vsprintf
#define _vsntprintf _vsnprintf #define _vsntprintf _vsnprintf
#define _tscanf scanf #define _tscanf scanf
#define _ftscanf fscanf #define _ftscanf fscanf
#define _stscanf sscanf #define _stscanf sscanf
#define _fgettc fgetc #define _fgettc fgetc
#define _fgettchar _fgetchar #define _fgettchar _fgetchar
#define _fgetts fgets #define _fgetts fgets
#define _fputtc fputc #define _fputtc fputc
#define _fputtchar _fputchar #define _fputtchar _fputchar
#define _fputts fputs #define _fputts fputs
#define _tfopen fopen #define _tfopen fopen
#define _tgetenv getenv #define _tgetenv getenv
#define _gettc getc #define _gettc getc
#define _getts gets #define _getts gets
#define _puttc putc #define _puttc putc
#define _putts puts #define _putts puts
#define _ungettc ungetc #define _ungettc ungetc
#define _tcstod strtod #define _tcstod strtod
#define _tcstol strtol #define _tcstol strtol
#define _tcstoul strtoul #define _tcstoul strtoul
#define _itot _itoa #define _itot _itoa
#define _ltot _ltoa #define _ltot _ltoa
#define _ultot _ultoa #define _ultot _ultoa
#define _ttoi atoi #define _ttoi atoi
#define _ttol atol #define _ttol atol
#define _tcscat strcat #define _tcscat strcat
#define _tcschr strchr #define _tcschr strchr
#define _tcscmp strcmp #define _tcscmp strcmp
#define _tcscpy strcpy #define _tcscpy strcpy
#define _tcscspn strcspn #define _tcscspn strcspn
#define _tcslen strlen #define _tcslen strlen
#define _tcsncat strncat #define _tcsncat strncat
#define _tcsncmp strncmp #define _tcsncmp strncmp
#define _tcsncpy strncpy #define _tcsncpy strncpy
#define _tcspbrk strpbrk #define _tcspbrk strpbrk
#define _tcsrchr strrchr #define _tcsrchr strrchr
#define _tcsspn strspn #define _tcsspn strspn
#define _tcsstr strstr #define _tcsstr strstr
#define _tcstok strtok #define _tcstok strtok
#define _tcsdup _strdup #define _tcsdup _strdup
#define _tcsicmp _stricmp #define _tcsicmp _stricmp
#define _tcsnicmp _strnicmp #define _tcsnicmp _strnicmp
#define _tcsnset _strnset #define _tcsnset _strnset
#define _tcsrev _strrev #define _tcsrev _strrev
#define _tcsset _strset #define _tcsset _strset
#define _tcslwr _strlwr #define _tcslwr _strlwr
#define _tcsupr _strupr #define _tcsupr _strupr
#define _tcsxfrm strxfrm #define _tcsxfrm strxfrm
#define _tcscoll strcoll #define _tcscoll strcoll
#define _tcsicoll _stricoll #define _tcsicoll _stricoll
#define _istalpha isalpha #define _istalpha isalpha
#define _istupper isupper #define _istupper isupper
#define _istlower islower #define _istlower islower
#define _istdigit isdigit #define _istdigit isdigit
#define _istxdigit isxdigit #define _istxdigit isxdigit
#define _istspace isspace #define _istspace isspace
#define _istpunct ispunct #define _istpunct ispunct
#define _istalnum isalnum #define _istalnum isalnum
#define _istprint isprint #define _istprint isprint
#define _istgraph isgraph #define _istgraph isgraph
#define _istcntrl iscntrl #define _istcntrl iscntrl
#define _istascii isascii #define _istascii isascii
#define _totupper toupper #define _totupper toupper
#define _totlower tolower #define _totlower tolower
#define _tasctime asctime #define _tasctime asctime
#define _tctime ctime #define _tctime ctime
#define _tstrdate _strdate #define _tstrdate _strdate
#define _tstrtime _strtime #define _tstrtime _strtime
#define _tutime _utime #define _tutime _utime
#define _tcsftime strftime #define _tcsftime strftime
/* Macro functions */ /* Macro functions */
#define _tcsdec _strdec #define _tcsdec _strdec
#define _tcsinc _strinc #define _tcsinc _strinc
#define _tcsnbcnt _strncnt #define _tcsnbcnt _strncnt
#define _tcsnccnt _strncnt #define _tcsnccnt _strncnt
#define _tcsnextc _strnextc #define _tcsnextc _strnextc
#define _tcsninc _strninc #define _tcsninc _strninc
#define _tcsspnp _strspnp #define _tcsspnp _strspnp
#define _strdec(_str1, _str2) ((_str1)>=(_str2) ? NULL : (_str2)-1) #define _strdec(_str1, _str2) ((_str1)>=(_str2) ? NULL : (_str2)-1)
#define _strinc(_str) ((_str)+1) #define _strinc(_str) ((_str)+1)
#define _strnextc(_str) ((unsigned int) *(_str)) #define _strnextc(_str) ((unsigned int) *(_str))
#define _strninc(_str, _inc) (((_str)+(_inc))) #define _strninc(_str, _inc) (((_str)+(_inc)))
#define _strncnt(_str, _cnt) ((strlen(_str)>_cnt) ? _count : strlen(_str)) #define _strncnt(_str, _cnt) ((strlen(_str)>_cnt) ? _count : strlen(_str))
#define _strspnp(_str1, _str2) ((*((_str1)+strspn(_str1,_str2))) ? ((_str1)+strspn(_str1,_str2)) : NULL) #define _strspnp(_str1, _str2) ((*((_str1)+strspn(_str1,_str2))) ? ((_str1)+strspn(_str1,_str2)) : NULL)
#define _tchmod _chmod #define _tchmod _chmod
#define _tcreat _creat #define _tcreat _creat
#define _tfindfirst _findfirst #define _tfindfirst _findfirst
#define _tfindnext _findnext #define _tfindnext _findnext
#define _tmktemp _mktemp #define _tmktemp _mktemp
#define _topen _open #define _topen _open
#define _taccess _access #define _taccess _access
#define _tremove remove #define _tremove remove
#define _trename rename #define _trename rename
#define _tsopen _sopen #define _tsopen _sopen
#define _tsetlocale setlocale #define _tsetlocale setlocale
#define _tunlink _unlink #define _tunlink _unlink
#define _tfinddata_t _finddata_t #define _tfinddata_t _finddata_t
#if 1 // defined __MSVCRT__ #if 1 // defined __MSVCRT__
/* Not in crtdll.dll. Define macros anyway? */ /* Not in crtdll.dll. Define macros anyway? */
#define _ttoi64 _atoi64 #define _ttoi64 _atoi64
#define _i64tot _i64toa #define _i64tot _i64toa
#define _ui64tot _ui64toa #define _ui64tot _ui64toa
#define _tcsnccoll _strncoll #define _tcsnccoll _strncoll
#define _tcsncoll _strncoll #define _tcsncoll _strncoll
#define _tcsncicoll _strnicoll #define _tcsncicoll _strnicoll
#define _tcsnicoll _strnicoll #define _tcsnicoll _strnicoll
#define _tfindfirsti64 _findfirsti64 #define _tfindfirsti64 _findfirsti64
#define _tfindnexti64 _findnexti64 #define _tfindnexti64 _findnexti64
#define _tfinddatai64_t _finddatai64_t #define _tfinddatai64_t _finddatai64_t
#endif /* __MSVCRT__ */ #endif /* __MSVCRT__ */
#endif /* Not _UNICODE */ #endif /* Not _UNICODE */
/* /*
* UNICODE a constant string when _UNICODE is defined else returns the string * UNICODE a constant string when _UNICODE is defined else returns the string
* unmodified. Also defined in w32api/winnt.h. * unmodified. Also defined in w32api/winnt.h.
*/ */
#define _TEXT(x) __TEXT(x) #define _TEXT(x) __TEXT(x)
#define _T(x) __TEXT(x) #define _T(x) __TEXT(x)
#endif /* Not _TCHAR_H_ */ #endif /* Not _TCHAR_H_ */

View File

@ -1,219 +1,219 @@
/* /*
* time.h * time.h
* *
* Date and time functions and types. * Date and time functions and types.
* *
* This file is part of the Mingw32 package. * This file is part of the Mingw32 package.
* *
* Contributors: * Contributors:
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp> * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
* *
* THIS SOFTWARE IS NOT COPYRIGHTED * THIS SOFTWARE IS NOT COPYRIGHTED
* *
* This source code is offered for use in the public domain. You may * This source code is offered for use in the public domain. You may
* use, modify or distribute it freely. * use, modify or distribute it freely.
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* $Author: bellard $ * $Author: bellard $
* $Date: 2005/04/14 23:49:21 $ * $Date: 2005/04/17 13:14:29 $
* *
*/ */
#ifndef _TIME_H_ #ifndef _TIME_H_
#define _TIME_H_ #define _TIME_H_
/* All the headers include this file. */ /* All the headers include this file. */
#include <_mingw.h> #include <_mingw.h>
#define __need_wchar_t #define __need_wchar_t
#define __need_size_t #define __need_size_t
#ifndef RC_INVOKED #ifndef RC_INVOKED
#include <stddef.h> #include <stddef.h>
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
/* /*
* Need a definition of time_t. * Need a definition of time_t.
*/ */
#include <sys/types.h> #include <sys/types.h>
/* /*
* Number of clock ticks per second. A clock tick is the unit by which * Number of clock ticks per second. A clock tick is the unit by which
* processor time is measured and is returned by 'clock'. * processor time is measured and is returned by 'clock'.
*/ */
#define CLOCKS_PER_SEC ((clock_t)1000) #define CLOCKS_PER_SEC ((clock_t)1000)
#define CLK_TCK CLOCKS_PER_SEC #define CLK_TCK CLOCKS_PER_SEC
#ifndef RC_INVOKED #ifndef RC_INVOKED
/* /*
* A type for storing the current time and date. This is the number of * A type for storing the current time and date. This is the number of
* seconds since midnight Jan 1, 1970. * seconds since midnight Jan 1, 1970.
* NOTE: Normally this is defined by the above include of sys/types.h * NOTE: Normally this is defined by the above include of sys/types.h
*/ */
#ifndef _TIME_T_DEFINED #ifndef _TIME_T_DEFINED
typedef long time_t; typedef long time_t;
#define _TIME_T_DEFINED #define _TIME_T_DEFINED
#endif #endif
/* /*
* A type for measuring processor time (in clock ticks). * A type for measuring processor time (in clock ticks).
*/ */
#ifndef _CLOCK_T_DEFINED #ifndef _CLOCK_T_DEFINED
typedef long clock_t; typedef long clock_t;
#define _CLOCK_T_DEFINED #define _CLOCK_T_DEFINED
#endif #endif
/* /*
* A structure for storing all kinds of useful information about the * A structure for storing all kinds of useful information about the
* current (or another) time. * current (or another) time.
*/ */
struct tm struct tm
{ {
int tm_sec; /* Seconds: 0-59 (K&R says 0-61?) */ int tm_sec; /* Seconds: 0-59 (K&R says 0-61?) */
int tm_min; /* Minutes: 0-59 */ int tm_min; /* Minutes: 0-59 */
int tm_hour; /* Hours since midnight: 0-23 */ int tm_hour; /* Hours since midnight: 0-23 */
int tm_mday; /* Day of the month: 1-31 */ int tm_mday; /* Day of the month: 1-31 */
int tm_mon; /* Months *since* january: 0-11 */ int tm_mon; /* Months *since* january: 0-11 */
int tm_year; /* Years since 1900 */ int tm_year; /* Years since 1900 */
int tm_wday; /* Days since Sunday (0-6) */ int tm_wday; /* Days since Sunday (0-6) */
int tm_yday; /* Days since Jan. 1: 0-365 */ int tm_yday; /* Days since Jan. 1: 0-365 */
int tm_isdst; /* +1 Daylight Savings Time, 0 No DST, int tm_isdst; /* +1 Daylight Savings Time, 0 No DST,
* -1 don't know */ * -1 don't know */
}; };
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
clock_t clock (void); clock_t clock (void);
time_t time (time_t*); time_t time (time_t*);
double difftime (time_t, time_t); double difftime (time_t, time_t);
time_t mktime (struct tm*); time_t mktime (struct tm*);
/* /*
* These functions write to and return pointers to static buffers that may * These functions write to and return pointers to static buffers that may
* be overwritten by other function calls. Yikes! * be overwritten by other function calls. Yikes!
* *
* NOTE: localtime, and perhaps the others of the four functions grouped * NOTE: localtime, and perhaps the others of the four functions grouped
* below may return NULL if their argument is not 'acceptable'. Also note * below may return NULL if their argument is not 'acceptable'. Also note
* that calling asctime with a NULL pointer will produce an Invalid Page * that calling asctime with a NULL pointer will produce an Invalid Page
* Fault and crap out your program. Guess how I know. Hint: stat called on * Fault and crap out your program. Guess how I know. Hint: stat called on
* a directory gives 'invalid' times in st_atime etc... * a directory gives 'invalid' times in st_atime etc...
*/ */
char* asctime (const struct tm*); char* asctime (const struct tm*);
char* ctime (const time_t*); char* ctime (const time_t*);
struct tm* gmtime (const time_t*); struct tm* gmtime (const time_t*);
struct tm* localtime (const time_t*); struct tm* localtime (const time_t*);
size_t strftime (char*, size_t, const char*, const struct tm*); size_t strftime (char*, size_t, const char*, const struct tm*);
size_t wcsftime (wchar_t*, size_t, const wchar_t*, const struct tm*); size_t wcsftime (wchar_t*, size_t, const wchar_t*, const struct tm*);
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
extern void _tzset (void); extern void _tzset (void);
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
extern void tzset (void); extern void tzset (void);
#endif #endif
size_t strftime(char*, size_t, const char*, const struct tm*); size_t strftime(char*, size_t, const char*, const struct tm*);
char* _strdate(char*); char* _strdate(char*);
char* _strtime(char*); char* _strtime(char*);
#endif /* Not __STRICT_ANSI__ */ #endif /* Not __STRICT_ANSI__ */
/* /*
* _daylight: non zero if daylight savings time is used. * _daylight: non zero if daylight savings time is used.
* _timezone: difference in seconds between GMT and local time. * _timezone: difference in seconds between GMT and local time.
* _tzname: standard/daylight savings time zone names (an array with two * _tzname: standard/daylight savings time zone names (an array with two
* elements). * elements).
*/ */
#ifdef __MSVCRT__ #ifdef __MSVCRT__
/* These are for compatibility with pre-VC 5.0 suppied MSVCRT. */ /* These are for compatibility with pre-VC 5.0 suppied MSVCRT. */
extern int* __p__daylight (void); extern int* __p__daylight (void);
extern long* __p__timezone (void); extern long* __p__timezone (void);
extern char** __p__tzname (void); extern char** __p__tzname (void);
__MINGW_IMPORT int _daylight; __MINGW_IMPORT int _daylight;
__MINGW_IMPORT long _timezone; __MINGW_IMPORT long _timezone;
__MINGW_IMPORT char *_tzname[2]; __MINGW_IMPORT char *_tzname[2];
#else /* not __MSVCRT (ie. crtdll) */ #else /* not __MSVCRT (ie. crtdll) */
#ifndef __DECLSPEC_SUPPORTED #ifndef __DECLSPEC_SUPPORTED
extern int* __imp__daylight_dll; extern int* __imp__daylight_dll;
extern long* __imp__timezone_dll; extern long* __imp__timezone_dll;
extern char** __imp__tzname; extern char** __imp__tzname;
#define _daylight (*__imp__daylight_dll) #define _daylight (*__imp__daylight_dll)
#define _timezone (*__imp__timezone_dll) #define _timezone (*__imp__timezone_dll)
#define _tzname (__imp__tzname) #define _tzname (__imp__tzname)
#else /* __DECLSPEC_SUPPORTED */ #else /* __DECLSPEC_SUPPORTED */
__MINGW_IMPORT int _daylight_dll; __MINGW_IMPORT int _daylight_dll;
__MINGW_IMPORT long _timezone_dll; __MINGW_IMPORT long _timezone_dll;
__MINGW_IMPORT char* _tzname[2]; __MINGW_IMPORT char* _tzname[2];
#define _daylight _daylight_dll #define _daylight _daylight_dll
#define _timezone _timezone_dll #define _timezone _timezone_dll
#endif /* __DECLSPEC_SUPPORTED */ #endif /* __DECLSPEC_SUPPORTED */
#endif /* not __MSVCRT__ */ #endif /* not __MSVCRT__ */
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
#ifdef __MSVCRT__ #ifdef __MSVCRT__
/* These go in the oldnames import library for MSVCRT. */ /* These go in the oldnames import library for MSVCRT. */
__MINGW_IMPORT int daylight; __MINGW_IMPORT int daylight;
__MINGW_IMPORT long timezone; __MINGW_IMPORT long timezone;
__MINGW_IMPORT char *tzname[2]; __MINGW_IMPORT char *tzname[2];
#ifndef _WTIME_DEFINED #ifndef _WTIME_DEFINED
/* wide function prototypes, also declared in wchar.h */ /* wide function prototypes, also declared in wchar.h */
wchar_t * _wasctime(const struct tm*); wchar_t * _wasctime(const struct tm*);
wchar_t * _wctime(const time_t*); wchar_t * _wctime(const time_t*);
wchar_t* _wstrdate(wchar_t*); wchar_t* _wstrdate(wchar_t*);
wchar_t* _wstrtime(wchar_t*); wchar_t* _wstrtime(wchar_t*);
#define _WTIME_DEFINED #define _WTIME_DEFINED
#endif /* _WTIME_DEFINED */ #endif /* _WTIME_DEFINED */
#else /* not __MSVCRT__ */ #else /* not __MSVCRT__ */
/* CRTDLL is royally messed up when it comes to these macros. /* CRTDLL is royally messed up when it comes to these macros.
TODO: import and alias these via oldnames import library instead TODO: import and alias these via oldnames import library instead
of macros. */ of macros. */
#define daylight _daylight #define daylight _daylight
/* NOTE: timezone not defined because it would conflict with sys/timeb.h. /* NOTE: timezone not defined because it would conflict with sys/timeb.h.
Also, tzname used to a be macro, but now it's in moldname. */ Also, tzname used to a be macro, but now it's in moldname. */
__MINGW_IMPORT char *tzname[2]; __MINGW_IMPORT char *tzname[2];
#endif /* not __MSVCRT__ */ #endif /* not __MSVCRT__ */
#endif /* Not _NO_OLDNAMES */ #endif /* Not _NO_OLDNAMES */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
#endif /* Not _TIME_H_ */ #endif /* Not _TIME_H_ */

View File

@ -1,10 +1,10 @@
/* /*
* This file is part of the Mingw32 package. * This file is part of the Mingw32 package.
* *
* unistd.h maps (roughly) to io.h * unistd.h maps (roughly) to io.h
*/ */
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#include <io.h> #include <io.h>
#endif #endif

View File

@ -1,4 +1,4 @@
/* /*
* TODO: Nothing here yet. Should provide UNIX compatibility constants * TODO: Nothing here yet. Should provide UNIX compatibility constants
* comparible to those in limits.h and float.h. * comparible to those in limits.h and float.h.
*/ */

View File

@ -1,318 +1,318 @@
/* /*
* wchar.h * wchar.h
* *
* Defines of all functions for supporting wide characters. Actually it * Defines of all functions for supporting wide characters. Actually it
* just includes all those headers, which is not a good thing to do from a * just includes all those headers, which is not a good thing to do from a
* processing time point of view, but it does mean that everything will be * processing time point of view, but it does mean that everything will be
* in sync. * in sync.
* *
* This file is part of the Mingw32 package. * This file is part of the Mingw32 package.
* *
* THIS SOFTWARE IS NOT COPYRIGHTED * THIS SOFTWARE IS NOT COPYRIGHTED
* *
* This source code is offered for use in the public domain. You may * This source code is offered for use in the public domain. You may
* use, modify or distribute it freely. * use, modify or distribute it freely.
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* $Author: bellard $ * $Author: bellard $
* $Date: 2005/04/14 23:49:21 $ * $Date: 2005/04/17 13:14:29 $
* *
*/ */
#ifndef _WCHAR_H_ #ifndef _WCHAR_H_
#define _WCHAR_H_ #define _WCHAR_H_
/* All the headers include this file. */ /* All the headers include this file. */
#include <_mingw.h> #include <_mingw.h>
#include <ctype.h> #include <ctype.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <time.h> #include <time.h>
#include <sys/types.h> #include <sys/types.h>
#define __need_size_t #define __need_size_t
#define __need_wint_t #define __need_wint_t
#define __need_wchar_t #define __need_wchar_t
#ifndef RC_INVOKED #ifndef RC_INVOKED
#include <stddef.h> #include <stddef.h>
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
#define WCHAR_MIN 0 #define WCHAR_MIN 0
#define WCHAR_MAX ((wchar_t)-1) #define WCHAR_MAX ((wchar_t)-1)
#ifndef RC_INVOKED #ifndef RC_INVOKED
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
#ifndef _FSIZE_T_DEFINED #ifndef _FSIZE_T_DEFINED
typedef unsigned long _fsize_t; typedef unsigned long _fsize_t;
#define _FSIZE_T_DEFINED #define _FSIZE_T_DEFINED
#endif #endif
#ifndef _WFINDDATA_T_DEFINED #ifndef _WFINDDATA_T_DEFINED
struct _wfinddata_t { struct _wfinddata_t {
unsigned attrib; unsigned attrib;
time_t time_create; /* -1 for FAT file systems */ time_t time_create; /* -1 for FAT file systems */
time_t time_access; /* -1 for FAT file systems */ time_t time_access; /* -1 for FAT file systems */
time_t time_write; time_t time_write;
_fsize_t size; _fsize_t size;
wchar_t name[FILENAME_MAX]; /* may include spaces. */ wchar_t name[FILENAME_MAX]; /* may include spaces. */
}; };
struct _wfinddatai64_t { struct _wfinddatai64_t {
unsigned attrib; unsigned attrib;
time_t time_create; time_t time_create;
time_t time_access; time_t time_access;
time_t time_write; time_t time_write;
__int64 size; __int64 size;
wchar_t name[FILENAME_MAX]; wchar_t name[FILENAME_MAX];
}; };
#define _WFINDDATA_T_DEFINED #define _WFINDDATA_T_DEFINED
#endif #endif
/* Wide character versions. Also defined in io.h. */ /* Wide character versions. Also defined in io.h. */
/* CHECK: I believe these only exist in MSVCRT, and not in CRTDLL. Also /* CHECK: I believe these only exist in MSVCRT, and not in CRTDLL. Also
applies to other wide character versions? */ applies to other wide character versions? */
#if !defined (_WIO_DEFINED) #if !defined (_WIO_DEFINED)
#if defined (__MSVCRT__) #if defined (__MSVCRT__)
int _waccess (const wchar_t*, int); int _waccess (const wchar_t*, int);
int _wchmod (const wchar_t*, int); int _wchmod (const wchar_t*, int);
int _wcreat (const wchar_t*, int); int _wcreat (const wchar_t*, int);
long _wfindfirst (wchar_t*, struct _wfinddata_t *); long _wfindfirst (wchar_t*, struct _wfinddata_t *);
int _wfindnext (long, struct _wfinddata_t *); int _wfindnext (long, struct _wfinddata_t *);
int _wunlink (const wchar_t*); int _wunlink (const wchar_t*);
int _wopen (const wchar_t*, int, ...); int _wopen (const wchar_t*, int, ...);
int _wsopen (const wchar_t*, int, int, ...); int _wsopen (const wchar_t*, int, int, ...);
wchar_t* _wmktemp (wchar_t*); wchar_t* _wmktemp (wchar_t*);
long _wfindfirsti64 (const wchar_t*, struct _wfinddatai64_t*); long _wfindfirsti64 (const wchar_t*, struct _wfinddatai64_t*);
int _wfindnexti64 (long, struct _wfinddatai64_t*); int _wfindnexti64 (long, struct _wfinddatai64_t*);
#endif /* defined (__MSVCRT__) */ #endif /* defined (__MSVCRT__) */
#define _WIO_DEFINED #define _WIO_DEFINED
#endif /* _WIO_DEFINED */ #endif /* _WIO_DEFINED */
#ifndef _WSTDIO_DEFINED #ifndef _WSTDIO_DEFINED
/* also in stdio.h - keep in sync */ /* also in stdio.h - keep in sync */
int fwprintf (FILE*, const wchar_t*, ...); int fwprintf (FILE*, const wchar_t*, ...);
int wprintf (const wchar_t*, ...); int wprintf (const wchar_t*, ...);
int swprintf (wchar_t*, const wchar_t*, ...); int swprintf (wchar_t*, const wchar_t*, ...);
int _snwprintf (wchar_t*, size_t, const wchar_t*, ...); int _snwprintf (wchar_t*, size_t, const wchar_t*, ...);
int vfwprintf (FILE*, const wchar_t*, va_list); int vfwprintf (FILE*, const wchar_t*, va_list);
int vwprintf (const wchar_t*, va_list); int vwprintf (const wchar_t*, va_list);
int vswprintf (wchar_t*, const wchar_t*, va_list); int vswprintf (wchar_t*, const wchar_t*, va_list);
int _vsnwprintf (wchar_t*, size_t, const wchar_t*, va_list); int _vsnwprintf (wchar_t*, size_t, const wchar_t*, va_list);
int fwscanf (FILE*, const wchar_t*, ...); int fwscanf (FILE*, const wchar_t*, ...);
int wscanf (const wchar_t*, ...); int wscanf (const wchar_t*, ...);
int swscanf (const wchar_t*, const wchar_t*, ...); int swscanf (const wchar_t*, const wchar_t*, ...);
wint_t fgetwc (FILE*); wint_t fgetwc (FILE*);
wint_t fputwc (wchar_t, FILE*); wint_t fputwc (wchar_t, FILE*);
wint_t ungetwc (wchar_t, FILE*); wint_t ungetwc (wchar_t, FILE*);
#ifndef __NO_ISOCEXT /* externs in libmingwex.a */ #ifndef __NO_ISOCEXT /* externs in libmingwex.a */
int snwprintf(wchar_t* s, size_t n, const wchar_t* format, ...); int snwprintf(wchar_t* s, size_t n, const wchar_t* format, ...);
extern inline int vsnwprintf (wchar_t* s, size_t n, const wchar_t* format, extern inline int vsnwprintf (wchar_t* s, size_t n, const wchar_t* format,
va_list arg) va_list arg)
{ return _vsnwprintf ( s, n, format, arg); } { return _vsnwprintf ( s, n, format, arg); }
#endif #endif
#ifdef __MSVCRT__ #ifdef __MSVCRT__
wchar_t* fgetws (wchar_t*, int, FILE*); wchar_t* fgetws (wchar_t*, int, FILE*);
int fputws (const wchar_t*, FILE*); int fputws (const wchar_t*, FILE*);
wint_t getwc (FILE*); wint_t getwc (FILE*);
wint_t getwchar (void); wint_t getwchar (void);
wchar_t* _getws (wchar_t*); wchar_t* _getws (wchar_t*);
wint_t putwc (wint_t, FILE*); wint_t putwc (wint_t, FILE*);
int _putws (const wchar_t*); int _putws (const wchar_t*);
wint_t putwchar (wint_t); wint_t putwchar (wint_t);
FILE* _wfopen (const wchar_t*, const wchar_t*); FILE* _wfopen (const wchar_t*, const wchar_t*);
FILE* _wfreopen (const wchar_t*, const wchar_t*, FILE*); FILE* _wfreopen (const wchar_t*, const wchar_t*, FILE*);
FILE* _wfsopen (const wchar_t*, const wchar_t*, int); FILE* _wfsopen (const wchar_t*, const wchar_t*, int);
wchar_t* _wtmpnam (wchar_t*); wchar_t* _wtmpnam (wchar_t*);
wchar_t* _wtempnam (const wchar_t*, const wchar_t*); wchar_t* _wtempnam (const wchar_t*, const wchar_t*);
int _wrename (const wchar_t*, const wchar_t*); int _wrename (const wchar_t*, const wchar_t*);
int _wremove (const wchar_t*) int _wremove (const wchar_t*)
FILE* _wpopen (const wchar_t*, const wchar_t*) FILE* _wpopen (const wchar_t*, const wchar_t*)
void _wperror (const wchar_t*); void _wperror (const wchar_t*);
#endif /* __MSVCRT__ */ #endif /* __MSVCRT__ */
#define _WSTDIO_DEFINED #define _WSTDIO_DEFINED
#endif /* _WSTDIO_DEFINED */ #endif /* _WSTDIO_DEFINED */
#ifndef _WDIRECT_DEFINED #ifndef _WDIRECT_DEFINED
/* Also in direct.h */ /* Also in direct.h */
#ifdef __MSVCRT__ #ifdef __MSVCRT__
int _wchdir (const wchar_t*); int _wchdir (const wchar_t*);
wchar_t* _wgetcwd (wchar_t*, int); wchar_t* _wgetcwd (wchar_t*, int);
wchar_t* _wgetdcwd (int, wchar_t*, int); wchar_t* _wgetdcwd (int, wchar_t*, int);
int _wmkdir (const wchar_t*); int _wmkdir (const wchar_t*);
int _wrmdir (const wchar_t*); int _wrmdir (const wchar_t*);
#endif /* __MSVCRT__ */ #endif /* __MSVCRT__ */
#define _WDIRECT_DEFINED #define _WDIRECT_DEFINED
#endif /* _WDIRECT_DEFINED */ #endif /* _WDIRECT_DEFINED */
#ifndef _STAT_DEFINED #ifndef _STAT_DEFINED
/* /*
* The structure manipulated and returned by stat and fstat. * The structure manipulated and returned by stat and fstat.
* *
* NOTE: If called on a directory the values in the time fields are not only * NOTE: If called on a directory the values in the time fields are not only
* invalid, they will cause localtime et. al. to return NULL. And calling * invalid, they will cause localtime et. al. to return NULL. And calling
* asctime with a NULL pointer causes an Invalid Page Fault. So watch it! * asctime with a NULL pointer causes an Invalid Page Fault. So watch it!
*/ */
struct _stat struct _stat
{ {
_dev_t st_dev; /* Equivalent to drive number 0=A 1=B ... */ _dev_t st_dev; /* Equivalent to drive number 0=A 1=B ... */
_ino_t st_ino; /* Always zero ? */ _ino_t st_ino; /* Always zero ? */
_mode_t st_mode; /* See above constants */ _mode_t st_mode; /* See above constants */
short st_nlink; /* Number of links. */ short st_nlink; /* Number of links. */
short st_uid; /* User: Maybe significant on NT ? */ short st_uid; /* User: Maybe significant on NT ? */
short st_gid; /* Group: Ditto */ short st_gid; /* Group: Ditto */
_dev_t st_rdev; /* Seems useless (not even filled in) */ _dev_t st_rdev; /* Seems useless (not even filled in) */
_off_t st_size; /* File size in bytes */ _off_t st_size; /* File size in bytes */
time_t st_atime; /* Accessed date (always 00:00 hrs local time_t st_atime; /* Accessed date (always 00:00 hrs local
* on FAT) */ * on FAT) */
time_t st_mtime; /* Modified time */ time_t st_mtime; /* Modified time */
time_t st_ctime; /* Creation time */ time_t st_ctime; /* Creation time */
}; };
struct stat struct stat
{ {
_dev_t st_dev; /* Equivalent to drive number 0=A 1=B ... */ _dev_t st_dev; /* Equivalent to drive number 0=A 1=B ... */
_ino_t st_ino; /* Always zero ? */ _ino_t st_ino; /* Always zero ? */
_mode_t st_mode; /* See above constants */ _mode_t st_mode; /* See above constants */
short st_nlink; /* Number of links. */ short st_nlink; /* Number of links. */
short st_uid; /* User: Maybe significant on NT ? */ short st_uid; /* User: Maybe significant on NT ? */
short st_gid; /* Group: Ditto */ short st_gid; /* Group: Ditto */
_dev_t st_rdev; /* Seems useless (not even filled in) */ _dev_t st_rdev; /* Seems useless (not even filled in) */
_off_t st_size; /* File size in bytes */ _off_t st_size; /* File size in bytes */
time_t st_atime; /* Accessed date (always 00:00 hrs local time_t st_atime; /* Accessed date (always 00:00 hrs local
* on FAT) */ * on FAT) */
time_t st_mtime; /* Modified time */ time_t st_mtime; /* Modified time */
time_t st_ctime; /* Creation time */ time_t st_ctime; /* Creation time */
}; };
#if defined (__MSVCRT__) #if defined (__MSVCRT__)
struct _stati64 { struct _stati64 {
_dev_t st_dev; _dev_t st_dev;
_ino_t st_ino; _ino_t st_ino;
unsigned short st_mode; unsigned short st_mode;
short st_nlink; short st_nlink;
short st_uid; short st_uid;
short st_gid; short st_gid;
_dev_t st_rdev; _dev_t st_rdev;
__int64 st_size; __int64 st_size;
time_t st_atime; time_t st_atime;
time_t st_mtime; time_t st_mtime;
time_t st_ctime; time_t st_ctime;
}; };
#endif /* __MSVCRT__ */ #endif /* __MSVCRT__ */
#define _STAT_DEFINED #define _STAT_DEFINED
#endif /* _STAT_DEFINED */ #endif /* _STAT_DEFINED */
#if !defined ( _WSTAT_DEFINED) #if !defined ( _WSTAT_DEFINED)
/* also declared in sys/stat.h */ /* also declared in sys/stat.h */
#if defined __MSVCRT__ #if defined __MSVCRT__
int _wstat (const wchar_t*, struct _stat*); int _wstat (const wchar_t*, struct _stat*);
int _wstati64 (const wchar_t*, struct _stati64*); int _wstati64 (const wchar_t*, struct _stati64*);
#endif /* __MSVCRT__ */ #endif /* __MSVCRT__ */
#define _WSTAT_DEFINED #define _WSTAT_DEFINED
#endif /* ! _WSTAT_DEFIND */ #endif /* ! _WSTAT_DEFIND */
#ifndef _WTIME_DEFINED #ifndef _WTIME_DEFINED
#ifdef __MSVCRT__ #ifdef __MSVCRT__
/* wide function prototypes, also declared in time.h */ /* wide function prototypes, also declared in time.h */
wchar_t* _wasctime (const struct tm*); wchar_t* _wasctime (const struct tm*);
wchar_t* _wctime (const time_t*); wchar_t* _wctime (const time_t*);
wchar_t* _wstrdate (wchar_t*); wchar_t* _wstrdate (wchar_t*);
wchar_t* _wstrtime (wchar_t*); wchar_t* _wstrtime (wchar_t*);
#endif /* __MSVCRT__ */ #endif /* __MSVCRT__ */
size_t wcsftime (wchar_t*, size_t, const wchar_t*, const struct tm*); size_t wcsftime (wchar_t*, size_t, const wchar_t*, const struct tm*);
#define _WTIME_DEFINED #define _WTIME_DEFINED
#endif /* _WTIME_DEFINED */ #endif /* _WTIME_DEFINED */
#ifndef _WLOCALE_DEFINED /* also declared in locale.h */ #ifndef _WLOCALE_DEFINED /* also declared in locale.h */
wchar_t* _wsetlocale (int, const wchar_t*); wchar_t* _wsetlocale (int, const wchar_t*);
#define _WLOCALE_DEFINED #define _WLOCALE_DEFINED
#endif #endif
#ifndef _WSTDLIB_DEFINED /* also declared in stdlib.h */ #ifndef _WSTDLIB_DEFINED /* also declared in stdlib.h */
long wcstol (const wchar_t*, wchar_t**, int); long wcstol (const wchar_t*, wchar_t**, int);
unsigned long wcstoul (const wchar_t*, wchar_t**, int); unsigned long wcstoul (const wchar_t*, wchar_t**, int);
double wcstod (const wchar_t*, wchar_t**); double wcstod (const wchar_t*, wchar_t**);
#if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */ #if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */
extern __inline__ float wcstof( const wchar_t *nptr, wchar_t **endptr) extern __inline__ float wcstof( const wchar_t *nptr, wchar_t **endptr)
{ return (wcstod(nptr, endptr)); } { return (wcstod(nptr, endptr)); }
#endif /* __NO_ISOCEXT */ #endif /* __NO_ISOCEXT */
#define _WSTDLIB_DEFINED #define _WSTDLIB_DEFINED
#endif #endif
#ifndef _NO_OLDNAMES #ifndef _NO_OLDNAMES
/* Wide character versions. Also declared in io.h. */ /* Wide character versions. Also declared in io.h. */
/* CHECK: Are these in the oldnames??? NO! */ /* CHECK: Are these in the oldnames??? NO! */
#if (0) #if (0)
int waccess (const wchar_t *, int); int waccess (const wchar_t *, int);
int wchmod (const wchar_t *, int); int wchmod (const wchar_t *, int);
int wcreat (const wchar_t *, int); int wcreat (const wchar_t *, int);
long wfindfirst (wchar_t *, struct _wfinddata_t *); long wfindfirst (wchar_t *, struct _wfinddata_t *);
int wfindnext (long, struct _wfinddata_t *); int wfindnext (long, struct _wfinddata_t *);
int wunlink (const wchar_t *); int wunlink (const wchar_t *);
int wrename (const wchar_t *, const wchar_t *); int wrename (const wchar_t *, const wchar_t *);
int wremove (const wchar_t *); int wremove (const wchar_t *);
int wopen (const wchar_t *, int, ...); int wopen (const wchar_t *, int, ...);
int wsopen (const wchar_t *, int, int, ...); int wsopen (const wchar_t *, int, int, ...);
wchar_t* wmktemp (wchar_t *); wchar_t* wmktemp (wchar_t *);
#endif #endif
#endif /* _NO_OLDNAMES */ #endif /* _NO_OLDNAMES */
#endif /* not __STRICT_ANSI__ */ #endif /* not __STRICT_ANSI__ */
/* These are resolved by -lmsvcp60 */ /* These are resolved by -lmsvcp60 */
/* If you don't have msvcp60.dll in your windows system directory, you can /* If you don't have msvcp60.dll in your windows system directory, you can
easily obtain it with a search from your favorite search engine. */ easily obtain it with a search from your favorite search engine. */
typedef int mbstate_t; typedef int mbstate_t;
typedef wchar_t _Wint_t; typedef wchar_t _Wint_t;
wint_t btowc(int); wint_t btowc(int);
size_t mbrlen(const char *, size_t, mbstate_t *); size_t mbrlen(const char *, size_t, mbstate_t *);
size_t mbrtowc(wchar_t *, const char *, size_t, mbstate_t *); size_t mbrtowc(wchar_t *, const char *, size_t, mbstate_t *);
size_t mbsrtowcs(wchar_t *, const char **, size_t, mbstate_t *); size_t mbsrtowcs(wchar_t *, const char **, size_t, mbstate_t *);
size_t wcrtomb(char *, wchar_t, mbstate_t *); size_t wcrtomb(char *, wchar_t, mbstate_t *);
size_t wcsrtombs(char *, const wchar_t **, size_t, mbstate_t *); size_t wcsrtombs(char *, const wchar_t **, size_t, mbstate_t *);
int wctob(wint_t); int wctob(wint_t);
#ifndef __NO_ISOCEXT /* these need static lib libmingwex.a */ #ifndef __NO_ISOCEXT /* these need static lib libmingwex.a */
extern inline int fwide(FILE* stream, int mode) {return -1;} /* limited to byte orientation */ extern inline int fwide(FILE* stream, int mode) {return -1;} /* limited to byte orientation */
extern inline int mbsinit(const mbstate_t* ps) {return 1;} extern inline int mbsinit(const mbstate_t* ps) {return 1;}
wchar_t* wmemset(wchar_t* s, wchar_t c, size_t n); wchar_t* wmemset(wchar_t* s, wchar_t c, size_t n);
wchar_t* wmemchr(const wchar_t* s, wchar_t c, size_t n); wchar_t* wmemchr(const wchar_t* s, wchar_t c, size_t n);
int wmemcmp(const wchar_t* s1, const wchar_t * s2, size_t n); int wmemcmp(const wchar_t* s1, const wchar_t * s2, size_t n);
wchar_t* wmemcpy(wchar_t* __restrict__ s1, const wchar_t* __restrict__ s2, wchar_t* wmemcpy(wchar_t* __restrict__ s1, const wchar_t* __restrict__ s2,
size_t n); size_t n);
wchar_t* wmemmove(wchar_t* s1, const wchar_t* s2, size_t n); wchar_t* wmemmove(wchar_t* s1, const wchar_t* s2, size_t n);
long long wcstoll(const wchar_t* __restrict__ nptr, long long wcstoll(const wchar_t* __restrict__ nptr,
wchar_t** __restrict__ endptr, int base); wchar_t** __restrict__ endptr, int base);
unsigned long long wcstoull(const wchar_t* __restrict__ nptr, unsigned long long wcstoull(const wchar_t* __restrict__ nptr,
wchar_t ** __restrict__ endptr, int base); wchar_t ** __restrict__ endptr, int base);
#endif /* __NO_ISOCEXT */ #endif /* __NO_ISOCEXT */
#ifdef __cplusplus #ifdef __cplusplus
} /* end of extern "C" */ } /* end of extern "C" */
#endif #endif
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
#endif /* not _WCHAR_H_ */ #endif /* not _WCHAR_H_ */

View File

@ -1,127 +1,127 @@
/* /*
* wctype.h * wctype.h
* *
* Functions for testing wide character types and converting characters. * Functions for testing wide character types and converting characters.
* *
* This file is part of the Mingw32 package. * This file is part of the Mingw32 package.
* *
* Contributors: * Contributors:
* Created by Mumit Khan <khan@xraylith.wisc.edu> * Created by Mumit Khan <khan@xraylith.wisc.edu>
* *
* THIS SOFTWARE IS NOT COPYRIGHTED * THIS SOFTWARE IS NOT COPYRIGHTED
* *
* This source code is offered for use in the public domain. You may * This source code is offered for use in the public domain. You may
* use, modify or distribute it freely. * use, modify or distribute it freely.
* *
* This code is distributed in the hope that it will be useful but * This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of * DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* *
*/ */
#ifndef _WCTYPE_H_ #ifndef _WCTYPE_H_
#define _WCTYPE_H_ #define _WCTYPE_H_
/* All the headers include this file. */ /* All the headers include this file. */
#include <_mingw.h> #include <_mingw.h>
#define __need_wchar_t #define __need_wchar_t
#define __need_wint_t #define __need_wint_t
#ifndef RC_INVOKED #ifndef RC_INVOKED
#include <stddef.h> #include <stddef.h>
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
/* /*
* The following flags are used to tell iswctype and _isctype what character * The following flags are used to tell iswctype and _isctype what character
* types you are looking for. * types you are looking for.
*/ */
#define _UPPER 0x0001 #define _UPPER 0x0001
#define _LOWER 0x0002 #define _LOWER 0x0002
#define _DIGIT 0x0004 #define _DIGIT 0x0004
#define _SPACE 0x0008 #define _SPACE 0x0008
#define _PUNCT 0x0010 #define _PUNCT 0x0010
#define _CONTROL 0x0020 #define _CONTROL 0x0020
#define _BLANK 0x0040 #define _BLANK 0x0040
#define _HEX 0x0080 #define _HEX 0x0080
#define _LEADBYTE 0x8000 #define _LEADBYTE 0x8000
#define _ALPHA 0x0103 #define _ALPHA 0x0103
#ifndef RC_INVOKED #ifndef RC_INVOKED
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#ifndef WEOF #ifndef WEOF
#define WEOF (wchar_t)(0xFFFF) #define WEOF (wchar_t)(0xFFFF)
#endif #endif
#ifndef _WCTYPE_T_DEFINED #ifndef _WCTYPE_T_DEFINED
typedef wchar_t wctype_t; typedef wchar_t wctype_t;
#define _WCTYPE_T_DEFINED #define _WCTYPE_T_DEFINED
#endif #endif
/* Wide character equivalents - also in ctype.h */ /* Wide character equivalents - also in ctype.h */
int iswalnum(wint_t); int iswalnum(wint_t);
int iswalpha(wint_t); int iswalpha(wint_t);
int iswascii(wint_t); int iswascii(wint_t);
int iswcntrl(wint_t); int iswcntrl(wint_t);
int iswctype(wint_t, wctype_t); int iswctype(wint_t, wctype_t);
int is_wctype(wint_t, wctype_t); /* Obsolete! */ int is_wctype(wint_t, wctype_t); /* Obsolete! */
int iswdigit(wint_t); int iswdigit(wint_t);
int iswgraph(wint_t); int iswgraph(wint_t);
int iswlower(wint_t); int iswlower(wint_t);
int iswprint(wint_t); int iswprint(wint_t);
int iswpunct(wint_t); int iswpunct(wint_t);
int iswspace(wint_t); int iswspace(wint_t);
int iswupper(wint_t); int iswupper(wint_t);
int iswxdigit(wint_t); int iswxdigit(wint_t);
wchar_t towlower(wchar_t); wchar_t towlower(wchar_t);
wchar_t towupper(wchar_t); wchar_t towupper(wchar_t);
int isleadbyte (int); int isleadbyte (int);
/* Also in ctype.h */ /* Also in ctype.h */
__MINGW_IMPORT unsigned short _ctype[]; __MINGW_IMPORT unsigned short _ctype[];
#ifdef __MSVCRT__ #ifdef __MSVCRT__
__MINGW_IMPORT unsigned short* _pctype; __MINGW_IMPORT unsigned short* _pctype;
#else #else
__MINGW_IMPORT unsigned short* _pctype_dll; __MINGW_IMPORT unsigned short* _pctype_dll;
#define _pctype _pctype_dll #define _pctype _pctype_dll
#endif #endif
#if !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED)) #if !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED))
#define __WCTYPE_INLINES_DEFINED #define __WCTYPE_INLINES_DEFINED
extern inline int iswalnum(wint_t wc) {return (iswctype(wc,_ALPHA|_DIGIT));} extern inline int iswalnum(wint_t wc) {return (iswctype(wc,_ALPHA|_DIGIT));}
extern inline int iswalpha(wint_t wc) {return (iswctype(wc,_ALPHA));} extern inline int iswalpha(wint_t wc) {return (iswctype(wc,_ALPHA));}
extern inline int iswascii(wint_t wc) {return (((unsigned)wc & 0x7F) ==0);} extern inline int iswascii(wint_t wc) {return (((unsigned)wc & 0x7F) ==0);}
extern inline int iswcntrl(wint_t wc) {return (iswctype(wc,_CONTROL));} extern inline int iswcntrl(wint_t wc) {return (iswctype(wc,_CONTROL));}
extern inline int iswdigit(wint_t wc) {return (iswctype(wc,_DIGIT));} extern inline int iswdigit(wint_t wc) {return (iswctype(wc,_DIGIT));}
extern inline int iswgraph(wint_t wc) {return (iswctype(wc,_PUNCT|_ALPHA|_DIGIT));} extern inline int iswgraph(wint_t wc) {return (iswctype(wc,_PUNCT|_ALPHA|_DIGIT));}
extern inline int iswlower(wint_t wc) {return (iswctype(wc,_LOWER));} extern inline int iswlower(wint_t wc) {return (iswctype(wc,_LOWER));}
extern inline int iswprint(wint_t wc) {return (iswctype(wc,_BLANK|_PUNCT|_ALPHA|_DIGIT));} extern inline int iswprint(wint_t wc) {return (iswctype(wc,_BLANK|_PUNCT|_ALPHA|_DIGIT));}
extern inline int iswpunct(wint_t wc) {return (iswctype(wc,_PUNCT));} extern inline int iswpunct(wint_t wc) {return (iswctype(wc,_PUNCT));}
extern inline int iswspace(wint_t wc) {return (iswctype(wc,_SPACE));} extern inline int iswspace(wint_t wc) {return (iswctype(wc,_SPACE));}
extern inline int iswupper(wint_t wc) {return (iswctype(wc,_UPPER));} extern inline int iswupper(wint_t wc) {return (iswctype(wc,_UPPER));}
extern inline int iswxdigit(wint_t wc) {return (iswctype(wc,_HEX));} extern inline int iswxdigit(wint_t wc) {return (iswctype(wc,_HEX));}
extern inline int isleadbyte(int c) {return (_pctype[(unsigned char)(c)] & _LEADBYTE);} extern inline int isleadbyte(int c) {return (_pctype[(unsigned char)(c)] & _LEADBYTE);}
#endif /* !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED)) */ #endif /* !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED)) */
typedef wchar_t wctrans_t; typedef wchar_t wctrans_t;
wint_t towctrans(wint_t, wctrans_t); wint_t towctrans(wint_t, wctrans_t);
wctrans_t wctrans(const char*); wctrans_t wctrans(const char*);
wctype_t wctype(const char*); wctype_t wctype(const char*);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* Not RC_INVOKED */ #endif /* Not RC_INVOKED */
#endif /* Not _WCTYPE_H_ */ #endif /* Not _WCTYPE_H_ */

View File

@ -1,119 +1,119 @@
#ifndef _BASETSD_H #ifndef _BASETSD_H
#define _BASETSD_H #define _BASETSD_H
#if __GNUC__ >=3 #if __GNUC__ >=3
#pragma GCC system_header #pragma GCC system_header
#endif #endif
#ifdef __GNUC__ #ifdef __GNUC__
#ifndef __int64 #ifndef __int64
#define __int64 long long #define __int64 long long
#endif #endif
#endif #endif
#if defined(_WIN64) #if defined(_WIN64)
#define __int3264 __int64 #define __int3264 __int64
#define ADDRESS_TAG_BIT 0x40000000000UI64 #define ADDRESS_TAG_BIT 0x40000000000UI64
#else /* !_WIN64 */ #else /* !_WIN64 */
#define __int3264 __int32 #define __int3264 __int32
#define ADDRESS_TAG_BIT 0x80000000UL #define ADDRESS_TAG_BIT 0x80000000UL
#define HandleToUlong( h ) ((ULONG)(ULONG_PTR)(h) ) #define HandleToUlong( h ) ((ULONG)(ULONG_PTR)(h) )
#define HandleToLong( h ) ((LONG)(LONG_PTR) (h) ) #define HandleToLong( h ) ((LONG)(LONG_PTR) (h) )
#define LongToHandle( h) ((HANDLE)(LONG_PTR) (h)) #define LongToHandle( h) ((HANDLE)(LONG_PTR) (h))
#define PtrToUlong( p ) ((ULONG)(ULONG_PTR) (p) ) #define PtrToUlong( p ) ((ULONG)(ULONG_PTR) (p) )
#define PtrToLong( p ) ((LONG)(LONG_PTR) (p) ) #define PtrToLong( p ) ((LONG)(LONG_PTR) (p) )
#define PtrToUint( p ) ((UINT)(UINT_PTR) (p) ) #define PtrToUint( p ) ((UINT)(UINT_PTR) (p) )
#define PtrToInt( p ) ((INT)(INT_PTR) (p) ) #define PtrToInt( p ) ((INT)(INT_PTR) (p) )
#define PtrToUshort( p ) ((unsigned short)(ULONG_PTR)(p) ) #define PtrToUshort( p ) ((unsigned short)(ULONG_PTR)(p) )
#define PtrToShort( p ) ((short)(LONG_PTR)(p) ) #define PtrToShort( p ) ((short)(LONG_PTR)(p) )
#define IntToPtr( i ) ((VOID*)(INT_PTR)((int)i)) #define IntToPtr( i ) ((VOID*)(INT_PTR)((int)i))
#define UIntToPtr( ui ) ((VOID*)(UINT_PTR)((unsigned int)ui)) #define UIntToPtr( ui ) ((VOID*)(UINT_PTR)((unsigned int)ui))
#define LongToPtr( l ) ((VOID*)(LONG_PTR)((long)l)) #define LongToPtr( l ) ((VOID*)(LONG_PTR)((long)l))
#define ULongToPtr( ul ) ((VOID*)(ULONG_PTR)((unsigned long)ul)) #define ULongToPtr( ul ) ((VOID*)(ULONG_PTR)((unsigned long)ul))
#endif /* !_WIN64 */ #endif /* !_WIN64 */
#define UlongToPtr(ul) ULongToPtr(ul) #define UlongToPtr(ul) ULongToPtr(ul)
#define UintToPtr(ui) UIntToPtr(ui) #define UintToPtr(ui) UIntToPtr(ui)
#define MAXUINT_PTR (~((UINT_PTR)0)) #define MAXUINT_PTR (~((UINT_PTR)0))
#define MAXINT_PTR ((INT_PTR)(MAXUINT_PTR >> 1)) #define MAXINT_PTR ((INT_PTR)(MAXUINT_PTR >> 1))
#define MININT_PTR (~MAXINT_PTR) #define MININT_PTR (~MAXINT_PTR)
#define MAXULONG_PTR (~((ULONG_PTR)0)) #define MAXULONG_PTR (~((ULONG_PTR)0))
#define MAXLONG_PTR ((LONG_PTR)(MAXULONG_PTR >> 1)) #define MAXLONG_PTR ((LONG_PTR)(MAXULONG_PTR >> 1))
#define MINLONG_PTR (~MAXLONG_PTR) #define MINLONG_PTR (~MAXLONG_PTR)
#define MAXUHALF_PTR ((UHALF_PTR)~0) #define MAXUHALF_PTR ((UHALF_PTR)~0)
#define MAXHALF_PTR ((HALF_PTR)(MAXUHALF_PTR >> 1)) #define MAXHALF_PTR ((HALF_PTR)(MAXUHALF_PTR >> 1))
#define MINHALF_PTR (~MAXHALF_PTR) #define MINHALF_PTR (~MAXHALF_PTR)
#ifndef RC_INVOKED #ifndef RC_INVOKED
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
typedef int LONG32, *PLONG32; typedef int LONG32, *PLONG32;
#ifndef XFree86Server #ifndef XFree86Server
typedef int INT32, *PINT32; typedef int INT32, *PINT32;
#endif /* ndef XFree86Server */ #endif /* ndef XFree86Server */
typedef unsigned int ULONG32, *PULONG32; typedef unsigned int ULONG32, *PULONG32;
typedef unsigned int DWORD32, *PDWORD32; typedef unsigned int DWORD32, *PDWORD32;
typedef unsigned int UINT32, *PUINT32; typedef unsigned int UINT32, *PUINT32;
#if defined(_WIN64) #if defined(_WIN64)
typedef __int64 INT_PTR, *PINT_PTR; typedef __int64 INT_PTR, *PINT_PTR;
typedef unsigned __int64 UINT_PTR, *PUINT_PTR; typedef unsigned __int64 UINT_PTR, *PUINT_PTR;
typedef __int64 LONG_PTR, *PLONG_PTR; typedef __int64 LONG_PTR, *PLONG_PTR;
typedef unsigned __int64 ULONG_PTR, *PULONG_PTR; typedef unsigned __int64 ULONG_PTR, *PULONG_PTR;
typedef unsigned __int64 HANDLE_PTR; typedef unsigned __int64 HANDLE_PTR;
typedef unsigned int UHALF_PTR, *PUHALF_PTR; typedef unsigned int UHALF_PTR, *PUHALF_PTR;
typedef int HALF_PTR, *PHALF_PTR; typedef int HALF_PTR, *PHALF_PTR;
#if 0 /* TODO when WIN64 is here */ #if 0 /* TODO when WIN64 is here */
inline unsigned long HandleToUlong(const void* h ) inline unsigned long HandleToUlong(const void* h )
{ return((unsigned long) h ); } { return((unsigned long) h ); }
inline long HandleToLong( const void* h ) inline long HandleToLong( const void* h )
{ return((long) h ); } { return((long) h ); }
inline void* LongToHandle( const long h ) inline void* LongToHandle( const long h )
{ return((void*) (INT_PTR) h ); } { return((void*) (INT_PTR) h ); }
inline unsigned long PtrToUlong( const void* p) inline unsigned long PtrToUlong( const void* p)
{ return((unsigned long) p ); } { return((unsigned long) p ); }
inline unsigned int PtrToUint( const void* p ) inline unsigned int PtrToUint( const void* p )
{ return((unsigned int) p ); } { return((unsigned int) p ); }
inline unsigned short PtrToUshort( const void* p ) inline unsigned short PtrToUshort( const void* p )
{ return((unsigned short) p ); } { return((unsigned short) p ); }
inline long PtrToLong( const void* p ) inline long PtrToLong( const void* p )
{ return((long) p ); } { return((long) p ); }
inline int PtrToInt( const void* p ) inline int PtrToInt( const void* p )
{ return((int) p ); } { return((int) p ); }
inline short PtrToShort( const void* p ) inline short PtrToShort( const void* p )
{ return((short) p ); } { return((short) p ); }
inline void* IntToPtr( const int i ) inline void* IntToPtr( const int i )
{ return( (void*)(INT_PTR)i ); } { return( (void*)(INT_PTR)i ); }
inline void* UIntToPtr(const unsigned int ui) inline void* UIntToPtr(const unsigned int ui)
{ return( (void*)(UINT_PTR)ui ); } { return( (void*)(UINT_PTR)ui ); }
inline void* LongToPtr( const long l ) inline void* LongToPtr( const long l )
{ return( (void*)(LONG_PTR)l ); } { return( (void*)(LONG_PTR)l ); }
inline void* ULongToPtr( const unsigned long ul ) inline void* ULongToPtr( const unsigned long ul )
{ return( (void*)(ULONG_PTR)ul ); } { return( (void*)(ULONG_PTR)ul ); }
#endif /* 0_ */ #endif /* 0_ */
#else /* !_WIN64 */ #else /* !_WIN64 */
typedef int INT_PTR, *PINT_PTR; typedef int INT_PTR, *PINT_PTR;
typedef unsigned int UINT_PTR, *PUINT_PTR; typedef unsigned int UINT_PTR, *PUINT_PTR;
typedef long LONG_PTR, *PLONG_PTR; typedef long LONG_PTR, *PLONG_PTR;
typedef unsigned long ULONG_PTR, *PULONG_PTR; typedef unsigned long ULONG_PTR, *PULONG_PTR;
typedef unsigned short UHALF_PTR, *PUHALF_PTR; typedef unsigned short UHALF_PTR, *PUHALF_PTR;
typedef short HALF_PTR, *PHALF_PTR; typedef short HALF_PTR, *PHALF_PTR;
typedef unsigned long HANDLE_PTR; typedef unsigned long HANDLE_PTR;
#endif /* !_WIN64 */ #endif /* !_WIN64 */
typedef ULONG_PTR SIZE_T, *PSIZE_T; typedef ULONG_PTR SIZE_T, *PSIZE_T;
typedef LONG_PTR SSIZE_T, *PSSIZE_T; typedef LONG_PTR SSIZE_T, *PSSIZE_T;
typedef ULONG_PTR DWORD_PTR, *PDWORD_PTR; typedef ULONG_PTR DWORD_PTR, *PDWORD_PTR;
typedef __int64 LONG64, *PLONG64; typedef __int64 LONG64, *PLONG64;
typedef __int64 INT64, *PINT64; typedef __int64 INT64, *PINT64;
typedef unsigned __int64 ULONG64, *PULONG64; typedef unsigned __int64 ULONG64, *PULONG64;
typedef unsigned __int64 DWORD64, *PDWORD64; typedef unsigned __int64 DWORD64, *PDWORD64;
typedef unsigned __int64 UINT64, *PUINT64; typedef unsigned __int64 UINT64, *PUINT64;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* !RC_INVOKED */ #endif /* !RC_INVOKED */
#endif /* _BASETSD_H */ #endif /* _BASETSD_H */

View File

@ -1,144 +1,144 @@
#ifndef _BASETYPS_H #ifndef _BASETYPS_H
#define _BASETYPS_H #define _BASETYPS_H
#if __GNUC__ >=3 #if __GNUC__ >=3
#pragma GCC system_header #pragma GCC system_header
#endif #endif
#ifndef __OBJC__ #ifndef __OBJC__
#ifdef __cplusplus #ifdef __cplusplus
#define EXTERN_C extern "C" #define EXTERN_C extern "C"
#else #else
#define EXTERN_C extern #define EXTERN_C extern
#endif /* __cplusplus */ #endif /* __cplusplus */
#define STDMETHODCALLTYPE __stdcall #define STDMETHODCALLTYPE __stdcall
#define STDMETHODVCALLTYPE __cdecl #define STDMETHODVCALLTYPE __cdecl
#define STDAPICALLTYPE __stdcall #define STDAPICALLTYPE __stdcall
#define STDAPIVCALLTYPE __cdecl #define STDAPIVCALLTYPE __cdecl
#define STDAPI EXTERN_C HRESULT STDAPICALLTYPE #define STDAPI EXTERN_C HRESULT STDAPICALLTYPE
#define STDAPI_(t) EXTERN_C t STDAPICALLTYPE #define STDAPI_(t) EXTERN_C t STDAPICALLTYPE
#define STDMETHODIMP HRESULT STDMETHODCALLTYPE #define STDMETHODIMP HRESULT STDMETHODCALLTYPE
#define STDMETHODIMP_(t) t STDMETHODCALLTYPE #define STDMETHODIMP_(t) t STDMETHODCALLTYPE
#define STDAPIV EXTERN_C HRESULT STDAPIVCALLTYPE #define STDAPIV EXTERN_C HRESULT STDAPIVCALLTYPE
#define STDAPIV_(t) EXTERN_C t STDAPIVCALLTYPE #define STDAPIV_(t) EXTERN_C t STDAPIVCALLTYPE
#define STDMETHODIMPV HRESULT STDMETHODVCALLTYPE #define STDMETHODIMPV HRESULT STDMETHODVCALLTYPE
#define STDMETHODIMPV_(t) t STDMETHODVCALLTYPE #define STDMETHODIMPV_(t) t STDMETHODVCALLTYPE
#define interface struct #define interface struct
#if defined(__cplusplus) && !defined(CINTERFACE) #if defined(__cplusplus) && !defined(CINTERFACE)
#define STDMETHOD(m) virtual HRESULT STDMETHODCALLTYPE m #define STDMETHOD(m) virtual HRESULT STDMETHODCALLTYPE m
#define STDMETHOD_(t,m) virtual t STDMETHODCALLTYPE m #define STDMETHOD_(t,m) virtual t STDMETHODCALLTYPE m
#define PURE =0 #define PURE =0
#define THIS_ #define THIS_
#define THIS void #define THIS void
/* /*
__attribute__((com_interface)) is obsolete in __GNUC__ >= 3 __attribute__((com_interface)) is obsolete in __GNUC__ >= 3
g++ vtables are now COM-compatible by default g++ vtables are now COM-compatible by default
*/ */
#if defined(__GNUC__) && __GNUC__ < 3 && !defined(NOCOMATTRIBUTE) #if defined(__GNUC__) && __GNUC__ < 3 && !defined(NOCOMATTRIBUTE)
#define DECLARE_INTERFACE(i) interface __attribute__((com_interface)) i #define DECLARE_INTERFACE(i) interface __attribute__((com_interface)) i
#define DECLARE_INTERFACE_(i,b) interface __attribute__((com_interface)) i : public b #define DECLARE_INTERFACE_(i,b) interface __attribute__((com_interface)) i : public b
#else #else
#define DECLARE_INTERFACE(i) interface i #define DECLARE_INTERFACE(i) interface i
#define DECLARE_INTERFACE_(i,b) interface i : public b #define DECLARE_INTERFACE_(i,b) interface i : public b
#endif #endif
#else #else
#define STDMETHOD(m) HRESULT(STDMETHODCALLTYPE *m) #define STDMETHOD(m) HRESULT(STDMETHODCALLTYPE *m)
#define STDMETHOD_(t,m) t(STDMETHODCALLTYPE *m) #define STDMETHOD_(t,m) t(STDMETHODCALLTYPE *m)
#define PURE #define PURE
#define THIS_ INTERFACE *, #define THIS_ INTERFACE *,
#define THIS INTERFACE * #define THIS INTERFACE *
#ifndef CONST_VTABLE #ifndef CONST_VTABLE
#define CONST_VTABLE #define CONST_VTABLE
#endif #endif
#define DECLARE_INTERFACE(i) \ #define DECLARE_INTERFACE(i) \
typedef interface i { CONST_VTABLE struct i##Vtbl *lpVtbl; } i; \ typedef interface i { CONST_VTABLE struct i##Vtbl *lpVtbl; } i; \
typedef CONST_VTABLE struct i##Vtbl i##Vtbl; \ typedef CONST_VTABLE struct i##Vtbl i##Vtbl; \
CONST_VTABLE struct i##Vtbl CONST_VTABLE struct i##Vtbl
#define DECLARE_INTERFACE_(i,b) DECLARE_INTERFACE(i) #define DECLARE_INTERFACE_(i,b) DECLARE_INTERFACE(i)
#endif #endif
#define BEGIN_INTERFACE #define BEGIN_INTERFACE
#define END_INTERFACE #define END_INTERFACE
#define FWD_DECL(i) typedef interface i i #define FWD_DECL(i) typedef interface i i
#if defined(__cplusplus) && !defined(CINTERFACE) #if defined(__cplusplus) && !defined(CINTERFACE)
#define IENUM_THIS(T) #define IENUM_THIS(T)
#define IENUM_THIS_(T) #define IENUM_THIS_(T)
#else #else
#define IENUM_THIS(T) T* #define IENUM_THIS(T) T*
#define IENUM_THIS_(T) T*, #define IENUM_THIS_(T) T*,
#endif #endif
#define DECLARE_ENUMERATOR_(I,T) \ #define DECLARE_ENUMERATOR_(I,T) \
DECLARE_INTERFACE_(I,IUnknown) \ DECLARE_INTERFACE_(I,IUnknown) \
{ \ { \
STDMETHOD(QueryInterface)(IENUM_THIS_(I) REFIID,PVOID*) PURE; \ STDMETHOD(QueryInterface)(IENUM_THIS_(I) REFIID,PVOID*) PURE; \
STDMETHOD_(ULONG,AddRef)(IENUM_THIS(I)) PURE; \ STDMETHOD_(ULONG,AddRef)(IENUM_THIS(I)) PURE; \
STDMETHOD_(ULONG,Release)(IENUM_THIS(I)) PURE; \ STDMETHOD_(ULONG,Release)(IENUM_THIS(I)) PURE; \
STDMETHOD(Next)(IENUM_THIS_(I) ULONG,T*,ULONG*) PURE; \ STDMETHOD(Next)(IENUM_THIS_(I) ULONG,T*,ULONG*) PURE; \
STDMETHOD(Skip)(IENUM_THIS_(I) ULONG) PURE; \ STDMETHOD(Skip)(IENUM_THIS_(I) ULONG) PURE; \
STDMETHOD(Reset)(IENUM_THIS(I)) PURE; \ STDMETHOD(Reset)(IENUM_THIS(I)) PURE; \
STDMETHOD(Clone)(IENUM_THIS_(I) I**) PURE; \ STDMETHOD(Clone)(IENUM_THIS_(I) I**) PURE; \
} }
#define DECLARE_ENUMERATOR(T) DECLARE_ENUMERATOR_(IEnum##T,T) #define DECLARE_ENUMERATOR(T) DECLARE_ENUMERATOR_(IEnum##T,T)
#endif /* __OBJC__ */ #endif /* __OBJC__ */
#ifndef _GUID_DEFINED /* also defined in winnt.h */ #ifndef _GUID_DEFINED /* also defined in winnt.h */
#define _GUID_DEFINED #define _GUID_DEFINED
typedef struct _GUID typedef struct _GUID
{ {
unsigned long Data1; unsigned long Data1;
unsigned short Data2; unsigned short Data2;
unsigned short Data3; unsigned short Data3;
unsigned char Data4[8]; unsigned char Data4[8];
} GUID,*REFGUID,*LPGUID; } GUID,*REFGUID,*LPGUID;
#endif /* _GUID_DEFINED */ #endif /* _GUID_DEFINED */
#ifndef UUID_DEFINED #ifndef UUID_DEFINED
#define UUID_DEFINED #define UUID_DEFINED
typedef GUID UUID; typedef GUID UUID;
#endif /* UUID_DEFINED */ #endif /* UUID_DEFINED */
typedef GUID IID; typedef GUID IID;
typedef GUID CLSID; typedef GUID CLSID;
typedef CLSID *LPCLSID; typedef CLSID *LPCLSID;
typedef IID *LPIID; typedef IID *LPIID;
typedef IID *REFIID; typedef IID *REFIID;
typedef CLSID *REFCLSID; typedef CLSID *REFCLSID;
typedef GUID FMTID; typedef GUID FMTID;
typedef FMTID *REFFMTID; typedef FMTID *REFFMTID;
typedef unsigned long error_status_t; typedef unsigned long error_status_t;
#define uuid_t UUID #define uuid_t UUID
typedef unsigned long PROPID; typedef unsigned long PROPID;
#ifndef _REFGUID_DEFINED #ifndef _REFGUID_DEFINED
#if defined (__cplusplus) && !defined (CINTERFACE) #if defined (__cplusplus) && !defined (CINTERFACE)
#define REFGUID const GUID& #define REFGUID const GUID&
#define REFIID const IID& #define REFIID const IID&
#define REFCLSID const CLSID& #define REFCLSID const CLSID&
#else #else
#define REFGUID const GUID* const #define REFGUID const GUID* const
#define REFIID const IID* const #define REFIID const IID* const
#define REFCLSID const CLSID* const #define REFCLSID const CLSID* const
#endif #endif
#define _REFGUID_DEFINED #define _REFGUID_DEFINED
#define _REFGIID_DEFINED #define _REFGIID_DEFINED
#define _REFCLSID_DEFINED #define _REFCLSID_DEFINED
#endif #endif
#ifndef GUID_SECTION #ifndef GUID_SECTION
#define GUID_SECTION ".text" #define GUID_SECTION ".text"
#endif #endif
#ifdef __GNUC__ #ifdef __GNUC__
#define GUID_SECT __attribute__ ((section (GUID_SECTION))) #define GUID_SECT __attribute__ ((section (GUID_SECTION)))
#else #else
#define GUID_SECT #define GUID_SECT
#endif #endif
#if !defined(INITGUID) || (defined(INITGUID) && defined(__cplusplus)) #if !defined(INITGUID) || (defined(INITGUID) && defined(__cplusplus))
#define GUID_EXT EXTERN_C #define GUID_EXT EXTERN_C
#else #else
#define GUID_EXT #define GUID_EXT
#endif #endif
#ifdef INITGUID #ifdef INITGUID
#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}} #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}}
#define DEFINE_OLEGUID(n,l,w1,w2) DEFINE_GUID(n,l,w1,w2,0xC0,0,0,0,0,0,0,0x46) #define DEFINE_OLEGUID(n,l,w1,w2) DEFINE_GUID(n,l,w1,w2,0xC0,0,0,0,0,0,0,0x46)
#else #else
#define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) GUID_EXT const GUID n #define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) GUID_EXT const GUID n
#define DEFINE_OLEGUID(n,l,w1,w2) DEFINE_GUID(n,l,w1,w2,0xC0,0,0,0,0,0,0,0x46) #define DEFINE_OLEGUID(n,l,w1,w2) DEFINE_GUID(n,l,w1,w2,0xC0,0,0,0,0,0,0,0x46)
#endif #endif
#endif #endif

File diff suppressed because it is too large Load Diff

View File

@ -1,207 +1,207 @@
#ifndef _WINCON_H #ifndef _WINCON_H
#define _WINCON_H #define _WINCON_H
#if __GNUC__ >=3 #if __GNUC__ >=3
#pragma GCC system_header #pragma GCC system_header
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#define FOREGROUND_BLUE 1 #define FOREGROUND_BLUE 1
#define FOREGROUND_GREEN 2 #define FOREGROUND_GREEN 2
#define FOREGROUND_RED 4 #define FOREGROUND_RED 4
#define FOREGROUND_INTENSITY 8 #define FOREGROUND_INTENSITY 8
#define BACKGROUND_BLUE 16 #define BACKGROUND_BLUE 16
#define BACKGROUND_GREEN 32 #define BACKGROUND_GREEN 32
#define BACKGROUND_RED 64 #define BACKGROUND_RED 64
#define BACKGROUND_INTENSITY 128 #define BACKGROUND_INTENSITY 128
#define CTRL_C_EVENT 0 #define CTRL_C_EVENT 0
#define CTRL_BREAK_EVENT 1 #define CTRL_BREAK_EVENT 1
#define CTRL_CLOSE_EVENT 2 #define CTRL_CLOSE_EVENT 2
#define CTRL_LOGOFF_EVENT 5 #define CTRL_LOGOFF_EVENT 5
#define CTRL_SHUTDOWN_EVENT 6 #define CTRL_SHUTDOWN_EVENT 6
#define ENABLE_LINE_INPUT 2 #define ENABLE_LINE_INPUT 2
#define ENABLE_ECHO_INPUT 4 #define ENABLE_ECHO_INPUT 4
#define ENABLE_PROCESSED_INPUT 1 #define ENABLE_PROCESSED_INPUT 1
#define ENABLE_WINDOW_INPUT 8 #define ENABLE_WINDOW_INPUT 8
#define ENABLE_MOUSE_INPUT 16 #define ENABLE_MOUSE_INPUT 16
#define ENABLE_PROCESSED_OUTPUT 1 #define ENABLE_PROCESSED_OUTPUT 1
#define ENABLE_WRAP_AT_EOL_OUTPUT 2 #define ENABLE_WRAP_AT_EOL_OUTPUT 2
#define KEY_EVENT 1 #define KEY_EVENT 1
#define MOUSE_EVENT 2 #define MOUSE_EVENT 2
#define WINDOW_BUFFER_SIZE_EVENT 4 #define WINDOW_BUFFER_SIZE_EVENT 4
#define MENU_EVENT 8 #define MENU_EVENT 8
#define FOCUS_EVENT 16 #define FOCUS_EVENT 16
#define CAPSLOCK_ON 128 #define CAPSLOCK_ON 128
#define ENHANCED_KEY 256 #define ENHANCED_KEY 256
#define RIGHT_ALT_PRESSED 1 #define RIGHT_ALT_PRESSED 1
#define LEFT_ALT_PRESSED 2 #define LEFT_ALT_PRESSED 2
#define RIGHT_CTRL_PRESSED 4 #define RIGHT_CTRL_PRESSED 4
#define LEFT_CTRL_PRESSED 8 #define LEFT_CTRL_PRESSED 8
#define SHIFT_PRESSED 16 #define SHIFT_PRESSED 16
#define NUMLOCK_ON 32 #define NUMLOCK_ON 32
#define SCROLLLOCK_ON 64 #define SCROLLLOCK_ON 64
#define FROM_LEFT_1ST_BUTTON_PRESSED 1 #define FROM_LEFT_1ST_BUTTON_PRESSED 1
#define RIGHTMOST_BUTTON_PRESSED 2 #define RIGHTMOST_BUTTON_PRESSED 2
#define FROM_LEFT_2ND_BUTTON_PRESSED 4 #define FROM_LEFT_2ND_BUTTON_PRESSED 4
#define FROM_LEFT_3RD_BUTTON_PRESSED 8 #define FROM_LEFT_3RD_BUTTON_PRESSED 8
#define FROM_LEFT_4TH_BUTTON_PRESSED 16 #define FROM_LEFT_4TH_BUTTON_PRESSED 16
#define MOUSE_MOVED 1 #define MOUSE_MOVED 1
#define DOUBLE_CLICK 2 #define DOUBLE_CLICK 2
#define MOUSE_WHEELED 4 #define MOUSE_WHEELED 4
typedef struct _CHAR_INFO { typedef struct _CHAR_INFO {
union { union {
WCHAR UnicodeChar; WCHAR UnicodeChar;
CHAR AsciiChar; CHAR AsciiChar;
} Char; } Char;
WORD Attributes; WORD Attributes;
} CHAR_INFO,*PCHAR_INFO; } CHAR_INFO,*PCHAR_INFO;
typedef struct _SMALL_RECT { typedef struct _SMALL_RECT {
SHORT Left; SHORT Left;
SHORT Top; SHORT Top;
SHORT Right; SHORT Right;
SHORT Bottom; SHORT Bottom;
} SMALL_RECT,*PSMALL_RECT; } SMALL_RECT,*PSMALL_RECT;
typedef struct _CONSOLE_CURSOR_INFO { typedef struct _CONSOLE_CURSOR_INFO {
DWORD dwSize; DWORD dwSize;
BOOL bVisible; BOOL bVisible;
} CONSOLE_CURSOR_INFO,*PCONSOLE_CURSOR_INFO; } CONSOLE_CURSOR_INFO,*PCONSOLE_CURSOR_INFO;
typedef struct _COORD { typedef struct _COORD {
SHORT X; SHORT X;
SHORT Y; SHORT Y;
} COORD; } COORD;
typedef struct _CONSOLE_SCREEN_BUFFER_INFO { typedef struct _CONSOLE_SCREEN_BUFFER_INFO {
COORD dwSize; COORD dwSize;
COORD dwCursorPosition; COORD dwCursorPosition;
WORD wAttributes; WORD wAttributes;
SMALL_RECT srWindow; SMALL_RECT srWindow;
COORD dwMaximumWindowSize; COORD dwMaximumWindowSize;
} CONSOLE_SCREEN_BUFFER_INFO,*PCONSOLE_SCREEN_BUFFER_INFO; } CONSOLE_SCREEN_BUFFER_INFO,*PCONSOLE_SCREEN_BUFFER_INFO;
typedef BOOL(CALLBACK *PHANDLER_ROUTINE)(DWORD); typedef BOOL(CALLBACK *PHANDLER_ROUTINE)(DWORD);
typedef struct _KEY_EVENT_RECORD { typedef struct _KEY_EVENT_RECORD {
BOOL bKeyDown; BOOL bKeyDown;
WORD wRepeatCount; WORD wRepeatCount;
WORD wVirtualKeyCode; WORD wVirtualKeyCode;
WORD wVirtualScanCode; WORD wVirtualScanCode;
union { union {
WCHAR UnicodeChar; WCHAR UnicodeChar;
CHAR AsciiChar; CHAR AsciiChar;
} uChar; } uChar;
DWORD dwControlKeyState; DWORD dwControlKeyState;
} }
#ifdef __GNUC__ #ifdef __GNUC__
/* gcc's alignment is not what win32 expects */ /* gcc's alignment is not what win32 expects */
PACKED PACKED
#endif #endif
KEY_EVENT_RECORD; KEY_EVENT_RECORD;
typedef struct _MOUSE_EVENT_RECORD { typedef struct _MOUSE_EVENT_RECORD {
COORD dwMousePosition; COORD dwMousePosition;
DWORD dwButtonState; DWORD dwButtonState;
DWORD dwControlKeyState; DWORD dwControlKeyState;
DWORD dwEventFlags; DWORD dwEventFlags;
} MOUSE_EVENT_RECORD; } MOUSE_EVENT_RECORD;
typedef struct _WINDOW_BUFFER_SIZE_RECORD { COORD dwSize; } WINDOW_BUFFER_SIZE_RECORD; typedef struct _WINDOW_BUFFER_SIZE_RECORD { COORD dwSize; } WINDOW_BUFFER_SIZE_RECORD;
typedef struct _MENU_EVENT_RECORD { UINT dwCommandId; } MENU_EVENT_RECORD,*PMENU_EVENT_RECORD; typedef struct _MENU_EVENT_RECORD { UINT dwCommandId; } MENU_EVENT_RECORD,*PMENU_EVENT_RECORD;
typedef struct _FOCUS_EVENT_RECORD { BOOL bSetFocus; } FOCUS_EVENT_RECORD; typedef struct _FOCUS_EVENT_RECORD { BOOL bSetFocus; } FOCUS_EVENT_RECORD;
typedef struct _INPUT_RECORD { typedef struct _INPUT_RECORD {
WORD EventType; WORD EventType;
union { union {
KEY_EVENT_RECORD KeyEvent; KEY_EVENT_RECORD KeyEvent;
MOUSE_EVENT_RECORD MouseEvent; MOUSE_EVENT_RECORD MouseEvent;
WINDOW_BUFFER_SIZE_RECORD WindowBufferSizeEvent; WINDOW_BUFFER_SIZE_RECORD WindowBufferSizeEvent;
MENU_EVENT_RECORD MenuEvent; MENU_EVENT_RECORD MenuEvent;
FOCUS_EVENT_RECORD FocusEvent; FOCUS_EVENT_RECORD FocusEvent;
} Event; } Event;
} INPUT_RECORD,*PINPUT_RECORD; } INPUT_RECORD,*PINPUT_RECORD;
BOOL WINAPI AllocConsole(void); BOOL WINAPI AllocConsole(void);
HANDLE WINAPI CreateConsoleScreenBuffer(DWORD,DWORD,LPSECURITY_ATTRIBUTES,DWORD,PVOID); HANDLE WINAPI CreateConsoleScreenBuffer(DWORD,DWORD,LPSECURITY_ATTRIBUTES,DWORD,PVOID);
BOOL WINAPI FillConsoleOutputAttribute(HANDLE,WORD,DWORD,COORD,PDWORD); BOOL WINAPI FillConsoleOutputAttribute(HANDLE,WORD,DWORD,COORD,PDWORD);
BOOL WINAPI FillConsoleOutputCharacterA(HANDLE,CHAR,DWORD,COORD,PDWORD); BOOL WINAPI FillConsoleOutputCharacterA(HANDLE,CHAR,DWORD,COORD,PDWORD);
BOOL WINAPI FillConsoleOutputCharacterW(HANDLE,WCHAR,DWORD,COORD,PDWORD); BOOL WINAPI FillConsoleOutputCharacterW(HANDLE,WCHAR,DWORD,COORD,PDWORD);
BOOL WINAPI FlushConsoleInputBuffer(HANDLE); BOOL WINAPI FlushConsoleInputBuffer(HANDLE);
BOOL WINAPI FreeConsole(void); BOOL WINAPI FreeConsole(void);
BOOL WINAPI GenerateConsoleCtrlEvent(DWORD,DWORD); BOOL WINAPI GenerateConsoleCtrlEvent(DWORD,DWORD);
UINT WINAPI GetConsoleCP(void); UINT WINAPI GetConsoleCP(void);
BOOL WINAPI GetConsoleCursorInfo(HANDLE,PCONSOLE_CURSOR_INFO); BOOL WINAPI GetConsoleCursorInfo(HANDLE,PCONSOLE_CURSOR_INFO);
BOOL WINAPI GetConsoleMode(HANDLE,PDWORD); BOOL WINAPI GetConsoleMode(HANDLE,PDWORD);
UINT WINAPI GetConsoleOutputCP(void); UINT WINAPI GetConsoleOutputCP(void);
BOOL WINAPI GetConsoleScreenBufferInfo(HANDLE,PCONSOLE_SCREEN_BUFFER_INFO); BOOL WINAPI GetConsoleScreenBufferInfo(HANDLE,PCONSOLE_SCREEN_BUFFER_INFO);
DWORD WINAPI GetConsoleTitleA(LPSTR,DWORD); DWORD WINAPI GetConsoleTitleA(LPSTR,DWORD);
DWORD WINAPI GetConsoleTitleW(LPWSTR,DWORD); DWORD WINAPI GetConsoleTitleW(LPWSTR,DWORD);
COORD WINAPI GetLargestConsoleWindowSize(HANDLE); COORD WINAPI GetLargestConsoleWindowSize(HANDLE);
BOOL WINAPI GetNumberOfConsoleInputEvents(HANDLE,PDWORD); BOOL WINAPI GetNumberOfConsoleInputEvents(HANDLE,PDWORD);
BOOL WINAPI GetNumberOfConsoleMouseButtons(PDWORD); BOOL WINAPI GetNumberOfConsoleMouseButtons(PDWORD);
BOOL WINAPI PeekConsoleInputA(HANDLE,PINPUT_RECORD,DWORD,PDWORD); BOOL WINAPI PeekConsoleInputA(HANDLE,PINPUT_RECORD,DWORD,PDWORD);
BOOL WINAPI PeekConsoleInputW(HANDLE,PINPUT_RECORD,DWORD,PDWORD); BOOL WINAPI PeekConsoleInputW(HANDLE,PINPUT_RECORD,DWORD,PDWORD);
BOOL WINAPI ReadConsoleA(HANDLE,PVOID,DWORD,PDWORD,PVOID); BOOL WINAPI ReadConsoleA(HANDLE,PVOID,DWORD,PDWORD,PVOID);
BOOL WINAPI ReadConsoleW(HANDLE,PVOID,DWORD,PDWORD,PVOID); BOOL WINAPI ReadConsoleW(HANDLE,PVOID,DWORD,PDWORD,PVOID);
BOOL WINAPI ReadConsoleInputA(HANDLE,PINPUT_RECORD,DWORD,PDWORD); BOOL WINAPI ReadConsoleInputA(HANDLE,PINPUT_RECORD,DWORD,PDWORD);
BOOL WINAPI ReadConsoleInputW(HANDLE,PINPUT_RECORD,DWORD,PDWORD); BOOL WINAPI ReadConsoleInputW(HANDLE,PINPUT_RECORD,DWORD,PDWORD);
BOOL WINAPI ReadConsoleOutputAttribute(HANDLE,LPWORD,DWORD,COORD,LPDWORD); BOOL WINAPI ReadConsoleOutputAttribute(HANDLE,LPWORD,DWORD,COORD,LPDWORD);
BOOL WINAPI ReadConsoleOutputCharacterA(HANDLE,LPSTR,DWORD,COORD,PDWORD); BOOL WINAPI ReadConsoleOutputCharacterA(HANDLE,LPSTR,DWORD,COORD,PDWORD);
BOOL WINAPI ReadConsoleOutputCharacterW(HANDLE,LPWSTR,DWORD,COORD,PDWORD); BOOL WINAPI ReadConsoleOutputCharacterW(HANDLE,LPWSTR,DWORD,COORD,PDWORD);
BOOL WINAPI ReadConsoleOutputA(HANDLE,PCHAR_INFO,COORD,COORD,PSMALL_RECT); BOOL WINAPI ReadConsoleOutputA(HANDLE,PCHAR_INFO,COORD,COORD,PSMALL_RECT);
BOOL WINAPI ReadConsoleOutputW(HANDLE,PCHAR_INFO,COORD,COORD,PSMALL_RECT); BOOL WINAPI ReadConsoleOutputW(HANDLE,PCHAR_INFO,COORD,COORD,PSMALL_RECT);
BOOL WINAPI ScrollConsoleScreenBufferA(HANDLE,const SMALL_RECT*,const SMALL_RECT*,COORD,const CHAR_INFO*); BOOL WINAPI ScrollConsoleScreenBufferA(HANDLE,const SMALL_RECT*,const SMALL_RECT*,COORD,const CHAR_INFO*);
BOOL WINAPI ScrollConsoleScreenBufferW(HANDLE,const SMALL_RECT*,const SMALL_RECT*,COORD,const CHAR_INFO*); BOOL WINAPI ScrollConsoleScreenBufferW(HANDLE,const SMALL_RECT*,const SMALL_RECT*,COORD,const CHAR_INFO*);
BOOL WINAPI SetConsoleActiveScreenBuffer(HANDLE); BOOL WINAPI SetConsoleActiveScreenBuffer(HANDLE);
BOOL WINAPI SetConsoleCP(UINT); BOOL WINAPI SetConsoleCP(UINT);
BOOL WINAPI SetConsoleCtrlHandler(PHANDLER_ROUTINE,BOOL); BOOL WINAPI SetConsoleCtrlHandler(PHANDLER_ROUTINE,BOOL);
BOOL WINAPI SetConsoleCursorInfo(HANDLE,const CONSOLE_CURSOR_INFO*); BOOL WINAPI SetConsoleCursorInfo(HANDLE,const CONSOLE_CURSOR_INFO*);
BOOL WINAPI SetConsoleCursorPosition(HANDLE,COORD); BOOL WINAPI SetConsoleCursorPosition(HANDLE,COORD);
BOOL WINAPI SetConsoleMode(HANDLE,DWORD); BOOL WINAPI SetConsoleMode(HANDLE,DWORD);
BOOL WINAPI SetConsoleOutputCP(UINT); BOOL WINAPI SetConsoleOutputCP(UINT);
BOOL WINAPI SetConsoleScreenBufferSize(HANDLE,COORD); BOOL WINAPI SetConsoleScreenBufferSize(HANDLE,COORD);
BOOL WINAPI SetConsoleTextAttribute(HANDLE,WORD); BOOL WINAPI SetConsoleTextAttribute(HANDLE,WORD);
BOOL WINAPI SetConsoleTitleA(LPCSTR); BOOL WINAPI SetConsoleTitleA(LPCSTR);
BOOL WINAPI SetConsoleTitleW(LPCWSTR); BOOL WINAPI SetConsoleTitleW(LPCWSTR);
BOOL WINAPI SetConsoleWindowInfo(HANDLE,BOOL,const SMALL_RECT*); BOOL WINAPI SetConsoleWindowInfo(HANDLE,BOOL,const SMALL_RECT*);
BOOL WINAPI WriteConsoleA(HANDLE,PCVOID,DWORD,PDWORD,PVOID); BOOL WINAPI WriteConsoleA(HANDLE,PCVOID,DWORD,PDWORD,PVOID);
BOOL WINAPI WriteConsoleW(HANDLE,PCVOID,DWORD,PDWORD,PVOID); BOOL WINAPI WriteConsoleW(HANDLE,PCVOID,DWORD,PDWORD,PVOID);
BOOL WINAPI WriteConsoleInputA(HANDLE,const INPUT_RECORD*,DWORD,PDWORD); BOOL WINAPI WriteConsoleInputA(HANDLE,const INPUT_RECORD*,DWORD,PDWORD);
BOOL WINAPI WriteConsoleInputW(HANDLE,const INPUT_RECORD*,DWORD,PDWORD); BOOL WINAPI WriteConsoleInputW(HANDLE,const INPUT_RECORD*,DWORD,PDWORD);
BOOL WINAPI WriteConsoleOutputA(HANDLE,const CHAR_INFO*,COORD,COORD,PSMALL_RECT); BOOL WINAPI WriteConsoleOutputA(HANDLE,const CHAR_INFO*,COORD,COORD,PSMALL_RECT);
BOOL WINAPI WriteConsoleOutputW(HANDLE,const CHAR_INFO*,COORD,COORD,PSMALL_RECT); BOOL WINAPI WriteConsoleOutputW(HANDLE,const CHAR_INFO*,COORD,COORD,PSMALL_RECT);
BOOL WINAPI WriteConsoleOutputAttribute(HANDLE,const WORD*,DWORD,COORD,PDWORD); BOOL WINAPI WriteConsoleOutputAttribute(HANDLE,const WORD*,DWORD,COORD,PDWORD);
BOOL WINAPI WriteConsoleOutputCharacterA(HANDLE,LPCSTR,DWORD,COORD,PDWORD); BOOL WINAPI WriteConsoleOutputCharacterA(HANDLE,LPCSTR,DWORD,COORD,PDWORD);
BOOL WINAPI WriteConsoleOutputCharacterW(HANDLE,LPCWSTR,DWORD,COORD,PDWORD); BOOL WINAPI WriteConsoleOutputCharacterW(HANDLE,LPCWSTR,DWORD,COORD,PDWORD);
#ifdef UNICODE #ifdef UNICODE
#define FillConsoleOutputCharacter FillConsoleOutputCharacterW #define FillConsoleOutputCharacter FillConsoleOutputCharacterW
#define GetConsoleTitle GetConsoleTitleW #define GetConsoleTitle GetConsoleTitleW
#define PeekConsoleInput PeekConsoleInputW #define PeekConsoleInput PeekConsoleInputW
#define ReadConsole ReadConsoleW #define ReadConsole ReadConsoleW
#define ReadConsoleInput ReadConsoleInputW #define ReadConsoleInput ReadConsoleInputW
#define ReadConsoleOutput ReadConsoleOutputW #define ReadConsoleOutput ReadConsoleOutputW
#define ReadConsoleOutputCharacter ReadConsoleOutputCharacterW #define ReadConsoleOutputCharacter ReadConsoleOutputCharacterW
#define ScrollConsoleScreenBuffer ScrollConsoleScreenBufferW #define ScrollConsoleScreenBuffer ScrollConsoleScreenBufferW
#define SetConsoleTitle SetConsoleTitleW #define SetConsoleTitle SetConsoleTitleW
#define WriteConsole WriteConsoleW #define WriteConsole WriteConsoleW
#define WriteConsoleInput WriteConsoleInputW #define WriteConsoleInput WriteConsoleInputW
#define WriteConsoleOutput WriteConsoleOutputW #define WriteConsoleOutput WriteConsoleOutputW
#define WriteConsoleOutputCharacter WriteConsoleOutputCharacterW #define WriteConsoleOutputCharacter WriteConsoleOutputCharacterW
#else #else
#define FillConsoleOutputCharacter FillConsoleOutputCharacterA #define FillConsoleOutputCharacter FillConsoleOutputCharacterA
#define GetConsoleTitle GetConsoleTitleA #define GetConsoleTitle GetConsoleTitleA
#define PeekConsoleInput PeekConsoleInputA #define PeekConsoleInput PeekConsoleInputA
#define ReadConsole ReadConsoleA #define ReadConsole ReadConsoleA
#define ReadConsoleInput ReadConsoleInputA #define ReadConsoleInput ReadConsoleInputA
#define ReadConsoleOutput ReadConsoleOutputA #define ReadConsoleOutput ReadConsoleOutputA
#define ReadConsoleOutputCharacter ReadConsoleOutputCharacterA #define ReadConsoleOutputCharacter ReadConsoleOutputCharacterA
#define ScrollConsoleScreenBuffer ScrollConsoleScreenBufferA #define ScrollConsoleScreenBuffer ScrollConsoleScreenBufferA
#define SetConsoleTitle SetConsoleTitleA #define SetConsoleTitle SetConsoleTitleA
#define WriteConsole WriteConsoleA #define WriteConsole WriteConsoleA
#define WriteConsoleInput WriteConsoleInputA #define WriteConsoleInput WriteConsoleInputA
#define WriteConsoleOutput WriteConsoleOutputA #define WriteConsoleOutput WriteConsoleOutputA
#define WriteConsoleOutputCharacter WriteConsoleOutputCharacterA #define WriteConsoleOutputCharacter WriteConsoleOutputCharacterA
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif

View File

@ -1,240 +1,240 @@
#ifndef _WINDEF_H #ifndef _WINDEF_H
#define _WINDEF_H #define _WINDEF_H
#if __GNUC__ >=3 #if __GNUC__ >=3
#pragma GCC system_header #pragma GCC system_header
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#ifndef WINVER #ifndef WINVER
#define WINVER 0x0400 #define WINVER 0x0400
#endif #endif
#ifndef _WIN32_WINNT #ifndef _WIN32_WINNT
#define _WIN32_WINNT WINVER #define _WIN32_WINNT WINVER
#endif #endif
#ifndef WIN32 #ifndef WIN32
#define WIN32 #define WIN32
#endif #endif
#ifndef _WIN32 #ifndef _WIN32
#define _WIN32 #define _WIN32
#endif #endif
#define FAR #define FAR
#define far #define far
#define NEAR #define NEAR
#define near #define near
#ifndef CONST #ifndef CONST
#define CONST const #define CONST const
#endif #endif
#undef MAX_PATH #undef MAX_PATH
#define MAX_PATH 260 #define MAX_PATH 260
#ifndef NULL #ifndef NULL
#ifdef __cplusplus #ifdef __cplusplus
#define NULL 0 #define NULL 0
#else #else
#define NULL ((void*)0) #define NULL ((void*)0)
#endif #endif
#endif #endif
#ifndef FALSE #ifndef FALSE
#define FALSE 0 #define FALSE 0
#endif #endif
#ifndef TRUE #ifndef TRUE
#define TRUE 1 #define TRUE 1
#endif #endif
#define IN #define IN
#define OUT #define OUT
#ifndef OPTIONAL #ifndef OPTIONAL
#define OPTIONAL #define OPTIONAL
#endif #endif
#ifdef __GNUC__ #ifdef __GNUC__
#define PACKED __attribute__((packed)) #define PACKED __attribute__((packed))
#ifndef _stdcall #ifndef _stdcall
#define _stdcall __attribute__((stdcall)) #define _stdcall __attribute__((stdcall))
#endif #endif
#ifndef __stdcall #ifndef __stdcall
#define __stdcall __attribute__((stdcall)) #define __stdcall __attribute__((stdcall))
#endif #endif
#ifndef _cdecl #ifndef _cdecl
#define _cdecl __attribute__((cdecl)) #define _cdecl __attribute__((cdecl))
#endif #endif
#ifndef __cdecl #ifndef __cdecl
#define __cdecl __attribute__((cdecl)) #define __cdecl __attribute__((cdecl))
#endif #endif
#ifndef __declspec #ifndef __declspec
#define __declspec(e) __attribute__((e)) #define __declspec(e) __attribute__((e))
#endif #endif
#ifndef _declspec #ifndef _declspec
#define _declspec(e) __attribute__((e)) #define _declspec(e) __attribute__((e))
#endif #endif
#else #else
#define PACKED #define PACKED
#define _cdecl #define _cdecl
#define __cdecl #define __cdecl
#endif #endif
#undef pascal #undef pascal
#undef _pascal #undef _pascal
#undef __pascal #undef __pascal
#define pascal __stdcall #define pascal __stdcall
#define _pascal __stdcall #define _pascal __stdcall
#define __pascal __stdcall #define __pascal __stdcall
#define PASCAL _pascal #define PASCAL _pascal
#define CDECL _cdecl #define CDECL _cdecl
#define STDCALL __stdcall #define STDCALL __stdcall
#define WINAPI __stdcall #define WINAPI __stdcall
#define WINAPIV __cdecl #define WINAPIV __cdecl
#define APIENTRY __stdcall #define APIENTRY __stdcall
#define CALLBACK __stdcall #define CALLBACK __stdcall
#define APIPRIVATE __stdcall #define APIPRIVATE __stdcall
#define DECLSPEC_IMPORT __declspec(dllimport) #define DECLSPEC_IMPORT __declspec(dllimport)
#define DECLSPEC_EXPORT __declspec(dllexport) #define DECLSPEC_EXPORT __declspec(dllexport)
#ifdef __GNUC__ #ifdef __GNUC__
#define DECLSPEC_NORETURN __declspec(noreturn) #define DECLSPEC_NORETURN __declspec(noreturn)
#define DECLARE_STDCALL_P( type ) __stdcall type #define DECLARE_STDCALL_P( type ) __stdcall type
#elif defined(__WATCOMC__) #elif defined(__WATCOMC__)
#define DECLSPEC_NORETURN #define DECLSPEC_NORETURN
#define DECLARE_STDCALL_P( type ) type __stdcall #define DECLARE_STDCALL_P( type ) type __stdcall
#endif /* __GNUC__/__WATCOMC__ */ #endif /* __GNUC__/__WATCOMC__ */
#define MAKEWORD(a,b) ((WORD)(((BYTE)(a))|(((WORD)((BYTE)(b)))<<8))) #define MAKEWORD(a,b) ((WORD)(((BYTE)(a))|(((WORD)((BYTE)(b)))<<8)))
#define MAKELONG(a,b) ((LONG)(((WORD)(a))|(((DWORD)((WORD)(b)))<<16))) #define MAKELONG(a,b) ((LONG)(((WORD)(a))|(((DWORD)((WORD)(b)))<<16)))
#define LOWORD(l) ((WORD)((DWORD)(l))) #define LOWORD(l) ((WORD)((DWORD)(l)))
#define HIWORD(l) ((WORD)(((DWORD)(l)>>16)&0xFFFF)) #define HIWORD(l) ((WORD)(((DWORD)(l)>>16)&0xFFFF))
#define LOBYTE(w) ((BYTE)(w)) #define LOBYTE(w) ((BYTE)(w))
#define HIBYTE(w) ((BYTE)(((WORD)(w)>>8)&0xFF)) #define HIBYTE(w) ((BYTE)(((WORD)(w)>>8)&0xFF))
#ifndef _export #ifndef _export
#define _export #define _export
#endif #endif
#ifndef __export #ifndef __export
#define __export #define __export
#endif #endif
#ifndef NOMINMAX #ifndef NOMINMAX
#ifndef max #ifndef max
#define max(a,b) ((a)>(b)?(a):(b)) #define max(a,b) ((a)>(b)?(a):(b))
#endif #endif
#ifndef min #ifndef min
#define min(a,b) ((a)<(b)?(a):(b)) #define min(a,b) ((a)<(b)?(a):(b))
#endif #endif
#endif #endif
#define UNREFERENCED_PARAMETER(P) {(P)=(P);} #define UNREFERENCED_PARAMETER(P) {(P)=(P);}
#define UNREFERENCED_LOCAL_VARIABLE(L) {(L)=(L);} #define UNREFERENCED_LOCAL_VARIABLE(L) {(L)=(L);}
#define DBG_UNREFERENCED_PARAMETER(P) #define DBG_UNREFERENCED_PARAMETER(P)
#define DBG_UNREFERENCED_LOCAL_VARIABLE(L) #define DBG_UNREFERENCED_LOCAL_VARIABLE(L)
typedef unsigned long DWORD; typedef unsigned long DWORD;
typedef int WINBOOL,*PWINBOOL,*LPWINBOOL; typedef int WINBOOL,*PWINBOOL,*LPWINBOOL;
/* FIXME: Is there a good solution to this? */ /* FIXME: Is there a good solution to this? */
#ifndef XFree86Server #ifndef XFree86Server
#ifndef __OBJC__ #ifndef __OBJC__
typedef WINBOOL BOOL; typedef WINBOOL BOOL;
#else #else
#define BOOL WINBOOL #define BOOL WINBOOL
#endif #endif
typedef unsigned char BYTE; typedef unsigned char BYTE;
#endif /* ndef XFree86Server */ #endif /* ndef XFree86Server */
typedef BOOL *PBOOL,*LPBOOL; typedef BOOL *PBOOL,*LPBOOL;
typedef unsigned short WORD; typedef unsigned short WORD;
typedef float FLOAT; typedef float FLOAT;
typedef FLOAT *PFLOAT; typedef FLOAT *PFLOAT;
typedef BYTE *PBYTE,*LPBYTE; typedef BYTE *PBYTE,*LPBYTE;
typedef int *PINT,*LPINT; typedef int *PINT,*LPINT;
typedef WORD *PWORD,*LPWORD; typedef WORD *PWORD,*LPWORD;
typedef long *LPLONG; typedef long *LPLONG;
typedef DWORD *PDWORD,*LPDWORD; typedef DWORD *PDWORD,*LPDWORD;
typedef void *PVOID,*LPVOID; typedef void *PVOID,*LPVOID;
typedef CONST void *PCVOID,*LPCVOID; typedef CONST void *PCVOID,*LPCVOID;
typedef int INT; typedef int INT;
typedef unsigned int UINT,*PUINT,*LPUINT; typedef unsigned int UINT,*PUINT,*LPUINT;
#include <winnt.h> #include <winnt.h>
typedef UINT WPARAM; typedef UINT WPARAM;
typedef LONG LPARAM; typedef LONG LPARAM;
typedef LONG LRESULT; typedef LONG LRESULT;
#ifndef _HRESULT_DEFINED #ifndef _HRESULT_DEFINED
typedef LONG HRESULT; typedef LONG HRESULT;
#define _HRESULT_DEFINED #define _HRESULT_DEFINED
#endif #endif
#ifndef XFree86Server #ifndef XFree86Server
typedef WORD ATOM; typedef WORD ATOM;
#endif /* XFree86Server */ #endif /* XFree86Server */
typedef HANDLE HGLOBAL; typedef HANDLE HGLOBAL;
typedef HANDLE HLOCAL; typedef HANDLE HLOCAL;
typedef HANDLE GLOBALHANDLE; typedef HANDLE GLOBALHANDLE;
typedef HANDLE LOCALHANDLE; typedef HANDLE LOCALHANDLE;
typedef void *HGDIOBJ; typedef void *HGDIOBJ;
DECLARE_HANDLE(HACCEL); DECLARE_HANDLE(HACCEL);
DECLARE_HANDLE(HBITMAP); DECLARE_HANDLE(HBITMAP);
DECLARE_HANDLE(HBRUSH); DECLARE_HANDLE(HBRUSH);
DECLARE_HANDLE(HCOLORSPACE); DECLARE_HANDLE(HCOLORSPACE);
DECLARE_HANDLE(HDC); DECLARE_HANDLE(HDC);
DECLARE_HANDLE(HGLRC); DECLARE_HANDLE(HGLRC);
DECLARE_HANDLE(HDESK); DECLARE_HANDLE(HDESK);
DECLARE_HANDLE(HENHMETAFILE); DECLARE_HANDLE(HENHMETAFILE);
DECLARE_HANDLE(HFONT); DECLARE_HANDLE(HFONT);
DECLARE_HANDLE(HICON); DECLARE_HANDLE(HICON);
DECLARE_HANDLE(HKEY); DECLARE_HANDLE(HKEY);
/* FIXME: How to handle these. SM_CMONITORS etc in winuser.h also. */ /* FIXME: How to handle these. SM_CMONITORS etc in winuser.h also. */
/* #if (WINVER >= 0x0500) */ /* #if (WINVER >= 0x0500) */
DECLARE_HANDLE(HMONITOR); DECLARE_HANDLE(HMONITOR);
#define HMONITOR_DECLARED 1 #define HMONITOR_DECLARED 1
DECLARE_HANDLE(HTERMINAL); DECLARE_HANDLE(HTERMINAL);
DECLARE_HANDLE(HWINEVENTHOOK); DECLARE_HANDLE(HWINEVENTHOOK);
/* #endif */ /* #endif */
typedef HKEY *PHKEY; typedef HKEY *PHKEY;
DECLARE_HANDLE(HMENU); DECLARE_HANDLE(HMENU);
DECLARE_HANDLE(HMETAFILE); DECLARE_HANDLE(HMETAFILE);
DECLARE_HANDLE(HINSTANCE); DECLARE_HANDLE(HINSTANCE);
typedef HINSTANCE HMODULE; typedef HINSTANCE HMODULE;
DECLARE_HANDLE(HPALETTE); DECLARE_HANDLE(HPALETTE);
DECLARE_HANDLE(HPEN); DECLARE_HANDLE(HPEN);
DECLARE_HANDLE(HRGN); DECLARE_HANDLE(HRGN);
DECLARE_HANDLE(HRSRC); DECLARE_HANDLE(HRSRC);
DECLARE_HANDLE(HSTR); DECLARE_HANDLE(HSTR);
DECLARE_HANDLE(HTASK); DECLARE_HANDLE(HTASK);
DECLARE_HANDLE(HWND); DECLARE_HANDLE(HWND);
DECLARE_HANDLE(HWINSTA); DECLARE_HANDLE(HWINSTA);
DECLARE_HANDLE(HKL); DECLARE_HANDLE(HKL);
typedef int HFILE; typedef int HFILE;
typedef HICON HCURSOR; typedef HICON HCURSOR;
typedef DWORD COLORREF; typedef DWORD COLORREF;
typedef int (WINAPI *FARPROC)(); typedef int (WINAPI *FARPROC)();
typedef int (WINAPI *NEARPROC)(); typedef int (WINAPI *NEARPROC)();
typedef int (WINAPI *PROC)(); typedef int (WINAPI *PROC)();
typedef struct tagRECT { typedef struct tagRECT {
LONG left; LONG left;
LONG top; LONG top;
LONG right; LONG right;
LONG bottom; LONG bottom;
} RECT,*PRECT,*LPRECT; } RECT,*PRECT,*LPRECT;
typedef const RECT *LPCRECT; typedef const RECT *LPCRECT;
typedef struct tagRECTL { typedef struct tagRECTL {
LONG left; LONG left;
LONG top; LONG top;
LONG right; LONG right;
LONG bottom; LONG bottom;
} RECTL,*PRECTL,*LPRECTL; } RECTL,*PRECTL,*LPRECTL;
typedef const RECTL *LPCRECTL; typedef const RECTL *LPCRECTL;
typedef struct tagPOINT { typedef struct tagPOINT {
LONG x; LONG x;
LONG y; LONG y;
} POINT,POINTL,*PPOINT,*LPPOINT,*PPOINTL,*LPPOINTL; } POINT,POINTL,*PPOINT,*LPPOINT,*PPOINTL,*LPPOINTL;
typedef struct tagSIZE { typedef struct tagSIZE {
LONG cx; LONG cx;
LONG cy; LONG cy;
} SIZE,SIZEL,*PSIZE,*LPSIZE,*PSIZEL,*LPSIZEL; } SIZE,SIZEL,*PSIZE,*LPSIZE,*PSIZEL,*LPSIZEL;
typedef struct tagPOINTS { typedef struct tagPOINTS {
SHORT x; SHORT x;
SHORT y; SHORT y;
} POINTS,*PPOINTS,*LPPOINTS; } POINTS,*PPOINTS,*LPPOINTS;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif

View File

@ -1,176 +1,176 @@
/* /*
windows.h - main header file for the Win32 API windows.h - main header file for the Win32 API
Written by Anders Norlander <anorland@hem2.passagen.se> Written by Anders Norlander <anorland@hem2.passagen.se>
This file is part of a free library for the Win32 API. This file is part of a free library for the Win32 API.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/ */
#ifndef _WINDOWS_H #ifndef _WINDOWS_H
#define _WINDOWS_H #define _WINDOWS_H
#if __GNUC__ >=3 #if __GNUC__ >=3
#pragma GCC system_header #pragma GCC system_header
#endif #endif
/* translate GCC target defines to MS equivalents. Keep this synchronized /* translate GCC target defines to MS equivalents. Keep this synchronized
with winnt.h. */ with winnt.h. */
#if defined(__i686__) && !defined(_M_IX86) #if defined(__i686__) && !defined(_M_IX86)
#define _M_IX86 600 #define _M_IX86 600
#elif defined(__i586__) && !defined(_M_IX86) #elif defined(__i586__) && !defined(_M_IX86)
#define _M_IX86 500 #define _M_IX86 500
#elif defined(__i486__) && !defined(_M_IX86) #elif defined(__i486__) && !defined(_M_IX86)
#define _M_IX86 400 #define _M_IX86 400
#elif defined(__i386__) && !defined(_M_IX86) #elif defined(__i386__) && !defined(_M_IX86)
#define _M_IX86 300 #define _M_IX86 300
#endif #endif
#if defined(_M_IX86) && !defined(_X86_) #if defined(_M_IX86) && !defined(_X86_)
#define _X86_ #define _X86_
#elif defined(_M_ALPHA) && !defined(_ALPHA_) #elif defined(_M_ALPHA) && !defined(_ALPHA_)
#define _ALPHA_ #define _ALPHA_
#elif defined(_M_PPC) && !defined(_PPC_) #elif defined(_M_PPC) && !defined(_PPC_)
#define _PPC_ #define _PPC_
#elif defined(_M_MRX000) && !defined(_MIPS_) #elif defined(_M_MRX000) && !defined(_MIPS_)
#define _MIPS_ #define _MIPS_
#elif defined(_M_M68K) && !defined(_68K_) #elif defined(_M_M68K) && !defined(_68K_)
#define _68K_ #define _68K_
#endif #endif
#ifdef RC_INVOKED #ifdef RC_INVOKED
/* winresrc.h includes the necessary headers */ /* winresrc.h includes the necessary headers */
#include <winresrc.h> #include <winresrc.h>
#else #else
#ifdef __GNUC__ #ifdef __GNUC__
#ifndef NONAMELESSUNION #ifndef NONAMELESSUNION
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
#define _ANONYMOUS_UNION __extension__ #define _ANONYMOUS_UNION __extension__
#define _ANONYMOUS_STRUCT __extension__ #define _ANONYMOUS_STRUCT __extension__
#else #else
#if defined(__cplusplus) #if defined(__cplusplus)
#define _ANONYMOUS_UNION __extension__ #define _ANONYMOUS_UNION __extension__
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) */ #endif /* __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) */
#endif /* NONAMELESSUNION */ #endif /* NONAMELESSUNION */
#elif defined(__WATCOMC__) #elif defined(__WATCOMC__)
#define _ANONYMOUS_UNION #define _ANONYMOUS_UNION
#define _ANONYMOUS_STRUCT #define _ANONYMOUS_STRUCT
#endif /* __GNUC__/__WATCOMC__ */ #endif /* __GNUC__/__WATCOMC__ */
#ifndef _ANONYMOUS_UNION #ifndef _ANONYMOUS_UNION
#define _ANONYMOUS_UNION #define _ANONYMOUS_UNION
#define _UNION_NAME(x) x #define _UNION_NAME(x) x
#define DUMMYUNIONNAME u #define DUMMYUNIONNAME u
#define DUMMYUNIONNAME2 u2 #define DUMMYUNIONNAME2 u2
#define DUMMYUNIONNAME3 u3 #define DUMMYUNIONNAME3 u3
#define DUMMYUNIONNAME4 u4 #define DUMMYUNIONNAME4 u4
#define DUMMYUNIONNAME5 u5 #define DUMMYUNIONNAME5 u5
#define DUMMYUNIONNAME6 u6 #define DUMMYUNIONNAME6 u6
#define DUMMYUNIONNAME7 u7 #define DUMMYUNIONNAME7 u7
#define DUMMYUNIONNAME8 u8 #define DUMMYUNIONNAME8 u8
#else #else
#define _UNION_NAME(x) #define _UNION_NAME(x)
#define DUMMYUNIONNAME #define DUMMYUNIONNAME
#define DUMMYUNIONNAME2 #define DUMMYUNIONNAME2
#define DUMMYUNIONNAME3 #define DUMMYUNIONNAME3
#define DUMMYUNIONNAME4 #define DUMMYUNIONNAME4
#define DUMMYUNIONNAME5 #define DUMMYUNIONNAME5
#define DUMMYUNIONNAME6 #define DUMMYUNIONNAME6
#define DUMMYUNIONNAME7 #define DUMMYUNIONNAME7
#define DUMMYUNIONNAME8 #define DUMMYUNIONNAME8
#endif #endif
#ifndef _ANONYMOUS_STRUCT #ifndef _ANONYMOUS_STRUCT
#define _ANONYMOUS_STRUCT #define _ANONYMOUS_STRUCT
#define _STRUCT_NAME(x) x #define _STRUCT_NAME(x) x
#define DUMMYSTRUCTNAME s #define DUMMYSTRUCTNAME s
#define DUMMYSTRUCTNAME2 s2 #define DUMMYSTRUCTNAME2 s2
#define DUMMYSTRUCTNAME3 s3 #define DUMMYSTRUCTNAME3 s3
#else #else
#define _STRUCT_NAME(x) #define _STRUCT_NAME(x)
#define DUMMYSTRUCTNAME #define DUMMYSTRUCTNAME
#define DUMMYSTRUCTNAME2 #define DUMMYSTRUCTNAME2
#define DUMMYSTRUCTNAME3 #define DUMMYSTRUCTNAME3
#endif #endif
#ifndef NO_STRICT #ifndef NO_STRICT
#ifndef STRICT #ifndef STRICT
#define STRICT 1 #define STRICT 1
#endif #endif
#endif #endif
#include <stdarg.h> #include <stdarg.h>
#include <windef.h> #include <windef.h>
#include <wincon.h> #include <wincon.h>
#include <basetyps.h> #include <basetyps.h>
#include <excpt.h> #include <excpt.h>
#include <winbase.h> #include <winbase.h>
#ifndef _WINGDI_H #ifndef _WINGDI_H
#include <wingdi.h> #include <wingdi.h>
#endif #endif
#ifndef _WINUSER_H #ifndef _WINUSER_H
#include <winuser.h> #include <winuser.h>
#endif #endif
#ifndef _WINNLS_H #ifndef _WINNLS_H
#include <winnls.h> #include <winnls.h>
#endif #endif
#ifndef _WINVER_H #ifndef _WINVER_H
#include <winver.h> #include <winver.h>
#endif #endif
#ifndef _WINNETWK_H #ifndef _WINNETWK_H
#include <winnetwk.h> #include <winnetwk.h>
#endif #endif
#ifndef _WINREG_H #ifndef _WINREG_H
#include <winreg.h> #include <winreg.h>
#endif #endif
#ifndef _WINSVC_H #ifndef _WINSVC_H
#include <winsvc.h> #include <winsvc.h>
#endif #endif
#ifndef WIN32_LEAN_AND_MEAN #ifndef WIN32_LEAN_AND_MEAN
#include <commdlg.h> #include <commdlg.h>
#include <cderr.h> #include <cderr.h>
#include <dde.h> #include <dde.h>
#include <ddeml.h> #include <ddeml.h>
#include <dlgs.h> #include <dlgs.h>
#include <lzexpand.h> #include <lzexpand.h>
#include <mmsystem.h> #include <mmsystem.h>
#include <nb30.h> #include <nb30.h>
#include <rpc.h> #include <rpc.h>
#include <shellapi.h> #include <shellapi.h>
#include <winperf.h> #include <winperf.h>
#include <winspool.h> #include <winspool.h>
#if defined(Win32_Winsock) #if defined(Win32_Winsock)
#warning "The Win32_Winsock macro name is deprecated.\ #warning "The Win32_Winsock macro name is deprecated.\
Please use __USE_W32_SOCKETS instead" Please use __USE_W32_SOCKETS instead"
#ifndef __USE_W32_SOCKETS #ifndef __USE_W32_SOCKETS
#define __USE_W32_SOCKETS #define __USE_W32_SOCKETS
#endif #endif
#endif #endif
#if defined(__USE_W32_SOCKETS) || !(defined(__CYGWIN__) || defined(__MSYS__) || defined(_UWIN)) #if defined(__USE_W32_SOCKETS) || !(defined(__CYGWIN__) || defined(__MSYS__) || defined(_UWIN))
#if (_WIN32_WINNT >= 0x0400) #if (_WIN32_WINNT >= 0x0400)
#include <winsock2.h> #include <winsock2.h>
/* /*
* MS likes to include mswsock.h here as well, * MS likes to include mswsock.h here as well,
* but that can cause undefined symbols if * but that can cause undefined symbols if
* winsock2.h is included before windows.h * winsock2.h is included before windows.h
*/ */
#else #else
#include <winsock.h> #include <winsock.h>
#endif /* (_WIN32_WINNT >= 0x0400) */ #endif /* (_WIN32_WINNT >= 0x0400) */
#endif #endif
#endif /* WIN32_LEAN_AND_MEAN */ #endif /* WIN32_LEAN_AND_MEAN */
#endif /* RC_INVOKED */ #endif /* RC_INVOKED */
#ifdef __OBJC__ #ifdef __OBJC__
/* FIXME: Not undefining BOOL here causes all BOOLs to be WINBOOL (int), /* FIXME: Not undefining BOOL here causes all BOOLs to be WINBOOL (int),
but undefining it causes trouble as well if a file is included after but undefining it causes trouble as well if a file is included after
windows.h windows.h
*/ */
#undef BOOL #undef BOOL
#endif #endif
#endif #endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,346 +1,346 @@
#ifndef _WINNETWK_H #ifndef _WINNETWK_H
#define _WINNETWK_H #define _WINNETWK_H
#if __GNUC__ >=3 #if __GNUC__ >=3
#pragma GCC system_header #pragma GCC system_header
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#define WNNC_NET_MSNET 0x00010000 #define WNNC_NET_MSNET 0x00010000
#define WNNC_NET_LANMAN 0x00020000 #define WNNC_NET_LANMAN 0x00020000
#define WNNC_NET_NETWARE 0x00030000 #define WNNC_NET_NETWARE 0x00030000
#define WNNC_NET_VINES 0x00040000 #define WNNC_NET_VINES 0x00040000
#define WNNC_NET_10NET 0x00050000 #define WNNC_NET_10NET 0x00050000
#define WNNC_NET_LOCUS 0x00060000 #define WNNC_NET_LOCUS 0x00060000
#define WNNC_NET_SUN_PC_NFS 0x00070000 #define WNNC_NET_SUN_PC_NFS 0x00070000
#define WNNC_NET_LANSTEP 0x00080000 #define WNNC_NET_LANSTEP 0x00080000
#define WNNC_NET_9TILES 0x00090000 #define WNNC_NET_9TILES 0x00090000
#define WNNC_NET_LANTASTIC 0x000A0000 #define WNNC_NET_LANTASTIC 0x000A0000
#define WNNC_NET_AS400 0x000B0000 #define WNNC_NET_AS400 0x000B0000
#define WNNC_NET_FTP_NFS 0x000C0000 #define WNNC_NET_FTP_NFS 0x000C0000
#define WNNC_NET_PATHWORKS 0x000D0000 #define WNNC_NET_PATHWORKS 0x000D0000
#define WNNC_NET_LIFENET 0x000E0000 #define WNNC_NET_LIFENET 0x000E0000
#define WNNC_NET_POWERLAN 0x000F0000 #define WNNC_NET_POWERLAN 0x000F0000
#define WNNC_NET_BWNFS 0x00100000 #define WNNC_NET_BWNFS 0x00100000
#define WNNC_NET_COGENT 0x00110000 #define WNNC_NET_COGENT 0x00110000
#define WNNC_NET_FARALLON 0x00120000 #define WNNC_NET_FARALLON 0x00120000
#define WNNC_NET_APPLETALK 0x00130000 #define WNNC_NET_APPLETALK 0x00130000
#define WNNC_NET_INTERGRAPH 0x00140000 #define WNNC_NET_INTERGRAPH 0x00140000
#define WNNC_NET_SYMFONET 0x00150000 #define WNNC_NET_SYMFONET 0x00150000
#define WNNC_NET_CLEARCASE 0x00160000 #define WNNC_NET_CLEARCASE 0x00160000
#define WNNC_NET_FRONTIER 0x00170000 #define WNNC_NET_FRONTIER 0x00170000
#define WNNC_NET_BMC 0x00180000 #define WNNC_NET_BMC 0x00180000
#define WNNC_NET_DCE 0x00190000 #define WNNC_NET_DCE 0x00190000
#define WNNC_NET_AVID 0x001A0000 #define WNNC_NET_AVID 0x001A0000
#define WNNC_NET_DOCUSPACE 0x001B0000 #define WNNC_NET_DOCUSPACE 0x001B0000
#define WNNC_NET_MANGOSOFT 0x001C0000 #define WNNC_NET_MANGOSOFT 0x001C0000
#define WNNC_NET_SERNET 0x001D0000 #define WNNC_NET_SERNET 0x001D0000
#define WNNC_NET_DECORB 0x00200000 #define WNNC_NET_DECORB 0x00200000
#define WNNC_NET_PROTSTOR 0x00210000 #define WNNC_NET_PROTSTOR 0x00210000
#define WNNC_NET_FJ_REDIR 0x00220000 #define WNNC_NET_FJ_REDIR 0x00220000
#define WNNC_NET_DISTINCT 0x00230000 #define WNNC_NET_DISTINCT 0x00230000
#define WNNC_NET_TWINS 0x00240000 #define WNNC_NET_TWINS 0x00240000
#define WNNC_NET_RDR2SAMPLE 0x00250000 #define WNNC_NET_RDR2SAMPLE 0x00250000
#define WNNC_NET_CSC 0x00260000 #define WNNC_NET_CSC 0x00260000
#define WNNC_NET_3IN1 0x00270000 #define WNNC_NET_3IN1 0x00270000
#define WNNC_NET_EXTENDNET 0x00290000 #define WNNC_NET_EXTENDNET 0x00290000
#define WNNC_NET_OBJECT_DIRE 0x00300000 #define WNNC_NET_OBJECT_DIRE 0x00300000
#define WNNC_NET_MASFAX 0x00310000 #define WNNC_NET_MASFAX 0x00310000
#define WNNC_NET_HOB_NFS 0x00320000 #define WNNC_NET_HOB_NFS 0x00320000
#define WNNC_NET_SHIVA 0x00330000 #define WNNC_NET_SHIVA 0x00330000
#define WNNC_NET_IBMAL 0x00340000 #define WNNC_NET_IBMAL 0x00340000
#define WNNC_CRED_MANAGER 0xFFFF0000 #define WNNC_CRED_MANAGER 0xFFFF0000
#define RESOURCE_CONNECTED 1 #define RESOURCE_CONNECTED 1
#define RESOURCE_GLOBALNET 2 #define RESOURCE_GLOBALNET 2
#define RESOURCE_REMEMBERED 3 #define RESOURCE_REMEMBERED 3
#define RESOURCE_RECENT 4 #define RESOURCE_RECENT 4
#define RESOURCE_CONTEXT 5 #define RESOURCE_CONTEXT 5
#define RESOURCETYPE_ANY 0 #define RESOURCETYPE_ANY 0
#define RESOURCETYPE_DISK 1 #define RESOURCETYPE_DISK 1
#define RESOURCETYPE_PRINT 2 #define RESOURCETYPE_PRINT 2
#define RESOURCETYPE_RESERVED 8 #define RESOURCETYPE_RESERVED 8
#define RESOURCETYPE_UNKNOWN 0xFFFFFFFF #define RESOURCETYPE_UNKNOWN 0xFFFFFFFF
#define RESOURCEUSAGE_CONNECTABLE 0x00000001 #define RESOURCEUSAGE_CONNECTABLE 0x00000001
#define RESOURCEUSAGE_CONTAINER 0x00000002 #define RESOURCEUSAGE_CONTAINER 0x00000002
#define RESOURCEUSAGE_NOLOCALDEVICE 0x00000004 #define RESOURCEUSAGE_NOLOCALDEVICE 0x00000004
#define RESOURCEUSAGE_SIBLING 0x00000008 #define RESOURCEUSAGE_SIBLING 0x00000008
#define RESOURCEUSAGE_ATTACHED 0x00000010 #define RESOURCEUSAGE_ATTACHED 0x00000010
#define RESOURCEUSAGE_ALL (RESOURCEUSAGE_CONNECTABLE | RESOURCEUSAGE_CONTAINER | RESOURCEUSAGE_ATTACHED) #define RESOURCEUSAGE_ALL (RESOURCEUSAGE_CONNECTABLE | RESOURCEUSAGE_CONTAINER | RESOURCEUSAGE_ATTACHED)
#define RESOURCEUSAGE_RESERVED 0x80000000 #define RESOURCEUSAGE_RESERVED 0x80000000
#define RESOURCEDISPLAYTYPE_GENERIC 0 #define RESOURCEDISPLAYTYPE_GENERIC 0
#define RESOURCEDISPLAYTYPE_DOMAIN 1 #define RESOURCEDISPLAYTYPE_DOMAIN 1
#define RESOURCEDISPLAYTYPE_SERVER 2 #define RESOURCEDISPLAYTYPE_SERVER 2
#define RESOURCEDISPLAYTYPE_SHARE 3 #define RESOURCEDISPLAYTYPE_SHARE 3
#define RESOURCEDISPLAYTYPE_FILE 4 #define RESOURCEDISPLAYTYPE_FILE 4
#define RESOURCEDISPLAYTYPE_GROUP 5 #define RESOURCEDISPLAYTYPE_GROUP 5
#define RESOURCEDISPLAYTYPE_NETWORK 6 #define RESOURCEDISPLAYTYPE_NETWORK 6
#define RESOURCEDISPLAYTYPE_ROOT 7 #define RESOURCEDISPLAYTYPE_ROOT 7
#define RESOURCEDISPLAYTYPE_SHAREADMIN 8 #define RESOURCEDISPLAYTYPE_SHAREADMIN 8
#define RESOURCEDISPLAYTYPE_DIRECTORY 9 #define RESOURCEDISPLAYTYPE_DIRECTORY 9
#define RESOURCEDISPLAYTYPE_TREE 10 #define RESOURCEDISPLAYTYPE_TREE 10
#define NETPROPERTY_PERSISTENT 1 #define NETPROPERTY_PERSISTENT 1
#define CONNECT_UPDATE_PROFILE 1 #define CONNECT_UPDATE_PROFILE 1
#define CONNECT_UPDATE_RECENT 2 #define CONNECT_UPDATE_RECENT 2
#define CONNECT_TEMPORARY 4 #define CONNECT_TEMPORARY 4
#define CONNECT_INTERACTIVE 8 #define CONNECT_INTERACTIVE 8
#define CONNECT_PROMPT 16 #define CONNECT_PROMPT 16
#define CONNECT_NEED_DRIVE 32 #define CONNECT_NEED_DRIVE 32
#define CONNECT_REFCOUNT 64 #define CONNECT_REFCOUNT 64
#define CONNECT_REDIRECT 128 #define CONNECT_REDIRECT 128
#define CONNECT_LOCALDRIVE 256 #define CONNECT_LOCALDRIVE 256
#define CONNECT_CURRENT_MEDIA 512 #define CONNECT_CURRENT_MEDIA 512
#define CONNDLG_RO_PATH 1 #define CONNDLG_RO_PATH 1
#define CONNDLG_CONN_POINT 2 #define CONNDLG_CONN_POINT 2
#define CONNDLG_USE_MRU 4 #define CONNDLG_USE_MRU 4
#define CONNDLG_HIDE_BOX 8 #define CONNDLG_HIDE_BOX 8
#define CONNDLG_PERSIST 16 #define CONNDLG_PERSIST 16
#define CONNDLG_NOT_PERSIST 32 #define CONNDLG_NOT_PERSIST 32
#define DISC_UPDATE_PROFILE 1 #define DISC_UPDATE_PROFILE 1
#define DISC_NO_FORCE 64 #define DISC_NO_FORCE 64
#define WNFMT_MULTILINE 1 #define WNFMT_MULTILINE 1
#define WNFMT_ABBREVIATED 2 #define WNFMT_ABBREVIATED 2
#define WNFMT_INENUM 16 #define WNFMT_INENUM 16
#define WNFMT_CONNECTION 32 #define WNFMT_CONNECTION 32
#define WN_SUCCESS NO_ERROR #define WN_SUCCESS NO_ERROR
#define WN_NO_ERROR NO_ERROR #define WN_NO_ERROR NO_ERROR
#define WN_NOT_SUPPORTED ERROR_NOT_SUPPORTED #define WN_NOT_SUPPORTED ERROR_NOT_SUPPORTED
#define WN_CANCEL ERROR_CANCELLED #define WN_CANCEL ERROR_CANCELLED
#define WN_RETRY ERROR_RETRY #define WN_RETRY ERROR_RETRY
#define WN_NET_ERROR ERROR_UNEXP_NET_ERR #define WN_NET_ERROR ERROR_UNEXP_NET_ERR
#define WN_MORE_DATA ERROR_MORE_DATA #define WN_MORE_DATA ERROR_MORE_DATA
#define WN_BAD_POINTER ERROR_INVALID_ADDRESS #define WN_BAD_POINTER ERROR_INVALID_ADDRESS
#define WN_BAD_VALUE ERROR_INVALID_PARAMETER #define WN_BAD_VALUE ERROR_INVALID_PARAMETER
#define WN_BAD_USER ERROR_BAD_USERNAME #define WN_BAD_USER ERROR_BAD_USERNAME
#define WN_BAD_PASSWORD ERROR_INVALID_PASSWORD #define WN_BAD_PASSWORD ERROR_INVALID_PASSWORD
#define WN_ACCESS_DENIED ERROR_ACCESS_DENIED #define WN_ACCESS_DENIED ERROR_ACCESS_DENIED
#define WN_FUNCTION_BUSY ERROR_BUSY #define WN_FUNCTION_BUSY ERROR_BUSY
#define WN_WINDOWS_ERROR ERROR_UNEXP_NET_ERR #define WN_WINDOWS_ERROR ERROR_UNEXP_NET_ERR
#define WN_OUT_OF_MEMORY ERROR_NOT_ENOUGH_MEMORY #define WN_OUT_OF_MEMORY ERROR_NOT_ENOUGH_MEMORY
#define WN_NO_NETWORK ERROR_NO_NETWORK #define WN_NO_NETWORK ERROR_NO_NETWORK
#define WN_EXTENDED_ERROR ERROR_EXTENDED_ERROR #define WN_EXTENDED_ERROR ERROR_EXTENDED_ERROR
#define WN_BAD_LEVEL ERROR_INVALID_LEVEL #define WN_BAD_LEVEL ERROR_INVALID_LEVEL
#define WN_BAD_HANDLE ERROR_INVALID_HANDLE #define WN_BAD_HANDLE ERROR_INVALID_HANDLE
#define WN_NOT_INITIALIZING ERROR_ALREADY_INITIALIZED #define WN_NOT_INITIALIZING ERROR_ALREADY_INITIALIZED
#define WN_NO_MORE_DEVICES ERROR_NO_MORE_DEVICES #define WN_NO_MORE_DEVICES ERROR_NO_MORE_DEVICES
#define WN_NOT_CONNECTED ERROR_NOT_CONNECTED #define WN_NOT_CONNECTED ERROR_NOT_CONNECTED
#define WN_OPEN_FILES ERROR_OPEN_FILES #define WN_OPEN_FILES ERROR_OPEN_FILES
#define WN_DEVICE_IN_USE ERROR_DEVICE_IN_USE #define WN_DEVICE_IN_USE ERROR_DEVICE_IN_USE
#define WN_BAD_NETNAME ERROR_BAD_NET_NAME #define WN_BAD_NETNAME ERROR_BAD_NET_NAME
#define WN_BAD_LOCALNAME ERROR_BAD_DEVICE #define WN_BAD_LOCALNAME ERROR_BAD_DEVICE
#define WN_ALREADY_CONNECTED ERROR_ALREADY_ASSIGNED #define WN_ALREADY_CONNECTED ERROR_ALREADY_ASSIGNED
#define WN_DEVICE_ERROR ERROR_GEN_FAILURE #define WN_DEVICE_ERROR ERROR_GEN_FAILURE
#define WN_CONNECTION_CLOSED ERROR_CONNECTION_UNAVAIL #define WN_CONNECTION_CLOSED ERROR_CONNECTION_UNAVAIL
#define WN_NO_NET_OR_BAD_PATH ERROR_NO_NET_OR_BAD_PATH #define WN_NO_NET_OR_BAD_PATH ERROR_NO_NET_OR_BAD_PATH
#define WN_BAD_PROVIDER ERROR_BAD_PROVIDER #define WN_BAD_PROVIDER ERROR_BAD_PROVIDER
#define WN_CANNOT_OPEN_PROFILE ERROR_CANNOT_OPEN_PROFILE #define WN_CANNOT_OPEN_PROFILE ERROR_CANNOT_OPEN_PROFILE
#define WN_BAD_PROFILE ERROR_BAD_PROFILE #define WN_BAD_PROFILE ERROR_BAD_PROFILE
#define WN_BAD_DEV_TYPE ERROR_BAD_DEV_TYPE #define WN_BAD_DEV_TYPE ERROR_BAD_DEV_TYPE
#define WN_DEVICE_ALREADY_REMEMBERED ERROR_DEVICE_ALREADY_REMEMBERED #define WN_DEVICE_ALREADY_REMEMBERED ERROR_DEVICE_ALREADY_REMEMBERED
#define WN_NO_MORE_ENTRIES ERROR_NO_MORE_ITEMS #define WN_NO_MORE_ENTRIES ERROR_NO_MORE_ITEMS
#define WN_NOT_CONTAINER ERROR_NOT_CONTAINER #define WN_NOT_CONTAINER ERROR_NOT_CONTAINER
#define WN_NOT_AUTHENTICATED ERROR_NOT_AUTHENTICATED #define WN_NOT_AUTHENTICATED ERROR_NOT_AUTHENTICATED
#define WN_NOT_LOGGED_ON ERROR_NOT_LOGGED_ON #define WN_NOT_LOGGED_ON ERROR_NOT_LOGGED_ON
#define WN_NOT_VALIDATED ERROR_NO_LOGON_SERVERS #define WN_NOT_VALIDATED ERROR_NO_LOGON_SERVERS
#define UNIVERSAL_NAME_INFO_LEVEL 1 #define UNIVERSAL_NAME_INFO_LEVEL 1
#define REMOTE_NAME_INFO_LEVEL 2 #define REMOTE_NAME_INFO_LEVEL 2
#define NETINFO_DLL16 1 #define NETINFO_DLL16 1
#define NETINFO_DISKRED 4 #define NETINFO_DISKRED 4
#define NETINFO_PRINTERRED 8 #define NETINFO_PRINTERRED 8
#define RP_LOGON 1 #define RP_LOGON 1
#define RP_INIFILE 2 #define RP_INIFILE 2
#define PP_DISPLAYERRORS 1 #define PP_DISPLAYERRORS 1
#define WNCON_FORNETCARD 1 #define WNCON_FORNETCARD 1
#define WNCON_NOTROUTED 2 #define WNCON_NOTROUTED 2
#define WNCON_SLOWLINK 4 #define WNCON_SLOWLINK 4
#define WNCON_DYNAMIC 8 #define WNCON_DYNAMIC 8
#ifndef RC_INVOKED #ifndef RC_INVOKED
typedef struct _NETRESOURCEA { typedef struct _NETRESOURCEA {
DWORD dwScope; DWORD dwScope;
DWORD dwType; DWORD dwType;
DWORD dwDisplayType; DWORD dwDisplayType;
DWORD dwUsage; DWORD dwUsage;
LPSTR lpLocalName; LPSTR lpLocalName;
LPSTR lpRemoteName; LPSTR lpRemoteName;
LPSTR lpComment ; LPSTR lpComment ;
LPSTR lpProvider; LPSTR lpProvider;
}NETRESOURCEA,*LPNETRESOURCEA; }NETRESOURCEA,*LPNETRESOURCEA;
typedef struct _NETRESOURCEW { typedef struct _NETRESOURCEW {
DWORD dwScope; DWORD dwScope;
DWORD dwType; DWORD dwType;
DWORD dwDisplayType; DWORD dwDisplayType;
DWORD dwUsage; DWORD dwUsage;
LPWSTR lpLocalName; LPWSTR lpLocalName;
LPWSTR lpRemoteName; LPWSTR lpRemoteName;
LPWSTR lpComment ; LPWSTR lpComment ;
LPWSTR lpProvider; LPWSTR lpProvider;
}NETRESOURCEW,*LPNETRESOURCEW; }NETRESOURCEW,*LPNETRESOURCEW;
typedef struct _CONNECTDLGSTRUCTA{ typedef struct _CONNECTDLGSTRUCTA{
DWORD cbStructure; DWORD cbStructure;
HWND hwndOwner; HWND hwndOwner;
LPNETRESOURCEA lpConnRes; LPNETRESOURCEA lpConnRes;
DWORD dwFlags; DWORD dwFlags;
DWORD dwDevNum; DWORD dwDevNum;
} CONNECTDLGSTRUCTA,*LPCONNECTDLGSTRUCTA; } CONNECTDLGSTRUCTA,*LPCONNECTDLGSTRUCTA;
typedef struct _CONNECTDLGSTRUCTW{ typedef struct _CONNECTDLGSTRUCTW{
DWORD cbStructure; DWORD cbStructure;
HWND hwndOwner; HWND hwndOwner;
LPNETRESOURCEW lpConnRes; LPNETRESOURCEW lpConnRes;
DWORD dwFlags; DWORD dwFlags;
DWORD dwDevNum; DWORD dwDevNum;
} CONNECTDLGSTRUCTW,*LPCONNECTDLGSTRUCTW; } CONNECTDLGSTRUCTW,*LPCONNECTDLGSTRUCTW;
typedef struct _DISCDLGSTRUCTA{ typedef struct _DISCDLGSTRUCTA{
DWORD cbStructure; DWORD cbStructure;
HWND hwndOwner; HWND hwndOwner;
LPSTR lpLocalName; LPSTR lpLocalName;
LPSTR lpRemoteName; LPSTR lpRemoteName;
DWORD dwFlags; DWORD dwFlags;
} DISCDLGSTRUCTA,*LPDISCDLGSTRUCTA; } DISCDLGSTRUCTA,*LPDISCDLGSTRUCTA;
typedef struct _DISCDLGSTRUCTW{ typedef struct _DISCDLGSTRUCTW{
DWORD cbStructure; DWORD cbStructure;
HWND hwndOwner; HWND hwndOwner;
LPWSTR lpLocalName; LPWSTR lpLocalName;
LPWSTR lpRemoteName; LPWSTR lpRemoteName;
DWORD dwFlags; DWORD dwFlags;
} DISCDLGSTRUCTW,*LPDISCDLGSTRUCTW; } DISCDLGSTRUCTW,*LPDISCDLGSTRUCTW;
typedef struct _UNIVERSAL_NAME_INFOA { LPSTR lpUniversalName; }UNIVERSAL_NAME_INFOA,*LPUNIVERSAL_NAME_INFOA; typedef struct _UNIVERSAL_NAME_INFOA { LPSTR lpUniversalName; }UNIVERSAL_NAME_INFOA,*LPUNIVERSAL_NAME_INFOA;
typedef struct _UNIVERSAL_NAME_INFOW { LPWSTR lpUniversalName; }UNIVERSAL_NAME_INFOW,*LPUNIVERSAL_NAME_INFOW; typedef struct _UNIVERSAL_NAME_INFOW { LPWSTR lpUniversalName; }UNIVERSAL_NAME_INFOW,*LPUNIVERSAL_NAME_INFOW;
typedef struct _REMOTE_NAME_INFOA { typedef struct _REMOTE_NAME_INFOA {
LPSTR lpUniversalName; LPSTR lpUniversalName;
LPSTR lpConnectionName; LPSTR lpConnectionName;
LPSTR lpRemainingPath; LPSTR lpRemainingPath;
}REMOTE_NAME_INFOA,*LPREMOTE_NAME_INFOA; }REMOTE_NAME_INFOA,*LPREMOTE_NAME_INFOA;
typedef struct _REMOTE_NAME_INFOW { typedef struct _REMOTE_NAME_INFOW {
LPWSTR lpUniversalName; LPWSTR lpUniversalName;
LPWSTR lpConnectionName; LPWSTR lpConnectionName;
LPWSTR lpRemainingPath; LPWSTR lpRemainingPath;
}REMOTE_NAME_INFOW,*LPREMOTE_NAME_INFOW; }REMOTE_NAME_INFOW,*LPREMOTE_NAME_INFOW;
typedef struct _NETINFOSTRUCT{ typedef struct _NETINFOSTRUCT{
DWORD cbStructure; DWORD cbStructure;
DWORD dwProviderVersion; DWORD dwProviderVersion;
DWORD dwStatus; DWORD dwStatus;
DWORD dwCharacteristics; DWORD dwCharacteristics;
DWORD dwHandle; DWORD dwHandle;
WORD wNetType; WORD wNetType;
DWORD dwPrinters; DWORD dwPrinters;
DWORD dwDrives; DWORD dwDrives;
} NETINFOSTRUCT,*LPNETINFOSTRUCT; } NETINFOSTRUCT,*LPNETINFOSTRUCT;
typedef UINT(PASCAL *PFNGETPROFILEPATHA)(LPCSTR,LPSTR,UINT); typedef UINT(PASCAL *PFNGETPROFILEPATHA)(LPCSTR,LPSTR,UINT);
typedef UINT(PASCAL *PFNGETPROFILEPATHW)(LPCWSTR,LPWSTR,UINT); typedef UINT(PASCAL *PFNGETPROFILEPATHW)(LPCWSTR,LPWSTR,UINT);
typedef UINT(PASCAL *PFNRECONCILEPROFILEA)(LPCSTR,LPCSTR,DWORD); typedef UINT(PASCAL *PFNRECONCILEPROFILEA)(LPCSTR,LPCSTR,DWORD);
typedef UINT(PASCAL *PFNRECONCILEPROFILEW)(LPCWSTR,LPCWSTR,DWORD); typedef UINT(PASCAL *PFNRECONCILEPROFILEW)(LPCWSTR,LPCWSTR,DWORD);
typedef BOOL(PASCAL *PFNPROCESSPOLICIESA)(HWND,LPCSTR,LPCSTR,LPCSTR,DWORD); typedef BOOL(PASCAL *PFNPROCESSPOLICIESA)(HWND,LPCSTR,LPCSTR,LPCSTR,DWORD);
typedef BOOL(PASCAL *PFNPROCESSPOLICIESW)(HWND,LPCWSTR,LPCWSTR,LPCWSTR,DWORD); typedef BOOL(PASCAL *PFNPROCESSPOLICIESW)(HWND,LPCWSTR,LPCWSTR,LPCWSTR,DWORD);
typedef struct _NETCONNECTINFOSTRUCT{ typedef struct _NETCONNECTINFOSTRUCT{
DWORD cbStructure; DWORD cbStructure;
DWORD dwFlags; DWORD dwFlags;
DWORD dwSpeed; DWORD dwSpeed;
DWORD dwDelay; DWORD dwDelay;
DWORD dwOptDataSize; DWORD dwOptDataSize;
} NETCONNECTINFOSTRUCT,*LPNETCONNECTINFOSTRUCT; } NETCONNECTINFOSTRUCT,*LPNETCONNECTINFOSTRUCT;
DWORD APIENTRY WNetAddConnectionA(LPCSTR,LPCSTR,LPCSTR); DWORD APIENTRY WNetAddConnectionA(LPCSTR,LPCSTR,LPCSTR);
DWORD APIENTRY WNetAddConnectionW(LPCWSTR,LPCWSTR,LPCWSTR); DWORD APIENTRY WNetAddConnectionW(LPCWSTR,LPCWSTR,LPCWSTR);
DWORD APIENTRY WNetAddConnection2A(LPNETRESOURCEA,LPCSTR,LPCSTR,DWORD); DWORD APIENTRY WNetAddConnection2A(LPNETRESOURCEA,LPCSTR,LPCSTR,DWORD);
DWORD APIENTRY WNetAddConnection2W(LPNETRESOURCEW,LPCWSTR,LPCWSTR,DWORD); DWORD APIENTRY WNetAddConnection2W(LPNETRESOURCEW,LPCWSTR,LPCWSTR,DWORD);
DWORD APIENTRY WNetAddConnection3A(HWND,LPNETRESOURCEA,LPCSTR,LPCSTR,DWORD); DWORD APIENTRY WNetAddConnection3A(HWND,LPNETRESOURCEA,LPCSTR,LPCSTR,DWORD);
DWORD APIENTRY WNetAddConnection3W(HWND,LPNETRESOURCEW,LPCWSTR,LPCWSTR,DWORD); DWORD APIENTRY WNetAddConnection3W(HWND,LPNETRESOURCEW,LPCWSTR,LPCWSTR,DWORD);
DWORD APIENTRY WNetCancelConnectionA(LPCSTR,BOOL); DWORD APIENTRY WNetCancelConnectionA(LPCSTR,BOOL);
DWORD APIENTRY WNetCancelConnectionW(LPCWSTR,BOOL); DWORD APIENTRY WNetCancelConnectionW(LPCWSTR,BOOL);
DWORD APIENTRY WNetCancelConnection2A(LPCSTR,DWORD,BOOL); DWORD APIENTRY WNetCancelConnection2A(LPCSTR,DWORD,BOOL);
DWORD APIENTRY WNetCancelConnection2W(LPCWSTR,DWORD,BOOL); DWORD APIENTRY WNetCancelConnection2W(LPCWSTR,DWORD,BOOL);
DWORD APIENTRY WNetGetConnectionA(LPCSTR,LPSTR,PDWORD); DWORD APIENTRY WNetGetConnectionA(LPCSTR,LPSTR,PDWORD);
DWORD APIENTRY WNetGetConnectionW(LPCWSTR,LPWSTR,PDWORD); DWORD APIENTRY WNetGetConnectionW(LPCWSTR,LPWSTR,PDWORD);
DWORD APIENTRY WNetUseConnectionA(HWND,LPNETRESOURCEA,LPCSTR,LPCSTR,DWORD,LPSTR,PDWORD,PDWORD); DWORD APIENTRY WNetUseConnectionA(HWND,LPNETRESOURCEA,LPCSTR,LPCSTR,DWORD,LPSTR,PDWORD,PDWORD);
DWORD APIENTRY WNetUseConnectionW(HWND,LPNETRESOURCEW,LPCWSTR,LPCWSTR,DWORD,LPWSTR,PDWORD,PDWORD); DWORD APIENTRY WNetUseConnectionW(HWND,LPNETRESOURCEW,LPCWSTR,LPCWSTR,DWORD,LPWSTR,PDWORD,PDWORD);
DWORD APIENTRY WNetSetConnectionA(LPCSTR,DWORD,PVOID); DWORD APIENTRY WNetSetConnectionA(LPCSTR,DWORD,PVOID);
DWORD APIENTRY WNetSetConnectionW(LPCWSTR,DWORD,PVOID); DWORD APIENTRY WNetSetConnectionW(LPCWSTR,DWORD,PVOID);
DWORD APIENTRY WNetConnectionDialog(HWND,DWORD); DWORD APIENTRY WNetConnectionDialog(HWND,DWORD);
DWORD APIENTRY WNetDisconnectDialog(HWND,DWORD); DWORD APIENTRY WNetDisconnectDialog(HWND,DWORD);
DWORD APIENTRY WNetConnectionDialog1A(LPCONNECTDLGSTRUCTA); DWORD APIENTRY WNetConnectionDialog1A(LPCONNECTDLGSTRUCTA);
DWORD APIENTRY WNetConnectionDialog1W(LPCONNECTDLGSTRUCTW); DWORD APIENTRY WNetConnectionDialog1W(LPCONNECTDLGSTRUCTW);
DWORD APIENTRY WNetDisconnectDialog1A(LPDISCDLGSTRUCTA); DWORD APIENTRY WNetDisconnectDialog1A(LPDISCDLGSTRUCTA);
DWORD APIENTRY WNetDisconnectDialog1W(LPDISCDLGSTRUCTW); DWORD APIENTRY WNetDisconnectDialog1W(LPDISCDLGSTRUCTW);
DWORD APIENTRY WNetOpenEnumA(DWORD,DWORD,DWORD,LPNETRESOURCEA,LPHANDLE); DWORD APIENTRY WNetOpenEnumA(DWORD,DWORD,DWORD,LPNETRESOURCEA,LPHANDLE);
DWORD APIENTRY WNetOpenEnumW(DWORD,DWORD,DWORD,LPNETRESOURCEW,LPHANDLE); DWORD APIENTRY WNetOpenEnumW(DWORD,DWORD,DWORD,LPNETRESOURCEW,LPHANDLE);
DWORD APIENTRY WNetEnumResourceA(HANDLE,PDWORD,PVOID,PDWORD); DWORD APIENTRY WNetEnumResourceA(HANDLE,PDWORD,PVOID,PDWORD);
DWORD APIENTRY WNetEnumResourceW(HANDLE,PDWORD,PVOID,PDWORD); DWORD APIENTRY WNetEnumResourceW(HANDLE,PDWORD,PVOID,PDWORD);
DWORD APIENTRY WNetCloseEnum(HANDLE); DWORD APIENTRY WNetCloseEnum(HANDLE);
DWORD APIENTRY WNetGetUniversalNameA(LPCSTR,DWORD,PVOID,PDWORD); DWORD APIENTRY WNetGetUniversalNameA(LPCSTR,DWORD,PVOID,PDWORD);
DWORD APIENTRY WNetGetUniversalNameW(LPCWSTR,DWORD,PVOID,PDWORD); DWORD APIENTRY WNetGetUniversalNameW(LPCWSTR,DWORD,PVOID,PDWORD);
DWORD APIENTRY WNetGetUserA(LPCSTR,LPSTR,PDWORD); DWORD APIENTRY WNetGetUserA(LPCSTR,LPSTR,PDWORD);
DWORD APIENTRY WNetGetUserW(LPCWSTR,LPWSTR,PDWORD); DWORD APIENTRY WNetGetUserW(LPCWSTR,LPWSTR,PDWORD);
DWORD APIENTRY WNetGetProviderNameA(DWORD,LPSTR,PDWORD); DWORD APIENTRY WNetGetProviderNameA(DWORD,LPSTR,PDWORD);
DWORD APIENTRY WNetGetProviderNameW(DWORD,LPWSTR,PDWORD); DWORD APIENTRY WNetGetProviderNameW(DWORD,LPWSTR,PDWORD);
DWORD APIENTRY WNetGetNetworkInformationA(LPCSTR,LPNETINFOSTRUCT); DWORD APIENTRY WNetGetNetworkInformationA(LPCSTR,LPNETINFOSTRUCT);
DWORD APIENTRY WNetGetNetworkInformationW(LPCWSTR,LPNETINFOSTRUCT); DWORD APIENTRY WNetGetNetworkInformationW(LPCWSTR,LPNETINFOSTRUCT);
DWORD APIENTRY WNetGetResourceInformationA(LPNETRESOURCEA,LPVOID,LPDWORD,LPCSTR*); DWORD APIENTRY WNetGetResourceInformationA(LPNETRESOURCEA,LPVOID,LPDWORD,LPCSTR*);
DWORD APIENTRY WNetGetResourceInformationW(LPNETRESOURCEA,LPVOID,LPDWORD,LPCWSTR*); DWORD APIENTRY WNetGetResourceInformationW(LPNETRESOURCEA,LPVOID,LPDWORD,LPCWSTR*);
DWORD APIENTRY WNetGetLastErrorA(PDWORD,LPSTR,DWORD,LPSTR,DWORD); DWORD APIENTRY WNetGetLastErrorA(PDWORD,LPSTR,DWORD,LPSTR,DWORD);
DWORD APIENTRY WNetGetLastErrorW(PDWORD,LPWSTR,DWORD,LPWSTR,DWORD); DWORD APIENTRY WNetGetLastErrorW(PDWORD,LPWSTR,DWORD,LPWSTR,DWORD);
DWORD APIENTRY MultinetGetConnectionPerformanceA(LPNETRESOURCEA,LPNETCONNECTINFOSTRUCT); DWORD APIENTRY MultinetGetConnectionPerformanceA(LPNETRESOURCEA,LPNETCONNECTINFOSTRUCT);
DWORD APIENTRY MultinetGetConnectionPerformanceW(LPNETRESOURCEW,LPNETCONNECTINFOSTRUCT); DWORD APIENTRY MultinetGetConnectionPerformanceW(LPNETRESOURCEW,LPNETCONNECTINFOSTRUCT);
#ifdef UNICODE #ifdef UNICODE
#define PFNPROCESSPOLICIES PFNPROCESSPOLICIESW #define PFNPROCESSPOLICIES PFNPROCESSPOLICIESW
#define PFNRECONCILEPROFILE PFNRECONCILEPROFILEW #define PFNRECONCILEPROFILE PFNRECONCILEPROFILEW
#define PFNGETPROFILEPATH PFNGETPROFILEPATHW #define PFNGETPROFILEPATH PFNGETPROFILEPATHW
typedef NETRESOURCEW NETRESOURCE,*LPNETRESOURCE; typedef NETRESOURCEW NETRESOURCE,*LPNETRESOURCE;
typedef CONNECTDLGSTRUCTW CONNECTDLGSTRUCT,*LPCONNECTDLGSTRUCT; typedef CONNECTDLGSTRUCTW CONNECTDLGSTRUCT,*LPCONNECTDLGSTRUCT;
typedef DISCDLGSTRUCTW DISCDLGSTRUCT,*LPDISCDLGSTRUCT; typedef DISCDLGSTRUCTW DISCDLGSTRUCT,*LPDISCDLGSTRUCT;
typedef REMOTE_NAME_INFOW REMOTE_NAME_INFO,*LPREMOTE_NAME_INFO; typedef REMOTE_NAME_INFOW REMOTE_NAME_INFO,*LPREMOTE_NAME_INFO;
typedef UNIVERSAL_NAME_INFOW UNIVERSAL_NAME_INFO,*LPUNIVERSAL_NAME_INFO; typedef UNIVERSAL_NAME_INFOW UNIVERSAL_NAME_INFO,*LPUNIVERSAL_NAME_INFO;
#define WNetEnumResource WNetEnumResourceW #define WNetEnumResource WNetEnumResourceW
#define WNetOpenEnum WNetOpenEnumW #define WNetOpenEnum WNetOpenEnumW
#define WNetGetResourceInformation WNetGetResourceInformationW #define WNetGetResourceInformation WNetGetResourceInformationW
#define WNetGetUniversalName WNetGetUniversalNameW #define WNetGetUniversalName WNetGetUniversalNameW
#define WNetSetConnection WNetSetConnectionW #define WNetSetConnection WNetSetConnectionW
#define WNetUseConnection WNetUseConnectionW #define WNetUseConnection WNetUseConnectionW
#define WNetGetConnection WNetGetConnectionW #define WNetGetConnection WNetGetConnectionW
#define WNetCancelConnection2 WNetCancelConnection2W #define WNetCancelConnection2 WNetCancelConnection2W
#define WNetCancelConnection WNetCancelConnectionW #define WNetCancelConnection WNetCancelConnectionW
#define WNetAddConnection3 WNetAddConnection3W #define WNetAddConnection3 WNetAddConnection3W
#define WNetAddConnection2 WNetAddConnection2W #define WNetAddConnection2 WNetAddConnection2W
#define WNetAddConnection WNetAddConnectionW #define WNetAddConnection WNetAddConnectionW
#define WNetConnectionDialog1 WNetConnectionDialog1W #define WNetConnectionDialog1 WNetConnectionDialog1W
#define WNetDisconnectDialog1 WNetDisconnectDialog1W #define WNetDisconnectDialog1 WNetDisconnectDialog1W
#define WNetGetNetworkInformation WNetGetNetworkInformationW #define WNetGetNetworkInformation WNetGetNetworkInformationW
#define WNetGetProviderName WNetGetProviderNameW #define WNetGetProviderName WNetGetProviderNameW
#define WNetGetUser WNetGetUserW #define WNetGetUser WNetGetUserW
#define MultinetGetConnectionPerformance MultinetGetConnectionPerformanceW #define MultinetGetConnectionPerformance MultinetGetConnectionPerformanceW
#define WNetGetLastError WNetGetLastErrorW #define WNetGetLastError WNetGetLastErrorW
#else #else
#define PFNGETPROFILEPATH PFNGETPROFILEPATHA #define PFNGETPROFILEPATH PFNGETPROFILEPATHA
#define PFNRECONCILEPROFILE PFNRECONCILEPROFILEA #define PFNRECONCILEPROFILE PFNRECONCILEPROFILEA
#define PFNPROCESSPOLICIES PFNPROCESSPOLICIESA #define PFNPROCESSPOLICIES PFNPROCESSPOLICIESA
typedef NETRESOURCEA NETRESOURCE,*LPNETRESOURCE; typedef NETRESOURCEA NETRESOURCE,*LPNETRESOURCE;
typedef CONNECTDLGSTRUCTA CONNECTDLGSTRUCT,*LPCONNECTDLGSTRUCT; typedef CONNECTDLGSTRUCTA CONNECTDLGSTRUCT,*LPCONNECTDLGSTRUCT;
typedef DISCDLGSTRUCTA DISCDLGSTRUCT,*LPDISCDLGSTRUCT; typedef DISCDLGSTRUCTA DISCDLGSTRUCT,*LPDISCDLGSTRUCT;
typedef UNIVERSAL_NAME_INFOA UNIVERSAL_NAME_INFO,*LPUNIVERSAL_NAME_INFO; typedef UNIVERSAL_NAME_INFOA UNIVERSAL_NAME_INFO,*LPUNIVERSAL_NAME_INFO;
typedef REMOTE_NAME_INFOA REMOTE_NAME_INFO,*LPREMOTE_NAME_INFO; typedef REMOTE_NAME_INFOA REMOTE_NAME_INFO,*LPREMOTE_NAME_INFO;
#define WNetOpenEnum WNetOpenEnumA #define WNetOpenEnum WNetOpenEnumA
#define WNetEnumResource WNetEnumResourceA #define WNetEnumResource WNetEnumResourceA
#define WNetGetResourceInformation WNetGetResourceInformationA #define WNetGetResourceInformation WNetGetResourceInformationA
#define WNetGetUniversalName WNetGetUniversalNameA #define WNetGetUniversalName WNetGetUniversalNameA
#define WNetConnectionDialog1 WNetConnectionDialog1A #define WNetConnectionDialog1 WNetConnectionDialog1A
#define WNetDisconnectDialog1 WNetDisconnectDialog1A #define WNetDisconnectDialog1 WNetDisconnectDialog1A
#define WNetAddConnection2 WNetAddConnection2A #define WNetAddConnection2 WNetAddConnection2A
#define WNetAddConnection3 WNetAddConnection3A #define WNetAddConnection3 WNetAddConnection3A
#define WNetCancelConnection WNetCancelConnectionA #define WNetCancelConnection WNetCancelConnectionA
#define WNetCancelConnection2 WNetCancelConnection2A #define WNetCancelConnection2 WNetCancelConnection2A
#define WNetGetConnection WNetGetConnectionA #define WNetGetConnection WNetGetConnectionA
#define WNetUseConnection WNetUseConnectionA #define WNetUseConnection WNetUseConnectionA
#define WNetSetConnection WNetSetConnectionA #define WNetSetConnection WNetSetConnectionA
#define WNetAddConnection WNetAddConnectionA #define WNetAddConnection WNetAddConnectionA
#define WNetGetUser WNetGetUserA #define WNetGetUser WNetGetUserA
#define WNetGetProviderName WNetGetProviderNameA #define WNetGetProviderName WNetGetProviderNameA
#define WNetGetNetworkInformation WNetGetNetworkInformationA #define WNetGetNetworkInformation WNetGetNetworkInformationA
#define WNetGetLastError WNetGetLastErrorA #define WNetGetLastError WNetGetLastErrorA
#define MultinetGetConnectionPerformance MultinetGetConnectionPerformanceA #define MultinetGetConnectionPerformance MultinetGetConnectionPerformanceA
#endif #endif
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,159 +1,159 @@
#ifndef _WINREG_H #ifndef _WINREG_H
#define _WINREG_H #define _WINREG_H
#if __GNUC__ >=3 #if __GNUC__ >=3
#pragma GCC system_header #pragma GCC system_header
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#define HKEY_CLASSES_ROOT ((HKEY)0x80000000) #define HKEY_CLASSES_ROOT ((HKEY)0x80000000)
#define HKEY_CURRENT_USER ((HKEY)0x80000001) #define HKEY_CURRENT_USER ((HKEY)0x80000001)
#define HKEY_LOCAL_MACHINE ((HKEY)0x80000002) #define HKEY_LOCAL_MACHINE ((HKEY)0x80000002)
#define HKEY_USERS ((HKEY)0x80000003) #define HKEY_USERS ((HKEY)0x80000003)
#define HKEY_PERFORMANCE_DATA ((HKEY)0x80000004) #define HKEY_PERFORMANCE_DATA ((HKEY)0x80000004)
#define HKEY_CURRENT_CONFIG ((HKEY)0x80000005) #define HKEY_CURRENT_CONFIG ((HKEY)0x80000005)
#define HKEY_DYN_DATA ((HKEY)0x80000006) #define HKEY_DYN_DATA ((HKEY)0x80000006)
#define REG_OPTION_VOLATILE 1 #define REG_OPTION_VOLATILE 1
#define REG_OPTION_NON_VOLATILE 0 #define REG_OPTION_NON_VOLATILE 0
#define REG_CREATED_NEW_KEY 1 #define REG_CREATED_NEW_KEY 1
#define REG_OPENED_EXISTING_KEY 2 #define REG_OPENED_EXISTING_KEY 2
#define REG_NONE 0 #define REG_NONE 0
#define REG_SZ 1 #define REG_SZ 1
#define REG_EXPAND_SZ 2 #define REG_EXPAND_SZ 2
#define REG_BINARY 3 #define REG_BINARY 3
#define REG_DWORD 4 #define REG_DWORD 4
#define REG_DWORD_BIG_ENDIAN 5 #define REG_DWORD_BIG_ENDIAN 5
#define REG_DWORD_LITTLE_ENDIAN 4 #define REG_DWORD_LITTLE_ENDIAN 4
#define REG_LINK 6 #define REG_LINK 6
#define REG_MULTI_SZ 7 #define REG_MULTI_SZ 7
#define REG_RESOURCE_LIST 8 #define REG_RESOURCE_LIST 8
#define REG_FULL_RESOURCE_DESCRIPTOR 9 #define REG_FULL_RESOURCE_DESCRIPTOR 9
#define REG_RESOURCE_REQUIREMENTS_LIST 10 #define REG_RESOURCE_REQUIREMENTS_LIST 10
#define REG_NOTIFY_CHANGE_NAME 1 #define REG_NOTIFY_CHANGE_NAME 1
#define REG_NOTIFY_CHANGE_ATTRIBUTES 2 #define REG_NOTIFY_CHANGE_ATTRIBUTES 2
#define REG_NOTIFY_CHANGE_LAST_SET 4 #define REG_NOTIFY_CHANGE_LAST_SET 4
#define REG_NOTIFY_CHANGE_SECURITY 8 #define REG_NOTIFY_CHANGE_SECURITY 8
#ifndef RC_INVOKED #ifndef RC_INVOKED
typedef ACCESS_MASK REGSAM; typedef ACCESS_MASK REGSAM;
typedef struct value_entA { typedef struct value_entA {
LPSTR ve_valuename; LPSTR ve_valuename;
DWORD ve_valuelen; DWORD ve_valuelen;
DWORD ve_valueptr; DWORD ve_valueptr;
DWORD ve_type; DWORD ve_type;
} VALENTA,*PVALENTA; } VALENTA,*PVALENTA;
typedef struct value_entW { typedef struct value_entW {
LPWSTR ve_valuename; LPWSTR ve_valuename;
DWORD ve_valuelen; DWORD ve_valuelen;
DWORD ve_valueptr; DWORD ve_valueptr;
DWORD ve_type; DWORD ve_type;
} VALENTW,*PVALENTW; } VALENTW,*PVALENTW;
BOOL WINAPI AbortSystemShutdownA(LPCSTR); BOOL WINAPI AbortSystemShutdownA(LPCSTR);
BOOL WINAPI AbortSystemShutdownW(LPCWSTR); BOOL WINAPI AbortSystemShutdownW(LPCWSTR);
BOOL WINAPI InitiateSystemShutdownA(LPSTR,LPSTR,DWORD,BOOL,BOOL); BOOL WINAPI InitiateSystemShutdownA(LPSTR,LPSTR,DWORD,BOOL,BOOL);
BOOL WINAPI InitiateSystemShutdownW(LPWSTR,LPWSTR,DWORD,BOOL,BOOL); BOOL WINAPI InitiateSystemShutdownW(LPWSTR,LPWSTR,DWORD,BOOL,BOOL);
LONG WINAPI RegCloseKey(HKEY); LONG WINAPI RegCloseKey(HKEY);
LONG WINAPI RegConnectRegistryA(LPSTR,HKEY,PHKEY); LONG WINAPI RegConnectRegistryA(LPSTR,HKEY,PHKEY);
LONG WINAPI RegConnectRegistryW(LPWSTR,HKEY,PHKEY); LONG WINAPI RegConnectRegistryW(LPWSTR,HKEY,PHKEY);
LONG WINAPI RegCreateKeyA(HKEY,LPCSTR,PHKEY); LONG WINAPI RegCreateKeyA(HKEY,LPCSTR,PHKEY);
LONG WINAPI RegCreateKeyExA(HKEY,LPCSTR,DWORD,LPSTR,DWORD,REGSAM,LPSECURITY_ATTRIBUTES,PHKEY,PDWORD); LONG WINAPI RegCreateKeyExA(HKEY,LPCSTR,DWORD,LPSTR,DWORD,REGSAM,LPSECURITY_ATTRIBUTES,PHKEY,PDWORD);
LONG WINAPI RegCreateKeyExW(HKEY,LPCWSTR,DWORD,LPWSTR,DWORD,REGSAM,LPSECURITY_ATTRIBUTES,PHKEY,PDWORD); LONG WINAPI RegCreateKeyExW(HKEY,LPCWSTR,DWORD,LPWSTR,DWORD,REGSAM,LPSECURITY_ATTRIBUTES,PHKEY,PDWORD);
LONG WINAPI RegCreateKeyW(HKEY,LPCWSTR,PHKEY); LONG WINAPI RegCreateKeyW(HKEY,LPCWSTR,PHKEY);
LONG WINAPI RegDeleteKeyA(HKEY,LPCSTR); LONG WINAPI RegDeleteKeyA(HKEY,LPCSTR);
LONG WINAPI RegDeleteKeyW(HKEY,LPCWSTR); LONG WINAPI RegDeleteKeyW(HKEY,LPCWSTR);
LONG WINAPI RegDeleteValueA (HKEY,LPCSTR); LONG WINAPI RegDeleteValueA (HKEY,LPCSTR);
LONG WINAPI RegDeleteValueW(HKEY,LPCWSTR); LONG WINAPI RegDeleteValueW(HKEY,LPCWSTR);
LONG WINAPI RegEnumKeyA (HKEY,DWORD,LPSTR,DWORD); LONG WINAPI RegEnumKeyA (HKEY,DWORD,LPSTR,DWORD);
LONG WINAPI RegEnumKeyW(HKEY,DWORD,LPWSTR,DWORD); LONG WINAPI RegEnumKeyW(HKEY,DWORD,LPWSTR,DWORD);
LONG WINAPI RegEnumKeyExA(HKEY,DWORD,LPSTR,PDWORD,PDWORD,LPSTR,PDWORD,PFILETIME); LONG WINAPI RegEnumKeyExA(HKEY,DWORD,LPSTR,PDWORD,PDWORD,LPSTR,PDWORD,PFILETIME);
LONG WINAPI RegEnumKeyExW(HKEY,DWORD,LPWSTR,PDWORD,PDWORD,LPWSTR,PDWORD,PFILETIME); LONG WINAPI RegEnumKeyExW(HKEY,DWORD,LPWSTR,PDWORD,PDWORD,LPWSTR,PDWORD,PFILETIME);
LONG WINAPI RegEnumValueA(HKEY,DWORD,LPSTR,PDWORD,PDWORD,PDWORD,LPBYTE,PDWORD); LONG WINAPI RegEnumValueA(HKEY,DWORD,LPSTR,PDWORD,PDWORD,PDWORD,LPBYTE,PDWORD);
LONG WINAPI RegEnumValueW(HKEY,DWORD,LPWSTR,PDWORD,PDWORD,PDWORD,LPBYTE,PDWORD); LONG WINAPI RegEnumValueW(HKEY,DWORD,LPWSTR,PDWORD,PDWORD,PDWORD,LPBYTE,PDWORD);
LONG WINAPI RegFlushKey(HKEY); LONG WINAPI RegFlushKey(HKEY);
LONG WINAPI RegGetKeySecurity(HKEY,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,PDWORD); LONG WINAPI RegGetKeySecurity(HKEY,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,PDWORD);
LONG WINAPI RegLoadKeyA(HKEY,LPCSTR,LPCSTR); LONG WINAPI RegLoadKeyA(HKEY,LPCSTR,LPCSTR);
LONG WINAPI RegLoadKeyW(HKEY,LPCWSTR,LPCWSTR); LONG WINAPI RegLoadKeyW(HKEY,LPCWSTR,LPCWSTR);
LONG WINAPI RegNotifyChangeKeyValue(HKEY,BOOL,DWORD,HANDLE,BOOL); LONG WINAPI RegNotifyChangeKeyValue(HKEY,BOOL,DWORD,HANDLE,BOOL);
LONG WINAPI RegOpenKeyA(HKEY,LPCSTR,PHKEY); LONG WINAPI RegOpenKeyA(HKEY,LPCSTR,PHKEY);
LONG WINAPI RegOpenKeyExA(HKEY,LPCSTR,DWORD,REGSAM,PHKEY); LONG WINAPI RegOpenKeyExA(HKEY,LPCSTR,DWORD,REGSAM,PHKEY);
LONG WINAPI RegOpenKeyExW(HKEY,LPCWSTR,DWORD,REGSAM,PHKEY); LONG WINAPI RegOpenKeyExW(HKEY,LPCWSTR,DWORD,REGSAM,PHKEY);
LONG WINAPI RegOpenKeyW(HKEY,LPCWSTR,PHKEY); LONG WINAPI RegOpenKeyW(HKEY,LPCWSTR,PHKEY);
LONG WINAPI RegQueryInfoKeyA(HKEY,LPSTR,PDWORD,PDWORD,PDWORD,PDWORD,PDWORD,PDWORD,PDWORD,PDWORD,PDWORD,PFILETIME); LONG WINAPI RegQueryInfoKeyA(HKEY,LPSTR,PDWORD,PDWORD,PDWORD,PDWORD,PDWORD,PDWORD,PDWORD,PDWORD,PDWORD,PFILETIME);
LONG WINAPI RegQueryInfoKeyW(HKEY,LPWSTR,PDWORD,PDWORD,PDWORD,PDWORD,PDWORD,PDWORD,PDWORD,PDWORD,PDWORD,PFILETIME); LONG WINAPI RegQueryInfoKeyW(HKEY,LPWSTR,PDWORD,PDWORD,PDWORD,PDWORD,PDWORD,PDWORD,PDWORD,PDWORD,PDWORD,PFILETIME);
LONG WINAPI RegQueryMultipleValuesA(HKEY,PVALENTA,DWORD,LPSTR,PDWORD); LONG WINAPI RegQueryMultipleValuesA(HKEY,PVALENTA,DWORD,LPSTR,PDWORD);
LONG WINAPI RegQueryMultipleValuesW(HKEY,PVALENTW,DWORD,LPWSTR,PDWORD); LONG WINAPI RegQueryMultipleValuesW(HKEY,PVALENTW,DWORD,LPWSTR,PDWORD);
LONG WINAPI RegQueryValueA(HKEY,LPCSTR,LPSTR,PLONG); LONG WINAPI RegQueryValueA(HKEY,LPCSTR,LPSTR,PLONG);
LONG WINAPI RegQueryValueExA (HKEY,LPCSTR,PDWORD,PDWORD,LPBYTE,PDWORD); LONG WINAPI RegQueryValueExA (HKEY,LPCSTR,PDWORD,PDWORD,LPBYTE,PDWORD);
LONG WINAPI RegQueryValueExW(HKEY,LPCWSTR,PDWORD,PDWORD,LPBYTE,PDWORD); LONG WINAPI RegQueryValueExW(HKEY,LPCWSTR,PDWORD,PDWORD,LPBYTE,PDWORD);
LONG WINAPI RegQueryValueW(HKEY,LPCWSTR,LPWSTR,PLONG); LONG WINAPI RegQueryValueW(HKEY,LPCWSTR,LPWSTR,PLONG);
LONG WINAPI RegReplaceKeyA(HKEY,LPCSTR,LPCSTR,LPCSTR); LONG WINAPI RegReplaceKeyA(HKEY,LPCSTR,LPCSTR,LPCSTR);
LONG WINAPI RegReplaceKeyW(HKEY,LPCWSTR,LPCWSTR,LPCWSTR); LONG WINAPI RegReplaceKeyW(HKEY,LPCWSTR,LPCWSTR,LPCWSTR);
LONG WINAPI RegRestoreKeyA (HKEY,LPCSTR,DWORD); LONG WINAPI RegRestoreKeyA (HKEY,LPCSTR,DWORD);
LONG WINAPI RegRestoreKeyW(HKEY,LPCWSTR,DWORD); LONG WINAPI RegRestoreKeyW(HKEY,LPCWSTR,DWORD);
LONG WINAPI RegSaveKeyA(HKEY,LPCSTR,LPSECURITY_ATTRIBUTES); LONG WINAPI RegSaveKeyA(HKEY,LPCSTR,LPSECURITY_ATTRIBUTES);
LONG WINAPI RegSaveKeyW(HKEY,LPCWSTR,LPSECURITY_ATTRIBUTES); LONG WINAPI RegSaveKeyW(HKEY,LPCWSTR,LPSECURITY_ATTRIBUTES);
LONG WINAPI RegSetKeySecurity(HKEY,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR); LONG WINAPI RegSetKeySecurity(HKEY,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
LONG WINAPI RegSetValueA(HKEY,LPCSTR,DWORD,LPCSTR,DWORD); LONG WINAPI RegSetValueA(HKEY,LPCSTR,DWORD,LPCSTR,DWORD);
LONG WINAPI RegSetValueExA(HKEY,LPCSTR,DWORD,DWORD,const BYTE*,DWORD); LONG WINAPI RegSetValueExA(HKEY,LPCSTR,DWORD,DWORD,const BYTE*,DWORD);
LONG WINAPI RegSetValueExW(HKEY,LPCWSTR,DWORD,DWORD,const BYTE*,DWORD); LONG WINAPI RegSetValueExW(HKEY,LPCWSTR,DWORD,DWORD,const BYTE*,DWORD);
LONG WINAPI RegSetValueW(HKEY,LPCWSTR,DWORD,LPCWSTR,DWORD); LONG WINAPI RegSetValueW(HKEY,LPCWSTR,DWORD,LPCWSTR,DWORD);
LONG WINAPI RegUnLoadKeyA(HKEY,LPCSTR); LONG WINAPI RegUnLoadKeyA(HKEY,LPCSTR);
LONG WINAPI RegUnLoadKeyW(HKEY,LPCWSTR); LONG WINAPI RegUnLoadKeyW(HKEY,LPCWSTR);
#ifdef UNICODE #ifdef UNICODE
typedef VALENTW VALENT,*PVALENT; typedef VALENTW VALENT,*PVALENT;
#define AbortSystemShutdown AbortSystemShutdownW #define AbortSystemShutdown AbortSystemShutdownW
#define InitiateSystemShutdown InitiateSystemShutdownW #define InitiateSystemShutdown InitiateSystemShutdownW
#define RegConnectRegistry RegConnectRegistryW #define RegConnectRegistry RegConnectRegistryW
#define RegCreateKey RegCreateKeyW #define RegCreateKey RegCreateKeyW
#define RegCreateKeyEx RegCreateKeyExW #define RegCreateKeyEx RegCreateKeyExW
#define RegDeleteKey RegDeleteKeyW #define RegDeleteKey RegDeleteKeyW
#define RegDeleteValue RegDeleteValueW #define RegDeleteValue RegDeleteValueW
#define RegEnumKey RegEnumKeyW #define RegEnumKey RegEnumKeyW
#define RegEnumKeyEx RegEnumKeyExW #define RegEnumKeyEx RegEnumKeyExW
#define RegEnumValue RegEnumValueW #define RegEnumValue RegEnumValueW
#define RegLoadKey RegLoadKeyW #define RegLoadKey RegLoadKeyW
#define RegOpenKey RegOpenKeyW #define RegOpenKey RegOpenKeyW
#define RegOpenKeyEx RegOpenKeyExW #define RegOpenKeyEx RegOpenKeyExW
#define RegQueryInfoKey RegQueryInfoKeyW #define RegQueryInfoKey RegQueryInfoKeyW
#define RegQueryMultipleValues RegQueryMultipleValuesW #define RegQueryMultipleValues RegQueryMultipleValuesW
#define RegQueryValue RegQueryValueW #define RegQueryValue RegQueryValueW
#define RegQueryValueEx RegQueryValueExW #define RegQueryValueEx RegQueryValueExW
#define RegReplaceKey RegReplaceKeyW #define RegReplaceKey RegReplaceKeyW
#define RegRestoreKey RegRestoreKeyW #define RegRestoreKey RegRestoreKeyW
#define RegSaveKey RegSaveKeyW #define RegSaveKey RegSaveKeyW
#define RegSetValue RegSetValueW #define RegSetValue RegSetValueW
#define RegSetValueEx RegSetValueExW #define RegSetValueEx RegSetValueExW
#define RegUnLoadKey RegUnLoadKeyW #define RegUnLoadKey RegUnLoadKeyW
#else #else
typedef VALENTA VALENT,*PVALENT; typedef VALENTA VALENT,*PVALENT;
#define AbortSystemShutdown AbortSystemShutdownA #define AbortSystemShutdown AbortSystemShutdownA
#define InitiateSystemShutdown InitiateSystemShutdownA #define InitiateSystemShutdown InitiateSystemShutdownA
#define RegConnectRegistry RegConnectRegistryA #define RegConnectRegistry RegConnectRegistryA
#define RegCreateKey RegCreateKeyA #define RegCreateKey RegCreateKeyA
#define RegCreateKeyEx RegCreateKeyExA #define RegCreateKeyEx RegCreateKeyExA
#define RegDeleteKey RegDeleteKeyA #define RegDeleteKey RegDeleteKeyA
#define RegDeleteValue RegDeleteValueA #define RegDeleteValue RegDeleteValueA
#define RegEnumKey RegEnumKeyA #define RegEnumKey RegEnumKeyA
#define RegEnumKeyEx RegEnumKeyExA #define RegEnumKeyEx RegEnumKeyExA
#define RegEnumValue RegEnumValueA #define RegEnumValue RegEnumValueA
#define RegLoadKey RegLoadKeyA #define RegLoadKey RegLoadKeyA
#define RegOpenKey RegOpenKeyA #define RegOpenKey RegOpenKeyA
#define RegOpenKeyEx RegOpenKeyExA #define RegOpenKeyEx RegOpenKeyExA
#define RegQueryInfoKey RegQueryInfoKeyA #define RegQueryInfoKey RegQueryInfoKeyA
#define RegQueryMultipleValues RegQueryMultipleValuesA #define RegQueryMultipleValues RegQueryMultipleValuesA
#define RegQueryValue RegQueryValueA #define RegQueryValue RegQueryValueA
#define RegQueryValueEx RegQueryValueExA #define RegQueryValueEx RegQueryValueExA
#define RegReplaceKey RegReplaceKeyA #define RegReplaceKey RegReplaceKeyA
#define RegRestoreKey RegRestoreKeyA #define RegRestoreKey RegRestoreKeyA
#define RegSaveKey RegSaveKeyA #define RegSaveKey RegSaveKeyA
#define RegSetValue RegSetValueA #define RegSetValue RegSetValueA
#define RegSetValueEx RegSetValueExA #define RegSetValueEx RegSetValueExA
#define RegUnLoadKey RegUnLoadKeyA #define RegUnLoadKey RegUnLoadKeyA
#endif #endif
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif

View File

@ -1,309 +1,309 @@
#ifndef _WINSVC_H #ifndef _WINSVC_H
#define _WINSVC_H #define _WINSVC_H
#if __GNUC__ >=3 #if __GNUC__ >=3
#pragma GCC system_header #pragma GCC system_header
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#define SERVICES_ACTIVE_DATABASEA "ServicesActive" #define SERVICES_ACTIVE_DATABASEA "ServicesActive"
#define SERVICES_ACTIVE_DATABASEW L"ServicesActive" #define SERVICES_ACTIVE_DATABASEW L"ServicesActive"
#define SERVICES_FAILED_DATABASEA "ServicesFailed" #define SERVICES_FAILED_DATABASEA "ServicesFailed"
#define SERVICES_FAILED_DATABASEW L"ServicesFailed" #define SERVICES_FAILED_DATABASEW L"ServicesFailed"
#define SC_GROUP_IDENTIFIERA '+' #define SC_GROUP_IDENTIFIERA '+'
#define SC_GROUP_IDENTIFIERW L'+' #define SC_GROUP_IDENTIFIERW L'+'
#define SC_MANAGER_ALL_ACCESS 0xf003f #define SC_MANAGER_ALL_ACCESS 0xf003f
#define SC_MANAGER_CONNECT 1 #define SC_MANAGER_CONNECT 1
#define SC_MANAGER_CREATE_SERVICE 2 #define SC_MANAGER_CREATE_SERVICE 2
#define SC_MANAGER_ENUMERATE_SERVICE 4 #define SC_MANAGER_ENUMERATE_SERVICE 4
#define SC_MANAGER_LOCK 8 #define SC_MANAGER_LOCK 8
#define SC_MANAGER_QUERY_LOCK_STATUS 16 #define SC_MANAGER_QUERY_LOCK_STATUS 16
#define SC_MANAGER_MODIFY_BOOT_CONFIG 32 #define SC_MANAGER_MODIFY_BOOT_CONFIG 32
#define SERVICE_NO_CHANGE (-1) #define SERVICE_NO_CHANGE (-1)
#define SERVICE_STOPPED 1 #define SERVICE_STOPPED 1
#define SERVICE_START_PENDING 2 #define SERVICE_START_PENDING 2
#define SERVICE_STOP_PENDING 3 #define SERVICE_STOP_PENDING 3
#define SERVICE_RUNNING 4 #define SERVICE_RUNNING 4
#define SERVICE_CONTINUE_PENDING 5 #define SERVICE_CONTINUE_PENDING 5
#define SERVICE_PAUSE_PENDING 6 #define SERVICE_PAUSE_PENDING 6
#define SERVICE_PAUSED 7 #define SERVICE_PAUSED 7
#define SERVICE_ACCEPT_STOP 1 #define SERVICE_ACCEPT_STOP 1
#define SERVICE_ACCEPT_PAUSE_CONTINUE 2 #define SERVICE_ACCEPT_PAUSE_CONTINUE 2
#define SERVICE_ACCEPT_SHUTDOWN 4 #define SERVICE_ACCEPT_SHUTDOWN 4
#define SERVICE_ACCEPT_PARAMCHANGE 8 #define SERVICE_ACCEPT_PARAMCHANGE 8
#define SERVICE_ACCEPT_NETBINDCHANGE 16 #define SERVICE_ACCEPT_NETBINDCHANGE 16
#define SERVICE_ACCEPT_HARDWAREPROFILECHANGE 32 #define SERVICE_ACCEPT_HARDWAREPROFILECHANGE 32
#define SERVICE_ACCEPT_POWEREVENT 64 #define SERVICE_ACCEPT_POWEREVENT 64
#define SERVICE_ACCEPT_SESSIONCHANGE 128 #define SERVICE_ACCEPT_SESSIONCHANGE 128
#define SERVICE_CONTROL_STOP 1 #define SERVICE_CONTROL_STOP 1
#define SERVICE_CONTROL_PAUSE 2 #define SERVICE_CONTROL_PAUSE 2
#define SERVICE_CONTROL_CONTINUE 3 #define SERVICE_CONTROL_CONTINUE 3
#define SERVICE_CONTROL_INTERROGATE 4 #define SERVICE_CONTROL_INTERROGATE 4
#define SERVICE_CONTROL_SHUTDOWN 5 #define SERVICE_CONTROL_SHUTDOWN 5
#define SERVICE_CONTROL_PARAMCHANGE 6 #define SERVICE_CONTROL_PARAMCHANGE 6
#define SERVICE_CONTROL_NETBINDADD 7 #define SERVICE_CONTROL_NETBINDADD 7
#define SERVICE_CONTROL_NETBINDREMOVE 8 #define SERVICE_CONTROL_NETBINDREMOVE 8
#define SERVICE_CONTROL_NETBINDENABLE 9 #define SERVICE_CONTROL_NETBINDENABLE 9
#define SERVICE_CONTROL_NETBINDDISABLE 10 #define SERVICE_CONTROL_NETBINDDISABLE 10
#define SERVICE_CONTROL_DEVICEEVENT 11 #define SERVICE_CONTROL_DEVICEEVENT 11
#define SERVICE_CONTROL_HARDWAREPROFILECHANGE 12 #define SERVICE_CONTROL_HARDWAREPROFILECHANGE 12
#define SERVICE_CONTROL_POWEREVENT 13 #define SERVICE_CONTROL_POWEREVENT 13
#define SERVICE_CONTROL_SESSIONCHANGE 14 #define SERVICE_CONTROL_SESSIONCHANGE 14
#define SERVICE_ACTIVE 1 #define SERVICE_ACTIVE 1
#define SERVICE_INACTIVE 2 #define SERVICE_INACTIVE 2
#define SERVICE_STATE_ALL 3 #define SERVICE_STATE_ALL 3
#define SERVICE_QUERY_CONFIG 1 #define SERVICE_QUERY_CONFIG 1
#define SERVICE_CHANGE_CONFIG 2 #define SERVICE_CHANGE_CONFIG 2
#define SERVICE_QUERY_STATUS 4 #define SERVICE_QUERY_STATUS 4
#define SERVICE_ENUMERATE_DEPENDENTS 8 #define SERVICE_ENUMERATE_DEPENDENTS 8
#define SERVICE_START 16 #define SERVICE_START 16
#define SERVICE_STOP 32 #define SERVICE_STOP 32
#define SERVICE_PAUSE_CONTINUE 64 #define SERVICE_PAUSE_CONTINUE 64
#define SERVICE_INTERROGATE 128 #define SERVICE_INTERROGATE 128
#define SERVICE_USER_DEFINED_CONTROL 256 #define SERVICE_USER_DEFINED_CONTROL 256
#define SERVICE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SERVICE_QUERY_CONFIG|SERVICE_CHANGE_CONFIG|SERVICE_QUERY_STATUS|SERVICE_ENUMERATE_DEPENDENTS|SERVICE_START|SERVICE_STOP|SERVICE_PAUSE_CONTINUE|SERVICE_INTERROGATE|SERVICE_USER_DEFINED_CONTROL) #define SERVICE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SERVICE_QUERY_CONFIG|SERVICE_CHANGE_CONFIG|SERVICE_QUERY_STATUS|SERVICE_ENUMERATE_DEPENDENTS|SERVICE_START|SERVICE_STOP|SERVICE_PAUSE_CONTINUE|SERVICE_INTERROGATE|SERVICE_USER_DEFINED_CONTROL)
#define SERVICE_RUNS_IN_SYSTEM_PROCESS 1 #define SERVICE_RUNS_IN_SYSTEM_PROCESS 1
#define SERVICE_CONFIG_DESCRIPTION 1 #define SERVICE_CONFIG_DESCRIPTION 1
#define SERVICE_CONFIG_FAILURE_ACTIONS 2 #define SERVICE_CONFIG_FAILURE_ACTIONS 2
typedef struct _SERVICE_STATUS { typedef struct _SERVICE_STATUS {
DWORD dwServiceType; DWORD dwServiceType;
DWORD dwCurrentState; DWORD dwCurrentState;
DWORD dwControlsAccepted; DWORD dwControlsAccepted;
DWORD dwWin32ExitCode; DWORD dwWin32ExitCode;
DWORD dwServiceSpecificExitCode; DWORD dwServiceSpecificExitCode;
DWORD dwCheckPoint; DWORD dwCheckPoint;
DWORD dwWaitHint; DWORD dwWaitHint;
} SERVICE_STATUS,*LPSERVICE_STATUS; } SERVICE_STATUS,*LPSERVICE_STATUS;
typedef struct _SERVICE_STATUS_PROCESS { typedef struct _SERVICE_STATUS_PROCESS {
DWORD dwServiceType; DWORD dwServiceType;
DWORD dwCurrentState; DWORD dwCurrentState;
DWORD dwControlsAccepted; DWORD dwControlsAccepted;
DWORD dwWin32ExitCode; DWORD dwWin32ExitCode;
DWORD dwServiceSpecificExitCode; DWORD dwServiceSpecificExitCode;
DWORD dwCheckPoint; DWORD dwCheckPoint;
DWORD dwWaitHint; DWORD dwWaitHint;
DWORD dwProcessId; DWORD dwProcessId;
DWORD dwServiceFlags; DWORD dwServiceFlags;
} SERVICE_STATUS_PROCESS, *LPSERVICE_STATUS_PROCESS; } SERVICE_STATUS_PROCESS, *LPSERVICE_STATUS_PROCESS;
typedef enum _SC_STATUS_TYPE { typedef enum _SC_STATUS_TYPE {
SC_STATUS_PROCESS_INFO = 0 SC_STATUS_PROCESS_INFO = 0
} SC_STATUS_TYPE; } SC_STATUS_TYPE;
typedef enum _SC_ENUM_TYPE { typedef enum _SC_ENUM_TYPE {
SC_ENUM_PROCESS_INFO = 0 SC_ENUM_PROCESS_INFO = 0
} SC_ENUM_TYPE; } SC_ENUM_TYPE;
typedef struct _ENUM_SERVICE_STATUSA { typedef struct _ENUM_SERVICE_STATUSA {
LPSTR lpServiceName; LPSTR lpServiceName;
LPSTR lpDisplayName; LPSTR lpDisplayName;
SERVICE_STATUS ServiceStatus; SERVICE_STATUS ServiceStatus;
} ENUM_SERVICE_STATUSA,*LPENUM_SERVICE_STATUSA; } ENUM_SERVICE_STATUSA,*LPENUM_SERVICE_STATUSA;
typedef struct _ENUM_SERVICE_STATUSW { typedef struct _ENUM_SERVICE_STATUSW {
LPWSTR lpServiceName; LPWSTR lpServiceName;
LPWSTR lpDisplayName; LPWSTR lpDisplayName;
SERVICE_STATUS ServiceStatus; SERVICE_STATUS ServiceStatus;
} ENUM_SERVICE_STATUSW,*LPENUM_SERVICE_STATUSW; } ENUM_SERVICE_STATUSW,*LPENUM_SERVICE_STATUSW;
typedef struct _ENUM_SERVICE_STATUS_PROCESSA { typedef struct _ENUM_SERVICE_STATUS_PROCESSA {
LPSTR lpServiceName; LPSTR lpServiceName;
LPSTR lpDisplayName; LPSTR lpDisplayName;
SERVICE_STATUS_PROCESS ServiceStatusProcess; SERVICE_STATUS_PROCESS ServiceStatusProcess;
} ENUM_SERVICE_STATUS_PROCESSA,*LPENUM_SERVICE_STATUS_PROCESSA; } ENUM_SERVICE_STATUS_PROCESSA,*LPENUM_SERVICE_STATUS_PROCESSA;
typedef struct _ENUM_SERVICE_STATUS_PROCESSW { typedef struct _ENUM_SERVICE_STATUS_PROCESSW {
LPWSTR lpServiceName; LPWSTR lpServiceName;
LPWSTR lpDisplayName; LPWSTR lpDisplayName;
SERVICE_STATUS_PROCESS ServiceStatusProcess; SERVICE_STATUS_PROCESS ServiceStatusProcess;
} ENUM_SERVICE_STATUS_PROCESSW,*LPENUM_SERVICE_STATUS_PROCESSW; } ENUM_SERVICE_STATUS_PROCESSW,*LPENUM_SERVICE_STATUS_PROCESSW;
typedef struct _QUERY_SERVICE_CONFIGA { typedef struct _QUERY_SERVICE_CONFIGA {
DWORD dwServiceType; DWORD dwServiceType;
DWORD dwStartType; DWORD dwStartType;
DWORD dwErrorControl; DWORD dwErrorControl;
LPSTR lpBinaryPathName; LPSTR lpBinaryPathName;
LPSTR lpLoadOrderGroup; LPSTR lpLoadOrderGroup;
DWORD dwTagId; DWORD dwTagId;
LPSTR lpDependencies; LPSTR lpDependencies;
LPSTR lpServiceStartName; LPSTR lpServiceStartName;
LPSTR lpDisplayName; LPSTR lpDisplayName;
} QUERY_SERVICE_CONFIGA,*LPQUERY_SERVICE_CONFIGA; } QUERY_SERVICE_CONFIGA,*LPQUERY_SERVICE_CONFIGA;
typedef struct _QUERY_SERVICE_CONFIGW { typedef struct _QUERY_SERVICE_CONFIGW {
DWORD dwServiceType; DWORD dwServiceType;
DWORD dwStartType; DWORD dwStartType;
DWORD dwErrorControl; DWORD dwErrorControl;
LPWSTR lpBinaryPathName; LPWSTR lpBinaryPathName;
LPWSTR lpLoadOrderGroup; LPWSTR lpLoadOrderGroup;
DWORD dwTagId; DWORD dwTagId;
LPWSTR lpDependencies; LPWSTR lpDependencies;
LPWSTR lpServiceStartName; LPWSTR lpServiceStartName;
LPWSTR lpDisplayName; LPWSTR lpDisplayName;
} QUERY_SERVICE_CONFIGW,*LPQUERY_SERVICE_CONFIGW; } QUERY_SERVICE_CONFIGW,*LPQUERY_SERVICE_CONFIGW;
typedef struct _QUERY_SERVICE_LOCK_STATUSA { typedef struct _QUERY_SERVICE_LOCK_STATUSA {
DWORD fIsLocked; DWORD fIsLocked;
LPSTR lpLockOwner; LPSTR lpLockOwner;
DWORD dwLockDuration; DWORD dwLockDuration;
} QUERY_SERVICE_LOCK_STATUSA,*LPQUERY_SERVICE_LOCK_STATUSA; } QUERY_SERVICE_LOCK_STATUSA,*LPQUERY_SERVICE_LOCK_STATUSA;
typedef struct _QUERY_SERVICE_LOCK_STATUSW { typedef struct _QUERY_SERVICE_LOCK_STATUSW {
DWORD fIsLocked; DWORD fIsLocked;
LPWSTR lpLockOwner; LPWSTR lpLockOwner;
DWORD dwLockDuration; DWORD dwLockDuration;
} QUERY_SERVICE_LOCK_STATUSW,*LPQUERY_SERVICE_LOCK_STATUSW; } QUERY_SERVICE_LOCK_STATUSW,*LPQUERY_SERVICE_LOCK_STATUSW;
typedef void (WINAPI *LPSERVICE_MAIN_FUNCTIONA)(DWORD,LPSTR*); typedef void (WINAPI *LPSERVICE_MAIN_FUNCTIONA)(DWORD,LPSTR*);
typedef void (WINAPI *LPSERVICE_MAIN_FUNCTIONW)(DWORD,LPWSTR*); typedef void (WINAPI *LPSERVICE_MAIN_FUNCTIONW)(DWORD,LPWSTR*);
typedef struct _SERVICE_TABLE_ENTRYA { typedef struct _SERVICE_TABLE_ENTRYA {
LPSTR lpServiceName; LPSTR lpServiceName;
LPSERVICE_MAIN_FUNCTIONA lpServiceProc; LPSERVICE_MAIN_FUNCTIONA lpServiceProc;
} SERVICE_TABLE_ENTRYA,*LPSERVICE_TABLE_ENTRYA; } SERVICE_TABLE_ENTRYA,*LPSERVICE_TABLE_ENTRYA;
typedef struct _SERVICE_TABLE_ENTRYW { typedef struct _SERVICE_TABLE_ENTRYW {
LPWSTR lpServiceName; LPWSTR lpServiceName;
LPSERVICE_MAIN_FUNCTIONW lpServiceProc; LPSERVICE_MAIN_FUNCTIONW lpServiceProc;
} SERVICE_TABLE_ENTRYW,*LPSERVICE_TABLE_ENTRYW; } SERVICE_TABLE_ENTRYW,*LPSERVICE_TABLE_ENTRYW;
DECLARE_HANDLE(SC_HANDLE); DECLARE_HANDLE(SC_HANDLE);
typedef SC_HANDLE *LPSC_HANDLE; typedef SC_HANDLE *LPSC_HANDLE;
typedef PVOID SC_LOCK; typedef PVOID SC_LOCK;
typedef DWORD SERVICE_STATUS_HANDLE; typedef DWORD SERVICE_STATUS_HANDLE;
typedef VOID(WINAPI *LPHANDLER_FUNCTION)(DWORD); typedef VOID(WINAPI *LPHANDLER_FUNCTION)(DWORD);
typedef DWORD (WINAPI *LPHANDLER_FUNCTION_EX)(DWORD,DWORD,LPVOID,LPVOID); typedef DWORD (WINAPI *LPHANDLER_FUNCTION_EX)(DWORD,DWORD,LPVOID,LPVOID);
typedef struct _SERVICE_DESCRIPTIONA { typedef struct _SERVICE_DESCRIPTIONA {
LPSTR lpDescription; LPSTR lpDescription;
} SERVICE_DESCRIPTIONA,*LPSERVICE_DESCRIPTIONA; } SERVICE_DESCRIPTIONA,*LPSERVICE_DESCRIPTIONA;
typedef struct _SERVICE_DESCRIPTIONW { typedef struct _SERVICE_DESCRIPTIONW {
LPWSTR lpDescription; LPWSTR lpDescription;
} SERVICE_DESCRIPTIONW,*LPSERVICE_DESCRIPTIONW; } SERVICE_DESCRIPTIONW,*LPSERVICE_DESCRIPTIONW;
typedef enum _SC_ACTION_TYPE { typedef enum _SC_ACTION_TYPE {
SC_ACTION_NONE = 0, SC_ACTION_NONE = 0,
SC_ACTION_RESTART = 1, SC_ACTION_RESTART = 1,
SC_ACTION_REBOOT = 2, SC_ACTION_REBOOT = 2,
SC_ACTION_RUN_COMMAND = 3 SC_ACTION_RUN_COMMAND = 3
} SC_ACTION_TYPE; } SC_ACTION_TYPE;
typedef struct _SC_ACTION { typedef struct _SC_ACTION {
SC_ACTION_TYPE Type; SC_ACTION_TYPE Type;
DWORD Delay; DWORD Delay;
} SC_ACTION,*LPSC_ACTION; } SC_ACTION,*LPSC_ACTION;
typedef struct _SERVICE_FAILURE_ACTIONSA { typedef struct _SERVICE_FAILURE_ACTIONSA {
DWORD dwResetPeriod; DWORD dwResetPeriod;
LPSTR lpRebootMsg; LPSTR lpRebootMsg;
LPSTR lpCommand; LPSTR lpCommand;
DWORD cActions; DWORD cActions;
SC_ACTION * lpsaActions; SC_ACTION * lpsaActions;
} SERVICE_FAILURE_ACTIONSA,*LPSERVICE_FAILURE_ACTIONSA; } SERVICE_FAILURE_ACTIONSA,*LPSERVICE_FAILURE_ACTIONSA;
typedef struct _SERVICE_FAILURE_ACTIONSW { typedef struct _SERVICE_FAILURE_ACTIONSW {
DWORD dwResetPeriod; DWORD dwResetPeriod;
LPWSTR lpRebootMsg; LPWSTR lpRebootMsg;
LPWSTR lpCommand; LPWSTR lpCommand;
DWORD cActions; DWORD cActions;
SC_ACTION * lpsaActions; SC_ACTION * lpsaActions;
} SERVICE_FAILURE_ACTIONSW,*LPSERVICE_FAILURE_ACTIONSW; } SERVICE_FAILURE_ACTIONSW,*LPSERVICE_FAILURE_ACTIONSW;
BOOL WINAPI ChangeServiceConfigA(SC_HANDLE,DWORD,DWORD,DWORD,LPCSTR,LPCSTR,LPDWORD,LPCSTR,LPCSTR,LPCSTR,LPCSTR); BOOL WINAPI ChangeServiceConfigA(SC_HANDLE,DWORD,DWORD,DWORD,LPCSTR,LPCSTR,LPDWORD,LPCSTR,LPCSTR,LPCSTR,LPCSTR);
BOOL WINAPI ChangeServiceConfigW(SC_HANDLE,DWORD,DWORD,DWORD,LPCWSTR,LPCWSTR,LPDWORD,LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR); BOOL WINAPI ChangeServiceConfigW(SC_HANDLE,DWORD,DWORD,DWORD,LPCWSTR,LPCWSTR,LPDWORD,LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR);
BOOL WINAPI ChangeServiceConfig2A(SC_HANDLE,DWORD,LPVOID); BOOL WINAPI ChangeServiceConfig2A(SC_HANDLE,DWORD,LPVOID);
BOOL WINAPI ChangeServiceConfig2W(SC_HANDLE,DWORD,LPVOID); BOOL WINAPI ChangeServiceConfig2W(SC_HANDLE,DWORD,LPVOID);
BOOL WINAPI CloseServiceHandle(SC_HANDLE); BOOL WINAPI CloseServiceHandle(SC_HANDLE);
BOOL WINAPI ControlService(SC_HANDLE,DWORD,LPSERVICE_STATUS); BOOL WINAPI ControlService(SC_HANDLE,DWORD,LPSERVICE_STATUS);
SC_HANDLE WINAPI CreateServiceA(SC_HANDLE,LPCSTR,LPCSTR,DWORD,DWORD,DWORD,DWORD,LPCSTR,LPCSTR,PDWORD,LPCSTR,LPCSTR,LPCSTR); SC_HANDLE WINAPI CreateServiceA(SC_HANDLE,LPCSTR,LPCSTR,DWORD,DWORD,DWORD,DWORD,LPCSTR,LPCSTR,PDWORD,LPCSTR,LPCSTR,LPCSTR);
SC_HANDLE WINAPI CreateServiceW(SC_HANDLE,LPCWSTR,LPCWSTR,DWORD,DWORD,DWORD,DWORD,LPCWSTR,LPCWSTR,PDWORD,LPCWSTR,LPCWSTR,LPCWSTR); SC_HANDLE WINAPI CreateServiceW(SC_HANDLE,LPCWSTR,LPCWSTR,DWORD,DWORD,DWORD,DWORD,LPCWSTR,LPCWSTR,PDWORD,LPCWSTR,LPCWSTR,LPCWSTR);
BOOL WINAPI DeleteService(SC_HANDLE); BOOL WINAPI DeleteService(SC_HANDLE);
BOOL WINAPI EnumDependentServicesA(SC_HANDLE,DWORD,LPENUM_SERVICE_STATUSA,DWORD,PDWORD,PDWORD); BOOL WINAPI EnumDependentServicesA(SC_HANDLE,DWORD,LPENUM_SERVICE_STATUSA,DWORD,PDWORD,PDWORD);
BOOL WINAPI EnumDependentServicesW(SC_HANDLE,DWORD,LPENUM_SERVICE_STATUSW,DWORD,PDWORD,PDWORD); BOOL WINAPI EnumDependentServicesW(SC_HANDLE,DWORD,LPENUM_SERVICE_STATUSW,DWORD,PDWORD,PDWORD);
BOOL WINAPI EnumServicesStatusA(SC_HANDLE,DWORD,DWORD,LPENUM_SERVICE_STATUSA,DWORD,PDWORD,PDWORD,PDWORD); BOOL WINAPI EnumServicesStatusA(SC_HANDLE,DWORD,DWORD,LPENUM_SERVICE_STATUSA,DWORD,PDWORD,PDWORD,PDWORD);
BOOL WINAPI EnumServicesStatusW(SC_HANDLE,DWORD,DWORD,LPENUM_SERVICE_STATUSW,DWORD,PDWORD,PDWORD,PDWORD); BOOL WINAPI EnumServicesStatusW(SC_HANDLE,DWORD,DWORD,LPENUM_SERVICE_STATUSW,DWORD,PDWORD,PDWORD,PDWORD);
BOOL WINAPI EnumServicesStatusExA(SC_HANDLE,SC_ENUM_TYPE,DWORD,DWORD,LPBYTE,DWORD,LPDWORD,LPDWORD,LPDWORD,LPCSTR); BOOL WINAPI EnumServicesStatusExA(SC_HANDLE,SC_ENUM_TYPE,DWORD,DWORD,LPBYTE,DWORD,LPDWORD,LPDWORD,LPDWORD,LPCSTR);
BOOL WINAPI EnumServicesStatusExW(SC_HANDLE,SC_ENUM_TYPE,DWORD,DWORD,LPBYTE,DWORD,LPDWORD,LPDWORD,LPDWORD,LPCWSTR); BOOL WINAPI EnumServicesStatusExW(SC_HANDLE,SC_ENUM_TYPE,DWORD,DWORD,LPBYTE,DWORD,LPDWORD,LPDWORD,LPDWORD,LPCWSTR);
BOOL WINAPI GetServiceDisplayNameA(SC_HANDLE,LPCSTR,LPSTR,PDWORD); BOOL WINAPI GetServiceDisplayNameA(SC_HANDLE,LPCSTR,LPSTR,PDWORD);
BOOL WINAPI GetServiceDisplayNameW(SC_HANDLE,LPCWSTR,LPWSTR,PDWORD); BOOL WINAPI GetServiceDisplayNameW(SC_HANDLE,LPCWSTR,LPWSTR,PDWORD);
BOOL WINAPI GetServiceKeyNameA(SC_HANDLE,LPCSTR,LPSTR,PDWORD); BOOL WINAPI GetServiceKeyNameA(SC_HANDLE,LPCSTR,LPSTR,PDWORD);
BOOL WINAPI GetServiceKeyNameW(SC_HANDLE,LPCWSTR,LPWSTR,PDWORD); BOOL WINAPI GetServiceKeyNameW(SC_HANDLE,LPCWSTR,LPWSTR,PDWORD);
SC_LOCK WINAPI LockServiceDatabase(SC_HANDLE); SC_LOCK WINAPI LockServiceDatabase(SC_HANDLE);
BOOL WINAPI NotifyBootConfigStatus(BOOL); BOOL WINAPI NotifyBootConfigStatus(BOOL);
SC_HANDLE WINAPI OpenSCManagerA(LPCSTR,LPCSTR,DWORD); SC_HANDLE WINAPI OpenSCManagerA(LPCSTR,LPCSTR,DWORD);
SC_HANDLE WINAPI OpenSCManagerW(LPCWSTR,LPCWSTR,DWORD); SC_HANDLE WINAPI OpenSCManagerW(LPCWSTR,LPCWSTR,DWORD);
SC_HANDLE WINAPI OpenServiceA(SC_HANDLE,LPCSTR,DWORD); SC_HANDLE WINAPI OpenServiceA(SC_HANDLE,LPCSTR,DWORD);
SC_HANDLE WINAPI OpenServiceW(SC_HANDLE,LPCWSTR,DWORD); SC_HANDLE WINAPI OpenServiceW(SC_HANDLE,LPCWSTR,DWORD);
BOOL WINAPI QueryServiceConfigA(SC_HANDLE,LPQUERY_SERVICE_CONFIGA,DWORD,PDWORD); BOOL WINAPI QueryServiceConfigA(SC_HANDLE,LPQUERY_SERVICE_CONFIGA,DWORD,PDWORD);
BOOL WINAPI QueryServiceConfigW(SC_HANDLE,LPQUERY_SERVICE_CONFIGW,DWORD,PDWORD); BOOL WINAPI QueryServiceConfigW(SC_HANDLE,LPQUERY_SERVICE_CONFIGW,DWORD,PDWORD);
BOOL WINAPI QueryServiceConfig2A(SC_HANDLE,DWORD,LPBYTE,DWORD,LPDWORD); BOOL WINAPI QueryServiceConfig2A(SC_HANDLE,DWORD,LPBYTE,DWORD,LPDWORD);
BOOL WINAPI QueryServiceConfig2W(SC_HANDLE,DWORD,LPBYTE,DWORD,LPDWORD); BOOL WINAPI QueryServiceConfig2W(SC_HANDLE,DWORD,LPBYTE,DWORD,LPDWORD);
BOOL WINAPI QueryServiceLockStatusA(SC_HANDLE,LPQUERY_SERVICE_LOCK_STATUSA,DWORD,PDWORD); BOOL WINAPI QueryServiceLockStatusA(SC_HANDLE,LPQUERY_SERVICE_LOCK_STATUSA,DWORD,PDWORD);
BOOL WINAPI QueryServiceLockStatusW(SC_HANDLE,LPQUERY_SERVICE_LOCK_STATUSW,DWORD,PDWORD); BOOL WINAPI QueryServiceLockStatusW(SC_HANDLE,LPQUERY_SERVICE_LOCK_STATUSW,DWORD,PDWORD);
BOOL WINAPI QueryServiceObjectSecurity(SC_HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,DWORD,LPDWORD); BOOL WINAPI QueryServiceObjectSecurity(SC_HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,DWORD,LPDWORD);
BOOL WINAPI QueryServiceStatus(SC_HANDLE,LPSERVICE_STATUS); BOOL WINAPI QueryServiceStatus(SC_HANDLE,LPSERVICE_STATUS);
BOOL WINAPI QueryServiceStatusEx(SC_HANDLE,SC_STATUS_TYPE,LPBYTE,DWORD,LPDWORD); BOOL WINAPI QueryServiceStatusEx(SC_HANDLE,SC_STATUS_TYPE,LPBYTE,DWORD,LPDWORD);
SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandlerA(LPCSTR,LPHANDLER_FUNCTION); SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandlerA(LPCSTR,LPHANDLER_FUNCTION);
SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandlerW(LPCWSTR,LPHANDLER_FUNCTION); SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandlerW(LPCWSTR,LPHANDLER_FUNCTION);
SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandlerExA(LPCSTR,LPHANDLER_FUNCTION_EX,LPVOID); SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandlerExA(LPCSTR,LPHANDLER_FUNCTION_EX,LPVOID);
SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandlerExW(LPCWSTR,LPHANDLER_FUNCTION_EX,LPVOID); SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandlerExW(LPCWSTR,LPHANDLER_FUNCTION_EX,LPVOID);
BOOL WINAPI SetServiceObjectSecurity(SC_HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR); BOOL WINAPI SetServiceObjectSecurity(SC_HANDLE,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
BOOL WINAPI SetServiceStatus(SERVICE_STATUS_HANDLE,LPSERVICE_STATUS); BOOL WINAPI SetServiceStatus(SERVICE_STATUS_HANDLE,LPSERVICE_STATUS);
BOOL WINAPI StartServiceA(SC_HANDLE,DWORD,LPCSTR*); BOOL WINAPI StartServiceA(SC_HANDLE,DWORD,LPCSTR*);
BOOL WINAPI StartServiceCtrlDispatcherA(LPSERVICE_TABLE_ENTRYA); BOOL WINAPI StartServiceCtrlDispatcherA(LPSERVICE_TABLE_ENTRYA);
BOOL WINAPI StartServiceCtrlDispatcherW(LPSERVICE_TABLE_ENTRYW); BOOL WINAPI StartServiceCtrlDispatcherW(LPSERVICE_TABLE_ENTRYW);
BOOL WINAPI StartServiceW(SC_HANDLE,DWORD,LPCWSTR); BOOL WINAPI StartServiceW(SC_HANDLE,DWORD,LPCWSTR);
BOOL WINAPI UnlockServiceDatabase(SC_LOCK); BOOL WINAPI UnlockServiceDatabase(SC_LOCK);
#ifdef UNICODE #ifdef UNICODE
typedef ENUM_SERVICE_STATUSW ENUM_SERVICE_STATUS,*LPENUM_SERVICE_STATUS; typedef ENUM_SERVICE_STATUSW ENUM_SERVICE_STATUS,*LPENUM_SERVICE_STATUS;
typedef ENUM_SERVICE_STATUS_PROCESSW ENUM_SERVICE_STATUS_PROCESS; typedef ENUM_SERVICE_STATUS_PROCESSW ENUM_SERVICE_STATUS_PROCESS;
typedef LPENUM_SERVICE_STATUS_PROCESSW LPENUM_SERVICE_STATUS_PROCESS; typedef LPENUM_SERVICE_STATUS_PROCESSW LPENUM_SERVICE_STATUS_PROCESS;
typedef QUERY_SERVICE_CONFIGW QUERY_SERVICE_CONFIG,*LPQUERY_SERVICE_CONFIG; typedef QUERY_SERVICE_CONFIGW QUERY_SERVICE_CONFIG,*LPQUERY_SERVICE_CONFIG;
typedef QUERY_SERVICE_LOCK_STATUSW QUERY_SERVICE_LOCK_STATUS,*LPQUERY_SERVICE_LOCK_STATUS; typedef QUERY_SERVICE_LOCK_STATUSW QUERY_SERVICE_LOCK_STATUS,*LPQUERY_SERVICE_LOCK_STATUS;
typedef SERVICE_TABLE_ENTRYW SERVICE_TABLE_ENTRY,*LPSERVICE_TABLE_ENTRY; typedef SERVICE_TABLE_ENTRYW SERVICE_TABLE_ENTRY,*LPSERVICE_TABLE_ENTRY;
typedef LPSERVICE_MAIN_FUNCTIONW LPSERVICE_MAIN_FUNCTION; typedef LPSERVICE_MAIN_FUNCTIONW LPSERVICE_MAIN_FUNCTION;
typedef SERVICE_DESCRIPTIONW SERVICE_DESCRIPTION; typedef SERVICE_DESCRIPTIONW SERVICE_DESCRIPTION;
typedef LPSERVICE_DESCRIPTIONW LPSERVICE_DESCRIPTION; typedef LPSERVICE_DESCRIPTIONW LPSERVICE_DESCRIPTION;
typedef SERVICE_FAILURE_ACTIONSW SERVICE_FAILURE_ACTIONS; typedef SERVICE_FAILURE_ACTIONSW SERVICE_FAILURE_ACTIONS;
typedef LPSERVICE_FAILURE_ACTIONSW LPSERVICE_FAILURE_ACTIONS; typedef LPSERVICE_FAILURE_ACTIONSW LPSERVICE_FAILURE_ACTIONS;
#define SERVICES_ACTIVE_DATABASE SERVICES_ACTIVE_DATABASEW #define SERVICES_ACTIVE_DATABASE SERVICES_ACTIVE_DATABASEW
#define SERVICES_FAILED_DATABASE SERVICES_FAILED_DATABASEW #define SERVICES_FAILED_DATABASE SERVICES_FAILED_DATABASEW
#define SC_GROUP_IDENTIFIER SC_GROUP_IDENTIFIERW #define SC_GROUP_IDENTIFIER SC_GROUP_IDENTIFIERW
#define ChangeServiceConfig ChangeServiceConfigW #define ChangeServiceConfig ChangeServiceConfigW
#define ChangeServiceConfig2 ChangeServiceConfig2W #define ChangeServiceConfig2 ChangeServiceConfig2W
#define CreateService CreateServiceW #define CreateService CreateServiceW
#define EnumDependentServices EnumDependentServicesW #define EnumDependentServices EnumDependentServicesW
#define EnumServicesStatus EnumServicesStatusW #define EnumServicesStatus EnumServicesStatusW
#define EnumServicesStatusEx EnumServicesStatusExW #define EnumServicesStatusEx EnumServicesStatusExW
#define GetServiceDisplayName GetServiceDisplayNameW #define GetServiceDisplayName GetServiceDisplayNameW
#define GetServiceKeyName GetServiceKeyNameW #define GetServiceKeyName GetServiceKeyNameW
#define OpenSCManager OpenSCManagerW #define OpenSCManager OpenSCManagerW
#define OpenService OpenServiceW #define OpenService OpenServiceW
#define QueryServiceConfig QueryServiceConfigW #define QueryServiceConfig QueryServiceConfigW
#define QueryServiceConfig2 QueryServiceConfig2W #define QueryServiceConfig2 QueryServiceConfig2W
#define QueryServiceLockStatus QueryServiceLockStatusW #define QueryServiceLockStatus QueryServiceLockStatusW
#define RegisterServiceCtrlHandler RegisterServiceCtrlHandlerW #define RegisterServiceCtrlHandler RegisterServiceCtrlHandlerW
#define RegisterServiceCtrlHandlerEx RegisterServiceCtrlHandlerExW #define RegisterServiceCtrlHandlerEx RegisterServiceCtrlHandlerExW
#define StartService StartServiceW #define StartService StartServiceW
#define StartServiceCtrlDispatcher StartServiceCtrlDispatcherW #define StartServiceCtrlDispatcher StartServiceCtrlDispatcherW
#else #else
typedef ENUM_SERVICE_STATUSA ENUM_SERVICE_STATUS,*LPENUM_SERVICE_STATUS; typedef ENUM_SERVICE_STATUSA ENUM_SERVICE_STATUS,*LPENUM_SERVICE_STATUS;
typedef ENUM_SERVICE_STATUS_PROCESSA ENUM_SERVICE_STATUS_PROCESS; typedef ENUM_SERVICE_STATUS_PROCESSA ENUM_SERVICE_STATUS_PROCESS;
typedef LPENUM_SERVICE_STATUS_PROCESSA LPENUM_SERVICE_STATUS_PROCESS; typedef LPENUM_SERVICE_STATUS_PROCESSA LPENUM_SERVICE_STATUS_PROCESS;
typedef QUERY_SERVICE_CONFIGA QUERY_SERVICE_CONFIG,*LPQUERY_SERVICE_CONFIG; typedef QUERY_SERVICE_CONFIGA QUERY_SERVICE_CONFIG,*LPQUERY_SERVICE_CONFIG;
typedef QUERY_SERVICE_LOCK_STATUSA QUERY_SERVICE_LOCK_STATUS,*LPQUERY_SERVICE_LOCK_STATUS; typedef QUERY_SERVICE_LOCK_STATUSA QUERY_SERVICE_LOCK_STATUS,*LPQUERY_SERVICE_LOCK_STATUS;
typedef SERVICE_TABLE_ENTRYA SERVICE_TABLE_ENTRY,*LPSERVICE_TABLE_ENTRY; typedef SERVICE_TABLE_ENTRYA SERVICE_TABLE_ENTRY,*LPSERVICE_TABLE_ENTRY;
typedef LPSERVICE_MAIN_FUNCTIONA LPSERVICE_MAIN_FUNCTION; typedef LPSERVICE_MAIN_FUNCTIONA LPSERVICE_MAIN_FUNCTION;
typedef SERVICE_DESCRIPTIONA SERVICE_DESCRIPTION; typedef SERVICE_DESCRIPTIONA SERVICE_DESCRIPTION;
typedef LPSERVICE_DESCRIPTIONA LPSERVICE_DESCRIPTION; typedef LPSERVICE_DESCRIPTIONA LPSERVICE_DESCRIPTION;
typedef SERVICE_FAILURE_ACTIONSA SERVICE_FAILURE_ACTIONS; typedef SERVICE_FAILURE_ACTIONSA SERVICE_FAILURE_ACTIONS;
typedef LPSERVICE_FAILURE_ACTIONSA LPSERVICE_FAILURE_ACTIONS; typedef LPSERVICE_FAILURE_ACTIONSA LPSERVICE_FAILURE_ACTIONS;
#define SERVICES_ACTIVE_DATABASE SERVICES_ACTIVE_DATABASEA #define SERVICES_ACTIVE_DATABASE SERVICES_ACTIVE_DATABASEA
#define SERVICES_FAILED_DATABASE SERVICES_FAILED_DATABASEA #define SERVICES_FAILED_DATABASE SERVICES_FAILED_DATABASEA
#define SC_GROUP_IDENTIFIER SC_GROUP_IDENTIFIERA #define SC_GROUP_IDENTIFIER SC_GROUP_IDENTIFIERA
#define ChangeServiceConfig ChangeServiceConfigA #define ChangeServiceConfig ChangeServiceConfigA
#define ChangeServiceConfig2 ChangeServiceConfig2A #define ChangeServiceConfig2 ChangeServiceConfig2A
#define CreateService CreateServiceA #define CreateService CreateServiceA
#define EnumDependentServices EnumDependentServicesA #define EnumDependentServices EnumDependentServicesA
#define EnumServicesStatus EnumServicesStatusA #define EnumServicesStatus EnumServicesStatusA
#define EnumServicesStatusEx EnumServicesStatusExA #define EnumServicesStatusEx EnumServicesStatusExA
#define GetServiceDisplayName GetServiceDisplayNameA #define GetServiceDisplayName GetServiceDisplayNameA
#define GetServiceKeyName GetServiceKeyNameA #define GetServiceKeyName GetServiceKeyNameA
#define OpenSCManager OpenSCManagerA #define OpenSCManager OpenSCManagerA
#define OpenService OpenServiceA #define OpenService OpenServiceA
#define QueryServiceConfig QueryServiceConfigA #define QueryServiceConfig QueryServiceConfigA
#define QueryServiceConfig2 QueryServiceConfig2A #define QueryServiceConfig2 QueryServiceConfig2A
#define QueryServiceLockStatus QueryServiceLockStatusA #define QueryServiceLockStatus QueryServiceLockStatusA
#define RegisterServiceCtrlHandler RegisterServiceCtrlHandlerA #define RegisterServiceCtrlHandler RegisterServiceCtrlHandlerA
#define RegisterServiceCtrlHandlerEx RegisterServiceCtrlHandlerExA #define RegisterServiceCtrlHandlerEx RegisterServiceCtrlHandlerExA
#define StartService StartServiceA #define StartService StartServiceA
#define StartServiceCtrlDispatcher StartServiceCtrlDispatcherA #define StartServiceCtrlDispatcher StartServiceCtrlDispatcherA
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* _WINSVC_H */ #endif /* _WINSVC_H */

File diff suppressed because it is too large Load Diff

View File

@ -1,133 +1,133 @@
#ifndef _WINVER_H #ifndef _WINVER_H
#define _WINVER_H #define _WINVER_H
#if __GNUC__ >=3 #if __GNUC__ >=3
#pragma GCC system_header #pragma GCC system_header
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#define VS_FILE_INFO RT_VERSION #define VS_FILE_INFO RT_VERSION
#define VS_VERSION_INFO 1 #define VS_VERSION_INFO 1
#define VS_USER_DEFINED 100 #define VS_USER_DEFINED 100
#define VS_FFI_SIGNATURE 0xFEEF04BD #define VS_FFI_SIGNATURE 0xFEEF04BD
#define VS_FFI_STRUCVERSION 0x10000 #define VS_FFI_STRUCVERSION 0x10000
#define VS_FFI_FILEFLAGSMASK 0x3F #define VS_FFI_FILEFLAGSMASK 0x3F
#define VS_FF_DEBUG 1 #define VS_FF_DEBUG 1
#define VS_FF_PRERELEASE 2 #define VS_FF_PRERELEASE 2
#define VS_FF_PATCHED 4 #define VS_FF_PATCHED 4
#define VS_FF_PRIVATEBUILD 8 #define VS_FF_PRIVATEBUILD 8
#define VS_FF_INFOINFERRED 16 #define VS_FF_INFOINFERRED 16
#define VS_FF_SPECIALBUILD 32 #define VS_FF_SPECIALBUILD 32
#define VOS_UNKNOWN 0 #define VOS_UNKNOWN 0
#define VOS_DOS 0x10000 #define VOS_DOS 0x10000
#define VOS_OS216 0x20000 #define VOS_OS216 0x20000
#define VOS_OS232 0x30000 #define VOS_OS232 0x30000
#define VOS_NT 0x40000 #define VOS_NT 0x40000
#define VOS__BASE 0 #define VOS__BASE 0
#define VOS__WINDOWS16 1 #define VOS__WINDOWS16 1
#define VOS__PM16 2 #define VOS__PM16 2
#define VOS__PM32 3 #define VOS__PM32 3
#define VOS__WINDOWS32 4 #define VOS__WINDOWS32 4
#define VOS_DOS_WINDOWS16 0x10001 #define VOS_DOS_WINDOWS16 0x10001
#define VOS_DOS_WINDOWS32 0x10004 #define VOS_DOS_WINDOWS32 0x10004
#define VOS_OS216_PM16 0x20002 #define VOS_OS216_PM16 0x20002
#define VOS_OS232_PM32 0x30003 #define VOS_OS232_PM32 0x30003
#define VOS_NT_WINDOWS32 0x40004 #define VOS_NT_WINDOWS32 0x40004
#define VFT_UNKNOWN 0 #define VFT_UNKNOWN 0
#define VFT_APP 1 #define VFT_APP 1
#define VFT_DLL 2 #define VFT_DLL 2
#define VFT_DRV 3 #define VFT_DRV 3
#define VFT_FONT 4 #define VFT_FONT 4
#define VFT_VXD 5 #define VFT_VXD 5
#define VFT_STATIC_LIB 7 #define VFT_STATIC_LIB 7
#define VFT2_UNKNOWN 0 #define VFT2_UNKNOWN 0
#define VFT2_DRV_PRINTER 1 #define VFT2_DRV_PRINTER 1
#define VFT2_DRV_KEYBOARD 2 #define VFT2_DRV_KEYBOARD 2
#define VFT2_DRV_LANGUAGE 3 #define VFT2_DRV_LANGUAGE 3
#define VFT2_DRV_DISPLAY 4 #define VFT2_DRV_DISPLAY 4
#define VFT2_DRV_MOUSE 5 #define VFT2_DRV_MOUSE 5
#define VFT2_DRV_NETWORK 6 #define VFT2_DRV_NETWORK 6
#define VFT2_DRV_SYSTEM 7 #define VFT2_DRV_SYSTEM 7
#define VFT2_DRV_INSTALLABLE 8 #define VFT2_DRV_INSTALLABLE 8
#define VFT2_DRV_SOUND 9 #define VFT2_DRV_SOUND 9
#define VFT2_DRV_COMM 10 #define VFT2_DRV_COMM 10
#define VFT2_DRV_INPUTMETHOD 11 #define VFT2_DRV_INPUTMETHOD 11
#define VFT2_FONT_RASTER 1 #define VFT2_FONT_RASTER 1
#define VFT2_FONT_VECTOR 2 #define VFT2_FONT_VECTOR 2
#define VFT2_FONT_TRUETYPE 3 #define VFT2_FONT_TRUETYPE 3
#define VFFF_ISSHAREDFILE 1 #define VFFF_ISSHAREDFILE 1
#define VFF_CURNEDEST 1 #define VFF_CURNEDEST 1
#define VFF_FILEINUSE 2 #define VFF_FILEINUSE 2
#define VFF_BUFFTOOSMALL 4 #define VFF_BUFFTOOSMALL 4
#define VIFF_FORCEINSTALL 1 #define VIFF_FORCEINSTALL 1
#define VIFF_DONTDELETEOLD 2 #define VIFF_DONTDELETEOLD 2
#define VIF_TEMPFILE 1 #define VIF_TEMPFILE 1
#define VIF_MISMATCH 2 #define VIF_MISMATCH 2
#define VIF_SRCOLD 4 #define VIF_SRCOLD 4
#define VIF_DIFFLANG 8 #define VIF_DIFFLANG 8
#define VIF_DIFFCODEPG 16 #define VIF_DIFFCODEPG 16
#define VIF_DIFFTYPE 32 #define VIF_DIFFTYPE 32
#define VIF_WRITEPROT 64 #define VIF_WRITEPROT 64
#define VIF_FILEINUSE 128 #define VIF_FILEINUSE 128
#define VIF_OUTOFSPACE 256 #define VIF_OUTOFSPACE 256
#define VIF_ACCESSVIOLATION 512 #define VIF_ACCESSVIOLATION 512
#define VIF_SHARINGVIOLATION 1024 #define VIF_SHARINGVIOLATION 1024
#define VIF_CANNOTCREATE 2048 #define VIF_CANNOTCREATE 2048
#define VIF_CANNOTDELETE 4096 #define VIF_CANNOTDELETE 4096
#define VIF_CANNOTRENAME 8192 #define VIF_CANNOTRENAME 8192
#define VIF_CANNOTDELETECUR 16384 #define VIF_CANNOTDELETECUR 16384
#define VIF_OUTOFMEMORY 32768 #define VIF_OUTOFMEMORY 32768
#define VIF_CANNOTREADSRC 65536 #define VIF_CANNOTREADSRC 65536
#define VIF_CANNOTREADDST 0x20000 #define VIF_CANNOTREADDST 0x20000
#define VIF_BUFFTOOSMALL 0x40000 #define VIF_BUFFTOOSMALL 0x40000
#ifndef RC_INVOKED #ifndef RC_INVOKED
typedef struct tagVS_FIXEDFILEINFO { typedef struct tagVS_FIXEDFILEINFO {
DWORD dwSignature; DWORD dwSignature;
DWORD dwStrucVersion; DWORD dwStrucVersion;
DWORD dwFileVersionMS; DWORD dwFileVersionMS;
DWORD dwFileVersionLS; DWORD dwFileVersionLS;
DWORD dwProductVersionMS; DWORD dwProductVersionMS;
DWORD dwProductVersionLS; DWORD dwProductVersionLS;
DWORD dwFileFlagsMask; DWORD dwFileFlagsMask;
DWORD dwFileFlags; DWORD dwFileFlags;
DWORD dwFileOS; DWORD dwFileOS;
DWORD dwFileType; DWORD dwFileType;
DWORD dwFileSubtype; DWORD dwFileSubtype;
DWORD dwFileDateMS; DWORD dwFileDateMS;
DWORD dwFileDateLS; DWORD dwFileDateLS;
} VS_FIXEDFILEINFO; } VS_FIXEDFILEINFO;
DWORD WINAPI VerFindFileA(DWORD,LPSTR,LPSTR,LPSTR,LPSTR,PUINT,LPSTR,PUINT); DWORD WINAPI VerFindFileA(DWORD,LPSTR,LPSTR,LPSTR,LPSTR,PUINT,LPSTR,PUINT);
DWORD WINAPI VerFindFileW(DWORD,LPWSTR,LPWSTR,LPWSTR,LPWSTR,PUINT,LPWSTR,PUINT); DWORD WINAPI VerFindFileW(DWORD,LPWSTR,LPWSTR,LPWSTR,LPWSTR,PUINT,LPWSTR,PUINT);
DWORD WINAPI VerInstallFileA(DWORD,LPSTR,LPSTR,LPSTR,LPSTR,LPSTR,LPSTR,PUINT); DWORD WINAPI VerInstallFileA(DWORD,LPSTR,LPSTR,LPSTR,LPSTR,LPSTR,LPSTR,PUINT);
DWORD WINAPI VerInstallFileW(DWORD,LPWSTR,LPWSTR,LPWSTR,LPWSTR,LPWSTR,LPWSTR,PUINT); DWORD WINAPI VerInstallFileW(DWORD,LPWSTR,LPWSTR,LPWSTR,LPWSTR,LPWSTR,LPWSTR,PUINT);
DWORD WINAPI GetFileVersionInfoSizeA(LPSTR,PDWORD); DWORD WINAPI GetFileVersionInfoSizeA(LPSTR,PDWORD);
DWORD WINAPI GetFileVersionInfoSizeW(LPWSTR,PDWORD); DWORD WINAPI GetFileVersionInfoSizeW(LPWSTR,PDWORD);
BOOL WINAPI GetFileVersionInfoA(LPSTR,DWORD,DWORD,PVOID); BOOL WINAPI GetFileVersionInfoA(LPSTR,DWORD,DWORD,PVOID);
BOOL WINAPI GetFileVersionInfoW(LPWSTR,DWORD,DWORD,PVOID); BOOL WINAPI GetFileVersionInfoW(LPWSTR,DWORD,DWORD,PVOID);
DWORD WINAPI VerLanguageNameA(DWORD,LPSTR,DWORD); DWORD WINAPI VerLanguageNameA(DWORD,LPSTR,DWORD);
DWORD WINAPI VerLanguageNameW(DWORD,LPWSTR,DWORD); DWORD WINAPI VerLanguageNameW(DWORD,LPWSTR,DWORD);
BOOL WINAPI VerQueryValueA(PCVOID,LPSTR,PVOID*,PUINT); BOOL WINAPI VerQueryValueA(PCVOID,LPSTR,PVOID*,PUINT);
BOOL WINAPI VerQueryValueW(PCVOID,LPWSTR,PVOID*,PUINT); BOOL WINAPI VerQueryValueW(PCVOID,LPWSTR,PVOID*,PUINT);
#ifdef UNICODE #ifdef UNICODE
#define VerFindFile VerFindFileW #define VerFindFile VerFindFileW
#define VerQueryValue VerQueryValueW #define VerQueryValue VerQueryValueW
#define VerInstallFile VerInstallFileW #define VerInstallFile VerInstallFileW
#define GetFileVersionInfoSize GetFileVersionInfoSizeW #define GetFileVersionInfoSize GetFileVersionInfoSizeW
#define GetFileVersionInfo GetFileVersionInfoW #define GetFileVersionInfo GetFileVersionInfoW
#define VerLanguageName VerLanguageNameW #define VerLanguageName VerLanguageNameW
#define VerQueryValue VerQueryValueW #define VerQueryValue VerQueryValueW
#else #else
#define VerQueryValue VerQueryValueA #define VerQueryValue VerQueryValueA
#define VerFindFile VerFindFileA #define VerFindFile VerFindFileA
#define VerInstallFile VerInstallFileA #define VerInstallFile VerInstallFileA
#define GetFileVersionInfoSize GetFileVersionInfoSizeA #define GetFileVersionInfoSize GetFileVersionInfoSizeA
#define GetFileVersionInfo GetFileVersionInfoA #define GetFileVersionInfo GetFileVersionInfoA
#define VerLanguageName VerLanguageNameA #define VerLanguageName VerLanguageNameA
#define VerQueryValue VerQueryValueA #define VerQueryValue VerQueryValueA
#endif #endif
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif

View File

@ -1,29 +1,29 @@
// ================================================= // =================================================
// chkstk.s // chkstk.s
.text .text
.globl __chkstk .globl __chkstk
__chkstk: __chkstk:
xchg (%esp), %ebp // store ebp, get ret.addr xchg (%esp), %ebp // store ebp, get ret.addr
push %ebp // push ret.addr push %ebp // push ret.addr
lea 4(%esp), %ebp // setup frame ptr lea 4(%esp), %ebp // setup frame ptr
push %ecx // save ecx push %ecx // save ecx
mov %ebp, %ecx mov %ebp, %ecx
P0: P0:
sub $4096,%ecx sub $4096,%ecx
test %eax,(%ecx) test %eax,(%ecx)
sub $4096,%eax sub $4096,%eax
cmp $4096,%eax cmp $4096,%eax
jge P0 jge P0
sub %eax,%ecx sub %eax,%ecx
mov %esp,%eax mov %esp,%eax
test %eax,(%ecx) test %eax,(%ecx)
mov %ecx,%esp mov %ecx,%esp
mov (%eax),%ecx // restore ecx mov (%eax),%ecx // restore ecx
mov 4(%eax),%eax mov 4(%eax),%eax
push %eax push %eax
ret ret

View File

@ -1,13 +1,13 @@
//+--------------------------------------------------------------------------- //+---------------------------------------------------------------------------
#include <windows.h> #include <windows.h>
BOOL WINAPI DllMain (HANDLE hDll, DWORD dwReason, LPVOID lpReserved); BOOL WINAPI DllMain (HANDLE hDll, DWORD dwReason, LPVOID lpReserved);
BOOL WINAPI _dllstart(HANDLE hDll, DWORD dwReason, LPVOID lpReserved) BOOL WINAPI _dllstart(HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
{ {
BOOL bRet; BOOL bRet;
bRet = DllMain (hDll, dwReason, lpReserved); bRet = DllMain (hDll, dwReason, lpReserved);
return bRet; return bRet;
} }

View File

@ -1,9 +1,9 @@
//+--------------------------------------------------------------------------- //+---------------------------------------------------------------------------
#include <windows.h> #include <windows.h>
BOOL WINAPI DllMain (HANDLE hDll, DWORD dwReason, LPVOID lpReserved) BOOL WINAPI DllMain (HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
{ {
return TRUE; return TRUE;
} }

View File

@ -1,337 +1,337 @@
LIBRARY gdi32.dll LIBRARY gdi32.dll
EXPORTS EXPORTS
AbortDoc AbortDoc
AbortPath AbortPath
AddFontResourceA AddFontResourceA
AddFontResourceW AddFontResourceW
AngleArc AngleArc
AnimatePalette AnimatePalette
Arc Arc
ArcTo ArcTo
BeginPath BeginPath
BitBlt BitBlt
ByeByeGDI ByeByeGDI
CancelDC CancelDC
CheckColorsInGamut CheckColorsInGamut
ChoosePixelFormat ChoosePixelFormat
Chord Chord
CloseEnhMetaFile CloseEnhMetaFile
CloseFigure CloseFigure
CloseMetaFile CloseMetaFile
ColorCorrectPalette ColorCorrectPalette
ColorMatchToTarget ColorMatchToTarget
CombineRgn CombineRgn
CombineTransform CombineTransform
CopyEnhMetaFileA CopyEnhMetaFileA
CopyEnhMetaFileW CopyEnhMetaFileW
CopyMetaFileA CopyMetaFileA
CopyMetaFileW CopyMetaFileW
CreateBitmap CreateBitmap
CreateBitmapIndirect CreateBitmapIndirect
CreateBrushIndirect CreateBrushIndirect
CreateColorSpaceA CreateColorSpaceA
CreateColorSpaceW CreateColorSpaceW
CreateCompatibleBitmap CreateCompatibleBitmap
CreateCompatibleDC CreateCompatibleDC
CreateDCA CreateDCA
CreateDCW CreateDCW
CreateDIBPatternBrush CreateDIBPatternBrush
CreateDIBPatternBrushPt CreateDIBPatternBrushPt
CreateDIBSection CreateDIBSection
CreateDIBitmap CreateDIBitmap
CreateDiscardableBitmap CreateDiscardableBitmap
CreateEllipticRgn CreateEllipticRgn
CreateEllipticRgnIndirect CreateEllipticRgnIndirect
CreateEnhMetaFileA CreateEnhMetaFileA
CreateEnhMetaFileW CreateEnhMetaFileW
CreateFontA CreateFontA
CreateFontIndirectA CreateFontIndirectA
CreateFontIndirectW CreateFontIndirectW
CreateFontW CreateFontW
CreateHalftonePalette CreateHalftonePalette
CreateHatchBrush CreateHatchBrush
CreateICA CreateICA
CreateICW CreateICW
CreateMetaFileA CreateMetaFileA
CreateMetaFileW CreateMetaFileW
CreatePalette CreatePalette
CreatePatternBrush CreatePatternBrush
CreatePen CreatePen
CreatePenIndirect CreatePenIndirect
CreatePolyPolygonRgn CreatePolyPolygonRgn
CreatePolygonRgn CreatePolygonRgn
CreateRectRgn CreateRectRgn
CreateRectRgnIndirect CreateRectRgnIndirect
CreateRoundRectRgn CreateRoundRectRgn
CreateScalableFontResourceA CreateScalableFontResourceA
CreateScalableFontResourceW CreateScalableFontResourceW
CreateSolidBrush CreateSolidBrush
DPtoLP DPtoLP
DeleteColorSpace DeleteColorSpace
DeleteDC DeleteDC
DeleteEnhMetaFile DeleteEnhMetaFile
DeleteMetaFile DeleteMetaFile
DeleteObject DeleteObject
DescribePixelFormat DescribePixelFormat
DeviceCapabilitiesEx DeviceCapabilitiesEx
DeviceCapabilitiesExA DeviceCapabilitiesExA
DeviceCapabilitiesExW DeviceCapabilitiesExW
DrawEscape DrawEscape
Ellipse Ellipse
EnableEUDC EnableEUDC
EndDoc EndDoc
EndPage EndPage
EndPath EndPath
EnumEnhMetaFile EnumEnhMetaFile
EnumFontFamiliesA EnumFontFamiliesA
EnumFontFamiliesExA EnumFontFamiliesExA
EnumFontFamiliesExW EnumFontFamiliesExW
EnumFontFamiliesW EnumFontFamiliesW
EnumFontsA EnumFontsA
EnumFontsW EnumFontsW
EnumICMProfilesA EnumICMProfilesA
EnumICMProfilesW EnumICMProfilesW
EnumMetaFile EnumMetaFile
EnumObjects EnumObjects
EqualRgn EqualRgn
Escape Escape
ExcludeClipRect ExcludeClipRect
ExtCreatePen ExtCreatePen
ExtCreateRegion ExtCreateRegion
ExtEscape ExtEscape
ExtFloodFill ExtFloodFill
ExtSelectClipRgn ExtSelectClipRgn
ExtTextOutA ExtTextOutA
ExtTextOutW ExtTextOutW
FillPath FillPath
FillRgn FillRgn
FixBrushOrgEx FixBrushOrgEx
FlattenPath FlattenPath
FloodFill FloodFill
FrameRgn FrameRgn
GdiComment GdiComment
GdiFlush GdiFlush
GdiGetBatchLimit GdiGetBatchLimit
GdiPlayDCScript GdiPlayDCScript
GdiPlayJournal GdiPlayJournal
GdiPlayScript GdiPlayScript
GdiSetBatchLimit GdiSetBatchLimit
GetArcDirection GetArcDirection
GetAspectRatioFilterEx GetAspectRatioFilterEx
GetBitmapBits GetBitmapBits
GetBitmapDimensionEx GetBitmapDimensionEx
GetBkColor GetBkColor
GetBkMode GetBkMode
GetBoundsRect GetBoundsRect
GetBrushOrgEx GetBrushOrgEx
GetCharABCWidthsA GetCharABCWidthsA
GetCharABCWidthsFloatA GetCharABCWidthsFloatA
GetCharABCWidthsFloatW GetCharABCWidthsFloatW
GetCharABCWidthsW GetCharABCWidthsW
GetCharWidth32A GetCharWidth32A
GetCharWidth32W GetCharWidth32W
GetCharWidthA GetCharWidthA
GetCharWidthFloatA GetCharWidthFloatA
GetCharWidthFloatW GetCharWidthFloatW
GetCharWidthW GetCharWidthW
GetCharacterPlacementA GetCharacterPlacementA
GetCharacterPlacementW GetCharacterPlacementW
GetClipBox GetClipBox
GetClipRgn GetClipRgn
GetColorAdjustment GetColorAdjustment
GetColorSpace GetColorSpace
GetCurrentObject GetCurrentObject
GetCurrentPositionEx GetCurrentPositionEx
GetDCOrgEx GetDCOrgEx
GetDIBColorTable GetDIBColorTable
GetDIBits GetDIBits
GetDeviceCaps GetDeviceCaps
GetDeviceGammaRamp GetDeviceGammaRamp
GetEnhMetaFileA GetEnhMetaFileA
GetEnhMetaFileBits GetEnhMetaFileBits
GetEnhMetaFileDescriptionA GetEnhMetaFileDescriptionA
GetEnhMetaFileDescriptionW GetEnhMetaFileDescriptionW
GetEnhMetaFileHeader GetEnhMetaFileHeader
GetEnhMetaFilePaletteEntries GetEnhMetaFilePaletteEntries
GetEnhMetaFileW GetEnhMetaFileW
GetFontData GetFontData
GetFontLanguageInfo GetFontLanguageInfo
GetFontResourceInfo GetFontResourceInfo
GetGlyphOutline GetGlyphOutline
GetGlyphOutlineA GetGlyphOutlineA
GetGlyphOutlineW GetGlyphOutlineW
GetGraphicsMode GetGraphicsMode
GetICMProfileA GetICMProfileA
GetICMProfileW GetICMProfileW
GetKerningPairs GetKerningPairs
GetKerningPairsA GetKerningPairsA
GetKerningPairsW GetKerningPairsW
GetLayout GetLayout
GetLogColorSpaceA GetLogColorSpaceA
GetLogColorSpaceW GetLogColorSpaceW
GetMapMode GetMapMode
GetMetaFileA GetMetaFileA
GetMetaFileBitsEx GetMetaFileBitsEx
GetMetaFileW GetMetaFileW
GetMetaRgn GetMetaRgn
GetMiterLimit GetMiterLimit
GetNearestColor GetNearestColor
GetNearestPaletteIndex GetNearestPaletteIndex
GetObjectA GetObjectA
GetObjectType GetObjectType
GetObjectW GetObjectW
GetOutlineTextMetricsA GetOutlineTextMetricsA
GetOutlineTextMetricsW GetOutlineTextMetricsW
GetPaletteEntries GetPaletteEntries
GetPath GetPath
GetPixel GetPixel
GetPixelFormat GetPixelFormat
GetPolyFillMode GetPolyFillMode
GetROP2 GetROP2
GetRandomRgn GetRandomRgn
GetRasterizerCaps GetRasterizerCaps
GetRegionData GetRegionData
GetRgnBox GetRgnBox
GetStockObject GetStockObject
GetStretchBltMode GetStretchBltMode
GetSystemPaletteEntries GetSystemPaletteEntries
GetSystemPaletteUse GetSystemPaletteUse
GetTextAlign GetTextAlign
GetTextCharacterExtra GetTextCharacterExtra
GetTextCharset GetTextCharset
GetTextCharsetInfo GetTextCharsetInfo
GetTextColor GetTextColor
GetTextExtentExPointA GetTextExtentExPointA
GetTextExtentExPointW GetTextExtentExPointW
GetTextExtentPoint32A GetTextExtentPoint32A
GetTextExtentPoint32W GetTextExtentPoint32W
GetTextExtentPointA GetTextExtentPointA
GetTextExtentPointW GetTextExtentPointW
GetTextFaceA GetTextFaceA
GetTextFaceW GetTextFaceW
GetTextMetricsA GetTextMetricsA
GetTextMetricsW GetTextMetricsW
GetViewportExtEx GetViewportExtEx
GetViewportOrgEx GetViewportOrgEx
GetWinMetaFileBits GetWinMetaFileBits
GetWindowExtEx GetWindowExtEx
GetWindowOrgEx GetWindowOrgEx
GetWorldTransform GetWorldTransform
IntersectClipRect IntersectClipRect
InvertRgn InvertRgn
LPtoDP LPtoDP
LineDDA LineDDA
LineTo LineTo
MaskBlt MaskBlt
ModifyWorldTransform ModifyWorldTransform
MoveToEx MoveToEx
OffsetClipRgn OffsetClipRgn
OffsetRgn OffsetRgn
OffsetViewportOrgEx OffsetViewportOrgEx
OffsetWindowOrgEx OffsetWindowOrgEx
PaintRgn PaintRgn
PatBlt PatBlt
PathToRegion PathToRegion
Pie Pie
PlayEnhMetaFile PlayEnhMetaFile
PlayEnhMetaFileRecord PlayEnhMetaFileRecord
PlayMetaFile PlayMetaFile
PlayMetaFileRecord PlayMetaFileRecord
PlgBlt PlgBlt
PolyBezier PolyBezier
PolyBezierTo PolyBezierTo
PolyDraw PolyDraw
PolyPolygon PolyPolygon
PolyPolyline PolyPolyline
PolyTextOutA PolyTextOutA
PolyTextOutW PolyTextOutW
Polygon Polygon
Polyline Polyline
PolylineTo PolylineTo
PtInRegion PtInRegion
PtVisible PtVisible
RealizePalette RealizePalette
RectInRegion RectInRegion
RectVisible RectVisible
Rectangle Rectangle
RemoveFontResourceA RemoveFontResourceA
RemoveFontResourceW RemoveFontResourceW
ResetDCA ResetDCA
ResetDCW ResetDCW
ResizePalette ResizePalette
RestoreDC RestoreDC
RoundRect RoundRect
SaveDC SaveDC
ScaleViewportExtEx ScaleViewportExtEx
ScaleWindowExtEx ScaleWindowExtEx
SelectClipPath SelectClipPath
SelectClipRgn SelectClipRgn
SelectObject SelectObject
SelectPalette SelectPalette
SetAbortProc SetAbortProc
SetArcDirection SetArcDirection
SetBitmapBits SetBitmapBits
SetBitmapDimensionEx SetBitmapDimensionEx
SetBkColor SetBkColor
SetBkMode SetBkMode
SetBoundsRect SetBoundsRect
SetBrushOrgEx SetBrushOrgEx
SetColorAdjustment SetColorAdjustment
SetColorSpace SetColorSpace
SetDIBColorTable SetDIBColorTable
SetDIBits SetDIBits
SetDIBitsToDevice SetDIBitsToDevice
SetDeviceGammaRamp SetDeviceGammaRamp
SetEnhMetaFileBits SetEnhMetaFileBits
SetFontEnumeration SetFontEnumeration
SetGraphicsMode SetGraphicsMode
SetICMMode SetICMMode
SetICMProfileA SetICMProfileA
SetICMProfileW SetICMProfileW
SetLayout SetLayout
SetMagicColors SetMagicColors
SetMapMode SetMapMode
SetMapperFlags SetMapperFlags
SetMetaFileBitsEx SetMetaFileBitsEx
SetMetaRgn SetMetaRgn
SetMiterLimit SetMiterLimit
SetObjectOwner SetObjectOwner
SetPaletteEntries SetPaletteEntries
SetPixel SetPixel
SetPixelFormat SetPixelFormat
SetPixelV SetPixelV
SetPolyFillMode SetPolyFillMode
SetROP2 SetROP2
SetRectRgn SetRectRgn
SetStretchBltMode SetStretchBltMode
SetSystemPaletteUse SetSystemPaletteUse
SetTextAlign SetTextAlign
SetTextCharacterExtra SetTextCharacterExtra
SetTextColor SetTextColor
SetTextJustification SetTextJustification
SetViewportExtEx SetViewportExtEx
SetViewportOrgEx SetViewportOrgEx
SetWinMetaFileBits SetWinMetaFileBits
SetWindowExtEx SetWindowExtEx
SetWindowOrgEx SetWindowOrgEx
SetWorldTransform SetWorldTransform
StartDocA StartDocA
StartDocW StartDocW
StartPage StartPage
StretchBlt StretchBlt
StretchDIBits StretchDIBits
StrokeAndFillPath StrokeAndFillPath
StrokePath StrokePath
SwapBuffers SwapBuffers
TextOutA TextOutA
TextOutW TextOutW
TranslateCharsetInfo TranslateCharsetInfo
UnrealizeObject UnrealizeObject
UpdateColors UpdateColors
UpdateICMRegKeyA UpdateICMRegKeyA
UpdateICMRegKeyW UpdateICMRegKeyW
WidenPath WidenPath
gdiPlaySpoolStream gdiPlaySpoolStream
pfnRealizePalette pfnRealizePalette
pfnSelectPalette pfnSelectPalette

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff