Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenwtol.c
Go to the documentation of this file.
00001 #include <string.h> 00002 #include <ctype.h> 00003 #include <basetsd.h> 00004 00005 /* Implementation comes from wine/dlls/ntdll/wcstring.c */ 00006 00007 /* 00008 * @implemented 00009 */ 00010 long 00011 _wtol(const wchar_t *str) 00012 { 00013 unsigned long RunningTotal = 0; 00014 char bMinus = 0; 00015 00016 if (str == NULL) 00017 return 0; 00018 00019 while (iswctype(*str, _SPACE) ) { 00020 str++; 00021 } /* while */ 00022 00023 if (*str == L'+') { 00024 str++; 00025 } else if (*str == L'-') { 00026 bMinus = 1; 00027 str++; 00028 } /* if */ 00029 00030 while (*str >= L'0' && *str <= L'9') { 00031 RunningTotal = RunningTotal * 10 + *str - L'0'; 00032 str++; 00033 } /* while */ 00034 00035 return bMinus ? 0-RunningTotal : RunningTotal; 00036 } 00037 00038 Generated on Sun May 27 2012 04:36:46 for ReactOS by
1.7.6.1
|