Home | History | Annotate | Download | only in Wchar
      1 /** @file
      2     Concatenation Functions for <wchar.h>.
      3 
      4     Unless explicitly stated otherwise, if the execution of a function declared
      5     in this file causes copying to take place between objects that overlap, the
      6     behavior is undefined.
      7 
      8     Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
      9     This program and the accompanying materials are licensed and made available under
     10     the terms and conditions of the BSD License that accompanies this distribution.
     11     The full text of the license may be found at
     12     http://opensource.org/licenses/bsd-license.php.
     13 
     14     THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
     15     WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     16 **/
     17 #include  <Uefi.h>
     18 #include  <Library/BaseLib.h>
     19 #include  <Library/BaseMemoryLib.h>
     20 
     21 #include  <LibConfig.h>
     22 
     23 #include  <wchar.h>
     24 
     25 /** The wcscat function appends a copy of the wide string pointed to by s2
     26     (including the terminating null wide character) to the end of the wide
     27     string pointed to by s1. The initial wide character of s2 overwrites the
     28     null wide character at the end of s1.
     29 
     30     @return   The wcscat function returns the value of s1.
     31 **/
     32 wchar_t *wcscat(wchar_t * __restrict s1, const wchar_t * __restrict s2)
     33 {
     34   return (wchar_t *)StrCat( (CHAR16 *)s1, (CONST CHAR16 *)s2);
     35 }
     36 
     37 /** The wcsncat function appends not more than n wide characters (a null wide
     38     character and those that follow it are not appended) from the array pointed
     39     to by s2 to the end of the wide string pointed to by s1. The initial wide
     40     character of s2 overwrites the null wide character at the end of s1.
     41     A terminating null wide character is always appended to the result.
     42 
     43     @return   The wcsncat function returns the value of s1.
     44 **/
     45 wchar_t *wcsncat(wchar_t * __restrict s1, const wchar_t * __restrict s2, size_t n)
     46 {
     47   return (wchar_t *)StrnCat( (CHAR16 *)s1, (CONST CHAR16 *)s2, (UINTN)n);
     48 }
     49