OSDN Git Service

a4ce580b20ee47f6cd74e0c6f6ea9100b079a68d
[linuxjm/LDP_man-pages.git] / draft / man3 / index.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\"
3 .\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka
4 .\"     all rights reserved.
5 .\" Translated Fri Dec 12 12:41:35 JST 1997
6 .\"     by HIROFUMI Nishizuka <nishi@rpts.cl.nec.co.jp>
7 .\"
8 .\" Permission is granted to make and distribute verbatim copies of this
9 .\" manual provided the copyright notice and this permission notice are
10 .\" preserved on all copies.
11 .\"
12 .\" Permission is granted to copy and distribute modified versions of this
13 .\" manual under the conditions for verbatim copying, provided that the
14 .\" entire resulting derived work is distributed under the terms of a
15 .\" permission notice identical to this one.
16 .\"
17 .\" Since the Linux kernel and libraries are constantly changing, this
18 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
19 .\" responsibility for errors or omissions, or for damages resulting from
20 .\" the use of the information contained herein.  The author(s) may not
21 .\" have taken the same level of care in the production of this manual,
22 .\" which is licensed free of charge, as they might when working
23 .\" professionally.
24 .\"
25 .\" Formatted or processed versions of this manual, if unaccompanied by
26 .\" the source, must acknowledge the copyright and authors of this work.
27 .\"
28 .\" References consulted:
29 .\"     Linux libc source code
30 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
31 .\"     386BSD man pages
32 .\" Modified Mon Apr 12 12:54:34 1993, David Metcalfe
33 .\" Modified Sat Jul 24 19:13:52 1993, Rik Faith (faith@cs.unc.edu)
34 .TH INDEX 3 2010-09-20 "GNU" "Linux Programmer's Manual"
35 .\"O .SH NAME
36 .SH Ì¾Á°
37 .\"O index, rindex \- locate character in string
38 index, rindex \- Ê¸»úÎóÃæ¤Îʸ»ú¤Î°ÌÃÖ¤ò¼¨¤¹
39 .\"O .SH SYNOPSIS
40 .SH ½ñ¼°
41 .nf
42 .B #include <strings.h>
43 .sp
44 .BI "char *index(const char *" s ", int " c );
45 .sp
46 .BI "char *rindex(const char *" s ", int " c );
47 .fi
48 .\"O .SH DESCRIPTION
49 .SH ÀâÌÀ
50 .\"O The
51 .\"O .BR index ()
52 .\"O function returns a pointer to the first occurrence
53 .\"O of the character \fIc\fP in the string \fIs\fP.
54 .BR index ()
55 ´Ø¿ô¤Ï¡¢Ê¸»úÎó \fIs\fP Ãæ¤ËºÇ½é¤Ëʸ»ú \fIc\fP ¤¬
56 ¸½¤ì¤¿°ÌÃ֤ؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£
57 .PP
58 .\"O The
59 .\"O .BR rindex ()
60 .\"O function returns a pointer to the last occurrence
61 .\"O of the character \fIc\fP in the string \fIs\fP.
62 .BR rindex ()
63 ´Ø¿ô¤Ï¡¢Ê¸»úÎó \fIs\fP Ãæ¤ËºÇ¸å¤Ëʸ»ú \fIc\fP ¤¬
64 ¸½¤ì¤¿°ÌÃ֤ؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£
65 .PP
66 .\"O The terminating NULL character is considered to be a part of the
67 .\"O strings.
68 ʸ»úÎó¤ò½ªÃ¼¤¹¤ë NULL Ê¸»ú¤Ï¡¢Ê¸»úÎó¤Î°ìÉô¤È¤ß¤Ê¤µ¤ì¤ë¡£
69 .\"O .SH "RETURN VALUE"
70 .SH ÊÖ¤êÃÍ
71 .\"O The
72 .\"O .BR index ()
73 .\"O and
74 .\"O .BR rindex ()
75 .\"O functions return a pointer to
76 .\"O the matched character or NULL if the character is not found.
77 .BR index ()
78 ¤È
79 .BR rindex ()
80 ´Ø¿ô¤Ï¡¢°ìÃפ·¤¿Ê¸»ú¤Ø¤Î¥Ý¥¤¥ó¥¿¤«¡¢
81 ¤â¤·Ê¸»ú¤¬¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£
82 .\"O .SH "CONFORMING TO"
83 .SH ½àµò
84 .\"O 4.3BSD; marked as LEGACY in POSIX.1-2001.
85 4.3BSD;
86 POSIX.1-2001 ¤Ç¤Ï¡Ö²áµî¤Î̾»Ä (LEGACY)¡×¤È°ÌÃÖÉÕ¤±¤é¤ì¤Æ¤¤¤ë¡£
87 .\"O POSIX.1-2008 removes the specifications of
88 .\"O .BR index ()
89 .\"O and
90 .\"O .BR rindex (),
91 .\"O recommending
92 .\"O .BR strchr (3)
93 .\"O and
94 .\"O .BR strrchr (3)
95 .\"O instead.
96 POSIX.1-2008 ¤Ç¤Ï
97 .BR index ()
98 ¤È
99 .BR rindex ()
100 ¤Î»ÅÍͤ¬ºï½ü¤µ¤ì¤Æ¤¤¤ë¡£
101 Âå¤ï¤ê¤Ë¡¢
102 .BR strchr (3)
103 ¤È
104 .BR strrchr (3)
105 ¤Î»ÈÍѤ¬¿ä¾©¤µ¤ì¤Æ¤¤¤ë¡£
106 .\"O .SH "SEE ALSO"
107 .SH ´ØÏ¢¹àÌÜ
108 .BR memchr (3),
109 .BR strchr (3),
110 .BR string (3),
111 .BR strpbrk (3),
112 .BR strrchr (3),
113 .BR strsep (3),
114 .BR strspn (3),
115 .BR strstr (3),
116 .BR strtok (3)