OSDN Git Service

(split) LDP: Release pages for LDP v3.39.
[linuxjm/LDP_man-pages.git] / release / man3 / strchr.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" References consulted:
24 .\"     Linux libc source code
25 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
26 .\"     386BSD man pages
27 .\" Modified Mon Apr 12 12:51:24 1993, David Metcalfe
28 .\" 2006-05-19, Justin Pryzby <pryzbyj@justinpryzby.com>
29 .\"     Document strchrnul(3).
30 .\"
31 .\"*******************************************************************
32 .\"
33 .\" This file was generated with po4a. Translate the source file.
34 .\"
35 .\"*******************************************************************
36 .TH STRCHR 3 2010\-09\-20 GNU "Linux Programmer's Manual"
37 .SH 名前
38 strchr, strrchr, strchrnul \- 文字列中の文字の位置を特定する
39 .SH 書式
40 .nf
41 \fB#include <string.h>\fP
42 .sp
43 \fBchar *strchr(const char *\fP\fIs\fP\fB, int \fP\fIc\fP\fB);\fP
44 .sp
45 \fBchar *strrchr(const char *\fP\fIs\fP\fB, int \fP\fIc\fP\fB);\fP
46 .sp
47 \fB#define _GNU_SOURCE\fP         /* feature_test_macros(7) 参照 */
48 \fB#include <string.h>\fP
49 .sp
50 \fBchar *strchrnul(const char *\fP\fIs\fP\fB, int \fP\fIc\fP\fB);\fP
51 .fi
52 .SH 説明
53 \fBstrchr\fP()  関数は、文字列 \fIs\fP 中に最初に文字 \fIc\fP が現れた位置へのポインタを返す。
54 .PP
55 \fBstrrchr\fP()  関数は、文字列 \fIs\fP 中に最後に文字 \fIc\fP が現れた位置へのポインタを返す。
56 .PP
57 \fBstrchrnul\fP()  関数は \fBstrchr\fP()  と同様だが、 \fIc\fP が \fIs\fP 中に見つからなかった場合に、返り値として
58 NULL でなく、\fIs\fP の末尾のヌルバイトへのポインタを返す点が異なる。
59 .PP
60 ここでいう「文字」は「バイト」の意味なので、 これらの関数はワイド文字やマルチバイト文字では動作しない。
61 .SH 返り値
62 \fBstrchr\fP()  と \fBstrrchr\fP()  関数は一致した文字へのポインタを 返し、もし文字が見つからない場合は NULL を返す。
63
64 \fBstrchrnul\fP()  関数は一致した文字へのポインタを返す。 文字が見つからない場合は、\fIs\fP の末尾のヌルバイトへの ポインタ (つまり
65 \fIs+strlen(s)\fP) を返す。
66 .SH バージョン
67 \fBstrchrnul\fP()  は glibc バージョン 2.1.1 で初めて登場した。
68 .SH 準拠
69 \fBstrchr\fP()  と \fBstrrchr\fP()  は SVr4, 4.3BSD, C89, C99 に準拠している。
70 \fBstrchrnul\fP()  は GNU 拡張である。
71 .SH 関連項目
72 \fBindex\fP(3), \fBmemchr\fP(3), \fBrindex\fP(3), \fBstring\fP(3), \fBstrlen\fP(3),
73 \fBstrpbrk\fP(3), \fBstrsep\fP(3), \fBstrspn\fP(3), \fBstrstr\fP(3), \fBstrtok\fP(3),
74 \fBwcschr\fP(3), \fBwcsrchr\fP(3)