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"
19 .\"O strnlen \- determine the length of a fixed-size string
20 strnlen \- ¸ÇÄêŤÎʸ»úÎó¤ÎŤµ¤òÄ´¤Ù¤ë
24 .B #include <string.h>
26 .BI "size_t strnlen(const char *" s ", size_t " maxlen );
30 .\"O Feature Test Macro Requirements for glibc (see
31 .\"O .BR feature_test_macros (7)):
32 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
33 .RB ( feature_test_macros (7)
42 .\"O Since glibc 2.10:
44 _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L
46 .\"O Before glibc 2.10:
56 .\"O function returns the number of characters in the string
57 .\"O- pointed to by \fIs\fP, not including the terminating \(aq\\0\(aq character,
58 .\"O+ pointed to by \fIs\fP, excluding the terminating null bye (\(aq\\0\(aq),
59 .\"O but at most \fImaxlen\fP.
62 .\"O looks only at the first
63 .\"O \fImaxlen\fP characters at \fIs\fP and never beyond \fIs+maxlen\fP.
65 ´Ø¿ô¤Ï \fIs\fP ¤¬»Ø¤¹Ê¸»úÎó¤ÎŤµ¤ò¥Ð¥¤¥È¿ô¤ÇÊÖ¤¹¡£
66 Ťµ¤Ë¤Ï½ªÃ¼¤Î NULL ¥Ð¥¤¥È (\(aq\\0\(aq) ¤Ï´Þ¤Þ¤Ê¤¤¡£
67 ¤Þ¤¿Ä¹¤µ¤ÏºÇÂç¤Ç \fImaxlen\fP ¤Þ¤Ç¤Ç¤¢¤ê¡¢
69 ¤Ï \fIs\fP ¤ÎºÇ½é¤Î \fImaxlen\fP ¥Ð¥¤¥È¤Î¤ß¤ò¸¡ºº¤·
70 \fIs+maxlen\fP ¤è¤êÀè¤ò¸¡ºº¤¹¤ë¤³¤È¤Ï¤Ê¤¤¡£
71 .\"O .SH "RETURN VALUE"
75 .\"O function returns \fIstrlen(s)\fP, if that is less than
76 .\"O \fImaxlen\fP, or \fImaxlen\fP
77 .\"O if there is no null byte (\(aq\\0\(aq) among the first
78 .\"O \fImaxlen\fP characters pointed to by \fIs\fP.
80 ´Ø¿ô¤Ï \fImaxlen\fP °Ê²¼¤Ê¤é¤Ð \fIstrlen(s)\fP ¤ÈƱ¤¸
81 ÃͤòÊÖ¤¹¡£\fIs\fP ¤Î»Ø¤¹Ê¸»úÎ󤬺ÇÂç \fImaxlen\fP ¥Ð¥¤¥È¤Þ¤Ç¤Ë
82 NULL ¥Ð¥¤¥È (\(aq\\0\(aq) ʸ»ú¤ò´Þ¤Þ¤Ê¤¤¾ì¹ç¤Ë¤Ï \fImaxlen\fP ¤òÊÖ¤¹¡£
83 .\"O .SH "CONFORMING TO"