OSDN Git Service

(split) LDP v3.24 -> v3.29 の定型的な変更内容を反映。
[linuxjm/LDP_man-pages.git] / draft / man3 / mblen.3
1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
2 .\"
3 .\" This is free documentation; you can redistribute it and/or
4 .\" modify it under the terms of the GNU General Public License as
5 .\" published by the Free Software Foundation; either version 2 of
6 .\" the License, or (at your option) any later version.
7 .\"
8 .\" References consulted:
9 .\"   GNU glibc-2 source code and manual
10 .\"   Dinkumware C library reference http://www.dinkumware.com/
11 .\"   OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
12 .\"   ISO/IEC 9899:1999
13 .\"
14 .\" Japanese Version Copyright (c) 1999 HANATAKA Shinya
15 .\"         all rights reserved.
16 .\" Translated Tue Jan 11 00:56:22 JST 2000
17 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
18 .\"
19 .\"
20 .TH MBLEN 3 1999-07-25 "GNU" "Linux Programmer's Manual"
21 .\"O .SH NAME
22 .SH Ì¾Á°
23 .\"O mblen \- determine number of bytes in next multibyte character
24 mblen \- ¼¡¤Î¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤Î¥Ð¥¤¥È¿ô¤òÊÖ¤¹
25 .\"O .SH SYNOPSIS
26 .SH ½ñ¼°
27 .nf
28 .B #include <stdlib.h>
29 .sp
30 .BI "int mblen(const char *" s ", size_t " n );
31 .fi
32 .\"O .SH DESCRIPTION
33 .SH ÀâÌÀ
34 .\"O If \fIs\fP is not a NULL pointer, the
35 .\"O .BR mblen ()
36 .\"O function inspects at most
37 .\"O \fIn\fP bytes of the multibyte string starting at \fIs\fP and extracts the
38 .\"O next complete multibyte character.
39 .\"O It uses a static anonymous shift state only
40 .\"O known to the
41 .\"O .BR mblen ()
42 .\"O function.
43 .\"O If the multibyte character is not the null wide
44 .\"O character, it returns the number of bytes that were consumed from \fIs\fP.
45 .\"O If the multibyte character is the null wide character, it returns 0.
46 \fIs\fP ¤¬ NULL ¥Ý¥¤¥ó¥¿¡¼¤Ç¤Ê¤±¤ì¤Ð¡¢
47 .BR mblen ()
48 ´Ø¿ô¤Ï \fIs\fP ¤«¤é»Ï¤Þ¤ëºÇÂç \fIn\fP ¥Ð¥¤¥È¤Î¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó¤ò¸¡ºº¤·¤Æ¡¢
49 ¼¡¤Î´°Á´¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ò¼è¤ê½Ð¤¹¡£¤³¤ì¤Ë¤Ï
50 .BR mblen ()
51 ´Ø¿ô¤Î¤ß¤¬»ÈÍѤ¹¤ëÀÅŪ¤Ç̾Á°¤Î¤Ê¤¤¥·¥Õ¥È¾õÂÖ¤¬»ÈÍѤµ¤ì¤ë¡£
52 ¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤¬¥Ê¥ë¥ï¥¤¥Éʸ»ú¤Ç¤Ê¤±¤ì¤Ð \fIs\fP ¤«¤é¾ÃÈñ¤µ¤ì¤ë
53 ¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤¬¥Ê¥ë¥ï¥¤¥Éʸ»ú¤Ê¤é¤Ð 0 ¤òÊÖ¤¹¡£
54 .PP
55 .\"O If the \fIn\fP bytes starting at \fIs\fP do not contain a complete multibyte
56 .\"O character,
57 .\"O .BR mblen ()
58 .\"O returns \-1.
59 .\"O This can happen even if
60 .\"O \fIn\fP is greater than or equal to \fIMB_CUR_MAX\fP,
61 .\"O if the multibyte string contains redundant shift sequences.
62 \fIs\fP ¤«¤é»Ï¤Þ¤ë \fIn\fP ¥Ð¥¤¥È¤¬´°Á´¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ò´Þ¤ó¤Ç
63 ¤¤¤Ê¤±¤ì¤Ð¡¢
64 .BR mblen ()
65 ¤Ï \-1 ¤òÊÖ¤¹¡£¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎó
66 ¤Ë¾éĹ¤Ê¥·¥Õ¥È¥·¡¼¥±¥ó¥¹¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¤È¡¢
67 \fIn\fP ¤¬ \fIMB_CUR_MAX\fP °Ê¾å¤Î¾ì¹ç¤Ë¤â
68 ¤³¤Î¤è¤¦¤Ê¤³¤È¤¬µ¯¤³¤ê¤¨¤ë¡£
69 .PP
70 .\"O If the multibyte string starting at \fIs\fP contains an invalid multibyte
71 .\"O sequence before the next complete character,
72 .\"O .BR mblen ()
73 .\"O also returns \-1.
74 \fIs\fP ¤«¤é»Ï¤Þ¤ë¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»úÎ󤬼¡¤Î´°Á´¤Êʸ»ú¤ÎÁ°¤Ë
75 ÉÔÀµ¤Ê¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ò´Þ¤ó¤Ç¤¤¤ë¾ì¹ç¤Ë¤â¡¢
76 .BR mblen ()
77 ¤Ï \-1 ¤òÊÖ¤¹¡£
78 .PP
79 .\"O If \fIs\fP is a NULL pointer, the
80 .\"O .BR mblen ()
81 .\"O function
82 .\" The Dinkumware doc and the Single UNIX specification say this, but
83 .\" glibc doesn't implement this.
84 .\"O resets the shift state, only known to this function, to the initial state, and
85 .\"O returns nonzero if the encoding has nontrivial shift state, or zero if the
86 .\"O encoding is stateless.
87 \fIs\fP ¤¬ NULL ¥Ý¥¤¥ó¥¿¡¼¤Ê¤é¤Ð¡¢
88 .BR mblen ()
89 ´Ø¿ô¤Ï¤³¤Î´Ø¿ô¤Î¤ß¤¬
90 »ÈÍѤ¹¤ë¥·¥Õ¥È¾õÂÖ¤ò½é´ü²½¾õÂÖ¤ËÌᤷ¡¢¥·¥Õ¥È¾õÂÖ¤ò»ÈÍѤ·¤¿Ê¸»úÉä¹æ¤Î¾ì¹ç¤Ë
91 ¤Ï¥¼¥í°Ê³°¤ò¡¢Ê¸»úÉä¹æ¤¬¥·¥Õ¥È¾õÂÖ¤ò»ý¤¿¤Ê¤¤¾ì¹ç¤Ë¤Ï¥¼¥í¤òÊÖ¤¹¡£
92 .\"O .SH "RETURN VALUE"
93 .SH ÊÖ¤êÃÍ
94 .\"O The
95 .\"O .BR mblen ()
96 .\"O function returns the number of
97 .\"O bytes parsed from the multibyte
98 .\"O sequence starting at \fIs\fP, if a non-null wide character was recognized.
99 .\"O It returns 0, if a null wide character was recognized.
100 .\"O It returns \-1, if an
101 .\"O invalid multibyte sequence was encountered or if it couldn't parse a complete
102 .\"O multibyte character.
103 .BR mblen ()
104 ´Ø¿ô¤Ï \fIs\fP ¤«¤é»Ï¤Þ¤ë¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤ò¸¡ºº¤·¤Æ
105 ¥Ê¥ë¥ï¥¤¥Éʸ»ú°Ê³°¤ò³Îǧ¤·¤¿¾ì¹ç¤Ë¤Ï¤½¤Î¥Ð¥¤¥È¿ô¤òÊÖ¤¹¡£
106 ¥Ê¥ë¥ï¥¤¥Éʸ»ú¤ò³Îǧ¤·¤¿¾ì¹ç¤Ë¤Ï¥¼¥í¤òÊÖ¤¹¡£ÉÔÀµ¤Ê¥Þ¥ë¥Á¥Ð¥¤¥ÈÎó¤Ë
107 Áø¶ø¤·¤¿¾ì¹ç¤ä´°Á´¤Ê¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤ò²òÀϤǤ­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï \-1 ¤òÊÖ¤¹¡£
108 .\"O .SH "CONFORMING TO"
109 .SH ½àµò
110 C99.
111 .\"O .SH NOTES
112 .SH Ãí°Õ
113 .\"O The behavior of
114 .\"O .BR mblen ()
115 .\"O depends on the
116 .\"O .B LC_CTYPE
117 .\"O category of the
118 .\"O \"O current locale.
119 .BR mblen ()
120 ¤ÎÆ°ºî¤Ï¸½ºß¤Î¥í¥±¡¼¥ë¤Î
121 .B LC_CTYPE
122 ¥«¥Æ¥´¥ê¤Ë°Í¸¤·¤Æ¤¤¤ë¡£
123 .PP
124 .\"O The function
125 .\"O .BR mbrlen (3)
126 .\"O provides a better interface to the same
127 .\"O functionality.
128 .BR mbrlen (3)
129 ´Ø¿ô¤ÏƱ¤¸µ¡Ç½¤Î¤è¤êÎɤ¤¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤òÄ󶡤¹¤ë¡£
130 .\"O .SH "SEE ALSO"
131 .SH ´ØÏ¢¹àÌÜ
132 .BR mbrlen (3)