OSDN Git Service

(split) DP: release pages (catch up to 3.50).
[linuxjm/LDP_man-pages.git] / release / man3 / scandir.3
index 2a6b0de..ce6a86e 100644 (file)
@@ -1,5 +1,6 @@
 .\" Copyright (C) 1993 David Metcalfe (david@prism.demon.co.uk)
 .\"
 .\" Copyright (C) 1993 David Metcalfe (david@prism.demon.co.uk)
 .\"
+.\" %%%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.
 .\" 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.
@@ -19,6 +20,7 @@
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
 .\"
 .\" References consulted:
 .\"     Linux libc source code
 .\"
 .\" References consulted:
 .\"     Linux libc source code
 .\" Modified Sun Sep 24 20:15:46 2000 by aeb, following Petter Reinholdtsen.
 .\" Modified 2001-12-26 by aeb, following Joey. Added versionsort.
 .\"
 .\" Modified Sun Sep 24 20:15:46 2000 by aeb, following Petter Reinholdtsen.
 .\" Modified 2001-12-26 by aeb, following Joey. Added versionsort.
 .\"
-.\" FIXME glibc 2.15 adds scandirat()
+.\"*******************************************************************
 .\"
 .\"
-.\" Japanese Version Copyright (c) 1998 Hiroaki Nagoya all rights reserved.
-.\" Translated Thu May 28 1998 by Hiroaki Nagoya <nagoya@is.titech.ac.jp>
-.\" Updated & Modified Sat Jan 19 18:22:21 JST 2002
-.\"         by Yuichi SATO <ysato@h4.dion.ne.jp>
-.\" Updated & Modified Sun Jan 16 08:12:04 JST 2005
-.\"         by Yuichi SATO <ysato444@yahoo.co.jp>
+.\" This file was generated with po4a. Translate the source file.
 .\"
 .\"
-.TH SCANDIR 3  2011-09-08 "GNU" "Linux Programmer's Manual"
+.\"*******************************************************************
+.TH SCANDIR 3 2012\-04\-26 GNU "Linux Programmer's Manual"
 .SH 名前
 scandir, alphasort, versionsort \- ディレクトリを走査する
 .SH 書式
 .nf
 .SH 名前
 scandir, alphasort, versionsort \- ディレクトリを走査する
 .SH 書式
 .nf
-.B #include <dirent.h>
+\fB#include <dirent.h>\fP
 .sp
 .sp
-.BI "int scandir(const char *" dirp ", struct dirent ***" namelist ,
+\fBint scandir(const char *\fP\fIdirp\fP\fB, struct dirent ***\fP\fInamelist\fP\fB,\fP
 .RS
 .RS
-.BI "int (*" filter ")(const struct dirent *),"
-.BI "int (*" compar ")(const struct dirent **, const struct dirent **));"
+\fBint (*\fP\fIfilter\fP\fB)(const struct dirent *),\fP
+\fBint (*\fP\fIcompar\fP\fB)(const struct dirent **, const struct dirent **));\fP
 .RE
 .sp
 .RE
 .sp
-.BI "int alphasort(const void *" a ", const void *" b );
+\fBint alphasort(const void *\fP\fIa\fP\fB, const void *\fP\fIb\fP\fB);\fP
 .sp
 .sp
-.BI "int versionsort(const void *" a ", const void *" b );
+\fBint versionsort(const void *\fP\fIa\fP\fB, const void *\fP\fIb\fP\fB);\fP
 .fi
 .sp
 .in -4n
 .fi
 .sp
 .in -4n
-glibc 向けの機能検査マクロの要件
-.RB ( feature_test_macros (7)
-参照):
+glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
 .in
 .sp
 .in
 .sp
-.BR scandir (),
-.BR alphasort ():
-_BSD_SOURCE || _SVID_SOURCE
+\fBscandir\fP(), \fBalphasort\fP(): _BSD_SOURCE || _SVID_SOURCE
 .br
 .br
-.BR versionsort ():
-_GNU_SOURCE
+\fBversionsort\fP(): _GNU_SOURCE
 .SH 説明
 .SH 説明
-関数
-.BR scandir ()
-はディレクトリ \fIdirp\fP を走査し、
-ディレクトリの各エントリを引き数として
-.BR filter ()
-を呼び出す。
-.BR filter ()
-が 0 以外の値を返すエントリは
-.BR malloc (3)
-によって
-確保された文字列に保存され、比較関数
-.BR compar ()
-を用いて
-.BR qsort (3)
-によりソートされ、
-.BR malloc (3)
-により確保された配列
-\fInamelist\fP にまとめられる。
-\fIfilter\fP が NULL ならば、すべてのエントリが選択される。
+関数 \fBscandir\fP()  はディレクトリ \fIdirp\fP を走査し、 ディレクトリの各エントリを引き数として \fBfilter\fP()
+を呼び出す。 \fBfilter\fP()  が 0 以外の値を返すエントリは \fBmalloc\fP(3)  によって 確保された文字列に保存され、比較関数
+\fBcompar\fP()  を用いて \fBqsort\fP(3)  によりソートされ、 \fBmalloc\fP(3)  により確保された配列
+\fInamelist\fP にまとめられる。 \fIfilter\fP が NULL ならば、すべてのエントリが選択される。
 .LP
 .LP
