OSDN Git Service

(split) LDP: Update drafts based on LDP 3.52 release
[linuxjm/LDP_man-pages.git] / draft / man3 / memchr.3
index ad1978a..cd54fea 100644 (file)
@@ -2,6 +2,7 @@
 .\" and Copyright (c) 2008 Linux Foundation, written by Michael Kerrisk
 .\"     <mtk.manpages@gmail.com>
 .\"
+.\" %%%LICENSE_START(VERBATIM)
 .\" 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.
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
 .\"
 .\" Modified Mon Apr 12 12:49:57 1993, David Metcalfe
 .\" Modified Sat Jul 24 18:56:22 1993, Rik Faith (faith@cs.unc.edu)
 .\" Modified Wed Feb 20 21:09:36 2002, Ian Redfern (redferni@logica.com)
 .\" 2008-07-09, mtk, add rawmemchr()
 .\"
-.\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka
-.\"    all rights reserved.
-.\" Translated 1997-12-16, HIROFUMI Nishizuka <nishi@rpts.cl.nec.co.jp>
-.\" Updated & Modified 2002-03-24, Yuichi SATO <ysato@h4.dion.ne.jp>
-.\" Updated & Modified 2003-11-27, Yuichi SATO <ysato444@yahoo.co.jp>
-.\" Updated 2008-08-11, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
+.\"*******************************************************************
 .\"
-.TH MEMCHR 3  2009-12-04 "" "Linux Programmer's Manual"
-.\"O .SH NAME
-.SH Ì¾Á°
-.\"O memchr, memrchr, rawmemchr \- scan memory for a character
-memchr, memrchr, rawmemchr \- Ê¸»ú¤òõ¤¹¤¿¤á¤Ë¥á¥â¥ê¤ò¥¹¥­¥ã¥ó¤¹¤ë
-.\"O .SH SYNOPSIS
-.SH ½ñ¼°
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.TH MEMCHR 3 2012\-04\-23 "" "Linux Programmer's Manual"
+.SH 名前
+memchr, memrchr, rawmemchr \- 文字を探すためにメモリをスキャンする
+.SH 書式
 .nf
-.B #include <string.h>
+\fB#include <string.h>\fP
 
-.BI "void *memchr(const void *" s ", int " c ", size_t " n );
+\fBvoid *memchr(const void *\fP\fIs\fP\fB, int \fP\fIc\fP\fB, size_t \fP\fIn\fP\fB);\fP
 
-.BI "void *memrchr(const void *" s ", int " c ", size_t " n );
+\fBvoid *memrchr(const void *\fP\fIs\fP\fB, int \fP\fIc\fP\fB, size_t \fP\fIn\fP\fB);\fP
 
-.BI "void *rawmemchr(const void *" s ", int " c );
+\fBvoid *rawmemchr(const void *\fP\fIs\fP\fB, int \fP\fIc\fP\fB);\fP
 .fi
 .sp
 .in -4n
-.\"O Feature Test Macro Requirements for glibc (see
-.\"O .BR feature_test_macros (7)):
-glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
-.RB ( feature_test_macros (7)
-»²¾È):
+glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
 .in
 .sp
-.BR memrchr ():
-.BR rawmemchr ():
-_GNU_SOURCE
-.\"O .SH DESCRIPTION
-.SH ÀâÌÀ
-.\"O The
-.\"O .BR memchr ()
-.\"O function scans the first \fIn\fP bytes of the memory
-.\"O area pointed to by \fIs\fP for the character \fIc\fP.
-.\"O The first byte to
-.\"O match \fIc\fP (interpreted as an unsigned character) stops the operation.
-.BR memchr ()
-´Ø¿ô¤Ï¡¢¥Ý¥¤¥ó¥¿ \fIs\fP ¤¬»Ø¤·¼¨¤¹¥á¥â¥ê¥Ö¥í¥Ã¥¯¤Î
-ÀèƬ¤Î \fIn\fP ¥Ð¥¤¥È¤«¤éʸ»ú \fIc\fP ¤òõ¤¹¡£
-ºÇ½é¤Ë \fIc\fP (unsigned char ¤È²ò¼á¤µ¤ì¤ë) ¤¬¸«¤Ä¤«¤Ã¤¿»þÅÀ¤ÇÆ°ºî¤¬Ää»ß¤¹¤ë¡£
+\fBmemrchr\fP(): \fBrawmemchr\fP(): _GNU_SOURCE
+.SH 説明
+\fBmemchr\fP() 関数は、ポインタ \fIs\fP が指し示すメモリ領域の先頭の
+\fIn\fP バイトから最初に登場する文字 \fIc\fP を探す。
+\fIc\fP と \fIs\fP が指し示すメモリ領域の各バイトは両方とも
+\fIunsigned char\fP と解釈される。
 .PP
