Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | RSS feed

  1. /*
  2. FUNCTION
  3.         <<wcsxfrm>>---locale-specific wide-character string transformation
  4.        
  5. INDEX
  6.         wcsxfrm
  7.  
  8. ANSI_SYNOPSIS
  9.         #include <wchar.h>
  10.         int wcsxfrm(wchar_t *__restrict <[stra]>,
  11.                     const wchar_t *__restrict <[strb]>, size_t <[n]>);
  12.  
  13. TRAD_SYNOPSIS
  14.         #include <wchar.h>
  15.         size_t wcsxfrm(<[stra]>, <[strb]>, <[n]>)
  16.         wchar_t *__restrict <[stra]>;
  17.         wchar_t *__restrict <[strb]>;
  18.         size_t   <[n]>
  19.  
  20. DESCRIPTION
  21.         <<wcsxfrm>> transforms the wide-character string pointed to by
  22.         <[strb]> to the wide-character string pointed to by <[stra]>,
  23.         Comparing two transformed wide strings with <<wcscmp>> should return
  24.         the same result as comparing the original strings with <<wcscoll>>.
  25.         No more than <[n]> wide characters are transformed, including the
  26.         trailing null character.
  27.  
  28.         If <[n]> is 0, <[stra]> may be a NULL pointer.
  29.  
  30.         The current implementation of <<wcsxfrm>> simply uses <<wcslcpy>>
  31.         and does not support any language-specific transformations.
  32.  
  33. RETURNS
  34.         <<wcsxfrm>> returns the length of the transformed wide character
  35.         string.  if the return value is greater or equal to <[n]>, the
  36.         content of <[stra]> is undefined.
  37.  
  38. PORTABILITY
  39. <<wcsxfrm>> is ISO/IEC 9899/AMD1:1995 (ISO C).
  40. */
  41.  
  42. #include <_ansi.h>
  43. #include <wchar.h>
  44.  
  45. size_t
  46. _DEFUN (wcsxfrm, (a, b, n),
  47.         wchar_t *__restrict a _AND
  48.         _CONST wchar_t *__restrict b _AND
  49.         size_t n)
  50.  
  51. {
  52.   return wcslcpy (a, b, n);
  53. }
  54.