svcadm(1M)을 검색하려면 섹션에서 1M 을 선택하고, 맨 페이지 이름에 svcadm을 입력하고 검색을 누른다.
wctomb(3c)
Standard C Library Functions wctomb(3C)
NAME
wctomb - convert a wide-character code to a character
wctomb_s - convert a wide-character code to a character with additional
safety checks
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),
wcstombs(3C), wcstombs_s(3C), attributes(7), standards(7), runtime_con‐
straint_handler(3C)
Oracle Solaris 11.4 13 Jun 2018 wctomb(3C)