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.

44 lines
1.2 KiB

  1. /***
  2. *wcschr.c - search a wide character string for a given wide character
  3. *
  4. * Copyright (c) 1985-1988, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * defines wcschr() - search a wide character string for a wide character
  8. *
  9. *Revision History:
  10. * 04-07-91 IanJa C version created.
  11. *
  12. *******************************************************************************/
  13. #include <stddef.h>
  14. #include <stdlib.h>
  15. /***
  16. *char *wcschr(string, c) - search a wide character string for a wide character
  17. *
  18. *Purpose:
  19. * Searches a wide character string for a given wide character, which may
  20. * be the null character L'\0'.
  21. *
  22. *Entry:
  23. * wchar_t *string - string to search in
  24. * wchar_t c - character to search for
  25. *
  26. *Exit:
  27. * returns pointer to the first occurence of c in string
  28. * returns NULL if c does not occur in string
  29. *
  30. *Exceptions:
  31. *
  32. *******************************************************************************/
  33. wchar_t * __cdecl wcschr(const wchar_t * string, wchar_t ch)
  34. {
  35. while (*string && *string != ch)
  36. string++;
  37. if (*string == ch)
  38. return (wchar_t *)string;
  39. return NULL;
  40. }