Commit 4f356e86 authored by Alexandre Julliard's avatar Alexandre Julliard

Moved shared crtdll/ntdll functions into ntdll.

Made crtdll a separate dll.
parent 91791032
...@@ -96,6 +96,7 @@ DLLS = \ ...@@ -96,6 +96,7 @@ DLLS = \
avifil32 \ avifil32 \
comctl32 \ comctl32 \
comdlg32 \ comdlg32 \
crtdll \
dciman32 \ dciman32 \
dinput \ dinput \
dplayx \ dplayx \
......
...@@ -39,8 +39,6 @@ SUBDIRS = \ ...@@ -39,8 +39,6 @@ SUBDIRS = \
debugger \ debugger \
dlls \ dlls \
dlls/advapi32 \ dlls/advapi32 \
dlls/crtdll \
dlls/kernel \
dlls/ntdll \ dlls/ntdll \
documentation \ documentation \
files \ files \
...@@ -84,7 +82,6 @@ LIBOBJS = \ ...@@ -84,7 +82,6 @@ LIBOBJS = \
controls/controls.o \ controls/controls.o \
console/console.o \ console/console.o \
dlls/advapi32/advapi32.o \ dlls/advapi32/advapi32.o \
dlls/crtdll/crtdll.o \
dlls/ntdll/ntdll.o \ dlls/ntdll/ntdll.o \
files/files.o \ files/files.o \
graphics/graphics.o \ graphics/graphics.o \
......
...@@ -16,6 +16,7 @@ DLLFILES = \ ...@@ -16,6 +16,7 @@ DLLFILES = \
avifil32/libavifil32.@LIBEXT@ \ avifil32/libavifil32.@LIBEXT@ \
comctl32/libcomctl32.@LIBEXT@ \ comctl32/libcomctl32.@LIBEXT@ \
commdlg/libcomdlg32.@LIBEXT@ \ commdlg/libcomdlg32.@LIBEXT@ \
crtdll/libcrtdll.@LIBEXT@ \
dciman32/libdciman32.@LIBEXT@ \ dciman32/libdciman32.@LIBEXT@ \
dinput/libdinput.@LIBEXT@ \ dinput/libdinput.@LIBEXT@ \
dplayx/libdplayx.@LIBEXT@ \ dplayx/libdplayx.@LIBEXT@ \
...@@ -117,6 +118,7 @@ SUBDIRS = \ ...@@ -117,6 +118,7 @@ SUBDIRS = \
avifil32 \ avifil32 \
comctl32 \ comctl32 \
commdlg \ commdlg \
crtdll \
dciman32 \ dciman32 \
ddraw \ ddraw \
dinput \ dinput \
...@@ -180,6 +182,9 @@ libcomctl32.@LIBEXT@: comctl32/libcomctl32.@LIBEXT@ ...@@ -180,6 +182,9 @@ libcomctl32.@LIBEXT@: comctl32/libcomctl32.@LIBEXT@
libcomdlg32.@LIBEXT@ libcommdlg.@LIBEXT@: commdlg/libcomdlg32.@LIBEXT@ libcomdlg32.@LIBEXT@ libcommdlg.@LIBEXT@: commdlg/libcomdlg32.@LIBEXT@
$(RM) $@ && $(LN_S) commdlg/libcomdlg32.@LIBEXT@ $@ $(RM) $@ && $(LN_S) commdlg/libcomdlg32.@LIBEXT@ $@
libcrtdll.@LIBEXT@: crtdll/libcrtdll.@LIBEXT@
$(RM) $@ && $(LN_S) crtdll/libcrtdll.@LIBEXT@ $@
libdciman32.@LIBEXT@: dciman32/libdciman32.@LIBEXT@ libdciman32.@LIBEXT@: dciman32/libdciman32.@LIBEXT@
$(RM) $@ && $(LN_S) dciman32/libdciman32.@LIBEXT@ $@ $(RM) $@ && $(LN_S) dciman32/libdciman32.@LIBEXT@ $@
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include <string.h> #include <string.h>
#include "winbase.h" #include "winbase.h"
#include "crtdll.h"
#include "ldt.h" #include "ldt.h"
#include "heap.h" #include "heap.h"
#include "commdlg.h" #include "commdlg.h"
...@@ -177,6 +176,8 @@ HRESULT FILEDLG95_HandleCustomDialogMessages(HWND hwnd, UINT uMsg, WPARAM wParam ...@@ -177,6 +176,8 @@ HRESULT FILEDLG95_HandleCustomDialogMessages(HWND hwnd, UINT uMsg, WPARAM wParam
BOOL FILEDLG95_OnOpenMultipleFiles(HWND hwnd, LPSTR lpstrFileList, UINT nFileCount, UINT sizeUsed); BOOL FILEDLG95_OnOpenMultipleFiles(HWND hwnd, LPSTR lpstrFileList, UINT nFileCount, UINT sizeUsed);
static BOOL BrowseSelectedFolder(HWND hwnd); static BOOL BrowseSelectedFolder(HWND hwnd);
extern LPSTR _strlwr( LPSTR str );
/*********************************************************************** /***********************************************************************
* GetFileName95 * GetFileName95
* *
...@@ -1599,7 +1600,7 @@ static HRESULT FILEDLG95_FILETYPE_Init(HWND hwnd) ...@@ -1599,7 +1600,7 @@ static HRESULT FILEDLG95_FILETYPE_Init(HWND hwnd)
if(lpstrFilter) if(lpstrFilter)
{ {
CRTDLL__strlwr(lpstrFilter); /* lowercase */ _strlwr(lpstrFilter); /* lowercase */
fodInfos->ShellInfos.lpstrCurrentFilter = MemAlloc((strlen(lpstrFilter)+1)*2); fodInfos->ShellInfos.lpstrCurrentFilter = MemAlloc((strlen(lpstrFilter)+1)*2);
lstrcpyAtoW(fodInfos->ShellInfos.lpstrCurrentFilter, lpstrFilter); lstrcpyAtoW(fodInfos->ShellInfos.lpstrCurrentFilter, lpstrFilter);
} }
...@@ -1638,7 +1639,7 @@ static BOOL FILEDLG95_FILETYPE_OnCommand(HWND hwnd, WORD wNotifyCode) ...@@ -1638,7 +1639,7 @@ static BOOL FILEDLG95_FILETYPE_OnCommand(HWND hwnd, WORD wNotifyCode)
if((int)lpstrFilter != CB_ERR) if((int)lpstrFilter != CB_ERR)
{ {
fodInfos->ShellInfos.lpstrCurrentFilter = MemAlloc((strlen(lpstrFilter)+1)*2); fodInfos->ShellInfos.lpstrCurrentFilter = MemAlloc((strlen(lpstrFilter)+1)*2);
lstrcpyAtoW(fodInfos->ShellInfos.lpstrCurrentFilter,CRTDLL__strlwr(lpstrFilter)); lstrcpyAtoW(fodInfos->ShellInfos.lpstrCurrentFilter,_strlwr(lpstrFilter));
SendCustomDlgNotificationMessage(hwnd,CDN_TYPECHANGE); SendCustomDlgNotificationMessage(hwnd,CDN_TYPECHANGE);
} }
......
Makefile
*.spec.c *.spec.c
*.spec.glue.s *.spec.glue.s
Makefile
libcrtdll.so.1.0
DEFS = @DLLFLAGS@ -D__WINE__
TOPSRCDIR = @top_srcdir@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../.. TOPOBJDIR = ../..
SRCDIR = @srcdir@ SRCDIR = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
MODULE = crtdll MODULE = crtdll
SOVERSION = 1.0
SPEC_SRCS = crtdll.spec
C_SRCS = \ C_SRCS = \
crtdll_main.c \ crtdll_main.c \
mbstring.c \ mbstring.c \
wcstring.c wcstring.c
all: $(MODULE).o @MAKE_DLL_RULES@
@MAKE_RULES@
### Dependencies: ### Dependencies:
...@@ -3,6 +3,8 @@ name crtdll ...@@ -3,6 +3,8 @@ name crtdll
type win32 type win32
init CRTDLL_Init init CRTDLL_Init
import ntdll
@ cdecl ??2@YAPAXI@Z(long) CRTDLL_new @ cdecl ??2@YAPAXI@Z(long) CRTDLL_new
@ cdecl ??3@YAXPAX@Z(long) CRTDLL_delete @ cdecl ??3@YAXPAX@Z(long) CRTDLL_delete
@ cdecl ?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z(ptr) CRTDLL_set_new_handler @ cdecl ?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z(ptr) CRTDLL_set_new_handler
...@@ -16,7 +18,7 @@ init CRTDLL_Init ...@@ -16,7 +18,7 @@ init CRTDLL_Init
@ stub _CIfmod @ stub _CIfmod
@ stub _CIlog @ stub _CIlog
@ stub _CIlog10 @ stub _CIlog10
@ cdecl _CIpow() CRTDLL__CIpow @ forward _CIpow ntdll._CIpow
@ stub _CIsin @ stub _CIsin
@ stub _CIsinh @ stub _CIsinh
@ stub _CIsqrt @ stub _CIsqrt
...@@ -115,7 +117,7 @@ init CRTDLL_Init ...@@ -115,7 +117,7 @@ init CRTDLL_Init
@ cdecl _fsopen(str str long) CRTDLL__fsopen @ cdecl _fsopen(str str long) CRTDLL__fsopen
@ cdecl _fstat(long ptr) CRTDLL__fstat @ cdecl _fstat(long ptr) CRTDLL__fstat
@ stub _ftime @ stub _ftime
@ cdecl _ftol() CRTDLL__ftol @ forward _ftol ntdll._ftol
@ cdecl _fullpath(ptr str long) CRTDLL__fullpath @ cdecl _fullpath(ptr str long) CRTDLL__fullpath
@ stub _futime @ stub _futime
@ stub _gcvt @ stub _gcvt
...@@ -167,7 +169,7 @@ init CRTDLL_Init ...@@ -167,7 +169,7 @@ init CRTDLL_Init
@ stub _ismbslead @ stub _ismbslead
@ stub _ismbstrail @ stub _ismbstrail
@ stub _isnan @ stub _isnan
@ cdecl _itoa(long ptr long) CRTDLL__itoa @ forward _itoa ntdll._itoa
@ stub _itow @ stub _itow
@ cdecl _j0(double) j0 @ cdecl _j0(double) j0
@ cdecl _j1(double) j1 @ cdecl _j1(double) j1
...@@ -182,7 +184,7 @@ init CRTDLL_Init ...@@ -182,7 +184,7 @@ init CRTDLL_Init
@ stub _lrotr @ stub _lrotr
@ stub _lsearch @ stub _lsearch
@ cdecl _lseek(long long long) CRTDLL__lseek @ cdecl _lseek(long long long) CRTDLL__lseek
@ cdecl _ltoa(long str long) CRTDLL__ltoa @ forward _ltoa ntdll._ltoa
@ stub _ltow @ stub _ltow
@ cdecl _makepath (ptr str str str str) CRTDLL__makepath @ cdecl _makepath (ptr str str str str) CRTDLL__makepath
@ stub _matherr @ stub _matherr
...@@ -235,7 +237,7 @@ init CRTDLL_Init ...@@ -235,7 +237,7 @@ init CRTDLL_Init
@ stub _mbstrlen @ stub _mbstrlen
@ stub _mbsupr @ stub _mbsupr
@ stub _memccpy @ stub _memccpy
@ cdecl _memicmp(str str long) CRTDLL__memicmp @ forward _memicmp ntdll._memicmp
@ cdecl _mkdir(str) CRTDLL__mkdir @ cdecl _mkdir(str) CRTDLL__mkdir
@ stub _mktemp @ stub _mktemp
@ stub _msize @ stub _msize
...@@ -284,25 +286,25 @@ init CRTDLL_Init ...@@ -284,25 +286,25 @@ init CRTDLL_Init
@ cdecl _splitpath (str ptr ptr ptr ptr) CRTDLL__splitpath @ cdecl _splitpath (str ptr ptr ptr ptr) CRTDLL__splitpath
@ cdecl _stat (str ptr) CRTDLL__stat @ cdecl _stat (str ptr) CRTDLL__stat
@ stub _statusfp @ stub _statusfp
@ cdecl _strcmpi(str str) CRTDLL__strcmpi @ cdecl _strcmpi(str str) strcasecmp
@ cdecl _strdate(str) CRTDLL__strdate @ cdecl _strdate(str) CRTDLL__strdate
@ stub _strdec @ stub _strdec
@ cdecl _strdup(str) CRTDLL__strdup @ cdecl _strdup(str) CRTDLL__strdup
@ stub _strerror @ stub _strerror
@ cdecl _stricmp(str str) CRTDLL__strcmpi @ cdecl _stricmp(str str) strcasecmp
@ stub _stricoll @ stub _stricoll
@ stub _strinc @ stub _strinc
@ cdecl _strlwr(str) CRTDLL__strlwr @ forward _strlwr ntdll._strlwr
@ stub _strncnt @ stub _strncnt
@ stub _strnextc @ stub _strnextc
@ cdecl _strnicmp(str str long) CRTDLL__strnicmp @ cdecl _strnicmp(str str long) strncasecmp
@ stub _strninc @ stub _strninc
@ stub _strnset @ stub _strnset
@ stub _strrev @ stub _strrev
@ stub _strset @ stub _strset
@ stub _strspnp @ stub _strspnp
@ cdecl _strtime(str) CRTDLL__strtime @ cdecl _strtime(str) CRTDLL__strtime
@ cdecl _strupr(str) CRTDLL__strupr @ forward _strupr ntdll._strupr
@ stub _swab @ stub _swab
@ stub _sys_errlist @ stub _sys_errlist
@ stub _sys_nerr_dll @ stub _sys_nerr_dll
...@@ -313,7 +315,7 @@ init CRTDLL_Init ...@@ -313,7 +315,7 @@ init CRTDLL_Init
@ stub _toupper @ stub _toupper
@ stub _tzname @ stub _tzname
@ stub _tzset @ stub _tzset
@ cdecl _ultoa(long ptr long) CRTDLL__ultoa @ forward _ultoa ntdll._ultoa
@ stub _ultow @ stub _ultow
@ stub _umask @ stub _umask
@ stub _ungetch @ stub _ungetch
...@@ -323,14 +325,14 @@ init CRTDLL_Init ...@@ -323,14 +325,14 @@ init CRTDLL_Init
@ stub _vsnprintf @ stub _vsnprintf
@ stub _vsnwprintf @ stub _vsnwprintf
@ cdecl _wcsdup(wstr) CRTDLL__wcsdup @ cdecl _wcsdup(wstr) CRTDLL__wcsdup
@ cdecl _wcsicmp(wstr wstr) CRTDLL__wcsicmp @ forward _wcsicmp ntdll._wcsicmp
@ cdecl _wcsicoll(wstr wstr) CRTDLL__wcsicoll @ cdecl _wcsicoll(wstr wstr) CRTDLL__wcsicoll
@ cdecl _wcslwr(wstr) CRTDLL__wcslwr @ forward _wcslwr forward._wcslwr
@ cdecl _wcsnicmp(wstr wstr long) CRTDLL__wcsnicmp @ forward _wcsnicmp forward._wcsnicmp
@ cdecl _wcsnset(wstr long long) CRTDLL__wcsnset @ cdecl _wcsnset(wstr long long) CRTDLL__wcsnset
@ cdecl _wcsrev(wstr) CRTDLL__wcsrev @ cdecl _wcsrev(wstr) CRTDLL__wcsrev
@ cdecl _wcsset(wstr long) CRTDLL__wcsset @ cdecl _wcsset(wstr long) CRTDLL__wcsset
@ cdecl _wcsupr(wstr) CRTDLL__wcsupr @ forward _wcsupr ntdll._wcsupr
@ extern _winmajor_dll CRTDLL_winmajor_dll @ extern _winmajor_dll CRTDLL_winmajor_dll
@ extern _winminor_dll CRTDLL_winminor_dll @ extern _winminor_dll CRTDLL_winminor_dll
@ extern _winver_dll CRTDLL_winver_dll @ extern _winver_dll CRTDLL_winver_dll
...@@ -408,10 +410,10 @@ init CRTDLL_Init ...@@ -408,10 +410,10 @@ init CRTDLL_Init
@ cdecl isspace(long) isspace @ cdecl isspace(long) isspace
@ cdecl isupper(long) isupper @ cdecl isupper(long) isupper
@ cdecl iswalnum(long) CRTDLL_iswalnum @ cdecl iswalnum(long) CRTDLL_iswalnum
@ cdecl iswalpha(long) CRTDLL_iswalpha @ forward iswalpha ntdll.iswalpha
@ stub iswascii @ stub iswascii
@ cdecl iswcntrl(long) CRTDLL_iswcntrl @ cdecl iswcntrl(long) CRTDLL_iswcntrl
@ cdecl iswctype(long long) CRTDLL_iswctype @ forward iswctype ntdll.iswctype
@ cdecl iswdigit(long) CRTDLL_iswdigit @ cdecl iswdigit(long) CRTDLL_iswdigit
@ cdecl iswgraph(long) CRTDLL_iswgraph @ cdecl iswgraph(long) CRTDLL_iswgraph
@ cdecl iswlower(long) CRTDLL_iswlower @ cdecl iswlower(long) CRTDLL_iswlower
...@@ -431,7 +433,7 @@ init CRTDLL_Init ...@@ -431,7 +433,7 @@ init CRTDLL_Init
@ cdecl longjmp(ptr long) CRTDLL_longjmp @ cdecl longjmp(ptr long) CRTDLL_longjmp
@ cdecl malloc(ptr) CRTDLL_malloc @ cdecl malloc(ptr) CRTDLL_malloc
@ cdecl mblen(str long) mblen @ cdecl mblen(str long) mblen
@ cdecl mbstowcs(ptr str long) CRTDLL_mbstowcs @ forward mbstowcs ntdll.mbstowcs
@ cdecl mbtowc(ptr ptr long) CRTDLL_mbtowc @ cdecl mbtowc(ptr ptr long) CRTDLL_mbtowc
@ cdecl memchr(ptr long long) memchr @ cdecl memchr(ptr long long) memchr
@ cdecl memcmp(ptr ptr long) memcmp @ cdecl memcmp(ptr ptr long) memcmp
...@@ -495,8 +497,8 @@ init CRTDLL_Init ...@@ -495,8 +497,8 @@ init CRTDLL_Init
@ cdecl tmpnam(str) CRTDLL_tmpnam @ cdecl tmpnam(str) CRTDLL_tmpnam
@ cdecl tolower(long) tolower @ cdecl tolower(long) tolower
@ cdecl toupper(long) toupper @ cdecl toupper(long) toupper
@ cdecl towlower(long) CRTDLL_towlower @ forward towlower ntdll.towlower
@ cdecl towupper(long) CRTDLL_towupper @ forward towupper ntdll.towupper
@ stub ungetc @ stub ungetc
@ stub ungetwc @ stub ungetwc
@ cdecl vfprintf(ptr str ptr) CRTDLL_vfprintf @ cdecl vfprintf(ptr str ptr) CRTDLL_vfprintf
...@@ -505,25 +507,25 @@ init CRTDLL_Init ...@@ -505,25 +507,25 @@ init CRTDLL_Init
@ cdecl vsprintf(ptr str ptr) CRTDLL_vsprintf @ cdecl vsprintf(ptr str ptr) CRTDLL_vsprintf
@ cdecl vswprintf(ptr wstr ptr) CRTDLL_vswprintf @ cdecl vswprintf(ptr wstr ptr) CRTDLL_vswprintf
@ stub vwprintf @ stub vwprintf
@ cdecl wcscat(wstr wstr) CRTDLL_wcscat @ forward wcscat ntdll.wcscat
@ cdecl wcschr(wstr long) CRTDLL_wcschr @ forward wcschr ntdll.wcschr
@ cdecl wcscmp(wstr wstr) CRTDLL_wcscmp @ forward wcscmp ntdll.wcscmp
@ cdecl wcscoll(wstr wstr) CRTDLL_wcscoll @ cdecl wcscoll(wstr wstr) CRTDLL_wcscoll
@ cdecl wcscpy(ptr wstr) CRTDLL_wcscpy @ forward wcscpy ntdll.wcscpy
@ cdecl wcscspn(wstr wstr) CRTDLL_wcscspn @ forward wcscspn ntdll.wcscspn
@ stub wcsftime @ stub wcsftime
@ cdecl wcslen(wstr) CRTDLL_wcslen @ forward wcslen ntdll.wcslen
@ cdecl wcsncat(wstr wstr long) CRTDLL_wcsncat @ forward wcsncat ntdll.wcsncat
@ cdecl wcsncmp(wstr wstr long) CRTDLL_wcsncmp @ forward wcsncmp ntdll.wcsncmp
@ cdecl wcsncpy(ptr wstr long) CRTDLL_wcsncpy @ forward wcsncpy ntdll.wcsncpy
@ cdecl wcspbrk(wstr wstr) CRTDLL_wcspbrk @ cdecl wcspbrk(wstr wstr) CRTDLL_wcspbrk
@ cdecl wcsrchr(wstr long) CRTDLL_wcsrchr @ forward wcsrchr ntdll.wcsrchr
@ cdecl wcsspn(wstr wstr) CRTDLL_wcsspn @ forward wcsspn ntdll.wcsspn
@ cdecl wcsstr(wstr wstr) CRTDLL_wcsstr @ forward wcsstr ntdll.wcsstr
@ stub wcstod @ stub wcstod
@ cdecl wcstok(wstr wstr) CRTDLL_wcstok @ forward wcstok ntdll.wcstok
@ cdecl wcstol(wstr ptr long) CRTDLL_wcstol @ forward wcstol ntdll.wcstol
@ cdecl wcstombs(ptr ptr long) CRTDLL_wcstombs @ forward wcstombs ntdll.wcstombs
@ stub wcstoul @ stub wcstoul
@ stub wcsxfrm @ stub wcsxfrm
@ cdecl wctomb(ptr long) CRTDLL_wctomb @ cdecl wctomb(ptr long) CRTDLL_wctomb
......
...@@ -100,12 +100,6 @@ typedef VOID (*new_handler_type)(VOID); ...@@ -100,12 +100,6 @@ typedef VOID (*new_handler_type)(VOID);
static new_handler_type new_handler; static new_handler_type new_handler;
#if defined(__GNUC__) && defined(__i386__)
#define USING_REAL_FPU
#define DO_FPU(x,y) __asm__ __volatile__( x " %0;fwait" : "=m" (y) : )
#define POP_FPU(x) DO_FPU("fstpl",x)
#endif
CRTDLL_FILE * __cdecl CRTDLL__fdopen(INT handle, LPCSTR mode); CRTDLL_FILE * __cdecl CRTDLL__fdopen(INT handle, LPCSTR mode);
/********************************************************************* /*********************************************************************
...@@ -953,43 +947,6 @@ INT __cdecl CRTDLL_vswprintf( LPWSTR buffer, LPCWSTR spec, va_list args ) ...@@ -953,43 +947,6 @@ INT __cdecl CRTDLL_vswprintf( LPWSTR buffer, LPCWSTR spec, va_list args )
return wvsprintfW( buffer, spec, args ); return wvsprintfW( buffer, spec, args );
} }
/*********************************************************************
* _strcmpi (CRTDLL.282) (CRTDLL.287)
*/
INT __cdecl CRTDLL__strcmpi( LPCSTR s1, LPCSTR s2 )
{
return lstrcmpiA( s1, s2 );
}
/*********************************************************************
* _strnicmp (CRTDLL.293)
*/
INT __cdecl CRTDLL__strnicmp( LPCSTR s1, LPCSTR s2, INT n )
{
return lstrncmpiA( s1, s2, n );
}
/*********************************************************************
* _strlwr (CRTDLL.293)
*
* convert a string in place to lowercase
*/
LPSTR __cdecl CRTDLL__strlwr(LPSTR x)
{
unsigned char *y =x;
TRACE("CRTDLL_strlwr got %s\n", x);
while (*y) {
if ((*y > 0x40) && (*y< 0x5b))
*y = *y + 0x20;
y++;
}
TRACE(" returned %s\n", x);
return x;
}
/********************************************************************* /*********************************************************************
* system (CRTDLL.485) * system (CRTDLL.485)
...@@ -1036,20 +993,6 @@ INT __cdecl CRTDLL_system(LPSTR x) ...@@ -1036,20 +993,6 @@ INT __cdecl CRTDLL_system(LPSTR x)
} }
/********************************************************************* /*********************************************************************
* _strupr (CRTDLL.300)
*/
LPSTR __cdecl CRTDLL__strupr(LPSTR x)
{
LPSTR y=x;
while (*y) {
*y=toupper(*y);
y++;
}
return x;
}
/*********************************************************************
* longjmp (CRTDLL.426) * longjmp (CRTDLL.426)
*/ */
VOID __cdecl CRTDLL_longjmp(jmp_buf env, int val) VOID __cdecl CRTDLL_longjmp(jmp_buf env, int val)
...@@ -1697,43 +1640,6 @@ LPSTR __cdecl CRTDLL__itoa(INT x,LPSTR buf,INT buflen) ...@@ -1697,43 +1640,6 @@ LPSTR __cdecl CRTDLL__itoa(INT x,LPSTR buf,INT buflen)
return buf; return buf;
} }
/*********************************************************************
* _ltoa (CRTDLL.180)
*/
LPSTR __cdecl CRTDLL__ltoa(long x,LPSTR buf,INT radix)
{
switch(radix) {
case 2: FIXME("binary format not implemented !\n");
break;
case 8: wsnprintfA(buf,0x80,"%o",x);
break;
case 10: wsnprintfA(buf,0x80,"%d",x);
break;
case 16: wsnprintfA(buf,0x80,"%x",x);
break;
default: FIXME("radix %d not implemented !\n", radix);
}
return buf;
}
/*********************************************************************
* _ultoa (CRTDLL.311)
*/
LPSTR __cdecl CRTDLL__ultoa(long x,LPSTR buf,INT radix)
{
switch(radix) {
case 2: FIXME("binary format not implemented !\n");
break;
case 8: wsnprintfA(buf,0x80,"%lo",x);
break;
case 10: wsnprintfA(buf,0x80,"%ld",x);
break;
case 16: wsnprintfA(buf,0x80,"%lx",x);
break;
default: FIXME("radix %d not implemented !\n", radix);
}
return buf;
}
typedef VOID (*sig_handler_type)(VOID); typedef VOID (*sig_handler_type)(VOID);
...@@ -1747,41 +1653,6 @@ void * __cdecl CRTDLL_signal(int sig, sig_handler_type ptr) ...@@ -1747,41 +1653,6 @@ void * __cdecl CRTDLL_signal(int sig, sig_handler_type ptr)
} }
/********************************************************************* /*********************************************************************
* _ftol (CRTDLL.113)
*/
#ifdef USING_REAL_FPU
LONG __cdecl CRTDLL__ftol(void) {
/* don't just do DO_FPU("fistp",retval), because the rounding
* mode must also be set to "round towards zero"... */
double fl;
POP_FPU(fl);
return (LONG)fl;
}
#else
LONG __cdecl CRTDLL__ftol(double fl) {
FIXME("should be register function\n");
return (LONG)fl;
}
#endif
/*********************************************************************
* _CIpow (CRTDLL.14)
*/
#ifdef USING_REAL_FPU
LONG __cdecl CRTDLL__CIpow(void) {
double x,y;
POP_FPU(y);
POP_FPU(x);
return pow(x,y);
}
#else
LONG __cdecl CRTDLL__CIpow(double x,double y) {
FIXME("should be register function\n");
return pow(x,y);
}
#endif
/*********************************************************************
* _sleep (CRTDLL.267) * _sleep (CRTDLL.267)
*/ */
VOID __cdecl CRTDLL__sleep(unsigned long timeout) VOID __cdecl CRTDLL__sleep(unsigned long timeout)
...@@ -1826,29 +1697,6 @@ LPSTR __cdecl CRTDLL__mbsrchr(LPSTR s,CHAR x) { ...@@ -1826,29 +1697,6 @@ LPSTR __cdecl CRTDLL__mbsrchr(LPSTR s,CHAR x) {
} }
/********************************************************************* /*********************************************************************
* _memicmp (CRTDLL.233)(NTDLL.868)
* A stringcompare, without \0 check
* RETURNS
* -1:if first string is alphabetically before second string
* 1:if second '' '' '' '' first ''
* 0:if both are equal.
*/
INT __cdecl CRTDLL__memicmp(
LPCSTR s1, /* [in] first string */
LPCSTR s2, /* [in] second string */
DWORD len /* [in] length to compare */
) {
int i;
for (i=0;i<len;i++) {
if (tolower(s1[i])<tolower(s2[i]))
return -1;
if (tolower(s1[i])>tolower(s2[i]))
return 1;
}
return 0;
}
/*********************************************************************
* __dllonexit (CRTDLL.25) * __dllonexit (CRTDLL.25)
*/ */
VOID __cdecl CRTDLL___dllonexit () VOID __cdecl CRTDLL___dllonexit ()
...@@ -1857,18 +1705,6 @@ VOID __cdecl CRTDLL___dllonexit () ...@@ -1857,18 +1705,6 @@ VOID __cdecl CRTDLL___dllonexit ()
} }
/********************************************************************* /*********************************************************************
* wcstol (CRTDLL.520)
* Like strtol, but for wide character strings.
*/
INT __cdecl CRTDLL_wcstol(LPWSTR s,LPWSTR *end,INT base) {
LPSTR sA = HEAP_strdupWtoA(GetProcessHeap(),0,s),endA;
INT ret = strtol(sA,&endA,base);
HeapFree(GetProcessHeap(),0,sA);
if (end) *end = s+(endA-sA); /* pointer magic checked. */
return ret;
}
/*********************************************************************
* _strdate (CRTDLL.283) * _strdate (CRTDLL.283)
*/ */
LPSTR __cdecl CRTDLL__strdate (LPSTR date) LPSTR __cdecl CRTDLL__strdate (LPSTR date)
......
...@@ -45,24 +45,6 @@ INT __cdecl CRTDLL__mbslen( LPCSTR str ) ...@@ -45,24 +45,6 @@ INT __cdecl CRTDLL__mbslen( LPCSTR str )
/********************************************************************* /*********************************************************************
* CRTDLL_mbstowcs (CRTDLL.429)
*/
INT __cdecl CRTDLL_mbstowcs( LPWSTR dst, LPCSTR src, INT n )
{
wchar_t *buffer, *p;
int ret;
if (!(buffer = CRTDLL_malloc( n * sizeof(wchar_t) ))) return -1;
ret = mbstowcs( buffer, src, n );
if (ret < n) n = ret + 1; /* nb of chars to copy (including terminating null) */
p = buffer;
while (n-- > 0) *dst++ = (WCHAR)*p++;
CRTDLL_free( buffer );
return ret;
}
/*********************************************************************
* CRTDLL_mbtowc (CRTDLL.430) * CRTDLL_mbtowc (CRTDLL.430)
*/ */
INT __cdecl CRTDLL_mbtowc( WCHAR *dst, LPCSTR str, INT n ) INT __cdecl CRTDLL_mbtowc( WCHAR *dst, LPCSTR str, INT n )
......
...@@ -17,11 +17,13 @@ C_SRCS = \ ...@@ -17,11 +17,13 @@ C_SRCS = \
reg.c \ reg.c \
rtl.c \ rtl.c \
rtlstr.c \ rtlstr.c \
string.c \
sec.c \ sec.c \
signal_i386.c \ signal_i386.c \
signal_sparc.c \ signal_sparc.c \
sync.c \ sync.c \
time.c time.c \
wcstring.c
all: $(MODULE).o all: $(MODULE).o
......
...@@ -10,6 +10,12 @@ ...@@ -10,6 +10,12 @@
DEFAULT_DEBUG_CHANNEL(ntdll); DEFAULT_DEBUG_CHANNEL(ntdll);
#if defined(__GNUC__) && defined(__i386__)
#define USING_REAL_FPU
#define DO_FPU(x,y) __asm__ __volatile__( x " %0;fwait" : "=m" (y) : )
#define POP_FPU(x) DO_FPU("fstpl",x)
#endif
void dump_ObjectAttributes (POBJECT_ATTRIBUTES oa) void dump_ObjectAttributes (POBJECT_ATTRIBUTES oa)
{ {
if (oa) if (oa)
...@@ -52,3 +58,41 @@ LPCSTR debugstr_us (PUNICODE_STRING us) ...@@ -52,3 +58,41 @@ LPCSTR debugstr_us (PUNICODE_STRING us)
return debugstr_wn(us->Buffer, us->Length); return debugstr_wn(us->Buffer, us->Length);
} }
/*********************************************************************
* _ftol (NTDLL)
*/
#ifdef USING_REAL_FPU
LONG __cdecl NTDLL__ftol(void)
{
/* don't just do DO_FPU("fistp",retval), because the rounding
* mode must also be set to "round towards zero"... */
double fl;
POP_FPU(fl);
return (LONG)fl;
}
#else
LONG __cdecl NTDLL__ftol(double fl)
{
FIXME("should be register function\n");
return (LONG)fl;
}
#endif
/*********************************************************************
* _CIpow (NTDLL)
*/
#ifdef USING_REAL_FPU
LONG __cdecl NTDLL__CIpow(void)
{
double x,y;
POP_FPU(y);
POP_FPU(x);
return pow(x,y);
}
#else
LONG __cdecl NTDLL__CIpow(double x,double y)
{
FIXME("should be register function\n");
return pow(x,y);
}
#endif
...@@ -753,7 +753,7 @@ type win32 ...@@ -753,7 +753,7 @@ type win32
@ stub ZwWriteFile @ stub ZwWriteFile
@ stub ZwWriteRequestData @ stub ZwWriteRequestData
@ stub ZwWriteVirtualMemory @ stub ZwWriteVirtualMemory
@ stub _CIpow @ cdecl _CIpow() NTDLL__CIpow
@ stub __eCommonExceptions @ stub __eCommonExceptions
@ stub __eEmulatorInit @ stub __eEmulatorInit
@ stub __eF2XM1 @ stub __eF2XM1
...@@ -868,25 +868,25 @@ type win32 ...@@ -868,25 +868,25 @@ type win32
@ register _alloca_probe() NTDLL_alloca_probe @ register _alloca_probe() NTDLL_alloca_probe
@ register _chkstk() NTDLL_chkstk @ register _chkstk() NTDLL_chkstk
@ stub _fltused @ stub _fltused
@ cdecl _ftol(double) CRTDLL__ftol @ cdecl _ftol() NTDLL__ftol
@ cdecl _itoa(long ptr long) CRTDLL__itoa @ cdecl _itoa(long ptr long) _itoa
@ stub _ltoa @ cdecl _ltoa(long ptr long) _ltoa
@ stub _memccpy @ stub _memccpy
@ cdecl _memicmp(str str long) CRTDLL__memicmp @ cdecl _memicmp(str str long) _memicmp
@ stub _snprintf @ stub _snprintf
@ stub _snwprintf @ stub _snwprintf
@ stub _splitpath @ stub _splitpath
@ cdecl _strcmpi(str str) CRTDLL__strcmpi @ cdecl _strcmpi(str str) strcasecmp
@ cdecl _stricmp(str str) CRTDLL__strcmpi @ cdecl _stricmp(str str) strcasecmp
@ cdecl _strlwr(str) CRTDLL__strlwr @ cdecl _strlwr(str) _strlwr
@ cdecl _strnicmp(str str long) CRTDLL__strnicmp @ cdecl _strnicmp(str str long) strncasecmp
@ cdecl _strupr(str) CRTDLL__strupr @ cdecl _strupr(str) _strupr
@ cdecl _ultoa(long ptr long) CRTDLL__ultoa @ cdecl _ultoa(long ptr long) _ultoa
@ stub _vsnprintf @ stub _vsnprintf
@ cdecl _wcsicmp(wstr wstr) CRTDLL__wcsicmp @ cdecl _wcsicmp(wstr wstr) NTDLL__wcsicmp
@ cdecl _wcslwr(wstr) CRTDLL__wcslwr @ cdecl _wcslwr(wstr) NTDLL__wcslwr
@ cdecl _wcsnicmp(wstr wstr long) CRTDLL__wcsnicmp @ cdecl _wcsnicmp(wstr wstr long) NTDLL__wcsnicmp
@ cdecl _wcsupr(wstr) CRTDLL__wcsupr @ cdecl _wcsupr(wstr) NTDLL__wcsupr
@ stub abs @ stub abs
@ stub atan @ stub atan
@ cdecl atoi(str) atoi @ cdecl atoi(str) atoi
...@@ -901,12 +901,12 @@ type win32 ...@@ -901,12 +901,12 @@ type win32
@ cdecl isprint(long) isprint @ cdecl isprint(long) isprint
@ cdecl isspace(long) isspace @ cdecl isspace(long) isspace
@ cdecl isupper(long) isupper @ cdecl isupper(long) isupper
@ cdecl iswalpha(long) CRTDLL_iswalpha @ cdecl iswalpha(long) NTDLL_iswalpha
@ cdecl iswctype(long long) CRTDLL_iswctype @ cdecl iswctype(long long) NTDLL_iswctype
@ cdecl isxdigit(long) isxdigit @ cdecl isxdigit(long) isxdigit
@ stub labs @ stub labs
@ stub log @ stub log
@ cdecl mbstowcs(ptr str long) CRTDLL_mbstowcs @ cdecl mbstowcs(ptr str long) NTDLL_mbstowcs
@ cdecl memchr(ptr long long) memchr @ cdecl memchr(ptr long long) memchr
@ cdecl memcmp(ptr ptr long) memcmp @ cdecl memcmp(ptr ptr long) memcmp
@ cdecl memcpy(ptr ptr long) memcpy @ cdecl memcpy(ptr ptr long) memcpy
...@@ -937,23 +937,23 @@ type win32 ...@@ -937,23 +937,23 @@ type win32
@ cdecl toupper(long) toupper @ cdecl toupper(long) toupper
@ cdecl towlower(long) NTDLL_towlower @ cdecl towlower(long) NTDLL_towlower
@ cdecl towupper(long) NTDLL_towupper @ cdecl towupper(long) NTDLL_towupper
@ cdecl vsprintf(ptr str ptr) CRTDLL_vsprintf @ cdecl vsprintf(ptr str ptr) vsprintf
@ cdecl wcscat(wstr wstr) CRTDLL_wcscat @ cdecl wcscat(wstr wstr) NTDLL_wcscat
@ cdecl wcschr(wstr long) CRTDLL_wcschr @ cdecl wcschr(wstr long) NTDLL_wcschr
@ cdecl wcscmp(wstr wstr) CRTDLL_wcscmp @ cdecl wcscmp(wstr wstr) NTDLL_wcscmp
@ cdecl wcscpy(ptr wstr) CRTDLL_wcscpy @ cdecl wcscpy(ptr wstr) NTDLL_wcscpy
@ cdecl wcscspn(wstr wstr) CRTDLL_wcscspn @ cdecl wcscspn(wstr wstr) NTDLL_wcscspn
@ cdecl wcslen(wstr) CRTDLL_wcslen @ cdecl wcslen(wstr) NTDLL_wcslen
@ cdecl wcsncat(wstr wstr long) CRTDLL_wcsncat @ cdecl wcsncat(wstr wstr long) NTDLL_wcsncat
@ cdecl wcsncmp(wstr wstr long) CRTDLL_wcsncmp @ cdecl wcsncmp(wstr wstr long) NTDLL_wcsncmp
@ cdecl wcsncpy(ptr wstr long) CRTDLL_wcsncpy @ cdecl wcsncpy(ptr wstr long) NTDLL_wcsncpy
@ cdecl wcspbrk(wstr wstr) CRTDLL_wcspbrk @ cdecl wcspbrk(wstr wstr) NTDLL_wcspbrk
@ cdecl wcsrchr(wstr long) CRTDLL_wcsrchr @ cdecl wcsrchr(wstr long) NTDLL_wcsrchr
@ cdecl wcsspn(wstr wstr) CRTDLL_wcsspn @ cdecl wcsspn(wstr wstr) NTDLL_wcsspn
@ cdecl wcsstr(wstr wstr) CRTDLL_wcsstr @ cdecl wcsstr(wstr wstr) NTDLL_wcsstr
@ cdecl wcstok(wstr wstr) CRTDLL_wcstok @ cdecl wcstok(wstr wstr) NTDLL_wcstok
@ cdecl wcstol(wstr ptr long) CRTDLL_wcstol @ cdecl wcstol(wstr ptr long) NTDLL_wcstol
@ cdecl wcstombs(ptr ptr long) CRTDLL_wcstombs @ cdecl wcstombs(ptr ptr long) NTDLL_wcstombs
@ stub wcstoul @ stub wcstoul
@ stub NtAddAtom @ stub NtAddAtom
@ stub NtDeleteAtom @ stub NtDeleteAtom
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include <ctype.h> #include <ctype.h>
#include "wine/winestring.h" #include "wine/winestring.h"
#include "wine/unicode.h" #include "wine/unicode.h"
#include "crtdll.h"
#include "heap.h" #include "heap.h"
#include "winnls.h" #include "winnls.h"
#include "debugtools.h" #include "debugtools.h"
...@@ -23,22 +22,6 @@ DEFAULT_DEBUG_CHANNEL(ntdll); ...@@ -23,22 +22,6 @@ DEFAULT_DEBUG_CHANNEL(ntdll);
/* STRING FUNCTIONS */ /* STRING FUNCTIONS */
/************************************************************************** /**************************************************************************
* NTDLL.towupper
*/
WCHAR CDECL NTDLL_towupper(WCHAR code)
{
return toupperW(code);
}
/**************************************************************************
* NTDLL.towlower
*/
WCHAR CDECL NTDLL_towlower(WCHAR code)
{
return tolowerW(code);
}
/**************************************************************************
* RtlInitString * RtlInitString
*/ */
VOID WINAPI RtlInitString(PSTRING target,LPCSTR source) VOID WINAPI RtlInitString(PSTRING target,LPCSTR source)
...@@ -154,9 +137,9 @@ BOOLEAN WINAPI RtlEqualUnicodeString( ...@@ -154,9 +137,9 @@ BOOLEAN WINAPI RtlEqualUnicodeString(
if (s1->Length != s2->Length) return FALSE; if (s1->Length != s2->Length) return FALSE;
if (CaseInsensitive) if (CaseInsensitive)
ret = !CRTDLL__wcsnicmp(s1->Buffer,s2->Buffer,s1->Length/sizeof(WCHAR)); ret = !strncmpiW(s1->Buffer,s2->Buffer,s1->Length/sizeof(WCHAR));
else else
ret = !CRTDLL_wcsncmp(s1->Buffer,s2->Buffer,s1->Length/sizeof(WCHAR)); ret = !strncmpW(s1->Buffer,s2->Buffer,s1->Length/sizeof(WCHAR));
return ret; return ret;
} }
...@@ -179,9 +162,9 @@ LONG WINAPI RtlCompareUnicodeString( ...@@ -179,9 +162,9 @@ LONG WINAPI RtlCompareUnicodeString(
if (s1->Length != s2->Length) return (s1->Length - s2->Length); if (s1->Length != s2->Length) return (s1->Length - s2->Length);
if (CaseInsensitive) if (CaseInsensitive)
ret = CRTDLL__wcsnicmp(s1->Buffer,s2->Buffer,s1->Length/sizeof(WCHAR)); ret = strncmpiW(s1->Buffer,s2->Buffer,s1->Length/sizeof(WCHAR));
else else
ret = CRTDLL_wcsncmp(s1->Buffer,s2->Buffer,s1->Length/sizeof(WCHAR)); ret = strncmpW(s1->Buffer,s2->Buffer,s1->Length/sizeof(WCHAR));
return ret; return ret;
} }
......
/*
* NTDLL string functions
*
* Copyright 2000 Alexandre Julliard
*/
#include "config.h"
#include <ctype.h>
#include <string.h>
#include "windef.h"
/*********************************************************************
* _memicmp (NTDLL)
*/
INT __cdecl _memicmp( LPCSTR s1, LPCSTR s2, DWORD len )
{
int ret = 0;
while (len--)
{
if ((ret = tolower(*s1) - tolower(*s2))) break;
s1++;
s2++;
}
return ret;
}
/*********************************************************************
* _strupr (NTDLL)
*/
LPSTR __cdecl _strupr( LPSTR str )
{
LPSTR ret = str;
for ( ; *str; str++) *str = toupper(*str);
return ret;
}
/*********************************************************************
* _strlwr (NTDLL)
*
* convert a string in place to lowercase
*/
LPSTR __cdecl _strlwr( LPSTR str )
{
LPSTR ret = str;
for ( ; *str; str++) *str = tolower(*str);
return ret;
}
/*********************************************************************
* _ultoa (NTDLL)
*/
LPSTR __cdecl _ultoa( unsigned long x, LPSTR buf, INT radix )
{
char buffer[32], *p;
p = buffer + sizeof(buffer);
*--p = 0;
do
{
int rem = x % radix;
*--p = (rem <= 9) ? rem + '0' : rem + 'a' - 10;
x /= radix;
} while (x);
strcpy( buf, p + 1 );
return buf;
}
/*********************************************************************
* _ltoa (NTDLL)
*/
LPSTR __cdecl _ltoa( long x, LPSTR buf, INT radix )
{
LPSTR p = buf;
if (x < 0)
{
*p++ = '-';
x = -x;
}
_ultoa( x, p, radix );
return buf;
}
/*********************************************************************
* _itoa (NTDLL)
*/
LPSTR __cdecl _itoa( int x, LPSTR buf, INT radix )
{
return _ltoa( x, buf, radix );
}
/*
* NTDLL wide-char functions
*
* Copyright 2000 Alexandre Julliard
*/
#include "config.h"
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_WCTYPE_H
#include <wctype.h>
#endif
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "wine/unicode.h"
#include "heap.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(ntdll);
/*********************************************************************
* NTDLL__wcsicmp (NTDLL)
*/
INT __cdecl NTDLL__wcsicmp( LPCWSTR str1, LPCWSTR str2 )
{
return strcmpiW( str1, str2 );
}
/*********************************************************************
* NTDLL__wcslwr (NTDLL)
*/
LPWSTR __cdecl NTDLL__wcslwr( LPWSTR str )
{
return strlwrW( str );
}
/*********************************************************************
* NTDLL__wcsnicmp (NTDLL)
*/
INT __cdecl NTDLL__wcsnicmp( LPCWSTR str1, LPCWSTR str2, INT n )
{
return strncmpiW( str1, str2, n );
}
/*********************************************************************
* NTDLL__wcsupr (NTDLL)
*/
LPWSTR __cdecl NTDLL__wcsupr( LPWSTR str )
{
return struprW( str );
}
/*********************************************************************
* NTDLL_towlower (NTDLL)
*/
WCHAR __cdecl NTDLL_towlower( WCHAR ch )
{
return tolowerW(ch);
}
/*********************************************************************
* NTDLL_towupper (NTDLL)
*/
WCHAR __cdecl NTDLL_towupper( WCHAR ch )
{
return toupperW(ch);
}
/***********************************************************************
* NTDLL_wcscat (NTDLL)
*/
LPWSTR __cdecl NTDLL_wcscat( LPWSTR dst, LPCWSTR src )
{
return strcatW( dst, src );
}
/*********************************************************************
* NTDLL_wcschr (NTDLL)
*/
LPWSTR __cdecl NTDLL_wcschr( LPCWSTR str, WCHAR ch )
{
return strchrW( str, ch );
}
/*********************************************************************
* NTDLL_wcscmp (NTDLL)
*/
INT __cdecl NTDLL_wcscmp( LPCWSTR str1, LPCWSTR str2 )
{
return strcmpW( str1, str2 );
}
/***********************************************************************
* NTDLL_wcscpy (NTDLL)
*/
LPWSTR __cdecl NTDLL_wcscpy( LPWSTR dst, LPCWSTR src )
{
return strcpyW( dst, src );
}
/*********************************************************************
* NTDLL_wcscspn (NTDLL)
*/
INT __cdecl NTDLL_wcscspn( LPCWSTR str, LPCWSTR reject )
{
LPCWSTR start = str;
while (*str)
{
LPCWSTR p = reject;
while (*p && (*p != *str)) p++;
if (*p) break;
str++;
}
return str - start;
}
/***********************************************************************
* NTDLL_wcslen (NTDLL)
*/
INT __cdecl NTDLL_wcslen( LPCWSTR str )
{
return strlenW( str );
}
/*********************************************************************
* NTDLL_wcsncat (NTDLL)
*/
LPWSTR __cdecl NTDLL_wcsncat( LPWSTR s1, LPCWSTR s2, INT n )
{
LPWSTR ret = s1;
while (*s1) s1++;
while (n-- > 0) if (!(*s1++ = *s2++)) return ret;
*s1 = 0;
return ret;
}
/*********************************************************************
* NTDLL_wcsncmp (NTDLL)
*/
INT __cdecl NTDLL_wcsncmp( LPCWSTR str1, LPCWSTR str2, INT n )
{
return strncmpW( str1, str2, n );
}
/*********************************************************************
* NTDLL_wcsncpy (NTDLL)
*/
LPWSTR __cdecl NTDLL_wcsncpy( LPWSTR s1, LPCWSTR s2, INT n )
{
LPWSTR ret = s1;
while (n-- > 0) if (!(*s1++ = *s2++)) break;
while (n-- > 0) *s1++ = 0;
return ret;
}
/*********************************************************************
* NTDLL_wcspbrk (NTDLL)
*/
LPWSTR __cdecl NTDLL_wcspbrk( LPCWSTR str, LPCWSTR accept )
{
LPCWSTR p;
while (*str)
{
for (p = accept; *p; p++) if (*p == *str) return (LPWSTR)str;
str++;
}
return NULL;
}
/*********************************************************************
* NTDLL_wcsrchr (NTDLL)
*/
LPWSTR __cdecl NTDLL_wcsrchr( LPWSTR str, WCHAR ch )
{
LPWSTR last = NULL;
while (*str)
{
if (*str == ch) last = str;
str++;
}
return last;
}
/*********************************************************************
* NTDLL_wcsspn (NTDLL)
*/
INT __cdecl NTDLL_wcsspn( LPCWSTR str, LPCWSTR accept )
{
LPCWSTR start = str;
while (*str)
{
LPCWSTR p = accept;
while (*p && (*p != *str)) p++;
if (!*p) break;
str++;
}
return str - start;
}
/*********************************************************************
* NTDLL_wcsstr (NTDLL)
*/
LPWSTR __cdecl NTDLL_wcsstr( LPCWSTR str, LPCWSTR sub )
{
return strstrW( str, sub );
}
/*********************************************************************
* NTDLL_wcstok (NTDLL)
*/
LPWSTR __cdecl NTDLL_wcstok( LPWSTR str, LPCWSTR delim )
{
static LPWSTR next = NULL;
LPWSTR ret;
if (!str)
if (!(str = next)) return NULL;
while (*str && NTDLL_wcschr( delim, *str )) str++;
if (!*str) return NULL;
ret = str++;
while (*str && !NTDLL_wcschr( delim, *str )) str++;
if (*str) *str++ = 0;
next = str;
return ret;
}
/*********************************************************************
* NTDLL_wcstombs (NTDLL)
*/
INT __cdecl NTDLL_wcstombs( LPSTR dst, LPCWSTR src, INT n )
{
INT ret;
if (n <= 0) return 0;
ret = WideCharToMultiByte( CP_ACP, 0, src, -1, dst, dst ? n : 0, NULL, NULL );
if (!ret) return n; /* overflow */
return ret - 1; /* do not count terminating NULL */
}
/*********************************************************************
* NTDLL_mbstowcs (NTDLL)
*/
INT __cdecl NTDLL_mbstowcs( LPWSTR dst, LPCSTR src, INT n )
{
INT ret;
if (n <= 0) return 0;
ret = MultiByteToWideChar( CP_ACP, 0, src, -1, dst, dst ? n : 0 );
if (!ret) return n; /* overflow */
return ret - 1; /* do not count terminating NULL */
}
/*********************************************************************
* wcstol (NTDLL)
* Like strtol, but for wide character strings.
*/
INT __cdecl NTDLL_wcstol(LPWSTR s,LPWSTR *end,INT base)
{
LPSTR sA = HEAP_strdupWtoA(GetProcessHeap(),0,s),endA;
INT ret = strtol(sA,&endA,base);
HeapFree(GetProcessHeap(),0,sA);
if (end) *end = s+(endA-sA); /* pointer magic checked. */
return ret;
}
/*********************************************************************
* NTDLL_iswctype (NTDLL)
*/
INT __cdecl NTDLL_iswctype( WCHAR wc, WCHAR wct )
{
INT res = 0;
#ifdef HAVE_WCTYPE_H
#undef iswupper
#undef iswlower
#undef iswdigit
#undef iswspace
#undef iswpunct
#undef iswcntrl
#undef iswxdigit
#undef iswalpha
if (wct & 0x0001) res |= iswupper(wc);
if (wct & 0x0002) res |= iswlower(wc);
if (wct & 0x0004) res |= iswdigit(wc);
if (wct & 0x0008) res |= iswspace(wc);
if (wct & 0x0010) res |= iswpunct(wc);
if (wct & 0x0020) res |= iswcntrl(wc);
if (wct & 0x0080) res |= iswxdigit(wc);
if (wct & 0x0100) res |= iswalpha(wc);
#else
if (wct & 0x0001) res |= isupper(LOBYTE(wc));
if (wct & 0x0002) res |= islower(LOBYTE(wc));
if (wct & 0x0004) res |= isdigit(LOBYTE(wc));
if (wct & 0x0008) res |= isspace(LOBYTE(wc));
if (wct & 0x0010) res |= ispunct(LOBYTE(wc));
if (wct & 0x0020) res |= iscntrl(LOBYTE(wc));
if (wct & 0x0080) res |= isxdigit(LOBYTE(wc));
if (wct & 0x0100) res |= isalpha(LOBYTE(wc));
#endif
if (wct & 0x0040)
FIXME(": iswctype(%04hx,_BLANK|...) requested\n",wc);
if (wct & 0x8000)
FIXME(": iswctype(%04hx,_LEADBYTE|...) requested\n",wc);
return res;
}
/*********************************************************************
* NTDLL_iswalpha (NTDLL)
*/
INT __cdecl NTDLL_iswalpha( WCHAR wc )
{
return NTDLL_iswctype( wc, 0x0100 );
}
...@@ -32,16 +32,11 @@ void __cdecl CRTDLL_free( void *ptr ); ...@@ -32,16 +32,11 @@ void __cdecl CRTDLL_free( void *ptr );
LPSTR __cdecl CRTDLL__mbsinc( LPCSTR str ); LPSTR __cdecl CRTDLL__mbsinc( LPCSTR str );
INT __cdecl CRTDLL__mbslen( LPCSTR str ); INT __cdecl CRTDLL__mbslen( LPCSTR str );
LPSTR __cdecl CRTDLL__strlwr( LPSTR str );
LPWSTR __cdecl CRTDLL__wcsdup( LPCWSTR str ); LPWSTR __cdecl CRTDLL__wcsdup( LPCWSTR str );
INT __cdecl CRTDLL__wcsicmp( LPCWSTR str1, LPCWSTR str2 );
INT __cdecl CRTDLL__wcsicoll( LPCWSTR str1, LPCWSTR str2 ); INT __cdecl CRTDLL__wcsicoll( LPCWSTR str1, LPCWSTR str2 );
LPWSTR __cdecl CRTDLL__wcslwr( LPWSTR str );
INT __cdecl CRTDLL__wcsnicmp( LPCWSTR str1, LPCWSTR str2, INT n );
LPWSTR __cdecl CRTDLL__wcsnset( LPWSTR str, WCHAR c, INT n ); LPWSTR __cdecl CRTDLL__wcsnset( LPWSTR str, WCHAR c, INT n );
LPWSTR __cdecl CRTDLL__wcsrev( LPWSTR str ); LPWSTR __cdecl CRTDLL__wcsrev( LPWSTR str );
LPWSTR __cdecl CRTDLL__wcsset( LPWSTR str, WCHAR c ); LPWSTR __cdecl CRTDLL__wcsset( LPWSTR str, WCHAR c );
LPWSTR __cdecl CRTDLL__wcsupr( LPWSTR str );
INT __cdecl CRTDLL_iswalnum( WCHAR wc ); INT __cdecl CRTDLL_iswalnum( WCHAR wc );
INT __cdecl CRTDLL_iswalpha( WCHAR wc ); INT __cdecl CRTDLL_iswalpha( WCHAR wc );
INT __cdecl CRTDLL_iswcntrl( WCHAR wc ); INT __cdecl CRTDLL_iswcntrl( WCHAR wc );
...@@ -56,39 +51,18 @@ INT __cdecl CRTDLL_iswxdigit( WCHAR wc ); ...@@ -56,39 +51,18 @@ INT __cdecl CRTDLL_iswxdigit( WCHAR wc );
INT __cdecl CRTDLL_iswctype( WCHAR wc, WCHAR wct ); INT __cdecl CRTDLL_iswctype( WCHAR wc, WCHAR wct );
INT __cdecl CRTDLL_mbstowcs( LPWSTR dst, LPCSTR src, INT n ); INT __cdecl CRTDLL_mbstowcs( LPWSTR dst, LPCSTR src, INT n );
INT __cdecl CRTDLL_mbtowc( WCHAR *dst, LPCSTR str, INT n ); INT __cdecl CRTDLL_mbtowc( WCHAR *dst, LPCSTR str, INT n );
WCHAR __cdecl CRTDLL_towlower( WCHAR ch );
WCHAR __cdecl CRTDLL_towupper( WCHAR ch );
LPWSTR __cdecl CRTDLL_wcscat( LPWSTR dst, LPCWSTR src );
LPWSTR __cdecl CRTDLL_wcschr( LPCWSTR str, WCHAR ch );
INT __cdecl CRTDLL_wcscmp( LPCWSTR str1, LPCWSTR str2 );
DWORD __cdecl CRTDLL_wcscoll( LPCWSTR str1, LPCWSTR str2 ); DWORD __cdecl CRTDLL_wcscoll( LPCWSTR str1, LPCWSTR str2 );
LPWSTR __cdecl CRTDLL_wcscpy( LPWSTR dst, LPCWSTR src );
INT __cdecl CRTDLL_wcscspn( LPCWSTR str, LPCWSTR reject );
INT __cdecl CRTDLL_wcslen( LPCWSTR str );
LPWSTR __cdecl CRTDLL_wcsncat( LPWSTR s1, LPCWSTR s2, INT n );
INT __cdecl CRTDLL_wcsncmp( LPCWSTR str1, LPCWSTR str2, INT n );
LPWSTR __cdecl CRTDLL_wcsncpy( LPWSTR s1, LPCWSTR s2, INT n );
LPWSTR __cdecl CRTDLL_wcspbrk( LPCWSTR str, LPCWSTR accept ); LPWSTR __cdecl CRTDLL_wcspbrk( LPCWSTR str, LPCWSTR accept );
LPWSTR __cdecl CRTDLL_wcsrchr( LPWSTR str, WCHAR ch );
INT __cdecl CRTDLL_wcsspn( LPCWSTR str, LPCWSTR accept );
LPWSTR __cdecl CRTDLL_wcsstr( LPCWSTR str, LPCWSTR sub );
LPWSTR __cdecl CRTDLL_wcstok( LPWSTR str, LPCWSTR delim );
INT __cdecl CRTDLL_wcstol( LPWSTR s, LPWSTR *end, INT base );
INT __cdecl CRTDLL_wcstombs( LPSTR dst, LPCWSTR src, INT n );
INT __cdecl CRTDLL_wctomb( LPSTR dst, WCHAR ch ); INT __cdecl CRTDLL_wctomb( LPSTR dst, WCHAR ch );
#ifdef notyet #ifdef notyet
#define _mbsinc CRTDLL__mbsinc #define _mbsinc CRTDLL__mbsinc
#define _mbslen CRTDLL__mbslen #define _mbslen CRTDLL__mbslen
#define _wcsdup CRTDLL__wcsdup #define _wcsdup CRTDLL__wcsdup
#define _wcsicmp CRTDLL__wcsicmp
#define _wcsicoll CRTDLL__wcsicoll #define _wcsicoll CRTDLL__wcsicoll
#define _wcslwr CRTDLL__wcslwr
#define _wcsnicmp CRTDLL__wcsnicmp
#define _wcsnset CRTDLL__wcsnset #define _wcsnset CRTDLL__wcsnset
#define _wcsrev CRTDLL__wcsrev #define _wcsrev CRTDLL__wcsrev
#define _wcsset CRTDLL__wcsset #define _wcsset CRTDLL__wcsset
#define _wcsupr CRTDLL__wcsupr
#define iswalnum CRTDLL_iswalnum #define iswalnum CRTDLL_iswalnum
#define iswalpha CRTDLL_iswalpha #define iswalpha CRTDLL_iswalpha
#define iswcntrl CRTDLL_iswcntrl #define iswcntrl CRTDLL_iswcntrl
...@@ -100,26 +74,8 @@ INT __cdecl CRTDLL_wctomb( LPSTR dst, WCHAR ch ); ...@@ -100,26 +74,8 @@ INT __cdecl CRTDLL_wctomb( LPSTR dst, WCHAR ch );
#define iswspace CRTDLL_iswspace #define iswspace CRTDLL_iswspace
#define iswupper CRTDLL_iswupper #define iswupper CRTDLL_iswupper
#define iswxdigit CRTDLL_iswxdigit #define iswxdigit CRTDLL_iswxdigit
#define mbstowcs CRTDLL_mbstowcs
#define mbtowc CRTDLL_mbtowc #define mbtowc CRTDLL_mbtowc
#define towlower CRTDLL_towlower
#define towupper CRTDLL_towupper
#define wcscat CRTDLL_wcscat
#define wcschr CRTDLL_wcschr
#define wcscmp CRTDLL_wcscmp
#define wcscoll CRTDLL_wcscoll #define wcscoll CRTDLL_wcscoll
#define wcscpy CRTDLL_wcscpy
#define wcscspn CRTDLL_wcscspn
#define wcslen CRTDLL_wcslen
#define wcsncat CRTDLL_wcsncat
#define wcsncmp CRTDLL_wcsncmp
#define wcsncpy CRTDLL_wcsncpy
#define wcspbrk CRTDLL_wcspbrk
#define wcsrchr CRTDLL_wcsrchr
#define wcsspn CRTDLL_wcsspn
#define wcsstr CRTDLL_wcsstr
#define wcstok CRTDLL_wcstok
#define wcstombs CRTDLL_wcstombs
#define wctomb CRTDLL_wctomb #define wctomb CRTDLL_wctomb
#endif #endif
......
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