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.

45 lines
1.0 KiB

  1. /***
  2. *wcslen.c - contains wcslen() routine
  3. *
  4. * Copyright (c) 1985-1992, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * wcslen returns the length of a null-terminated wide-character string,
  8. * not including the null wchar_t itself.
  9. *
  10. *Revision History:
  11. * 09-09-91 ETC Created from strlen.c.
  12. * 04-07-92 KRS Updated and ripped out _INTL switches.
  13. *
  14. *******************************************************************************/
  15. #include <cruntime.h>
  16. #include <string.h>
  17. /***
  18. *wcslen - return the length of a null-terminated wide-character string
  19. *
  20. *Purpose:
  21. * Finds the length in wchar_t's of the given string, not including
  22. * the final null wchar_t (wide-characters).
  23. *
  24. *Entry:
  25. * const wchar_t * wcs - string whose length is to be computed
  26. *
  27. *Exit:
  28. * length of the string "wcs", exclusive of the final null wchar_t
  29. *
  30. *Exceptions:
  31. *
  32. *******************************************************************************/
  33. size_t _CALLTYPE1 wcslen (
  34. const wchar_t * wcs
  35. )
  36. {
  37. const wchar_t *eos = wcs;
  38. while( *eos++ ) ;
  39. return( (size_t)(eos - wcs - 1) );
  40. }