GLProgramming.com

home :: about :: development guides :: irc :: forums :: search :: paste :: links :: contribute :: code dump

-> Click here to learn how to get live help <-


Manpage of WCRTOMB

WCRTOMB

Index
 

NAME

wcrtomb - convert a wide character to a multibyte sequence  

SYNOPSIS

#include <wchar.h>

size_t wcrtomb(char *s, wchar_t wc, mbstate_t *ps);
 

DESCRIPTION

The main case for this function is when fIsfP is not NULL and fIwcfP is not L' '. In this case, the fBwcrtombfP function converts the wide character fIwcfP to its multibyte representation and stores it at the beginning of the character array pointed to by fIsfP. It updates the shift state fI*psfP, and returns the length of said multibyte representation, i.e. the number of bytes written at fIsfP.

A different case is when fIsfP is not NULL but fIwcfP is L' '. In this case the fBwcrtombfP function stores at the character array pointed to by fIsfP the shift sequence needed to bring fI*psfP back to the initial state, followed by a ' ' byte. It updates the shift state fI*psfP (i.e. brings it into the initial state), and returns the length of the shift sequence plus one, i.e. the number of bytes written at fIsfP.

A third case is when fIsfP is NULL. In this case fIwcfP is ignored, and the function effectively returns wcrtomb(buf,L' ',fIpsfP) where buf is an internal anonymous buffer.

In all of the above cases, if fIpsfP is a NULL pointer, a static anonymous state only known to the wcrtomb function is used instead.  

RETURN VALUE

The fBwcrtombfP function returns the number of bytes that have been or would have been written to the byte array at fIsfP. If fIwcfP can not be represented as a multibyte sequence (according to the current locale), (size_t)(-1) is returned, and fBerrnofP set to fBEILSEQfP.  

CONFORMING TO

ISO/ANSI C, UNIX98  

SEE ALSO

wcsrtombs(3)  

NOTES

The behaviour of fBwcrtombfP depends on the LC_CTYPE category of the current locale.

Passing NULL as fIpsfP is not multi-thread safe.


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
CONFORMING TO
SEE ALSO
NOTES