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.

42 lines
1.0 KiB

  1. /***
  2. *wcslen.c - contains wcslen() routine
  3. *
  4. * Copyright (c) 1985-1988, Microsoft Corporation. All Rights Reserved.
  5. *
  6. *Purpose:
  7. * wcslen returns the length of a null-terminated string in number of
  8. * wide characters, not including the null wide character itself.
  9. *
  10. *Revision History:
  11. * 04-07-91 IanJa C version created.
  12. *
  13. *******************************************************************************/
  14. #include <stdlib.h>
  15. /***
  16. *wcslen - return the length of a null-terminated string
  17. *
  18. *Purpose:
  19. * Finds the number of wide characters in the given wide character
  20. * string, not including the final null character.
  21. *
  22. *Entry:
  23. * const wchat_t * str - string whose length is to be computed
  24. *
  25. *Exit:
  26. * length of the string "str", exclusive of the final null wide character
  27. *
  28. *Exceptions:
  29. *
  30. *******************************************************************************/
  31. size_t __cdecl wcslen(const wchar_t * str)
  32. {
  33. wchar_t *string = (wchar_t *) str;
  34. while( *string )
  35. string++;
  36. return string - str;
  37. }