-.\"O The
-.\"O .BR memrchr ()
-.\"O function is like the
-.\"O .BR memchr ()
-.\"O function,
-.\"O except that it searches backward from the end of the \fIn\fP bytes
-.\"O pointed to by \fIs\fP instead of forward from the beginning.
-.BR memrchr ()
-´Ø¿ô¤Ï
-.BR memchr ()
-´Ø¿ô¤Ë»÷¤Æ¤¤¤ë¤¬¡¢
-ÀèƬ¤«¤é½çÊý¸þ¤Ëõ¤¹¤Î¤Ç¤Ï¤Ê¤¯¡¢
-¥Ý¥¤¥ó¥¿ \fIs\fP ¤¬»Ø¤·¼¨¤¹ \fIn\fP ¥Ð¥¤¥È¤Î¥á¥â¥ê¥Ö¥í¥Ã¥¯¤Î
-ËöÈø¤«¤éµÕ¸þ¤­¤Ëõ¤¹¡£
+\fBmemrchr\fP()  関数は \fBmemchr\fP()  関数に似ているが、 先頭から順方向に探すのではなく、 ポインタ \fIs\fP が指し示す
+\fIn\fP バイトのメモリブロックの 末尾から逆向きに探す。
 
-.\"O The
-.\"O .BR rawmemchr ()
-.\"O function is similar to
-.\"O .BR memchr ():
-.\"O it assumes (i.e., the programmer knows for certain)
-.\"O that the character
-.\"O .I c
-.\"O lies somewhere in the string
-.\"O .IR s ,
-.\"O and so performs an optimized search
-.\"O for the character
-.\"O .IR c
-.\"O (i.e., no checking for the terminating null byte, or use of an argument,
-.\"O .IR n ,
-.\"O to limit the range of the search).
-.BR rawmemchr ()
-´Ø¿ô¤Ï
-.BR memchr ()
-¤ÈƱÍͤÀ¤¬¡¢
-ʸ»ú
-.I c
-¤¬Ê¸»úÎó
-.I s
-Æâ¤Î¤É¤³¤«¤Ë¤¢¤ë¤³¤È¤òÁ°Äó¤Ë¤·¤Æ
-(¤Ä¤Þ¤ê¡¢¥×¥í¥°¥é¥Þ¤Ï¤½¤Î¤³¤È¤òÃΤäƤ¤¤ë)¡¢
-ºÇŬ²½¤·¤¿ÊýË¡¤Çʸ»ú
-.I c
-¤Î¸¡º÷¤ò¼Â¹Ô¤¹¤ë
-(¤¹¤Ê¤ï¤Á¡¢½ªÃ¼¤Î NULL ¥Ð¥¤¥È¤Î¥Á¥§¥Ã¥¯¤â¹Ô¤ï¤ì¤Ê¤¤¤·¡¢
-¸¡º÷ÈϰϤξå¸Â¤ò¼¨¤¹°ú¤­¿ô
-.I n
-¤â»ÈÍѤµ¤ì¤Ê¤¤)¡£
-.\"O If the character
-.\"O .I c
-.\"O is not in the string
-.\"O .IR s ,
-.\"O then
-.\"O .BR rawmemchr ()
-.\"O may proceed to search beyond the end of the string,
-.\"O and the result is unspecified.
-ʸ»ú
-.I c
-¤¬Ê¸»úÎó
-.I s
-Æâ¤Ë¤Ê¤¤¾ì¹ç¡¢
-.BR rawmemchr ()
-¤Ïʸ»úÎóËöÈø¤ò±Û¤¨¤Æ¸¡º÷¤ò¼Â¹Ô¤¹¤ë¤«¤â¤·¤ì¤º¡¢·ë²Ì¤ÏÉÔÄê¤Ç¤¢¤ë¡£
-.\"O The folowing call is a fast means of locating a string's
-.\"O terminating null byte:
-¼¡¤Ë¼¨¤¹¸Æ¤Ó½Ð¤·¤Ï¡¢Ê¸»úÎó½ªÃ¼¤Î NULL ¥Ð¥¤¥È¤Î°ÌÃÖ¤òÆÃÄꤹ¤ë
-¹â®¤Ê¼êÃʤǤ¢¤ë¡£
+\fBrawmemchr\fP() 関数は \fBmemchr\fP() と同様だが、 \fIc\fP が \fIs\fP が指す場所
+から始まるメモリ領域のどこかにあることを前提にして (つまり、プログラマ
+はそのことを知っている)、最適化した方法で \fIc\fP の検索を実行する (すなわ
+ち、検索範囲の上限を示す引き数も使用されない)。\fIc\fP が見つからなかった
+場合、その結果はどうなるか分からない。次に示す呼び出しは、文字列終端の
+NULL バイトの位置を特定する高速な手段である。
 .in +4n
 .nf
 
