.\" Copyright (c) Bruno Haible .\" .\" 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 .\" .\" About this Japanese page, please contact to JM Project .\" Translated Tue Oct 19 02:22:50 JST 1999 .\" by FUJIWARA Teruyoshi .\" .TH WCSNLEN 3 2010-09-15 "GNU" "Linux Programmer's Manual" .SH 名前 wcsnlen \- 固定長のワイド文字文字列の長さを求める .SH 書式 .nf .B #include .sp .BI "size_t wcsnlen(const wchar_t *" s ", size_t " maxlen ); .fi .sp .in -4n glibc 向けの機能検査マクロの要件 .RB ( feature_test_macros (7) 参照): .in .sp .BR wcsncasecmp (): .PD 0 .ad l .RS 4 .TP 4 glibc 2.10 以降: _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L .TP glibc 2.10 より前: _GNU_SOURCE .RE .ad .PD .SH 説明 .BR wcsnlen () 関数は、 .BR strnlen (3) 関数に対応するワイド文字関数である。 この関数は、\fIs\fP が指す文字列中のワイド文字の数を返すが、これは最大 \fImaxlen\fP 文字までである。また、終端の L\(aq\\0\(aq 文字は含まない。 これを行う際には、 .BR wcsnlen () は \fIs\fP が指すワイド文字列の最初の \fImaxlen\fP 文字しか見ず、決して \fIs+maxlen\fP 文字を超えて文字列を 参照することはない。 .SH 返り値 .BR wcsnlen () 関数は、\fIwcslen(s)\fP の値が \fImaxlen\fP より小さけれ ば \fIwcslen(s)\fP を返す。あるいは、\fIs\fP が指すワイド文字列中の 最初の \fImaxlen\fP 文字に L\(aq\\0\(aq 文字が含まれていなければ \fImaxlen\fP を返す。 .SH バージョン .BR wcsnlen () 関数は glibc バージョン 2.1 以降で提供されている。 .SH 準拠 この関数は GNU 拡張である。 .SH 関連項目 .BR strnlen (3), .BR wcslen (3)