ntdll: Use the standard C library names for the string functions.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2020-06-30 12:06:01 +02:00
parent 4478ba258e
commit cfc9da22f5
3 changed files with 96 additions and 117 deletions

View File

@ -1424,10 +1424,10 @@
@ cdecl -private -arch=i386 _CIsqrt() NTDLL__CIsqrt @ cdecl -private -arch=i386 _CIsqrt() NTDLL__CIsqrt
@ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) @ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr)
@ cdecl -arch=arm,x86_64 -norelay __chkstk() @ cdecl -arch=arm,x86_64 -norelay __chkstk()
@ cdecl __isascii(long) NTDLL___isascii @ cdecl __isascii(long)
@ cdecl __iscsym(long) NTDLL___iscsym @ cdecl __iscsym(long)
@ cdecl __iscsymf(long) NTDLL___iscsymf @ cdecl __iscsymf(long)
@ cdecl __toascii(long) NTDLL___toascii @ cdecl __toascii(long)
@ cdecl -arch=i386 -ret64 _alldiv(int64 int64) @ cdecl -arch=i386 -ret64 _alldiv(int64 int64)
@ cdecl -arch=i386 -norelay _alldvrm(int64 int64) @ cdecl -arch=i386 -norelay _alldvrm(int64 int64)
@ cdecl -arch=i386 -ret64 _allmul(int64 int64) @ cdecl -arch=i386 -ret64 _allmul(int64 int64)
@ -1464,8 +1464,8 @@
@ cdecl _strlwr(str) @ cdecl _strlwr(str)
@ cdecl _strnicmp(str str long) @ cdecl _strnicmp(str str long)
@ cdecl _strupr(str) @ cdecl _strupr(str)
@ cdecl _tolower(long) NTDLL__tolower @ cdecl _tolower(long)
@ cdecl _toupper(long) NTDLL__toupper @ cdecl _toupper(long)
@ cdecl _ui64toa(int64 ptr long) @ cdecl _ui64toa(int64 ptr long)
@ cdecl _ui64tow(int64 ptr long) @ cdecl _ui64tow(int64 ptr long)
@ cdecl _ultoa(long ptr long) @ cdecl _ultoa(long ptr long)
@ -1484,34 +1484,34 @@
@ cdecl _wtol(wstr) @ cdecl _wtol(wstr)
@ cdecl abs(long) NTDLL_abs @ cdecl abs(long) NTDLL_abs
@ cdecl atan(double) NTDLL_atan @ cdecl atan(double) NTDLL_atan
@ cdecl atoi(str) NTDLL_atoi @ cdecl atoi(str)
@ cdecl atol(str) NTDLL_atol @ cdecl atol(str)
@ cdecl bsearch(ptr ptr long long ptr) @ cdecl bsearch(ptr ptr long long ptr)
@ cdecl ceil(double) NTDLL_ceil @ cdecl ceil(double) NTDLL_ceil
@ cdecl cos(double) NTDLL_cos @ cdecl cos(double) NTDLL_cos
@ cdecl fabs(double) NTDLL_fabs @ cdecl fabs(double) NTDLL_fabs
@ cdecl floor(double) NTDLL_floor @ cdecl floor(double) NTDLL_floor
@ cdecl isalnum(long) NTDLL_isalnum @ cdecl isalnum(long)
@ cdecl isalpha(long) NTDLL_isalpha @ cdecl isalpha(long)
@ cdecl iscntrl(long) NTDLL_iscntrl @ cdecl iscntrl(long)
@ cdecl isdigit(long) NTDLL_isdigit @ cdecl isdigit(long)
@ cdecl isgraph(long) NTDLL_isgraph @ cdecl isgraph(long)
@ cdecl islower(long) NTDLL_islower @ cdecl islower(long)
@ cdecl isprint(long) NTDLL_isprint @ cdecl isprint(long)
@ cdecl ispunct(long) NTDLL_ispunct @ cdecl ispunct(long)
@ cdecl isspace(long) NTDLL_isspace @ cdecl isspace(long)
@ cdecl isupper(long) NTDLL_isupper @ cdecl isupper(long)
@ cdecl iswalpha(long) NTDLL_iswalpha @ cdecl iswalpha(long) NTDLL_iswalpha
@ cdecl iswctype(long long) NTDLL_iswctype @ cdecl iswctype(long long) NTDLL_iswctype
@ cdecl iswdigit(long) NTDLL_iswdigit @ cdecl iswdigit(long) NTDLL_iswdigit
@ cdecl iswlower(long) NTDLL_iswlower @ cdecl iswlower(long) NTDLL_iswlower
@ cdecl iswspace(long) NTDLL_iswspace @ cdecl iswspace(long) NTDLL_iswspace
@ cdecl iswxdigit(long) NTDLL_iswxdigit @ cdecl iswxdigit(long) NTDLL_iswxdigit
@ cdecl isxdigit(long) NTDLL_isxdigit @ cdecl isxdigit(long)
@ cdecl labs(long) NTDLL_abs @ cdecl labs(long) NTDLL_abs
@ cdecl log(double) NTDLL_log @ cdecl log(double) NTDLL_log
@ cdecl mbstowcs(ptr str long) NTDLL_mbstowcs @ cdecl mbstowcs(ptr str long) NTDLL_mbstowcs
@ cdecl memchr(ptr long long) NTDLL_memchr @ cdecl memchr(ptr long long)
@ cdecl memcmp(ptr ptr long) @ cdecl memcmp(ptr ptr long)
@ cdecl memcpy(ptr ptr long) @ cdecl memcpy(ptr ptr long)
@ cdecl memmove(ptr ptr long) @ cdecl memmove(ptr ptr long)
@ -1522,28 +1522,28 @@
@ varargs sprintf(ptr str) NTDLL_sprintf @ varargs sprintf(ptr str) NTDLL_sprintf
@ varargs sprintf_s(ptr long str) @ varargs sprintf_s(ptr long str)
@ cdecl sqrt(double) NTDLL_sqrt @ cdecl sqrt(double) NTDLL_sqrt
@ varargs sscanf(str str) NTDLL_sscanf @ varargs sscanf(str str)
@ cdecl strcat(str str) NTDLL_strcat @ cdecl strcat(str str)
@ cdecl strchr(str long) NTDLL_strchr @ cdecl strchr(str long)
@ cdecl strcmp(str str) NTDLL_strcmp @ cdecl strcmp(str str)
@ cdecl strcpy(ptr str) NTDLL_strcpy @ cdecl strcpy(ptr str)
@ cdecl strcspn(str str) NTDLL_strcspn @ cdecl strcspn(str str)
@ cdecl strlen(str) NTDLL_strlen @ cdecl strlen(str)
@ cdecl strncat(str str long) NTDLL_strncat @ cdecl strncat(str str long)
@ cdecl strncmp(str str long) NTDLL_strncmp @ cdecl strncmp(str str long)
@ cdecl strncpy(ptr str long) NTDLL_strncpy @ cdecl strncpy(ptr str long)
@ cdecl strnlen(ptr long) NTDLL_strnlen @ cdecl strnlen(ptr long)
@ cdecl strpbrk(str str) NTDLL_strpbrk @ cdecl strpbrk(str str)
@ cdecl strrchr(str long) NTDLL_strrchr @ cdecl strrchr(str long)
@ cdecl strspn(str str) NTDLL_strspn @ cdecl strspn(str str)
@ cdecl strstr(str str) NTDLL_strstr @ cdecl strstr(str str)
@ cdecl strtol(str ptr long) NTDLL_strtol @ cdecl strtol(str ptr long)
@ cdecl strtoul(str ptr long) NTDLL_strtoul @ cdecl strtoul(str ptr long)
@ varargs swprintf(ptr wstr) NTDLL_swprintf @ varargs swprintf(ptr wstr) NTDLL_swprintf
@ varargs swprintf_s(ptr long wstr) @ varargs swprintf_s(ptr long wstr)
@ cdecl tan(double) NTDLL_tan @ cdecl tan(double) NTDLL_tan
@ cdecl tolower(long) NTDLL_tolower @ cdecl tolower(long)
@ cdecl toupper(long) NTDLL_toupper @ cdecl toupper(long)
@ cdecl towlower(long) NTDLL_towlower @ cdecl towlower(long) NTDLL_towlower
@ cdecl towupper(long) NTDLL_towupper @ cdecl towupper(long) NTDLL_towupper
@ stdcall vDbgPrintEx(long long str ptr) @ stdcall vDbgPrintEx(long long str ptr)

