Penguin
Annotated edit history of mbrlen(3) version 1, including all changes. View license author blame.
Rev Author # Line
1 perry 1 MBRLEN
2 !!!MBRLEN
3 NAME
4 SYNOPSIS
5 DESCRIPTION
6 RETURN VALUE
7 CONFORMING TO
8 SEE ALSO
9 NOTES
10 ----
11 !!NAME
12
13
14 mbrlen - determine number of bytes in next multibyte character
15 !!SYNOPSIS
16
17
18 __#include
19 __''s''__, size_t__ ''n''__, mbstate_t *__''ps''__);
20 __
21 !!DESCRIPTION
22
23
24 The __mbrlen__ function inspects at most ''n'' bytes
25 of the multibyte string starting at ''s'' and extracts
26 the next complete multibyte character. It updates the shift
27 state ''*ps''. If the multibyte character is not the null
28 wide character, it returns the number of bytes that were
29 consumed from ''s''. If the multibyte character is the
30 null wide character, it resets the shift state ''*ps'' to
31 the initial state and returns 0.
32
33
34 If the ''n'' bytes starting at ''s'' do not contain a
35 complete multibyte character, __mbrlen__ returns
36 ''(size_t)(-2)''. This can happen even if ''n''
37 ''MB_CUR_MAX'', if the multibyte string contains
38 redundant shift sequences.
39
40
41 If the multibyte string starting at ''s'' contains an
42 invalid multibyte sequence before the next complete
43 character, __mbrlen__ returns ''(size_t)(-1)'' and
44 sets __errno__ to __EILSEQ__. In this case, the
45 effects on ''*ps'' are undefined.
46
47
48 If ''ps'' is a NULL pointer, a static anonymous state
49 only known to the mbrlen function is used
50 instead.
51 !!RETURN VALUE
52
53
54 The __mbrlen__ function returns the number of bytes
55 parsed from the multibyte sequence starting at ''s'', if
56 a non-null wide character was recognized. It returns 0, if a
57 null wide character was recognized. It returns (size_t)(-1)
58 and sets __errno__ to __EILSEQ__, if an invalid
59 multibyte sequence was encountered. It returns (size_t)(-2)
60 if it couldn't parse a complete multibyte character, meaning
61 that ''n'' should be increased.
62 !!CONFORMING TO
63
64
65 ISO/ANSI C, UNIX98
66 !!SEE ALSO
67
68
69 mbrtowc(3)
70 !!NOTES
71
72
73 The behaviour of __mbrlen__ depends on the LC_CTYPE
74 category of the current locale.
75 ----
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.