Download Ultra C Library Reference

Transcript
wcstombs()
Convert Sequence of Wide Chars to Multibyte Chars
Syntax
#include <stdlib.h>
size_t wcstombs(
char
*str,
const wchar_t *pwcs,
size_t
maxnum);
Description
wcstombs() converts a sequence of codes that correspond to
multibyte characters from an array into a sequence of multibyte
characters that begins in the initial shift state. wcstombs() stores
these multibyte characters, stopping if a multibyte character would
exceed the limit of maxnum total bytes or if a null character is stored.
Each code is converted as if by a call to wctomb(), except that the shift
state of wctomb() is not affected.
str is a pointer to the string in which to store the multibyte characters.
pwcs is a pointer to the array from which to read. maxnum specifies the
maximum number of bytes to convert.
No more than maxnum bytes are modified in str. If copying takes place
between overlapping objects, the behavior is undefined.
If a code is encountered that does not correspond to a valid multibyte
character, wcstombs() returns (size_t)-1. Otherwise,
wcstombs() returns the number of bytes modified, not including a
terminating null character, if any.
wcstombs() is supported for both the C and JAPAN locales.
Attributes
Operating System:
State:
Threads:
Re-entrant:
Standards:
Ultra C Library Reference
OS-9 and OS-9 for 68K
User and System
Safe
Yes
ANSI
1083