1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
|
.\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" References consulted:
.\" GNU glibc-2 source code and manual
.\" Dinkumware C library reference http://www.dinkumware.com/
.\" OpenGroup's Single Unix specification
.\" http://www.UNIX-systems.org/online.html
.\" ISO/IEC 9899:1999
.\"
.\" Japanese Version Copyright (c) 1999 HANATAKA Shinya
.\" all rights reserved.
.\" Translated Tue Jan 11 00:56:16 JST 2000
.\" by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
.\" Updated Thu Dec 13 JST 2001 by Kentaro Shirakata <argrath@ub32.org>
.\"
.TH MBRTOWC 3 2001-11-22 "GNU" "Linux Programmer's Manual"
.SH ̾
mbrtowc \- ޥХ磻ʸѴ
.SH
.nf
.B #include <wchar.h>
.sp
.BI "size_t mbrtowc(wchar_t *" pwc ", const char *" s ", size_t " n ", mbstate_t *" ps );
.fi
.SH
δؿѤ硢̾ \fIs\fP NULL Ǥʤ \fIpwc\fP NULL
ʤξϡ
.BR mbrtowc ()
ؿ \fIs\fP Ϥޤ \fIn\fP ХȤ
ޥХʸơδʥޥХʸФ
磻ʸѴ \fI*pwc\fP ˳Ǽ롣
Ʊ˥եȾ \fI*ps\fP 롣Ѵ磻ʸ L'\\0'
ʤС\fIs\fP Хȿ֤
Ѵ磻ʸ L'\\0' ξˤϥեȾ \fI*ps\fP
֤ᤷ 0 ֤
.PP
\fIs\fP Ϥޤ \fIn\fP ХȤ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