ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

wtol.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 doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.