-比較関数
-.IR compar ()
-には
-.BR alphasort ()
-関数と
-.BR versionsort ()
-関数を使うことができる。
-.BR alphasort ()
-は
-.BR strcoll (3)
-を用いてディレクトリエントリをソートし、
-.BR versionsort ()
-は文字列 \fI(*a)\->d_name\fP と \fI(*b)\->d_name\fP に対して
-.BR strverscmp (3)
-を用いる。
+比較関数 \fIcompar\fP()  には \fBalphasort\fP()  関数と \fBversionsort\fP()  関数を使うことができる。
+\fBalphasort\fP()  は \fBstrcoll\fP(3)  を用いてディレクトリエントリをソートし、 \fBversionsort\fP()  は文字列
+\fI(*a)\->d_name\fP と \fI(*b)\->d_name\fP に対して \fBstrverscmp\fP(3)  を用いる。
 .SH 返り値
 .SH 返り値
-関数
-.BR scandir ()
-は選択されたエントリの数か、
-(エラーが発生した場合) \-1 を返す。
+関数 \fBscandir\fP()  は選択されたエントリの数か、 (エラーが発生した場合) \-1 を返す。
 .PP
 .PP
-関数
-.BR alphasort ()
-と
-.BR versionsort ()
-は 1 番目の引き数が 2 番目の引き数に対して、
+関数 \fBalphasort\fP()  と \fBversionsort\fP()  は 1 番目の引き数が 2 番目の引き数に対して、
 [小さい/等しい/大きい] かに応じて、0 より [小さい/等しい/大きい] 値を返す。
 .SH エラー
 [小さい/等しい/大きい] かに応じて、0 より [小さい/等しい/大きい] 値を返す。
 .SH エラー
-.TP
-.B ENOENT
-\fIdirp\fR で指定されたパスが存在しない。
-.TP
-.B ENOMEM
-動作を完遂するにはメモリが足りない。
-.TP
-.B ENOTDIR
-\fIdirp\fR で指定されたパスがディレクトリではない。
+.TP 
+\fBENOENT\fP
+\fIdirp\fP で指定されたパスが存在しない。
+.TP 
+\fBENOMEM\fP
+操作を完了するのに十分なメモリがない。
+.TP 
+\fBENOTDIR\fP
+\fIdirp\fP で指定されたパスがディレクトリではない。
 .SH バージョン
 .SH バージョン
-.BR versionsort ()
-は、glibc バージョン 2.1 で追加された。
+\fBversionsort\fP()  は、glibc バージョン 2.1 で追加された。
 .SH 準拠
 .SH 準拠
-.BR alphasort ()
-と
-.BR scandir ()
-は POSIX.1-2008 で規定されており、広く利用可能である。
-.BR versionsort ()
-は GNU 拡張である。
+\fBalphasort\fP()  と \fBscandir\fP()  は POSIX.1\-2008 で規定されており、広く利用可能である。
+\fBversionsort\fP()  は GNU 拡張である。
 .LP
 .LP
-関数
-.BR scandir ()
-と
-.BR alphasort ()
-は 4.3BSD から取り入れられ、Linux では libc4 から使用可能になった。
-libc4 と libc5 では以下のようなもっと詳細なプロトタイプを使っている。
+関数 \fBscandir\fP()  と \fBalphasort\fP()  は 4.3BSD から取り入れられ、Linux では libc4
+から使用可能になった。 libc4 と libc5 では以下のようなもっと詳細なプロトタイプを使っている。
 .sp
 .nf
     int alphasort(const struct dirent ** a,
 .sp
 .nf
     int alphasort(const struct dirent ** a,
@@ -153,19 +103,10 @@ libc4 と libc5 では以下のようなもっと詳細なプロトタイプを
 .sp
 しかし glibc 2.0 では不正確な BSD のプロトタイプに戻った。
 .LP
 .sp
 しかし glibc 2.0 では不正確な BSD のプロトタイプに戻った。
 .LP
-関数
-.BR versionsort ()
-は GNU の拡張であり、glibc 2.1 以降で使用可能である。
+関数 \fBversionsort\fP()  は GNU の拡張であり、glibc 2.1 以降で使用可能である。
 .LP
 .LP
-glibc 2.1 以降では
-.BR alphasort ()
-は
-.BR strcoll (3)
-を呼び出す。
-.BR alphasort ()
-は以前は
-.BR strcmp (3)
-を使っていた。
+glibc 2.1 以降では \fBalphasort\fP()  は \fBstrcoll\fP(3)  を呼び出す。 \fBalphasort\fP()  は以前は
+\fBstrcmp\fP(3)  を使っていた。
 .SH 例
 .nf
 #define _SVID_SOURCE
 .SH 例
 .nf
 #define _SVID_SOURCE
@@ -178,7 +119,7 @@ main(void)
     struct dirent **namelist;
     int n;
 
     struct dirent **namelist;
     int n;
 
-    n = scandir(".", &namelist, 0, alphasort);
+    n = scandir(".", &namelist, NULL, alphasort);
     if (n < 0)
         perror("scandir");
     else {
     if (n < 0)
         perror("scandir");
     else {
@@ -191,13 +132,10 @@ main(void)
 }
 .fi
 .SH 関連項目
 }
 .fi
 .SH 関連項目
-.BR closedir (3),
-.BR fnmatch (3),
-.BR opendir (3),
-.BR readdir (3),
-.BR rewinddir (3),
-.BR seekdir (3),
-.BR strcmp (3),
-.BR strcoll (3),
-.BR strverscmp (3),
-.BR telldir (3)
+\fBclosedir\fP(3), \fBfnmatch\fP(3), \fBopendir\fP(3), \fBreaddir\fP(3),
+\fBrewinddir\fP(3), \fBscandirat\fP(3), \fBseekdir\fP(3), \fBstrcmp\fP(3),
+\fBstrcoll\fP(3), \fBstrverscmp\fP(3), \fBtelldir\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。