Leaked source code of windows server 2003
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.

54 lines
1.3 KiB

  1. /***
  2. *wcschr.c - search a wchar_t string for a given wchar_t character
  3. *
  4. * Copyright (c) 1985-2001, 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. * 04-06-93 SKS Replace _CRTAPI* with __cdecl
  13. * 02-07-94 CFW POSIXify.
  14. *
  15. *******************************************************************************/
  16. #ifndef _POSIX_
  17. #include <cruntime.h>
  18. #include <string.h>
  19. /***
  20. *wchar_t *wcschr(string, c) - search a string for a wchar_t character
  21. *
  22. *Purpose:
  23. * Searches a wchar_t string for a given wchar_t character,
  24. * which may be the null character L'\0'.
  25. *
  26. *Entry:
  27. * wchar_t *string - wchar_t string to search in
  28. * wchar_t c - wchar_t character to search for
  29. *
  30. *Exit:
  31. * returns pointer to the first occurence of c in string
  32. * returns NULL if c does not occur in string
  33. *
  34. *Exceptions:
  35. *
  36. *******************************************************************************/
  37. wchar_t * __cdecl wcschr (
  38. const wchar_t * string,
  39. wchar_t ch
  40. )
  41. {
  42. while (*string && *string != (wchar_t)ch)
  43. string++;
  44. if (*string == (wchar_t)ch)
  45. return((wchar_t *)string);
  46. return(NULL);
  47. }
  48. #endif /* _POSIX_ */