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.

57 lines
1.2 KiB

  1. /***
  2. *wcsset.c - sets all characters of wchar_t string to given character
  3. *
  4. * Copyright (c) 1985-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * defines _wcsset() - sets all of the characters in a string (except
  8. * the L'\0') equal to a given character (wide-characters).
  9. *
  10. *Revision History:
  11. * 09-09-91 ETC Created from strset.c.
  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 *_wcsset(string, val) - sets all of string to val (wide-characters)
  22. *
  23. *Purpose:
  24. * Sets all of wchar_t characters in string (except the terminating '/0'
  25. * character) equal to val (wide-characters).
  26. *
  27. *
  28. *Entry:
  29. * wchar_t *string - string to modify
  30. * wchar_t val - value to fill string with
  31. *
  32. *Exit:
  33. * returns string -- now filled with val's
  34. *
  35. *Uses:
  36. *
  37. *Exceptions:
  38. *
  39. *******************************************************************************/
  40. wchar_t * __cdecl _wcsset (
  41. wchar_t * string,
  42. wchar_t val
  43. )
  44. {
  45. wchar_t *start = string;
  46. while (*string)
  47. *string++ = (wchar_t)val;
  48. return(start);
  49. }
  50. #endif /* _POSIX_ */