View File

@ -148,17 +148,6 @@ void WINAPI LdrInitializeThunk(CONTEXT*,void**,ULONG_PTR,ULONG_PTR);
#endif #endif
/* string functions */ /* string functions */
void * __cdecl NTDLL_memchr( const void *ptr, int c, size_t n );
char * __cdecl NTDLL_strcat( char *dst, const char *src );
char * __cdecl NTDLL_strchr( const char *str, int c );
int __cdecl NTDLL_strcmp( const char *str1, const char *str2 );
char * __cdecl NTDLL_strcpy( char *dst, const char *src );
size_t __cdecl NTDLL_strlen( const char *str );
char * __cdecl NTDLL_strrchr( const char *str, int c );
LONG __cdecl NTDLL_strtol( const char *s, char **end, int base );
ULONG __cdecl NTDLL_strtoul( const char *s, char **end, int base );
int __cdecl NTDLL_atoi( const char *nptr );
int __cdecl NTDLL_tolower( int c );
int __cdecl NTDLL__wcsicmp( LPCWSTR str1, LPCWSTR str2 ); int __cdecl NTDLL__wcsicmp( LPCWSTR str1, LPCWSTR str2 );
int __cdecl NTDLL__wcsnicmp( LPCWSTR str1, LPCWSTR str2, size_t n ); int __cdecl NTDLL__wcsnicmp( LPCWSTR str1, LPCWSTR str2, size_t n );
int __cdecl NTDLL_wcscmp( LPCWSTR str1, LPCWSTR str2 ); int __cdecl NTDLL_wcscmp( LPCWSTR str1, LPCWSTR str2 );
@ -182,16 +171,6 @@ LPWSTR __cdecl NTDLL_wcstok( LPWSTR str, LPCWSTR delim );
LONG __cdecl NTDLL_wcstol( LPCWSTR s, LPWSTR *end, INT base ); LONG __cdecl NTDLL_wcstol( LPCWSTR s, LPWSTR *end, INT base );
ULONG __cdecl NTDLL_wcstoul( LPCWSTR s, LPWSTR *end, INT base ); ULONG __cdecl NTDLL_wcstoul( LPCWSTR s, LPWSTR *end, INT base );
#define memchr(p,c,n) NTDLL_memchr(p,c,n)
#define strcat(d,s) NTDLL_strcat(d,s)
#define strchr(s,c) NTDLL_strchr(s,c)
#define strcmp(s1,s2) NTDLL_strcmp(s1,s2)
#define strcpy(d,s) NTDLL_strcpy(d,s)
#define strlen(s) NTDLL_strlen(s)
#define strrchr(s,c) NTDLL_strrchr(s,c)
#define strtol(s,e,b) NTDLL_strtol(s,e,b)
#define strtoul(s,e,b) NTDLL_strtoul(s,e,b)
#define atoi(s) NTDLL_atoi(s)
#define wcsicmp(s1,s2) NTDLL__wcsicmp(s1,s2) #define wcsicmp(s1,s2) NTDLL__wcsicmp(s1,s2)
#define wcsnicmp(s1,s2,n) NTDLL__wcsnicmp(s1,s2,n) #define wcsnicmp(s1,s2,n) NTDLL__wcsnicmp(s1,s2,n)
#define towupper(c) NTDLL_towupper(c) #define towupper(c) NTDLL_towupper(c)

