Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
899 B

  1. /*++
  2. Copyright (c) 1991-1992 Microsoft Corporation
  3. Module Name:
  4. WToL.c
  5. Abstract:
  6. Contains wcs string functions that are not available in wcstr.h
  7. Author:
  8. 10/29/91 madana
  9. temp code.
  10. Environment:
  11. User mode only.
  12. Contains NT-specific code.
  13. Requires ANSI C extensions: slash-slash comments, long external names.
  14. Tab size is set to 4.
  15. Revision History:
  16. 09-Jan-1992 JohnRo
  17. Moved MadanA's wcstol() from replicator svc to NetLib.
  18. Changed name to avoid probable conflict with strtol -> wcstol routine.
  19. --*/
  20. #include <windef.h>
  21. #include <tstring.h> // My prototypes.
  22. LONG
  23. wtol(
  24. IN LPWSTR string
  25. )
  26. {
  27. LONG value = 0;
  28. while((*string != L'\0') &&
  29. (*string >= L'0') &&
  30. ( *string <= L'9')) {
  31. value = value * 10 + (*string - L'0');
  32. string++;
  33. }
  34. return(value);
  35. }