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.

93 lines
2.2 KiB

  1. /***
  2. *wcscat.c - contains wcscat() and wcscpy()
  3. *
  4. * Copyright (c) 1985-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * wcscat() appends one wchar_t string onto another.
  8. * wcscpy() copies one wchar_t string into another.
  9. *
  10. * wcscat() concatenates (appends) a copy of the source string to the
  11. * end of the destination string, returning the destination string.
  12. * Strings are wide-character strings.
  13. *
  14. * wcscpy() copies the source string to the spot pointed to be
  15. * the destination string, returning the destination string.
  16. * Strings are wide-character strings.
  17. *
  18. *Revision History:
  19. * 09-09-91 ETC Created from strcat.c.
  20. * 04-07-92 KRS Updated and ripped out _INTL switches.
  21. * 04-06-93 SKS Replace _CRTAPI* with __cdecl
  22. * 02-07-94 CFW POSIXify.
  23. *
  24. *******************************************************************************/
  25. #ifndef _POSIX_
  26. #include <cruntime.h>
  27. #include <string.h>
  28. /***
  29. *wchar_t *wcscat(dst, src) - concatenate (append) one wchar_t string to another
  30. *
  31. *Purpose:
  32. * Concatenates src onto the end of dest. Assumes enough
  33. * space in dest.
  34. *
  35. *Entry:
  36. * wchar_t *dst - wchar_t string to which "src" is to be appended
  37. * const wchar_t *src - wchar_t string to be appended to the end of "dst"
  38. *
  39. *Exit:
  40. * The address of "dst"
  41. *
  42. *Exceptions:
  43. *
  44. *******************************************************************************/
  45. wchar_t * __cdecl wcscat (
  46. wchar_t * dst,
  47. const wchar_t * src
  48. )
  49. {
  50. wchar_t * cp = dst;
  51. while( *cp )
  52. cp++; /* find end of dst */
  53. while( *cp++ = *src++ ) ; /* Copy src to end of dst */
  54. return( dst ); /* return dst */
  55. }
  56. /***
  57. *wchar_t *wcscpy(dst, src) - copy one wchar_t string over another
  58. *
  59. *Purpose:
  60. * Copies the wchar_t string src into the spot specified by
  61. * dest; assumes enough room.
  62. *
  63. *Entry:
  64. * wchar_t * dst - wchar_t string over which "src" is to be copied
  65. * const wchar_t * src - wchar_t string to be copied over "dst"
  66. *
  67. *Exit:
  68. * The address of "dst"
  69. *
  70. *Exceptions:
  71. *******************************************************************************/
  72. wchar_t * __cdecl wcscpy(wchar_t * dst, const wchar_t * src)
  73. {
  74. wchar_t * cp = dst;
  75. while( *cp++ = *src++ )
  76. ; /* Copy src over dst */
  77. return( dst );
  78. }
  79. #endif /* _POSIX_ */