View File

@ -68,7 +68,7 @@ static const unsigned short ctypes[257] =
/********************************************************************* /*********************************************************************
* memchr (NTDLL.@) * memchr (NTDLL.@)
*/ */
void * __cdecl NTDLL_memchr( const void *ptr, int c, size_t n ) void * __cdecl memchr( const void *ptr, int c, size_t n )
{ {
const unsigned char *p = ptr; const unsigned char *p = ptr;
@ -154,7 +154,7 @@ void * __cdecl memset( void *dst, int c, size_t n )
/********************************************************************* /*********************************************************************
* strcat (NTDLL.@) * strcat (NTDLL.@)
*/ */
char * __cdecl NTDLL_strcat( char *dst, const char *src ) char * __cdecl strcat( char *dst, const char *src )
{ {
char *d = dst; char *d = dst;
while (*d) d++; while (*d) d++;
@ -166,7 +166,7 @@ char * __cdecl NTDLL_strcat( char *dst, const char *src )
/********************************************************************* /*********************************************************************
* strchr (NTDLL.@) * strchr (NTDLL.@)
*/ */
char * __cdecl NTDLL_strchr( const char *str, int c ) char * __cdecl strchr( const char *str, int c )
{ {
do { if (*str == (char)c) return (char *)(ULONG_PTR)str; } while (*str++); do { if (*str == (char)c) return (char *)(ULONG_PTR)str; } while (*str++);
return NULL; return NULL;
@ -176,7 +176,7 @@ char * __cdecl NTDLL_strchr( const char *str, int c )
/********************************************************************* /*********************************************************************
* strcmp (NTDLL.@) * strcmp (NTDLL.@)
*/ */
int __cdecl NTDLL_strcmp( const char *str1, const char *str2 ) int __cdecl strcmp( const char *str1, const char *str2 )
{ {
while (*str1 && *str1 == *str2) { str1++; str2++; } while (*str1 && *str1 == *str2) { str1++; str2++; }
if ((unsigned char)*str1 > (unsigned char)*str2) return 1; if ((unsigned char)*str1 > (unsigned char)*str2) return 1;
@ -188,7 +188,7 @@ int __cdecl NTDLL_strcmp( const char *str1, const char *str2 )
/********************************************************************* /*********************************************************************
* strcpy (NTDLL.@) * strcpy (NTDLL.@)
*/ */
char * __cdecl NTDLL_strcpy( char *dst, const char *src ) char * __cdecl strcpy( char *dst, const char *src )
{ {
char *d = dst; char *d = dst;
while ((*d++ = *src++)); while ((*d++ = *src++));
@ -199,7 +199,7 @@ char * __cdecl NTDLL_strcpy( char *dst, const char *src )
/********************************************************************* /*********************************************************************
* strcspn (NTDLL.@) * strcspn (NTDLL.@)
*/ */
size_t __cdecl NTDLL_strcspn( const char *str, const char *reject ) size_t __cdecl strcspn( const char *str, const char *reject )
{ {
const char *ptr; const char *ptr;
for (ptr = str; *ptr; ptr++) if (strchr( reject, *ptr )) break; for (ptr = str; *ptr; ptr++) if (strchr( reject, *ptr )) break;
@ -210,7 +210,7 @@ size_t __cdecl NTDLL_strcspn( const char *str, const char *reject )
/********************************************************************* /*********************************************************************
* strlen (NTDLL.@) * strlen (NTDLL.@)
*/ */
size_t __cdecl NTDLL_strlen( const char *str ) size_t __cdecl strlen( const char *str )
{ {
const char *s = str; const char *s = str;
while (*s) s++; while (*s) s++;
@ -221,7 +221,7 @@ size_t __cdecl NTDLL_strlen( const char *str )
/********************************************************************* /*********************************************************************
* strncat (NTDLL.@) * strncat (NTDLL.@)
*/ */
char * __cdecl NTDLL_strncat( char *dst, const char *src, size_t len ) char * __cdecl strncat( char *dst, const char *src, size_t len )
{ {
char *d = dst; char *d = dst;
while (*d) d++; while (*d) d++;
@ -234,7 +234,7 @@ char * __cdecl NTDLL_strncat( char *dst, const char *src, size_t len )
/********************************************************************* /*********************************************************************
* strncmp (NTDLL.@) * strncmp (NTDLL.@)
*/ */
int __cdecl NTDLL_strncmp( const char *str1, const char *str2, size_t len ) int __cdecl strncmp( const char *str1, const char *str2, size_t len )
{ {
if (!len) return 0; if (!len) return 0;
while (--len && *str1 && *str1 == *str2) { str1++; str2++; } while (--len && *str1 && *str1 == *str2) { str1++; str2++; }
@ -246,7 +246,7 @@ int __cdecl NTDLL_strncmp( const char *str1, const char *str2, size_t len )
* strncpy (NTDLL.@) * strncpy (NTDLL.@)
*/ */
#undef strncpy #undef strncpy
char * __cdecl NTDLL_strncpy( char *dst, const char *src, size_t len ) char * __cdecl strncpy( char *dst, const char *src, size_t len )
{ {
char *d; char *d;
for (d = dst; len && *src; d++, src++, len--) *d = *src; for (d = dst; len && *src; d++, src++, len--) *d = *src;
@ -258,7 +258,7 @@ char * __cdecl NTDLL_strncpy( char *dst, const char *src, size_t len )
/********************************************************************* /*********************************************************************
* strnlen (NTDLL.@) * strnlen (NTDLL.@)
*/ */
size_t __cdecl NTDLL_strnlen( const char *str, size_t len ) size_t __cdecl strnlen( const char *str, size_t len )
{ {
const char *s = str; const char *s = str;
for (s = str; len && *s; s++, len--) ; for (s = str; len && *s; s++, len--) ;
@ -269,7 +269,7 @@ size_t __cdecl NTDLL_strnlen( const char *str, size_t len )
/********************************************************************* /*********************************************************************
* strpbrk (NTDLL.@) * strpbrk (NTDLL.@)
*/ */
char * __cdecl NTDLL_strpbrk( const char *str, const char *accept ) char * __cdecl strpbrk( const char *str, const char *accept )
{ {
for ( ; *str; str++) if (strchr( accept, *str )) return (char *)(ULONG_PTR)str; for ( ; *str; str++) if (strchr( accept, *str )) return (char *)(ULONG_PTR)str;
return NULL; return NULL;
@ -279,7 +279,7 @@ char * __cdecl NTDLL_strpbrk( const char *str, const char *accept )
/********************************************************************* /*********************************************************************
* strrchr (NTDLL.@) * strrchr (NTDLL.@)
*/ */
char * __cdecl NTDLL_strrchr( const char *str, int c ) char * __cdecl strrchr( const char *str, int c )
{ {
char *ret = NULL; char *ret = NULL;
do { if (*str == (char)c) ret = (char *)(ULONG_PTR)str; } while (*str++); do { if (*str == (char)c) ret = (char *)(ULONG_PTR)str; } while (*str++);
@ -290,7 +290,7 @@ char * __cdecl NTDLL_strrchr( const char *str, int c )
/********************************************************************* /*********************************************************************
* strspn (NTDLL.@) * strspn (NTDLL.@)
*/ */
size_t __cdecl NTDLL_strspn( const char *str, const char *accept ) size_t __cdecl strspn( const char *str, const char *accept )
{ {
const char *ptr; const char *ptr;
for (ptr = str; *ptr; ptr++) if (!strchr( accept, *ptr )) break; for (ptr = str; *ptr; ptr++) if (!strchr( accept, *ptr )) break;
@ -301,7 +301,7 @@ size_t __cdecl NTDLL_strspn( const char *str, const char *accept )
/********************************************************************* /*********************************************************************
* strstr (NTDLL.@) * strstr (NTDLL.@)
*/ */
char * __cdecl NTDLL_strstr( const char *str, const char *sub ) char * __cdecl strstr( const char *str, const char *sub )
{ {
while (*str) while (*str)
{ {
@ -329,7 +329,7 @@ void * __cdecl _memccpy( void *dst, const void *src, int c, size_t n )
/********************************************************************* /*********************************************************************
* tolower (NTDLL.@) * tolower (NTDLL.@)
*/ */
int __cdecl NTDLL_tolower( int c ) int __cdecl tolower( int c )
{ {
return (char)c >= 'A' && (char)c <= 'Z' ? c - 'A' + 'a' : c; return (char)c >= 'A' && (char)c <= 'Z' ? c - 'A' + 'a' : c;
} }
@ -359,7 +359,7 @@ int __cdecl _memicmp( const void *str1, const void *str2, size_t len )
int ret = 0; int ret = 0;
while (len--) while (len--)
{ {
if ((ret = NTDLL_tolower(*s1) - NTDLL_tolower(*s2))) break; if ((ret = tolower(*s1) - tolower(*s2))) break;
s1++; s1++;
s2++; s2++;
} }
@ -376,8 +376,8 @@ int __cdecl _strnicmp( LPCSTR str1, LPCSTR str2, size_t n )
while (n--) while (n--)
{ {
l1 = (unsigned char)NTDLL_tolower(*str1); l1 = (unsigned char)tolower(*str1);
l2 = (unsigned char)NTDLL_tolower(*str2); l2 = (unsigned char)tolower(*str2);
if (l1 != l2) if (l1 != l2)
{ {
if (sizeof(void *) > sizeof(int)) return l1 - l2; if (sizeof(void *) > sizeof(int)) return l1 - l2;
@ -436,7 +436,7 @@ LPSTR __cdecl _strupr( LPSTR str )
LPSTR __cdecl _strlwr( LPSTR str ) LPSTR __cdecl _strlwr( LPSTR str )
{ {
LPSTR ret = str; LPSTR ret = str;
for ( ; *str; str++) *str = NTDLL_tolower(*str); for ( ; *str; str++) *str = tolower(*str);
return ret; return ret;
} }
@ -444,7 +444,7 @@ LPSTR __cdecl _strlwr( LPSTR str )
/********************************************************************* /*********************************************************************
* toupper (NTDLL.@) * toupper (NTDLL.@)
*/ */
int __cdecl NTDLL_toupper( int c ) int __cdecl toupper( int c )
{ {
char str[2], *p = str; char str[2], *p = str;
WCHAR wc; WCHAR wc;
@ -463,7 +463,7 @@ int __cdecl NTDLL_toupper( int c )
/********************************************************************* /*********************************************************************
* isalnum (NTDLL.@) * isalnum (NTDLL.@)
*/ */
int __cdecl NTDLL_isalnum( int c ) int __cdecl isalnum( int c )
{ {
return ctypes[c + 1] & (C1_LOWER | C1_UPPER | C1_DIGIT); return ctypes[c + 1] & (C1_LOWER | C1_UPPER | C1_DIGIT);
} }
@ -472,7 +472,7 @@ int __cdecl NTDLL_isalnum( int c )
/********************************************************************* /*********************************************************************
* isalpha (NTDLL.@) * isalpha (NTDLL.@)
*/ */
int __cdecl NTDLL_isalpha( int c ) int __cdecl isalpha( int c )
{ {
return ctypes[c + 1] & (C1_LOWER | C1_UPPER); return ctypes[c + 1] & (C1_LOWER | C1_UPPER);
} }
@ -481,7 +481,7 @@ int __cdecl NTDLL_isalpha( int c )
/********************************************************************* /*********************************************************************
* iscntrl (NTDLL.@) * iscntrl (NTDLL.@)
*/ */
int __cdecl NTDLL_iscntrl( int c ) int __cdecl iscntrl( int c )
{ {
return ctypes[c + 1] & C1_CNTRL; return ctypes[c + 1] & C1_CNTRL;
} }
@ -490,7 +490,7 @@ int __cdecl NTDLL_iscntrl( int c )
/********************************************************************* /*********************************************************************
* isdigit (NTDLL.@) * isdigit (NTDLL.@)
*/ */
int __cdecl NTDLL_isdigit( int c ) int __cdecl isdigit( int c )
{ {
return ctypes[c + 1] & C1_DIGIT; return ctypes[c + 1] & C1_DIGIT;
} }
@ -499,7 +499,7 @@ int __cdecl NTDLL_isdigit( int c )
/********************************************************************* /*********************************************************************
* isgraph (NTDLL.@) * isgraph (NTDLL.@)
*/ */
int __cdecl NTDLL_isgraph( int c ) int __cdecl isgraph( int c )
{ {
return ctypes[c + 1] & (C1_LOWER | C1_UPPER | C1_DIGIT | C1_PUNCT); return ctypes[c + 1] & (C1_LOWER | C1_UPPER | C1_DIGIT | C1_PUNCT);
} }
@ -508,7 +508,7 @@ int __cdecl NTDLL_isgraph( int c )
/********************************************************************* /*********************************************************************
* islower (NTDLL.@) * islower (NTDLL.@)
*/ */
int __cdecl NTDLL_islower( int c ) int __cdecl islower( int c )
{ {
return ctypes[c + 1] & C1_LOWER; return ctypes[c + 1] & C1_LOWER;
} }
@ -517,7 +517,7 @@ int __cdecl NTDLL_islower( int c )
/********************************************************************* /*********************************************************************
* isprint (NTDLL.@) * isprint (NTDLL.@)
*/ */
int __cdecl NTDLL_isprint( int c ) int __cdecl isprint( int c )
{ {
return ctypes[c + 1] & (C1_LOWER | C1_UPPER | C1_DIGIT | C1_PUNCT | C1_BLANK); return ctypes[c + 1] & (C1_LOWER | C1_UPPER | C1_DIGIT | C1_PUNCT | C1_BLANK);
} }
@ -526,7 +526,7 @@ int __cdecl NTDLL_isprint( int c )
/********************************************************************* /*********************************************************************
* ispunct (NTDLL.@) * ispunct (NTDLL.@)
*/ */
int __cdecl NTDLL_ispunct( int c ) int __cdecl ispunct( int c )
{ {
return ctypes[c + 1] & C1_PUNCT; return ctypes[c + 1] & C1_PUNCT;
} }
@ -535,7 +535,7 @@ int __cdecl NTDLL_ispunct( int c )
/********************************************************************* /*********************************************************************
* isspace (NTDLL.@) * isspace (NTDLL.@)
*/ */
int __cdecl NTDLL_isspace( int c ) int __cdecl isspace( int c )
{ {
return ctypes[c + 1] & C1_SPACE; return ctypes[c + 1] & C1_SPACE;
} }
@ -544,7 +544,7 @@ int __cdecl NTDLL_isspace( int c )
/********************************************************************* /*********************************************************************
* isupper (NTDLL.@) * isupper (NTDLL.@)
*/ */
int __cdecl NTDLL_isupper( int c ) int __cdecl isupper( int c )
{ {
return ctypes[c + 1] & C1_UPPER; return ctypes[c + 1] & C1_UPPER;
} }
@ -553,7 +553,7 @@ int __cdecl NTDLL_isupper( int c )
/********************************************************************* /*********************************************************************
* isxdigit (NTDLL.@) * isxdigit (NTDLL.@)
*/ */
int __cdecl NTDLL_isxdigit( int c ) int __cdecl isxdigit( int c )
{ {
return ctypes[c + 1] & C1_XDIGIT; return ctypes[c + 1] & C1_XDIGIT;
} }
@ -562,7 +562,7 @@ int __cdecl NTDLL_isxdigit( int c )
/********************************************************************* /*********************************************************************
* __isascii (NTDLL.@) * __isascii (NTDLL.@)
*/ */
int CDECL NTDLL___isascii(int c) int CDECL __isascii(int c)
{ {
return (unsigned)c < 0x80; return (unsigned)c < 0x80;
} }
@ -571,7 +571,7 @@ int CDECL NTDLL___isascii(int c)
/********************************************************************* /*********************************************************************
* __toascii (NTDLL.@) * __toascii (NTDLL.@)
*/ */
int CDECL NTDLL___toascii(int c) int CDECL __toascii(int c)
{ {
return (unsigned)c & 0x7f; return (unsigned)c & 0x7f;
} }
@ -580,25 +580,25 @@ int CDECL NTDLL___toascii(int c)
/********************************************************************* /*********************************************************************
* __iscsym (NTDLL.@) * __iscsym (NTDLL.@)
*/ */
int CDECL NTDLL___iscsym(int c) int CDECL __iscsym(int c)
{ {
return (c < 127 && (NTDLL_isalnum(c) || c == '_')); return (c < 127 && (isalnum(c) || c == '_'));
} }
/********************************************************************* /*********************************************************************
* __iscsymf (NTDLL.@) * __iscsymf (NTDLL.@)
*/ */
int CDECL NTDLL___iscsymf(int c) int CDECL __iscsymf(int c)
{ {
return (c < 127 && (NTDLL_isalpha(c) || c == '_')); return (c < 127 && (isalpha(c) || c == '_'));
} }
/********************************************************************* /*********************************************************************
* _toupper (NTDLL.@) * _toupper (NTDLL.@)
*/ */
int CDECL NTDLL__toupper(int c) int CDECL _toupper(int c)
{ {
return c - 0x20; /* sic */ return c - 0x20; /* sic */
} }
@ -607,7 +607,7 @@ int CDECL NTDLL__toupper(int c)
/********************************************************************* /*********************************************************************
* _tolower (NTDLL.@) * _tolower (NTDLL.@)
*/ */
int CDECL NTDLL__tolower(int c) int CDECL _tolower(int c)
{ {
return c + 0x20; /* sic */ return c + 0x20; /* sic */
} }
@ -624,14 +624,14 @@ static int char_to_int( char c )
/********************************************************************* /*********************************************************************
* strtol (NTDLL.@) * strtol (NTDLL.@)
*/ */
LONG __cdecl NTDLL_strtol( const char *s, char **end, int base ) __msvcrt_long __cdecl strtol( const char *s, char **end, int base )
{ {
BOOL negative = FALSE, empty = TRUE; BOOL negative = FALSE, empty = TRUE;
LONG ret = 0; LONG ret = 0;
if (base < 0 || base == 1 || base > 36) return 0; if (base < 0 || base == 1 || base > 36) return 0;
if (end) *end = (char *)s; if (end) *end = (char *)s;
while (NTDLL_isspace(*s)) s++; while (isspace(*s)) s++;
if (*s == '-') if (*s == '-')
{ {
@ -671,14 +671,14 @@ LONG __cdecl NTDLL_strtol( const char *s, char **end, int base )
/********************************************************************* /*********************************************************************
* strtoul (NTDLL.@) * strtoul (NTDLL.@)
*/ */
ULONG __cdecl NTDLL_strtoul( const char *s, char **end, int base ) __msvcrt_ulong __cdecl strtoul( const char *s, char **end, int base )
{ {
BOOL negative = FALSE, empty = TRUE; BOOL negative = FALSE, empty = TRUE;
ULONG ret = 0; ULONG ret = 0;
if (base < 0 || base == 1 || base > 36) return 0; if (base < 0 || base == 1 || base > 36) return 0;
if (end) *end = (char *)s; if (end) *end = (char *)s;
while (NTDLL_isspace(*s)) s++; while (isspace(*s)) s++;
if (*s == '-') if (*s == '-')
{ {
@ -979,7 +979,7 @@ LONGLONG __cdecl _atoi64( const char *str )
/********************************************************************* /*********************************************************************
* atoi (NTDLL.@) * atoi (NTDLL.@)
*/ */
int __cdecl NTDLL_atoi( const char *nptr ) int __cdecl atoi( const char *nptr )
{ {
return _atoi64( nptr ); return _atoi64( nptr );
} }
@ -988,7 +988,7 @@ int __cdecl NTDLL_atoi( const char *nptr )
/********************************************************************* /*********************************************************************
* atol (NTDLL.@) * atol (NTDLL.@)
*/ */
LONG __cdecl NTDLL_atol( const char *nptr ) __msvcrt_long __cdecl atol( const char *nptr )
{ {
return _atoi64( nptr ); return _atoi64( nptr );
} }
@ -1007,7 +1007,7 @@ static int char2digit( char c, int base )
} }
static int NTDLL_vsscanf( const char *str, const char *format, __ms_va_list ap) static int vsscanf( const char *str, const char *format, __ms_va_list ap)
{ {
int rd = 0, consumed = 0; int rd = 0, consumed = 0;
int nch; int nch;
@ -1019,10 +1019,10 @@ static int NTDLL_vsscanf( const char *str, const char *format, __ms_va_list ap)
while (*format) while (*format)
{ {
if (NTDLL_isspace( *format )) if (isspace( *format ))
{ {
/* skip whitespace */ /* skip whitespace */
while ((nch != '\0') && NTDLL_isspace( nch )) while ((nch != '\0') && isspace( nch ))
nch = (consumed++, *str++); nch = (consumed++, *str++);
} }
else if (*format == '%') else if (*format == '%')
@ -1107,7 +1107,7 @@ static int NTDLL_vsscanf( const char *str, const char *format, __ms_va_list ap)
BOOLEAN negative = FALSE; BOOLEAN negative = FALSE;
BOOLEAN seendigit = FALSE; BOOLEAN seendigit = FALSE;
/* skip initial whitespace */ /* skip initial whitespace */
while ((nch != '\0') && NTDLL_isspace( nch )) while ((nch != '\0') && isspace( nch ))
nch = (consumed++, *str++); nch = (consumed++, *str++);
/* get sign */ /* get sign */
if (nch == '-' || nch == '+') if (nch == '-' || nch == '+')
@ -1193,10 +1193,10 @@ static int NTDLL_vsscanf( const char *str, const char *format, __ms_va_list ap)
char *sptr_beg = sptr; char *sptr_beg = sptr;
unsigned size = UINT_MAX; unsigned size = UINT_MAX;
/* skip initial whitespace */ /* skip initial whitespace */
while (nch != '\0' && NTDLL_isspace( nch )) while (nch != '\0' && isspace( nch ))
nch = (consumed++, *str++); nch = (consumed++, *str++);
/* read until whitespace */ /* read until whitespace */
while (width != 0 && nch != '\0' && !NTDLL_isspace( nch )) while (width != 0 && nch != '\0' && !isspace( nch ))
{ {
if (!suppress) if (!suppress)
{ {
@ -1222,10 +1222,10 @@ static int NTDLL_vsscanf( const char *str, const char *format, __ms_va_list ap)
WCHAR *sptr_beg = sptr; WCHAR *sptr_beg = sptr;
unsigned size = UINT_MAX; unsigned size = UINT_MAX;
/* skip initial whitespace */ /* skip initial whitespace */
while (nch != '\0' && NTDLL_isspace( nch )) while (nch != '\0' && isspace( nch ))
nch = (consumed++, *str++); nch = (consumed++, *str++);
/* read until whitespace */ /* read until whitespace */
while (width != 0 && nch != '\0' && !NTDLL_isspace( nch )) while (width != 0 && nch != '\0' && !isspace( nch ))
{ {
if (!suppress) if (!suppress)
{ {
@ -1407,7 +1407,7 @@ static int NTDLL_vsscanf( const char *str, const char *format, __ms_va_list ap)
* of characters that must match the input. For example, * of characters that must match the input. For example,
* to specify that a percent-sign character is to be input, * to specify that a percent-sign character is to be input,
* use %%." */ * use %%." */
while (nch != '\0' && NTDLL_isspace( nch )) while (nch != '\0' && isspace( nch ))
nch = (consumed++, *str++); nch = (consumed++, *str++);
if (nch == *format) if (nch == *format)
{ {
@ -1442,12 +1442,12 @@ static int NTDLL_vsscanf( const char *str, const char *format, __ms_va_list ap)
/********************************************************************* /*********************************************************************
* sscanf (NTDLL.@) * sscanf (NTDLL.@)
*/ */
int WINAPIV NTDLL_sscanf( const char *str, const char *format, ... ) int WINAPIV sscanf( const char *str, const char *format, ... )
{ {
int ret; int ret;
__ms_va_list valist; __ms_va_list valist;
__ms_va_start( valist, format ); __ms_va_start( valist, format );
ret = NTDLL_vsscanf( str, format, valist ); ret = vsscanf( str, format, valist );
__ms_va_end( valist ); __ms_va_end( valist );
return ret; return ret;
} }