1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
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.
8 .\" References consulted:
9 .\" GNU glibc-2 source code and manual
11 .\" Japanese Version Copyright (c) 1999 HANATAKA Shinya
12 .\" all rights reserved.
13 .\" Translated Tue Jan 11 00:55:48 JST 2000
14 .\" by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
16 .TH STRNLEN 3 2011-09-28 "GNU" "Linux Programmer's Manual"
18 strnlen \- 固定長の文字列の長さを調べる
21 .B #include <string.h>
23 .BI "size_t strnlen(const char *" s ", size_t " maxlen );
28 .RB ( feature_test_macros (7)
38 _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L
47 関数は \fIs\fP が指す文字列の長さをバイト数で返す。
48 長さには終端の NULL バイト (\(aq\\0\(aq) は含まない。
49 また長さは最大で \fImaxlen\fP までであり、
51 は \fIs\fP の最初の \fImaxlen\fP バイトのみを検査し
52 \fIs+maxlen\fP より先を検査することはない。
55 関数は \fImaxlen\fP 以下ならば \fIstrlen(s)\fP と同じ
56 値を返す。\fIs\fP の指す文字列が最大 \fImaxlen\fP バイトまでに
57 NULL バイト (\(aq\\0\(aq) 文字を含まない場合には \fImaxlen\fP を返す。