Split the MSVCRT implementation headers from the public headers.
Fix some naming conventions aberrations. Add tests to ensure consistency between the two sets of symbols.
This commit is contained in:
parent
7d12892731
commit
0377462460
|
@ -1,4 +1,4 @@
|
|||
EXTRADEFS = -DUSE_MSVCRT_PREFIX -D_MT
|
||||
EXTRADEFS = -D_MT
|
||||
TOPSRCDIR = @top_srcdir@
|
||||
TOPOBJDIR = ../..
|
||||
SRCDIR = @srcdir@
|
||||
|
|
|
@ -20,14 +20,10 @@
|
|||
* Note: init and free don't need MT locking since they are called at DLL
|
||||
* (de)attachment time, which is syncronised for us
|
||||
*/
|
||||
|
||||
#include "msvcrt.h"
|
||||
#include "wincon.h"
|
||||
|
||||
#include "msvcrt/conio.h"
|
||||
#include "msvcrt/malloc.h"
|
||||
#include "msvcrt/stdio.h"
|
||||
#include "mtdll.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
|
||||
|
|
|
@ -31,9 +31,6 @@
|
|||
#include "wine/exception.h"
|
||||
#include "excpt.h"
|
||||
#include "wine/debug.h"
|
||||
#include "msvcrt/malloc.h"
|
||||
#include "msvcrt/stdlib.h"
|
||||
|
||||
#include "msvcrt.h"
|
||||
#include "cppexcept.h"
|
||||
#include "mtdll.h"
|
||||
|
@ -539,9 +536,9 @@ const char * __stdcall MSVCRT_type_info_name(type_info * _this)
|
|||
if (!_this->name)
|
||||
{
|
||||
/* Create and set the demangled name */
|
||||
char* name = MSVCRT___unDName(0, _this->mangled, 0,
|
||||
(MSVCRT_malloc_func)MSVCRT_malloc,
|
||||
(MSVCRT_free_func)MSVCRT_free, 0x2800);
|
||||
char* name = __unDName(0, _this->mangled, 0,
|
||||
(malloc_func_t)MSVCRT_malloc,
|
||||
(free_func_t)MSVCRT_free, 0x2800);
|
||||
|
||||
if (name)
|
||||
{
|
||||
|
@ -953,10 +950,10 @@ static const cxx_exception_type __non_rtti_object_exception_type =
|
|||
* RETURNS
|
||||
* The previously installed handler function, if any.
|
||||
*/
|
||||
terminate_function MSVCRT_set_terminate(terminate_function func)
|
||||
MSVCRT_terminate_function MSVCRT_set_terminate(MSVCRT_terminate_function func)
|
||||
{
|
||||
MSVCRT_thread_data *data = msvcrt_get_thread_data();
|
||||
terminate_function previous = data->terminate_handler;
|
||||
thread_data_t *data = msvcrt_get_thread_data();
|
||||
MSVCRT_terminate_function previous = data->terminate_handler;
|
||||
TRACE("(%p) returning %p\n",func,previous);
|
||||
data->terminate_handler = func;
|
||||
return previous;
|
||||
|
@ -973,10 +970,10 @@ terminate_function MSVCRT_set_terminate(terminate_function func)
|
|||
* RETURNS
|
||||
* The previously installed handler function, if any.
|
||||
*/
|
||||
unexpected_function MSVCRT_set_unexpected(unexpected_function func)
|
||||
MSVCRT_unexpected_function MSVCRT_set_unexpected(MSVCRT_unexpected_function func)
|
||||
{
|
||||
MSVCRT_thread_data *data = msvcrt_get_thread_data();
|
||||
unexpected_function previous = data->unexpected_handler;
|
||||
thread_data_t *data = msvcrt_get_thread_data();
|
||||
MSVCRT_unexpected_function previous = data->unexpected_handler;
|
||||
TRACE("(%p) returning %p\n",func,previous);
|
||||
data->unexpected_handler = func;
|
||||
return previous;
|
||||
|
@ -985,10 +982,10 @@ unexpected_function MSVCRT_set_unexpected(unexpected_function func)
|
|||
/******************************************************************
|
||||
* ?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z (MSVCRT.@)
|
||||
*/
|
||||
_se_translator_function MSVCRT__set_se_translator(_se_translator_function func)
|
||||
MSVCRT__se_translator_function MSVCRT__set_se_translator(MSVCRT__se_translator_function func)
|
||||
{
|
||||
MSVCRT_thread_data *data = msvcrt_get_thread_data();
|
||||
_se_translator_function previous = data->se_translator;
|
||||
thread_data_t *data = msvcrt_get_thread_data();
|
||||
MSVCRT__se_translator_function previous = data->se_translator;
|
||||
TRACE("(%p) returning %p\n",func,previous);
|
||||
data->se_translator = func;
|
||||
return previous;
|
||||
|
@ -1009,7 +1006,7 @@ _se_translator_function MSVCRT__set_se_translator(_se_translator_function func)
|
|||
*/
|
||||
void MSVCRT_terminate(void)
|
||||
{
|
||||
MSVCRT_thread_data *data = msvcrt_get_thread_data();
|
||||
thread_data_t *data = msvcrt_get_thread_data();
|
||||
if (data->terminate_handler) data->terminate_handler();
|
||||
MSVCRT_abort();
|
||||
}
|
||||
|
@ -1019,7 +1016,7 @@ void MSVCRT_terminate(void)
|
|||
*/
|
||||
void MSVCRT_unexpected(void)
|
||||
{
|
||||
MSVCRT_thread_data *data = msvcrt_get_thread_data();
|
||||
thread_data_t *data = msvcrt_get_thread_data();
|
||||
if (data->unexpected_handler) data->unexpected_handler();
|
||||
MSVCRT_terminate();
|
||||
}
|
||||
|
|
|
@ -269,7 +269,7 @@ inline static void *call_catch_block( PEXCEPTION_RECORD rec, cxx_exception_frame
|
|||
void *addr, *object = (void *)rec->ExceptionInformation[1];
|
||||
struct catch_func_nested_frame nested_frame;
|
||||
int trylevel = frame->trylevel;
|
||||
MSVCRT_thread_data *thread_data = msvcrt_get_thread_data();
|
||||
thread_data_t *thread_data = msvcrt_get_thread_data();
|
||||
|
||||
for (i = 0; i < descr->tryblock_count; i++)
|
||||
{
|
||||
|
|
|
@ -18,26 +18,23 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "msvcrt.h"
|
||||
|
||||
#include "msvcrt/ctype.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
|
||||
|
||||
/* Some abbreviations to make the following table readable */
|
||||
#define _C_ _CONTROL
|
||||
#define _S_ _SPACE
|
||||
#define _P_ _PUNCT
|
||||
#define _D_ _DIGIT
|
||||
#define _H_ _HEX
|
||||
#define _U_ _UPPER
|
||||
#define _L_ _LOWER
|
||||
#define _C_ MSVCRT__CONTROL
|
||||
#define _S_ MSVCRT__SPACE
|
||||
#define _P_ MSVCRT__PUNCT
|
||||
#define _D_ MSVCRT__DIGIT
|
||||
#define _H_ MSVCRT__HEX
|
||||
#define _U_ MSVCRT__UPPER
|
||||
#define _L_ MSVCRT__LOWER
|
||||
|
||||
WORD MSVCRT__ctype [257] = {
|
||||
0, _C_, _C_, _C_, _C_, _C_, _C_, _C_, _C_, _C_, _S_|_C_, _S_|_C_,
|
||||
_S_|_C_, _S_|_C_, _S_|_C_, _C_, _C_, _C_, _C_, _C_, _C_, _C_, _C_,
|
||||
_C_, _C_, _C_, _C_, _C_, _C_, _C_, _C_, _C_, _C_, _S_|_BLANK,
|
||||
_C_, _C_, _C_, _C_, _C_, _C_, _C_, _C_, _C_, _C_, _S_|MSVCRT__BLANK,
|
||||
_P_, _P_, _P_, _P_, _P_, _P_, _P_, _P_, _P_, _P_, _P_, _P_, _P_, _P_,
|
||||
_P_, _D_|_H_, _D_|_H_, _D_|_H_, _D_|_H_, _D_|_H_, _D_|_H_, _D_|_H_,
|
||||
_D_|_H_, _D_|_H_, _D_|_H_, _P_, _P_, _P_, _P_, _P_, _P_, _P_, _U_|_H_,
|
||||
|
@ -90,7 +87,7 @@ int _isctype(int c, int type)
|
|||
WORD typeInfo;
|
||||
char convert[3], *pconv = convert;
|
||||
|
||||
if (MSVCRT__pctype[(UINT)c >> 8] & _LEADBYTE)
|
||||
if (MSVCRT__pctype[(UINT)c >> 8] & MSVCRT__LEADBYTE)
|
||||
*pconv++ = (UINT)c >> 8;
|
||||
*pconv++ = c & 0xff;
|
||||
*pconv = 0;
|
||||
|
@ -107,7 +104,7 @@ int _isctype(int c, int type)
|
|||
*/
|
||||
int MSVCRT_isalnum(int c)
|
||||
{
|
||||
return _isctype( c, _ALPHA | _DIGIT );
|
||||
return _isctype( c, MSVCRT__ALPHA | MSVCRT__DIGIT );
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
@ -115,7 +112,7 @@ int MSVCRT_isalnum(int c)
|
|||
*/
|
||||
int MSVCRT_isalpha(int c)
|
||||
{
|
||||
return _isctype( c, _ALPHA );
|
||||
return _isctype( c, MSVCRT__ALPHA );
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
@ -123,7 +120,7 @@ int MSVCRT_isalpha(int c)
|
|||
*/
|
||||
int MSVCRT_iscntrl(int c)
|
||||
{
|
||||
return _isctype( c, _CONTROL );
|
||||
return _isctype( c, MSVCRT__CONTROL );
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
@ -131,7 +128,7 @@ int MSVCRT_iscntrl(int c)
|
|||
*/
|
||||
int MSVCRT_isdigit(int c)
|
||||
{
|
||||
return _isctype( c, _DIGIT );
|
||||
return _isctype( c, MSVCRT__DIGIT );
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
@ -139,7 +136,7 @@ int MSVCRT_isdigit(int c)
|
|||
*/
|
||||
int MSVCRT_isgraph(int c)
|
||||
{
|
||||
return _isctype( c, _ALPHA | _DIGIT | _PUNCT );
|
||||
return _isctype( c, MSVCRT__ALPHA | MSVCRT__DIGIT | MSVCRT__PUNCT );
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
@ -147,7 +144,7 @@ int MSVCRT_isgraph(int c)
|
|||
*/
|
||||
int MSVCRT_isleadbyte(int c)
|
||||
{
|
||||
return _isctype( c, _LEADBYTE );
|
||||
return _isctype( c, MSVCRT__LEADBYTE );
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
@ -155,7 +152,7 @@ int MSVCRT_isleadbyte(int c)
|
|||
*/
|
||||
int MSVCRT_islower(int c)
|
||||
{
|
||||
return _isctype( c, _LOWER );
|
||||
return _isctype( c, MSVCRT__LOWER );
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
@ -163,7 +160,7 @@ int MSVCRT_islower(int c)
|
|||
*/
|
||||
int MSVCRT_isprint(int c)
|
||||
{
|
||||
return _isctype( c, _ALPHA | _DIGIT | _BLANK | _PUNCT );
|
||||
return _isctype( c, MSVCRT__ALPHA | MSVCRT__DIGIT | MSVCRT__BLANK | MSVCRT__PUNCT );
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
@ -171,7 +168,7 @@ int MSVCRT_isprint(int c)
|
|||
*/
|
||||
int MSVCRT_ispunct(int c)
|
||||
{
|
||||
return _isctype( c, _PUNCT );
|
||||
return _isctype( c, MSVCRT__PUNCT );
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
@ -179,7 +176,7 @@ int MSVCRT_ispunct(int c)
|
|||
*/
|
||||
int MSVCRT_isspace(int c)
|
||||
{
|
||||
return _isctype( c, _SPACE );
|
||||
return _isctype( c, MSVCRT__SPACE );
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
@ -187,7 +184,7 @@ int MSVCRT_isspace(int c)
|
|||
*/
|
||||
int MSVCRT_isupper(int c)
|
||||
{
|
||||
return _isctype( c, _UPPER );
|
||||
return _isctype( c, MSVCRT__UPPER );
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
@ -195,7 +192,7 @@ int MSVCRT_isupper(int c)
|
|||
*/
|
||||
int MSVCRT_isxdigit(int c)
|
||||
{
|
||||
return _isctype( c, _HEX );
|
||||
return _isctype( c, MSVCRT__HEX );
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
|
|
@ -23,11 +23,6 @@
|
|||
|
||||
#include <math.h>
|
||||
#include "msvcrt.h"
|
||||
|
||||
#include "msvcrt/fcntl.h"
|
||||
#include "msvcrt/stdlib.h"
|
||||
#include "msvcrt/string.h"
|
||||
|
||||
#include "wine/library.h"
|
||||
#include "wine/unicode.h"
|
||||
#include "wine/debug.h"
|
||||
|
@ -57,8 +52,8 @@ char **MSVCRT___argv;
|
|||
MSVCRT_wchar_t **MSVCRT___wargv;
|
||||
char *MSVCRT__acmdln;
|
||||
MSVCRT_wchar_t *MSVCRT__wcmdln;
|
||||
char **MSVCRT__environ = 0;
|
||||
MSVCRT_wchar_t **MSVCRT__wenviron = 0;
|
||||
char **_environ = 0;
|
||||
MSVCRT_wchar_t **_wenviron = 0;
|
||||
char **MSVCRT___initenv = 0;
|
||||
MSVCRT_wchar_t **MSVCRT___winitenv = 0;
|
||||
int MSVCRT_timezone;
|
||||
|
@ -211,9 +206,9 @@ MSVCRT_wchar_t*** __p___wargv(void) { return &MSVCRT___wargv; }
|
|||
*/
|
||||
char*** __p__environ(void)
|
||||
{
|
||||
if (!MSVCRT__environ)
|
||||
MSVCRT__environ = msvcrt_SnapshotOfEnvironmentA(NULL);
|
||||
return &MSVCRT__environ;
|
||||
if (!_environ)
|
||||
_environ = msvcrt_SnapshotOfEnvironmentA(NULL);
|
||||
return &_environ;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
@ -221,9 +216,9 @@ char*** __p__environ(void)
|
|||
*/
|
||||
MSVCRT_wchar_t*** __p__wenviron(void)
|
||||
{
|
||||
if (!MSVCRT__wenviron)
|
||||
MSVCRT__wenviron = msvcrt_SnapshotOfEnvironmentW(NULL);
|
||||
return &MSVCRT__wenviron;
|
||||
if (!_wenviron)
|
||||
_wenviron = msvcrt_SnapshotOfEnvironmentW(NULL);
|
||||
return &_wenviron;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
@ -286,7 +281,7 @@ void msvcrt_init_args(void)
|
|||
MSVCRT___setlc_active = 0;
|
||||
MSVCRT___unguarded_readlc_active = 0;
|
||||
MSVCRT_timezone = 0;
|
||||
MSVCRT__fmode = _O_TEXT;
|
||||
MSVCRT__fmode = MSVCRT__O_TEXT;
|
||||
|
||||
MSVCRT___initenv= msvcrt_SnapshotOfEnvironmentA(NULL);
|
||||
MSVCRT___winitenv= msvcrt_SnapshotOfEnvironmentW(NULL);
|
||||
|
@ -317,8 +312,8 @@ void msvcrt_free_args(void)
|
|||
/* FIXME: more things to free */
|
||||
if (MSVCRT___initenv) HeapFree(GetProcessHeap(), 0, MSVCRT___initenv);
|
||||
if (MSVCRT___winitenv) HeapFree(GetProcessHeap(), 0, MSVCRT___winitenv);
|
||||
if (MSVCRT__environ) HeapFree(GetProcessHeap(), 0, MSVCRT__environ);
|
||||
if (MSVCRT__wenviron) HeapFree(GetProcessHeap(), 0, MSVCRT__wenviron);
|
||||
if (_environ) HeapFree(GetProcessHeap(), 0, _environ);
|
||||
if (_wenviron) HeapFree(GetProcessHeap(), 0, _wenviron);
|
||||
if (MSVCRT__pgmptr) HeapFree(GetProcessHeap(), 0, MSVCRT__pgmptr);
|
||||
if (MSVCRT__wpgmptr) HeapFree(GetProcessHeap(), 0, MSVCRT__wpgmptr);
|
||||
}
|
||||
|
|
|
@ -33,14 +33,6 @@
|
|||
#include "winternl.h"
|
||||
#include "wine/unicode.h"
|
||||
#include "msvcrt.h"
|
||||
#include "msvcrt/errno.h"
|
||||
|
||||
#include "wine/unicode.h"
|
||||
#include "msvcrt/io.h"
|
||||
#include "msvcrt/stdlib.h"
|
||||
#include "msvcrt/string.h"
|
||||
#include "msvcrt/dos.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
|
||||
|
@ -144,7 +136,7 @@ int _chdir(const char * newdir)
|
|||
{
|
||||
if (!SetCurrentDirectoryA(newdir))
|
||||
{
|
||||
MSVCRT__set_errno(newdir?GetLastError():0);
|
||||
msvcrt_set_errno(newdir?GetLastError():0);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
@ -159,7 +151,7 @@ int _wchdir(const MSVCRT_wchar_t * newdir)
|
|||
{
|
||||
if (!SetCurrentDirectoryW(newdir))
|
||||
{
|
||||
MSVCRT__set_errno(newdir?GetLastError():0);
|
||||
msvcrt_set_errno(newdir?GetLastError():0);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
@ -187,7 +179,7 @@ int _chdrive(int newdrive)
|
|||
buffer[0] += newdrive - 1;
|
||||
if (!SetCurrentDirectoryW( buffer ))
|
||||
{
|
||||
MSVCRT__set_errno(GetLastError());
|
||||
msvcrt_set_errno(GetLastError());
|
||||
if (newdrive <= 0)
|
||||
*MSVCRT__errno() = MSVCRT_EACCES;
|
||||
return -1;
|
||||
|
@ -215,7 +207,7 @@ int _findclose(long hand)
|
|||
TRACE(":handle %ld\n",hand);
|
||||
if (!FindClose((HANDLE)hand))
|
||||
{
|
||||
MSVCRT__set_errno(GetLastError());
|
||||
msvcrt_set_errno(GetLastError());
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
@ -246,7 +238,7 @@ long MSVCRT__findfirst(const char * fspec, struct MSVCRT__finddata_t* ft)
|
|||
hfind = FindFirstFileA(fspec, &find_data);
|
||||
if (hfind == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
MSVCRT__set_errno(GetLastError());
|
||||
msvcrt_set_errno(GetLastError());
|
||||
return -1;
|
||||
}
|
||||
msvcrt_fttofd(&find_data,ft);
|
||||
|
@ -267,7 +259,7 @@ long MSVCRT__wfindfirst(const MSVCRT_wchar_t * fspec, struct MSVCRT__wfinddata_t
|
|||
hfind = FindFirstFileW(fspec, &find_data);
|
||||
if (hfind == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
MSVCRT__set_errno(GetLastError());
|
||||
msvcrt_set_errno(GetLastError());
|
||||
return -1;
|
||||
}
|
||||
msvcrt_wfttofd(&find_data,ft);
|
||||
|
@ -288,7 +280,7 @@ long MSVCRT__findfirsti64(const char * fspec, struct MSVCRT__finddatai64_t* ft)
|
|||
hfind = FindFirstFileA(fspec, &find_data);
|
||||
if (hfind == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
MSVCRT__set_errno(GetLastError());
|
||||
msvcrt_set_errno(GetLastError());
|
||||
return -1;
|
||||
}
|
||||
msvcrt_fttofdi64(&find_data,ft);
|
||||
|
@ -309,7 +301,7 @@ long MSVCRT__wfindfirsti64(const MSVCRT_wchar_t * fspec, struct MSVCRT__wfinddat
|
|||
hfind = FindFirstFileW(fspec, &find_data);
|
||||
if (hfind == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
MSVCRT__set_errno(GetLastError());
|
||||
msvcrt_set_errno(GetLastError());
|
||||
return -1;
|
||||
}
|
||||
msvcrt_wfttofdi64(&find_data,ft);
|
||||
|
@ -619,7 +611,7 @@ unsigned int MSVCRT__getdiskfree(unsigned int disk, struct MSVCRT__diskfree_t *
|
|||
return 0;
|
||||
}
|
||||
err = GetLastError();
|
||||
MSVCRT__set_errno(err);
|
||||
msvcrt_set_errno(err);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
@ -642,7 +634,7 @@ int _mkdir(const char * newdir)
|
|||
{
|
||||
if (CreateDirectoryA(newdir,NULL))
|
||||
return 0;
|
||||
MSVCRT__set_errno(GetLastError());
|
||||
msvcrt_set_errno(GetLastError());
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -655,7 +647,7 @@ int _wmkdir(const MSVCRT_wchar_t* newdir)
|
|||
{
|
||||
if (CreateDirectoryW(newdir,NULL))
|
||||
return 0;
|
||||
MSVCRT__set_errno(GetLastError());
|
||||
msvcrt_set_errno(GetLastError());
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -678,7 +670,7 @@ int _rmdir(const char * dir)
|
|||
{
|
||||
if (RemoveDirectoryA(dir))
|
||||
return 0;
|
||||
MSVCRT__set_errno(GetLastError());
|
||||
msvcrt_set_errno(GetLastError());
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -691,7 +683,7 @@ int _wrmdir(const MSVCRT_wchar_t * dir)
|
|||
{
|
||||
if (RemoveDirectoryW(dir))
|
||||
return 0;
|
||||
MSVCRT__set_errno(GetLastError());
|
||||
msvcrt_set_errno(GetLastError());
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -1216,7 +1208,7 @@ void _searchenv(const char* file, const char* env, char *buf)
|
|||
{
|
||||
GetFullPathNameA( file, MAX_PATH, buf, NULL );
|
||||
/* Sigh. This error is *always* set, regardless of success */
|
||||
MSVCRT__set_errno(ERROR_FILE_NOT_FOUND);
|
||||
msvcrt_set_errno(ERROR_FILE_NOT_FOUND);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1224,7 +1216,7 @@ void _searchenv(const char* file, const char* env, char *buf)
|
|||
envVal = MSVCRT_getenv(env);
|
||||
if (!envVal)
|
||||
{
|
||||
MSVCRT__set_errno(ERROR_FILE_NOT_FOUND);
|
||||
msvcrt_set_errno(ERROR_FILE_NOT_FOUND);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1238,7 +1230,7 @@ void _searchenv(const char* file, const char* env, char *buf)
|
|||
while(*end && *end != ';') end++; /* Find end of next path */
|
||||
if (penv == end || !*penv)
|
||||
{
|
||||
MSVCRT__set_errno(ERROR_FILE_NOT_FOUND);
|
||||
msvcrt_set_errno(ERROR_FILE_NOT_FOUND);
|
||||
return;
|
||||
}
|
||||
strncpy(curPath, penv, end - penv);
|
||||
|
@ -1255,7 +1247,7 @@ void _searchenv(const char* file, const char* env, char *buf)
|
|||
if (GetFileAttributesA( curPath ) != INVALID_FILE_ATTRIBUTES)
|
||||
{
|
||||
strcpy(buf, curPath);
|
||||
MSVCRT__set_errno(ERROR_FILE_NOT_FOUND);
|
||||
msvcrt_set_errno(ERROR_FILE_NOT_FOUND);
|
||||
return; /* Found */
|
||||
}
|
||||
penv = *end ? end + 1 : end;
|
||||
|
|
|
@ -22,10 +22,6 @@
|
|||
*/
|
||||
#include "wine/unicode.h"
|
||||
#include "msvcrt.h"
|
||||
|
||||
#include "msvcrt/stdlib.h"
|
||||
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
|
||||
|
@ -97,10 +93,10 @@ int _putenv(const char *str)
|
|||
|
||||
ret = !SetEnvironmentVariableA(name, value[0] ? value : NULL);
|
||||
/* Update the __p__environ array only when already initialized */
|
||||
if (MSVCRT__environ)
|
||||
MSVCRT__environ = msvcrt_SnapshotOfEnvironmentA(MSVCRT__environ);
|
||||
if (MSVCRT__wenviron)
|
||||
MSVCRT__wenviron = msvcrt_SnapshotOfEnvironmentW(MSVCRT__wenviron);
|
||||
if (_environ)
|
||||
_environ = msvcrt_SnapshotOfEnvironmentA(_environ);
|
||||
if (_wenviron)
|
||||
_wenviron = msvcrt_SnapshotOfEnvironmentW(_wenviron);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -129,9 +125,9 @@ int _wputenv(const MSVCRT_wchar_t *str)
|
|||
|
||||
ret = !SetEnvironmentVariableW(name, value[0] ? value : NULL);
|
||||
/* Update the __p__environ array only when already initialized */
|
||||
if (MSVCRT__environ)
|
||||
MSVCRT__environ = msvcrt_SnapshotOfEnvironmentA(MSVCRT__environ);
|
||||
if (MSVCRT__wenviron)
|
||||
MSVCRT__wenviron = msvcrt_SnapshotOfEnvironmentW(MSVCRT__wenviron);
|
||||
if (_environ)
|
||||
_environ = msvcrt_SnapshotOfEnvironmentA(_environ);
|
||||
if (_wenviron)
|
||||
_wenviron = msvcrt_SnapshotOfEnvironmentW(_wenviron);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -18,24 +18,17 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "msvcrt.h"
|
||||
#include "msvcrt/errno.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "msvcrt/conio.h"
|
||||
#include "msvcrt/stdlib.h"
|
||||
#include "msvcrt/string.h"
|
||||
|
||||
|
||||
#include "msvcrt.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
|
||||
|
||||
|
||||
/* INTERNAL: Set the crt and dos errno's from the OS error given. */
|
||||
void MSVCRT__set_errno(int err)
|
||||
void msvcrt_set_errno(int err)
|
||||
{
|
||||
int *errno = MSVCRT__errno();
|
||||
unsigned long *doserrno = MSVCRT___doserrno();
|
||||
|
@ -154,10 +147,10 @@ void MSVCRT_perror(const char* str)
|
|||
*/
|
||||
int _set_error_mode(int mode)
|
||||
{
|
||||
static int current_mode = _OUT_TO_DEFAULT;
|
||||
static int current_mode = MSVCRT__OUT_TO_DEFAULT;
|
||||
|
||||
const int old = current_mode;
|
||||
if ( _REPORT_ERRMODE != mode ) {
|
||||
if ( MSVCRT__REPORT_ERRMODE != mode ) {
|
||||
current_mode = mode;
|
||||
FIXME("dummy implementation (old mode: %d, new mode: %d)\n",
|
||||
old, mode);
|
||||
|
|
|
@ -36,11 +36,7 @@
|
|||
#include "winternl.h"
|
||||
#include "wine/exception.h"
|
||||
#include "msvcrt.h"
|
||||
|
||||
#include "msvcrt/setjmp.h"
|
||||
#include "excpt.h"
|
||||
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
|
||||
|
@ -281,7 +277,7 @@ typedef void (*MSVCRT_unwind_function)(const void*);
|
|||
* _setjmp (MSVCRT.@)
|
||||
*/
|
||||
DEFINE_REGS_ENTRYPOINT( MSVCRT__setjmp, _MSVCRT__setjmp, 4, 0 );
|
||||
void _MSVCRT__setjmp(_JUMP_BUFFER *jmp, CONTEXT86* context)
|
||||
void _MSVCRT__setjmp(struct MSVCRT___JUMP_BUFFER *jmp, CONTEXT86* context)
|
||||
{
|
||||
TRACE("(%p)\n",jmp);
|
||||
jmp->Ebp = context->Ebp;
|
||||
|
@ -303,7 +299,7 @@ void _MSVCRT__setjmp(_JUMP_BUFFER *jmp, CONTEXT86* context)
|
|||
* _setjmp3 (MSVCRT.@)
|
||||
*/
|
||||
DEFINE_REGS_ENTRYPOINT( MSVCRT__setjmp3, _MSVCRT__setjmp3, 8, 0 );
|
||||
void _MSVCRT__setjmp3(_JUMP_BUFFER *jmp, int nb_args, CONTEXT86* context)
|
||||
void _MSVCRT__setjmp3(struct MSVCRT___JUMP_BUFFER *jmp, int nb_args, CONTEXT86* context)
|
||||
{
|
||||
TRACE("(%p,%d)\n",jmp,nb_args);
|
||||
jmp->Ebp = context->Ebp;
|
||||
|
@ -340,7 +336,7 @@ void _MSVCRT__setjmp3(_JUMP_BUFFER *jmp, int nb_args, CONTEXT86* context)
|
|||
* longjmp (MSVCRT.@)
|
||||
*/
|
||||
DEFINE_REGS_ENTRYPOINT( MSVCRT_longjmp, _MSVCRT_longjmp, 8, 0 );
|
||||
void _MSVCRT_longjmp(_JUMP_BUFFER *jmp, int retval, CONTEXT86* context)
|
||||
void _MSVCRT_longjmp(struct MSVCRT___JUMP_BUFFER *jmp, int retval, CONTEXT86* context)
|
||||
{
|
||||
unsigned long cur_frame = 0;
|
||||
|
||||
|
@ -383,7 +379,7 @@ void _MSVCRT_longjmp(_JUMP_BUFFER *jmp, int retval, CONTEXT86* context)
|
|||
/*********************************************************************
|
||||
* _seh_longjmp_unwind (MSVCRT.@)
|
||||
*/
|
||||
void __stdcall _seh_longjmp_unwind(_JUMP_BUFFER *jmp)
|
||||
void __stdcall _seh_longjmp_unwind(struct MSVCRT___JUMP_BUFFER *jmp)
|
||||
{
|
||||
_local_unwind2( (MSVCRT_EXCEPTION_FRAME *)jmp->Registration, jmp->TryLevel );
|
||||
}
|
||||
|
|
|
@ -19,12 +19,8 @@
|
|||
*/
|
||||
#include <stdio.h>
|
||||
#include "msvcrt.h"
|
||||
|
||||
#include "msvcrt/conio.h"
|
||||
#include "msvcrt/stdlib.h"
|
||||
#include "mtdll.h"
|
||||
#include "winuser.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
|
||||
|
@ -132,7 +128,7 @@ static void DoMessageBox(LPCSTR lead, LPCSTR message)
|
|||
/*********************************************************************
|
||||
* _amsg_exit (MSVCRT.@)
|
||||
*/
|
||||
void MSVCRT__amsg_exit(int errnum)
|
||||
void _amsg_exit(int errnum)
|
||||
{
|
||||
TRACE("(%d)\n", errnum);
|
||||
/* FIXME: text for the error number. */
|
||||
|
@ -259,5 +255,5 @@ int MSVCRT_atexit(void (*func)(void))
|
|||
void _purecall(void)
|
||||
{
|
||||
TRACE("(void)\n");
|
||||
MSVCRT__amsg_exit( 25 );
|
||||
_amsg_exit( 25 );
|
||||
}
|
||||
|
|
|
@ -31,36 +31,24 @@
|
|||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winreg.h"
|
||||
#include "winternl.h"
|
||||
#include "msvcrt.h"
|
||||
#include "msvcrt/errno.h"
|
||||
|
||||
#include "wine/unicode.h"
|
||||
#include "msvcrt/fcntl.h"
|
||||
#include "msvcrt/io.h"
|
||||
#include "msvcrt/sys/locking.h"
|
||||
#include "msvcrt/stdio.h"
|
||||
#include "msvcrt/stdlib.h"
|
||||
#include "msvcrt/string.h"
|
||||
#include "msvcrt/sys/stat.h"
|
||||
#include "msvcrt/sys/utime.h"
|
||||
#include "msvcrt/time.h"
|
||||
#include "msvcrt/share.h"
|
||||
#include "msvcrt/wctype.h"
|
||||
#include "msvcrt/direct.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
|
||||
|
||||
/* for stat mode, permissions apply to all,owner and group */
|
||||
#define MSVCRT_S_IREAD (_S_IREAD | (_S_IREAD >> 3) | (_S_IREAD >> 6))
|
||||
#define MSVCRT_S_IWRITE (_S_IWRITE | (_S_IWRITE >> 3) | (_S_IWRITE >> 6))
|
||||
#define MSVCRT_S_IEXEC (_S_IEXEC | (_S_IEXEC >> 3) | (_S_IEXEC >> 6))
|
||||
#define ALL_S_IREAD (MSVCRT__S_IREAD | (MSVCRT__S_IREAD >> 3) | (MSVCRT__S_IREAD >> 6))
|
||||
#define ALL_S_IWRITE (MSVCRT__S_IWRITE | (MSVCRT__S_IWRITE >> 3) | (MSVCRT__S_IWRITE >> 6))
|
||||
#define ALL_S_IEXEC (MSVCRT__S_IEXEC | (MSVCRT__S_IEXEC >> 3) | (MSVCRT__S_IEXEC >> 6))
|
||||
|
||||
/* _access() bit flags FIXME: incomplete */
|
||||
#define MSVCRT_W_OK 0x02
|
||||
|
@ -181,9 +169,9 @@ static int msvcrt_alloc_fd(HANDLE hand, int flag)
|
|||
}
|
||||
MSVCRT_fdesc[fd].handle = hand;
|
||||
MSVCRT_fdesc[fd].xflag = WX_OPEN;
|
||||
if (flag & _O_NOINHERIT) MSVCRT_fdesc[fd].xflag |= WX_DONTINHERIT;
|
||||
if (flag & _O_APPEND) MSVCRT_fdesc[fd].xflag |= WX_APPEND;
|
||||
if (flag & _O_TEXT) MSVCRT_fdesc[fd].xflag |= WX_TEXT;
|
||||
if (flag & MSVCRT__O_NOINHERIT) MSVCRT_fdesc[fd].xflag |= WX_DONTINHERIT;
|
||||
if (flag & MSVCRT__O_APPEND) MSVCRT_fdesc[fd].xflag |= WX_APPEND;
|
||||
if (flag & MSVCRT__O_TEXT) MSVCRT_fdesc[fd].xflag |= WX_TEXT;
|
||||
|
||||
/* locate next free slot */
|
||||
if (fd == MSVCRT_fdend)
|
||||
|
@ -352,12 +340,12 @@ int _access(const char *filename, int mode)
|
|||
|
||||
if (!filename || attr == INVALID_FILE_ATTRIBUTES)
|
||||
{
|
||||
MSVCRT__set_errno(GetLastError());
|
||||
msvcrt_set_errno(GetLastError());
|
||||
return -1;
|
||||
}
|
||||
if ((attr & FILE_ATTRIBUTE_READONLY) && (mode & MSVCRT_W_OK))
|
||||
{
|
||||
MSVCRT__set_errno(ERROR_ACCESS_DENIED);
|
||||
msvcrt_set_errno(ERROR_ACCESS_DENIED);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
@ -374,12 +362,12 @@ int _waccess(const MSVCRT_wchar_t *filename, int mode)
|
|||
|
||||
if (!filename || attr == INVALID_FILE_ATTRIBUTES)
|
||||
{
|
||||
MSVCRT__set_errno(GetLastError());
|
||||
msvcrt_set_errno(GetLastError());
|
||||
return -1;
|
||||
}
|
||||
if ((attr & FILE_ATTRIBUTE_READONLY) && (mode & MSVCRT_W_OK))
|
||||
{
|
||||
MSVCRT__set_errno(ERROR_ACCESS_DENIED);
|
||||
msvcrt_set_errno(ERROR_ACCESS_DENIED);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
@ -394,13 +382,13 @@ int _chmod(const char *path, int flags)
|
|||
|
||||
if (oldFlags != INVALID_FILE_ATTRIBUTES)
|
||||
{
|
||||
DWORD newFlags = (flags & _S_IWRITE)? oldFlags & ~FILE_ATTRIBUTE_READONLY:
|
||||
DWORD newFlags = (flags & MSVCRT__S_IWRITE)? oldFlags & ~FILE_ATTRIBUTE_READONLY:
|
||||
oldFlags | FILE_ATTRIBUTE_READONLY;
|
||||
|
||||
if (newFlags == oldFlags || SetFileAttributesA(path, newFlags))
|
||||
return 0;
|
||||
}
|
||||
MSVCRT__set_errno(GetLastError());
|
||||
msvcrt_set_errno(GetLastError());
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -413,13 +401,13 @@ int _wchmod(const MSVCRT_wchar_t *path, int flags)
|
|||
|
||||
if (oldFlags != INVALID_FILE_ATTRIBUTES)
|
||||
{
|
||||
DWORD newFlags = (flags & _S_IWRITE)? oldFlags & ~FILE_ATTRIBUTE_READONLY:
|
||||
DWORD newFlags = (flags & MSVCRT__S_IWRITE)? oldFlags & ~FILE_ATTRIBUTE_READONLY:
|
||||
oldFlags | FILE_ATTRIBUTE_READONLY;
|
||||
|
||||
if (newFlags == oldFlags || SetFileAttributesW(path, newFlags))
|
||||
return 0;
|
||||
}
|
||||
MSVCRT__set_errno(GetLastError());
|
||||
msvcrt_set_errno(GetLastError());
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -459,7 +447,7 @@ int _unlink(const char *path)
|
|||
if(DeleteFileA(path))
|
||||
return 0;
|
||||
TRACE("failed (%ld)\n",GetLastError());
|
||||
MSVCRT__set_errno(GetLastError());
|
||||
msvcrt_set_errno(GetLastError());
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -472,7 +460,7 @@ int _wunlink(const MSVCRT_wchar_t *path)
|
|||
if(DeleteFileW(path))
|
||||
return 0;
|
||||
TRACE("failed (%ld)\n",GetLastError());
|
||||
MSVCRT__set_errno(GetLastError());
|
||||
msvcrt_set_errno(GetLastError());
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -533,7 +521,7 @@ int _close(int fd)
|
|||
if (!CloseHandle(hand))
|
||||
{
|
||||
WARN(":failed-last error (%ld)\n",GetLastError());
|
||||
MSVCRT__set_errno(GetLastError());
|
||||
msvcrt_set_errno(GetLastError());
|
||||
return -1;
|
||||
}
|
||||
msvcrt_free_fd(fd);
|
||||
|
@ -562,7 +550,7 @@ int _commit(int fd)
|
|||
return 0;
|
||||
}
|
||||
TRACE(":failed-last error (%ld)\n",GetLastError());
|
||||
MSVCRT__set_errno(GetLastError());
|
||||
msvcrt_set_errno(GetLastError());
|
||||
return -1;
|
||||
}
|
||||
TRACE(":ok\n");
|
||||
|
@ -654,7 +642,7 @@ __int64 _lseeki64(int fd, __int64 offset, int whence)
|
|||
return ((__int64)hoffset << 32) | ret;
|
||||
}
|
||||
TRACE(":error-last error (%ld)\n",GetLastError());
|
||||
MSVCRT__set_errno(GetLastError());
|
||||
msvcrt_set_errno(GetLastError());
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -688,11 +676,11 @@ int _locking(int fd, int mode, LONG nbytes)
|
|||
}
|
||||
|
||||
TRACE(":fd (%d) by 0x%08lx mode %s\n",
|
||||
fd,nbytes,(mode==_LK_UNLCK)?"_LK_UNLCK":
|
||||
(mode==_LK_LOCK)?"_LK_LOCK":
|
||||
(mode==_LK_NBLCK)?"_LK_NBLCK":
|
||||
(mode==_LK_RLCK)?"_LK_RLCK":
|
||||
(mode==_LK_NBRLCK)?"_LK_NBRLCK":
|
||||
fd,nbytes,(mode==MSVCRT__LK_UNLCK)?"_LK_UNLCK":
|
||||
(mode==MSVCRT__LK_LOCK)?"_LK_LOCK":
|
||||
(mode==MSVCRT__LK_NBLCK)?"_LK_NBLCK":
|
||||
(mode==MSVCRT__LK_RLCK)?"_LK_RLCK":
|
||||
(mode==MSVCRT__LK_NBRLCK)?"_LK_NBRLCK":
|
||||
"UNKNOWN");
|
||||
|
||||
if ((cur_locn = SetFilePointer(hand, 0L, NULL, SEEK_CUR)) == INVALID_SET_FILE_POINTER)
|
||||
|
@ -701,7 +689,7 @@ int _locking(int fd, int mode, LONG nbytes)
|
|||
*MSVCRT__errno() = MSVCRT_EINVAL; /* FIXME */
|
||||
return -1;
|
||||
}
|
||||
if (mode == _LK_LOCK || mode == _LK_RLCK)
|
||||
if (mode == MSVCRT__LK_LOCK || mode == MSVCRT__LK_RLCK)
|
||||
{
|
||||
int nretry = 10;
|
||||
ret = 1; /* just to satisfy gcc */
|
||||
|
@ -709,10 +697,10 @@ int _locking(int fd, int mode, LONG nbytes)
|
|||
{
|
||||
ret = LockFile(hand, cur_locn, 0L, nbytes, 0L);
|
||||
if (ret) break;
|
||||
_sleep (1);
|
||||
Sleep(1);
|
||||
}
|
||||
}
|
||||
else if (mode == _LK_UNLCK)
|
||||
else if (mode == MSVCRT__LK_UNLCK)
|
||||
ret = UnlockFile(hand, cur_locn, 0L, nbytes, 0L);
|
||||
else
|
||||
ret = LockFile(hand, cur_locn, 0L, nbytes, 0L);
|
||||
|
@ -768,15 +756,15 @@ static int msvcrt_get_flags(const char* mode, int *open_flags, int* stream_flags
|
|||
switch(*mode++)
|
||||
{
|
||||
case 'R': case 'r':
|
||||
*open_flags = plus ? _O_RDWR : _O_RDONLY;
|
||||
*open_flags = plus ? MSVCRT__O_RDWR : MSVCRT__O_RDONLY;
|
||||
*stream_flags = plus ? MSVCRT__IORW : MSVCRT__IOREAD;
|
||||
break;
|
||||
case 'W': case 'w':
|
||||
*open_flags = _O_CREAT | _O_TRUNC | (plus ? _O_RDWR : _O_WRONLY);
|
||||
*open_flags = MSVCRT__O_CREAT | MSVCRT__O_TRUNC | (plus ? MSVCRT__O_RDWR : MSVCRT__O_WRONLY);
|
||||
*stream_flags = plus ? MSVCRT__IORW : MSVCRT__IOWRT;
|
||||
break;
|
||||
case 'A': case 'a':
|
||||
*open_flags = _O_CREAT | _O_APPEND | (plus ? _O_RDWR : _O_WRONLY);
|
||||
*open_flags = MSVCRT__O_CREAT | MSVCRT__O_APPEND | (plus ? MSVCRT__O_RDWR : MSVCRT__O_WRONLY);
|
||||
*stream_flags = plus ? MSVCRT__IORW : MSVCRT__IOWRT;
|
||||
break;
|
||||
default:
|
||||
|
@ -787,12 +775,12 @@ static int msvcrt_get_flags(const char* mode, int *open_flags, int* stream_flags
|
|||
switch (*mode++)
|
||||
{
|
||||
case 'B': case 'b':
|
||||
*open_flags |= _O_BINARY;
|
||||
*open_flags &= ~_O_TEXT;
|
||||
*open_flags |= MSVCRT__O_BINARY;
|
||||
*open_flags &= ~MSVCRT__O_TEXT;
|
||||
break;
|
||||
case 'T': case 't':
|
||||
*open_flags |= _O_TEXT;
|
||||
*open_flags &= ~_O_BINARY;
|
||||
*open_flags |= MSVCRT__O_TEXT;
|
||||
*open_flags &= ~MSVCRT__O_BINARY;
|
||||
break;
|
||||
case '+':
|
||||
break;
|
||||
|
@ -916,7 +904,7 @@ int MSVCRT__fstati64(int fd, struct MSVCRT__stati64* buf)
|
|||
if (!buf)
|
||||
{
|
||||
WARN(":failed-NULL buf\n");
|
||||
MSVCRT__set_errno(ERROR_INVALID_PARAMETER);
|
||||
msvcrt_set_errno(ERROR_INVALID_PARAMETER);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -925,7 +913,7 @@ int MSVCRT__fstati64(int fd, struct MSVCRT__stati64* buf)
|
|||
if (!GetFileInformationByHandle(hand, &hfi))
|
||||
{
|
||||
WARN(":failed-last error (%ld)\n",GetLastError());
|
||||
MSVCRT__set_errno(ERROR_INVALID_PARAMETER);
|
||||
msvcrt_set_errno(ERROR_INVALID_PARAMETER);
|
||||
return -1;
|
||||
}
|
||||
FIXME(":dwFileAttributes = %ld, mode set to 0\n",hfi.dwFileAttributes);
|
||||
|
@ -954,7 +942,7 @@ int MSVCRT__fstat(int fd, struct MSVCRT__stat* buf)
|
|||
/*********************************************************************
|
||||
* _futime (MSVCRT.@)
|
||||
*/
|
||||
int _futime(int fd, struct _utimbuf *t)
|
||||
int _futime(int fd, struct MSVCRT__utimbuf *t)
|
||||
{
|
||||
HANDLE hand = msvcrt_fdtoh(fd);
|
||||
FILETIME at, wt;
|
||||
|
@ -977,7 +965,7 @@ int _futime(int fd, struct _utimbuf *t)
|
|||
|
||||
if (!SetFileTime(hand, NULL, &at, &wt))
|
||||
{
|
||||
MSVCRT__set_errno(GetLastError());
|
||||
msvcrt_set_errno(GetLastError());
|
||||
return -1 ;
|
||||
}
|
||||
return 0;
|
||||
|
@ -1108,71 +1096,71 @@ int MSVCRT__sopen( const char *path, int oflags, int shflags, ... )
|
|||
TRACE(":file (%s) oflags: 0x%04x shflags: 0x%04x\n",
|
||||
path, oflags, shflags);
|
||||
|
||||
switch(oflags & (_O_RDONLY | _O_WRONLY | _O_RDWR))
|
||||
switch(oflags & (MSVCRT__O_RDONLY | MSVCRT__O_WRONLY | MSVCRT__O_RDWR))
|
||||
{
|
||||
case _O_RDONLY:
|
||||
case MSVCRT__O_RDONLY:
|
||||
access |= GENERIC_READ;
|
||||
ioflag |= MSVCRT__IOREAD;
|
||||
break;
|
||||
case _O_WRONLY:
|
||||
case MSVCRT__O_WRONLY:
|
||||
access |= GENERIC_WRITE;
|
||||
ioflag |= MSVCRT__IOWRT;
|
||||
break;
|
||||
case _O_RDWR:
|
||||
case MSVCRT__O_RDWR:
|
||||
access |= GENERIC_WRITE | GENERIC_READ;
|
||||
ioflag |= MSVCRT__IORW;
|
||||
break;
|
||||
}
|
||||
|
||||
if (oflags & _O_CREAT)
|
||||
if (oflags & MSVCRT__O_CREAT)
|
||||
{
|
||||
va_start(ap, shflags);
|
||||
pmode = va_arg(ap, int);
|
||||
va_end(ap);
|
||||
|
||||
if(pmode & ~(_S_IREAD | _S_IWRITE))
|
||||
if(pmode & ~(MSVCRT__S_IREAD | MSVCRT__S_IWRITE))
|
||||
FIXME(": pmode 0x%04x ignored\n", pmode);
|
||||
else
|
||||
WARN(": pmode 0x%04x ignored\n", pmode);
|
||||
|
||||
if (oflags & _O_EXCL)
|
||||
if (oflags & MSVCRT__O_EXCL)
|
||||
creation = CREATE_NEW;
|
||||
else if (oflags & _O_TRUNC)
|
||||
else if (oflags & MSVCRT__O_TRUNC)
|
||||
creation = CREATE_ALWAYS;
|
||||
else
|
||||
creation = OPEN_ALWAYS;
|
||||
}
|
||||
else /* no _O_CREAT */
|
||||
else /* no MSVCRT__O_CREAT */
|
||||
{
|
||||
if (oflags & _O_TRUNC)
|
||||
if (oflags & MSVCRT__O_TRUNC)
|
||||
creation = TRUNCATE_EXISTING;
|
||||
else
|
||||
creation = OPEN_EXISTING;
|
||||
}
|
||||
if (oflags & _O_APPEND)
|
||||
ioflag |= _O_APPEND;
|
||||
if (oflags & MSVCRT__O_APPEND)
|
||||
ioflag |= MSVCRT__O_APPEND;
|
||||
|
||||
if (oflags & _O_BINARY)
|
||||
ioflag |= _O_BINARY;
|
||||
else if (oflags & _O_TEXT)
|
||||
ioflag |= _O_TEXT;
|
||||
else if (*__p__fmode() & _O_BINARY)
|
||||
ioflag |= _O_BINARY;
|
||||
if (oflags & MSVCRT__O_BINARY)
|
||||
ioflag |= MSVCRT__O_BINARY;
|
||||
else if (oflags & MSVCRT__O_TEXT)
|
||||
ioflag |= MSVCRT__O_TEXT;
|
||||
else if (*__p__fmode() & MSVCRT__O_BINARY)
|
||||
ioflag |= MSVCRT__O_BINARY;
|
||||
else
|
||||
ioflag |= _O_TEXT; /* default to TEXT*/
|
||||
ioflag |= MSVCRT__O_TEXT; /* default to TEXT*/
|
||||
|
||||
switch( shflags )
|
||||
{
|
||||
case _SH_DENYRW:
|
||||
case MSVCRT__SH_DENYRW:
|
||||
sharing = 0L;
|
||||
break;
|
||||
case _SH_DENYWR:
|
||||
case MSVCRT__SH_DENYWR:
|
||||
sharing = FILE_SHARE_READ;
|
||||
break;
|
||||
case _SH_DENYRD:
|
||||
case MSVCRT__SH_DENYRD:
|
||||
sharing = FILE_SHARE_WRITE;
|
||||
break;
|
||||
case _SH_DENYNO:
|
||||
case MSVCRT__SH_DENYNO:
|
||||
sharing = FILE_SHARE_READ | FILE_SHARE_WRITE;
|
||||
break;
|
||||
default:
|
||||
|
@ -1181,26 +1169,26 @@ int MSVCRT__sopen( const char *path, int oflags, int shflags, ... )
|
|||
}
|
||||
attrib = FILE_ATTRIBUTE_NORMAL;
|
||||
|
||||
if (oflags & _O_TEMPORARY)
|
||||
if (oflags & MSVCRT__O_TEMPORARY)
|
||||
{
|
||||
attrib |= FILE_FLAG_DELETE_ON_CLOSE;
|
||||
access |= DELETE;
|
||||
sharing |= FILE_SHARE_DELETE;
|
||||
}
|
||||
|
||||
if (oflags & ~(_O_BINARY|_O_TEXT|_O_APPEND|_O_TRUNC|_O_EXCL
|
||||
|_O_CREAT|_O_RDWR|_O_WRONLY|_O_TEMPORARY|_O_NOINHERIT))
|
||||
if (oflags & ~(MSVCRT__O_BINARY|MSVCRT__O_TEXT|MSVCRT__O_APPEND|MSVCRT__O_TRUNC|MSVCRT__O_EXCL
|
||||
|MSVCRT__O_CREAT|MSVCRT__O_RDWR|MSVCRT__O_WRONLY|MSVCRT__O_TEMPORARY|MSVCRT__O_NOINHERIT))
|
||||
ERR(":unsupported oflags 0x%04x\n",oflags);
|
||||
|
||||
sa.nLength = sizeof( SECURITY_ATTRIBUTES );
|
||||
sa.lpSecurityDescriptor = NULL;
|
||||
sa.bInheritHandle = (oflags & _O_NOINHERIT) ? FALSE : TRUE;
|
||||
sa.bInheritHandle = (oflags & MSVCRT__O_NOINHERIT) ? FALSE : TRUE;
|
||||
|
||||
hand = CreateFileA(path, access, sharing, &sa, creation, attrib, 0);
|
||||
|
||||
if (hand == INVALID_HANDLE_VALUE) {
|
||||
WARN(":failed-last error (%ld)\n",GetLastError());
|
||||
MSVCRT__set_errno(GetLastError());
|
||||
msvcrt_set_errno(GetLastError());
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -1210,7 +1198,7 @@ int MSVCRT__sopen( const char *path, int oflags, int shflags, ... )
|
|||
|
||||
if (fd > 0)
|
||||
{
|
||||
if (oflags & _O_APPEND)
|
||||
if (oflags & MSVCRT__O_APPEND)
|
||||
_lseek(fd, 0, FILE_END);
|
||||
}
|
||||
|
||||
|
@ -1238,7 +1226,7 @@ int MSVCRT__wsopen( const MSVCRT_wchar_t* path, int oflags, int shflags, ... )
|
|||
return retval;
|
||||
}
|
||||
|
||||
MSVCRT__set_errno(GetLastError());
|
||||
msvcrt_set_errno(GetLastError());
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -1249,16 +1237,16 @@ int _open( const char *path, int flags, ... )
|
|||
{
|
||||
va_list ap;
|
||||
|
||||
if (flags & _O_CREAT)
|
||||
if (flags & MSVCRT__O_CREAT)
|
||||
{
|
||||
int pmode;
|
||||
va_start(ap, flags);
|
||||
pmode = va_arg(ap, int);
|
||||
va_end(ap);
|
||||
return MSVCRT__sopen( path, flags, _SH_DENYNO, pmode );
|
||||
return MSVCRT__sopen( path, flags, MSVCRT__SH_DENYNO, pmode );
|
||||
}
|
||||
else
|
||||
return MSVCRT__sopen( path, flags, _SH_DENYNO);
|
||||
return MSVCRT__sopen( path, flags, MSVCRT__SH_DENYNO);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
@ -1282,7 +1270,7 @@ int _wopen(const MSVCRT_wchar_t *path,int flags,...)
|
|||
return retval;
|
||||
}
|
||||
|
||||
MSVCRT__set_errno(GetLastError());
|
||||
msvcrt_set_errno(GetLastError());
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -1291,7 +1279,7 @@ int _wopen(const MSVCRT_wchar_t *path,int flags,...)
|
|||
*/
|
||||
int _creat(const char *path, int flags)
|
||||
{
|
||||
int usedFlags = (flags & _O_TEXT)| _O_CREAT| _O_WRONLY| _O_TRUNC;
|
||||
int usedFlags = (flags & MSVCRT__O_TEXT)| MSVCRT__O_CREAT| MSVCRT__O_WRONLY| MSVCRT__O_TRUNC;
|
||||
return _open(path, usedFlags);
|
||||
}
|
||||
|
||||
|
@ -1300,7 +1288,7 @@ int _creat(const char *path, int flags)
|
|||
*/
|
||||
int _wcreat(const MSVCRT_wchar_t *path, int flags)
|
||||
{
|
||||
int usedFlags = (flags & _O_TEXT)| _O_CREAT| _O_WRONLY| _O_TRUNC;
|
||||
int usedFlags = (flags & MSVCRT__O_TEXT)| MSVCRT__O_CREAT| MSVCRT__O_WRONLY| MSVCRT__O_TRUNC;
|
||||
return _wopen(path, usedFlags);
|
||||
}
|
||||
|
||||
|
@ -1311,16 +1299,16 @@ int _open_osfhandle(long hand, int flags)
|
|||
{
|
||||
int fd;
|
||||
|
||||
/* _O_RDONLY (0) always matches, so set the read flag
|
||||
/* MSVCRT__O_RDONLY (0) always matches, so set the read flag
|
||||
* MFC's CStdioFile clears O_RDONLY (0)! if it wants to write to the
|
||||
* file, so set the write flag. It also only sets _O_TEXT if it wants
|
||||
* text - it never sets _O_BINARY.
|
||||
* file, so set the write flag. It also only sets MSVCRT__O_TEXT if it wants
|
||||
* text - it never sets MSVCRT__O_BINARY.
|
||||
*/
|
||||
/* FIXME: handle more flags */
|
||||
if (!(flags & (_O_BINARY | _O_TEXT)) && (*__p__fmode() & _O_BINARY))
|
||||
flags |= _O_BINARY;
|
||||
if (!(flags & (MSVCRT__O_BINARY | MSVCRT__O_TEXT)) && (*__p__fmode() & MSVCRT__O_BINARY))
|
||||
flags |= MSVCRT__O_BINARY;
|
||||
else
|
||||
flags |= _O_TEXT;
|
||||
flags |= MSVCRT__O_TEXT;
|
||||
|
||||
fd = msvcrt_alloc_fd((HANDLE)hand,flags);
|
||||
TRACE(":handle (%ld) fd (%d) flags 0x%08x\n",hand,fd,flags);
|
||||
|
@ -1433,10 +1421,10 @@ int MSVCRT__getw(MSVCRT_FILE* file)
|
|||
*/
|
||||
int _setmode(int fd,int mode)
|
||||
{
|
||||
int ret = MSVCRT_fdesc[fd].xflag & WX_TEXT ? _O_TEXT : _O_BINARY;
|
||||
if (mode & (~(_O_TEXT|_O_BINARY)))
|
||||
int ret = MSVCRT_fdesc[fd].xflag & WX_TEXT ? MSVCRT__O_TEXT : MSVCRT__O_BINARY;
|
||||
if (mode & (~(MSVCRT__O_TEXT|MSVCRT__O_BINARY)))
|
||||
FIXME("fd (%d) mode (0x%08x) unknown\n",fd,mode);
|
||||
if ((mode & _O_TEXT) == _O_TEXT)
|
||||
if ((mode & MSVCRT__O_TEXT) == MSVCRT__O_TEXT)
|
||||
MSVCRT_fdesc[fd].xflag |= WX_TEXT;
|
||||
else
|
||||
MSVCRT_fdesc[fd].xflag &= ~WX_TEXT;
|
||||
|
@ -1450,7 +1438,7 @@ int MSVCRT__stati64(const char* path, struct MSVCRT__stati64 * buf)
|
|||
{
|
||||
DWORD dw;
|
||||
WIN32_FILE_ATTRIBUTE_DATA hfi;
|
||||
unsigned short mode = MSVCRT_S_IREAD;
|
||||
unsigned short mode = ALL_S_IREAD;
|
||||
int plen;
|
||||
|
||||
TRACE(":file (%s) buf(%p)\n",path,buf);
|
||||
|
@ -1458,7 +1446,7 @@ int MSVCRT__stati64(const char* path, struct MSVCRT__stati64 * buf)
|
|||
if (!GetFileAttributesExA(path, GetFileExInfoStandard, &hfi))
|
||||
{
|
||||
TRACE("failed (%ld)\n",GetLastError());
|
||||
MSVCRT__set_errno(ERROR_FILE_NOT_FOUND);
|
||||
msvcrt_set_errno(ERROR_FILE_NOT_FOUND);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -1479,22 +1467,22 @@ int MSVCRT__stati64(const char* path, struct MSVCRT__stati64 * buf)
|
|||
/* Dir, or regular file? */
|
||||
if ((hfi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ||
|
||||
(path[plen-1] == '\\'))
|
||||
mode |= (_S_IFDIR | MSVCRT_S_IEXEC);
|
||||
mode |= (MSVCRT__S_IFDIR | ALL_S_IEXEC);
|
||||
else
|
||||
{
|
||||
mode |= _S_IFREG;
|
||||
mode |= MSVCRT__S_IFREG;
|
||||
/* executable? */
|
||||
if (plen > 6 && path[plen-4] == '.') /* shortest exe: "\x.exe" */
|
||||
{
|
||||
unsigned int ext = tolower(path[plen-1]) | (tolower(path[plen-2]) << 8) |
|
||||
(tolower(path[plen-3]) << 16);
|
||||
if (ext == EXE || ext == BAT || ext == CMD || ext == COM)
|
||||
mode |= MSVCRT_S_IEXEC;
|
||||
mode |= ALL_S_IEXEC;
|
||||
}
|
||||
}
|
||||
|
||||
if (!(hfi.dwFileAttributes & FILE_ATTRIBUTE_READONLY))
|
||||
mode |= MSVCRT_S_IWRITE;
|
||||
mode |= ALL_S_IWRITE;
|
||||
|
||||
buf->st_mode = mode;
|
||||
buf->st_nlink = 1;
|
||||
|
@ -1529,7 +1517,7 @@ int MSVCRT__wstati64(const MSVCRT_wchar_t* path, struct MSVCRT__stati64 * buf)
|
|||
{
|
||||
DWORD dw;
|
||||
WIN32_FILE_ATTRIBUTE_DATA hfi;
|
||||
unsigned short mode = MSVCRT_S_IREAD;
|
||||
unsigned short mode = ALL_S_IREAD;
|
||||
int plen;
|
||||
|
||||
TRACE(":file (%s) buf(%p)\n",debugstr_w(path),buf);
|
||||
|
@ -1537,7 +1525,7 @@ int MSVCRT__wstati64(const MSVCRT_wchar_t* path, struct MSVCRT__stati64 * buf)
|
|||
if (!GetFileAttributesExW(path, GetFileExInfoStandard, &hfi))
|
||||
{
|
||||
TRACE("failed (%ld)\n",GetLastError());
|
||||
MSVCRT__set_errno(ERROR_FILE_NOT_FOUND);
|
||||
msvcrt_set_errno(ERROR_FILE_NOT_FOUND);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -1554,22 +1542,22 @@ int MSVCRT__wstati64(const MSVCRT_wchar_t* path, struct MSVCRT__stati64 * buf)
|
|||
/* Dir, or regular file? */
|
||||
if ((hfi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ||
|
||||
(path[plen-1] == '\\'))
|
||||
mode |= (_S_IFDIR | MSVCRT_S_IEXEC);
|
||||
mode |= (MSVCRT__S_IFDIR | ALL_S_IEXEC);
|
||||
else
|
||||
{
|
||||
mode |= _S_IFREG;
|
||||
mode |= MSVCRT__S_IFREG;
|
||||
/* executable? */
|
||||
if (plen > 6 && path[plen-4] == '.') /* shortest exe: "\x.exe" */
|
||||
{
|
||||
ULONGLONG ext = tolowerW(path[plen-1]) | (tolowerW(path[plen-2]) << 16) |
|
||||
((ULONGLONG)tolowerW(path[plen-3]) << 32);
|
||||
if (ext == WCEXE || ext == WCBAT || ext == WCCMD || ext == WCCOM)
|
||||
mode |= MSVCRT_S_IEXEC;
|
||||
mode |= ALL_S_IEXEC;
|
||||
}
|
||||
}
|
||||
|
||||
if (!(hfi.dwFileAttributes & FILE_ATTRIBUTE_READONLY))
|
||||
mode |= MSVCRT_S_IWRITE;
|
||||
mode |= ALL_S_IWRITE;
|
||||
|
||||
buf->st_mode = mode;
|
||||
buf->st_nlink = 1;
|
||||
|
@ -1663,9 +1651,9 @@ int _umask(int umask)
|
|||
/*********************************************************************
|
||||
* _utime (MSVCRT.@)
|
||||
*/
|
||||
int _utime(const char* path, struct _utimbuf *t)
|
||||
int _utime(const char* path, struct MSVCRT__utimbuf *t)
|
||||
{
|
||||
int fd = _open(path, _O_WRONLY | _O_BINARY);
|
||||
int fd = _open(path, MSVCRT__O_WRONLY | MSVCRT__O_BINARY);
|
||||
|
||||
if (fd > 0)
|
||||
{
|
||||
|
@ -1679,9 +1667,9 @@ int _utime(const char* path, struct _utimbuf *t)
|
|||
/*********************************************************************
|
||||
* _wutime (MSVCRT.@)
|
||||
*/
|
||||
int _wutime(const MSVCRT_wchar_t* path, struct _utimbuf *t)
|
||||
int _wutime(const MSVCRT_wchar_t* path, struct MSVCRT__utimbuf *t)
|
||||
{
|
||||
int fd = _wopen(path, _O_WRONLY | _O_BINARY);
|
||||
int fd = _wopen(path, MSVCRT__O_WRONLY | MSVCRT__O_BINARY);
|
||||
|
||||
if (fd > 0)
|
||||
{
|
||||
|
@ -1921,7 +1909,7 @@ char *MSVCRT_fgets(char *s, int size, MSVCRT_FILE* file)
|
|||
/*********************************************************************
|
||||
* fgetwc (MSVCRT.@)
|
||||
*
|
||||
* In _O_TEXT mode, multibyte characters are read from the file, dropping
|
||||
* In MSVCRT__O_TEXT mode, multibyte characters are read from the file, dropping
|
||||
* the CR from CR/LF combinations
|
||||
*/
|
||||
MSVCRT_wint_t MSVCRT_fgetwc(MSVCRT_FILE* file)
|
||||
|
@ -2074,7 +2062,7 @@ MSVCRT_FILE* MSVCRT_fopen(const char *path, const char *mode)
|
|||
if (msvcrt_get_flags(mode, &open_flags, &stream_flags) == -1)
|
||||
return NULL;
|
||||
|
||||
fd = _open(path, open_flags, _S_IREAD | _S_IWRITE);
|
||||
fd = _open(path, open_flags, MSVCRT__S_IREAD | MSVCRT__S_IWRITE);
|
||||
|
||||
if (fd < 0)
|
||||
return NULL;
|
||||
|
@ -2114,7 +2102,7 @@ MSVCRT_FILE *MSVCRT__wfopen(const MSVCRT_wchar_t *path, const MSVCRT_wchar_t *mo
|
|||
return retval;
|
||||
}
|
||||
|
||||
MSVCRT__set_errno(GetLastError());
|
||||
msvcrt_set_errno(GetLastError());
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -2250,7 +2238,7 @@ MSVCRT_FILE* MSVCRT_freopen(const char *path, const char *mode,MSVCRT_FILE* file
|
|||
if (msvcrt_get_flags(mode, &open_flags, &stream_flags) == -1)
|
||||
return NULL;
|
||||
|
||||
fd = _open(path, open_flags, _S_IREAD | _S_IWRITE);
|
||||
fd = _open(path, open_flags, MSVCRT__S_IREAD | MSVCRT__S_IWRITE);
|
||||
|
||||
if (fd < 0)
|
||||
return NULL;
|
||||
|
@ -2258,7 +2246,7 @@ MSVCRT_FILE* MSVCRT_freopen(const char *path, const char *mode,MSVCRT_FILE* file
|
|||
{
|
||||
file->_flag = 0;
|
||||
WARN(":failed-last error (%ld)\n",GetLastError());
|
||||
MSVCRT__set_errno(GetLastError());
|
||||
msvcrt_set_errno(GetLastError());
|
||||
return NULL;
|
||||
}
|
||||
return file;
|
||||
|
@ -2432,7 +2420,7 @@ int MSVCRT_remove(const char *path)
|
|||
if (DeleteFileA(path))
|
||||
return 0;
|
||||
TRACE(":failed (%ld)\n",GetLastError());
|
||||
MSVCRT__set_errno(GetLastError());
|
||||
msvcrt_set_errno(GetLastError());
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -2445,7 +2433,7 @@ int _wremove(const MSVCRT_wchar_t *path)
|
|||
if (DeleteFileW(path))
|
||||
return 0;
|
||||
TRACE(":failed (%ld)\n",GetLastError());
|
||||
MSVCRT__set_errno(GetLastError());
|
||||
msvcrt_set_errno(GetLastError());
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -2458,7 +2446,7 @@ int MSVCRT_rename(const char *oldpath,const char *newpath)
|
|||
if (MoveFileExA(oldpath, newpath, MOVEFILE_COPY_ALLOWED))
|
||||
return 0;
|
||||
TRACE(":failed (%ld)\n",GetLastError());
|
||||
MSVCRT__set_errno(GetLastError());
|
||||
msvcrt_set_errno(GetLastError());
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -2471,7 +2459,7 @@ int _wrename(const MSVCRT_wchar_t *oldpath,const MSVCRT_wchar_t *newpath)
|
|||
if (MoveFileExW(oldpath, newpath, MOVEFILE_COPY_ALLOWED))
|
||||
return 0;
|
||||
TRACE(":failed (%ld)\n",GetLastError());
|
||||
MSVCRT__set_errno(GetLastError());
|
||||
msvcrt_set_errno(GetLastError());
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -2539,10 +2527,10 @@ MSVCRT_FILE* MSVCRT_tmpfile(void)
|
|||
int fd;
|
||||
MSVCRT_FILE* file = NULL;
|
||||
|
||||
fd = _open(filename, _O_CREAT | _O_BINARY | _O_RDWR | _O_TEMPORARY);
|
||||
fd = _open(filename, MSVCRT__O_CREAT | MSVCRT__O_BINARY | MSVCRT__O_RDWR | MSVCRT__O_TEMPORARY);
|
||||
if (fd != -1 && (file = msvcrt_alloc_fp()))
|
||||
{
|
||||
if (msvcrt_init_fp(file, fd, _O_RDWR) == -1)
|
||||
if (msvcrt_init_fp(file, fd, MSVCRT__O_RDWR) == -1)
|
||||
{
|
||||
file->_flag = 0;
|
||||
file = NULL;
|
||||
|
|
|
@ -22,12 +22,7 @@
|
|||
*/
|
||||
|
||||
#include "msvcrt.h"
|
||||
#include "msvcrt/errno.h"
|
||||
|
||||
#include "msvcrt/malloc.h"
|
||||
#include "msvcrt/stdlib.h"
|
||||
#include "mtdll.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
|
||||
|
@ -145,10 +140,10 @@ int _heapchk(void)
|
|||
{
|
||||
if (!HeapValidate( GetProcessHeap(), 0, NULL))
|
||||
{
|
||||
MSVCRT__set_errno(GetLastError());
|
||||
return _HEAPBADNODE;
|
||||
msvcrt_set_errno(GetLastError());
|
||||
return MSVCRT__HEAPBADNODE;
|
||||
}
|
||||
return _HEAPOK;
|
||||
return MSVCRT__HEAPOK;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
@ -159,7 +154,7 @@ int _heapmin(void)
|
|||
if (!HeapCompact( GetProcessHeap(), 0 ))
|
||||
{
|
||||
if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
|
||||
MSVCRT__set_errno(GetLastError());
|
||||
msvcrt_set_errno(GetLastError());
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
@ -168,21 +163,21 @@ int _heapmin(void)
|
|||
/*********************************************************************
|
||||
* _heapwalk (MSVCRT.@)
|
||||
*/
|
||||
int _heapwalk(_HEAPINFO* next)
|
||||
int _heapwalk(struct MSVCRT__heapinfo* next)
|
||||
{
|
||||
PROCESS_HEAP_ENTRY phe;
|
||||
|
||||
LOCK_HEAP;
|
||||
phe.lpData = next->_pentry;
|
||||
phe.cbData = next->_size;
|
||||
phe.wFlags = next->_useflag == _USEDENTRY ? PROCESS_HEAP_ENTRY_BUSY : 0;
|
||||
phe.wFlags = next->_useflag == MSVCRT__USEDENTRY ? PROCESS_HEAP_ENTRY_BUSY : 0;
|
||||
|
||||
if (phe.lpData && phe.wFlags & PROCESS_HEAP_ENTRY_BUSY &&
|
||||
!HeapValidate( GetProcessHeap(), 0, phe.lpData ))
|
||||
{
|
||||
UNLOCK_HEAP;
|
||||
MSVCRT__set_errno(GetLastError());
|
||||
return _HEAPBADNODE;
|
||||
msvcrt_set_errno(GetLastError());
|
||||
return MSVCRT__HEAPBADNODE;
|
||||
}
|
||||
|
||||
do
|
||||
|
@ -191,19 +186,19 @@ int _heapwalk(_HEAPINFO* next)
|
|||
{
|
||||
UNLOCK_HEAP;
|
||||
if (GetLastError() == ERROR_NO_MORE_ITEMS)
|
||||
return _HEAPEND;
|
||||
MSVCRT__set_errno(GetLastError());
|
||||
return MSVCRT__HEAPEND;
|
||||
msvcrt_set_errno(GetLastError());
|
||||
if (!phe.lpData)
|
||||
return _HEAPBADBEGIN;
|
||||
return _HEAPBADNODE;
|
||||
return MSVCRT__HEAPBADBEGIN;
|
||||
return MSVCRT__HEAPBADNODE;
|
||||
}
|
||||
} while (phe.wFlags & (PROCESS_HEAP_REGION|PROCESS_HEAP_UNCOMMITTED_RANGE));
|
||||
|
||||
UNLOCK_HEAP;
|
||||
next->_pentry = phe.lpData;
|
||||
next->_size = phe.cbData;
|
||||
next->_useflag = phe.wFlags & PROCESS_HEAP_ENTRY_BUSY ? _USEDENTRY : _FREEENTRY;
|
||||
return _HEAPOK;
|
||||
next->_useflag = phe.wFlags & PROCESS_HEAP_ENTRY_BUSY ? MSVCRT__USEDENTRY : MSVCRT__FREEENTRY;
|
||||
return MSVCRT__HEAPOK;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
@ -212,17 +207,17 @@ int _heapwalk(_HEAPINFO* next)
|
|||
int _heapset(unsigned int value)
|
||||
{
|
||||
int retval;
|
||||
_HEAPINFO heap;
|
||||
struct MSVCRT__heapinfo heap;
|
||||
|
||||
memset( &heap, 0, sizeof(_HEAPINFO) );
|
||||
memset( &heap, 0, sizeof(heap) );
|
||||
LOCK_HEAP;
|
||||
while ((retval = _heapwalk(&heap)) == _HEAPOK)
|
||||
while ((retval = _heapwalk(&heap)) == MSVCRT__HEAPOK)
|
||||
{
|
||||
if (heap._useflag == _FREEENTRY)
|
||||
if (heap._useflag == MSVCRT__FREEENTRY)
|
||||
memset(heap._pentry, value, heap._size);
|
||||
}
|
||||
UNLOCK_HEAP;
|
||||
return retval == _HEAPEND? _HEAPOK : retval;
|
||||
return retval == MSVCRT__HEAPEND? MSVCRT__HEAPOK : retval;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
@ -272,7 +267,7 @@ void* MSVCRT_malloc(MSVCRT_size_t size)
|
|||
{
|
||||
void *ret = HeapAlloc(GetProcessHeap(),0,size);
|
||||
if (!ret)
|
||||
MSVCRT__set_errno(GetLastError());
|
||||
msvcrt_set_errno(GetLastError());
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
#include "winuser.h"
|
||||
|
||||
#include "msvcrt.h"
|
||||
#include "msvcrt/locale.h"
|
||||
#include "mtdll.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
@ -44,7 +43,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
|
|||
#define MAX_LOCALE_LENGTH 256
|
||||
char MSVCRT_current_lc_all[MAX_LOCALE_LENGTH];
|
||||
LCID MSVCRT_current_lc_all_lcid;
|
||||
int MSVCRT_current_lc_all_cp;
|
||||
int msvcrt_current_lc_all_cp;
|
||||
|
||||
/* MT */
|
||||
#define LOCK_LOCALE _mlock(_SETLOCALE_LOCK);
|
||||
|
@ -275,7 +274,7 @@ static void msvcrt_set_ctype(unsigned int codepage, LCID lcid)
|
|||
unsigned char *traverse = (unsigned char *)cp.LeadByte;
|
||||
|
||||
memset(MSVCRT_current_ctype, 0, sizeof(MSVCRT__ctype));
|
||||
MSVCRT_current_lc_all_cp = codepage;
|
||||
msvcrt_current_lc_all_cp = codepage;
|
||||
|
||||
/* Switch ctype macros to MBCS if needed */
|
||||
MSVCRT___mb_cur_max = cp.MaxCharSize;
|
||||
|
@ -342,7 +341,7 @@ char* MSVCRT_setlocale(int category, const char* locale)
|
|||
{
|
||||
MSVCRT_current_lc_all[0] = 'C';
|
||||
MSVCRT_current_lc_all[1] = '\0';
|
||||
MSVCRT_current_lc_all_cp = GetACP();
|
||||
msvcrt_current_lc_all_cp = GetACP();
|
||||
|
||||
switch (category) {
|
||||
case MSVCRT_LC_ALL:
|
||||
|
@ -520,10 +519,10 @@ const char* _Strftime(char *out, unsigned int len, const char *fmt,
|
|||
void _setmbcp(int cp)
|
||||
{
|
||||
LOCK_LOCALE;
|
||||
if (MSVCRT_current_lc_all_cp != cp)
|
||||
if (msvcrt_current_lc_all_cp != cp)
|
||||
{
|
||||
/* FIXME: set ctype behaviour for this cp */
|
||||
MSVCRT_current_lc_all_cp = cp;
|
||||
msvcrt_current_lc_all_cp = cp;
|
||||
}
|
||||
UNLOCK_LOCALE;
|
||||
}
|
||||
|
@ -533,7 +532,7 @@ void _setmbcp(int cp)
|
|||
*/
|
||||
int _getmbcp(void)
|
||||
{
|
||||
return MSVCRT_current_lc_all_cp;
|
||||
return msvcrt_current_lc_all_cp;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
|
|
@ -19,15 +19,12 @@
|
|||
*/
|
||||
#include "msvcrt.h"
|
||||
|
||||
#include "msvcrt/locale.h"
|
||||
#include "msvcrt/stdio.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
|
||||
|
||||
/* Index to TLS */
|
||||
DWORD MSVCRT_tls_index;
|
||||
DWORD msvcrt_tls_index;
|
||||
|
||||
static inline BOOL msvcrt_init_tls(void);
|
||||
static inline BOOL msvcrt_free_tls(void);
|
||||
|
@ -38,12 +35,12 @@ const char* msvcrt_get_reason(DWORD reason) WINE_UNUSED;
|
|||
*/
|
||||
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
||||
{
|
||||
MSVCRT_thread_data *tls;
|
||||
thread_data_t *tls;
|
||||
|
||||
TRACE("(%p, %s, %p) pid(%lx), tid(%lx), tls(%ld)\n",
|
||||
hinstDLL, msvcrt_get_reason(fdwReason), lpvReserved,
|
||||
GetCurrentProcessId(), GetCurrentThreadId(),
|
||||
(long)MSVCRT_tls_index);
|
||||
(long)msvcrt_tls_index);
|
||||
|
||||
switch (fdwReason)
|
||||
{
|
||||
|
@ -70,7 +67,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
|||
break;
|
||||
case DLL_THREAD_DETACH:
|
||||
/* Free TLS */
|
||||
tls = TlsGetValue(MSVCRT_tls_index);
|
||||
tls = TlsGetValue(msvcrt_tls_index);
|
||||
if (tls) HeapFree(GetProcessHeap(), 0, tls);
|
||||
TRACE("finished thread free\n");
|
||||
break;
|
||||
|
@ -80,9 +77,9 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
|||
|
||||
static inline BOOL msvcrt_init_tls(void)
|
||||
{
|
||||
MSVCRT_tls_index = TlsAlloc();
|
||||
msvcrt_tls_index = TlsAlloc();
|
||||
|
||||
if (MSVCRT_tls_index == TLS_OUT_OF_INDEXES)
|
||||
if (msvcrt_tls_index == TLS_OUT_OF_INDEXES)
|
||||
{
|
||||
ERR("TlsAlloc() failed!\n");
|
||||
return FALSE;
|
||||
|
@ -92,7 +89,7 @@ static inline BOOL msvcrt_init_tls(void)
|
|||
|
||||
static inline BOOL msvcrt_free_tls(void)
|
||||
{
|
||||
if (!TlsFree(MSVCRT_tls_index))
|
||||
if (!TlsFree(msvcrt_tls_index))
|
||||
{
|
||||
ERR("TlsFree() failed!\n");
|
||||
return FALSE;
|
||||
|
@ -140,11 +137,9 @@ void MSVCRT_I10_OUTPUT(void)
|
|||
* Success: A string pointing to the unmangled name, allocated with memget.
|
||||
* Failure: NULL.
|
||||
*/
|
||||
char* MSVCRT___unDNameEx(char * OutStr, const char* mangled, int OutStrLen,
|
||||
MSVCRT_malloc_func memget,
|
||||
MSVCRT_free_func memfree,
|
||||
void * unknown,
|
||||
unsigned short int flags)
|
||||
char* __unDNameEx(char * OutStr, const char* mangled, int OutStrLen,
|
||||
malloc_func_t memget, free_func_t memfree,
|
||||
void * unknown, unsigned short int flags)
|
||||
{
|
||||
FIXME("(%p,%s,%d,%p,%p,%p,%x) stub!\n",
|
||||
OutStr, mangled, OutStrLen, memget, memfree, unknown, flags);
|
||||
|
@ -177,11 +172,9 @@ char* MSVCRT___unDNameEx(char * OutStr, const char* mangled, int OutStrLen,
|
|||
/*********************************************************************
|
||||
* __unDName (MSVCRT.@)
|
||||
*/
|
||||
char* MSVCRT___unDName(char * OutStr, const char* mangled, int OutStrLen,
|
||||
MSVCRT_malloc_func memget,
|
||||
MSVCRT_free_func memfree,
|
||||
unsigned short int flags)
|
||||
char* __unDName(char * OutStr, const char* mangled, int OutStrLen,
|
||||
malloc_func_t memget, free_func_t memfree,
|
||||
unsigned short int flags)
|
||||
{
|
||||
return MSVCRT___unDNameEx( OutStr, mangled, OutStrLen, memget, memfree,
|
||||
NULL, flags);
|
||||
return __unDNameEx( OutStr, mangled, OutStrLen, memget, memfree, 0, flags);
|
||||
}
|
||||
|
|
|
@ -28,10 +28,6 @@
|
|||
#endif
|
||||
|
||||
#include "msvcrt.h"
|
||||
#include "msvcrt/errno.h"
|
||||
#include "msvcrt/stdlib.h"
|
||||
#include "msvcrt/math.h"
|
||||
#include "msvcrt/float.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
|
@ -262,50 +258,50 @@ int _fpclass(double num)
|
|||
switch (fpclass( num ))
|
||||
{
|
||||
#ifdef FP_SNAN
|
||||
case FP_SNAN: return _FPCLASS_SNAN;
|
||||
case FP_SNAN: return MSVCRT__FPCLASS_SNAN;
|
||||
#endif
|
||||
#ifdef FP_QNAN
|
||||
case FP_QNAN: return _FPCLASS_QNAN;
|
||||
case FP_QNAN: return MSVCRT__FPCLASS_QNAN;
|
||||
#endif
|
||||
#ifdef FP_NINF
|
||||
case FP_NINF: return _FPCLASS_NINF;
|
||||
case FP_NINF: return MSVCRT__FPCLASS_NINF;
|
||||
#endif
|
||||
#ifdef FP_PINF
|
||||
case FP_PINF: return _FPCLASS_PINF;
|
||||
case FP_PINF: return MSVCRT__FPCLASS_PINF;
|
||||
#endif
|
||||
#ifdef FP_NDENORM
|
||||
case FP_NDENORM: return _FPCLASS_ND;
|
||||
case FP_NDENORM: return MSVCRT__FPCLASS_ND;
|
||||
#endif
|
||||
#ifdef FP_PDENORM
|
||||
case FP_PDENORM: return _FPCLASS_PD;
|
||||
case FP_PDENORM: return MSVCRT__FPCLASS_PD;
|
||||
#endif
|
||||
#ifdef FP_NZERO
|
||||
case FP_NZERO: return _FPCLASS_NZ;
|
||||
case FP_NZERO: return MSVCRT__FPCLASS_NZ;
|
||||
#endif
|
||||
#ifdef FP_PZERO
|
||||
case FP_PZERO: return _FPCLASS_PZ;
|
||||
case FP_PZERO: return MSVCRT__FPCLASS_PZ;
|
||||
#endif
|
||||
#ifdef FP_NNORM
|
||||
case FP_NNORM: return _FPCLASS_NN;
|
||||
case FP_NNORM: return MSVCRT__FPCLASS_NN;
|
||||
#endif
|
||||
#ifdef FP_PNORM
|
||||
case FP_PNORM: return _FPCLASS_PN;
|
||||
case FP_PNORM: return MSVCRT__FPCLASS_PN;
|
||||
#endif
|
||||
}
|
||||
return _FPCLASS_PN;
|
||||
return MSVCRT__FPCLASS_PN;
|
||||
#elif defined (fpclassify)
|
||||
switch (fpclassify( num ))
|
||||
{
|
||||
case FP_NAN: return _FPCLASS_QNAN;
|
||||
case FP_INFINITE: return signbit(num) ? _FPCLASS_NINF : _FPCLASS_PINF;
|
||||
case FP_SUBNORMAL: return signbit(num) ?_FPCLASS_ND : _FPCLASS_PD;
|
||||
case FP_ZERO: return signbit(num) ? _FPCLASS_NZ : _FPCLASS_PZ;
|
||||
case FP_NAN: return MSVCRT__FPCLASS_QNAN;
|
||||
case FP_INFINITE: return signbit(num) ? MSVCRT__FPCLASS_NINF : MSVCRT__FPCLASS_PINF;
|
||||
case FP_SUBNORMAL: return signbit(num) ?MSVCRT__FPCLASS_ND : MSVCRT__FPCLASS_PD;
|
||||
case FP_ZERO: return signbit(num) ? MSVCRT__FPCLASS_NZ : MSVCRT__FPCLASS_PZ;
|
||||
}
|
||||
return signbit(num) ? _FPCLASS_NN : _FPCLASS_PN;
|
||||
return signbit(num) ? MSVCRT__FPCLASS_NN : MSVCRT__FPCLASS_PN;
|
||||
#else
|
||||
if (!finite(num))
|
||||
return _FPCLASS_QNAN;
|
||||
return num == 0.0 ? _FPCLASS_PZ : (num < 0 ? _FPCLASS_NN : _FPCLASS_PN);
|
||||
return MSVCRT__FPCLASS_QNAN;
|
||||
return num == 0.0 ? MSVCRT__FPCLASS_PZ : (num < 0 ? MSVCRT__FPCLASS_NN : MSVCRT__FPCLASS_PN);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -400,12 +396,12 @@ unsigned int _statusfp(void)
|
|||
unsigned int fpword;
|
||||
|
||||
__asm__ __volatile__( "fstsw %0" : "=m" (fpword) : );
|
||||
if (fpword & 0x1) retVal |= _SW_INVALID;
|
||||
if (fpword & 0x2) retVal |= _SW_DENORMAL;
|
||||
if (fpword & 0x4) retVal |= _SW_ZERODIVIDE;
|
||||
if (fpword & 0x8) retVal |= _SW_OVERFLOW;
|
||||
if (fpword & 0x10) retVal |= _SW_UNDERFLOW;
|
||||
if (fpword & 0x20) retVal |= _SW_INEXACT;
|
||||
if (fpword & 0x1) retVal |= MSVCRT__SW_INVALID;
|
||||
if (fpword & 0x2) retVal |= MSVCRT__SW_DENORMAL;
|
||||
if (fpword & 0x4) retVal |= MSVCRT__SW_ZERODIVIDE;
|
||||
if (fpword & 0x8) retVal |= MSVCRT__SW_OVERFLOW;
|
||||
if (fpword & 0x10) retVal |= MSVCRT__SW_UNDERFLOW;
|
||||
if (fpword & 0x20) retVal |= MSVCRT__SW_INEXACT;
|
||||
#else
|
||||
FIXME(":Not implemented!\n");
|
||||
#endif
|
||||
|
@ -482,46 +478,46 @@ unsigned int _control87(unsigned int newval, unsigned int mask)
|
|||
TRACE("Control word before : %08x\n", fpword);
|
||||
|
||||
/* Convert into mask constants */
|
||||
if (fpword & 0x1) flags |= _EM_INVALID;
|
||||
if (fpword & 0x2) flags |= _EM_DENORMAL;
|
||||
if (fpword & 0x4) flags |= _EM_ZERODIVIDE;
|
||||
if (fpword & 0x8) flags |= _EM_OVERFLOW;
|
||||
if (fpword & 0x10) flags |= _EM_UNDERFLOW;
|
||||
if (fpword & 0x20) flags |= _EM_INEXACT;
|
||||
if (fpword & 0x1) flags |= MSVCRT__EM_INVALID;
|
||||
if (fpword & 0x2) flags |= MSVCRT__EM_DENORMAL;
|
||||
if (fpword & 0x4) flags |= MSVCRT__EM_ZERODIVIDE;
|
||||
if (fpword & 0x8) flags |= MSVCRT__EM_OVERFLOW;
|
||||
if (fpword & 0x10) flags |= MSVCRT__EM_UNDERFLOW;
|
||||
if (fpword & 0x20) flags |= MSVCRT__EM_INEXACT;
|
||||
switch(fpword & 0xC00) {
|
||||
case 0xC00: flags |= _RC_UP|_RC_DOWN; break;
|
||||
case 0x800: flags |= _RC_UP; break;
|
||||
case 0x400: flags |= _RC_DOWN; break;
|
||||
case 0xC00: flags |= MSVCRT__RC_UP|MSVCRT__RC_DOWN; break;
|
||||
case 0x800: flags |= MSVCRT__RC_UP; break;
|
||||
case 0x400: flags |= MSVCRT__RC_DOWN; break;
|
||||
}
|
||||
switch(fpword & 0x300) {
|
||||
case 0x0: flags |= _PC_24; break;
|
||||
case 0x200: flags |= _PC_53; break;
|
||||
case 0x300: flags |= _PC_64; break;
|
||||
case 0x0: flags |= MSVCRT__PC_24; break;
|
||||
case 0x200: flags |= MSVCRT__PC_53; break;
|
||||
case 0x300: flags |= MSVCRT__PC_64; break;
|
||||
}
|
||||
if (fpword & 0x1000) flags |= _IC_AFFINE;
|
||||
if (fpword & 0x1000) flags |= MSVCRT__IC_AFFINE;
|
||||
|
||||
/* Mask with parameters */
|
||||
flags = (flags & ~mask) | (newval & mask);
|
||||
|
||||
/* Convert (masked) value back to fp word */
|
||||
fpword = 0;
|
||||
if (flags & _EM_INVALID) fpword |= 0x1;
|
||||
if (flags & _EM_DENORMAL) fpword |= 0x2;
|
||||
if (flags & _EM_ZERODIVIDE) fpword |= 0x4;
|
||||
if (flags & _EM_OVERFLOW) fpword |= 0x8;
|
||||
if (flags & _EM_UNDERFLOW) fpword |= 0x10;
|
||||
if (flags & _EM_INEXACT) fpword |= 0x20;
|
||||
switch(flags & (_RC_UP | _RC_DOWN)) {
|
||||
case _RC_UP|_RC_DOWN: fpword |= 0xC00; break;
|
||||
case _RC_UP: fpword |= 0x800; break;
|
||||
case _RC_DOWN: fpword |= 0x400; break;
|
||||
if (flags & MSVCRT__EM_INVALID) fpword |= 0x1;
|
||||
if (flags & MSVCRT__EM_DENORMAL) fpword |= 0x2;
|
||||
if (flags & MSVCRT__EM_ZERODIVIDE) fpword |= 0x4;
|
||||
if (flags & MSVCRT__EM_OVERFLOW) fpword |= 0x8;
|
||||
if (flags & MSVCRT__EM_UNDERFLOW) fpword |= 0x10;
|
||||
if (flags & MSVCRT__EM_INEXACT) fpword |= 0x20;
|
||||
switch(flags & (MSVCRT__RC_UP | MSVCRT__RC_DOWN)) {
|
||||
case MSVCRT__RC_UP|MSVCRT__RC_DOWN: fpword |= 0xC00; break;
|
||||
case MSVCRT__RC_UP: fpword |= 0x800; break;
|
||||
case MSVCRT__RC_DOWN: fpword |= 0x400; break;
|
||||
}
|
||||
switch (flags & (_PC_24 | _PC_53)) {
|
||||
case _PC_64: fpword |= 0x300; break;
|
||||
case _PC_53: fpword |= 0x200; break;
|
||||
case _PC_24: fpword |= 0x0; break;
|
||||
switch (flags & (MSVCRT__PC_24 | MSVCRT__PC_53)) {
|
||||
case MSVCRT__PC_64: fpword |= 0x300; break;
|
||||
case MSVCRT__PC_53: fpword |= 0x200; break;
|
||||
case MSVCRT__PC_24: fpword |= 0x0; break;
|
||||
}
|
||||
if (flags & _IC_AFFINE) fpword |= 0x1000;
|
||||
if (flags & MSVCRT__IC_AFFINE) fpword |= 0x1000;
|
||||
|
||||
TRACE("Control word after : %08x\n", fpword);
|
||||
|
||||
|
@ -541,7 +537,7 @@ unsigned int _control87(unsigned int newval, unsigned int mask)
|
|||
unsigned int _controlfp(unsigned int newval, unsigned int mask)
|
||||
{
|
||||
#ifdef __i386__
|
||||
return _control87( newval, mask & ~_EM_DENORMAL );
|
||||
return _control87( newval, mask & ~MSVCRT__EM_DENORMAL );
|
||||
#else
|
||||
FIXME(":Not Implemented!\n");
|
||||
return 0;
|
||||
|
@ -598,7 +594,7 @@ double _y0(double num)
|
|||
double retval;
|
||||
if (!finite(num)) *MSVCRT__errno() = MSVCRT_EDOM;
|
||||
retval = y0(num);
|
||||
if (_fpclass(retval) == _FPCLASS_NINF)
|
||||
if (_fpclass(retval) == MSVCRT__FPCLASS_NINF)
|
||||
{
|
||||
*MSVCRT__errno() = MSVCRT_EDOM;
|
||||
retval = sqrt(-1);
|
||||
|
@ -614,7 +610,7 @@ double _y1(double num)
|
|||
double retval;
|
||||
if (!finite(num)) *MSVCRT__errno() = MSVCRT_EDOM;
|
||||
retval = y1(num);
|
||||
if (_fpclass(retval) == _FPCLASS_NINF)
|
||||
if (_fpclass(retval) == MSVCRT__FPCLASS_NINF)
|
||||
{
|
||||
*MSVCRT__errno() = MSVCRT_EDOM;
|
||||
retval = sqrt(-1);
|
||||
|
@ -630,7 +626,7 @@ double _yn(int order, double num)
|
|||
double retval;
|
||||
if (!finite(num)) *MSVCRT__errno() = MSVCRT_EDOM;
|
||||
retval = yn(order,num);
|
||||
if (_fpclass(retval) == _FPCLASS_NINF)
|
||||
if (_fpclass(retval) == MSVCRT__FPCLASS_NINF)
|
||||
{
|
||||
*MSVCRT__errno() = MSVCRT_EDOM;
|
||||
retval = sqrt(-1);
|
||||
|
@ -654,7 +650,7 @@ double _nextafter(double num, double next)
|
|||
*/
|
||||
char *_ecvt( double number, int ndigits, int *decpt, int *sign )
|
||||
{
|
||||
MSVCRT_thread_data *data = msvcrt_get_thread_data();
|
||||
thread_data_t *data = msvcrt_get_thread_data();
|
||||
char *dec;
|
||||
|
||||
if (!data->efcvt_buffer)
|
||||
|
@ -672,7 +668,7 @@ char *_ecvt( double number, int ndigits, int *decpt, int *sign )
|
|||
*/
|
||||
char *_fcvt( double number, int ndigits, int *decpt, int *sign )
|
||||
{
|
||||
MSVCRT_thread_data *data = msvcrt_get_thread_data();
|
||||
thread_data_t *data = msvcrt_get_thread_data();
|
||||
char *dec;
|
||||
|
||||
if (!data->efcvt_buffer)
|
||||
|
|
|
@ -24,13 +24,6 @@
|
|||
*/
|
||||
|
||||
#include "msvcrt.h"
|
||||
|
||||
#include "msvcrt/mbctype.h"
|
||||
#include "msvcrt/mbstring.h"
|
||||
#include "msvcrt/stdlib.h"
|
||||
#include "msvcrt/string.h"
|
||||
#include "msvcrt/wctype.h"
|
||||
|
||||
#include "wine/unicode.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
|
@ -53,7 +46,7 @@ static MSVCRT_wchar_t msvcrt_mbc_to_wc(unsigned int ch)
|
|||
mbch[1] = ch & 0xff;
|
||||
n_chars = 2;
|
||||
}
|
||||
if (!MultiByteToWideChar(MSVCRT_current_lc_all_cp, 0, mbch, n_chars, &chW, 1))
|
||||
if (!MultiByteToWideChar(msvcrt_current_lc_all_cp, 0, mbch, n_chars, &chW, 1))
|
||||
{
|
||||
WARN("MultiByteToWideChar failed on %x\n", ch);
|
||||
return 0;
|
||||
|
@ -555,7 +548,7 @@ unsigned char* _mbsrchr(const unsigned char* s, unsigned int x)
|
|||
*/
|
||||
unsigned char* _mbstok(unsigned char *str, const unsigned char *delim)
|
||||
{
|
||||
MSVCRT_thread_data *data = msvcrt_get_thread_data();
|
||||
thread_data_t *data = msvcrt_get_thread_data();
|
||||
char *ret;
|
||||
|
||||
if(MSVCRT___mb_cur_max > 1)
|
||||
|
@ -626,7 +619,7 @@ unsigned int _mbbtombc(unsigned int c)
|
|||
int _ismbbkana(unsigned int c)
|
||||
{
|
||||
/* FIXME: use lc_ctype when supported, not lc_all */
|
||||
if(MSVCRT_current_lc_all_cp == 932)
|
||||
if(msvcrt_current_lc_all_cp == 932)
|
||||
{
|
||||
/* Japanese/Katakana, CP 932 */
|
||||
return (c >= 0xa1 && c <= 0xdf);
|
||||
|
@ -736,7 +729,7 @@ int _ismbcpunct(unsigned int ch)
|
|||
int _ismbchira(unsigned int c)
|
||||
{
|
||||
/* FIXME: use lc_ctype when supported, not lc_all */
|
||||
if(MSVCRT_current_lc_all_cp == 932)
|
||||
if(msvcrt_current_lc_all_cp == 932)
|
||||
{
|
||||
/* Japanese/Hiragana, CP 932 */
|
||||
return (c >= 0x829f && c <= 0x82f1);
|
||||
|
@ -750,7 +743,7 @@ int _ismbchira(unsigned int c)
|
|||
int _ismbckata(unsigned int c)
|
||||
{
|
||||
/* FIXME: use lc_ctype when supported, not lc_all */
|
||||
if(MSVCRT_current_lc_all_cp == 932)
|
||||
if(msvcrt_current_lc_all_cp == 932)
|
||||
{
|
||||
if(c < 256)
|
||||
return _ismbbkana(c);
|
||||
|
|
|
@ -24,8 +24,6 @@
|
|||
#include <stdlib.h>
|
||||
|
||||
#include "msvcrt.h"
|
||||
#include "msvcrt/stdlib.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright 2001 Jon Griffiths
|
||||
* Copyright 2004 Dimitrie O. Paun
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -14,6 +15,22 @@
|
|||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* NOTES
|
||||
* Naming conventions
|
||||
* - Symbols are prefixed with MSVCRT_ if they conflict
|
||||
* with libc symbols
|
||||
* - Internal symbolx are usually prefixed by msvcrt_.
|
||||
* - Exported symbols that are not present in the public
|
||||
* headers are usually kept the same as the original.
|
||||
* Other conventions
|
||||
* - To avoid conflicts with the standard C library,
|
||||
* no msvcrt headers are included in the implementation.
|
||||
* - Instead, symbols are duplicated here, prefixed with
|
||||
* MSVCRT_, as explained above.
|
||||
* - To avoid inconsistencies, a test for each symbol is
|
||||
* added into tests/headers.c. Please always add a
|
||||
* corresponding test when you add a new symbol!
|
||||
*/
|
||||
|
||||
#ifndef __WINE_MSVCRT_H
|
||||
|
@ -28,38 +45,58 @@
|
|||
#include "winerror.h"
|
||||
#include "winnls.h"
|
||||
|
||||
#include "msvcrt/string.h"
|
||||
#include "msvcrt/eh.h"
|
||||
typedef unsigned short MSVCRT_wchar_t;
|
||||
typedef unsigned short MSVCRT_wint_t;
|
||||
typedef unsigned short MSVCRT_wctype_t;
|
||||
typedef unsigned short MSVCRT__ino_t;
|
||||
typedef unsigned long MSVCRT__fsize_t;
|
||||
typedef unsigned int MSVCRT_size_t;
|
||||
typedef unsigned int MSVCRT__dev_t;
|
||||
typedef int MSVCRT__off_t;
|
||||
typedef long MSVCRT_clock_t;
|
||||
typedef long MSVCRT_time_t;
|
||||
typedef long MSVCRT_fpos_t;
|
||||
|
||||
typedef void (*MSVCRT_terminate_handler)();
|
||||
typedef void (*MSVCRT_terminate_function)();
|
||||
typedef void (*MSVCRT_unexpected_handler)();
|
||||
typedef void (*MSVCRT_unexpected_function)();
|
||||
typedef void (*MSVCRT__se_translator_function)(unsigned int code, struct _EXCEPTION_POINTERS *info);
|
||||
typedef void (*MSVCRT__beginthread_start_routine_t)(void *);
|
||||
typedef unsigned int (__stdcall *MSVCRT__beginthreadex_start_routine_t)(void *);
|
||||
typedef int (*MSVCRT__onexit_t)(void);
|
||||
|
||||
|
||||
/* TLS data */
|
||||
extern DWORD MSVCRT_tls_index;
|
||||
extern DWORD msvcrt_tls_index;
|
||||
|
||||
typedef struct __MSVCRT_thread_data
|
||||
{
|
||||
int thread_errno;
|
||||
unsigned long thread_doserrno;
|
||||
char *mbstok_next; /* next ptr for mbstok() */
|
||||
char *efcvt_buffer; /* buffer for ecvt/fcvt */
|
||||
int fpecode;
|
||||
terminate_function terminate_handler;
|
||||
unexpected_function unexpected_handler;
|
||||
_se_translator_function se_translator;
|
||||
EXCEPTION_RECORD *exc_record;
|
||||
} MSVCRT_thread_data;
|
||||
struct __thread_data {
|
||||
int thread_errno;
|
||||
unsigned long thread_doserrno;
|
||||
char *mbstok_next; /* next ptr for mbstok() */
|
||||
char *efcvt_buffer; /* buffer for ecvt/fcvt */
|
||||
int fpecode;
|
||||
MSVCRT_terminate_function terminate_handler;
|
||||
MSVCRT_unexpected_function unexpected_handler;
|
||||
MSVCRT__se_translator_function se_translator;
|
||||
EXCEPTION_RECORD *exc_record;
|
||||
};
|
||||
|
||||
extern MSVCRT_thread_data *msvcrt_get_thread_data(void);
|
||||
typedef struct __thread_data thread_data_t;
|
||||
|
||||
extern int MSVCRT_current_lc_all_cp;
|
||||
extern thread_data_t *msvcrt_get_thread_data(void);
|
||||
|
||||
void _purecall(void);
|
||||
void MSVCRT__set_errno(int);
|
||||
extern int msvcrt_current_lc_all_cp;
|
||||
|
||||
void msvcrt_set_errno(int);
|
||||
char* msvcrt_strndup(const char*,unsigned int);
|
||||
MSVCRT_wchar_t *msvcrt_wstrndup(const MSVCRT_wchar_t*, unsigned int);
|
||||
|
||||
void MSVCRT__amsg_exit(int errnum);
|
||||
void _purecall(void);
|
||||
void _amsg_exit(int errnum);
|
||||
|
||||
extern char **MSVCRT__environ;
|
||||
extern MSVCRT_wchar_t **MSVCRT__wenviron;
|
||||
extern char **_environ;
|
||||
extern MSVCRT_wchar_t **_wenviron;
|
||||
|
||||
extern char ** msvcrt_SnapshotOfEnvironmentA(char **);
|
||||
extern MSVCRT_wchar_t ** msvcrt_SnapshotOfEnvironmentW(MSVCRT_wchar_t **);
|
||||
|
@ -70,13 +107,13 @@ extern MSVCRT_wchar_t ** msvcrt_SnapshotOfEnvironmentW(MSVCRT_wchar_t **);
|
|||
int MSVCRT__set_new_mode(int mode);
|
||||
|
||||
void* MSVCRT_operator_new(unsigned long size);
|
||||
void MSVCRT_operator_delete(void*);
|
||||
void MSVCRT_operator_delete(void*);
|
||||
|
||||
typedef void* (*MSVCRT_malloc_func)(MSVCRT_size_t);
|
||||
typedef void (*MSVCRT_free_func)(void*);
|
||||
typedef void* (*malloc_func_t)(MSVCRT_size_t);
|
||||
typedef void (*free_func_t)(void*);
|
||||
|
||||
extern char* MSVCRT___unDName(char *,const char*,int,MSVCRT_malloc_func,MSVCRT_free_func,unsigned short int);
|
||||
extern char* MSVCRT___unDNameEx(char *,const char*,int,MSVCRT_malloc_func,MSVCRT_free_func,void *,unsigned short int);
|
||||
extern char* __unDName(char *,const char*,int,malloc_func_t,free_func_t,unsigned short int);
|
||||
extern char* __unDNameEx(char *,const char*,int,malloc_func_t,free_func_t,void *,unsigned short int);
|
||||
|
||||
/* Setup and teardown multi threaded locks */
|
||||
extern void msvcrt_init_mt_locks(void);
|
||||
|
@ -123,4 +160,429 @@ extern void msvcrt_free_args(void);
|
|||
#define _RT_CRNL 252
|
||||
#define _RT_BANNER 255
|
||||
|
||||
struct MSVCRT_tm {
|
||||
int tm_sec;
|
||||
int tm_min;
|
||||
int tm_hour;
|
||||
int tm_mday;
|
||||
int tm_mon;
|
||||
int tm_year;
|
||||
int tm_wday;
|
||||
int tm_yday;
|
||||
int tm_isdst;
|
||||
};
|
||||
|
||||
struct MSVCRT__timeb {
|
||||
MSVCRT_time_t time;
|
||||
unsigned short millitm;
|
||||
short timezone;
|
||||
short dstflag;
|
||||
};
|
||||
|
||||
struct MSVCRT__iobuf {
|
||||
char* _ptr;
|
||||
int _cnt;
|
||||
char* _base;
|
||||
int _flag;
|
||||
int _file;
|
||||
int _charbuf;
|
||||
int _bufsiz;
|
||||
char* _tmpfname;
|
||||
};
|
||||
|
||||
typedef struct MSVCRT__iobuf MSVCRT_FILE;
|
||||
|
||||
struct MSVCRT_lconv {
|
||||
char* decimal_point;
|
||||
char* thousands_sep;
|
||||
char* grouping;
|
||||
char* int_curr_symbol;
|
||||
char* currency_symbol;
|
||||
char* mon_decimal_point;
|
||||
char* mon_thousands_sep;
|
||||
char* mon_grouping;
|
||||
char* positive_sign;
|
||||
char* negative_sign;
|
||||
char int_frac_digits;
|
||||
char frac_digits;
|
||||
char p_cs_precedes;
|
||||
char p_sep_by_space;
|
||||
char n_cs_precedes;
|
||||
char n_sep_by_space;
|
||||
char p_sign_posn;
|
||||
char n_sign_posn;
|
||||
};
|
||||
|
||||
struct MSVCRT__exception {
|
||||
int type;
|
||||
char* name;
|
||||
double arg1;
|
||||
double arg2;
|
||||
double retval;
|
||||
};
|
||||
|
||||
struct MSVCRT__complex {
|
||||
double x; /* Real part */
|
||||
double y; /* Imaginary part */
|
||||
};
|
||||
|
||||
struct MSVCRT__heapinfo {
|
||||
int* _pentry;
|
||||
MSVCRT_size_t _size;
|
||||
int _useflag;
|
||||
};
|
||||
|
||||
#ifdef __i386__
|
||||
struct MSVCRT___JUMP_BUFFER {
|
||||
unsigned long Ebp;
|
||||
unsigned long Ebx;
|
||||
unsigned long Edi;
|
||||
unsigned long Esi;
|
||||
unsigned long Esp;
|
||||
unsigned long Eip;
|
||||
unsigned long Registration;
|
||||
unsigned long TryLevel;
|
||||
/* Start of new struct members */
|
||||
unsigned long Cookie;
|
||||
unsigned long UnwindFunc;
|
||||
unsigned long UnwindData[6];
|
||||
};
|
||||
#endif /* __i386__ */
|
||||
|
||||
struct MSVCRT__diskfree_t {
|
||||
unsigned int total_clusters;
|
||||
unsigned int avail_clusters;
|
||||
unsigned int sectors_per_cluster;
|
||||
unsigned int bytes_per_sector;
|
||||
};
|
||||
|
||||
struct MSVCRT__finddata_t {
|
||||
unsigned attrib;
|
||||
MSVCRT_time_t time_create;
|
||||
MSVCRT_time_t time_access;
|
||||
MSVCRT_time_t time_write;
|
||||
MSVCRT__fsize_t size;
|
||||
char name[260];
|
||||
};
|
||||
|
||||
struct MSVCRT__finddatai64_t {
|
||||
unsigned attrib;
|
||||
MSVCRT_time_t time_create;
|
||||
MSVCRT_time_t time_access;
|
||||
MSVCRT_time_t time_write;
|
||||
__int64 size;
|
||||
char name[260];
|
||||
};
|
||||
|
||||
struct MSVCRT__wfinddata_t {
|
||||
unsigned attrib;
|
||||
MSVCRT_time_t time_create;
|
||||
MSVCRT_time_t time_access;
|
||||
MSVCRT_time_t time_write;
|
||||
MSVCRT__fsize_t size;
|
||||
MSVCRT_wchar_t name[260];
|
||||
};
|
||||
|
||||
struct MSVCRT__wfinddatai64_t {
|
||||
unsigned attrib;
|
||||
MSVCRT_time_t time_create;
|
||||
MSVCRT_time_t time_access;
|
||||
MSVCRT_time_t time_write;
|
||||
__int64 size;
|
||||
MSVCRT_wchar_t name[260];
|
||||
};
|
||||
|
||||
struct MSVCRT__utimbuf
|
||||
{
|
||||
MSVCRT_time_t actime;
|
||||
MSVCRT_time_t modtime;
|
||||
};
|
||||
|
||||
/* for FreeBSD */
|
||||
#undef st_atime
|
||||
#undef st_ctime
|
||||
#undef st_mtime
|
||||
|
||||
struct MSVCRT__stat {
|
||||
MSVCRT__dev_t st_dev;
|
||||
MSVCRT__ino_t st_ino;
|
||||
unsigned short st_mode;
|
||||
short st_nlink;
|
||||
short st_uid;
|
||||
short st_gid;
|
||||
MSVCRT__dev_t st_rdev;
|
||||
MSVCRT__off_t st_size;
|
||||
MSVCRT_time_t st_atime;
|
||||
MSVCRT_time_t st_mtime;
|
||||
MSVCRT_time_t st_ctime;
|
||||
};
|
||||
|
||||
struct MSVCRT_stat {
|
||||
MSVCRT__dev_t st_dev;
|
||||
MSVCRT__ino_t st_ino;
|
||||
unsigned short st_mode;
|
||||
short st_nlink;
|
||||
short st_uid;
|
||||
short st_gid;
|
||||
MSVCRT__dev_t st_rdev;
|
||||
MSVCRT__off_t st_size;
|
||||
MSVCRT_time_t st_atime;
|
||||
MSVCRT_time_t st_mtime;
|
||||
MSVCRT_time_t st_ctime;
|
||||
};
|
||||
|
||||
struct MSVCRT__stati64 {
|
||||
MSVCRT__dev_t st_dev;
|
||||
MSVCRT__ino_t st_ino;
|
||||
unsigned short st_mode;
|
||||
short st_nlink;
|
||||
short st_uid;
|
||||
short st_gid;
|
||||
MSVCRT__dev_t st_rdev;
|
||||
__int64 st_size;
|
||||
MSVCRT_time_t st_atime;
|
||||
MSVCRT_time_t st_mtime;
|
||||
MSVCRT_time_t st_ctime;
|
||||
};
|
||||
|
||||
#define MSVCRT_WEOF (MSVCRT_wint_t)(0xFFFF)
|
||||
#define MSVCRT_EOF (-1)
|
||||
#define MSVCRT_TMP_MAX 0x7fff
|
||||
#define MSVCRT_BUFSIZ 512
|
||||
|
||||
#define MSVCRT_STDIN_FILENO 0
|
||||
#define MSVCRT_STDOUT_FILENO 1
|
||||
#define MSVCRT_STDERR_FILENO 2
|
||||
|
||||
/* more file._flag flags, but these conflict with Unix */
|
||||
#define MSVCRT__IOFBF 0x0000
|
||||
#define MSVCRT__IONBF 0x0004
|
||||
#define MSVCRT__IOLBF 0x0040
|
||||
|
||||
#define MSVCRT_FILENAME_MAX 260
|
||||
#define MSVCRT_stdin (MSVCRT__iob+MSVCRT_STDIN_FILENO)
|
||||
#define MSVCRT_stdout (MSVCRT__iob+MSVCRT_STDOUT_FILENO)
|
||||
#define MSVCRT_stderr (MSVCRT__iob+MSVCRT_STDERR_FILENO)
|
||||
|
||||
#define MSVCRT__P_WAIT 0
|
||||
#define MSVCRT__P_NOWAIT 1
|
||||
#define MSVCRT__P_OVERLAY 2
|
||||
#define MSVCRT__P_NOWAITO 3
|
||||
#define MSVCRT__P_DETACH 4
|
||||
|
||||
#define MSVCRT_EPERM 1
|
||||
#define MSVCRT_ENOENT 2
|
||||
#define MSVCRT_ESRCH 3
|
||||
#define MSVCRT_EINTR 4
|
||||
#define MSVCRT_EIO 5
|
||||
#define MSVCRT_ENXIO 6
|
||||
#define MSVCRT_E2BIG 7
|
||||
#define MSVCRT_ENOEXEC 8
|
||||
#define MSVCRT_EBADF 9
|
||||
#define MSVCRT_ECHILD 10
|
||||
#define MSVCRT_EAGAIN 11
|
||||
#define MSVCRT_ENOMEM 12
|
||||
#define MSVCRT_EACCES 13
|
||||
#define MSVCRT_EFAULT 14
|
||||
#define MSVCRT_EBUSY 16
|
||||
#define MSVCRT_EEXIST 17
|
||||
#define MSVCRT_EXDEV 18
|
||||
#define MSVCRT_ENODEV 19
|
||||
#define MSVCRT_ENOTDIR 20
|
||||
#define MSVCRT_EISDIR 21
|
||||
#define MSVCRT_EINVAL 22
|
||||
#define MSVCRT_ENFILE 23
|
||||
#define MSVCRT_EMFILE 24
|
||||
#define MSVCRT_ENOTTY 25
|
||||
#define MSVCRT_EFBIG 27
|
||||
#define MSVCRT_ENOSPC 28
|
||||
#define MSVCRT_ESPIPE 29
|
||||
#define MSVCRT_EROFS 30
|
||||
#define MSVCRT_EMLINK 31
|
||||
#define MSVCRT_EPIPE 32
|
||||
#define MSVCRT_EDOM 33
|
||||
#define MSVCRT_ERANGE 34
|
||||
#define MSVCRT_EDEADLK 36
|
||||
#define MSVCRT_EDEADLOCK MSVCRT_EDEADLK
|
||||
#define MSVCRT_ENAMETOOLONG 38
|
||||
#define MSVCRT_ENOLCK 39
|
||||
#define MSVCRT_ENOSYS 40
|
||||
#define MSVCRT_ENOTEMPTY 41
|
||||
|
||||
#define MSVCRT_LC_ALL 0
|
||||
#define MSVCRT_LC_COLLATE 1
|
||||
#define MSVCRT_LC_CTYPE 2
|
||||
#define MSVCRT_LC_MONETARY 3
|
||||
#define MSVCRT_LC_NUMERIC 4
|
||||
#define MSVCRT_LC_TIME 5
|
||||
#define MSVCRT_LC_MIN MSVCRT_LC_ALL
|
||||
#define MSVCRT_LC_MAX MSVCRT_LC_TIME
|
||||
|
||||
#define MSVCRT__HEAPEMPTY -1
|
||||
#define MSVCRT__HEAPOK -2
|
||||
#define MSVCRT__HEAPBADBEGIN -3
|
||||
#define MSVCRT__HEAPBADNODE -4
|
||||
#define MSVCRT__HEAPEND -5
|
||||
#define MSVCRT__HEAPBADPTR -6
|
||||
|
||||
#define MSVCRT__FREEENTRY 0
|
||||
#define MSVCRT__USEDENTRY 1
|
||||
|
||||
#define MSVCRT__OUT_TO_DEFAULT 0
|
||||
#define MSVCRT__REPORT_ERRMODE 3
|
||||
|
||||
/* ASCII char classification table - binary compatible */
|
||||
#define MSVCRT__UPPER 0x0001 /* C1_UPPER */
|
||||
#define MSVCRT__LOWER 0x0002 /* C1_LOWER */
|
||||
#define MSVCRT__DIGIT 0x0004 /* C1_DIGIT */
|
||||
#define MSVCRT__SPACE 0x0008 /* C1_SPACE */
|
||||
#define MSVCRT__PUNCT 0x0010 /* C1_PUNCT */
|
||||
#define MSVCRT__CONTROL 0x0020 /* C1_CNTRL */
|
||||
#define MSVCRT__BLANK 0x0040 /* C1_BLANK */
|
||||
#define MSVCRT__HEX 0x0080 /* C1_XDIGIT */
|
||||
#define MSVCRT__LEADBYTE 0x8000
|
||||
#define MSVCRT__ALPHA (0x0100|MSVCRT__UPPER|MSVCRT__LOWER) /* (C1_ALPHA|_UPPER|_LOWER) */
|
||||
|
||||
#define MSVCRT__IOREAD 0x0001
|
||||
#define MSVCRT__IOWRT 0x0002
|
||||
#define MSVCRT__IOMYBUF 0x0008
|
||||
#define MSVCRT__IOEOF 0x0010
|
||||
#define MSVCRT__IOERR 0x0020
|
||||
#define MSVCRT__IOSTRG 0x0040
|
||||
#define MSVCRT__IORW 0x0080
|
||||
|
||||
#define MSVCRT__S_IEXEC 0x0040
|
||||
#define MSVCRT__S_IWRITE 0x0080
|
||||
#define MSVCRT__S_IREAD 0x0100
|
||||
#define MSVCRT__S_IFIFO 0x1000
|
||||
#define MSVCRT__S_IFCHR 0x2000
|
||||
#define MSVCRT__S_IFDIR 0x4000
|
||||
#define MSVCRT__S_IFREG 0x8000
|
||||
#define MSVCRT__S_IFMT 0xF000
|
||||
|
||||
#define MSVCRT__LK_UNLCK 0
|
||||
#define MSVCRT__LK_LOCK 1
|
||||
#define MSVCRT__LK_NBLCK 2
|
||||
#define MSVCRT__LK_RLCK 3
|
||||
#define MSVCRT__LK_NBRLCK 4
|
||||
|
||||
#define MSVCRT__SH_COMPAT 0x00 /* Compatibility */
|
||||
#define MSVCRT__SH_DENYRW 0x10 /* Deny read/write */
|
||||
#define MSVCRT__SH_DENYWR 0x20 /* Deny write */
|
||||
#define MSVCRT__SH_DENYRD 0x30 /* Deny read */
|
||||
#define MSVCRT__SH_DENYNO 0x40 /* Deny nothing */
|
||||
|
||||
#define MSVCRT__O_RDONLY 0
|
||||
#define MSVCRT__O_WRONLY 1
|
||||
#define MSVCRT__O_RDWR 2
|
||||
#define MSVCRT__O_ACCMODE (MSVCRT__O_RDONLY|MSVCRT__O_WRONLY|MSVCRT__O_RDWR)
|
||||
#define MSVCRT__O_APPEND 0x0008
|
||||
#define MSVCRT__O_RANDOM 0x0010
|
||||
#define MSVCRT__O_SEQUENTIAL 0x0020
|
||||
#define MSVCRT__O_TEMPORARY 0x0040
|
||||
#define MSVCRT__O_NOINHERIT 0x0080
|
||||
#define MSVCRT__O_CREAT 0x0100
|
||||
#define MSVCRT__O_TRUNC 0x0200
|
||||
#define MSVCRT__O_EXCL 0x0400
|
||||
#define MSVCRT__O_SHORT_LIVED 0x1000
|
||||
#define MSVCRT__O_TEXT 0x4000
|
||||
#define MSVCRT__O_BINARY 0x8000
|
||||
#define MSVCRT__O_RAW MSVCRT__O_BINARY
|
||||
|
||||
/* _statusfp bit flags */
|
||||
#define MSVCRT__SW_INEXACT 0x00000001 /* inexact (precision) */
|
||||
#define MSVCRT__SW_UNDERFLOW 0x00000002 /* underflow */
|
||||
#define MSVCRT__SW_OVERFLOW 0x00000004 /* overflow */
|
||||
#define MSVCRT__SW_ZERODIVIDE 0x00000008 /* zero divide */
|
||||
#define MSVCRT__SW_INVALID 0x00000010 /* invalid */
|
||||
|
||||
#define MSVCRT__SW_UNEMULATED 0x00000040 /* unemulated instruction */
|
||||
#define MSVCRT__SW_SQRTNEG 0x00000080 /* square root of a neg number */
|
||||
#define MSVCRT__SW_STACKOVERFLOW 0x00000200 /* FP stack overflow */
|
||||
#define MSVCRT__SW_STACKUNDERFLOW 0x00000400 /* FP stack underflow */
|
||||
|
||||
#define MSVCRT__SW_DENORMAL 0x00080000 /* denormal status bit */
|
||||
|
||||
/* fpclass constants */
|
||||
#define MSVCRT__FPCLASS_SNAN 0x0001 /* Signaling "Not a Number" */
|
||||
#define MSVCRT__FPCLASS_QNAN 0x0002 /* Quiet "Not a Number" */
|
||||
#define MSVCRT__FPCLASS_NINF 0x0004 /* Negative Infinity */
|
||||
#define MSVCRT__FPCLASS_NN 0x0008 /* Negative Normal */
|
||||
#define MSVCRT__FPCLASS_ND 0x0010 /* Negative Denormal */
|
||||
#define MSVCRT__FPCLASS_NZ 0x0020 /* Negative Zero */
|
||||
#define MSVCRT__FPCLASS_PZ 0x0040 /* Positive Zero */
|
||||
#define MSVCRT__FPCLASS_PD 0x0080 /* Positive Denormal */
|
||||
#define MSVCRT__FPCLASS_PN 0x0100 /* Positive Normal */
|
||||
#define MSVCRT__FPCLASS_PINF 0x0200 /* Positive Infinity */
|
||||
|
||||
#define MSVCRT__EM_INVALID 0x00000010
|
||||
#define MSVCRT__EM_DENORMAL 0x00080000
|
||||
#define MSVCRT__EM_ZERODIVIDE 0x00000008
|
||||
#define MSVCRT__EM_OVERFLOW 0x00000004
|
||||
#define MSVCRT__EM_UNDERFLOW 0x00000002
|
||||
#define MSVCRT__EM_INEXACT 0x00000001
|
||||
#define MSVCRT__IC_AFFINE 0x00040000
|
||||
#define MSVCRT__IC_PROJECTIVE 0x00000000
|
||||
#define MSVCRT__RC_CHOP 0x00000300
|
||||
#define MSVCRT__RC_UP 0x00000200
|
||||
#define MSVCRT__RC_DOWN 0x00000100
|
||||
#define MSVCRT__RC_NEAR 0x00000000
|
||||
#define MSVCRT__PC_24 0x00020000
|
||||
#define MSVCRT__PC_53 0x00010000
|
||||
#define MSVCRT__PC_64 0x00000000
|
||||
|
||||
void MSVCRT_free(void*);
|
||||
void* MSVCRT_malloc(MSVCRT_size_t);
|
||||
void* MSVCRT_calloc(MSVCRT_size_t,MSVCRT_size_t);
|
||||
void* MSVCRT_realloc(void*,MSVCRT_size_t);
|
||||
|
||||
int MSVCRT_iswalpha(MSVCRT_wint_t);
|
||||
int MSVCRT_iswspace(MSVCRT_wint_t);
|
||||
int MSVCRT_iswdigit(MSVCRT_wint_t);
|
||||
int MSVCRT_isleadbyte(int);
|
||||
|
||||
int MSVCRT_fgetc(MSVCRT_FILE*);
|
||||
int MSVCRT_ungetc(int,MSVCRT_FILE*);
|
||||
MSVCRT_wint_t MSVCRT_fgetwc(MSVCRT_FILE*);
|
||||
MSVCRT_wint_t MSVCRT_ungetwc(MSVCRT_wint_t,MSVCRT_FILE*);
|
||||
void MSVCRT__exit(int);
|
||||
void MSVCRT_abort();
|
||||
unsigned long* MSVCRT___doserrno(void);
|
||||
int* MSVCRT__errno(void);
|
||||
char* MSVCRT_getenv(const char*);
|
||||
char* MSVCRT_setlocale(int,const char*);
|
||||
int MSVCRT_fclose(MSVCRT_FILE*);
|
||||
void MSVCRT_terminate();
|
||||
MSVCRT_FILE* MSVCRT__p__iob(void);
|
||||
MSVCRT_time_t MSVCRT_time(MSVCRT_time_t*);
|
||||
|
||||
#ifndef __WINE_MSVCRT_TEST
|
||||
int _write(int,const void*,unsigned int);
|
||||
int _getch(void);
|
||||
int _vsnwprintf(MSVCRT_wchar_t*,MSVCRT_size_t,const MSVCRT_wchar_t*,va_list);
|
||||
int _ismbstrail(const unsigned char* start, const unsigned char* str);
|
||||
int _spawnve(int,const char*,const char* const *,const char* const *);
|
||||
void _searchenv(const char*,const char*,char*);
|
||||
int _getdrive(void);
|
||||
char* _strdup(const char*);
|
||||
char* _strnset(char*,int,MSVCRT_size_t);
|
||||
char* _strset(char*,int);
|
||||
int _ungetch(int);
|
||||
int _cputs(const char*);
|
||||
int _cprintf(const char*,...);
|
||||
int _snprintf(char*,size_t,const char*,...);
|
||||
char*** __p__environ(void);
|
||||
int* __p___mb_cur_max(void);
|
||||
unsigned int* __p__fmode(void);
|
||||
MSVCRT_wchar_t* _wcsdup(const MSVCRT_wchar_t*);
|
||||
MSVCRT_wchar_t*** __p__wenviron(void);
|
||||
#endif
|
||||
|
||||
/* FIXME: Functions that we forward to. They shouldn't be defined
|
||||
* here, but for now they're not declared in the standard headers.
|
||||
*/
|
||||
void _splitpath(const char*,char*,char*,char*,char*);
|
||||
char* _strlwr(char*);
|
||||
char* _strupr(char*);
|
||||
|
||||
#endif /* __WINE_MSVCRT_H */
|
||||
|
|
|
@ -137,8 +137,8 @@
|
|||
@ cdecl __threadhandle() kernel32.GetCurrentThread
|
||||
@ cdecl __threadid() kernel32.GetCurrentThreadId
|
||||
@ cdecl __toascii(long) MSVCRT___toascii
|
||||
@ cdecl __unDName(ptr str long ptr ptr long) MSVCRT___unDName
|
||||
@ cdecl __unDNameEx(ptr str long ptr ptr ptr long) MSVCRT___unDNameEx
|
||||
@ cdecl __unDName(ptr str long ptr ptr long)
|
||||
@ cdecl __unDNameEx(ptr str long ptr ptr ptr long)
|
||||
@ extern __unguarded_readlc_active MSVCRT___unguarded_readlc_active
|
||||
@ extern __wargv MSVCRT___wargv
|
||||
@ cdecl __wgetmainargs(ptr ptr ptr long ptr)
|
||||
|
@ -161,7 +161,7 @@
|
|||
@ cdecl _adj_fptan()
|
||||
@ cdecl _adjust_fdiv()
|
||||
@ extern _aexit_rtn
|
||||
@ cdecl _amsg_exit(long) MSVCRT__amsg_exit
|
||||
@ cdecl _amsg_exit(long)
|
||||
@ cdecl _assert(str str long) MSVCRT__assert
|
||||
@ stub _atodbl #(ptr str)
|
||||
@ cdecl -ret64 _atoi64(str) ntdll._atoi64
|
||||
|
@ -200,7 +200,7 @@
|
|||
@ cdecl _ecvt(double long ptr ptr)
|
||||
@ cdecl _endthread ()
|
||||
@ cdecl _endthreadex(long)
|
||||
@ extern _environ MSVCRT__environ
|
||||
@ extern _environ
|
||||
@ cdecl _eof(long)
|
||||
@ cdecl _errno() MSVCRT__errno
|
||||
@ cdecl _except_handler2(ptr ptr ptr ptr)
|
||||
|
@ -504,7 +504,7 @@
|
|||
@ cdecl _wcsset(wstr long)
|
||||
@ cdecl _wcsupr(wstr) ntdll._wcsupr
|
||||
@ stub _wctime #(ptr)
|
||||
@ extern _wenviron MSVCRT__wenviron
|
||||
@ extern _wenviron
|
||||
@ stub _wexecl #(wstr wstr) varargs
|
||||
@ stub _wexecle #(wstr wstr) varargs
|
||||
@ stub _wexeclp #(wstr wstr) varargs
|
||||
|
|
|
@ -30,13 +30,6 @@
|
|||
#include <stdarg.h>
|
||||
|
||||
#include "msvcrt.h"
|
||||
#include "msvcrt/errno.h"
|
||||
|
||||
#include "msvcrt/stdio.h"
|
||||
#include "msvcrt/process.h"
|
||||
#include "msvcrt/stdlib.h"
|
||||
#include "msvcrt/string.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
|
||||
|
@ -50,7 +43,7 @@ static int msvcrt_spawn(int flags, const char* exe, char* cmdline, char* env)
|
|||
if (sizeof(HANDLE) != sizeof(int))
|
||||
WARN("This call is unsuitable for your architecture\n");
|
||||
|
||||
if ((unsigned)flags > _P_DETACH)
|
||||
if ((unsigned)flags > MSVCRT__P_DETACH)
|
||||
{
|
||||
*MSVCRT__errno() = MSVCRT_EINVAL;
|
||||
return -1;
|
||||
|
@ -62,30 +55,30 @@ static int msvcrt_spawn(int flags, const char* exe, char* cmdline, char* env)
|
|||
si.cb = sizeof(si);
|
||||
|
||||
if (!CreateProcessA(exe, cmdline, NULL, NULL, TRUE,
|
||||
flags == _P_DETACH ? DETACHED_PROCESS : 0,
|
||||
flags == MSVCRT__P_DETACH ? DETACHED_PROCESS : 0,
|
||||
env, NULL, &si, &pi))
|
||||
{
|
||||
MSVCRT__set_errno(GetLastError());
|
||||
msvcrt_set_errno(GetLastError());
|
||||
return -1;
|
||||
}
|
||||
|
||||
switch(flags)
|
||||
{
|
||||
case _P_WAIT:
|
||||
case MSVCRT__P_WAIT:
|
||||
WaitForSingleObject(pi.hProcess, INFINITE);
|
||||
GetExitCodeProcess(pi.hProcess,&pi.dwProcessId);
|
||||
CloseHandle(pi.hProcess);
|
||||
CloseHandle(pi.hThread);
|
||||
return (int)pi.dwProcessId;
|
||||
case _P_DETACH:
|
||||
case MSVCRT__P_DETACH:
|
||||
CloseHandle(pi.hProcess);
|
||||
pi.hProcess = 0;
|
||||
/* fall through */
|
||||
case _P_NOWAIT:
|
||||
case _P_NOWAITO:
|
||||
case MSVCRT__P_NOWAIT:
|
||||
case MSVCRT__P_NOWAITO:
|
||||
CloseHandle(pi.hThread);
|
||||
return (int)pi.hProcess;
|
||||
case _P_OVERLAY:
|
||||
case MSVCRT__P_OVERLAY:
|
||||
MSVCRT__exit(0);
|
||||
}
|
||||
return -1; /* can't reach here */
|
||||
|
@ -218,7 +211,7 @@ int _cwait(int *status, int pid, int action)
|
|||
*MSVCRT___doserrno() = doserrno;
|
||||
}
|
||||
else
|
||||
MSVCRT__set_errno(doserrno);
|
||||
msvcrt_set_errno(doserrno);
|
||||
|
||||
return status ? *status = -1 : -1;
|
||||
}
|
||||
|
@ -239,7 +232,7 @@ int _execl(const char* name, const char* arg0, ...)
|
|||
args = msvcrt_valisttos(arg0, ap, ' ');
|
||||
va_end(ap);
|
||||
|
||||
ret = msvcrt_spawn(_P_OVERLAY, name, args, NULL);
|
||||
ret = msvcrt_spawn(MSVCRT__P_OVERLAY, name, args, NULL);
|
||||
MSVCRT_free(args);
|
||||
|
||||
return ret;
|
||||
|
@ -273,7 +266,7 @@ int _execlp(const char* name, const char* arg0, ...)
|
|||
args = msvcrt_valisttos(arg0, ap, ' ');
|
||||
va_end(ap);
|
||||
|
||||
ret = msvcrt_spawn(_P_OVERLAY, fullname[0] ? fullname : name, args, NULL);
|
||||
ret = msvcrt_spawn(MSVCRT__P_OVERLAY, fullname[0] ? fullname : name, args, NULL);
|
||||
MSVCRT_free(args);
|
||||
|
||||
return ret;
|
||||
|
@ -296,7 +289,7 @@ int _execlpe(const char* name, const char* arg0, ...)
|
|||
*/
|
||||
int _execv(const char* name, char* const* argv)
|
||||
{
|
||||
return _spawnve(_P_OVERLAY, name, (const char* const*) argv, NULL);
|
||||
return _spawnve(MSVCRT__P_OVERLAY, name, (const char* const*) argv, NULL);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
@ -307,7 +300,7 @@ int _execv(const char* name, char* const* argv)
|
|||
*/
|
||||
int _execve(const char* name, char* const* argv, const char* const* envv)
|
||||
{
|
||||
return _spawnve(_P_OVERLAY, name, (const char* const*) argv, envv);
|
||||
return _spawnve(MSVCRT__P_OVERLAY, name, (const char* const*) argv, envv);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
@ -321,7 +314,7 @@ int _execvpe(const char* name, char* const* argv, const char* const* envv)
|
|||
char fullname[MAX_PATH];
|
||||
|
||||
_searchenv(name, "PATH", fullname);
|
||||
return _spawnve(_P_OVERLAY, fullname[0] ? fullname : name,
|
||||
return _spawnve(MSVCRT__P_OVERLAY, fullname[0] ? fullname : name,
|
||||
(const char* const*) argv, envv);
|
||||
}
|
||||
|
||||
|
@ -504,7 +497,7 @@ int MSVCRT_system(const char* cmd)
|
|||
/* Make a writable copy for CreateProcess */
|
||||
cmdcopy=_strdup(cmd);
|
||||
/* FIXME: should probably launch cmd interpreter in COMSPEC */
|
||||
res=msvcrt_spawn(_P_WAIT, NULL, cmdcopy, NULL);
|
||||
res=msvcrt_spawn(MSVCRT__P_WAIT, NULL, cmdcopy, NULL);
|
||||
MSVCRT_free(cmdcopy);
|
||||
return res;
|
||||
}
|
||||
|
@ -527,7 +520,7 @@ int _unloaddll(int dll)
|
|||
else
|
||||
{
|
||||
int err = GetLastError();
|
||||
MSVCRT__set_errno(err);
|
||||
msvcrt_set_errno(err);
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,10 +30,6 @@
|
|||
#include "winreg.h"
|
||||
#include "winternl.h"
|
||||
#include "msvcrt.h"
|
||||
#include "msvcrt/conio.h"
|
||||
#include "msvcrt/io.h"
|
||||
#include "msvcrt/stdio.h"
|
||||
#include "msvcrt/wctype.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
|
||||
|
|
|
@ -22,9 +22,6 @@
|
|||
*/
|
||||
|
||||
#include "msvcrt.h"
|
||||
#include "msvcrt/stdlib.h"
|
||||
#include "msvcrt/string.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
Makefile
|
||||
cpp.ok
|
||||
file.ok
|
||||
headers.ok
|
||||
heap.ok
|
||||
scanf.ok
|
||||
string.ok
|
||||
|
|
|
@ -4,11 +4,12 @@ SRCDIR = @srcdir@
|
|||
VPATH = @srcdir@
|
||||
TESTDLL = msvcrt.dll
|
||||
IMPORTS = msvcrt
|
||||
EXTRAINCL = -I$(TOPSRCDIR)/include/msvcrt
|
||||
EXTRAINCL = -I$(TOPSRCDIR)/include/msvcrt -I$(SRCDIR)/..
|
||||
|
||||
CTESTS = \
|
||||
cpp.c \
|
||||
file.c \
|
||||
headers.c \
|
||||
heap.c \
|
||||
scanf.c \
|
||||
string.c \
|
||||
|
|
|
@ -0,0 +1,451 @@
|
|||
/*
|
||||
* Copyright 2004 Dimitrie O. Paun
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* This file contains tests to ensure consystencies between symbols
|
||||
* defined in the msvcrt headers, and corresponding duplciated
|
||||
* symbol defined in msvcrt.h (prefixed by MSVCRT_).
|
||||
*/
|
||||
|
||||
#define __WINE_MSVCRT_TEST
|
||||
#include "dos.h"
|
||||
#include "math.h"
|
||||
#include "stdlib.h"
|
||||
#include "eh.h"
|
||||
#include "io.h"
|
||||
#include "errno.h"
|
||||
#include "unistd.h"
|
||||
#include "fcntl.h"
|
||||
#include "malloc.h"
|
||||
#include "limits.h"
|
||||
#include "mbctype.h"
|
||||
#include "stdio.h"
|
||||
#include "wchar.h"
|
||||
#include "ctype.h"
|
||||
#include "crtdbg.h"
|
||||
#include "share.h"
|
||||
#include "search.h"
|
||||
#include "wctype.h"
|
||||
#include "float.h"
|
||||
#include "stddef.h"
|
||||
#include "mbstring.h"
|
||||
#include "sys/unistd.h"
|
||||
#include "sys/locking.h"
|
||||
#include "sys/utime.h"
|
||||
#include "sys/types.h"
|
||||
#include "sys/stat.h"
|
||||
#include "sys/timeb.h"
|
||||
#include "direct.h"
|
||||
#include "conio.h"
|
||||
#include "dirent.h"
|
||||
#include "process.h"
|
||||
#include "string.h"
|
||||
#include "time.h"
|
||||
#include "locale.h"
|
||||
#include "setjmp.h"
|
||||
#include "msvcrt.h"
|
||||
#include "wine/test.h"
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define TYPEOF(type) typeof(type)
|
||||
#else
|
||||
#define TYPEOF(type) int
|
||||
#endif
|
||||
#define MSVCRT(x) MSVCRT_##x
|
||||
#define OFFSET(T,F) ((unsigned int)((char *)&((struct T *)0L)->F - (char *)0L))
|
||||
#define CHECK_SIZE(e) ok(sizeof(e) == sizeof(MSVCRT(e)), "Element has different sizes\n")
|
||||
#define CHECK_TYPE(t) { TYPEOF(t) a = 0; TYPEOF(MSVCRT(t)) b = 0; a = b; CHECK_SIZE(t); }
|
||||
#define CHECK_STRUCT(s) ok(sizeof(struct s) == sizeof(struct MSVCRT(s)), "Struct has different sizes\n")
|
||||
#define CHECK_FIELD(s,e) ok(OFFSET(s,e) == OFFSET(MSVCRT(s),e), "Bad offset\n")
|
||||
#define CHECK_DEF(n,d1,d2) ok(d1 == d2, "Defines (MSVCRT_)%s are different: '%d' vs. '%d'\n", n, d1, d2)
|
||||
|
||||
/************* Checking types ***************/
|
||||
void test_types()
|
||||
{
|
||||
CHECK_TYPE(wchar_t);
|
||||
CHECK_TYPE(wint_t);
|
||||
CHECK_TYPE(wctype_t);
|
||||
CHECK_TYPE(_ino_t);
|
||||
CHECK_TYPE(_fsize_t);
|
||||
CHECK_TYPE(size_t);
|
||||
CHECK_TYPE(_dev_t);
|
||||
CHECK_TYPE(_off_t);
|
||||
CHECK_TYPE(clock_t);
|
||||
CHECK_TYPE(time_t);
|
||||
CHECK_TYPE(fpos_t);
|
||||
CHECK_SIZE(FILE);
|
||||
CHECK_TYPE(terminate_handler);
|
||||
CHECK_TYPE(terminate_function);
|
||||
CHECK_TYPE(unexpected_handler);
|
||||
CHECK_TYPE(unexpected_function);
|
||||
CHECK_TYPE(_se_translator_function);
|
||||
CHECK_TYPE(_beginthread_start_routine_t);
|
||||
CHECK_TYPE(_onexit_t);
|
||||
}
|
||||
|
||||
/************* Checking structs ***************/
|
||||
void test_structs()
|
||||
{
|
||||
CHECK_STRUCT(tm);
|
||||
CHECK_FIELD(tm, tm_sec);
|
||||
CHECK_FIELD(tm, tm_min);
|
||||
CHECK_FIELD(tm, tm_hour);
|
||||
CHECK_FIELD(tm, tm_mday);
|
||||
CHECK_FIELD(tm, tm_mon);
|
||||
CHECK_FIELD(tm, tm_year);
|
||||
CHECK_FIELD(tm, tm_wday);
|
||||
CHECK_FIELD(tm, tm_yday);
|
||||
CHECK_FIELD(tm, tm_isdst);
|
||||
CHECK_STRUCT(_timeb);
|
||||
CHECK_FIELD(_timeb, time);
|
||||
CHECK_FIELD(_timeb, millitm);
|
||||
CHECK_FIELD(_timeb, timezone);
|
||||
CHECK_FIELD(_timeb, dstflag);
|
||||
CHECK_STRUCT(_iobuf);
|
||||
CHECK_FIELD(_iobuf, _ptr);
|
||||
CHECK_FIELD(_iobuf, _cnt);
|
||||
CHECK_FIELD(_iobuf, _base);
|
||||
CHECK_FIELD(_iobuf, _flag);
|
||||
CHECK_FIELD(_iobuf, _file);
|
||||
CHECK_FIELD(_iobuf, _charbuf);
|
||||
CHECK_FIELD(_iobuf, _bufsiz);
|
||||
CHECK_FIELD(_iobuf, _tmpfname);
|
||||
CHECK_STRUCT(lconv);
|
||||
CHECK_FIELD(lconv, decimal_point);
|
||||
CHECK_FIELD(lconv, thousands_sep);
|
||||
CHECK_FIELD(lconv, grouping);
|
||||
CHECK_FIELD(lconv, int_curr_symbol);
|
||||
CHECK_FIELD(lconv, currency_symbol);
|
||||
CHECK_FIELD(lconv, mon_decimal_point);
|
||||
CHECK_FIELD(lconv, mon_thousands_sep);
|
||||
CHECK_FIELD(lconv, mon_grouping);
|
||||
CHECK_FIELD(lconv, positive_sign);
|
||||
CHECK_FIELD(lconv, negative_sign);
|
||||
CHECK_FIELD(lconv, int_frac_digits);
|
||||
CHECK_FIELD(lconv, frac_digits);
|
||||
CHECK_FIELD(lconv, p_cs_precedes);
|
||||
CHECK_FIELD(lconv, p_sep_by_space);
|
||||
CHECK_FIELD(lconv, n_cs_precedes);
|
||||
CHECK_FIELD(lconv, n_sep_by_space);
|
||||
CHECK_FIELD(lconv, p_sign_posn);
|
||||
CHECK_FIELD(lconv, n_sign_posn);
|
||||
CHECK_STRUCT(_exception);
|
||||
CHECK_FIELD(_exception, type);
|
||||
CHECK_FIELD(_exception, name);
|
||||
CHECK_FIELD(_exception, arg1);
|
||||
CHECK_FIELD(_exception, arg2);
|
||||
CHECK_FIELD(_exception, retval);
|
||||
CHECK_STRUCT(_complex);
|
||||
CHECK_FIELD(_complex, x);
|
||||
CHECK_FIELD(_complex, y);
|
||||
CHECK_STRUCT(_heapinfo);
|
||||
CHECK_FIELD(_heapinfo, _pentry);
|
||||
CHECK_FIELD(_heapinfo, _size);
|
||||
CHECK_FIELD(_heapinfo, _useflag);
|
||||
CHECK_STRUCT(__JUMP_BUFFER);
|
||||
CHECK_FIELD(__JUMP_BUFFER, Ebp);
|
||||
CHECK_FIELD(__JUMP_BUFFER, Ebx);
|
||||
CHECK_FIELD(__JUMP_BUFFER, Edi);
|
||||
CHECK_FIELD(__JUMP_BUFFER, Esi);
|
||||
CHECK_FIELD(__JUMP_BUFFER, Esp);
|
||||
CHECK_FIELD(__JUMP_BUFFER, Eip);
|
||||
CHECK_FIELD(__JUMP_BUFFER, Registration);
|
||||
CHECK_FIELD(__JUMP_BUFFER, TryLevel);
|
||||
CHECK_FIELD(__JUMP_BUFFER, Cookie);
|
||||
CHECK_FIELD(__JUMP_BUFFER, UnwindFunc);
|
||||
CHECK_FIELD(__JUMP_BUFFER, UnwindData[6]);
|
||||
CHECK_STRUCT(_diskfree_t);
|
||||
CHECK_FIELD(_diskfree_t, total_clusters);
|
||||
CHECK_FIELD(_diskfree_t, avail_clusters);
|
||||
CHECK_FIELD(_diskfree_t, sectors_per_cluster);
|
||||
CHECK_FIELD(_diskfree_t, bytes_per_sector);
|
||||
CHECK_STRUCT(_finddata_t);
|
||||
CHECK_FIELD(_finddata_t, attrib);
|
||||
CHECK_FIELD(_finddata_t, time_create);
|
||||
CHECK_FIELD(_finddata_t, time_access);
|
||||
CHECK_FIELD(_finddata_t, time_write);
|
||||
CHECK_FIELD(_finddata_t, size);
|
||||
CHECK_FIELD(_finddata_t, name[260]);
|
||||
CHECK_STRUCT(_finddatai64_t);
|
||||
CHECK_FIELD(_finddatai64_t, attrib);
|
||||
CHECK_FIELD(_finddatai64_t, time_create);
|
||||
CHECK_FIELD(_finddatai64_t, time_access);
|
||||
CHECK_FIELD(_finddatai64_t, time_write);
|
||||
CHECK_FIELD(_finddatai64_t, size);
|
||||
CHECK_FIELD(_finddatai64_t, name[260]);
|
||||
CHECK_STRUCT(_wfinddata_t);
|
||||
CHECK_FIELD(_wfinddata_t, attrib);
|
||||
CHECK_FIELD(_wfinddata_t, time_create);
|
||||
CHECK_FIELD(_wfinddata_t, time_access);
|
||||
CHECK_FIELD(_wfinddata_t, time_write);
|
||||
CHECK_FIELD(_wfinddata_t, size);
|
||||
CHECK_FIELD(_wfinddata_t, name[260]);
|
||||
CHECK_STRUCT(_wfinddatai64_t);
|
||||
CHECK_FIELD(_wfinddatai64_t, attrib);
|
||||
CHECK_FIELD(_wfinddatai64_t, time_create);
|
||||
CHECK_FIELD(_wfinddatai64_t, time_access);
|
||||
CHECK_FIELD(_wfinddatai64_t, time_write);
|
||||
CHECK_FIELD(_wfinddatai64_t, size);
|
||||
CHECK_FIELD(_wfinddatai64_t, name[260]);
|
||||
CHECK_STRUCT(_utimbuf);
|
||||
CHECK_FIELD(_utimbuf, actime);
|
||||
CHECK_FIELD(_utimbuf, modtime);
|
||||
CHECK_STRUCT(_stat);
|
||||
CHECK_FIELD(_stat, st_dev);
|
||||
CHECK_FIELD(_stat, st_ino);
|
||||
CHECK_FIELD(_stat, st_mode);
|
||||
CHECK_FIELD(_stat, st_nlink);
|
||||
CHECK_FIELD(_stat, st_uid);
|
||||
CHECK_FIELD(_stat, st_gid);
|
||||
CHECK_FIELD(_stat, st_rdev);
|
||||
CHECK_FIELD(_stat, st_size);
|
||||
CHECK_FIELD(_stat, st_atime);
|
||||
CHECK_FIELD(_stat, st_mtime);
|
||||
CHECK_FIELD(_stat, st_ctime);
|
||||
CHECK_FIELD(_stat, st_dev);
|
||||
CHECK_FIELD(_stat, st_ino);
|
||||
CHECK_FIELD(_stat, st_mode);
|
||||
CHECK_FIELD(_stat, st_nlink);
|
||||
CHECK_FIELD(_stat, st_uid);
|
||||
CHECK_FIELD(_stat, st_gid);
|
||||
CHECK_FIELD(_stat, st_rdev);
|
||||
CHECK_FIELD(_stat, st_size);
|
||||
CHECK_FIELD(_stat, st_atime);
|
||||
CHECK_FIELD(_stat, st_mtime);
|
||||
CHECK_FIELD(_stat, st_ctime);
|
||||
CHECK_FIELD(_stat, st_dev);
|
||||
CHECK_FIELD(_stat, st_ino);
|
||||
CHECK_FIELD(_stat, st_mode);
|
||||
CHECK_FIELD(_stat, st_nlink);
|
||||
CHECK_FIELD(_stat, st_uid);
|
||||
CHECK_FIELD(_stat, st_gid);
|
||||
CHECK_FIELD(_stat, st_rdev);
|
||||
CHECK_FIELD(_stat, st_size);
|
||||
CHECK_FIELD(_stat, st_atime);
|
||||
CHECK_FIELD(_stat, st_mtime);
|
||||
CHECK_FIELD(_stat, st_ctime);
|
||||
CHECK_STRUCT(stat);
|
||||
CHECK_FIELD(stat, st_dev);
|
||||
CHECK_FIELD(stat, st_ino);
|
||||
CHECK_FIELD(stat, st_mode);
|
||||
CHECK_FIELD(stat, st_nlink);
|
||||
CHECK_FIELD(stat, st_uid);
|
||||
CHECK_FIELD(stat, st_gid);
|
||||
CHECK_FIELD(stat, st_rdev);
|
||||
CHECK_FIELD(stat, st_size);
|
||||
CHECK_FIELD(stat, st_atime);
|
||||
CHECK_FIELD(stat, st_mtime);
|
||||
CHECK_FIELD(stat, st_ctime);
|
||||
CHECK_FIELD(stat, st_dev);
|
||||
CHECK_FIELD(stat, st_ino);
|
||||
CHECK_FIELD(stat, st_mode);
|
||||
CHECK_FIELD(stat, st_nlink);
|
||||
CHECK_FIELD(stat, st_uid);
|
||||
CHECK_FIELD(stat, st_gid);
|
||||
CHECK_FIELD(stat, st_rdev);
|
||||
CHECK_FIELD(stat, st_size);
|
||||
CHECK_FIELD(stat, st_atime);
|
||||
CHECK_FIELD(stat, st_mtime);
|
||||
CHECK_FIELD(stat, st_ctime);
|
||||
CHECK_FIELD(stat, st_dev);
|
||||
CHECK_FIELD(stat, st_ino);
|
||||
CHECK_FIELD(stat, st_mode);
|
||||
CHECK_FIELD(stat, st_nlink);
|
||||
CHECK_FIELD(stat, st_uid);
|
||||
CHECK_FIELD(stat, st_gid);
|
||||
CHECK_FIELD(stat, st_rdev);
|
||||
CHECK_FIELD(stat, st_size);
|
||||
CHECK_FIELD(stat, st_atime);
|
||||
CHECK_FIELD(stat, st_mtime);
|
||||
CHECK_FIELD(stat, st_ctime);
|
||||
CHECK_STRUCT(_stati64);
|
||||
CHECK_FIELD(_stati64, st_dev);
|
||||
CHECK_FIELD(_stati64, st_ino);
|
||||
CHECK_FIELD(_stati64, st_mode);
|
||||
CHECK_FIELD(_stati64, st_nlink);
|
||||
CHECK_FIELD(_stati64, st_uid);
|
||||
CHECK_FIELD(_stati64, st_gid);
|
||||
CHECK_FIELD(_stati64, st_rdev);
|
||||
CHECK_FIELD(_stati64, st_size);
|
||||
CHECK_FIELD(_stati64, st_atime);
|
||||
CHECK_FIELD(_stati64, st_mtime);
|
||||
CHECK_FIELD(_stati64, st_ctime);
|
||||
}
|
||||
|
||||
/************* Checking defines ***************/
|
||||
void test_defines()
|
||||
{
|
||||
CHECK_DEF("WEOF", WEOF, MSVCRT_WEOF);
|
||||
CHECK_DEF("EOF", EOF, MSVCRT_EOF);
|
||||
CHECK_DEF("TMP_MAX", TMP_MAX, MSVCRT_TMP_MAX);
|
||||
CHECK_DEF("BUFSIZ", BUFSIZ, MSVCRT_BUFSIZ);
|
||||
CHECK_DEF("STDIN_FILENO", STDIN_FILENO, MSVCRT_STDIN_FILENO);
|
||||
CHECK_DEF("STDOUT_FILENO", STDOUT_FILENO, MSVCRT_STDOUT_FILENO);
|
||||
CHECK_DEF("STDERR_FILENO", STDERR_FILENO, MSVCRT_STDERR_FILENO);
|
||||
CHECK_DEF("_IOFBF", _IOFBF, MSVCRT__IOFBF);
|
||||
CHECK_DEF("_IONBF", _IONBF, MSVCRT__IONBF);
|
||||
CHECK_DEF("_IOLBF", _IOLBF, MSVCRT__IOLBF);
|
||||
CHECK_DEF("FILENAME_MAX", FILENAME_MAX, MSVCRT_FILENAME_MAX);
|
||||
CHECK_DEF("_P_WAIT", _P_WAIT, MSVCRT__P_WAIT);
|
||||
CHECK_DEF("_P_NOWAIT", _P_NOWAIT, MSVCRT__P_NOWAIT);
|
||||
CHECK_DEF("_P_OVERLAY", _P_OVERLAY, MSVCRT__P_OVERLAY);
|
||||
CHECK_DEF("_P_NOWAITO", _P_NOWAITO, MSVCRT__P_NOWAITO);
|
||||
CHECK_DEF("_P_DETACH", _P_DETACH, MSVCRT__P_DETACH);
|
||||
CHECK_DEF("EPERM", EPERM, MSVCRT_EPERM);
|
||||
CHECK_DEF("ENOENT", ENOENT, MSVCRT_ENOENT);
|
||||
CHECK_DEF("ESRCH", ESRCH, MSVCRT_ESRCH);
|
||||
CHECK_DEF("EINTR", EINTR, MSVCRT_EINTR);
|
||||
CHECK_DEF("EIO", EIO, MSVCRT_EIO);
|
||||
CHECK_DEF("ENXIO", ENXIO, MSVCRT_ENXIO);
|
||||
CHECK_DEF("E2BIG", E2BIG, MSVCRT_E2BIG);
|
||||
CHECK_DEF("ENOEXEC", ENOEXEC, MSVCRT_ENOEXEC);
|
||||
CHECK_DEF("EBADF", EBADF, MSVCRT_EBADF);
|
||||
CHECK_DEF("ECHILD", ECHILD, MSVCRT_ECHILD);
|
||||
CHECK_DEF("EAGAIN", EAGAIN, MSVCRT_EAGAIN);
|
||||
CHECK_DEF("ENOMEM", ENOMEM, MSVCRT_ENOMEM);
|
||||
CHECK_DEF("EACCES", EACCES, MSVCRT_EACCES);
|
||||
CHECK_DEF("EFAULT", EFAULT, MSVCRT_EFAULT);
|
||||
CHECK_DEF("EBUSY", EBUSY, MSVCRT_EBUSY);
|
||||
CHECK_DEF("EEXIST", EEXIST, MSVCRT_EEXIST);
|
||||
CHECK_DEF("EXDEV", EXDEV, MSVCRT_EXDEV);
|
||||
CHECK_DEF("ENODEV", ENODEV, MSVCRT_ENODEV);
|
||||
CHECK_DEF("ENOTDIR", ENOTDIR, MSVCRT_ENOTDIR);
|
||||
CHECK_DEF("EISDIR", EISDIR, MSVCRT_EISDIR);
|
||||
CHECK_DEF("EINVAL", EINVAL, MSVCRT_EINVAL);
|
||||
CHECK_DEF("ENFILE", ENFILE, MSVCRT_ENFILE);
|
||||
CHECK_DEF("EMFILE", EMFILE, MSVCRT_EMFILE);
|
||||
CHECK_DEF("ENOTTY", ENOTTY, MSVCRT_ENOTTY);
|
||||
CHECK_DEF("EFBIG", EFBIG, MSVCRT_EFBIG);
|
||||
CHECK_DEF("ENOSPC", ENOSPC, MSVCRT_ENOSPC);
|
||||
CHECK_DEF("ESPIPE", ESPIPE, MSVCRT_ESPIPE);
|
||||
CHECK_DEF("EROFS", EROFS, MSVCRT_EROFS);
|
||||
CHECK_DEF("EMLINK", EMLINK, MSVCRT_EMLINK);
|
||||
CHECK_DEF("EPIPE", EPIPE, MSVCRT_EPIPE);
|
||||
CHECK_DEF("EDOM", EDOM, MSVCRT_EDOM);
|
||||
CHECK_DEF("ERANGE", ERANGE, MSVCRT_ERANGE);
|
||||
CHECK_DEF("EDEADLK", EDEADLK, MSVCRT_EDEADLK);
|
||||
CHECK_DEF("EDEADLOCK", EDEADLOCK, MSVCRT_EDEADLOCK);
|
||||
CHECK_DEF("ENAMETOOLONG", ENAMETOOLONG, MSVCRT_ENAMETOOLONG);
|
||||
CHECK_DEF("ENOLCK", ENOLCK, MSVCRT_ENOLCK);
|
||||
CHECK_DEF("ENOSYS", ENOSYS, MSVCRT_ENOSYS);
|
||||
CHECK_DEF("ENOTEMPTY", ENOTEMPTY, MSVCRT_ENOTEMPTY);
|
||||
CHECK_DEF("LC_ALL", LC_ALL, MSVCRT_LC_ALL);
|
||||
CHECK_DEF("LC_COLLATE", LC_COLLATE, MSVCRT_LC_COLLATE);
|
||||
CHECK_DEF("LC_CTYPE", LC_CTYPE, MSVCRT_LC_CTYPE);
|
||||
CHECK_DEF("LC_MONETARY", LC_MONETARY, MSVCRT_LC_MONETARY);
|
||||
CHECK_DEF("LC_NUMERIC", LC_NUMERIC, MSVCRT_LC_NUMERIC);
|
||||
CHECK_DEF("LC_TIME", LC_TIME, MSVCRT_LC_TIME);
|
||||
CHECK_DEF("LC_MIN", LC_MIN, MSVCRT_LC_MIN);
|
||||
CHECK_DEF("LC_MAX", LC_MAX, MSVCRT_LC_MAX);
|
||||
CHECK_DEF("_HEAPEMPTY", _HEAPEMPTY, MSVCRT__HEAPEMPTY);
|
||||
CHECK_DEF("_HEAPOK", _HEAPOK, MSVCRT__HEAPOK);
|
||||
CHECK_DEF("_HEAPBADBEGIN", _HEAPBADBEGIN, MSVCRT__HEAPBADBEGIN);
|
||||
CHECK_DEF("_HEAPBADNODE", _HEAPBADNODE, MSVCRT__HEAPBADNODE);
|
||||
CHECK_DEF("_HEAPEND", _HEAPEND, MSVCRT__HEAPEND);
|
||||
CHECK_DEF("_HEAPBADPTR", _HEAPBADPTR, MSVCRT__HEAPBADPTR);
|
||||
CHECK_DEF("_FREEENTRY", _FREEENTRY, MSVCRT__FREEENTRY);
|
||||
CHECK_DEF("_USEDENTRY", _USEDENTRY, MSVCRT__USEDENTRY);
|
||||
CHECK_DEF("_OUT_TO_DEFAULT", _OUT_TO_DEFAULT, MSVCRT__OUT_TO_DEFAULT);
|
||||
CHECK_DEF("_REPORT_ERRMODE", _REPORT_ERRMODE, MSVCRT__REPORT_ERRMODE);
|
||||
CHECK_DEF("_UPPER", _UPPER, MSVCRT__UPPER);
|
||||
CHECK_DEF("_LOWER", _LOWER, MSVCRT__LOWER);
|
||||
CHECK_DEF("_DIGIT", _DIGIT, MSVCRT__DIGIT);
|
||||
CHECK_DEF("_SPACE", _SPACE, MSVCRT__SPACE);
|
||||
CHECK_DEF("_PUNCT", _PUNCT, MSVCRT__PUNCT);
|
||||
CHECK_DEF("_CONTROL", _CONTROL, MSVCRT__CONTROL);
|
||||
CHECK_DEF("_BLANK", _BLANK, MSVCRT__BLANK);
|
||||
CHECK_DEF("_HEX", _HEX, MSVCRT__HEX);
|
||||
CHECK_DEF("_LEADBYTE", _LEADBYTE, MSVCRT__LEADBYTE);
|
||||
CHECK_DEF("_ALPHA", _ALPHA, MSVCRT__ALPHA);
|
||||
CHECK_DEF("_IOREAD", _IOREAD, MSVCRT__IOREAD);
|
||||
CHECK_DEF("_IOWRT", _IOWRT, MSVCRT__IOWRT);
|
||||
CHECK_DEF("_IOMYBUF", _IOMYBUF, MSVCRT__IOMYBUF);
|
||||
CHECK_DEF("_IOEOF", _IOEOF, MSVCRT__IOEOF);
|
||||
CHECK_DEF("_IOERR", _IOERR, MSVCRT__IOERR);
|
||||
CHECK_DEF("_IOSTRG", _IOSTRG, MSVCRT__IOSTRG);
|
||||
CHECK_DEF("_IORW", _IORW, MSVCRT__IORW);
|
||||
CHECK_DEF("_S_IEXEC", _S_IEXEC, MSVCRT__S_IEXEC);
|
||||
CHECK_DEF("_S_IWRITE", _S_IWRITE, MSVCRT__S_IWRITE);
|
||||
CHECK_DEF("_S_IREAD", _S_IREAD, MSVCRT__S_IREAD);
|
||||
CHECK_DEF("_S_IFIFO", _S_IFIFO, MSVCRT__S_IFIFO);
|
||||
CHECK_DEF("_S_IFCHR", _S_IFCHR, MSVCRT__S_IFCHR);
|
||||
CHECK_DEF("_S_IFDIR", _S_IFDIR, MSVCRT__S_IFDIR);
|
||||
CHECK_DEF("_S_IFREG", _S_IFREG, MSVCRT__S_IFREG);
|
||||
CHECK_DEF("_S_IFMT", _S_IFMT, MSVCRT__S_IFMT);
|
||||
CHECK_DEF("_LK_UNLCK", _LK_UNLCK, MSVCRT__LK_UNLCK);
|
||||
CHECK_DEF("_LK_LOCK", _LK_LOCK, MSVCRT__LK_LOCK);
|
||||
CHECK_DEF("_LK_NBLCK", _LK_NBLCK, MSVCRT__LK_NBLCK);
|
||||
CHECK_DEF("_LK_RLCK", _LK_RLCK, MSVCRT__LK_RLCK);
|
||||
CHECK_DEF("_LK_NBRLCK", _LK_NBRLCK, MSVCRT__LK_NBRLCK);
|
||||
CHECK_DEF("_O_RDONLY", _O_RDONLY, MSVCRT__O_RDONLY);
|
||||
CHECK_DEF("_O_WRONLY", _O_WRONLY, MSVCRT__O_WRONLY);
|
||||
CHECK_DEF("_O_RDWR", _O_RDWR, MSVCRT__O_RDWR);
|
||||
CHECK_DEF("_O_ACCMODE", _O_ACCMODE, MSVCRT__O_ACCMODE);
|
||||
CHECK_DEF("_O_APPEND", _O_APPEND, MSVCRT__O_APPEND);
|
||||
CHECK_DEF("_O_RANDOM", _O_RANDOM, MSVCRT__O_RANDOM);
|
||||
CHECK_DEF("_O_SEQUENTIAL", _O_SEQUENTIAL, MSVCRT__O_SEQUENTIAL);
|
||||
CHECK_DEF("_O_TEMPORARY", _O_TEMPORARY, MSVCRT__O_TEMPORARY);
|
||||
CHECK_DEF("_O_NOINHERIT", _O_NOINHERIT, MSVCRT__O_NOINHERIT);
|
||||
CHECK_DEF("_O_CREAT", _O_CREAT, MSVCRT__O_CREAT);
|
||||
CHECK_DEF("_O_TRUNC", _O_TRUNC, MSVCRT__O_TRUNC);
|
||||
CHECK_DEF("_O_EXCL", _O_EXCL, MSVCRT__O_EXCL);
|
||||
CHECK_DEF("_O_SHORT_LIVED", _O_SHORT_LIVED, MSVCRT__O_SHORT_LIVED);
|
||||
CHECK_DEF("_O_TEXT", _O_TEXT, MSVCRT__O_TEXT);
|
||||
CHECK_DEF("_O_BINARY", _O_BINARY, MSVCRT__O_BINARY);
|
||||
CHECK_DEF("_O_RAW", _O_RAW, MSVCRT__O_RAW);
|
||||
CHECK_DEF("_SW_INEXACT", _SW_INEXACT, MSVCRT__SW_INEXACT);
|
||||
CHECK_DEF("_SW_UNDERFLOW", _SW_UNDERFLOW, MSVCRT__SW_UNDERFLOW);
|
||||
CHECK_DEF("_SW_OVERFLOW", _SW_OVERFLOW, MSVCRT__SW_OVERFLOW);
|
||||
CHECK_DEF("_SW_ZERODIVIDE", _SW_ZERODIVIDE, MSVCRT__SW_ZERODIVIDE);
|
||||
CHECK_DEF("_SW_INVALID", _SW_INVALID, MSVCRT__SW_INVALID);
|
||||
CHECK_DEF("_SW_UNEMULATED", _SW_UNEMULATED, MSVCRT__SW_UNEMULATED);
|
||||
CHECK_DEF("_SW_SQRTNEG", _SW_SQRTNEG, MSVCRT__SW_SQRTNEG);
|
||||
CHECK_DEF("_SW_STACKOVERFLOW", _SW_STACKOVERFLOW, MSVCRT__SW_STACKOVERFLOW);
|
||||
CHECK_DEF("_SW_STACKUNDERFLOW", _SW_STACKUNDERFLOW, MSVCRT__SW_STACKUNDERFLOW);
|
||||
CHECK_DEF("_SW_DENORMAL", _SW_DENORMAL, MSVCRT__SW_DENORMAL);
|
||||
CHECK_DEF("_FPCLASS_SNAN", _FPCLASS_SNAN, MSVCRT__FPCLASS_SNAN);
|
||||
CHECK_DEF("_FPCLASS_QNAN", _FPCLASS_QNAN, MSVCRT__FPCLASS_QNAN);
|
||||
CHECK_DEF("_FPCLASS_NINF", _FPCLASS_NINF, MSVCRT__FPCLASS_NINF);
|
||||
CHECK_DEF("_FPCLASS_NN", _FPCLASS_NN, MSVCRT__FPCLASS_NN);
|
||||
CHECK_DEF("_FPCLASS_ND", _FPCLASS_ND, MSVCRT__FPCLASS_ND);
|
||||
CHECK_DEF("_FPCLASS_NZ", _FPCLASS_NZ, MSVCRT__FPCLASS_NZ);
|
||||
CHECK_DEF("_FPCLASS_PZ", _FPCLASS_PZ, MSVCRT__FPCLASS_PZ);
|
||||
CHECK_DEF("_FPCLASS_PD", _FPCLASS_PD, MSVCRT__FPCLASS_PD);
|
||||
CHECK_DEF("_FPCLASS_PN", _FPCLASS_PN, MSVCRT__FPCLASS_PN);
|
||||
CHECK_DEF("_FPCLASS_PINF", _FPCLASS_PINF, MSVCRT__FPCLASS_PINF);
|
||||
CHECK_DEF("_EM_INVALID", _EM_INVALID, MSVCRT__EM_INVALID);
|
||||
CHECK_DEF("_EM_DENORMAL", _EM_DENORMAL, MSVCRT__EM_DENORMAL);
|
||||
CHECK_DEF("_EM_ZERODIVIDE", _EM_ZERODIVIDE, MSVCRT__EM_ZERODIVIDE);
|
||||
CHECK_DEF("_EM_OVERFLOW", _EM_OVERFLOW, MSVCRT__EM_OVERFLOW);
|
||||
CHECK_DEF("_EM_UNDERFLOW", _EM_UNDERFLOW, MSVCRT__EM_UNDERFLOW);
|
||||
CHECK_DEF("_EM_INEXACT", _EM_INEXACT, MSVCRT__EM_INEXACT);
|
||||
CHECK_DEF("_IC_AFFINE", _IC_AFFINE, MSVCRT__IC_AFFINE);
|
||||
CHECK_DEF("_IC_PROJECTIVE", _IC_PROJECTIVE, MSVCRT__IC_PROJECTIVE);
|
||||
CHECK_DEF("_RC_CHOP", _RC_CHOP, MSVCRT__RC_CHOP);
|
||||
CHECK_DEF("_RC_UP", _RC_UP, MSVCRT__RC_UP);
|
||||
CHECK_DEF("_RC_DOWN", _RC_DOWN, MSVCRT__RC_DOWN);
|
||||
CHECK_DEF("_RC_NEAR", _RC_NEAR, MSVCRT__RC_NEAR);
|
||||
CHECK_DEF("_PC_24", _PC_24, MSVCRT__PC_24);
|
||||
CHECK_DEF("_PC_53", _PC_53, MSVCRT__PC_53);
|
||||
CHECK_DEF("_PC_64", _PC_64, MSVCRT__PC_64);
|
||||
}
|
||||
|
||||
START_TEST(headers)
|
||||
{
|
||||
test_types();
|
||||
test_structs();
|
||||
test_defines();
|
||||
}
|
|
@ -18,10 +18,6 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "msvcrt.h"
|
||||
|
||||
#include "msvcrt/malloc.h"
|
||||
#include "msvcrt/process.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
|
||||
|
@ -29,7 +25,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
|
|||
/********************************************************************/
|
||||
|
||||
typedef struct {
|
||||
_beginthread_start_routine_t start_address;
|
||||
MSVCRT__beginthread_start_routine_t start_address;
|
||||
void *arglist;
|
||||
} _beginthread_trampoline_t;
|
||||
|
||||
|
@ -38,16 +34,16 @@ typedef struct {
|
|||
*
|
||||
* Return the thread local storage structure.
|
||||
*/
|
||||
MSVCRT_thread_data *msvcrt_get_thread_data(void)
|
||||
thread_data_t *msvcrt_get_thread_data(void)
|
||||
{
|
||||
MSVCRT_thread_data *ptr;
|
||||
thread_data_t *ptr;
|
||||
DWORD err = GetLastError(); /* need to preserve last error */
|
||||
|
||||
if (!(ptr = TlsGetValue( MSVCRT_tls_index )))
|
||||
if (!(ptr = TlsGetValue( msvcrt_tls_index )))
|
||||
{
|
||||
if (!(ptr = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ptr) )))
|
||||
MSVCRT__amsg_exit( _RT_THREAD );
|
||||
if (!TlsSetValue( MSVCRT_tls_index, ptr )) MSVCRT__amsg_exit( _RT_THREAD );
|
||||
_amsg_exit( _RT_THREAD );
|
||||
if (!TlsSetValue( msvcrt_tls_index, ptr )) _amsg_exit( _RT_THREAD );
|
||||
}
|
||||
SetLastError( err );
|
||||
return ptr;
|
||||
|
@ -75,7 +71,7 @@ static DWORD CALLBACK _beginthread_trampoline(LPVOID arg)
|
|||
* _beginthread (MSVCRT.@)
|
||||
*/
|
||||
unsigned long _beginthread(
|
||||
_beginthread_start_routine_t start_address, /* [in] Start address of routine that begins execution of new thread */
|
||||
MSVCRT__beginthread_start_routine_t start_address, /* [in] Start address of routine that begins execution of new thread */
|
||||
unsigned int stack_size, /* [in] Stack size for new thread or 0 */
|
||||
void *arglist) /* [in] Argument list to be passed to new thread or NULL */
|
||||
{
|
||||
|
@ -102,7 +98,7 @@ unsigned long _beginthread(
|
|||
unsigned long _beginthreadex(
|
||||
void *security, /* [in] Security descriptor for new thread; must be NULL for Windows 9x applications */
|
||||
unsigned int stack_size, /* [in] Stack size for new thread or 0 */
|
||||
_beginthreadex_start_routine_t start_address, /* [in] Start address of routine that begins execution of new thread */
|
||||
MSVCRT__beginthreadex_start_routine_t start_address, /* [in] Start address of routine that begins execution of new thread */
|
||||
void *arglist, /* [in] Argument list to be passed to new thread or NULL */
|
||||
unsigned int initflag, /* [in] Initial state of new thread (0 for running or CREATE_SUSPEND for suspended) */
|
||||
unsigned int *thrdaddr) /* [out] Points to a 32-bit variable that receives the thread identifier */
|
||||
|
|
|
@ -30,11 +30,7 @@
|
|||
#endif
|
||||
|
||||
#include "msvcrt.h"
|
||||
#include "msvcrt/sys/timeb.h"
|
||||
#include "msvcrt/time.h"
|
||||
|
||||
#include "winbase.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
|
||||
|
@ -220,24 +216,10 @@ double MSVCRT_difftime(MSVCRT_time_t time1, MSVCRT_time_t time2)
|
|||
return (double)(time1 - time2);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* time (MSVCRT.@)
|
||||
*/
|
||||
MSVCRT_time_t MSVCRT_time(MSVCRT_time_t* buf)
|
||||
{
|
||||
MSVCRT_time_t curtime;
|
||||
struct _timeb tb;
|
||||
|
||||
_ftime(&tb);
|
||||
|
||||
curtime = tb.time;
|
||||
return buf ? *buf = curtime : curtime;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* _ftime (MSVCRT.@)
|
||||
*/
|
||||
void _ftime(struct _timeb *buf)
|
||||
void _ftime(struct MSVCRT__timeb *buf)
|
||||
{
|
||||
TIME_ZONE_INFORMATION tzinfo;
|
||||
FILETIME ft;
|
||||
|
@ -254,6 +236,20 @@ void _ftime(struct _timeb *buf)
|
|||
buf->dstflag = (tzid == TIME_ZONE_ID_DAYLIGHT?1:0);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* time (MSVCRT.@)
|
||||
*/
|
||||
MSVCRT_time_t MSVCRT_time(MSVCRT_time_t* buf)
|
||||
{
|
||||
MSVCRT_time_t curtime;
|
||||
struct MSVCRT__timeb tb;
|
||||
|
||||
_ftime(&tb);
|
||||
|
||||
curtime = tb.time;
|
||||
return buf ? *buf = curtime : curtime;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* _daylight (MSVCRT.@)
|
||||
*/
|
||||
|
|
|
@ -24,12 +24,6 @@
|
|||
#include "msvcrt.h"
|
||||
#include "winnls.h"
|
||||
#include "wine/unicode.h"
|
||||
|
||||
#include "msvcrt/stdio.h"
|
||||
#include "msvcrt/stdlib.h"
|
||||
#include "msvcrt/string.h"
|
||||
#include "msvcrt/wctype.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
|
||||
|
|
|
@ -39,7 +39,6 @@ unsigned short _outpw(unsigned short, unsigned short);
|
|||
#endif
|
||||
|
||||
|
||||
#ifndef USE_MSVCRT_PREFIX
|
||||
static inline char* cgets(char* str) { return _cgets(str); }
|
||||
static inline int cputs(const char* str) { return _cputs(str); }
|
||||
static inline int getch(void) { return _getch(); }
|
||||
|
@ -62,6 +61,4 @@ extern int cscanf(const char*,...) __attribute__((alias("_cscanf"),format(scanf,
|
|||
#define cscanf _cscanf
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
#endif /* USE_MSVCRT_PREFIX */
|
||||
|
||||
#endif /* __WINE_CONIO_H */
|
||||
|
|
|
@ -11,38 +11,24 @@
|
|||
#define __WINE_USE_MSVCRT
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT
|
||||
# ifdef USE_MSVCRT_PREFIX
|
||||
# define MSVCRT(x) MSVCRT_##x
|
||||
# else
|
||||
# define MSVCRT(x) x
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_WCHAR_T_DEFINED
|
||||
#define MSVCRT_WCHAR_T_DEFINED
|
||||
#ifndef _WCHAR_T_DEFINED
|
||||
#define _WCHAR_T_DEFINED
|
||||
#ifndef __cplusplus
|
||||
typedef unsigned short MSVCRT(wchar_t);
|
||||
typedef unsigned short wchar_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef USE_MSVCRT_PREFIX
|
||||
# ifndef WEOF
|
||||
# define WEOF (wint_t)(0xFFFF)
|
||||
# endif
|
||||
#else
|
||||
# ifndef MSVCRT_WEOF
|
||||
# define MSVCRT_WEOF (MSVCRT_wint_t)(0xFFFF)
|
||||
# endif
|
||||
#endif /* USE_MSVCRT_PREFIX */
|
||||
#ifndef WEOF
|
||||
#define WEOF (wint_t)(0xFFFF)
|
||||
#endif
|
||||
|
||||
#ifndef _WCTYPE_T_DEFINED
|
||||
typedef unsigned short MSVCRT(wint_t);
|
||||
typedef unsigned short MSVCRT(wctype_t);
|
||||
typedef unsigned short wint_t;
|
||||
typedef unsigned short wctype_t;
|
||||
#define _WCTYPE_T_DEFINED
|
||||
#endif
|
||||
|
||||
|
@ -58,58 +44,56 @@ typedef unsigned short MSVCRT(wctype_t);
|
|||
#define _LEADBYTE 0x8000
|
||||
#define _ALPHA (0x0100|_UPPER|_LOWER) /* (C1_ALPHA|_UPPER|_LOWER) */
|
||||
|
||||
int MSVCRT(__isascii)(int);
|
||||
int MSVCRT(__iscsym)(int);
|
||||
int MSVCRT(__iscsymf)(int);
|
||||
int MSVCRT(__toascii)(int);
|
||||
int MSVCRT(_isctype)(int,int);
|
||||
int MSVCRT(_tolower)(int);
|
||||
int MSVCRT(_toupper)(int);
|
||||
int MSVCRT(isalnum)(int);
|
||||
int MSVCRT(isalpha)(int);
|
||||
int MSVCRT(iscntrl)(int);
|
||||
int MSVCRT(isdigit)(int);
|
||||
int MSVCRT(isgraph)(int);
|
||||
int MSVCRT(islower)(int);
|
||||
int MSVCRT(isprint)(int);
|
||||
int MSVCRT(ispunct)(int);
|
||||
int MSVCRT(isspace)(int);
|
||||
int MSVCRT(isupper)(int);
|
||||
int MSVCRT(isxdigit)(int);
|
||||
int MSVCRT(tolower)(int);
|
||||
int MSVCRT(toupper)(int);
|
||||
int __isascii(int);
|
||||
int __iscsym(int);
|
||||
int __iscsymf(int);
|
||||
int __toascii(int);
|
||||
int _isctype(int,int);
|
||||
int _tolower(int);
|
||||
int _toupper(int);
|
||||
int isalnum(int);
|
||||
int isalpha(int);
|
||||
int iscntrl(int);
|
||||
int isdigit(int);
|
||||
int isgraph(int);
|
||||
int islower(int);
|
||||
int isprint(int);
|
||||
int ispunct(int);
|
||||
int isspace(int);
|
||||
int isupper(int);
|
||||
int isxdigit(int);
|
||||
int tolower(int);
|
||||
int toupper(int);
|
||||
|
||||
#ifndef MSVCRT_WCTYPE_DEFINED
|
||||
#define MSVCRT_WCTYPE_DEFINED
|
||||
int MSVCRT(is_wctype)(MSVCRT(wint_t),MSVCRT(wctype_t));
|
||||
int MSVCRT(isleadbyte)(int);
|
||||
int MSVCRT(iswalnum)(MSVCRT(wint_t));
|
||||
int MSVCRT(iswalpha)(MSVCRT(wint_t));
|
||||
int MSVCRT(iswascii)(MSVCRT(wint_t));
|
||||
int MSVCRT(iswcntrl)(MSVCRT(wint_t));
|
||||
int MSVCRT(iswctype)(MSVCRT(wint_t),MSVCRT(wctype_t));
|
||||
int MSVCRT(iswdigit)(MSVCRT(wint_t));
|
||||
int MSVCRT(iswgraph)(MSVCRT(wint_t));
|
||||
int MSVCRT(iswlower)(MSVCRT(wint_t));
|
||||
int MSVCRT(iswprint)(MSVCRT(wint_t));
|
||||
int MSVCRT(iswpunct)(MSVCRT(wint_t));
|
||||
int MSVCRT(iswspace)(MSVCRT(wint_t));
|
||||
int MSVCRT(iswupper)(MSVCRT(wint_t));
|
||||
int MSVCRT(iswxdigit)(MSVCRT(wint_t));
|
||||
MSVCRT(wchar_t) MSVCRT(towlower)(MSVCRT(wchar_t));
|
||||
MSVCRT(wchar_t) MSVCRT(towupper)(MSVCRT(wchar_t));
|
||||
#endif /* MSVCRT_WCTYPE_DEFINED */
|
||||
#ifndef _WCTYPE_DEFINED
|
||||
#define _WCTYPE_DEFINED
|
||||
int is_wctype(wint_t,wctype_t);
|
||||
int isleadbyte(int);
|
||||
int iswalnum(wint_t);
|
||||
int iswalpha(wint_t);
|
||||
int iswascii(wint_t);
|
||||
int iswcntrl(wint_t);
|
||||
int iswctype(wint_t,wctype_t);
|
||||
int iswdigit(wint_t);
|
||||
int iswgraph(wint_t);
|
||||
int iswlower(wint_t);
|
||||
int iswprint(wint_t);
|
||||
int iswpunct(wint_t);
|
||||
int iswspace(wint_t);
|
||||
int iswupper(wint_t);
|
||||
int iswxdigit(wint_t);
|
||||
wchar_t towlower(wchar_t);
|
||||
wchar_t towupper(wchar_t);
|
||||
#endif /* _WCTYPE_DEFINED */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef USE_MSVCRT_PREFIX
|
||||
static inline int isascii(int c) { return __isascii(c); }
|
||||
static inline int iscsym(int c) { return __iscsym(c); }
|
||||
static inline int iscsymf(int c) { return __iscsymf(c); }
|
||||
static inline int toascii(int c) { return __toascii(c); }
|
||||
#endif /* USE_MSVCRT_PREFIX */
|
||||
|
||||
#endif /* __WINE_CTYPE_H */
|
||||
|
|
|
@ -11,39 +11,31 @@
|
|||
#define __WINE_USE_MSVCRT
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT
|
||||
# ifdef USE_MSVCRT_PREFIX
|
||||
# define MSVCRT(x) MSVCRT_##x
|
||||
# else
|
||||
# define MSVCRT(x) x
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_WCHAR_T_DEFINED
|
||||
#define MSVCRT_WCHAR_T_DEFINED
|
||||
#ifndef _WCHAR_T_DEFINED
|
||||
#define _WCHAR_T_DEFINED
|
||||
#ifndef __cplusplus
|
||||
typedef unsigned short MSVCRT(wchar_t);
|
||||
typedef unsigned short wchar_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_SIZE_T_DEFINED
|
||||
typedef unsigned int MSVCRT(size_t);
|
||||
#define MSVCRT_SIZE_T_DEFINED
|
||||
#ifndef _SIZE_T_DEFINED
|
||||
typedef unsigned int size_t;
|
||||
#define _SIZE_T_DEFINED
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_DISKFREE_T_DEFINED
|
||||
#define MSVCRT_DISKFREE_T_DEFINED
|
||||
struct MSVCRT(_diskfree_t) {
|
||||
#ifndef _DISKFREE_T_DEFINED
|
||||
#define _DISKFREE_T_DEFINED
|
||||
struct _diskfree_t {
|
||||
unsigned int total_clusters;
|
||||
unsigned int avail_clusters;
|
||||
unsigned int sectors_per_cluster;
|
||||
unsigned int bytes_per_sector;
|
||||
};
|
||||
#endif /* MSVCRT_DISKFREE_T_DEFINED */
|
||||
#endif /* _DISKFREE_T_DEFINED */
|
||||
|
||||
int _chdir(const char*);
|
||||
int _chdrive(int);
|
||||
|
@ -54,25 +46,23 @@ unsigned long _getdrives(void);
|
|||
int _mkdir(const char*);
|
||||
int _rmdir(const char*);
|
||||
|
||||
#ifndef MSVCRT_WDIRECT_DEFINED
|
||||
#define MSVCRT_WDIRECT_DEFINED
|
||||
int _wchdir(const MSVCRT(wchar_t)*);
|
||||
MSVCRT(wchar_t)* _wgetcwd(MSVCRT(wchar_t)*,int);
|
||||
MSVCRT(wchar_t)* _wgetdcwd(int,MSVCRT(wchar_t)*,int);
|
||||
int _wmkdir(const MSVCRT(wchar_t)*);
|
||||
int _wrmdir(const MSVCRT(wchar_t)*);
|
||||
#endif /* MSVCRT_WDIRECT_DEFINED */
|
||||
#ifndef _WDIRECT_DEFINED
|
||||
#define _WDIRECT_DEFINED
|
||||
int _wchdir(const wchar_t*);
|
||||
wchar_t* _wgetcwd(wchar_t*,int);
|
||||
wchar_t* _wgetdcwd(int,wchar_t*,int);
|
||||
int _wmkdir(const wchar_t*);
|
||||
int _wrmdir(const wchar_t*);
|
||||
#endif /* _WDIRECT_DEFINED */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef USE_MSVCRT_PREFIX
|
||||
static inline int chdir(const char* newdir) { return _chdir(newdir); }
|
||||
static inline char* getcwd(char * buf, int size) { return _getcwd(buf, size); }
|
||||
static inline int mkdir(const char* newdir) { return _mkdir(newdir); }
|
||||
static inline int rmdir(const char* dir) { return _rmdir(dir); }
|
||||
#endif /* USE_MSVCRT_PREFIX */
|
||||
|
||||
#endif /* __WINE_DIRECT_H */
|
||||
|
|
|
@ -20,30 +20,28 @@
|
|||
#define _A_SUBDIR 0x00000010
|
||||
#define _A_ARCH 0x00000020
|
||||
|
||||
#ifndef MSVCRT_DISKFREE_T_DEFINED
|
||||
#define MSVCRT_DISKFREE_T_DEFINED
|
||||
struct MSVCRT(_diskfree_t) {
|
||||
#ifndef _DISKFREE_T_DEFINED
|
||||
#define _DISKFREE_T_DEFINED
|
||||
struct _diskfree_t {
|
||||
unsigned int total_clusters;
|
||||
unsigned int avail_clusters;
|
||||
unsigned int sectors_per_cluster;
|
||||
unsigned int bytes_per_sector;
|
||||
};
|
||||
#endif /* MSVCRT_DISKFREE_T_DEFINED */
|
||||
#endif /* _DISKFREE_T_DEFINED */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
unsigned int MSVCRT(_getdiskfree)(unsigned int, struct MSVCRT(_diskfree_t) *);
|
||||
unsigned int _getdiskfree(unsigned int, struct _diskfree_t *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef USE_MSVCRT_PREFIX
|
||||
#define MSVCRT(diskfree_t) MSVCRT(_diskfree_t)
|
||||
#endif /* USE_MSVCRT_PREFIX */
|
||||
#define diskfree_t _diskfree_t
|
||||
|
||||
#endif /* __WINE_DOS_H */
|
||||
|
|
|
@ -23,18 +23,10 @@
|
|||
#define __WINE_USE_MSVCRT
|
||||
#endif
|
||||
|
||||
#if !defined(__cplusplus) && !defined(USE_MSVCRT_PREFIX)
|
||||
#if !defined(__cplusplus) && !defined(__WINE_MSVCRT_TEST)
|
||||
#error "eh.h is meant only for C++ applications"
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT
|
||||
# ifdef USE_MSVCRT_PREFIX
|
||||
# define MSVCRT(x) MSVCRT_##x
|
||||
# else
|
||||
# define MSVCRT(x) x
|
||||
# endif
|
||||
#endif
|
||||
|
||||
struct _EXCEPTION_POINTERS;
|
||||
|
||||
typedef void (*terminate_handler)();
|
||||
|
@ -43,11 +35,11 @@ typedef void (*unexpected_handler)();
|
|||
typedef void (*unexpected_function)();
|
||||
typedef void (*_se_translator_function)(unsigned int code, struct _EXCEPTION_POINTERS *info);
|
||||
|
||||
terminate_function MSVCRT(set_terminate)(terminate_function func);
|
||||
unexpected_function MSVCRT(set_unexpected)(unexpected_function func);
|
||||
_se_translator_function MSVCRT(_set_se_translator)(_se_translator_function func);
|
||||
terminate_function set_terminate(terminate_function func);
|
||||
unexpected_function set_unexpected(unexpected_function func);
|
||||
_se_translator_function _set_se_translator(_se_translator_function func);
|
||||
|
||||
void MSVCRT(terminate)();
|
||||
void MSVCRT(unexpected)();
|
||||
void terminate();
|
||||
void unexpected();
|
||||
|
||||
#endif /* __WINE_EH_H */
|
||||
|
|
|
@ -22,57 +22,6 @@
|
|||
#define __WINE_USE_MSVCRT
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT
|
||||
# ifdef USE_MSVCRT_PREFIX
|
||||
# define MSVCRT(x) MSVCRT_##x
|
||||
# else
|
||||
# define MSVCRT(x) x
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef USE_MSVCRT_PREFIX
|
||||
|
||||
# define MSVCRT_EPERM 1
|
||||
# define MSVCRT_ENOENT 2
|
||||
# define MSVCRT_ESRCH 3
|
||||
# define MSVCRT_EINTR 4
|
||||
# define MSVCRT_EIO 5
|
||||
# define MSVCRT_ENXIO 6
|
||||
# define MSVCRT_E2BIG 7
|
||||
# define MSVCRT_ENOEXEC 8
|
||||
# define MSVCRT_EBADF 9
|
||||
# define MSVCRT_ECHILD 10
|
||||
# define MSVCRT_EAGAIN 11
|
||||
# define MSVCRT_ENOMEM 12
|
||||
# define MSVCRT_EACCES 13
|
||||
# define MSVCRT_EFAULT 14
|
||||
# define MSVCRT_EBUSY 16
|
||||
# define MSVCRT_EEXIST 17
|
||||
# define MSVCRT_EXDEV 18
|
||||
# define MSVCRT_ENODEV 19
|
||||
# define MSVCRT_ENOTDIR 20
|
||||
# define MSVCRT_EISDIR 21
|
||||
# define MSVCRT_EINVAL 22
|
||||
# define MSVCRT_ENFILE 23
|
||||
# define MSVCRT_EMFILE 24
|
||||
# define MSVCRT_ENOTTY 25
|
||||
# define MSVCRT_EFBIG 27
|
||||
# define MSVCRT_ENOSPC 28
|
||||
# define MSVCRT_ESPIPE 29
|
||||
# define MSVCRT_EROFS 30
|
||||
# define MSVCRT_EMLINK 31
|
||||
# define MSVCRT_EPIPE 32
|
||||
# define MSVCRT_EDOM 33
|
||||
# define MSVCRT_ERANGE 34
|
||||
# define MSVCRT_EDEADLK 36
|
||||
# define MSVCRT_EDEADLOCK MSVCRT_EDEADLK
|
||||
# define MSVCRT_ENAMETOOLONG 38
|
||||
# define MSVCRT_ENOLCK 39
|
||||
# define MSVCRT_ENOSYS 40
|
||||
# define MSVCRT_ENOTEMPTY 41
|
||||
|
||||
#else /* USE_MSVCRT_PREFIX */
|
||||
|
||||
# define EPERM 1
|
||||
# define ENOENT 2
|
||||
# define ESRCH 3
|
||||
|
@ -112,22 +61,16 @@
|
|||
# define ENOSYS 40
|
||||
# define ENOTEMPTY 41
|
||||
|
||||
#endif /* USE_MSVCRT_PREFIX */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern int* MSVCRT(_errno)(void);
|
||||
extern int* _errno(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef USE_MSVCRT_PREFIX
|
||||
# define errno (*_errno())
|
||||
#else
|
||||
# define MSVCRT_errno (*MSVCRT__errno())
|
||||
#endif
|
||||
#define errno (*_errno())
|
||||
|
||||
#endif /* __WINE_ERRNO_H */
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#define _O_RAW _O_BINARY
|
||||
|
||||
|
||||
#ifndef USE_MSVCRT_PREFIX
|
||||
#define O_RDONLY _O_RDONLY
|
||||
#define O_WRONLY _O_WRONLY
|
||||
#define O_RDWR _O_RDWR
|
||||
|
@ -45,6 +44,5 @@
|
|||
#define O_TEXT _O_TEXT
|
||||
#define O_BINARY _O_BINARY
|
||||
#define O_RAW _O_BINARY
|
||||
#endif /* USE_MSVCRT_PREFIX */
|
||||
|
||||
#endif /* __WINE_FCNTL_H */
|
||||
|
|
|
@ -12,14 +12,6 @@
|
|||
#define __WINE_USE_MSVCRT
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT
|
||||
# ifdef USE_MSVCRT_PREFIX
|
||||
# define MSVCRT(x) MSVCRT_##x
|
||||
# else
|
||||
# define MSVCRT(x) x
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
|
|
@ -11,18 +11,10 @@
|
|||
#define __WINE_USE_MSVCRT
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT
|
||||
# ifdef USE_MSVCRT_PREFIX
|
||||
# define MSVCRT(x) MSVCRT_##x
|
||||
# else
|
||||
# define MSVCRT(x) x
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_WCHAR_T_DEFINED
|
||||
#define MSVCRT_WCHAR_T_DEFINED
|
||||
#ifndef _WCHAR_T_DEFINED
|
||||
#define _WCHAR_T_DEFINED
|
||||
#ifndef __cplusplus
|
||||
typedef unsigned short MSVCRT(wchar_t);
|
||||
typedef unsigned short wchar_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -41,59 +33,59 @@ typedef unsigned short MSVCRT(wchar_t);
|
|||
#define _A_SUBDIR 0x00000010
|
||||
#define _A_ARCH 0x00000020
|
||||
|
||||
#ifndef MSVCRT_TIME_T_DEFINED
|
||||
typedef long MSVCRT(time_t);
|
||||
#define MSVCRT_TIME_T_DEFINED
|
||||
#ifndef _TIME_T_DEFINED
|
||||
typedef long time_t;
|
||||
#define _TIME_T_DEFINED
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_FSIZE_T_DEFINED
|
||||
typedef unsigned long MSVCRT(_fsize_t);
|
||||
#define MSVCRT_FSIZE_T_DEFINED
|
||||
#ifndef _FSIZE_T_DEFINED
|
||||
typedef unsigned long _fsize_t;
|
||||
#define _FSIZE_T_DEFINED
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_FINDDATA_T_DEFINED
|
||||
#define MSVCRT_FINDDATA_T_DEFINED
|
||||
struct MSVCRT(_finddata_t)
|
||||
#ifndef _FINDDATA_T_DEFINED
|
||||
#define _FINDDATA_T_DEFINED
|
||||
struct _finddata_t
|
||||
{
|
||||
unsigned attrib;
|
||||
MSVCRT(time_t) time_create;
|
||||
MSVCRT(time_t) time_access;
|
||||
MSVCRT(time_t) time_write;
|
||||
MSVCRT(_fsize_t) size;
|
||||
time_t time_create;
|
||||
time_t time_access;
|
||||
time_t time_write;
|
||||
_fsize_t size;
|
||||
char name[260];
|
||||
};
|
||||
|
||||
struct MSVCRT(_finddatai64_t)
|
||||
struct _finddatai64_t
|
||||
{
|
||||
unsigned attrib;
|
||||
MSVCRT(time_t) time_create;
|
||||
MSVCRT(time_t) time_access;
|
||||
MSVCRT(time_t) time_write;
|
||||
time_t time_create;
|
||||
time_t time_access;
|
||||
time_t time_write;
|
||||
__int64 size;
|
||||
char name[260];
|
||||
};
|
||||
#endif /* MSVCRT_FINDDATA_T_DEFINED */
|
||||
#endif /* _FINDDATA_T_DEFINED */
|
||||
|
||||
#ifndef MSVCRT_WFINDDATA_T_DEFINED
|
||||
#define MSVCRT_WFINDDATA_T_DEFINED
|
||||
struct MSVCRT(_wfinddata_t) {
|
||||
#ifndef _WFINDDATA_T_DEFINED
|
||||
#define _WFINDDATA_T_DEFINED
|
||||
struct _wfinddata_t {
|
||||
unsigned attrib;
|
||||
MSVCRT(time_t) time_create;
|
||||
MSVCRT(time_t) time_access;
|
||||
MSVCRT(time_t) time_write;
|
||||
MSVCRT(_fsize_t) size;
|
||||
MSVCRT(wchar_t) name[260];
|
||||
time_t time_create;
|
||||
time_t time_access;
|
||||
time_t time_write;
|
||||
_fsize_t size;
|
||||
wchar_t name[260];
|
||||
};
|
||||
|
||||
struct MSVCRT(_wfinddatai64_t) {
|
||||
struct _wfinddatai64_t {
|
||||
unsigned attrib;
|
||||
MSVCRT(time_t) time_create;
|
||||
MSVCRT(time_t) time_access;
|
||||
MSVCRT(time_t) time_write;
|
||||
time_t time_create;
|
||||
time_t time_access;
|
||||
time_t time_write;
|
||||
__int64 size;
|
||||
MSVCRT(wchar_t) name[260];
|
||||
wchar_t name[260];
|
||||
};
|
||||
#endif /* MSVCRT_WFINDDATA_T_DEFINED */
|
||||
#endif /* _WFINDDATA_T_DEFINED */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -111,10 +103,10 @@ int _eof(int);
|
|||
__int64 _filelengthi64(int);
|
||||
long _filelength(int);
|
||||
int _findclose(long);
|
||||
long MSVCRT(_findfirst)(const char*,struct MSVCRT(_finddata_t)*);
|
||||
long MSVCRT(_findfirsti64)(const char*, struct MSVCRT(_finddatai64_t)*);
|
||||
int MSVCRT(_findnext)(long,struct MSVCRT(_finddata_t)*);
|
||||
int MSVCRT(_findnexti64)(long, struct MSVCRT(_finddatai64_t)*);
|
||||
long _findfirst(const char*,struct _finddata_t*);
|
||||
long _findfirsti64(const char*, struct _finddatai64_t*);
|
||||
int _findnext(long,struct _finddata_t*);
|
||||
int _findnexti64(long, struct _finddatai64_t*);
|
||||
long _get_osfhandle(int);
|
||||
int _isatty(int);
|
||||
int _locking(int,int,long);
|
||||
|
@ -133,31 +125,30 @@ int _umask(int);
|
|||
int _unlink(const char*);
|
||||
int _write(int,const void*,unsigned int);
|
||||
|
||||
int MSVCRT(remove)(const char*);
|
||||
int MSVCRT(rename)(const char*,const char*);
|
||||
int remove(const char*);
|
||||
int rename(const char*,const char*);
|
||||
|
||||
#ifndef MSVCRT_WIO_DEFINED
|
||||
#define MSVCRT_WIO_DEFINED
|
||||
int _waccess(const MSVCRT(wchar_t)*,int);
|
||||
int _wchmod(const MSVCRT(wchar_t)*,int);
|
||||
int _wcreat(const MSVCRT(wchar_t)*,int);
|
||||
long MSVCRT(_wfindfirst)(const MSVCRT(wchar_t)*,struct MSVCRT(_wfinddata_t)*);
|
||||
long MSVCRT(_wfindfirsti64)(const MSVCRT(wchar_t)*, struct MSVCRT(_wfinddatai64_t)*);
|
||||
int MSVCRT(_wfindnext)(long,struct MSVCRT(_wfinddata_t)*);
|
||||
int MSVCRT(_wfindnexti64)(long, struct MSVCRT(_wfinddatai64_t)*);
|
||||
MSVCRT(wchar_t)*_wmktemp(MSVCRT(wchar_t)*);
|
||||
int _wopen(const MSVCRT(wchar_t)*,int,...);
|
||||
int _wrename(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
|
||||
int _wsopen(const MSVCRT(wchar_t)*,int,int,...);
|
||||
int _wunlink(const MSVCRT(wchar_t)*);
|
||||
#endif /* MSVCRT_WIO_DEFINED */
|
||||
#ifndef _WIO_DEFINED
|
||||
#define _WIO_DEFINED
|
||||
int _waccess(const wchar_t*,int);
|
||||
int _wchmod(const wchar_t*,int);
|
||||
int _wcreat(const wchar_t*,int);
|
||||
long _wfindfirst(const wchar_t*,struct _wfinddata_t*);
|
||||
long _wfindfirsti64(const wchar_t*, struct _wfinddatai64_t*);
|
||||
int _wfindnext(long,struct _wfinddata_t*);
|
||||
int _wfindnexti64(long, struct _wfinddatai64_t*);
|
||||
wchar_t*_wmktemp(wchar_t*);
|
||||
int _wopen(const wchar_t*,int,...);
|
||||
int _wrename(const wchar_t*,const wchar_t*);
|
||||
int _wsopen(const wchar_t*,int,int,...);
|
||||
int _wunlink(const wchar_t*);
|
||||
#endif /* _WIO_DEFINED */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef USE_MSVCRT_PREFIX
|
||||
static inline int access(const char* path, int mode) { return _access(path, mode); }
|
||||
static inline int chmod(const char* path, int mode) { return _chmod(path, mode); }
|
||||
static inline int chsize(int fd, long size) { return _chsize(fd, size); }
|
||||
|
@ -174,13 +165,13 @@ static inline char* mktemp(char* pat) { return _mktemp(pat); }
|
|||
static inline int read(int fd, void* buf, unsigned int size) { return _read(fd, buf, size); }
|
||||
static inline int setmode(int fd, int mode) { return _setmode(fd, mode); }
|
||||
static inline long tell(int fd) { return _tell(fd); }
|
||||
#ifndef MSVCRT_UMASK_DEFINED
|
||||
#ifndef _UMASK_DEFINED
|
||||
static inline int umask(int fd) { return _umask(fd); }
|
||||
#define MSVCRT_UMASK_DEFINED
|
||||
#define _UMASK_DEFINED
|
||||
#endif
|
||||
#ifndef MSVCRT_UNLINK_DEFINED
|
||||
#ifndef _UNLINK_DEFINED
|
||||
static inline int unlink(const char* path) { return _unlink(path); }
|
||||
#define MSVCRT_UNLINK_DEFINED
|
||||
#define _UNLINK_DEFINED
|
||||
#endif
|
||||
static inline int write(int fd, const void* buf, unsigned int size) { return _write(fd, buf, size); }
|
||||
|
||||
|
@ -192,6 +183,4 @@ extern int sopen(const char*,int,int,...) __attribute__((alias("_sopen")));
|
|||
#define sopen _sopen
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
#endif /* USE _MSVCRT_PREFIX */
|
||||
|
||||
#endif /* __WINE_IO_H */
|
||||
|
|
|
@ -23,31 +23,13 @@
|
|||
#define __WINE_USE_MSVCRT
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT
|
||||
# ifdef USE_MSVCRT_PREFIX
|
||||
# define MSVCRT(x) MSVCRT_##x
|
||||
# else
|
||||
# define MSVCRT(x) x
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_WCHAR_T_DEFINED
|
||||
#define MSVCRT_WCHAR_T_DEFINED
|
||||
#ifndef _WCHAR_T_DEFINED
|
||||
#define _WCHAR_T_DEFINED
|
||||
#ifndef __cplusplus
|
||||
typedef unsigned short MSVCRT(wchar_t);
|
||||
typedef unsigned short wchar_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef USE_MSVCRT_PREFIX
|
||||
#define MSVCRT_LC_ALL 0
|
||||
#define MSVCRT_LC_COLLATE 1
|
||||
#define MSVCRT_LC_CTYPE 2
|
||||
#define MSVCRT_LC_MONETARY 3
|
||||
#define MSVCRT_LC_NUMERIC 4
|
||||
#define MSVCRT_LC_TIME 5
|
||||
#define MSVCRT_LC_MIN MSVCRT_LC_ALL
|
||||
#define MSVCRT_LC_MAX MSVCRT_LC_TIME
|
||||
#else
|
||||
#define LC_ALL 0
|
||||
#define LC_COLLATE 1
|
||||
#define LC_CTYPE 2
|
||||
|
@ -56,11 +38,10 @@ typedef unsigned short MSVCRT(wchar_t);
|
|||
#define LC_TIME 5
|
||||
#define LC_MIN LC_ALL
|
||||
#define LC_MAX LC_TIME
|
||||
#endif /* USE_MSVCRT_PREFIX */
|
||||
|
||||
#ifndef MSVCRT_LCONV_DEFINED
|
||||
#define MSVCRT_LCONV_DEFINED
|
||||
struct MSVCRT(lconv)
|
||||
#ifndef _LCONV_DEFINED
|
||||
#define _LCONV_DEFINED
|
||||
struct lconv
|
||||
{
|
||||
char* decimal_point;
|
||||
char* thousands_sep;
|
||||
|
@ -81,20 +62,20 @@ struct MSVCRT(lconv)
|
|||
char p_sign_posn;
|
||||
char n_sign_posn;
|
||||
};
|
||||
#endif /* MSVCRT_LCONV_DEFINED */
|
||||
#endif /* _LCONV_DEFINED */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
char* MSVCRT(setlocale)(int,const char*);
|
||||
struct MSVCRT(lconv)* MSVCRT(localeconv)(void);
|
||||
char* setlocale(int,const char*);
|
||||
struct lconv* localeconv(void);
|
||||
|
||||
#ifndef MSVCRT_WLOCALE_DEFINED
|
||||
#define MSVCRT_WLOCALE_DEFINED
|
||||
MSVCRT(wchar_t)* _wsetlocale(int,const MSVCRT(wchar_t)*);
|
||||
#endif /* MSVCRT_WLOCALE_DEFINED */
|
||||
#ifndef _WLOCALE_DEFINED
|
||||
#define _WLOCALE_DEFINED
|
||||
wchar_t* _wsetlocale(int,const wchar_t*);
|
||||
#endif /* _WLOCALE_DEFINED */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -23,14 +23,6 @@
|
|||
#define __WINE_USE_MSVCRT
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT
|
||||
# ifdef USE_MSVCRT_PREFIX
|
||||
# define MSVCRT(x) MSVCRT_##x
|
||||
# else
|
||||
# define MSVCRT(x) x
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* heap function constants */
|
||||
#define _HEAPEMPTY -1
|
||||
#define _HEAPOK -2
|
||||
|
@ -43,48 +35,46 @@
|
|||
#define _USEDENTRY 1
|
||||
|
||||
|
||||
#ifndef MSVCRT_SIZE_T_DEFINED
|
||||
typedef unsigned int MSVCRT(size_t);
|
||||
#define MSVCRT_SIZE_T_DEFINED
|
||||
#ifndef _SIZE_T_DEFINED
|
||||
typedef unsigned int size_t;
|
||||
#define _SIZE_T_DEFINED
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_HEAPINFO_DEFINED
|
||||
#define MSVCRT_HEAPINFO_DEFINED
|
||||
#ifndef _HEAPINFO_DEFINED
|
||||
#define _HEAPINFO_DEFINED
|
||||
typedef struct _heapinfo
|
||||
{
|
||||
int* _pentry;
|
||||
MSVCRT(size_t) _size;
|
||||
size_t _size;
|
||||
int _useflag;
|
||||
} _HEAPINFO;
|
||||
#endif /* MSVCRT_HEAPINFO_DEFINED */
|
||||
#endif /* _HEAPINFO_DEFINED */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void* _expand(void*,MSVCRT(size_t));
|
||||
int _heapadd(void*,MSVCRT(size_t));
|
||||
void* _expand(void*,size_t);
|
||||
int _heapadd(void*,size_t);
|
||||
int _heapchk(void);
|
||||
int _heapmin(void);
|
||||
int _heapset(unsigned int);
|
||||
MSVCRT(size_t) _heapused(MSVCRT(size_t)*,MSVCRT(size_t)*);
|
||||
size_t _heapused(size_t*,size_t*);
|
||||
int _heapwalk(_HEAPINFO*);
|
||||
MSVCRT(size_t) _msize(void*);
|
||||
size_t _msize(void*);
|
||||
|
||||
void* MSVCRT(calloc)(MSVCRT(size_t),MSVCRT(size_t));
|
||||
void MSVCRT(free)(void*);
|
||||
void* MSVCRT(malloc)(MSVCRT(size_t));
|
||||
void* MSVCRT(realloc)(void*,MSVCRT(size_t));
|
||||
void* calloc(size_t,size_t);
|
||||
void free(void*);
|
||||
void* malloc(size_t);
|
||||
void* realloc(void*,size_t);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef USE_MSVCRT_PREFIX
|
||||
# ifdef __GNUC__
|
||||
# define _alloca(x) __builtin_alloca((x))
|
||||
# define alloca(x) __builtin_alloca((x))
|
||||
# endif
|
||||
#endif /* USE_MSVCRT_PREFIX */
|
||||
|
||||
#endif /* __WINE_MALLOC_H */
|
||||
|
|
|
@ -12,14 +12,6 @@
|
|||
#define __WINE_USE_MSVCRT
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT
|
||||
# ifdef USE_MSVCRT_PREFIX
|
||||
# define MSVCRT(x) MSVCRT_##x
|
||||
# else
|
||||
# define MSVCRT(x) x
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
@ -31,9 +23,9 @@ extern "C" {
|
|||
#define _TLOSS 5 /* total loss of precision */
|
||||
#define _PLOSS 6 /* partial loss of precision */
|
||||
|
||||
#ifndef MSVCRT_EXCEPTION_DEFINED
|
||||
#define MSVCRT_EXCEPTION_DEFINED
|
||||
struct MSVCRT(_exception)
|
||||
#ifndef _EXCEPTION_DEFINED
|
||||
#define _EXCEPTION_DEFINED
|
||||
struct _exception
|
||||
{
|
||||
int type;
|
||||
char *name;
|
||||
|
@ -41,16 +33,16 @@ struct MSVCRT(_exception)
|
|||
double arg2;
|
||||
double retval;
|
||||
};
|
||||
#endif /* MSVCRT_EXCEPTION_DEFINED */
|
||||
#endif /* _EXCEPTION_DEFINED */
|
||||
|
||||
#ifndef MSVCRT_COMPLEX_DEFINED
|
||||
#define MSVCRT_COMPLEX_DEFINED
|
||||
struct MSVCRT(_complex)
|
||||
#ifndef _COMPLEX_DEFINED
|
||||
#define _COMPLEX_DEFINED
|
||||
struct _complex
|
||||
{
|
||||
double x; /* Real part */
|
||||
double y; /* Imaginary part */
|
||||
};
|
||||
#endif /* MSVCRT_COMPLEX_DEFINED */
|
||||
#endif /* _COMPLEX_DEFINED */
|
||||
|
||||
double sin(double);
|
||||
double cos(double);
|
||||
|
@ -83,8 +75,8 @@ double y0(double);
|
|||
double y1(double);
|
||||
double yn(int, double);
|
||||
|
||||
int MSVCRT(_matherr)(struct MSVCRT(_exception)*);
|
||||
double MSVCRT(_cabs)(struct MSVCRT(_complex));
|
||||
int _matherr(struct _exception*);
|
||||
double _cabs(struct _complex);
|
||||
|
||||
#ifndef HUGE_VAL
|
||||
# if defined(__GNUC__) && (__GNUC__ >= 3)
|
||||
|
|
|
@ -42,13 +42,13 @@ int _ismbbprint(unsigned int);
|
|||
int _ismbbpunct(unsigned int);
|
||||
int _setmbcp(int);
|
||||
|
||||
#ifndef MSVCRT_MBLEADTRAIL_DEFINED
|
||||
#define MSVCRT_MBLEADTRAIL_DEFINED
|
||||
#ifndef _MBLEADTRAIL_DEFINED
|
||||
#define _MBLEADTRAIL_DEFINED
|
||||
int _ismbblead(unsigned int);
|
||||
int _ismbbtrail(unsigned int);
|
||||
int _ismbslead(const unsigned char*,const unsigned char*);
|
||||
int _ismbstrail(const unsigned char*,const unsigned char*);
|
||||
#endif /* MSVCRT_MBLEADTRAIL_DEFINED */
|
||||
#endif /* _MBLEADTRAIL_DEFINED */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -23,22 +23,14 @@
|
|||
#define __WINE_USE_MSVCRT
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT
|
||||
# ifdef USE_MSVCRT_PREFIX
|
||||
# define MSVCRT(x) MSVCRT_##x
|
||||
# else
|
||||
# define MSVCRT(x) x
|
||||
# endif
|
||||
#ifndef _SIZE_T_DEFINED
|
||||
typedef unsigned int size_t;
|
||||
#define _SIZE_T_DEFINED
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_SIZE_T_DEFINED
|
||||
typedef unsigned int MSVCRT(size_t);
|
||||
#define MSVCRT_SIZE_T_DEFINED
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_NLSCMP_DEFINED
|
||||
#ifndef _NLSCMP_DEFINED
|
||||
#define _NLSCMPERROR ((unsigned int)0x7fffffff)
|
||||
#define MSVCRT_NLSCMP_DEFINED
|
||||
#define _NLSCMP_DEFINED
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -67,64 +59,64 @@ int _mbbtype(unsigned char,int);
|
|||
void _mbccpy(unsigned char*,const unsigned char*);
|
||||
unsigned int _mbcjistojms(unsigned int);
|
||||
unsigned int _mbcjmstojis(unsigned int);
|
||||
MSVCRT(size_t) _mbclen(const unsigned char*);
|
||||
size_t _mbclen(const unsigned char*);
|
||||
unsigned int _mbctohira(unsigned int);
|
||||
unsigned int _mbctokata(unsigned int);
|
||||
unsigned int _mbctolower(unsigned int);
|
||||
unsigned int _mbctombb(unsigned int);
|
||||
unsigned int _mbctoupper(unsigned int);
|
||||
int _mbsbtype(const unsigned char*,MSVCRT(size_t));
|
||||
int _mbsbtype(const unsigned char*,size_t);
|
||||
unsigned char* _mbscat(unsigned char*,const unsigned char*);
|
||||
unsigned char* _mbschr(const unsigned char*,unsigned int);
|
||||
int _mbscmp(const unsigned char*,const unsigned char*);
|
||||
int _mbscoll(const unsigned char*,const unsigned char*);
|
||||
unsigned char* _mbscpy(unsigned char*,const unsigned char*);
|
||||
MSVCRT(size_t) _mbscspn(const unsigned char*,const unsigned char*);
|
||||
size_t _mbscspn(const unsigned char*,const unsigned char*);
|
||||
unsigned char* _mbsdec(const unsigned char*,const unsigned char*);
|
||||
unsigned char* _mbsdup(const unsigned char*);
|
||||
int _mbsicmp(const unsigned char*,const unsigned char*);
|
||||
int _mbsicoll(const unsigned char*,const unsigned char*);
|
||||
unsigned char* _mbsinc(const unsigned char*);
|
||||
MSVCRT(size_t) _mbslen(const unsigned char*);
|
||||
size_t _mbslen(const unsigned char*);
|
||||
unsigned char* _mbslwr(unsigned char*);
|
||||
unsigned char* _mbsnbcat(unsigned char*,const unsigned char*,MSVCRT(size_t));
|
||||
int _mbsnbcmp(const unsigned char*,const unsigned char*,MSVCRT(size_t));
|
||||
int _mbsnbcoll(const unsigned char*,const unsigned char*,MSVCRT(size_t));
|
||||
MSVCRT(size_t) _mbsnbcnt(const unsigned char*,MSVCRT(size_t));
|
||||
unsigned char* _mbsnbcat(unsigned char*,const unsigned char*,size_t);
|
||||
int _mbsnbcmp(const unsigned char*,const unsigned char*,size_t);
|
||||
int _mbsnbcoll(const unsigned char*,const unsigned char*,size_t);
|
||||
size_t _mbsnbcnt(const unsigned char*,size_t);
|
||||
unsigned char* _mbsnbcpy(unsigned char*,const unsigned char*
|
||||
,MSVCRT(size_t));
|
||||
int _mbsnbicmp(const unsigned char*,const unsigned char*,MSVCRT(size_t));
|
||||
int _mbsnbicoll(const unsigned char*,const unsigned char*,MSVCRT(size_t));
|
||||
unsigned char* _mbsnbset(unsigned char*,unsigned int,MSVCRT(size_t))
|
||||
,size_t);
|
||||
int _mbsnbicmp(const unsigned char*,const unsigned char*,size_t);
|
||||
int _mbsnbicoll(const unsigned char*,const unsigned char*,size_t);
|
||||
unsigned char* _mbsnbset(unsigned char*,unsigned int,size_t)
|
||||
;
|
||||
unsigned char* _mbsncat(unsigned char*,const unsigned char*,
|
||||
MSVCRT(size_t));
|
||||
MSVCRT(size_t) _mbsnccnt(const unsigned char*,MSVCRT(size_t));
|
||||
int _mbsncmp(const unsigned char*,const unsigned char*,MSVCRT(size_t));
|
||||
int _mbsncoll(const unsigned char*,const unsigned char*,MSVCRT(size_t));
|
||||
unsigned char* _mbsncpy(unsigned char*,const unsigned char*,MSVCRT(size_t));
|
||||
size_t);
|
||||
size_t _mbsnccnt(const unsigned char*,size_t);
|
||||
int _mbsncmp(const unsigned char*,const unsigned char*,size_t);
|
||||
int _mbsncoll(const unsigned char*,const unsigned char*,size_t);
|
||||
unsigned char* _mbsncpy(unsigned char*,const unsigned char*,size_t);
|
||||
unsigned int _mbsnextc (const unsigned char*);
|
||||
int _mbsnicmp(const unsigned char*,const unsigned char*,MSVCRT(size_t));
|
||||
int _mbsnicoll(const unsigned char*,const unsigned char*,MSVCRT(size_t));
|
||||
unsigned char* _mbsninc(const unsigned char*,MSVCRT(size_t));
|
||||
unsigned char* _mbsnset(unsigned char*,unsigned int,MSVCRT(size_t));
|
||||
int _mbsnicmp(const unsigned char*,const unsigned char*,size_t);
|
||||
int _mbsnicoll(const unsigned char*,const unsigned char*,size_t);
|
||||
unsigned char* _mbsninc(const unsigned char*,size_t);
|
||||
unsigned char* _mbsnset(unsigned char*,unsigned int,size_t);
|
||||
unsigned char* _mbspbrk(const unsigned char*,const unsigned char*);
|
||||
unsigned char* _mbsrchr(const unsigned char*,unsigned int);
|
||||
unsigned char* _mbsrev(unsigned char*);
|
||||
unsigned char* _mbsset(unsigned char*,unsigned int);
|
||||
MSVCRT(size_t) _mbsspn(const unsigned char*,const unsigned char*);
|
||||
size_t _mbsspn(const unsigned char*,const unsigned char*);
|
||||
unsigned char* _mbsspnp(const unsigned char*,const unsigned char*);
|
||||
unsigned char* _mbsstr(const unsigned char*,const unsigned char*);
|
||||
unsigned char* _mbstok(unsigned char*,const unsigned char*);
|
||||
unsigned char* _mbsupr(unsigned char*);
|
||||
|
||||
#ifndef MSVCRT_MBLEADTRAIL_DEFINED
|
||||
#define MSVCRT_MBLEADTRAIL_DEFINED
|
||||
#ifndef _MBLEADTRAIL_DEFINED
|
||||
#define _MBLEADTRAIL_DEFINED
|
||||
int _ismbblead(unsigned int);
|
||||
int _ismbbtrail(unsigned int);
|
||||
int _ismbslead(const unsigned char*,const unsigned char*);
|
||||
int _ismbstrail(const unsigned char*,const unsigned char*);
|
||||
#endif /* MSVCRT_MBLEADTRAIL_DEFINED */
|
||||
#endif /* _MBLEADTRAIL_DEFINED */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -11,18 +11,10 @@
|
|||
#define __WINE_USE_MSVCRT
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT
|
||||
# ifdef USE_MSVCRT_PREFIX
|
||||
# define MSVCRT(x) MSVCRT_##x
|
||||
# else
|
||||
# define MSVCRT(x) x
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_WCHAR_T_DEFINED
|
||||
#define MSVCRT_WCHAR_T_DEFINED
|
||||
#ifndef _WCHAR_T_DEFINED
|
||||
#define _WCHAR_T_DEFINED
|
||||
#ifndef __cplusplus
|
||||
typedef unsigned short MSVCRT(wchar_t);
|
||||
typedef unsigned short wchar_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -80,40 +72,39 @@ int _spawnve(int,const char*,const char* const *,const char* const *);
|
|||
int _spawnvp(int,const char*,const char* const *);
|
||||
int _spawnvpe(int,const char*,const char* const *,const char* const *);
|
||||
|
||||
void MSVCRT(_c_exit)(void);
|
||||
void MSVCRT(_cexit)(void);
|
||||
void MSVCRT(_exit)(int);
|
||||
void MSVCRT(abort)(void);
|
||||
void MSVCRT(exit)(int);
|
||||
int MSVCRT(system)(const char*);
|
||||
void _c_exit(void);
|
||||
void _cexit(void);
|
||||
void _exit(int);
|
||||
void abort(void);
|
||||
void exit(int);
|
||||
int system(const char*);
|
||||
|
||||
#ifndef MSVCRT_WPROCESS_DEFINED
|
||||
#define MSVCRT_WPROCESS_DEFINED
|
||||
int _wexecl(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
|
||||
int _wexecle(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
|
||||
int _wexeclp(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
|
||||
int _wexeclpe(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
|
||||
int _wexecv(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
|
||||
int _wexecve(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
|
||||
int _wexecvp(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
|
||||
int _wexecvpe(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
|
||||
int _wspawnl(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
|
||||
int _wspawnle(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
|
||||
int _wspawnlp(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
|
||||
int _wspawnlpe(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
|
||||
int _wspawnv(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
|
||||
int _wspawnve(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
|
||||
int _wspawnvp(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
|
||||
int _wspawnvpe(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
|
||||
int _wsystem(const MSVCRT(wchar_t)*);
|
||||
#endif /* MSVCRT_WPROCESS_DEFINED */
|
||||
#ifndef _WPROCESS_DEFINED
|
||||
#define _WPROCESS_DEFINED
|
||||
int _wexecl(const wchar_t*,const wchar_t*,...);
|
||||
int _wexecle(const wchar_t*,const wchar_t*,...);
|
||||
int _wexeclp(const wchar_t*,const wchar_t*,...);
|
||||
int _wexeclpe(const wchar_t*,const wchar_t*,...);
|
||||
int _wexecv(const wchar_t*,const wchar_t* const *);
|
||||
int _wexecve(const wchar_t*,const wchar_t* const *,const wchar_t* const *);
|
||||
int _wexecvp(const wchar_t*,const wchar_t* const *);
|
||||
int _wexecvpe(const wchar_t*,const wchar_t* const *,const wchar_t* const *);
|
||||
int _wspawnl(int,const wchar_t*,const wchar_t*,...);
|
||||
int _wspawnle(int,const wchar_t*,const wchar_t*,...);
|
||||
int _wspawnlp(int,const wchar_t*,const wchar_t*,...);
|
||||
int _wspawnlpe(int,const wchar_t*,const wchar_t*,...);
|
||||
int _wspawnv(int,const wchar_t*,const wchar_t* const *);
|
||||
int _wspawnve(int,const wchar_t*,const wchar_t* const *,const wchar_t* const *);
|
||||
int _wspawnvp(int,const wchar_t*,const wchar_t* const *);
|
||||
int _wspawnvpe(int,const wchar_t*,const wchar_t* const *,const wchar_t* const *);
|
||||
int _wsystem(const wchar_t*);
|
||||
#endif /* _WPROCESS_DEFINED */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef USE_MSVCRT_PREFIX
|
||||
#define P_WAIT _P_WAIT
|
||||
#define P_NOWAIT _P_NOWAIT
|
||||
#define P_OVERLAY _P_OVERLAY
|
||||
|
@ -154,6 +145,4 @@ extern int spawnlpe(int,const char*,const char*,...) __attribute__((alias("_spaw
|
|||
#define spawnlpe _spawnlpe
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
#endif /* USE_MSVCRT_PREFIX */
|
||||
|
||||
#endif /* __WINE_PROCESS_H */
|
||||
|
|
|
@ -23,17 +23,9 @@
|
|||
#define __WINE_USE_MSVCRT
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT
|
||||
# ifdef USE_MSVCRT_PREFIX
|
||||
# define MSVCRT(x) MSVCRT_##x
|
||||
# else
|
||||
# define MSVCRT(x) x
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_SIZE_T_DEFINED
|
||||
typedef unsigned int MSVCRT(size_t);
|
||||
#define MSVCRT_SIZE_T_DEFINED
|
||||
#ifndef _SIZE_T_DEFINED
|
||||
typedef unsigned int size_t;
|
||||
#define _SIZE_T_DEFINED
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -45,9 +37,9 @@ void* _lfind(const void*,const void*,unsigned int*,unsigned int,
|
|||
int (*)(const void*,const void*));
|
||||
void* _lsearch(const void*,void*,unsigned int*,unsigned int,
|
||||
int (*)(const void*,const void*));
|
||||
void* MSVCRT(bsearch)(const void*,const void*,MSVCRT(size_t),MSVCRT(size_t),
|
||||
void* bsearch(const void*,const void*,size_t,size_t,
|
||||
int (*)(const void*,const void*));
|
||||
void MSVCRT(qsort)(void*,MSVCRT(size_t),MSVCRT(size_t),
|
||||
void qsort(void*,size_t,size_t,
|
||||
int (*)(const void*,const void*));
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -55,9 +47,7 @@ void MSVCRT(qsort)(void*,MSVCRT(size_t),MSVCRT(size_t),
|
|||
#endif
|
||||
|
||||
|
||||
#ifndef USE_MSVCRT_PREFIX
|
||||
static inline void* lfind(const void* match, const void* start, unsigned int* array_size, unsigned int elem_size, int (*cf)(const void*,const void*)) { return _lfind(match, start, array_size, elem_size, cf); }
|
||||
static inline void* lsearch(const void* match, void* start, unsigned int* array_size, unsigned int elem_size, int (*cf)(const void*,const void*) ) { return _lsearch(match, start, array_size, elem_size, cf); }
|
||||
#endif /* USE_MSVCRT_PREFIX */
|
||||
|
||||
#endif /* __WINE_SEARCH_H */
|
||||
|
|
|
@ -23,15 +23,6 @@
|
|||
#define __WINE_USE_MSVCRT
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT
|
||||
# ifdef USE_MSVCRT_PREFIX
|
||||
# define MSVCRT(x) MSVCRT_##x
|
||||
# else
|
||||
# define MSVCRT(x) x
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __i386__
|
||||
|
||||
typedef struct __JUMP_BUFFER
|
||||
|
@ -52,30 +43,22 @@ typedef struct __JUMP_BUFFER
|
|||
|
||||
#endif /* __i386__ */
|
||||
|
||||
#ifndef USE_MSVCRT_PREFIX
|
||||
#define _JBLEN 16
|
||||
#define _JBTYPE int
|
||||
typedef _JBTYPE jmp_buf[_JBLEN];
|
||||
#else
|
||||
#define MSVCRT__JBLEN 16
|
||||
#define MSVCRT__JBTYPE int
|
||||
typedef MSVCRT__JBTYPE MSVCRT_jmp_buf[MSVCRT__JBLEN];
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int MSVCRT(_setjmp)(MSVCRT(jmp_buf));
|
||||
int MSVCRT(longjmp)(MSVCRT(jmp_buf),int);
|
||||
int _setjmp(jmp_buf);
|
||||
int longjmp(jmp_buf,int);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef USE_MSVCRT_PREFIX
|
||||
#define setjmp _setjmp
|
||||
#endif
|
||||
|
||||
#endif /* __WINE_SETJMP_H */
|
||||
|
|
|
@ -23,29 +23,21 @@
|
|||
#define __WINE_USE_MSVCRT
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT
|
||||
# ifdef USE_MSVCRT_PREFIX
|
||||
# define MSVCRT(x) MSVCRT_##x
|
||||
# else
|
||||
# define MSVCRT(x) x
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_WCHAR_T_DEFINED
|
||||
#define MSVCRT_WCHAR_T_DEFINED
|
||||
#ifndef _WCHAR_T_DEFINED
|
||||
#define _WCHAR_T_DEFINED
|
||||
#ifndef __cplusplus
|
||||
typedef unsigned short MSVCRT(wchar_t);
|
||||
typedef unsigned short wchar_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_PTRDIFF_T_DEFINED
|
||||
#ifndef _PTRDIFF_T_DEFINED
|
||||
typedef int ptrdiff_t;
|
||||
#define MSVCRT_PTRDIFF_T_DEFINED
|
||||
#define _PTRDIFF_T_DEFINED
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_SIZE_T_DEFINED
|
||||
typedef unsigned int MSVCRT(size_t);
|
||||
#define MSVCRT_SIZE_T_DEFINED
|
||||
#ifndef _SIZE_T_DEFINED
|
||||
typedef unsigned int size_t;
|
||||
#define _SIZE_T_DEFINED
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
|
|
|
@ -15,16 +15,7 @@
|
|||
#include <stdarg.h>
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT
|
||||
# ifdef USE_MSVCRT_PREFIX
|
||||
# define MSVCRT(x) MSVCRT_##x
|
||||
# else
|
||||
# define MSVCRT(x) x
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* file._flag flags */
|
||||
#ifndef USE_MSVCRT_PREFIX
|
||||
#define _IOREAD 0x0001
|
||||
#define _IOWRT 0x0002
|
||||
#define _IOMYBUF 0x0008
|
||||
|
@ -32,15 +23,6 @@
|
|||
#define _IOERR 0x0020
|
||||
#define _IOSTRG 0x0040
|
||||
#define _IORW 0x0080
|
||||
#else
|
||||
#define MSVCRT__IOREAD 0x0001
|
||||
#define MSVCRT__IOWRT 0x0002
|
||||
#define MSVCRT__IOMYBUF 0x0008
|
||||
#define MSVCRT__IOEOF 0x0010
|
||||
#define MSVCRT__IOERR 0x0020
|
||||
#define MSVCRT__IOSTRG 0x0040
|
||||
#define MSVCRT__IORW 0x0080
|
||||
#endif /* USE_MSVCRT_PREFIX */
|
||||
|
||||
#ifndef NULL
|
||||
#ifdef __cplusplus
|
||||
|
@ -50,8 +32,6 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef USE_MSVCRT_PREFIX
|
||||
|
||||
#define STDIN_FILENO 0
|
||||
#define STDOUT_FILENO 1
|
||||
#define STDERR_FILENO 2
|
||||
|
@ -75,29 +55,9 @@
|
|||
#define SEEK_END 2
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#define MSVCRT_STDIN_FILENO 0
|
||||
#define MSVCRT_STDOUT_FILENO 1
|
||||
#define MSVCRT_STDERR_FILENO 2
|
||||
|
||||
/* more file._flag flags, but these conflict with Unix */
|
||||
#define MSVCRT__IOFBF 0x0000
|
||||
#define MSVCRT__IONBF 0x0004
|
||||
#define MSVCRT__IOLBF 0x0040
|
||||
|
||||
#define MSVCRT_FILENAME_MAX 260
|
||||
#define MSVCRT_TMP_MAX 0x7fff
|
||||
|
||||
#define MSVCRT_EOF (-1)
|
||||
|
||||
#define MSVCRT_BUFSIZ 512
|
||||
|
||||
#endif /* USE_MSVCRT_PREFIX */
|
||||
|
||||
#ifndef MSVCRT_FILE_DEFINED
|
||||
#define MSVCRT_FILE_DEFINED
|
||||
typedef struct MSVCRT(_iobuf)
|
||||
#ifndef _FILE_DEFINED
|
||||
#define _FILE_DEFINED
|
||||
typedef struct _iobuf
|
||||
{
|
||||
char* _ptr;
|
||||
int _cnt;
|
||||
|
@ -107,29 +67,29 @@ typedef struct MSVCRT(_iobuf)
|
|||
int _charbuf;
|
||||
int _bufsiz;
|
||||
char* _tmpfname;
|
||||
} MSVCRT(FILE);
|
||||
#endif /* MSVCRT_FILE_DEFINED */
|
||||
} FILE;
|
||||
#endif /* _FILE_DEFINED */
|
||||
|
||||
#ifndef MSVCRT_FPOS_T_DEFINED
|
||||
typedef long MSVCRT(fpos_t);
|
||||
#define MSVCRT_FPOS_T_DEFINED
|
||||
#ifndef _FPOS_T_DEFINED
|
||||
typedef long fpos_t;
|
||||
#define _FPOS_T_DEFINED
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_SIZE_T_DEFINED
|
||||
typedef unsigned int MSVCRT(size_t);
|
||||
#define MSVCRT_SIZE_T_DEFINED
|
||||
#ifndef _SIZE_T_DEFINED
|
||||
typedef unsigned int size_t;
|
||||
#define _SIZE_T_DEFINED
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_WCHAR_T_DEFINED
|
||||
#define MSVCRT_WCHAR_T_DEFINED
|
||||
#ifndef _WCHAR_T_DEFINED
|
||||
#define _WCHAR_T_DEFINED
|
||||
#ifndef __cplusplus
|
||||
typedef unsigned short MSVCRT(wchar_t);
|
||||
typedef unsigned short wchar_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef _WCTYPE_T_DEFINED
|
||||
typedef unsigned short MSVCRT(wint_t);
|
||||
typedef unsigned short MSVCRT(wctype_t);
|
||||
typedef unsigned short wint_t;
|
||||
typedef unsigned short wctype_t;
|
||||
#define _WCTYPE_T_DEFINED
|
||||
#endif
|
||||
|
||||
|
@ -137,153 +97,145 @@ typedef unsigned short MSVCRT(wctype_t);
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_STDIO_DEFINED
|
||||
MSVCRT(FILE)* MSVCRT(__p__iob)(void);
|
||||
#ifndef _STDIO_DEFINED
|
||||
FILE* __p__iob(void);
|
||||
#define _iob (__p__iob())
|
||||
#endif /* MSVCRT_STDIO_DEFINED */
|
||||
#endif /* _STDIO_DEFINED */
|
||||
|
||||
#ifndef USE_MSVCRT_PREFIX
|
||||
#define stdin (_iob+STDIN_FILENO)
|
||||
#define stdout (_iob+STDOUT_FILENO)
|
||||
#define stderr (_iob+STDERR_FILENO)
|
||||
#else
|
||||
#define MSVCRT_stdin (MSVCRT__iob+MSVCRT_STDIN_FILENO)
|
||||
#define MSVCRT_stdout (MSVCRT__iob+MSVCRT_STDOUT_FILENO)
|
||||
#define MSVCRT_stderr (MSVCRT__iob+MSVCRT_STDERR_FILENO)
|
||||
#endif /* USE_MSVCRT_PREFIX */
|
||||
|
||||
#ifndef MSVCRT_STDIO_DEFINED
|
||||
#define MSVCRT_STDIO_DEFINED
|
||||
int MSVCRT(_fcloseall)(void);
|
||||
MSVCRT(FILE)* MSVCRT(_fdopen)(int,const char*);
|
||||
#ifndef _STDIO_DEFINED
|
||||
#define _STDIO_DEFINED
|
||||
int _fcloseall(void);
|
||||
FILE* _fdopen(int,const char*);
|
||||
int _fgetchar(void);
|
||||
int MSVCRT(_filbuf)(MSVCRT(FILE*));
|
||||
int MSVCRT(_fileno)(MSVCRT(FILE)*);
|
||||
int MSVCRT(_flsbuf)(int,MSVCRT(FILE)*);
|
||||
int _filbuf(FILE*);
|
||||
int _fileno(FILE*);
|
||||
int _flsbuf(int,FILE*);
|
||||
int _flushall(void);
|
||||
int _fputchar(int);
|
||||
MSVCRT(FILE)* _fsopen(const char*,const char*,int);
|
||||
FILE* _fsopen(const char*,const char*,int);
|
||||
int _getmaxstdio(void);
|
||||
int MSVCRT(_getw)(MSVCRT(FILE)*);
|
||||
int MSVCRT(_pclose)(MSVCRT(FILE)*);
|
||||
MSVCRT(FILE)* MSVCRT(_popen)(const char*,const char*);
|
||||
int MSVCRT(_putw)(int,MSVCRT(FILE)*);
|
||||
int _getw(FILE*);
|
||||
int _pclose(FILE*);
|
||||
FILE* _popen(const char*,const char*);
|
||||
int _putw(int,FILE*);
|
||||
int _rmtmp(void);
|
||||
int _setmaxstdio(int);
|
||||
int _snprintf(char*,MSVCRT(size_t),const char*,...);
|
||||
int _snprintf(char*,size_t,const char*,...);
|
||||
char* _tempnam(const char*,const char*);
|
||||
int _unlink(const char*);
|
||||
int _vsnprintf(char*,MSVCRT(size_t),const char*,va_list);
|
||||
int _vsnprintf(char*,size_t,const char*,va_list);
|
||||
|
||||
void MSVCRT(clearerr)(MSVCRT(FILE)*);
|
||||
int MSVCRT(fclose)(MSVCRT(FILE)*);
|
||||
int MSVCRT(feof)(MSVCRT(FILE)*);
|
||||
int MSVCRT(ferror)(MSVCRT(FILE)*);
|
||||
int MSVCRT(fflush)(MSVCRT(FILE)*);
|
||||
int MSVCRT(fgetc)(MSVCRT(FILE)*);
|
||||
int MSVCRT(fgetpos)(MSVCRT(FILE)*,MSVCRT(fpos_t)*);
|
||||
char* MSVCRT(fgets)(char*,int,MSVCRT(FILE)*);
|
||||
MSVCRT(FILE)* MSVCRT(fopen)(const char*,const char*);
|
||||
int MSVCRT(fprintf)(MSVCRT(FILE)*,const char*,...);
|
||||
int MSVCRT(fputc)(int,MSVCRT(FILE)*);
|
||||
int MSVCRT(fputs)(const char*,MSVCRT(FILE)*);
|
||||
MSVCRT(size_t) MSVCRT(fread)(void*,MSVCRT(size_t),MSVCRT(size_t),MSVCRT(FILE)*);
|
||||
MSVCRT(FILE)* MSVCRT(freopen)(const char*,const char*,MSVCRT(FILE)*);
|
||||
int MSVCRT(fscanf)(MSVCRT(FILE)*,const char*,...);
|
||||
int MSVCRT(fseek)(MSVCRT(FILE)*,long,int);
|
||||
int MSVCRT(fsetpos)(MSVCRT(FILE)*,MSVCRT(fpos_t)*);
|
||||
long MSVCRT(ftell)(MSVCRT(FILE)*);
|
||||
MSVCRT(size_t) MSVCRT(fwrite)(const void*,MSVCRT(size_t),MSVCRT(size_t),MSVCRT(FILE)*);
|
||||
int MSVCRT(getc)(MSVCRT(FILE)*);
|
||||
int MSVCRT(getchar)(void);
|
||||
char* MSVCRT(gets)(char*);
|
||||
void MSVCRT(perror)(const char*);
|
||||
int MSVCRT(printf)(const char*,...);
|
||||
int MSVCRT(putc)(int,MSVCRT(FILE)*);
|
||||
int MSVCRT(putchar)(int);
|
||||
int MSVCRT(puts)(const char*);
|
||||
int MSVCRT(remove)(const char*);
|
||||
int MSVCRT(rename)(const char*,const char*);
|
||||
void MSVCRT(rewind)(MSVCRT(FILE)*);
|
||||
int MSVCRT(scanf)(const char*,...);
|
||||
void MSVCRT(setbuf)(MSVCRT(FILE)*,char*);
|
||||
int MSVCRT(setvbuf)(MSVCRT(FILE)*,char*,int,MSVCRT(size_t));
|
||||
int MSVCRT(sprintf)(char*,const char*,...);
|
||||
int MSVCRT(sscanf)(const char*,const char*,...);
|
||||
MSVCRT(FILE)* MSVCRT(tmpfile)(void);
|
||||
char* MSVCRT(tmpnam)(char*);
|
||||
int MSVCRT(ungetc)(int,MSVCRT(FILE)*);
|
||||
int MSVCRT(vfprintf)(MSVCRT(FILE)*,const char*,va_list);
|
||||
int MSVCRT(vprintf)(const char*,va_list);
|
||||
int MSVCRT(vsprintf)(char*,const char*,va_list);
|
||||
void clearerr(FILE*);
|
||||
int fclose(FILE*);
|
||||
int feof(FILE*);
|
||||
int ferror(FILE*);
|
||||
int fflush(FILE*);
|
||||
int fgetc(FILE*);
|
||||
int fgetpos(FILE*,fpos_t*);
|
||||
char* fgets(char*,int,FILE*);
|
||||
FILE* fopen(const char*,const char*);
|
||||
int fprintf(FILE*,const char*,...);
|
||||
int fputc(int,FILE*);
|
||||
int fputs(const char*,FILE*);
|
||||
size_t fread(void*,size_t,size_t,FILE*);
|
||||
FILE* freopen(const char*,const char*,FILE*);
|
||||
int fscanf(FILE*,const char*,...);
|
||||
int fseek(FILE*,long,int);
|
||||
int fsetpos(FILE*,fpos_t*);
|
||||
long ftell(FILE*);
|
||||
size_t fwrite(const void*,size_t,size_t,FILE*);
|
||||
int getc(FILE*);
|
||||
int getchar(void);
|
||||
char* gets(char*);
|
||||
void perror(const char*);
|
||||
int printf(const char*,...);
|
||||
int putc(int,FILE*);
|
||||
int putchar(int);
|
||||
int puts(const char*);
|
||||
int remove(const char*);
|
||||
int rename(const char*,const char*);
|
||||
void rewind(FILE*);
|
||||
int scanf(const char*,...);
|
||||
void setbuf(FILE*,char*);
|
||||
int setvbuf(FILE*,char*,int,size_t);
|
||||
int sprintf(char*,const char*,...);
|
||||
int sscanf(const char*,const char*,...);
|
||||
FILE* tmpfile(void);
|
||||
char* tmpnam(char*);
|
||||
int ungetc(int,FILE*);
|
||||
int vfprintf(FILE*,const char*,va_list);
|
||||
int vprintf(const char*,va_list);
|
||||
int vsprintf(char*,const char*,va_list);
|
||||
|
||||
#ifndef MSVCRT_WSTDIO_DEFINED
|
||||
#define MSVCRT_WSTDIO_DEFINED
|
||||
MSVCRT(wint_t) _fgetwchar(void);
|
||||
MSVCRT(wint_t) _fputwchar(MSVCRT(wint_t));
|
||||
MSVCRT(wchar_t)*_getws(MSVCRT(wchar_t)*);
|
||||
int _putws(const MSVCRT(wchar_t)*);
|
||||
int _snwprintf(MSVCRT(wchar_t)*,MSVCRT(size_t),const MSVCRT(wchar_t)*,...);
|
||||
int _vsnwprintf(MSVCRT(wchar_t)*,MSVCRT(size_t),const MSVCRT(wchar_t)*,va_list);
|
||||
MSVCRT(FILE)* MSVCRT(_wfdopen)(int,const MSVCRT(wchar_t)*);
|
||||
MSVCRT(FILE)* MSVCRT(_wfopen)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
|
||||
MSVCRT(FILE)* MSVCRT(_wfreopen)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(FILE)*);
|
||||
MSVCRT(FILE)* MSVCRT(_wfsopen)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,int);
|
||||
void _wperror(const MSVCRT(wchar_t)*);
|
||||
MSVCRT(FILE)* MSVCRT(_wpopen)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
|
||||
int _wremove(const MSVCRT(wchar_t)*);
|
||||
MSVCRT(wchar_t)*_wtempnam(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
|
||||
MSVCRT(wchar_t)*_wtmpnam(MSVCRT(wchar_t)*);
|
||||
#ifndef _WSTDIO_DEFINED
|
||||
#define _WSTDIO_DEFINED
|
||||
wint_t _fgetwchar(void);
|
||||
wint_t _fputwchar(wint_t);
|
||||
wchar_t*_getws(wchar_t*);
|
||||
int _putws(const wchar_t*);
|
||||
int _snwprintf(wchar_t*,size_t,const wchar_t*,...);
|
||||
int _vsnwprintf(wchar_t*,size_t,const wchar_t*,va_list);
|
||||
FILE* _wfdopen(int,const wchar_t*);
|
||||
FILE* _wfopen(const wchar_t*,const wchar_t*);
|
||||
FILE* _wfreopen(const wchar_t*,const wchar_t*,FILE*);
|
||||
FILE* _wfsopen(const wchar_t*,const wchar_t*,int);
|
||||
void _wperror(const wchar_t*);
|
||||
FILE* _wpopen(const wchar_t*,const wchar_t*);
|
||||
int _wremove(const wchar_t*);
|
||||
wchar_t*_wtempnam(const wchar_t*,const wchar_t*);
|
||||
wchar_t*_wtmpnam(wchar_t*);
|
||||
|
||||
MSVCRT(wint_t) MSVCRT(fgetwc)(MSVCRT(FILE)*);
|
||||
MSVCRT(wchar_t)*MSVCRT(fgetws)(MSVCRT(wchar_t)*,int,MSVCRT(FILE)*);
|
||||
MSVCRT(wint_t) MSVCRT(fputwc)(MSVCRT(wint_t),MSVCRT(FILE)*);
|
||||
int MSVCRT(fputws)(const MSVCRT(wchar_t)*,MSVCRT(FILE)*);
|
||||
int MSVCRT(fwprintf)(MSVCRT(FILE)*,const MSVCRT(wchar_t)*,...);
|
||||
int MSVCRT(fputws)(const MSVCRT(wchar_t)*,MSVCRT(FILE)*);
|
||||
int MSVCRT(fwscanf)(MSVCRT(FILE)*,const MSVCRT(wchar_t)*,...);
|
||||
MSVCRT(wint_t) MSVCRT(getwc)(MSVCRT(FILE)*);
|
||||
MSVCRT(wint_t) MSVCRT(getwchar)(void);
|
||||
MSVCRT(wchar_t)*MSVCRT(getws)(MSVCRT(wchar_t)*);
|
||||
MSVCRT(wint_t) MSVCRT(putwc)(MSVCRT(wint_t),MSVCRT(FILE)*);
|
||||
MSVCRT(wint_t) MSVCRT(putwchar)(MSVCRT(wint_t));
|
||||
int MSVCRT(putws)(const MSVCRT(wchar_t)*);
|
||||
int MSVCRT(swprintf)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
|
||||
int MSVCRT(swscanf)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
|
||||
MSVCRT(wint_t) MSVCRT(ungetwc)(MSVCRT(wint_t),MSVCRT(FILE)*);
|
||||
int MSVCRT(vfwprintf)(MSVCRT(FILE)*,const MSVCRT(wchar_t)*,va_list);
|
||||
int MSVCRT(vswprintf)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,va_list);
|
||||
int MSVCRT(vwprintf)(const MSVCRT(wchar_t)*,va_list);
|
||||
int MSVCRT(wprintf)(const MSVCRT(wchar_t)*,...);
|
||||
int MSVCRT(wscanf)(const MSVCRT(wchar_t)*,...);
|
||||
#endif /* MSVCRT_WSTDIO_DEFINED */
|
||||
wint_t fgetwc(FILE*);
|
||||
wchar_t*fgetws(wchar_t*,int,FILE*);
|
||||
wint_t fputwc(wint_t,FILE*);
|
||||
int fputws(const wchar_t*,FILE*);
|
||||
int fwprintf(FILE*,const wchar_t*,...);
|
||||
int fputws(const wchar_t*,FILE*);
|
||||
int fwscanf(FILE*,const wchar_t*,...);
|
||||
wint_t getwc(FILE*);
|
||||
wint_t getwchar(void);
|
||||
wchar_t*getws(wchar_t*);
|
||||
wint_t putwc(wint_t,FILE*);
|
||||
wint_t putwchar(wint_t);
|
||||
int putws(const wchar_t*);
|
||||
int swprintf(wchar_t*,const wchar_t*,...);
|
||||
int swscanf(const wchar_t*,const wchar_t*,...);
|
||||
wint_t ungetwc(wint_t,FILE*);
|
||||
int vfwprintf(FILE*,const wchar_t*,va_list);
|
||||
int vswprintf(wchar_t*,const wchar_t*,va_list);
|
||||
int vwprintf(const wchar_t*,va_list);
|
||||
int wprintf(const wchar_t*,...);
|
||||
int wscanf(const wchar_t*,...);
|
||||
#endif /* _WSTDIO_DEFINED */
|
||||
|
||||
#endif /* MSVCRT_STDIO_DEFINED */
|
||||
#endif /* _STDIO_DEFINED */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef USE_MSVCRT_PREFIX
|
||||
static inline MSVCRT(FILE)* fdopen(int fd, const char *mode) { return _fdopen(fd, mode); }
|
||||
static inline FILE* fdopen(int fd, const char *mode) { return _fdopen(fd, mode); }
|
||||
static inline int fgetchar(void) { return _fgetchar(); }
|
||||
static inline int fileno(MSVCRT(FILE)* file) { return _fileno(file); }
|
||||
static inline int fileno(FILE* file) { return _fileno(file); }
|
||||
static inline int fputchar(int c) { return _fputchar(c); }
|
||||
static inline int pclose(MSVCRT(FILE)* file) { return _pclose(file); }
|
||||
static inline MSVCRT(FILE)* popen(const char* command, const char* mode) { return _popen(command, mode); }
|
||||
static inline int pclose(FILE* file) { return _pclose(file); }
|
||||
static inline FILE* popen(const char* command, const char* mode) { return _popen(command, mode); }
|
||||
static inline char* tempnam(const char *dir, const char *prefix) { return _tempnam(dir, prefix); }
|
||||
#ifndef MSVCRT_UNLINK_DEFINED
|
||||
#ifndef _UNLINK_DEFINED
|
||||
static inline int unlink(const char* path) { return _unlink(path); }
|
||||
#define MSVCRT_UNLINK_DEFINED
|
||||
#define _UNLINK_DEFINED
|
||||
#endif
|
||||
static inline int vsnprintf(char *buffer, size_t size, const char *format, va_list args) { return _vsnprintf(buffer,size,format,args); }
|
||||
|
||||
static inline MSVCRT(wint_t) fgetwchar(void) { return _fgetwchar(); }
|
||||
static inline MSVCRT(wint_t) fputwchar(MSVCRT(wint_t) wc) { return _fputwchar(wc); }
|
||||
static inline int getw(MSVCRT(FILE)* file) { return _getw(file); }
|
||||
static inline int putw(int val, MSVCRT(FILE)* file) { return _putw(val, file); }
|
||||
static inline MSVCRT(FILE)* wpopen(const MSVCRT(wchar_t)* command,const MSVCRT(wchar_t)* mode) { return _wpopen(command, mode); }
|
||||
#endif /* USE_MSVCRT_PREFIX */
|
||||
static inline wint_t fgetwchar(void) { return _fgetwchar(); }
|
||||
static inline wint_t fputwchar(wint_t wc) { return _fputwchar(wc); }
|
||||
static inline int getw(FILE* file) { return _getw(file); }
|
||||
static inline int putw(int val, FILE* file) { return _putw(val, file); }
|
||||
static inline FILE* wpopen(const wchar_t* command,const wchar_t* mode) { return _wpopen(command, mode); }
|
||||
|
||||
#endif /* __WINE_STDIO_H */
|
||||
|
|
|
@ -11,14 +11,6 @@
|
|||
#define __WINE_USE_MSVCRT
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT
|
||||
# ifdef USE_MSVCRT_PREFIX
|
||||
# define MSVCRT(x) MSVCRT_##x
|
||||
# else
|
||||
# define MSVCRT(x) x
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
#ifdef __cplusplus
|
||||
#define NULL 0
|
||||
|
@ -27,10 +19,10 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_WCHAR_T_DEFINED
|
||||
#define MSVCRT_WCHAR_T_DEFINED
|
||||
#ifndef _WCHAR_T_DEFINED
|
||||
#define _WCHAR_T_DEFINED
|
||||
#ifndef __cplusplus
|
||||
typedef unsigned short MSVCRT(wchar_t);
|
||||
typedef unsigned short wchar_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -40,13 +32,9 @@ typedef unsigned short MSVCRT(wchar_t);
|
|||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef USE_MSVCRT_PREFIX
|
||||
#define EXIT_SUCCESS 0
|
||||
#define EXIT_FAILURE -1
|
||||
#define RAND_MAX 0x7FFF
|
||||
#else
|
||||
#define MSVCRT_RAND_MAX 0x7FFF
|
||||
#endif /* USE_MSVCRT_PREFIX */
|
||||
|
||||
#ifndef _MAX_PATH
|
||||
#define _MAX_DRIVE 3
|
||||
|
@ -57,19 +45,19 @@ typedef unsigned short MSVCRT(wchar_t);
|
|||
#endif
|
||||
|
||||
|
||||
typedef struct MSVCRT(_div_t) {
|
||||
typedef struct _div_t {
|
||||
int quot;
|
||||
int rem;
|
||||
} MSVCRT(div_t);
|
||||
} div_t;
|
||||
|
||||
typedef struct MSVCRT(_ldiv_t) {
|
||||
typedef struct _ldiv_t {
|
||||
long quot;
|
||||
long rem;
|
||||
} MSVCRT(ldiv_t);
|
||||
} ldiv_t;
|
||||
|
||||
#ifndef MSVCRT_SIZE_T_DEFINED
|
||||
typedef unsigned int MSVCRT(size_t);
|
||||
#define MSVCRT_SIZE_T_DEFINED
|
||||
#ifndef _SIZE_T_DEFINED
|
||||
typedef unsigned int size_t;
|
||||
#define _SIZE_T_DEFINED
|
||||
#endif
|
||||
|
||||
#define __max(a,b) (((a) > (b)) ? (a) : (b))
|
||||
|
@ -101,17 +89,16 @@ extern unsigned int* __p__winminor();
|
|||
|
||||
extern int* __p___argc(void);
|
||||
extern char*** __p___argv(void);
|
||||
extern MSVCRT(wchar_t)*** __p___wargv(void);
|
||||
extern wchar_t*** __p___wargv(void);
|
||||
extern char*** __p__environ(void);
|
||||
extern MSVCRT(wchar_t)*** __p__wenviron(void);
|
||||
extern wchar_t*** __p__wenviron(void);
|
||||
extern int* __p___mb_cur_max(void);
|
||||
extern unsigned long* MSVCRT(__doserrno)(void);
|
||||
extern unsigned long* __doserrno(void);
|
||||
extern unsigned int* __p__fmode(void);
|
||||
/* FIXME: We need functions to access these:
|
||||
* int _sys_nerr;
|
||||
* char** _sys_errlist;
|
||||
*/
|
||||
#ifndef USE_MSVCRT_PREFIX
|
||||
#define __argc (*__p___argc())
|
||||
#define __argv (*__p___argv())
|
||||
#define __wargv (*__p___wargv())
|
||||
|
@ -120,18 +107,13 @@ extern unsigned int* __p__fmode(void);
|
|||
#define __mb_cur_max (*__p___mb_cur_max())
|
||||
#define _doserrno (*__doserrno())
|
||||
#define _fmode (*_fmode)
|
||||
#endif /* USE_MSVCRT_PREFIX */
|
||||
|
||||
|
||||
extern int* MSVCRT(_errno)(void);
|
||||
#ifndef USE_MSVCRT_PREFIX
|
||||
# define errno (*_errno())
|
||||
#else
|
||||
# define MSVCRT_errno (*MSVCRT__errno())
|
||||
#endif
|
||||
extern int* _errno(void);
|
||||
#define errno (*_errno())
|
||||
|
||||
|
||||
typedef int (*MSVCRT(_onexit_t))(void);
|
||||
typedef int (*_onexit_t)(void);
|
||||
|
||||
|
||||
__int64 _atoi64(const char*);
|
||||
|
@ -139,7 +121,7 @@ long double _atold(const char*);
|
|||
void _beep(unsigned int,unsigned int);
|
||||
char* _ecvt(double,int,int*,int*);
|
||||
char* _fcvt(double,int,int*,int*);
|
||||
char* _fullpath(char*,const char*,MSVCRT(size_t));
|
||||
char* _fullpath(char*,const char*,size_t);
|
||||
char* _gcvt(double,int,char*);
|
||||
char* _i64toa(__int64,char*,int);
|
||||
char* _itoa(int,char*,int);
|
||||
|
@ -147,8 +129,8 @@ char* _ltoa(long,char*,int);
|
|||
unsigned long _lrotl(unsigned long,int);
|
||||
unsigned long _lrotr(unsigned long,int);
|
||||
void _makepath(char*,const char*,const char*,const char*,const char*);
|
||||
MSVCRT(size_t) _mbstrlen(const char*);
|
||||
MSVCRT(_onexit_t) MSVCRT(_onexit)(MSVCRT(_onexit_t));
|
||||
size_t _mbstrlen(const char*);
|
||||
_onexit_t _onexit(_onexit_t);
|
||||
int _putenv(const char*);
|
||||
unsigned int _rotl(unsigned int,int);
|
||||
unsigned int _rotr(unsigned int,int);
|
||||
|
@ -158,75 +140,74 @@ void _seterrormode(int);
|
|||
void _sleep(unsigned long);
|
||||
void _splitpath(const char*,char*,char*,char*,char*);
|
||||
long double _strtold(const char*,char**);
|
||||
void MSVCRT(_swab)(char*,char*,int);
|
||||
void _swab(char*,char*,int);
|
||||
char* _ui64toa(unsigned __int64,char*,int);
|
||||
char* _ultoa(unsigned long,char*,int);
|
||||
|
||||
void MSVCRT(_exit)(int);
|
||||
void MSVCRT(abort)();
|
||||
int MSVCRT(abs)(int);
|
||||
int MSVCRT(atexit)(void (*)(void));
|
||||
double MSVCRT(atof)(const char*);
|
||||
int MSVCRT(atoi)(const char*);
|
||||
long MSVCRT(atol)(const char*);
|
||||
void* MSVCRT(calloc)(MSVCRT(size_t),MSVCRT(size_t));
|
||||
void _exit(int);
|
||||
void abort();
|
||||
int abs(int);
|
||||
int atexit(void (*)(void));
|
||||
double atof(const char*);
|
||||
int atoi(const char*);
|
||||
long atol(const char*);
|
||||
void* calloc(size_t,size_t);
|
||||
#ifndef __i386__
|
||||
MSVCRT(div_t) MSVCRT(div)(int,int);
|
||||
MSVCRT(ldiv_t) MSVCRT(ldiv)(long,long);
|
||||
div_t div(int,int);
|
||||
ldiv_t ldiv(long,long);
|
||||
#endif
|
||||
void MSVCRT(exit)(int);
|
||||
void MSVCRT(free)(void*);
|
||||
char* MSVCRT(getenv)(const char*);
|
||||
long MSVCRT(labs)(long);
|
||||
void* MSVCRT(malloc)(MSVCRT(size_t));
|
||||
int MSVCRT(mblen)(const char*,MSVCRT(size_t));
|
||||
void MSVCRT(perror)(const char*);
|
||||
int MSVCRT(rand)(void);
|
||||
void* MSVCRT(realloc)(void*,MSVCRT(size_t));
|
||||
void MSVCRT(srand)(unsigned int);
|
||||
double MSVCRT(strtod)(const char*,char**);
|
||||
long MSVCRT(strtol)(const char*,char**,int);
|
||||
unsigned long MSVCRT(strtoul)(const char*,char**,int);
|
||||
int MSVCRT(system)(const char*);
|
||||
void* MSVCRT(bsearch)(const void*,const void*,MSVCRT(size_t),MSVCRT(size_t),
|
||||
void exit(int);
|
||||
void free(void*);
|
||||
char* getenv(const char*);
|
||||
long labs(long);
|
||||
void* malloc(size_t);
|
||||
int mblen(const char*,size_t);
|
||||
void perror(const char*);
|
||||
int rand(void);
|
||||
void* realloc(void*,size_t);
|
||||
void srand(unsigned int);
|
||||
double strtod(const char*,char**);
|
||||
long strtol(const char*,char**,int);
|
||||
unsigned long strtoul(const char*,char**,int);
|
||||
int system(const char*);
|
||||
void* bsearch(const void*,const void*,size_t,size_t,
|
||||
int (*)(const void*,const void*));
|
||||
void MSVCRT(qsort)(void*,MSVCRT(size_t),MSVCRT(size_t),
|
||||
void qsort(void*,size_t,size_t,
|
||||
int (*)(const void*,const void*));
|
||||
|
||||
#ifndef MSVCRT_WSTDLIB_DEFINED
|
||||
#define MSVCRT_WSTDLIB_DEFINED
|
||||
MSVCRT(wchar_t)*_itow(int,MSVCRT(wchar_t)*,int);
|
||||
MSVCRT(wchar_t)*_i64tow(__int64,MSVCRT(wchar_t)*,int);
|
||||
MSVCRT(wchar_t)*_ltow(long,MSVCRT(wchar_t)*,int);
|
||||
MSVCRT(wchar_t)*_ui64tow(unsigned __int64,MSVCRT(wchar_t)*,int);
|
||||
MSVCRT(wchar_t)*_ultow(unsigned long,MSVCRT(wchar_t)*,int);
|
||||
MSVCRT(wchar_t)*_wfullpath(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
|
||||
MSVCRT(wchar_t)*_wgetenv(const MSVCRT(wchar_t)*);
|
||||
void _wmakepath(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
|
||||
void _wperror(const MSVCRT(wchar_t)*);
|
||||
int _wputenv(const MSVCRT(wchar_t)*);
|
||||
void _wsearchenv(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(wchar_t)*);
|
||||
void _wsplitpath(const MSVCRT(wchar_t)*,MSVCRT(wchar_t)*,MSVCRT(wchar_t)*,MSVCRT(wchar_t)*,MSVCRT(wchar_t)*);
|
||||
int _wsystem(const MSVCRT(wchar_t)*);
|
||||
int _wtoi(const MSVCRT(wchar_t)*);
|
||||
__int64 _wtoi64(const MSVCRT(wchar_t)*);
|
||||
long _wtol(const MSVCRT(wchar_t)*);
|
||||
#ifndef _WSTDLIB_DEFINED
|
||||
#define _WSTDLIB_DEFINED
|
||||
wchar_t*_itow(int,wchar_t*,int);
|
||||
wchar_t*_i64tow(__int64,wchar_t*,int);
|
||||
wchar_t*_ltow(long,wchar_t*,int);
|
||||
wchar_t*_ui64tow(unsigned __int64,wchar_t*,int);
|
||||
wchar_t*_ultow(unsigned long,wchar_t*,int);
|
||||
wchar_t*_wfullpath(wchar_t*,const wchar_t*,size_t);
|
||||
wchar_t*_wgetenv(const wchar_t*);
|
||||
void _wmakepath(wchar_t*,const wchar_t*,const wchar_t*,const wchar_t*,const wchar_t*);
|
||||
void _wperror(const wchar_t*);
|
||||
int _wputenv(const wchar_t*);
|
||||
void _wsearchenv(const wchar_t*,const wchar_t*,wchar_t*);
|
||||
void _wsplitpath(const wchar_t*,wchar_t*,wchar_t*,wchar_t*,wchar_t*);
|
||||
int _wsystem(const wchar_t*);
|
||||
int _wtoi(const wchar_t*);
|
||||
__int64 _wtoi64(const wchar_t*);
|
||||
long _wtol(const wchar_t*);
|
||||
|
||||
MSVCRT(size_t) MSVCRT(mbstowcs)(MSVCRT(wchar_t)*,const char*,MSVCRT(size_t));
|
||||
int MSVCRT(mbtowc)(MSVCRT(wchar_t)*,const char*,MSVCRT(size_t));
|
||||
double MSVCRT(wcstod)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t)**);
|
||||
long MSVCRT(wcstol)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t)**,int);
|
||||
MSVCRT(size_t) MSVCRT(wcstombs)(char*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
|
||||
unsigned long MSVCRT(wcstoul)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t)**,int);
|
||||
int MSVCRT(wctomb)(char*,MSVCRT(wchar_t));
|
||||
#endif /* MSVCRT_WSTDLIB_DEFINED */
|
||||
size_t mbstowcs(wchar_t*,const char*,size_t);
|
||||
int mbtowc(wchar_t*,const char*,size_t);
|
||||
double wcstod(const wchar_t*,wchar_t**);
|
||||
long wcstol(const wchar_t*,wchar_t**,int);
|
||||
size_t wcstombs(char*,const wchar_t*,size_t);
|
||||
unsigned long wcstoul(const wchar_t*,wchar_t**,int);
|
||||
int wctomb(char*,wchar_t);
|
||||
#endif /* _WSTDLIB_DEFINED */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef USE_MSVCRT_PREFIX
|
||||
#define environ _environ
|
||||
#define onexit_t _onexit_t
|
||||
|
||||
|
@ -263,6 +244,4 @@ static inline ldiv_t __wine_msvcrt_ldiv(long num, long denom)
|
|||
#define ldiv(num,denom) __wine_msvcrt_ldiv(num,denom)
|
||||
#endif
|
||||
|
||||
#endif /* USE_MSVCRT_PREFIX */
|
||||
|
||||
#endif /* __WINE_STDLIB_H */
|
||||
|
|
|
@ -11,29 +11,21 @@
|
|||
#define __WINE_USE_MSVCRT
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT
|
||||
# ifdef USE_MSVCRT_PREFIX
|
||||
# define MSVCRT(x) MSVCRT_##x
|
||||
# else
|
||||
# define MSVCRT(x) x
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_WCHAR_T_DEFINED
|
||||
#define MSVCRT_WCHAR_T_DEFINED
|
||||
#ifndef _WCHAR_T_DEFINED
|
||||
#define _WCHAR_T_DEFINED
|
||||
#ifndef __cplusplus
|
||||
typedef unsigned short MSVCRT(wchar_t);
|
||||
typedef unsigned short wchar_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_SIZE_T_DEFINED
|
||||
typedef unsigned int MSVCRT(size_t);
|
||||
#define MSVCRT_SIZE_T_DEFINED
|
||||
#ifndef _SIZE_T_DEFINED
|
||||
typedef unsigned int size_t;
|
||||
#define _SIZE_T_DEFINED
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_NLSCMP_DEFINED
|
||||
#ifndef _NLSCMP_DEFINED
|
||||
#define _NLSCMPERROR ((unsigned int)0x7fffffff)
|
||||
#define MSVCRT_NLSCMP_DEFINED
|
||||
#define _NLSCMP_DEFINED
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
|
@ -56,73 +48,72 @@ char* _strerror(const char*);
|
|||
int _stricmp(const char*,const char*);
|
||||
int _stricoll(const char*,const char*);
|
||||
char* _strlwr(char*);
|
||||
int _strnicmp(const char*,const char*,MSVCRT(size_t));
|
||||
char* _strnset(char*,int,MSVCRT(size_t));
|
||||
int _strnicmp(const char*,const char*,size_t);
|
||||
char* _strnset(char*,int,size_t);
|
||||
char* _strrev(char*);
|
||||
char* _strset(char*,int);
|
||||
char* _strupr(char*);
|
||||
|
||||
void* MSVCRT(memchr)(const void*,int,MSVCRT(size_t));
|
||||
int MSVCRT(memcmp)(const void*,const void*,MSVCRT(size_t));
|
||||
void* MSVCRT(memcpy)(void*,const void*,MSVCRT(size_t));
|
||||
void* MSVCRT(memmove)(void*,const void*,MSVCRT(size_t));
|
||||
void* MSVCRT(memset)(void*,int,MSVCRT(size_t));
|
||||
char* MSVCRT(strcat)(char*,const char*);
|
||||
char* MSVCRT(strchr)(const char*,int);
|
||||
int MSVCRT(strcmp)(const char*,const char*);
|
||||
int MSVCRT(strcoll)(const char*,const char*);
|
||||
char* MSVCRT(strcpy)(char*,const char*);
|
||||
MSVCRT(size_t) MSVCRT(strcspn)(const char*,const char*);
|
||||
char* MSVCRT(strerror)(int);
|
||||
MSVCRT(size_t) MSVCRT(strlen)(const char*);
|
||||
char* MSVCRT(strncat)(char*,const char*,MSVCRT(size_t));
|
||||
int MSVCRT(strncmp)(const char*,const char*,MSVCRT(size_t));
|
||||
char* MSVCRT(strncpy)(char*,const char*,MSVCRT(size_t));
|
||||
char* MSVCRT(strpbrk)(const char*,const char*);
|
||||
char* MSVCRT(strrchr)(const char*,int);
|
||||
MSVCRT(size_t) MSVCRT(strspn)(const char*,const char*);
|
||||
char* MSVCRT(strstr)(const char*,const char*);
|
||||
char* MSVCRT(strtok)(char*,const char*);
|
||||
MSVCRT(size_t) MSVCRT(strxfrm)(char*,const char*,MSVCRT(size_t));
|
||||
void* memchr(const void*,int,size_t);
|
||||
int memcmp(const void*,const void*,size_t);
|
||||
void* memcpy(void*,const void*,size_t);
|
||||
void* memmove(void*,const void*,size_t);
|
||||
void* memset(void*,int,size_t);
|
||||
char* strcat(char*,const char*);
|
||||
char* strchr(const char*,int);
|
||||
int strcmp(const char*,const char*);
|
||||
int strcoll(const char*,const char*);
|
||||
char* strcpy(char*,const char*);
|
||||
size_t strcspn(const char*,const char*);
|
||||
char* strerror(int);
|
||||
size_t strlen(const char*);
|
||||
char* strncat(char*,const char*,size_t);
|
||||
int strncmp(const char*,const char*,size_t);
|
||||
char* strncpy(char*,const char*,size_t);
|
||||
char* strpbrk(const char*,const char*);
|
||||
char* strrchr(const char*,int);
|
||||
size_t strspn(const char*,const char*);
|
||||
char* strstr(const char*,const char*);
|
||||
char* strtok(char*,const char*);
|
||||
size_t strxfrm(char*,const char*,size_t);
|
||||
|
||||
#ifndef MSVCRT_WSTRING_DEFINED
|
||||
#define MSVCRT_WSTRING_DEFINED
|
||||
MSVCRT(wchar_t)*_wcsdup(const MSVCRT(wchar_t)*);
|
||||
int _wcsicmp(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
|
||||
int _wcsicoll(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
|
||||
MSVCRT(wchar_t)*_wcslwr(MSVCRT(wchar_t)*);
|
||||
int _wcsnicmp(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
|
||||
MSVCRT(wchar_t)*_wcsnset(MSVCRT(wchar_t)*,MSVCRT(wchar_t),MSVCRT(size_t));
|
||||
MSVCRT(wchar_t)*_wcsrev(MSVCRT(wchar_t)*);
|
||||
MSVCRT(wchar_t)*_wcsset(MSVCRT(wchar_t)*,MSVCRT(wchar_t));
|
||||
MSVCRT(wchar_t)*_wcsupr(MSVCRT(wchar_t)*);
|
||||
#ifndef _WSTRING_DEFINED
|
||||
#define _WSTRING_DEFINED
|
||||
wchar_t*_wcsdup(const wchar_t*);
|
||||
int _wcsicmp(const wchar_t*,const wchar_t*);
|
||||
int _wcsicoll(const wchar_t*,const wchar_t*);
|
||||
wchar_t*_wcslwr(wchar_t*);
|
||||
int _wcsnicmp(const wchar_t*,const wchar_t*,size_t);
|
||||
wchar_t*_wcsnset(wchar_t*,wchar_t,size_t);
|
||||
wchar_t*_wcsrev(wchar_t*);
|
||||
wchar_t*_wcsset(wchar_t*,wchar_t);
|
||||
wchar_t*_wcsupr(wchar_t*);
|
||||
|
||||
MSVCRT(wchar_t)*MSVCRT(wcscat)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
|
||||
MSVCRT(wchar_t)*MSVCRT(wcschr)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t));
|
||||
int MSVCRT(wcscmp)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
|
||||
int MSVCRT(wcscoll)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
|
||||
MSVCRT(wchar_t)*MSVCRT(wcscpy)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
|
||||
MSVCRT(size_t) MSVCRT(wcscspn)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
|
||||
MSVCRT(size_t) MSVCRT(wcslen)(const MSVCRT(wchar_t)*);
|
||||
MSVCRT(wchar_t)*MSVCRT(wcsncat)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
|
||||
int MSVCRT(wcsncmp)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
|
||||
MSVCRT(wchar_t)*MSVCRT(wcsncpy)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
|
||||
MSVCRT(wchar_t)*MSVCRT(wcspbrk)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
|
||||
MSVCRT(wchar_t)*MSVCRT(wcsrchr)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t) wcFor);
|
||||
MSVCRT(size_t) MSVCRT(wcsspn)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
|
||||
MSVCRT(wchar_t)*MSVCRT(wcsstr)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
|
||||
MSVCRT(wchar_t)*MSVCRT(wcstok)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
|
||||
MSVCRT(size_t) MSVCRT(wcsxfrm)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
|
||||
#endif /* MSVCRT_WSTRING_DEFINED */
|
||||
wchar_t*wcscat(wchar_t*,const wchar_t*);
|
||||
wchar_t*wcschr(const wchar_t*,wchar_t);
|
||||
int wcscmp(const wchar_t*,const wchar_t*);
|
||||
int wcscoll(const wchar_t*,const wchar_t*);
|
||||
wchar_t*wcscpy(wchar_t*,const wchar_t*);
|
||||
size_t wcscspn(const wchar_t*,const wchar_t*);
|
||||
size_t wcslen(const wchar_t*);
|
||||
wchar_t*wcsncat(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*wcspbrk(const wchar_t*,const wchar_t*);
|
||||
wchar_t*wcsrchr(const wchar_t*,wchar_t wcFor);
|
||||
size_t wcsspn(const wchar_t*,const wchar_t*);
|
||||
wchar_t*wcsstr(const wchar_t*,const wchar_t*);
|
||||
wchar_t*wcstok(wchar_t*,const wchar_t*);
|
||||
size_t wcsxfrm(wchar_t*,const wchar_t*,size_t);
|
||||
#endif /* _WSTRING_DEFINED */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef USE_MSVCRT_PREFIX
|
||||
static inline void* memccpy(void *s1, const void *s2, int c, MSVCRT(size_t) n) { return _memccpy(s1, s2, c, n); }
|
||||
static inline int memicmp(const void* s1, const void* s2, MSVCRT(size_t) len) { return _memicmp(s1, s2, len); }
|
||||
static inline void* memccpy(void *s1, const void *s2, int c, size_t n) { return _memccpy(s1, s2, c, n); }
|
||||
static inline int memicmp(const void* s1, const void* s2, size_t len) { return _memicmp(s1, s2, len); }
|
||||
static inline int strcasecmp(const char* s1, const char* s2) { return _stricmp(s1, s2); }
|
||||
static inline int strcmpi(const char* s1, const char* s2) { return _strcmpi(s1, s2); }
|
||||
static inline char* strdup(const char* buf) { return _strdup(buf); }
|
||||
|
@ -130,20 +121,19 @@ static inline int stricmp(const char* s1, const char* s2) { return _stricmp(s1,
|
|||
static inline int stricoll(const char* s1, const char* s2) { return _stricoll(s1, s2); }
|
||||
static inline char* strlwr(char* str) { return _strlwr(str); }
|
||||
static inline int strncasecmp(const char *str1, const char *str2, size_t n) { return _strnicmp(str1, str2, n); }
|
||||
static inline int strnicmp(const char* s1, const char* s2, MSVCRT(size_t) n) { return _strnicmp(s1, s2, n); }
|
||||
static inline int strnicmp(const char* s1, const char* s2, size_t n) { return _strnicmp(s1, s2, n); }
|
||||
static inline char* strnset(char* str, int value, unsigned int len) { return _strnset(str, value, len); }
|
||||
static inline char* strrev(char* str) { return _strrev(str); }
|
||||
static inline char* strset(char* str, int value) { return _strset(str, value); }
|
||||
static inline char* strupr(char* str) { return _strupr(str); }
|
||||
|
||||
static inline MSVCRT(wchar_t)* wcsdup(const MSVCRT(wchar_t)* str) { return _wcsdup(str); }
|
||||
static inline int wcsicoll(const MSVCRT(wchar_t)* str1, const MSVCRT(wchar_t)* str2) { return _wcsicoll(str1, str2); }
|
||||
static inline MSVCRT(wchar_t)* wcslwr(MSVCRT(wchar_t)* str) { return _wcslwr(str); }
|
||||
static inline int wcsnicmp(const MSVCRT(wchar_t)* str1, const MSVCRT(wchar_t)* str2, MSVCRT(size_t) n) { return _wcsnicmp(str1, str2, n); }
|
||||
static inline MSVCRT(wchar_t)* wcsnset(MSVCRT(wchar_t)* str, MSVCRT(wchar_t) c, MSVCRT(size_t) n) { return _wcsnset(str, c, n); }
|
||||
static inline MSVCRT(wchar_t)* wcsrev(MSVCRT(wchar_t)* str) { return _wcsrev(str); }
|
||||
static inline MSVCRT(wchar_t)* wcsset(MSVCRT(wchar_t)* str, MSVCRT(wchar_t) c) { return _wcsset(str, c); }
|
||||
static inline MSVCRT(wchar_t)* wcsupr(MSVCRT(wchar_t)* str) { return _wcsupr(str); }
|
||||
#endif /* USE_MSVCRT_PREFIX */
|
||||
static inline wchar_t* wcsdup(const wchar_t* str) { return _wcsdup(str); }
|
||||
static inline int wcsicoll(const wchar_t* str1, const wchar_t* str2) { return _wcsicoll(str1, str2); }
|
||||
static inline wchar_t* wcslwr(wchar_t* str) { return _wcslwr(str); }
|
||||
static inline int wcsnicmp(const wchar_t* str1, const wchar_t* str2, size_t n) { return _wcsnicmp(str1, str2, n); }
|
||||
static inline wchar_t* wcsnset(wchar_t* str, wchar_t c, size_t n) { return _wcsnset(str, c, n); }
|
||||
static inline wchar_t* wcsrev(wchar_t* str) { return _wcsrev(str); }
|
||||
static inline wchar_t* wcsset(wchar_t* str, wchar_t c) { return _wcsset(str, c); }
|
||||
static inline wchar_t* wcsupr(wchar_t* str) { return _wcsupr(str); }
|
||||
|
||||
#endif /* __WINE_STRING_H */
|
||||
|
|
|
@ -13,18 +13,10 @@
|
|||
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifndef MSVCRT
|
||||
# ifdef USE_MSVCRT_PREFIX
|
||||
# define MSVCRT(x) MSVCRT_##x
|
||||
# else
|
||||
# define MSVCRT(x) x
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_WCHAR_T_DEFINED
|
||||
#define MSVCRT_WCHAR_T_DEFINED
|
||||
#ifndef _WCHAR_T_DEFINED
|
||||
#define _WCHAR_T_DEFINED
|
||||
#ifndef __cplusplus
|
||||
typedef unsigned short MSVCRT(wchar_t);
|
||||
typedef unsigned short wchar_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -34,24 +26,24 @@ typedef unsigned short MSVCRT(wchar_t);
|
|||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_DEV_T_DEFINED
|
||||
typedef unsigned int MSVCRT(_dev_t);
|
||||
#define MSVCRT_DEV_T_DEFINED
|
||||
#ifndef _DEV_T_DEFINED
|
||||
typedef unsigned int _dev_t;
|
||||
#define _DEV_T_DEFINED
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_INO_T_DEFINED
|
||||
typedef unsigned short MSVCRT(_ino_t);
|
||||
#define MSVCRT_INO_T_DEFINED
|
||||
#ifndef _INO_T_DEFINED
|
||||
typedef unsigned short _ino_t;
|
||||
#define _INO_T_DEFINED
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_TIME_T_DEFINED
|
||||
typedef long MSVCRT(time_t);
|
||||
#define MSVCRT_TIME_T_DEFINED
|
||||
#ifndef _TIME_T_DEFINED
|
||||
typedef long time_t;
|
||||
#define _TIME_T_DEFINED
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_OFF_T_DEFINED
|
||||
typedef int MSVCRT(_off_t);
|
||||
#define MSVCRT_OFF_T_DEFINED
|
||||
#ifndef _OFF_T_DEFINED
|
||||
typedef int _off_t;
|
||||
#define _OFF_T_DEFINED
|
||||
#endif
|
||||
|
||||
#define _S_IEXEC 0x0040
|
||||
|
@ -68,74 +60,73 @@ typedef int MSVCRT(_off_t);
|
|||
#undef st_ctime
|
||||
#undef st_mtime
|
||||
|
||||
#ifndef MSVCRT_STAT_DEFINED
|
||||
#define MSVCRT_STAT_DEFINED
|
||||
#ifndef _STAT_DEFINED
|
||||
#define _STAT_DEFINED
|
||||
|
||||
struct MSVCRT(_stat) {
|
||||
MSVCRT(_dev_t) st_dev;
|
||||
MSVCRT(_ino_t) st_ino;
|
||||
struct _stat {
|
||||
_dev_t st_dev;
|
||||
_ino_t st_ino;
|
||||
unsigned short st_mode;
|
||||
short st_nlink;
|
||||
short st_uid;
|
||||
short st_gid;
|
||||
MSVCRT(_dev_t) st_rdev;
|
||||
MSVCRT(_off_t) st_size;
|
||||
MSVCRT(time_t) st_atime;
|
||||
MSVCRT(time_t) st_mtime;
|
||||
MSVCRT(time_t) st_ctime;
|
||||
_dev_t st_rdev;
|
||||
_off_t st_size;
|
||||
time_t st_atime;
|
||||
time_t st_mtime;
|
||||
time_t st_ctime;
|
||||
};
|
||||
|
||||
struct MSVCRT(stat) {
|
||||
MSVCRT(_dev_t) st_dev;
|
||||
MSVCRT(_ino_t) st_ino;
|
||||
struct stat {
|
||||
_dev_t st_dev;
|
||||
_ino_t st_ino;
|
||||
unsigned short st_mode;
|
||||
short st_nlink;
|
||||
short st_uid;
|
||||
short st_gid;
|
||||
MSVCRT(_dev_t) st_rdev;
|
||||
MSVCRT(_off_t) st_size;
|
||||
MSVCRT(time_t) st_atime;
|
||||
MSVCRT(time_t) st_mtime;
|
||||
MSVCRT(time_t) st_ctime;
|
||||
_dev_t st_rdev;
|
||||
_off_t st_size;
|
||||
time_t st_atime;
|
||||
time_t st_mtime;
|
||||
time_t st_ctime;
|
||||
};
|
||||
|
||||
struct MSVCRT(_stati64) {
|
||||
MSVCRT(_dev_t) st_dev;
|
||||
MSVCRT(_ino_t) st_ino;
|
||||
struct _stati64 {
|
||||
_dev_t st_dev;
|
||||
_ino_t st_ino;
|
||||
unsigned short st_mode;
|
||||
short st_nlink;
|
||||
short st_uid;
|
||||
short st_gid;
|
||||
MSVCRT(_dev_t) st_rdev;
|
||||
_dev_t st_rdev;
|
||||
__int64 st_size;
|
||||
MSVCRT(time_t) st_atime;
|
||||
MSVCRT(time_t) st_mtime;
|
||||
MSVCRT(time_t) st_ctime;
|
||||
time_t st_atime;
|
||||
time_t st_mtime;
|
||||
time_t st_ctime;
|
||||
};
|
||||
#endif /* MSVCRT_STAT_DEFINED */
|
||||
#endif /* _STAT_DEFINED */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int MSVCRT(_fstat)(int,struct MSVCRT(_stat)*);
|
||||
int MSVCRT(_stat)(const char*,struct MSVCRT(_stat)*);
|
||||
int MSVCRT(_fstati64)(int,struct MSVCRT(_stati64)*);
|
||||
int MSVCRT(_stati64)(const char*,struct MSVCRT(_stati64)*);
|
||||
int _fstat(int,struct _stat*);
|
||||
int _stat(const char*,struct _stat*);
|
||||
int _fstati64(int,struct _stati64*);
|
||||
int _stati64(const char*,struct _stati64*);
|
||||
int _umask(int);
|
||||
|
||||
#ifndef MSVCRT_WSTAT_DEFINED
|
||||
#define MSVCRT_WSTAT_DEFINED
|
||||
int MSVCRT(_wstat)(const MSVCRT(wchar_t)*,struct MSVCRT(_stat)*);
|
||||
int MSVCRT(_wstati64)(const MSVCRT(wchar_t)*,struct MSVCRT(_stati64)*);
|
||||
#endif /* MSVCRT_WSTAT_DEFINED */
|
||||
#ifndef _WSTAT_DEFINED
|
||||
#define _WSTAT_DEFINED
|
||||
int _wstat(const wchar_t*,struct _stat*);
|
||||
int _wstati64(const wchar_t*,struct _stati64*);
|
||||
#endif /* _WSTAT_DEFINED */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef USE_MSVCRT_PREFIX
|
||||
#define S_IFMT _S_IFMT
|
||||
#define S_IFDIR _S_IFDIR
|
||||
#define S_IFCHR _S_IFCHR
|
||||
|
@ -151,10 +142,9 @@ int MSVCRT(_wstati64)(const MSVCRT(wchar_t)*,struct MSVCRT(_stati64)*);
|
|||
|
||||
static inline int fstat(int fd, struct stat* ptr) { return _fstat(fd, (struct _stat*)ptr); }
|
||||
static inline int stat(const char* path, struct stat* ptr) { return _stat(path, (struct _stat*)ptr); }
|
||||
#ifndef MSVCRT_UMASK_DEFINED
|
||||
#ifndef _UMASK_DEFINED
|
||||
static inline int umask(int fd) { return _umask(fd); }
|
||||
#define MSVCRT_UMASK_DEFINED
|
||||
#define _UMASK_DEFINED
|
||||
#endif
|
||||
#endif /* USE_MSVCRT_PREFIX */
|
||||
|
||||
#endif /* __WINE_SYS_STAT_H */
|
||||
|
|
|
@ -23,29 +23,21 @@
|
|||
#define __WINE_USE_MSVCRT
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT
|
||||
# ifdef USE_MSVCRT_PREFIX
|
||||
# define MSVCRT(x) MSVCRT_##x
|
||||
# else
|
||||
# define MSVCRT(x) x
|
||||
# endif
|
||||
#ifndef _TIME_T_DEFINED
|
||||
typedef long time_t;
|
||||
#define _TIME_T_DEFINED
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_TIME_T_DEFINED
|
||||
typedef long MSVCRT(time_t);
|
||||
#define MSVCRT_TIME_T_DEFINED
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_TIMEB_DEFINED
|
||||
#define MSVCRT_TIMEB_DEFINED
|
||||
#ifndef _TIMEB_DEFINED
|
||||
#define _TIMEB_DEFINED
|
||||
struct _timeb
|
||||
{
|
||||
MSVCRT(time_t) time;
|
||||
time_t time;
|
||||
unsigned short millitm;
|
||||
short timezone;
|
||||
short dstflag;
|
||||
};
|
||||
#endif /* MSVCRT_TIMEB_DEFINED */
|
||||
#endif /* _TIMEB_DEFINED */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -59,10 +51,8 @@ void _ftime(struct _timeb*);
|
|||
#endif
|
||||
|
||||
|
||||
#ifndef USE_MSVCRT_PREFIX
|
||||
#define timeb _timeb
|
||||
|
||||
static inline void ftime(struct _timeb* ptr) { return _ftime(ptr); }
|
||||
#endif /* USE_MSVCRT_PREFIX */
|
||||
|
||||
#endif /* __WINE_SYS_TIMEB_H */
|
||||
|
|
|
@ -23,52 +23,42 @@
|
|||
#define __WINE_USE_MSVCRT
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT
|
||||
# ifdef USE_MSVCRT_PREFIX
|
||||
# define MSVCRT(x) MSVCRT_##x
|
||||
# else
|
||||
# define MSVCRT(x) x
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_DEV_T_DEFINED
|
||||
#ifndef _DEV_T_DEFINED
|
||||
typedef unsigned int _dev_t;
|
||||
#define MSVCRT_DEV_T_DEFINED
|
||||
#define _DEV_T_DEFINED
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_INO_T_DEFINED
|
||||
#ifndef _INO_T_DEFINED
|
||||
typedef unsigned short _ino_t;
|
||||
#define MSVCRT_INO_T_DEFINED
|
||||
#define _INO_T_DEFINED
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_MODE_T_DEFINED
|
||||
#ifndef _MODE_T_DEFINED
|
||||
typedef unsigned short _mode_t;
|
||||
#define MSVCRT_MODE_T_DEFINED
|
||||
#define _MODE_T_DEFINED
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_OFF_T_DEFINED
|
||||
typedef int MSVCRT(_off_t);
|
||||
#define MSVCRT_OFF_T_DEFINED
|
||||
#ifndef _OFF_T_DEFINED
|
||||
typedef int _off_t;
|
||||
#define _OFF_T_DEFINED
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_TIME_T_DEFINED
|
||||
typedef long MSVCRT(time_t);
|
||||
#define MSVCRT_TIME_T_DEFINED
|
||||
#ifndef _TIME_T_DEFINED
|
||||
typedef long time_t;
|
||||
#define _TIME_T_DEFINED
|
||||
#endif
|
||||
|
||||
#ifndef USE_MSVCRT_PREFIX
|
||||
#ifndef MSVCRT_BSD_TYPES_DEFINED
|
||||
#ifndef _BSD_TYPES_DEFINED
|
||||
typedef unsigned char u_char;
|
||||
typedef unsigned short u_short;
|
||||
typedef unsigned int u_int;
|
||||
typedef unsigned long u_long;
|
||||
#define MSVCRT_BSD_TYPES_DEFINED
|
||||
#define _BSD_TYPES_DEFINED
|
||||
#endif
|
||||
|
||||
#define dev_t _dev_t
|
||||
#define ino_t _ino_t
|
||||
#define mode_t _mode_t
|
||||
#define off_t _off_t
|
||||
#endif /* USE_MSVCRT_PREFIX */
|
||||
|
||||
#endif /* __WINE_SYS_TYPES_H */
|
||||
|
|
|
@ -23,34 +23,26 @@
|
|||
#define __WINE_USE_MSVCRT
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT
|
||||
# ifdef USE_MSVCRT_PREFIX
|
||||
# define MSVCRT(x) MSVCRT_##x
|
||||
# else
|
||||
# define MSVCRT(x) x
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_WCHAR_T_DEFINED
|
||||
#define MSVCRT_WCHAR_T_DEFINED
|
||||
#ifndef _WCHAR_T_DEFINED
|
||||
#define _WCHAR_T_DEFINED
|
||||
#ifndef __cplusplus
|
||||
typedef unsigned short MSVCRT(wchar_t);
|
||||
typedef unsigned short wchar_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_TIME_T_DEFINED
|
||||
typedef long MSVCRT(time_t);
|
||||
#define MSVCRT_TIME_T_DEFINED
|
||||
#ifndef _TIME_T_DEFINED
|
||||
typedef long time_t;
|
||||
#define _TIME_T_DEFINED
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_UTIMBUF_DEFINED
|
||||
#define MSVCRT_UTIMBUF_DEFINED
|
||||
#ifndef _UTIMBUF_DEFINED
|
||||
#define _UTIMBUF_DEFINED
|
||||
struct _utimbuf
|
||||
{
|
||||
MSVCRT(time_t) actime;
|
||||
MSVCRT(time_t) modtime;
|
||||
time_t actime;
|
||||
time_t modtime;
|
||||
};
|
||||
#endif /* MSVCRT_UTIMBUF_DEFINED */
|
||||
#endif /* _UTIMBUF_DEFINED */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -59,17 +51,15 @@ extern "C" {
|
|||
int _futime(int,struct _utimbuf*);
|
||||
int _utime(const char*,struct _utimbuf*);
|
||||
|
||||
int _wutime(const MSVCRT(wchar_t)*,struct _utimbuf*);
|
||||
int _wutime(const wchar_t*,struct _utimbuf*);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef USE_MSVCRT_PREFIX
|
||||
#define utimbuf _utimbuf
|
||||
|
||||
static inline int utime(const char* path, struct _utimbuf* buf) { return _utime(path, buf); }
|
||||
#endif /* USE_MSVCRT_PREFIX */
|
||||
|
||||
#endif /* __WINE_SYS_UTIME_H */
|
||||
|
|
|
@ -23,34 +23,26 @@
|
|||
#define __WINE_USE_MSVCRT
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT
|
||||
# ifdef USE_MSVCRT_PREFIX
|
||||
# define MSVCRT(x) MSVCRT_##x
|
||||
# else
|
||||
# define MSVCRT(x) x
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_WCHAR_T_DEFINED
|
||||
#define MSVCRT_WCHAR_T_DEFINED
|
||||
#ifndef _WCHAR_T_DEFINED
|
||||
#define _WCHAR_T_DEFINED
|
||||
#ifndef __cplusplus
|
||||
typedef unsigned short MSVCRT(wchar_t);
|
||||
typedef unsigned short wchar_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_SIZE_T_DEFINED
|
||||
typedef unsigned int MSVCRT(size_t);
|
||||
#define MSVCRT_SIZE_T_DEFINED
|
||||
#ifndef _SIZE_T_DEFINED
|
||||
typedef unsigned int size_t;
|
||||
#define _SIZE_T_DEFINED
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_TIME_T_DEFINED
|
||||
typedef long MSVCRT(time_t);
|
||||
#define MSVCRT_TIME_T_DEFINED
|
||||
#ifndef _TIME_T_DEFINED
|
||||
typedef long time_t;
|
||||
#define _TIME_T_DEFINED
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_CLOCK_T_DEFINED
|
||||
typedef long MSVCRT(clock_t);
|
||||
#define MSVCRT_CLOCK_T_DEFINED
|
||||
#ifndef _CLOCK_T_DEFINED
|
||||
typedef long clock_t;
|
||||
#define _CLOCK_T_DEFINED
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
|
@ -65,9 +57,9 @@ typedef long MSVCRT(clock_t);
|
|||
#define CLOCKS_PER_SEC 1000
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_TM_DEFINED
|
||||
#define MSVCRT_TM_DEFINED
|
||||
struct MSVCRT(tm) {
|
||||
#ifndef _TM_DEFINED
|
||||
#define _TM_DEFINED
|
||||
struct tm {
|
||||
int tm_sec;
|
||||
int tm_min;
|
||||
int tm_hour;
|
||||
|
@ -78,7 +70,7 @@ struct MSVCRT(tm) {
|
|||
int tm_yday;
|
||||
int tm_isdst;
|
||||
};
|
||||
#endif /* MSVCRT_TM_DEFINED */
|
||||
#endif /* _TM_DEFINED */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -87,30 +79,30 @@ extern "C" {
|
|||
/* FIXME: Must do something for _daylight, _dstbias, _timezone, _tzname */
|
||||
|
||||
|
||||
unsigned _getsystime(struct MSVCRT(tm)*);
|
||||
unsigned _setsystime(struct MSVCRT(tm)*,unsigned);
|
||||
unsigned _getsystime(struct tm*);
|
||||
unsigned _setsystime(struct tm*,unsigned);
|
||||
char* _strdate(char*);
|
||||
char* _strtime(char*);
|
||||
void _tzset(void);
|
||||
|
||||
char* MSVCRT(asctime)(const struct MSVCRT(tm)*);
|
||||
MSVCRT(clock_t) MSVCRT(clock)(void);
|
||||
char* MSVCRT(ctime)(const MSVCRT(time_t)*);
|
||||
double MSVCRT(difftime)(MSVCRT(time_t),MSVCRT(time_t));
|
||||
struct MSVCRT(tm)* MSVCRT(gmtime)(const MSVCRT(time_t)*);
|
||||
struct MSVCRT(tm)* MSVCRT(localtime)(const MSVCRT(time_t)*);
|
||||
MSVCRT(time_t) MSVCRT(mktime)(struct MSVCRT(tm)*);
|
||||
size_t MSVCRT(strftime)(char*,size_t,const char*,const struct MSVCRT(tm)*);
|
||||
MSVCRT(time_t) MSVCRT(time)(MSVCRT(time_t)*);
|
||||
char* asctime(const struct tm*);
|
||||
clock_t clock(void);
|
||||
char* ctime(const time_t*);
|
||||
double difftime(time_t,time_t);
|
||||
struct tm* gmtime(const time_t*);
|
||||
struct tm* localtime(const time_t*);
|
||||
time_t mktime(struct tm*);
|
||||
size_t strftime(char*,size_t,const char*,const struct tm*);
|
||||
time_t time(time_t*);
|
||||
|
||||
#ifndef MSVCRT_WTIME_DEFINED
|
||||
#define MSVCRT_WTIME_DEFINED
|
||||
MSVCRT(wchar_t)* MSVCRT(_wasctime)(const struct MSVCRT(tm)*);
|
||||
MSVCRT(size_t) MSVCRT(wcsftime)(MSVCRT(wchar_t)*,MSVCRT(size_t),const MSVCRT(wchar_t)*,const struct MSVCRT(tm)*);
|
||||
MSVCRT(wchar_t)*_wctime(const MSVCRT(time_t)*);
|
||||
MSVCRT(wchar_t)*_wstrdate(MSVCRT(wchar_t)*);
|
||||
MSVCRT(wchar_t)*_wstrtime(MSVCRT(wchar_t)*);
|
||||
#endif /* MSVCRT_WTIME_DEFINED */
|
||||
#ifndef _WTIME_DEFINED
|
||||
#define _WTIME_DEFINED
|
||||
wchar_t* _wasctime(const struct tm*);
|
||||
size_t wcsftime(wchar_t*,size_t,const wchar_t*,const struct tm*);
|
||||
wchar_t*_wctime(const time_t*);
|
||||
wchar_t*_wstrdate(wchar_t*);
|
||||
wchar_t*_wstrtime(wchar_t*);
|
||||
#endif /* _WTIME_DEFINED */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -13,22 +13,14 @@
|
|||
|
||||
#include <stdarg.h>
|
||||
|
||||
#ifndef MSVCRT
|
||||
# ifdef USE_MSVCRT_PREFIX
|
||||
# define MSVCRT(x) MSVCRT_##x
|
||||
# else
|
||||
# define MSVCRT(x) x
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_WCHAR_T_DEFINED
|
||||
#define MSVCRT_WCHAR_T_DEFINED
|
||||
#ifndef _WCHAR_T_DEFINED
|
||||
#define _WCHAR_T_DEFINED
|
||||
#ifndef __cplusplus
|
||||
typedef unsigned short MSVCRT(wchar_t);
|
||||
typedef unsigned short wchar_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -41,18 +33,18 @@ typedef unsigned short MSVCRT(wchar_t);
|
|||
#endif
|
||||
|
||||
#define WCHAR_MIN 0
|
||||
#define WCHAR_MAX ((MSVCRT(wchar_t))-1)
|
||||
#define WCHAR_MAX ((wchar_t)-1)
|
||||
|
||||
typedef int MSVCRT(mbstate_t);
|
||||
typedef int mbstate_t;
|
||||
|
||||
#ifndef MSVCRT_SIZE_T_DEFINED
|
||||
typedef unsigned int MSVCRT(size_t);
|
||||
#define MSVCRT_SIZE_T_DEFINED
|
||||
#ifndef _SIZE_T_DEFINED
|
||||
typedef unsigned int size_t;
|
||||
#define _SIZE_T_DEFINED
|
||||
#endif
|
||||
|
||||
#ifndef _WCTYPE_T_DEFINED
|
||||
typedef unsigned short MSVCRT(wint_t);
|
||||
typedef unsigned short MSVCRT(wctype_t);
|
||||
typedef unsigned short wint_t;
|
||||
typedef unsigned short wctype_t;
|
||||
#define _WCTYPE_T_DEFINED
|
||||
#endif
|
||||
|
||||
|
@ -62,44 +54,38 @@ typedef unsigned short MSVCRT(wctype_t);
|
|||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef USE_MSVCRT_PREFIX
|
||||
# ifndef WEOF
|
||||
# define WEOF (wint_t)(0xFFFF)
|
||||
# endif
|
||||
#else
|
||||
# ifndef MSVCRT_WEOF
|
||||
# define MSVCRT_WEOF (MSVCRT_wint_t)(0xFFFF)
|
||||
# endif
|
||||
#endif /* USE_MSVCRT_PREFIX */
|
||||
#ifndef WEOF
|
||||
#define WEOF (wint_t)(0xFFFF)
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_FSIZE_T_DEFINED
|
||||
#ifndef _FSIZE_T_DEFINED
|
||||
typedef unsigned long _fsize_t;
|
||||
#define MSVCRT_FSIZE_T_DEFINED
|
||||
#define _FSIZE_T_DEFINED
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_DEV_T_DEFINED
|
||||
#ifndef _DEV_T_DEFINED
|
||||
typedef unsigned int _dev_t;
|
||||
#define MSVCRT_DEV_T_DEFINED
|
||||
#define _DEV_T_DEFINED
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_INO_T_DEFINED
|
||||
#ifndef _INO_T_DEFINED
|
||||
typedef unsigned short _ino_t;
|
||||
#define MSVCRT_INO_T_DEFINED
|
||||
#define _INO_T_DEFINED
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_OFF_T_DEFINED
|
||||
typedef int MSVCRT(_off_t);
|
||||
#define MSVCRT_OFF_T_DEFINED
|
||||
#ifndef _OFF_T_DEFINED
|
||||
typedef int _off_t;
|
||||
#define _OFF_T_DEFINED
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_TIME_T_DEFINED
|
||||
typedef long MSVCRT(time_t);
|
||||
#define MSVCRT_TIME_T_DEFINED
|
||||
#ifndef _TIME_T_DEFINED
|
||||
typedef long time_t;
|
||||
#define _TIME_T_DEFINED
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_TM_DEFINED
|
||||
#define MSVCRT_TM_DEFINED
|
||||
struct MSVCRT(tm) {
|
||||
#ifndef _TM_DEFINED
|
||||
#define _TM_DEFINED
|
||||
struct tm {
|
||||
int tm_sec;
|
||||
int tm_min;
|
||||
int tm_hour;
|
||||
|
@ -110,11 +96,11 @@ struct MSVCRT(tm) {
|
|||
int tm_yday;
|
||||
int tm_isdst;
|
||||
};
|
||||
#endif /* MSVCRT_TM_DEFINED */
|
||||
#endif /* _TM_DEFINED */
|
||||
|
||||
#ifndef MSVCRT_FILE_DEFINED
|
||||
#define MSVCRT_FILE_DEFINED
|
||||
typedef struct MSVCRT(_iobuf)
|
||||
#ifndef _FILE_DEFINED
|
||||
#define _FILE_DEFINED
|
||||
typedef struct _iobuf
|
||||
{
|
||||
char* _ptr;
|
||||
int _cnt;
|
||||
|
@ -124,77 +110,77 @@ typedef struct MSVCRT(_iobuf)
|
|||
int _charbuf;
|
||||
int _bufsiz;
|
||||
char* _tmpfname;
|
||||
} MSVCRT(FILE);
|
||||
#endif /* MSVCRT_FILE_DEFINED */
|
||||
} FILE;
|
||||
#endif /* _FILE_DEFINED */
|
||||
|
||||
#ifndef MSVCRT_WFINDDATA_T_DEFINED
|
||||
#define MSVCRT_WFINDDATA_T_DEFINED
|
||||
#ifndef _WFINDDATA_T_DEFINED
|
||||
#define _WFINDDATA_T_DEFINED
|
||||
|
||||
struct MSVCRT(_wfinddata_t) {
|
||||
struct _wfinddata_t {
|
||||
unsigned attrib;
|
||||
MSVCRT(time_t) time_create;
|
||||
MSVCRT(time_t) time_access;
|
||||
MSVCRT(time_t) time_write;
|
||||
MSVCRT(_fsize_t) size;
|
||||
MSVCRT(wchar_t) name[260];
|
||||
time_t time_create;
|
||||
time_t time_access;
|
||||
time_t time_write;
|
||||
_fsize_t size;
|
||||
wchar_t name[260];
|
||||
};
|
||||
|
||||
struct MSVCRT(_wfinddatai64_t) {
|
||||
struct _wfinddatai64_t {
|
||||
unsigned attrib;
|
||||
MSVCRT(time_t) time_create;
|
||||
MSVCRT(time_t) time_access;
|
||||
MSVCRT(time_t) time_write;
|
||||
time_t time_create;
|
||||
time_t time_access;
|
||||
time_t time_write;
|
||||
__int64 size;
|
||||
MSVCRT(wchar_t) name[260];
|
||||
wchar_t name[260];
|
||||
};
|
||||
|
||||
#endif /* MSVCRT_WFINDDATA_T_DEFINED */
|
||||
#endif /* _WFINDDATA_T_DEFINED */
|
||||
|
||||
#ifndef MSVCRT_STAT_DEFINED
|
||||
#define MSVCRT_STAT_DEFINED
|
||||
#ifndef _STAT_DEFINED
|
||||
#define _STAT_DEFINED
|
||||
|
||||
struct MSVCRT(_stat) {
|
||||
MSVCRT(_dev_t) st_dev;
|
||||
MSVCRT(_ino_t) st_ino;
|
||||
struct _stat {
|
||||
_dev_t st_dev;
|
||||
_ino_t st_ino;
|
||||
unsigned short st_mode;
|
||||
short st_nlink;
|
||||
short st_uid;
|
||||
short st_gid;
|
||||
MSVCRT(_dev_t) st_rdev;
|
||||
MSVCRT(_off_t) st_size;
|
||||
MSVCRT(time_t) st_atime;
|
||||
MSVCRT(time_t) st_mtime;
|
||||
MSVCRT(time_t) st_ctime;
|
||||
_dev_t st_rdev;
|
||||
_off_t st_size;
|
||||
time_t st_atime;
|
||||
time_t st_mtime;
|
||||
time_t st_ctime;
|
||||
};
|
||||
|
||||
struct MSVCRT(stat) {
|
||||
MSVCRT(_dev_t) st_dev;
|
||||
MSVCRT(_ino_t) st_ino;
|
||||
struct stat {
|
||||
_dev_t st_dev;
|
||||
_ino_t st_ino;
|
||||
unsigned short st_mode;
|
||||
short st_nlink;
|
||||
short st_uid;
|
||||
short st_gid;
|
||||
MSVCRT(_dev_t) st_rdev;
|
||||
MSVCRT(_off_t) st_size;
|
||||
MSVCRT(time_t) st_atime;
|
||||
MSVCRT(time_t) st_mtime;
|
||||
MSVCRT(time_t) st_ctime;
|
||||
_dev_t st_rdev;
|
||||
_off_t st_size;
|
||||
time_t st_atime;
|
||||
time_t st_mtime;
|
||||
time_t st_ctime;
|
||||
};
|
||||
|
||||
struct MSVCRT(_stati64) {
|
||||
MSVCRT(_dev_t) st_dev;
|
||||
MSVCRT(_ino_t) st_ino;
|
||||
struct _stati64 {
|
||||
_dev_t st_dev;
|
||||
_ino_t st_ino;
|
||||
unsigned short st_mode;
|
||||
short st_nlink;
|
||||
short st_uid;
|
||||
short st_gid;
|
||||
MSVCRT(_dev_t) st_rdev;
|
||||
_dev_t st_rdev;
|
||||
__int64 st_size;
|
||||
MSVCRT(time_t) st_atime;
|
||||
MSVCRT(time_t) st_mtime;
|
||||
MSVCRT(time_t) st_ctime;
|
||||
time_t st_atime;
|
||||
time_t st_mtime;
|
||||
time_t st_ctime;
|
||||
};
|
||||
#endif /* MSVCRT_STAT_DEFINED */
|
||||
#endif /* _STAT_DEFINED */
|
||||
|
||||
/* ASCII char classification table - binary compatible */
|
||||
#define _UPPER 0x0001 /* C1_UPPER */
|
||||
|
@ -208,199 +194,199 @@ struct MSVCRT(_stati64) {
|
|||
#define _LEADBYTE 0x8000
|
||||
#define _ALPHA (0x0100|_UPPER|_LOWER) /* (C1_ALPHA|_UPPER|_LOWER) */
|
||||
|
||||
#ifndef MSVCRT_WCTYPE_DEFINED
|
||||
#define MSVCRT_WCTYPE_DEFINED
|
||||
int MSVCRT(is_wctype)(MSVCRT(wint_t),MSVCRT(wctype_t));
|
||||
int MSVCRT(isleadbyte)(int);
|
||||
int MSVCRT(iswalnum)(MSVCRT(wint_t));
|
||||
int MSVCRT(iswalpha)(MSVCRT(wint_t));
|
||||
int MSVCRT(iswascii)(MSVCRT(wint_t));
|
||||
int MSVCRT(iswcntrl)(MSVCRT(wint_t));
|
||||
int MSVCRT(iswctype)(MSVCRT(wint_t),MSVCRT(wctype_t));
|
||||
int MSVCRT(iswdigit)(MSVCRT(wint_t));
|
||||
int MSVCRT(iswgraph)(MSVCRT(wint_t));
|
||||
int MSVCRT(iswlower)(MSVCRT(wint_t));
|
||||
int MSVCRT(iswprint)(MSVCRT(wint_t));
|
||||
int MSVCRT(iswpunct)(MSVCRT(wint_t));
|
||||
int MSVCRT(iswspace)(MSVCRT(wint_t));
|
||||
int MSVCRT(iswupper)(MSVCRT(wint_t));
|
||||
int MSVCRT(iswxdigit)(MSVCRT(wint_t));
|
||||
MSVCRT(wchar_t) MSVCRT(towlower)(MSVCRT(wchar_t));
|
||||
MSVCRT(wchar_t) MSVCRT(towupper)(MSVCRT(wchar_t));
|
||||
#endif /* MSVCRT_WCTYPE_DEFINED */
|
||||
#ifndef _WCTYPE_DEFINED
|
||||
#define _WCTYPE_DEFINED
|
||||
int is_wctype(wint_t,wctype_t);
|
||||
int isleadbyte(int);
|
||||
int iswalnum(wint_t);
|
||||
int iswalpha(wint_t);
|
||||
int iswascii(wint_t);
|
||||
int iswcntrl(wint_t);
|
||||
int iswctype(wint_t,wctype_t);
|
||||
int iswdigit(wint_t);
|
||||
int iswgraph(wint_t);
|
||||
int iswlower(wint_t);
|
||||
int iswprint(wint_t);
|
||||
int iswpunct(wint_t);
|
||||
int iswspace(wint_t);
|
||||
int iswupper(wint_t);
|
||||
int iswxdigit(wint_t);
|
||||
wchar_t towlower(wchar_t);
|
||||
wchar_t towupper(wchar_t);
|
||||
#endif /* _WCTYPE_DEFINED */
|
||||
|
||||
#ifndef MSVCRT_WDIRECT_DEFINED
|
||||
#define MSVCRT_WDIRECT_DEFINED
|
||||
int _wchdir(const MSVCRT(wchar_t)*);
|
||||
MSVCRT(wchar_t)* _wgetcwd(MSVCRT(wchar_t)*,int);
|
||||
MSVCRT(wchar_t)* _wgetdcwd(int,MSVCRT(wchar_t)*,int);
|
||||
int _wmkdir(const MSVCRT(wchar_t)*);
|
||||
int _wrmdir(const MSVCRT(wchar_t)*);
|
||||
#endif /* MSVCRT_WDIRECT_DEFINED */
|
||||
#ifndef _WDIRECT_DEFINED
|
||||
#define _WDIRECT_DEFINED
|
||||
int _wchdir(const wchar_t*);
|
||||
wchar_t* _wgetcwd(wchar_t*,int);
|
||||
wchar_t* _wgetdcwd(int,wchar_t*,int);
|
||||
int _wmkdir(const wchar_t*);
|
||||
int _wrmdir(const wchar_t*);
|
||||
#endif /* _WDIRECT_DEFINED */
|
||||
|
||||
#ifndef MSVCRT_WIO_DEFINED
|
||||
#define MSVCRT_WIO_DEFINED
|
||||
int _waccess(const MSVCRT(wchar_t)*,int);
|
||||
int _wchmod(const MSVCRT(wchar_t)*,int);
|
||||
int _wcreat(const MSVCRT(wchar_t)*,int);
|
||||
long _wfindfirst(const MSVCRT(wchar_t)*,struct _wfinddata_t*);
|
||||
long _wfindfirsti64(const MSVCRT(wchar_t)*, struct _wfinddatai64_t*);
|
||||
#ifndef _WIO_DEFINED
|
||||
#define _WIO_DEFINED
|
||||
int _waccess(const wchar_t*,int);
|
||||
int _wchmod(const wchar_t*,int);
|
||||
int _wcreat(const wchar_t*,int);
|
||||
long _wfindfirst(const wchar_t*,struct _wfinddata_t*);
|
||||
long _wfindfirsti64(const wchar_t*, struct _wfinddatai64_t*);
|
||||
int _wfindnext(long,struct _wfinddata_t*);
|
||||
int _wfindnexti64(long, struct _wfinddatai64_t*);
|
||||
MSVCRT(wchar_t)*_wmktemp(MSVCRT(wchar_t)*);
|
||||
int _wopen(const MSVCRT(wchar_t)*,int,...);
|
||||
int _wrename(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
|
||||
int _wsopen(const MSVCRT(wchar_t)*,int,int,...);
|
||||
int _wunlink(const MSVCRT(wchar_t)*);
|
||||
#endif /* MSVCRT_WIO_DEFINED */
|
||||
wchar_t*_wmktemp(wchar_t*);
|
||||
int _wopen(const wchar_t*,int,...);
|
||||
int _wrename(const wchar_t*,const wchar_t*);
|
||||
int _wsopen(const wchar_t*,int,int,...);
|
||||
int _wunlink(const wchar_t*);
|
||||
#endif /* _WIO_DEFINED */
|
||||
|
||||
#ifndef MSVCRT_WLOCALE_DEFINED
|
||||
#define MSVCRT_WLOCALE_DEFINED
|
||||
MSVCRT(wchar_t)* _wsetlocale(int,const MSVCRT(wchar_t)*);
|
||||
#endif /* MSVCRT_WLOCALE_DEFINED */
|
||||
#ifndef _WLOCALE_DEFINED
|
||||
#define _WLOCALE_DEFINED
|
||||
wchar_t* _wsetlocale(int,const wchar_t*);
|
||||
#endif /* _WLOCALE_DEFINED */
|
||||
|
||||
#ifndef MSVCRT_WPROCESS_DEFINED
|
||||
#define MSVCRT_WPROCESS_DEFINED
|
||||
int _wexecl(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
|
||||
int _wexecle(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
|
||||
int _wexeclp(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
|
||||
int _wexeclpe(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
|
||||
int _wexecv(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
|
||||
int _wexecve(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
|
||||
int _wexecvp(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
|
||||
int _wexecvpe(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
|
||||
int _wspawnl(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
|
||||
int _wspawnle(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
|
||||
int _wspawnlp(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
|
||||
int _wspawnlpe(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
|
||||
int _wspawnv(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
|
||||
int _wspawnve(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
|
||||
int _wspawnvp(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
|
||||
int _wspawnvpe(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
|
||||
int _wsystem(const MSVCRT(wchar_t)*);
|
||||
#endif /* MSVCRT_WPROCESS_DEFINED */
|
||||
#ifndef _WPROCESS_DEFINED
|
||||
#define _WPROCESS_DEFINED
|
||||
int _wexecl(const wchar_t*,const wchar_t*,...);
|
||||
int _wexecle(const wchar_t*,const wchar_t*,...);
|
||||
int _wexeclp(const wchar_t*,const wchar_t*,...);
|
||||
int _wexeclpe(const wchar_t*,const wchar_t*,...);
|
||||
int _wexecv(const wchar_t*,const wchar_t* const *);
|
||||
int _wexecve(const wchar_t*,const wchar_t* const *,const wchar_t* const *);
|
||||
int _wexecvp(const wchar_t*,const wchar_t* const *);
|
||||
int _wexecvpe(const wchar_t*,const wchar_t* const *,const wchar_t* const *);
|
||||
int _wspawnl(int,const wchar_t*,const wchar_t*,...);
|
||||
int _wspawnle(int,const wchar_t*,const wchar_t*,...);
|
||||
int _wspawnlp(int,const wchar_t*,const wchar_t*,...);
|
||||
int _wspawnlpe(int,const wchar_t*,const wchar_t*,...);
|
||||
int _wspawnv(int,const wchar_t*,const wchar_t* const *);
|
||||
int _wspawnve(int,const wchar_t*,const wchar_t* const *,const wchar_t* const *);
|
||||
int _wspawnvp(int,const wchar_t*,const wchar_t* const *);
|
||||
int _wspawnvpe(int,const wchar_t*,const wchar_t* const *,const wchar_t* const *);
|
||||
int _wsystem(const wchar_t*);
|
||||
#endif /* _WPROCESS_DEFINED */
|
||||
|
||||
#ifndef MSVCRT_WSTAT_DEFINED
|
||||
#define MSVCRT_WSTAT_DEFINED
|
||||
int _wstat(const MSVCRT(wchar_t)*,struct MSVCRT(_stat)*);
|
||||
int _wstati64(const MSVCRT(wchar_t)*,struct MSVCRT(_stati64)*);
|
||||
#endif /* MSVCRT_WSTAT_DEFINED */
|
||||
#ifndef _WSTAT_DEFINED
|
||||
#define _WSTAT_DEFINED
|
||||
int _wstat(const wchar_t*,struct _stat*);
|
||||
int _wstati64(const wchar_t*,struct _stati64*);
|
||||
#endif /* _WSTAT_DEFINED */
|
||||
|
||||
#ifndef MSVCRT_WSTDIO_DEFINED
|
||||
#define MSVCRT_WSTDIO_DEFINED
|
||||
MSVCRT(wint_t) _fgetwchar(void);
|
||||
MSVCRT(wint_t) _fputwchar(MSVCRT(wint_t));
|
||||
MSVCRT(wchar_t)*_getws(MSVCRT(wchar_t)*);
|
||||
int _putws(const MSVCRT(wchar_t)*);
|
||||
int _snwprintf(MSVCRT(wchar_t)*,MSVCRT(size_t),const MSVCRT(wchar_t)*,...);
|
||||
int _vsnwprintf(MSVCRT(wchar_t)*,MSVCRT(size_t),const MSVCRT(wchar_t)*,va_list);
|
||||
MSVCRT(FILE)* _wfdopen(int,const MSVCRT(wchar_t)*);
|
||||
MSVCRT(FILE)* _wfopen(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
|
||||
MSVCRT(FILE)* _wfreopen(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(FILE)*);
|
||||
MSVCRT(FILE)* _wfsopen(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,int);
|
||||
void _wperror(const MSVCRT(wchar_t)*);
|
||||
MSVCRT(FILE)* _wpopen(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
|
||||
int _wremove(const MSVCRT(wchar_t)*);
|
||||
MSVCRT(wchar_t)*_wtempnam(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
|
||||
MSVCRT(wchar_t)*_wtmpnam(MSVCRT(wchar_t)*);
|
||||
#ifndef _WSTDIO_DEFINED
|
||||
#define _WSTDIO_DEFINED
|
||||
wint_t _fgetwchar(void);
|
||||
wint_t _fputwchar(wint_t);
|
||||
wchar_t*_getws(wchar_t*);
|
||||
int _putws(const wchar_t*);
|
||||
int _snwprintf(wchar_t*,size_t,const wchar_t*,...);
|
||||
int _vsnwprintf(wchar_t*,size_t,const wchar_t*,va_list);
|
||||
FILE* _wfdopen(int,const wchar_t*);
|
||||
FILE* _wfopen(const wchar_t*,const wchar_t*);
|
||||
FILE* _wfreopen(const wchar_t*,const wchar_t*,FILE*);
|
||||
FILE* _wfsopen(const wchar_t*,const wchar_t*,int);
|
||||
void _wperror(const wchar_t*);
|
||||
FILE* _wpopen(const wchar_t*,const wchar_t*);
|
||||
int _wremove(const wchar_t*);
|
||||
wchar_t*_wtempnam(const wchar_t*,const wchar_t*);
|
||||
wchar_t*_wtmpnam(wchar_t*);
|
||||
|
||||
MSVCRT(wint_t) MSVCRT(fgetwc)(MSVCRT(FILE)*);
|
||||
MSVCRT(wchar_t)*MSVCRT(fgetws)(MSVCRT(wchar_t)*,int,MSVCRT(FILE)*);
|
||||
MSVCRT(wint_t) MSVCRT(fputwc)(MSVCRT(wint_t),MSVCRT(FILE)*);
|
||||
int MSVCRT(fputws)(const MSVCRT(wchar_t)*,MSVCRT(FILE)*);
|
||||
int MSVCRT(fwprintf)(MSVCRT(FILE)*,const MSVCRT(wchar_t)*,...);
|
||||
int MSVCRT(fputws)(const MSVCRT(wchar_t)*,MSVCRT(FILE)*);
|
||||
int MSVCRT(fwscanf)(MSVCRT(FILE)*,const MSVCRT(wchar_t)*,...);
|
||||
MSVCRT(wint_t) MSVCRT(getwc)(MSVCRT(FILE)*);
|
||||
MSVCRT(wint_t) MSVCRT(getwchar)(void);
|
||||
MSVCRT(wchar_t)*MSVCRT(getws)(MSVCRT(wchar_t)*);
|
||||
MSVCRT(wint_t) MSVCRT(putwc)(MSVCRT(wint_t),MSVCRT(FILE)*);
|
||||
MSVCRT(wint_t) MSVCRT(putwchar)(MSVCRT(wint_t));
|
||||
int MSVCRT(putws)(const MSVCRT(wchar_t)*);
|
||||
int MSVCRT(swprintf)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
|
||||
int MSVCRT(swscanf)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
|
||||
MSVCRT(wint_t) MSVCRT(ungetwc)(MSVCRT(wint_t),MSVCRT(FILE)*);
|
||||
int MSVCRT(vfwprintf)(MSVCRT(FILE)*,const MSVCRT(wchar_t)*,va_list);
|
||||
int MSVCRT(vswprintf)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,va_list);
|
||||
int MSVCRT(vwprintf)(const MSVCRT(wchar_t)*,va_list);
|
||||
int MSVCRT(wprintf)(const MSVCRT(wchar_t)*,...);
|
||||
int MSVCRT(wscanf)(const MSVCRT(wchar_t)*,...);
|
||||
#endif /* MSVCRT_WSTDIO_DEFINED */
|
||||
wint_t fgetwc(FILE*);
|
||||
wchar_t*fgetws(wchar_t*,int,FILE*);
|
||||
wint_t fputwc(wint_t,FILE*);
|
||||
int fputws(const wchar_t*,FILE*);
|
||||
int fwprintf(FILE*,const wchar_t*,...);
|
||||
int fputws(const wchar_t*,FILE*);
|
||||
int fwscanf(FILE*,const wchar_t*,...);
|
||||
wint_t getwc(FILE*);
|
||||
wint_t getwchar(void);
|
||||
wchar_t*getws(wchar_t*);
|
||||
wint_t putwc(wint_t,FILE*);
|
||||
wint_t putwchar(wint_t);
|
||||
int putws(const wchar_t*);
|
||||
int swprintf(wchar_t*,const wchar_t*,...);
|
||||
int swscanf(const wchar_t*,const wchar_t*,...);
|
||||
wint_t ungetwc(wint_t,FILE*);
|
||||
int vfwprintf(FILE*,const wchar_t*,va_list);
|
||||
int vswprintf(wchar_t*,const wchar_t*,va_list);
|
||||
int vwprintf(const wchar_t*,va_list);
|
||||
int wprintf(const wchar_t*,...);
|
||||
int wscanf(const wchar_t*,...);
|
||||
#endif /* _WSTDIO_DEFINED */
|
||||
|
||||
#ifndef MSVCRT_WSTDLIB_DEFINED
|
||||
#define MSVCRT_WSTDLIB_DEFINED
|
||||
MSVCRT(wchar_t)*_itow(int,MSVCRT(wchar_t)*,int);
|
||||
MSVCRT(wchar_t)*_i64tow(__int64,MSVCRT(wchar_t)*,int);
|
||||
MSVCRT(wchar_t)*_ltow(long,MSVCRT(wchar_t)*,int);
|
||||
MSVCRT(wchar_t)*_ui64tow(unsigned __int64,MSVCRT(wchar_t)*,int);
|
||||
MSVCRT(wchar_t)*_ultow(unsigned long,MSVCRT(wchar_t)*,int);
|
||||
MSVCRT(wchar_t)*_wfullpath(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,size_t);
|
||||
MSVCRT(wchar_t)*_wgetenv(const MSVCRT(wchar_t)*);
|
||||
void _wmakepath(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
|
||||
void _wperror(const MSVCRT(wchar_t)*);
|
||||
int _wputenv(const MSVCRT(wchar_t)*);
|
||||
void _wsearchenv(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(wchar_t)*);
|
||||
void _wsplitpath(const MSVCRT(wchar_t)*,MSVCRT(wchar_t)*,MSVCRT(wchar_t)*,MSVCRT(wchar_t)*,MSVCRT(wchar_t)*);
|
||||
int _wsystem(const MSVCRT(wchar_t)*);
|
||||
int _wtoi(const MSVCRT(wchar_t)*);
|
||||
__int64 _wtoi64(const MSVCRT(wchar_t)*);
|
||||
long _wtol(const MSVCRT(wchar_t)*);
|
||||
#ifndef _WSTDLIB_DEFINED
|
||||
#define _WSTDLIB_DEFINED
|
||||
wchar_t*_itow(int,wchar_t*,int);
|
||||
wchar_t*_i64tow(__int64,wchar_t*,int);
|
||||
wchar_t*_ltow(long,wchar_t*,int);
|
||||
wchar_t*_ui64tow(unsigned __int64,wchar_t*,int);
|
||||
wchar_t*_ultow(unsigned long,wchar_t*,int);
|
||||
wchar_t*_wfullpath(wchar_t*,const wchar_t*,size_t);
|
||||
wchar_t*_wgetenv(const wchar_t*);
|
||||
void _wmakepath(wchar_t*,const wchar_t*,const wchar_t*,const wchar_t*,const wchar_t*);
|
||||
void _wperror(const wchar_t*);
|
||||
int _wputenv(const wchar_t*);
|
||||
void _wsearchenv(const wchar_t*,const wchar_t*,wchar_t*);
|
||||
void _wsplitpath(const wchar_t*,wchar_t*,wchar_t*,wchar_t*,wchar_t*);
|
||||
int _wsystem(const wchar_t*);
|
||||
int _wtoi(const wchar_t*);
|
||||
__int64 _wtoi64(const wchar_t*);
|
||||
long _wtol(const wchar_t*);
|
||||
|
||||
MSVCRT(size_t) MSVCRT(mbstowcs)(MSVCRT(wchar_t)*,const char*,MSVCRT(size_t));
|
||||
int MSVCRT(mbtowc)(MSVCRT(wchar_t)*,const char*,MSVCRT(size_t));
|
||||
double MSVCRT(wcstod)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t)**);
|
||||
long MSVCRT(wcstol)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t)**,int);
|
||||
MSVCRT(size_t) MSVCRT(wcstombs)(char*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
|
||||
unsigned long MSVCRT(wcstoul)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t)**,int);
|
||||
int MSVCRT(wctomb)(char*,MSVCRT(wchar_t));
|
||||
#endif /* MSVCRT_WSTDLIB_DEFINED */
|
||||
size_t mbstowcs(wchar_t*,const char*,size_t);
|
||||
int mbtowc(wchar_t*,const char*,size_t);
|
||||
double wcstod(const wchar_t*,wchar_t**);
|
||||
long wcstol(const wchar_t*,wchar_t**,int);
|
||||
size_t wcstombs(char*,const wchar_t*,size_t);
|
||||
unsigned long wcstoul(const wchar_t*,wchar_t**,int);
|
||||
int wctomb(char*,wchar_t);
|
||||
#endif /* _WSTDLIB_DEFINED */
|
||||
|
||||
#ifndef MSVCRT_WSTRING_DEFINED
|
||||
#define MSVCRT_WSTRING_DEFINED
|
||||
MSVCRT(wchar_t)*_wcsdup(const MSVCRT(wchar_t)*);
|
||||
int _wcsicmp(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
|
||||
int _wcsicoll(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
|
||||
MSVCRT(wchar_t)*_wcslwr(MSVCRT(wchar_t)*);
|
||||
int _wcsnicmp(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
|
||||
MSVCRT(wchar_t)*_wcsnset(MSVCRT(wchar_t)*,MSVCRT(wchar_t),MSVCRT(size_t));
|
||||
MSVCRT(wchar_t)*_wcsrev(MSVCRT(wchar_t)*);
|
||||
MSVCRT(wchar_t)*_wcsset(MSVCRT(wchar_t)*,MSVCRT(wchar_t));
|
||||
MSVCRT(wchar_t)*_wcsupr(MSVCRT(wchar_t)*);
|
||||
#ifndef _WSTRING_DEFINED
|
||||
#define _WSTRING_DEFINED
|
||||
wchar_t*_wcsdup(const wchar_t*);
|
||||
int _wcsicmp(const wchar_t*,const wchar_t*);
|
||||
int _wcsicoll(const wchar_t*,const wchar_t*);
|
||||
wchar_t*_wcslwr(wchar_t*);
|
||||
int _wcsnicmp(const wchar_t*,const wchar_t*,size_t);
|
||||
wchar_t*_wcsnset(wchar_t*,wchar_t,size_t);
|
||||
wchar_t*_wcsrev(wchar_t*);
|
||||
wchar_t*_wcsset(wchar_t*,wchar_t);
|
||||
wchar_t*_wcsupr(wchar_t*);
|
||||
|
||||
MSVCRT(wchar_t)*MSVCRT(wcscat)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
|
||||
MSVCRT(wchar_t)*MSVCRT(wcschr)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t));
|
||||
int MSVCRT(wcscmp)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
|
||||
int MSVCRT(wcscoll)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
|
||||
MSVCRT(wchar_t)*MSVCRT(wcscpy)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
|
||||
MSVCRT(size_t) MSVCRT(wcscspn)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
|
||||
MSVCRT(size_t) MSVCRT(wcslen)(const MSVCRT(wchar_t)*);
|
||||
MSVCRT(wchar_t)*MSVCRT(wcsncat)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
|
||||
int MSVCRT(wcsncmp)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
|
||||
MSVCRT(wchar_t)*MSVCRT(wcsncpy)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
|
||||
MSVCRT(wchar_t)*MSVCRT(wcspbrk)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
|
||||
MSVCRT(wchar_t)*MSVCRT(wcsrchr)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t) wcFor);
|
||||
MSVCRT(size_t) MSVCRT(wcsspn)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
|
||||
MSVCRT(wchar_t)*MSVCRT(wcsstr)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
|
||||
MSVCRT(wchar_t)*MSVCRT(wcstok)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
|
||||
MSVCRT(size_t) MSVCRT(wcsxfrm)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
|
||||
#endif /* MSVCRT_WSTRING_DEFINED */
|
||||
wchar_t*wcscat(wchar_t*,const wchar_t*);
|
||||
wchar_t*wcschr(const wchar_t*,wchar_t);
|
||||
int wcscmp(const wchar_t*,const wchar_t*);
|
||||
int wcscoll(const wchar_t*,const wchar_t*);
|
||||
wchar_t*wcscpy(wchar_t*,const wchar_t*);
|
||||
size_t wcscspn(const wchar_t*,const wchar_t*);
|
||||
size_t wcslen(const wchar_t*);
|
||||
wchar_t*wcsncat(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*wcspbrk(const wchar_t*,const wchar_t*);
|
||||
wchar_t*wcsrchr(const wchar_t*,wchar_t wcFor);
|
||||
size_t wcsspn(const wchar_t*,const wchar_t*);
|
||||
wchar_t*wcsstr(const wchar_t*,const wchar_t*);
|
||||
wchar_t*wcstok(wchar_t*,const wchar_t*);
|
||||
size_t wcsxfrm(wchar_t*,const wchar_t*,size_t);
|
||||
#endif /* _WSTRING_DEFINED */
|
||||
|
||||
#ifndef MSVCRT_WTIME_DEFINED
|
||||
#define MSVCRT_WTIME_DEFINED
|
||||
MSVCRT(wchar_t)*_wasctime(const struct MSVCRT(tm)*);
|
||||
MSVCRT(size_t) wcsftime(MSVCRT(wchar_t)*,MSVCRT(size_t),const MSVCRT(wchar_t)*,const struct MSVCRT(tm)*);
|
||||
MSVCRT(wchar_t)*_wctime(const MSVCRT(time_t)*);
|
||||
MSVCRT(wchar_t)*_wstrdate(MSVCRT(wchar_t)*);
|
||||
MSVCRT(wchar_t)*_wstrtime(MSVCRT(wchar_t)*);
|
||||
#endif /* MSVCRT_WTIME_DEFINED */
|
||||
#ifndef _WTIME_DEFINED
|
||||
#define _WTIME_DEFINED
|
||||
wchar_t*_wasctime(const struct tm*);
|
||||
size_t wcsftime(wchar_t*,size_t,const wchar_t*,const struct tm*);
|
||||
wchar_t*_wctime(const time_t*);
|
||||
wchar_t*_wstrdate(wchar_t*);
|
||||
wchar_t*_wstrtime(wchar_t*);
|
||||
#endif /* _WTIME_DEFINED */
|
||||
|
||||
MSVCRT(wchar_t) btowc(int);
|
||||
MSVCRT(size_t) mbrlen(const char *,MSVCRT(size_t),MSVCRT(mbstate_t)*);
|
||||
MSVCRT(size_t) mbrtowc(MSVCRT(wchar_t)*,const char*,MSVCRT(size_t),MSVCRT(mbstate_t)*);
|
||||
MSVCRT(size_t) mbsrtowcs(MSVCRT(wchar_t)*,const char**,MSVCRT(size_t),MSVCRT(mbstate_t)*);
|
||||
MSVCRT(size_t) wcrtomb(char*,MSVCRT(wchar_t),MSVCRT(mbstate_t)*);
|
||||
MSVCRT(size_t) wcsrtombs(char*,const MSVCRT(wchar_t)**,MSVCRT(size_t),MSVCRT(mbstate_t)*);
|
||||
int wctob(MSVCRT(wint_t));
|
||||
wchar_t btowc(int);
|
||||
size_t mbrlen(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 wcrtomb(char*,wchar_t,mbstate_t*);
|
||||
size_t wcsrtombs(char*,const wchar_t**,size_t,mbstate_t*);
|
||||
int wctob(wint_t);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -23,18 +23,10 @@
|
|||
#define __WINE_USE_MSVCRT
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT
|
||||
# ifdef USE_MSVCRT_PREFIX
|
||||
# define MSVCRT(x) MSVCRT_##x
|
||||
# else
|
||||
# define MSVCRT(x) x
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_WCHAR_T_DEFINED
|
||||
#define MSVCRT_WCHAR_T_DEFINED
|
||||
#ifndef _WCHAR_T_DEFINED
|
||||
#define _WCHAR_T_DEFINED
|
||||
#ifndef __cplusplus
|
||||
typedef unsigned short MSVCRT(wchar_t);
|
||||
typedef unsigned short wchar_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -50,19 +42,13 @@ typedef unsigned short MSVCRT(wchar_t);
|
|||
#define _LEADBYTE 0x8000
|
||||
#define _ALPHA (0x0100|_UPPER|_LOWER) /* (C1_ALPHA|_UPPER|_LOWER) */
|
||||
|
||||
#ifndef USE_MSVCRT_PREFIX
|
||||
# ifndef WEOF
|
||||
# define WEOF (wint_t)(0xFFFF)
|
||||
# endif
|
||||
#else
|
||||
# ifndef MSVCRT_WEOF
|
||||
# define MSVCRT_WEOF (MSVCRT_wint_t)(0xFFFF)
|
||||
# endif
|
||||
#endif /* USE_MSVCRT_PREFIX */
|
||||
#ifndef WEOF
|
||||
#define WEOF (wint_t)(0xFFFF)
|
||||
#endif
|
||||
|
||||
#ifndef _WCTYPE_T_DEFINED
|
||||
typedef unsigned short MSVCRT(wint_t);
|
||||
typedef unsigned short MSVCRT(wctype_t);
|
||||
typedef unsigned short wint_t;
|
||||
typedef unsigned short wctype_t;
|
||||
#define _WCTYPE_T_DEFINED
|
||||
#endif
|
||||
|
||||
|
@ -73,26 +59,26 @@ typedef unsigned short MSVCRT(wctype_t);
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef MSVCRT_WCTYPE_DEFINED
|
||||
#define MSVCRT_WCTYPE_DEFINED
|
||||
int MSVCRT(is_wctype)(MSVCRT(wint_t),MSVCRT(wctype_t));
|
||||
int MSVCRT(isleadbyte)(int);
|
||||
int MSVCRT(iswalnum)(MSVCRT(wint_t));
|
||||
int MSVCRT(iswalpha)(MSVCRT(wint_t));
|
||||
int MSVCRT(iswascii)(MSVCRT(wint_t));
|
||||
int MSVCRT(iswcntrl)(MSVCRT(wint_t));
|
||||
int MSVCRT(iswctype)(MSVCRT(wint_t),MSVCRT(wctype_t));
|
||||
int MSVCRT(iswdigit)(MSVCRT(wint_t));
|
||||
int MSVCRT(iswgraph)(MSVCRT(wint_t));
|
||||
int MSVCRT(iswlower)(MSVCRT(wint_t));
|
||||
int MSVCRT(iswprint)(MSVCRT(wint_t));
|
||||
int MSVCRT(iswpunct)(MSVCRT(wint_t));
|
||||
int MSVCRT(iswspace)(MSVCRT(wint_t));
|
||||
int MSVCRT(iswupper)(MSVCRT(wint_t));
|
||||
int MSVCRT(iswxdigit)(MSVCRT(wint_t));
|
||||
MSVCRT(wchar_t) MSVCRT(towlower)(MSVCRT(wchar_t));
|
||||
MSVCRT(wchar_t) MSVCRT(towupper)(MSVCRT(wchar_t));
|
||||
#endif /* MSVCRT_WCTYPE_DEFINED */
|
||||
#ifndef _WCTYPE_DEFINED
|
||||
#define _WCTYPE_DEFINED
|
||||
int is_wctype(wint_t,wctype_t);
|
||||
int isleadbyte(int);
|
||||
int iswalnum(wint_t);
|
||||
int iswalpha(wint_t);
|
||||
int iswascii(wint_t);
|
||||
int iswcntrl(wint_t);
|
||||
int iswctype(wint_t,wctype_t);
|
||||
int iswdigit(wint_t);
|
||||
int iswgraph(wint_t);
|
||||
int iswlower(wint_t);
|
||||
int iswprint(wint_t);
|
||||
int iswpunct(wint_t);
|
||||
int iswspace(wint_t);
|
||||
int iswupper(wint_t);
|
||||
int iswxdigit(wint_t);
|
||||
wchar_t towlower(wchar_t);
|
||||
wchar_t towupper(wchar_t);
|
||||
#endif /* _WCTYPE_DEFINED */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@
|
|||
#ifndef _WINSOCKAPI_
|
||||
#define _WINSOCKAPI_
|
||||
|
||||
#if (defined(_MSC_VER) || defined(__MINGW_H)) && !defined(MSVCRT_BSD_TYPES_DEFINED)
|
||||
#if (defined(_MSC_VER) || defined(__MINGW_H)) && !defined(_BSD_TYPES_DEFINED)
|
||||
/* MinGW doesn't define the u_xxx types */
|
||||
typedef unsigned char u_char;
|
||||
typedef unsigned short u_short;
|
||||
|
|
Loading…
Reference in New Issue