wcstombs(3c) 맨 페이지 - 윈디하나의 솔라나라

개요

섹션
맨 페이지 이름
검색(S)

wcstombs(3c)

Standard C Library Functions                                      wcstombs(3C)



NAME
       wcstombs - convert a wide-character string to a character string
       wcstombs_s - convert a wide-character string to a character string with
       additional safety
                   checks

SYNOPSIS
       #include <stdlib.h>

       size_t wcstombs(char *restrict s, const wchar_t *restrict pwcs, size_t n);


       #define __STDC_WANT_LIB_EXT1__ 1
       #include <stdlib.h>

       errno_t wcstombs_s(size_t *restrict retval, char *restrict dst,
           rsize_t dstmax, const wchar_t *restrict src, rsize_t len);

DESCRIPTION
       The wcstombs() function converts the sequence of  wide-character  codes
       from  the  array  pointed  to by pwcs into a sequence of characters and
       stores these characters into the array pointed to by s, stopping  if  a
       character  would exceed the limit of n total bytes or if a null byte is
       stored. Each wide-character code is  converted  as  if  by  a  call  to
       wctomb(3C).


       The  behavior  of this function is affected by the LC_CTYPE category of
       the current locale.


       No more than n bytes will be modified in the array pointed to by s.  If
       copying takes place between objects that overlap, the behavior is unde‐
       fined. If s is a null pointer, wcstombs() returns the  length  required
       to convert the entire array regardless of the value of n, but no values
       are stored.


       The wcstombs_s() function is part of the C11 bounds checking interfaces
       specified in the C11 standard, Annex K. It is similar to the wcstombs()
       function, but with differing parameters and return  type  in  order  to
       provide  additional  safety checks in the form of explicit runtime-con‐
       straints as defined in the C11  standard.  See  runtime_constraint_han‐
       dler(3C) and INCITS/ISO/IEC 9899:2011.

RETURN VALUES
       If  a  wide-character code is encountered that does not correspond to a
       valid character  (of  one  or  more  bytes  each),  wcstombs()  returns
       (size_t)-1. Otherwise, wcstombs() returns the number of bytes stored in
       the character array, not including any terminating null byte. The array
       will not be null-terminated if the value returned is n.


       If  neither  a  runtime  constraint  violation  nor encoding error (the
       result of a failed conversion)  occurred,  wcstombs_s()  returns  zero,
       otherwise, it returns a non-zero value.

ERRORS
       The wcstombs() function may fail if:


       EILSEQ    A  wide-character code does not correspond to a valid charac‐
                 ter.




       The wcstombs_s() function may fail if:


       EINVAL    Null pointer is passed.


       ERANGE    Size argument is not valid value.


       EILSEQ    A wide-character code does not correspond to a valid  charac‐
                 ter.




ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:


       tab()  box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE TYPEAT‐
       TRIBUTE VALUE _ CSIEnabled _ Interface StabilityCommitted _ MT-LevelSee
       below _ StandardSee standards(7).



       The  wcstombs()  function  can be used safely in multithreaded applica‐
       tions.


       The wcstombs_s() function cannot be  used  safely  in  a  multithreaded
       application  due  to  the runtime constraint handler. For more informa‐
       tion, see the runtime_constraint_handler(3C) man page.

SEE ALSO
       mblen(3C),  mbstowcs(3C),  mbstowcs_s(3C),  mbtowc(3C),  setlocale(3C),
       wctomb(3C),  wctomb_s(3C),  attributes(7),  standards(7),  runtime_con‐
       straint_handler(3C)



Oracle Solaris 11.4               13 Jun 2018                     wcstombs(3C)
맨 페이지 내용의 저작권은 맨 페이지 작성자에게 있습니다.
RSS ATOM XHTML 5 CSS3