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.

62 lines
1.6 KiB

  1. /***
  2. *wcspbrk.c - scans wide character string for a character from control string
  3. *
  4. * Copyright (c) 1985-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * defines wcspbrk()- returns pointer to the first wide-character in
  8. * a wide-character string in the control string.
  9. *
  10. *Revision History:
  11. * 11-04-91 ETC Created with source from crtdll.
  12. * 04-07-92 KRS Updated and ripped out _INTL switches.
  13. * 04-06-93 SKS Replace _CRTAPI* with __cdecl
  14. * 02-07-94 CFW POSIXify.
  15. *
  16. *******************************************************************************/
  17. #ifndef _POSIX_
  18. #include <cruntime.h>
  19. #include <string.h>
  20. /***
  21. *wchar_t *wcspbrk(string, control) - scans string for a character from control
  22. *
  23. *Purpose:
  24. * Returns pointer to the first wide-character in
  25. * a wide-character string in the control string.
  26. *
  27. *Entry:
  28. * wchar_t *string - string to search in
  29. * wchar_t *control - string containing characters to search for
  30. *
  31. *Exit:
  32. * returns a pointer to the first character from control found
  33. * in string.
  34. * returns NULL if string and control have no characters in common.
  35. *
  36. *Exceptions:
  37. *
  38. *******************************************************************************/
  39. wchar_t * __cdecl wcspbrk (
  40. const wchar_t * string,
  41. const wchar_t * control
  42. )
  43. {
  44. wchar_t *wcset;
  45. /* 1st char in control string stops search */
  46. while (*string) {
  47. for (wcset = (wchar_t *) control; *wcset; wcset++) {
  48. if (*wcset == *string) {
  49. return (wchar_t *) string;
  50. }
  51. }
  52. string++;
  53. }
  54. return NULL;
  55. }
  56. #endif /* _POSIX_ */