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.

48 lines
1.1 KiB

  1. /***
  2. *wcschr.c - search a wchar_t string for a given wchar_t character
  3. *
  4. * Copyright (c) 1985-1992, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * defines wcschr() - search a wchar_t string for a wchar_t character
  8. *
  9. *Revision History:
  10. * 09-09-91 ETC Created from strchr.c.
  11. * 04-07-92 KRS Updated and ripped out _INTL switches.
  12. *
  13. *******************************************************************************/
  14. #include <cruntime.h>
  15. #include <string.h>
  16. /***
  17. *wchar_t *wcschr(string, c) - search a string for a wchar_t character
  18. *
  19. *Purpose:
  20. * Searches a wchar_t string for a given wchar_t character,
  21. * which may be the null character L'\0'.
  22. *
  23. *Entry:
  24. * wchar_t *string - wchar_t string to search in
  25. * wchar_t c - wchar_t character to search for
  26. *
  27. *Exit:
  28. * returns pointer to the first occurence of c in string
  29. * returns NULL if c does not occur in string
  30. *
  31. *Exceptions:
  32. *
  33. *******************************************************************************/
  34. wchar_t * _CALLTYPE1 wcschr (
  35. const wchar_t * string,
  36. wchar_t ch
  37. )
  38. {
  39. while (*string && *string != (wchar_t)ch)
  40. string++;
  41. if (*string == (wchar_t)ch)
  42. return((wchar_t *)string);
  43. return(NULL);
  44. }