mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-02 15:28:03 +00:00
Moved CharUpper* and CharLower* functions to dlls/user.
This commit is contained in:
parent
c86cb24ec2
commit
dcd247e55f
12 changed files with 141 additions and 160 deletions
|
@ -410,7 +410,7 @@ version/libversion.so: liblz32.so libkernel32.so
|
|||
win32s/libw32skrnl.so: libkernel32.so
|
||||
winaspi/libwnaspi32.so: libkernel32.so
|
||||
wineps/libwineps.so: libgdi32.so libkernel32.so
|
||||
wininet/libwininet.so: libkernel32.so
|
||||
wininet/libwininet.so: libuser32.so libkernel32.so
|
||||
winmm/joystick/libjoystick.drv.so: libwinmm.so libuser32.so
|
||||
winmm/libwinmm.so: libuser32.so libkernel32.so
|
||||
winmm/mcianim/libmcianim.drv.so: libwinmm.so libuser32.so libkernel32.so
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include <string.h>
|
||||
|
||||
#include "winbase.h"
|
||||
#include "ntddk.h"
|
||||
#include "ldt.h"
|
||||
#include "heap.h"
|
||||
#include "commdlg.h"
|
||||
|
@ -178,8 +179,6 @@ HRESULT FILEDLG95_HandleCustomDialogMessages(HWND hwnd, UINT uMsg, WPARAM wParam
|
|||
BOOL FILEDLG95_OnOpenMultipleFiles(HWND hwnd, LPSTR lpstrFileList, UINT nFileCount, UINT sizeUsed);
|
||||
static BOOL BrowseSelectedFolder(HWND hwnd);
|
||||
|
||||
extern LPSTR _strlwr( LPSTR str );
|
||||
|
||||
/***********************************************************************
|
||||
* GetFileName95
|
||||
*
|
||||
|
|
113
dlls/user/lstr.c
113
dlls/user/lstr.c
|
@ -319,6 +319,119 @@ BOOL WINAPI OemToCharW( LPCSTR s, LPWSTR d )
|
|||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* CharLowerA (USER32.25)
|
||||
* FIXME: handle current locale
|
||||
*/
|
||||
LPSTR WINAPI CharLowerA(LPSTR x)
|
||||
{
|
||||
LPSTR s;
|
||||
|
||||
if (HIWORD(x))
|
||||
{
|
||||
s=x;
|
||||
while (*s)
|
||||
{
|
||||
*s=tolower(*s);
|
||||
s++;
|
||||
}
|
||||
return x;
|
||||
}
|
||||
else return (LPSTR)tolower((char)(int)x);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* CharUpperA (USER32.@)
|
||||
* FIXME: handle current locale
|
||||
*/
|
||||
LPSTR WINAPI CharUpperA(LPSTR x)
|
||||
{
|
||||
if (HIWORD(x))
|
||||
{
|
||||
LPSTR s = x;
|
||||
while (*s)
|
||||
{
|
||||
*s=toupper(*s);
|
||||
s++;
|
||||
}
|
||||
return x;
|
||||
}
|
||||
return (LPSTR)toupper((char)(int)x);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* CharLowerW (USER32.@)
|
||||
*/
|
||||
LPWSTR WINAPI CharLowerW(LPWSTR x)
|
||||
{
|
||||
if (HIWORD(x)) return strlwrW(x);
|
||||
else return (LPWSTR)((UINT)tolowerW(LOWORD(x)));
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* CharUpperW (USER32.@)
|
||||
* FIXME: handle current locale
|
||||
*/
|
||||
LPWSTR WINAPI CharUpperW(LPWSTR x)
|
||||
{
|
||||
if (HIWORD(x)) return struprW(x);
|
||||
else return (LPWSTR)((UINT)toupperW(LOWORD(x)));
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* CharLowerBuffA (USER32.@)
|
||||
* FIXME: handle current locale
|
||||
*/
|
||||
DWORD WINAPI CharLowerBuffA( LPSTR str, DWORD len )
|
||||
{
|
||||
DWORD ret = len;
|
||||
if (!str) return 0; /* YES */
|
||||
for (; len; len--, str++) *str = tolower(*str);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* CharLowerBuffW (USER32.@)
|
||||
*/
|
||||
DWORD WINAPI CharLowerBuffW( LPWSTR str, DWORD len )
|
||||
{
|
||||
DWORD ret = len;
|
||||
if (!str) return 0; /* YES */
|
||||
for (; len; len--, str++) *str = tolowerW(*str);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* CharUpperBuffA (USER32.@)
|
||||
* FIXME: handle current locale
|
||||
*/
|
||||
DWORD WINAPI CharUpperBuffA( LPSTR str, DWORD len )
|
||||
{
|
||||
DWORD ret = len;
|
||||
if (!str) return 0; /* YES */
|
||||
for (; len; len--, str++) *str = toupper(*str);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* CharUpperBuffW (USER32.@)
|
||||
*/
|
||||
DWORD WINAPI CharUpperBuffW( LPWSTR str, DWORD len )
|
||||
{
|
||||
DWORD ret = len;
|
||||
if (!str) return 0; /* YES */
|
||||
for (; len; len--, str++) *str = toupperW(*str);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* IsCharLowerA (USER.436) (USER32.@)
|
||||
* FIXME: handle current locale
|
||||
|
|
|
@ -4,7 +4,7 @@ SRCDIR = @srcdir@
|
|||
VPATH = @srcdir@
|
||||
MODULE = wininet
|
||||
SOVERSION = 1.0
|
||||
IMPORTS = kernel32
|
||||
IMPORTS = user32 kernel32
|
||||
|
||||
C_SRCS = \
|
||||
http.c \
|
||||
|
|
|
@ -2,6 +2,7 @@ name wininet
|
|||
type win32
|
||||
init WININET_LibMain
|
||||
|
||||
import user32.dll
|
||||
import kernel32.dll
|
||||
|
||||
@ stub InternetInitializeAutoProxyDll
|
||||
|
|
|
@ -22,8 +22,7 @@
|
|||
#include <unistd.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
#include "ntddk.h"
|
||||
#include "wine/winbase16.h"
|
||||
#include "wine/unicode.h"
|
||||
#include "winerror.h"
|
||||
|
@ -1191,7 +1190,7 @@ static DWORD DOSFS_DoGetFullPathName( LPCSTR name, DWORD len, LPSTR result,
|
|||
memmove(p+1,p+3,strlen(p+3)+1);
|
||||
}
|
||||
if (!(DRIVE_GetFlags(drive) & DRIVE_CASE_PRESERVING))
|
||||
CharUpperA( full_name.short_name );
|
||||
_strupr( full_name.short_name );
|
||||
namelen=strlen(full_name.short_name);
|
||||
if (!strcmp(full_name.short_name+namelen-3,"\\.."))
|
||||
{
|
||||
|
@ -1373,7 +1372,7 @@ static int DOSFS_FindNextEx( FIND_FIRST_INFO *info, WIN32_FIND_DATAA *entry )
|
|||
!(flags & DRIVE_CASE_SENSITIVE) );
|
||||
|
||||
lstrcpynA( entry->cFileName, long_name, sizeof(entry->cFileName) );
|
||||
if (!(flags & DRIVE_CASE_PRESERVING)) CharLowerA( entry->cFileName );
|
||||
if (!(flags & DRIVE_CASE_PRESERVING)) _strlwr( entry->cFileName );
|
||||
TRACE("returning %s (%s) %02lx %ld\n",
|
||||
entry->cFileName, entry->cAlternateFileName,
|
||||
entry->dwFileAttributes, entry->nFileSizeLow );
|
||||
|
|
|
@ -18,8 +18,6 @@
|
|||
#include "winerror.h"
|
||||
#include "wine/winbase16.h"
|
||||
#include "windef.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
#include "winnls.h"
|
||||
#include "winreg.h"
|
||||
#include "file.h"
|
||||
|
@ -511,7 +509,7 @@ static BOOL PROFILE_FlushFile(void)
|
|||
p = buffer + strlen(buffer);
|
||||
*p++ = '/';
|
||||
strcpy( p, strrchr( CurProfile->dos_name, '\\' ) + 1 );
|
||||
CharLowerA( p );
|
||||
_strlwr( p );
|
||||
file = fopen( buffer, "w" );
|
||||
unix_name = buffer;
|
||||
}
|
||||
|
@ -646,7 +644,7 @@ static BOOL PROFILE_Open( LPCSTR filename )
|
|||
p = buffer + strlen(buffer);
|
||||
*p++ = '/';
|
||||
strcpy( p, strrchr( newdos_name, '\\' ) + 1 );
|
||||
CharLowerA( p );
|
||||
_strlwr( p );
|
||||
if ((file = fopen( buffer, "r" )))
|
||||
{
|
||||
TRACE("(%s): found it in %s\n",
|
||||
|
|
|
@ -974,6 +974,10 @@ NTSTATUS WINAPI NtReleaseSemaphore( IN HANDLE SemaphoreHandle,
|
|||
IN PULONG PreviousCount);
|
||||
|
||||
|
||||
/* string functions */
|
||||
extern LPSTR _strlwr( LPSTR str );
|
||||
extern LPSTR _strupr( LPSTR str );
|
||||
|
||||
/* misc */
|
||||
|
||||
#if defined(__i386__) && defined(__GNUC__)
|
||||
|
|
|
@ -244,7 +244,7 @@ WORD NE_GetOrdinal( HMODULE16 hModule, const char *name )
|
|||
/* Now copy and uppercase the string */
|
||||
|
||||
strcpy( buffer, name );
|
||||
CharUpperA( buffer );
|
||||
_strupr( buffer );
|
||||
len = strlen( buffer );
|
||||
|
||||
/* First search the resident names */
|
||||
|
|
137
misc/lstr.c
137
misc/lstr.c
|
@ -29,143 +29,6 @@ DEFAULT_DEBUG_CHANNEL(resource);
|
|||
|
||||
extern const WORD OLE2NLS_CT_CType3_LUT[]; /* FIXME: does not belong here */
|
||||
|
||||
/***********************************************************************
|
||||
* CharLowerA (USER32.25)
|
||||
* FIXME: handle current locale
|
||||
*/
|
||||
LPSTR WINAPI CharLowerA(LPSTR x)
|
||||
{
|
||||
LPSTR s;
|
||||
|
||||
if (HIWORD(x))
|
||||
{
|
||||
s=x;
|
||||
while (*s)
|
||||
{
|
||||
*s=tolower(*s);
|
||||
s++;
|
||||
}
|
||||
return x;
|
||||
}
|
||||
else return (LPSTR)tolower((char)(int)x);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* CharLowerBuffA (USER32.26)
|
||||
* FIXME: handle current locale
|
||||
*/
|
||||
DWORD WINAPI CharLowerBuffA(LPSTR x,DWORD buflen)
|
||||
{
|
||||
DWORD done=0;
|
||||
|
||||
if (!x) return 0; /* YES */
|
||||
while (*x && (buflen--))
|
||||
{
|
||||
*x=tolower(*x);
|
||||
x++;
|
||||
done++;
|
||||
}
|
||||
return done;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* CharLowerBuffW (USER32.27)
|
||||
*/
|
||||
DWORD WINAPI CharLowerBuffW(LPWSTR x,DWORD buflen)
|
||||
{
|
||||
DWORD done=0;
|
||||
|
||||
if (!x) return 0; /* YES */
|
||||
while (*x && (buflen--))
|
||||
{
|
||||
*x=tolowerW(*x);
|
||||
x++;
|
||||
done++;
|
||||
}
|
||||
return done;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* CharLowerW (USER32.28)
|
||||
* FIXME: handle current locale
|
||||
*/
|
||||
LPWSTR WINAPI CharLowerW(LPWSTR x)
|
||||
{
|
||||
if (HIWORD(x))
|
||||
{
|
||||
LPWSTR s = x;
|
||||
while (*s)
|
||||
{
|
||||
*s = tolowerW(*s);
|
||||
s++;
|
||||
}
|
||||
return x;
|
||||
}
|
||||
else return (LPWSTR)((UINT)tolowerW(LOWORD(x)));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* CharUpperA (USER32.41)
|
||||
* FIXME: handle current locale
|
||||
*/
|
||||
LPSTR WINAPI CharUpperA(LPSTR x)
|
||||
{
|
||||
if (HIWORD(x))
|
||||
{
|
||||
LPSTR s = x;
|
||||
while (*s)
|
||||
{
|
||||
*s=toupper(*s);
|
||||
s++;
|
||||
}
|
||||
return x;
|
||||
}
|
||||
return (LPSTR)toupper((char)(int)x);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* CharUpperBuffA (USER32.42)
|
||||
* FIXME: handle current locale
|
||||
*/
|
||||
DWORD WINAPI CharUpperBuffA( LPSTR str, DWORD len )
|
||||
{
|
||||
DWORD ret = len;
|
||||
if (!str) return 0; /* YES */
|
||||
for (; len; len--, str++) *str = toupper(*str);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* CharUpperBuffW (USER32.43)
|
||||
* FIXME: handle current locale
|
||||
*/
|
||||
DWORD WINAPI CharUpperBuffW( LPWSTR str, DWORD len )
|
||||
{
|
||||
DWORD ret = len;
|
||||
if (!str) return 0; /* YES */
|
||||
for (; len; len--, str++) *str = toupperW(*str);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* CharUpperW (USER32.44)
|
||||
* FIXME: handle current locale
|
||||
*/
|
||||
LPWSTR WINAPI CharUpperW(LPWSTR x)
|
||||
{
|
||||
if (HIWORD(x))
|
||||
{
|
||||
LPWSTR s = x;
|
||||
while (*s)
|
||||
{
|
||||
*s = toupperW(*s);
|
||||
s++;
|
||||
}
|
||||
return x;
|
||||
}
|
||||
else return (LPWSTR)((UINT)toupperW(LOWORD(x)));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* IsCharAlphaA (USER.433) (USER32.331)
|
||||
* FIXME: handle current locale
|
||||
|
|
14
misc/main.c
14
misc/main.c
|
@ -16,7 +16,12 @@
|
|||
# include <malloc.h>
|
||||
#endif
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "ntddk.h"
|
||||
#include "winnls.h"
|
||||
#include "winerror.h"
|
||||
|
||||
#include "winsock.h"
|
||||
#include "heap.h"
|
||||
#include "msdos.h"
|
||||
|
@ -24,12 +29,7 @@
|
|||
#include "debugtools.h"
|
||||
#include "debugdefs.h"
|
||||
#include "module.h"
|
||||
#include "winnls.h"
|
||||
#include "windef.h"
|
||||
#include "wingdi.h"
|
||||
#include "wine/winuser16.h"
|
||||
#include "tweak.h"
|
||||
#include "winerror.h"
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -121,14 +121,14 @@ void MAIN_ParseDebugOptions( const char *arg )
|
|||
while((s2 = strchr(s, ':'))) {
|
||||
c = *s2;
|
||||
*s2 = '\0';
|
||||
*((*output)+i) = CharUpperA(strdup(s));
|
||||
*((*output)+i) = _strupr(strdup(s));
|
||||
*s2 = c;
|
||||
s = s2 + 1;
|
||||
i++;
|
||||
}
|
||||
c = *(options + l);
|
||||
*(options + l) = '\0';
|
||||
*((*output)+i) = CharUpperA(strdup(s));
|
||||
*((*output)+i) = _strupr(strdup(s));
|
||||
*(options + l) = c;
|
||||
*((*output)+i+1) = NULL;
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include <ctype.h>
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "ntddk.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h" /* SW_NORMAL */
|
||||
#include "wine/winbase16.h"
|
||||
|
@ -2049,12 +2050,15 @@ void WINAPI DOS3Call( CONTEXT86 *context )
|
|||
break;
|
||||
case 0x21:
|
||||
TRACE("\tconvert string to uppercase with length\n");
|
||||
CharUpperBuffA( (LPSTR)CTX_SEG_OFF_TO_LIN(context,DS_reg(context),EDX_reg(context)),
|
||||
CX_reg(context) );
|
||||
{
|
||||
char *ptr = (char *)CTX_SEG_OFF_TO_LIN(context,DS_reg(context),EDX_reg(context));
|
||||
WORD len = CX_reg(context);
|
||||
while (len--) { *ptr = toupper(*ptr); ptr++; }
|
||||
}
|
||||
break;
|
||||
case 0x22:
|
||||
TRACE("\tConvert ASCIIZ string to uppercase\n");
|
||||
CharUpperA( (LPSTR)CTX_SEG_OFF_TO_LIN(context,DS_reg(context),EDX_reg(context)) );
|
||||
_strupr( (LPSTR)CTX_SEG_OFF_TO_LIN(context,DS_reg(context),EDX_reg(context)) );
|
||||
break;
|
||||
default:
|
||||
TRACE("\tunimplemented function %d\n",AL_reg(context));
|
||||
|
|
Loading…
Reference in a new issue