mirror of
https://github.com/reactos/reactos.git
synced 2024-11-10 00:34:39 +00:00
c501d8112c
svn path=/branches/aicom-network-fixes/; revision=34994
35 lines
615 B
C
35 lines
615 B
C
#include <string.h>
|
|
#include <ctype.h>
|
|
#include <basetsd.h>
|
|
|
|
/* Implementation comes from wine/dlls/ntdll/wcstring.c */
|
|
|
|
/*
|
|
* @implemented
|
|
*/
|
|
long
|
|
_wtol(const wchar_t *str)
|
|
{
|
|
unsigned long RunningTotal = 0;
|
|
char bMinus = 0;
|
|
|
|
while (iswctype(*str, _SPACE) ) {
|
|
str++;
|
|
} /* while */
|
|
|
|
if (*str == L'+') {
|
|
str++;
|
|
} else if (*str == L'-') {
|
|
bMinus = 1;
|
|
str++;
|
|
} /* if */
|
|
|
|
while (*str >= L'0' && *str <= L'9') {
|
|
RunningTotal = RunningTotal * 10 + *str - L'0';
|
|
str++;
|
|
} /* while */
|
|
|
|
return bMinus ? -RunningTotal : RunningTotal;
|
|
}
|
|
|
|
|