scc

A fork of https://git.simple-cc.org/scc/ for Qute

git clone https://git.8pit.net/scc.git

 1.TH MBTOWC 3 scc\-VERSION
 2.SH NAME
 3mbtowc - convert a multibyte sequence to a wide character
 4.SH SYNOPSIS
 5#include <stdlib.h>
 6
 7int mbtowc(wchar_t * restrict pwc, const char * restrict s, size_t n)
 8.SH DESCRIPTION
 9When
10.I s
11is not a null pointer,
12the
13.BR mbtowc ()
14function examines up to
15.I n
16bytes starting at
17.I s
18to determine how many bytes form the next complete multibyte character,
19including any required shift sequences.
20If a complete, valid multibyte character is found,
21the corresponding wide character value is computed and,
22if
23.I pwc
24is not a null pointer,
25stored in the object at
26.IR pwc .
27When the converted character is the null wide character,
28the conversion state is reset to its initial value.
29.SH RETURN VALUE
30When
31.I s
32is a null pointer,
33.BR mbtowc ()
34returns non-zero if the current encoding has state-dependent sequences,
35or zero otherwise.
36When
37.I s
38is not a null pointer, the function returns:
39.TP
400
41if
42.I s
43points to the null character;
44.TP
45positive
46the number of bytes consumed to produce the wide character,
47when the next
48.I n
49or fewer bytes form a valid multibyte character;
50.TP
51\-1
52if the bytes do not form a valid multibyte character.
53.PP
54The return value never exceeds
55.I n
56or the value of
57.IR MB_CUR_MAX .
58.SH STANDARDS
59ISO/IEC 9899:1999 Section 7.20.7.2 Paragraph 1,2,3,4,5
60.SH SEE ALSO
61.BR stdlib.h (3)
62.BR wchar.h (3)