-char *p = rawmemchr(s,\ \(aq\\0\(aq);
+char *p = rawmemchr(s,\ \(aq\e0\(aq);
 .fi
 .in
-.\"O .SH "RETURN VALUE"
-.SH ÊÖ¤êÃÍ
-.\"O The
-.\"O .BR memchr ()
-.\"O and
-.\"O .BR memrchr ()
-.\"O functions return a pointer
-.\"O to the matching byte or NULL if the character does not occur in
-.\"O the given memory area.
-.BR memchr ()
-´Ø¿ô¤È
-.BR memrchr ()
-´Ø¿ô¤Ï°ìÃפ¹¤ëʸ»ú¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤·¡¢
-¤â¤·Ê¸»ú¤¬»ØÄê¥á¥â¥êÎΰè¤Ë¸½¤ì¤Ê¤¤¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£
+.SH 返り値
+\fBmemchr\fP()  関数と \fBmemrchr\fP()  関数は一致する文字へのポインタを返し、 もし文字が指定メモリ領域に現れない場合は NULL
+を返す。
 
-.\"O The
-.\"O .BR rawmemchr ()
-.\"O function returns a pointer to the matching byte, if one is found.
-.\"O If no matching byte is found, the result is unspecified.
-.BR rawmemchr ()
-´Ø¿ô¤Ï¥Þ¥Ã¥Á¤¹¤ë¥Ð¥¤¥È¤¬¸«¤Ä¤«¤Ã¤¿¾ì¹ç¤Ï¥Þ¥Ã¥Á¤·¤¿¥Ð¥¤¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£
-¥Þ¥Ã¥Á¤¹¤ë¥Ð¥¤¥È¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¡¢·ë²Ì¤ÏÉÔÄê¤Ç¤¢¤ë¡£
-.\"O .SH VERSIONS
-.SH ¥Ð¡¼¥¸¥ç¥ó
-.\"O .BR rawmemchr ()
-.\"O first appeared in glibc in version 2.1.
-.BR rawmemchr ()
-¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£
+\fBrawmemchr\fP()  関数はマッチするバイトが見つかった場合はマッチしたバイトへのポインタを返す。
+マッチするバイトが見つからなかった場合、結果は不定である。
+.SH バージョン
+\fBrawmemchr\fP()  は glibc バージョン 2.1 で初めて登場した。
 
-.\"O .BR memrchr ()
-.\"O first appeared in glibc in version 2.2.
-.BR memrchr ()
-¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.2 ¤Ç½é¤á¤ÆÅо줷¤¿¡£
-.\"O .SH "CONFORMING TO"
-.SH ½àµò
-.\"O The
-.\"O .BR memchr ()
-.\"O function conforms to SVr4, 4.3BSD, C89, C99, POSIX.1-2001.
-.BR memchr ()
-´Ø¿ô¤Ï SVr4, 4.3BSD, C89, C99, POSIX.1-2001 ¤Ë½àµò¤¹¤ë¡£
+\fBmemrchr\fP()  は glibc バージョン 2.2 で初めて登場した。
+.SH 準拠
+\fBmemchr\fP()  関数は SVr4, 4.3BSD, C89, C99, POSIX.1\-2001 に準拠する。
 
-.\"O The
-.\"O .BR memrchr ()
-.\"O function is a GNU extension, available since glibc 2.1.91.
-.BR memrchr ()
-´Ø¿ô¤Ï GNU ³ÈÄ¥¤Ç¤¢¤ê¡¢glibc 2.1.91 ¤«¤é»ÈÍѲÄǽ¤Ç¤¢¤ë¡£
+\fBmemrchr\fP()  関数は GNU 拡張であり、glibc 2.1.91 から使用可能である。
 
-.\"O The
-.\"O .BR rawmemchr ()
-.\"O function is a GNU extension, available since glibc 2.1.
-.BR rawmemchr ()
-´Ø¿ô¤Ï GNU ³ÈÄ¥¤Ç¤¢¤ê¡¢glibc 2.1 ¤«¤é»ÈÍѲÄǽ¤Ç¤¢¤ë¡£
-.\"O .SH "SEE ALSO"
-.SH ´ØÏ¢¹àÌÜ
-.BR ffs (3),
-.BR index (3),
-.BR rindex (3),
-.BR strchr (3),
-.BR strpbrk (3),
-.BR strrchr (3),
-.BR strsep (3),
-.BR strspn (3),
-.BR strstr (3),
-.BR wmemchr (3)
+\fBrawmemchr\fP()  関数は GNU 拡張であり、glibc 2.1 から使用可能である。
+.SH 関連項目
+\fBffs\fP(3), \fBindex\fP(3), \fBrindex\fP(3), \fBstrchr\fP(3), \fBstrpbrk\fP(3),
+\fBstrrchr\fP(3), \fBstrsep\fP(3), \fBstrspn\fP(3), \fBstrstr\fP(3), \fBwmemchr\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.52 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。