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

개요

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

wctomb_s(3c)

wctomb(3C)               Standard C Library Functions               wctomb(3C)

NAME
       wctomb, wctomb_s - convert a wide-character code to a character

SYNOPSIS
       #include <stdlib.h>

       int wctomb(char *s, wchar_t wchar);


       #define __STDC_WANT_LIB_EXT1__ 1
       #include <stdlib.h>

       errno_t wctomb_s(int *restrict status, char *restrict s,
           rsize_t smax, wchar_t wc);

DESCRIPTION
       The  wctomb()  function determines the number of bytes needed to repre‐
       sent the character corresponding to the wide-character code whose value
       is wchar. It stores the  character  representation  (possibly  multiple
       bytes) in the array object pointed to by s, if s is not a null pointer.
       At most MB_CUR_MAX bytes are stored.


       A  call  with s as a null pointer causes this function to return 0. The
       behavior of this function is affected by the LC_CTYPE category  of  the
       current locale.


       The  wctomb_s()  function is part of the C11 bounds checking interfaces
       specified in the C11 standard, Annex K. It is similar to  the  wctomb()
       function,  but  with additional parameter testing and explicit runtime-
       constraints as defined by the C11 standard. See runtime_constraint_han‐
       dler(3C) and INCITS/ISO/IEC 9899:2011.

RETURN VALUES
       If s is a null pointer, the wctomb() function returns zero. If s is not
       a null pointer, the wctomb() function returns -1 if the value of  wchar
       does  not  correspond  to  a  valid character, or returns the number of
       bytes that constitute the  character  corresponding  to  the  value  of
       wchar.


       In  no  case  will  the value returned be greater than the value of the
       MB_CUR_MAX macro.


       Upon successful completion, the wctomb_s() function returns zero. If  a
       runtime-constraint  violation occurred, or if wc was not a valid multi‐
       byte character, the wctomb_s() function returns a non-zero value.


       The value of int pointed to by status will never  be  set  to  a  value
       greater than the value of the MB_CUR_MAX macro.

ERRORS
       No errors are defined for wctomb().


       The wctomb_s() function will fail if:

       ERANGE       Size argument is not valid value


       EOVERFLOW    Destination array is too small


       EILSEQ       Illegal byte sequence


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 StabilityStandard _  MT-LevelSee
       below



       The wctomb() function can be used safely in multithreaded applications,
       as long as setlocale(3C) is not being called to change the locale.


       The wctomb_s() function cannot be used safely in a multithreaded appli‐
       cation due to the runtime constraint handler. For more information, see
       the runtime_constraint_handler(3C) man page.

SEE ALSO
       mblen(3C), mbstowcs(3C), mbstowcs_s(3C), mbtowc(3C), setlocale(3C), wc‐
       stombs(3C),  wcstombs_s(3C),  attributes(7), standards(7), runtime_con‐
       straint_handler(3C)


       Handling Characters and Character Strings in Internationalizing and Lo‐
       calizing Applications in Oracle Solaris

HISTORY
       The wctomb_s() function was added to  Solaris  in  the  Oracle  Solaris
       11.4.0 release.


       The  wctomb() function has been included in all Sun and Oracle releases
       of Solaris.

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