2 * NTDLL string functions
4 * Copyright 2000 Alexandre Julliard
5 * Copyright 2000 Jon Griffiths
15 /*********************************************************************
18 INT __cdecl _memicmp( LPCSTR s1, LPCSTR s2, DWORD len )
23 if ((ret = tolower(*s1) - tolower(*s2))) break;
30 /*********************************************************************
33 LPSTR __cdecl _strupr( LPSTR str )
36 for ( ; *str; str++) *str = toupper(*str);
40 /*********************************************************************
43 * convert a string in place to lowercase
45 LPSTR __cdecl _strlwr( LPSTR str )
48 for ( ; *str; str++) *str = tolower(*str);
53 /*********************************************************************
56 LPSTR __cdecl _ultoa( unsigned long x, LPSTR buf, INT radix )
60 p = buffer + sizeof(buffer);
65 *--p = (rem <= 9) ? rem + '0' : rem + 'a' - 10;
73 /*********************************************************************
76 LPSTR __cdecl _ltoa( long x, LPSTR buf, INT radix )
84 _ultoa( x, p, radix );
89 /*********************************************************************
92 LPSTR __cdecl _itoa( int x, LPSTR buf, INT radix )
94 return _ltoa( x, buf, radix );
98 /*********************************************************************
99 * _splitpath (NTDLL.@)
101 void __cdecl _splitpath(const char* inpath, char * drv, char * dir,
102 char* fname, char * ext )
104 /* Modified PD code from 'snippets' collection. */
106 char pathbuff[MAX_PATH], *path=pathbuff;
108 strcpy(pathbuff, inpath);
110 /* convert slashes to backslashes for searching */
111 for (ptr = (char*)path; *ptr; ++ptr)
115 /* look for drive spec */
116 if ('\0' != (ptr = strchr(path, ':')))
121 strncpy(drv, path, ptr - path);
122 drv[ptr - path] = '\0';
129 /* find rightmost backslash or leftmost colon */
130 if (NULL == (ptr = strrchr(path, '\\')))
131 ptr = (strchr(path, ':'));
135 ptr = (char *)path; /* no path */
141 ++ptr; /* skip the delimiter */
151 if (NULL == (p = strrchr(ptr, '.')))
168 /* Fix pathological case - Win returns ':' as part of the
169 * directory when no drive letter is given.
171 if (drv && drv[0] == ':')
178 strcat(pathbuff,dir);
179 strcpy(dir,pathbuff);