.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) .\" .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" .\" References consulted: .\" Linux libc source code .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified Mon Apr 12 12:51:24 1993, David Metcalfe .\" 2006-05-19, Justin Pryzby .\" Document strchrnul(3). .\" .\" .\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka .\" all rights reserved. .\" Translated Tue Dec 16 10:29:05 JST 1997 .\" by HIROFUMI Nishizuka .\" Updated & Modified 2001-10-16, Yuichi SATO .\" Updated 2006-07-20, Akihiro MOTOKI .\" .TH STRCHR 3 2010-09-20 "GNU" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O strchr, strrchr, strchrnul \- locate character in string strchr, strrchr, strchrnul \- 文字列中の文字の位置を特定する .\"O .SH SYNOPSIS .SH 書式 .nf .B #include .sp .BI "char *strchr(const char *" s ", int " c ); .sp .BI "char *strrchr(const char *" s ", int " c ); .sp .B #define _GNU_SOURCE .B #include .sp .BI "char *strchrnul(const char *" s ", int " c ); .fi .\"O .SH DESCRIPTION .SH 説明 .\"O The .\"O .BR strchr () .\"O function returns a pointer to the first occurrence .\"O of the character \fIc\fP in the string \fIs\fP. .BR strchr () 関数は、文字列 \fIs\fP 中に最初に文字 \fIc\fP が現れた位置へのポインタを返す。 .PP .\"O The .\"O .BR strrchr () .\"O function returns a pointer to the last occurrence .\"O of the character \fIc\fP in the string \fIs\fP. .BR strrchr () 関数は、文字列 \fIs\fP 中に最後に文字 \fIc\fP が現れた位置へのポインタを返す。 .PP .\"O The \fBstrchrnul\fP() function is like .\"O .BR strchr () .\"O except that if \fIc\fP is not found in \fIs\fP, .\"O then it returns a pointer to the null byte .\"O at the end of \fIs\fP, rather than NULL. .BR strchrnul () 関数は .BR strchr () と同様だが、 \fIc\fP が \fIs\fP 中に見つからなかった場合に、返り値として NULL でなく、\fIs\fP の末尾のヌルバイトへのポインタを返す点が異なる。 .PP .\"O Here "character" means "byte"; these functions do not work with .\"O wide or multibyte characters. ここでいう「文字」は「バイト」の意味なので、 これらの関数はワイド文字やマルチバイト文字では動作しない。 .\"O .SH "RETURN VALUE" .SH 返り値 .\"O The .\"O .BR strchr () .\"O and .\"O .BR strrchr () .\"O functions return a pointer to .\"O the matched character or NULL if the character is not found. .BR strchr () と .BR strrchr () 関数は一致した文字へのポインタを 返し、もし文字が見つからない場合は NULL を返す。 .\"O The .\"O .BR strchrnul () .\"O function returns a pointer to .\"O the matched character, .\"O or a pointer to the null .\"O byte at the end of \fIs\fP (i.e., \fIs+strlen(s)\fP) .\"O if the character is not found. .BR strchrnul () 関数は一致した文字へのポインタを返す。 文字が見つからない場合は、\fIs\fP の末尾のヌルバイトへの ポインタ (つまり \fIs+strlen(s)\fP) を返す。 .\"O .SH VERSIONS .SH バージョン .\"O .BR strchrnul () .\"O first appeared in glibc in version 2.1.1. .BR strchrnul () は glibc バージョン 2.1.1 で初めて登場した。 .\"O .SH "CONFORMING TO" .SH 準拠 .\"O .BR strchr () .\"O and .\"O .BR strrchr () .\"O are in SVr4, 4.3BSD, C89, C99. .\"O .BR strchrnul () .\"O is a GNU extension. .BR strchr () と .BR strrchr () は SVr4, 4.3BSD, C89, C99 に準拠している。 .BR strchrnul () は GNU 拡張である。 .\"O .SH "SEE ALSO" .SH 関連項目 .BR index (3), .BR memchr (3), .BR rindex (3), .BR string (3), .BR strlen (3), .BR strpbrk (3), .BR strsep (3), .BR strspn (3), .BR strstr (3), .BR strtok (3), .BR wcschr (3), .BR wcsrchr (3), .BR feature_test_macros (7)