OSDN Git Service

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