OSDN Git Service

47056ceaf42f2f55f2abbaf88e4c1474a628ad8e
[linuxjm/LDP_man-pages.git] / draft / man3 / strnlen.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 .\"
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>
15 .\"
16 .TH STRNLEN 3 2010-09-15 "GNU" "Linux Programmer's Manual"
17 .\"O .SH NAME
18 .SH Ì¾Á°
19 .\"O strnlen \- determine the length of a fixed-size string
20 strnlen \- ¸ÇÄêŤÎʸ»úÎó¤ÎŤµ¤òÄ´¤Ù¤ë
21 .\"O .SH SYNOPSIS
22 .SH ½ñ¼°
23 .nf
24 .B #define _GNU_SOURCE
25 .sp
26 .B #include <string.h>
27 .sp
28 .BI "size_t strnlen(const char *" s ", size_t " maxlen );
29 .fi
30 .sp
31 .in -4n
32 .\"O Feature Test Macro Requirements for glibc (see
33 .\"O .BR feature_test_macros (7)):
34 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
35 .RB ( feature_test_macros (7)
36 »²¾È):
37 .in
38 .sp
39 .BR strnlen ():
40 .PD 0
41 .ad l
42 .RS 4
43 .TP 4
44 .\"O Since glibc 2.10:
45 glibc 2.10 °Ê¹ß:
46 _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L
47 .TP
48 .\"O Before glibc 2.10:
49 glibc 2.10 ¤è¤êÁ°:
50 _GNU_SOURCE
51 .RE
52 .ad
53 .PD
54 .\"O .SH DESCRIPTION
55 .SH ÀâÌÀ
56 .\"O The
57 .\"O .BR strnlen ()
58 .\"O function returns the number of characters in the string
59 .\"O pointed to by \fIs\fP, not including the terminating \(aq\\0\(aq character,
60 .\"O but at most \fImaxlen\fP.
61 .\"O In doing this,
62 .\"O .BR strnlen ()
63 .\"O looks only at the first
64 .\"O \fImaxlen\fP characters at \fIs\fP and never beyond \fIs+maxlen\fP.
65 .BR strnlen ()
66 ´Ø¿ô¤Ï \fIs\fP ¤¬»Ø¤¹Ê¸»úÎó¤ÎŤµ¤ò¥Ð¥¤¥È¿ô¤ÇÊÖ¤¹¡£
67 Ťµ¤Ë¤Ï½ªÃ¼¤Î \(aq\\0\(aq Ê¸»ú¤ò´Þ¤Þ¤Ê¤¤¡£
68 ¤Þ¤¿Ä¹¤µ¤ÏºÇÂç¤Ç \fImaxlen\fP ¤Þ¤Ç¤Ç¤¢¤ê¡¢
69 .BR strnlen ()
70 ¤Ï \fIs\fP ¤ÎºÇ½é¤Î \fImaxlen\fP ¥Ð¥¤¥È¤Î¤ß¤ò¸¡ºº¤·
71 \fIs+maxlen\fP ¤è¤êÀè¤ò¸¡ºº¤¹¤ë¤³¤È¤Ï¤Ê¤¤¡£
72 .\"O .SH "RETURN VALUE"
73 .SH ÊÖ¤êÃÍ
74 .\"O The
75 .\"O .BR strnlen ()
76 .\"O function returns \fIstrlen(s)\fP, if that is less than
77 .\"O \fImaxlen\fP, or \fImaxlen\fP
78 .\"O if there is no \(aq\\0\(aq character among the first
79 .\"O \fImaxlen\fP characters pointed to by \fIs\fP.
80 .BR strnlen ()
81 ´Ø¿ô¤Ï \fImaxlen\fP °Ê²¼¤Ê¤é¤Ð \fIstrlen(s)\fP ¤ÈƱ¤¸
82 ÃͤòÊÖ¤¹¡£\fIs\fP ¤Î»Ø¤¹Ê¸»úÎ󤬺ÇÂç \fImaxlen\fP ¥Ð¥¤¥È¤Þ¤Ç¤Ë
83 \(aq\\0\(aq Ê¸»ú¤ò´Þ¤Þ¤Ê¤¤¾ì¹ç¤Ë¤Ï \fImaxlen\fP ¤òÊÖ¤¹¡£
84 .\"O .SH "CONFORMING TO"
85 .SH ½àµò
86 .\"O This function is a GNU extension.
87 ¤³¤Î´Ø¿ô¤Ï GNU ¤Î³ÈÄ¥¤Ç¤¢¤ë¡£
88 .\"O .SH "SEE ALSO"
89 .SH ´ØÏ¢¹àÌÜ
90 .BR strlen (3),
91 .BR feature_test_macros (7)