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.

62 lines
1.4 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. #if defined(_M_IA64)
  21. #pragma warning(disable:4163)
  22. #pragma function(_wcsset)
  23. #endif
  24. /***
  25. *wchar_t *_wcsset(string, val) - sets all of string to val (wide-characters)
  26. *
  27. *Purpose:
  28. * Sets all of wchar_t characters in string (except the terminating '/0'
  29. * character) equal to val (wide-characters).
  30. *
  31. *
  32. *Entry:
  33. * wchar_t *string - string to modify
  34. * wchar_t val - value to fill string with
  35. *
  36. *Exit:
  37. * returns string -- now filled with val's
  38. *
  39. *Uses:
  40. *
  41. *Exceptions:
  42. *
  43. *******************************************************************************/
  44. wchar_t * __cdecl _wcsset (
  45. wchar_t * string,
  46. wchar_t val
  47. )
  48. {
  49. wchar_t *start = string;
  50. while (*string)
  51. *string++ = (wchar_t)val;
  52. return(start);
  53. }
  54. #endif /* _POSIX_ */