Commit 03774624 authored by Dimitrie O. Paun's avatar Dimitrie O. Paun Committed by Alexandre Julliard

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.
parent 7d128927
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 );
}
......@@ -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);
......
......@@ -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);
......
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 \
......
......@@ -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);
......@@ -221,23 +217,9 @@ double MSVCRT_difftime(MSVCRT_time_t time1, MSVCRT_time_t 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;
......@@ -255,6 +237,20 @@ void _ftime(struct _timeb *buf)
}
/*********************************************************************
* 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.@)
*/
int MSVCRT___daylight = 1; /* FIXME: assume daylight */
......
......@@ -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*);
#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 */
int remove(const char*);
int rename(const char*,const char*);
#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*);
#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 */
void _c_exit(void);
void _cexit(void);
void _exit(int);
void abort(void);
void exit(int);
int system(const char*);
#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
......
......@@ -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)*);
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 */
#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*);
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)*);
#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 */
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 _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
}
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment