OSDN Git Service

db8cd31f9c62f88940acd81668e73aad74041088
[linuxjm/LDP_man-pages.git] / release / man3 / fnmatch.3
1 .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
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 .\" Modified Sat Jul 24 19:35:54 1993 by Rik Faith (faith@cs.unc.edu)
26 .\" Modified Mon Oct 16 00:16:29 2000 following Joseph S. Myers
27 .\"
28 .\"*******************************************************************
29 .\"
30 .\" This file was generated with po4a. Translate the source file.
31 .\"
32 .\"*******************************************************************
33 .TH FNMATCH 3 2000\-10\-15 GNU "Linux Programmer's Manual"
34 .SH 名前
35 fnmatch \- ファイル名またはパス名へのマッチを行う
36 .SH 書式
37 .nf
38 \fB#include <fnmatch.h>\fP
39 .sp
40 \fBint fnmatch(const char *\fP\fIpattern\fP\fB, const char *\fP\fIstring\fP\fB, int \fP\fIflags\fP\fB);\fP
41 .fi
42 .SH 説明
43 \fBfnmatch\fP()  関数は \fIstrings\fP 引き数が \fIpattern\fP 引き数にマッチするかをチェックする。 \fIpattern\fP
44 にはシェルのワイルドカードパターンを与える。
45 .PP
46 \fIflags\fP 引き数により動作を変更できる。 \fIflags\fP は以下のフラグのビット毎の OR で指定する。
47 .TP 
48 \fBFNM_NOESCAPE\fP
49 このフラグがセットされていると、バックスラッシュ (\e) をエスケープ文字 ではなく通常の文字として扱う。
50 .TP 
51 \fBFNM_PATHNAME\fP
52 このフラグがセットされていると、 \fIstring\fP 中のスラッシュ (/) を \fIpattern\fP にあるスラッシュそのものにだけマッチさせ、
53 アスタリスク (*) や疑問符 (?) のメタキャラクタや、 スラッシュを含むブラケット表現 ([]) にはマッチさせない。
54 .TP 
55 \fBFNM_PERIOD\fP
56 このフラグがセットされていると、 \fIstring\fP の先頭ピリオド (leading period) は \fIpattern\fP
57 中のピリオドそのものにしかマッチしない。先頭ピリオドとは、 \fIstring\fP の最初の文字位置にあるピリオドのことである。ただし
58 \fBFNM_PATHNAME\fP フラグが同時にセットされている場合には、スラッシュの直後に続くピリオド も先頭ピリオドとみなされる。
59 .TP 
60 \fBFNM_FILE_NAME\fP
61 これは \fBFNM_PATHNAME\fP に対する GNU での同義語である.
62 .TP 
63 \fBFNM_LEADING_DIR\fP
64 このフラグは GNU での拡張である。これがセットされている場合には、 パターンが \fIstring\fP の最初の部分 (にスラッシュを付けたもの)
65 にマッチすれば、 マッチしたものとみなされる。 このフラグは主として glibc で内部的に使用するもので、そのためにのみ実装されている。
66 .TP 
67 \fBFNM_CASEFOLD\fP
68 このフラグは GNU での拡張である。これがセットされている場合には、 パターンのマッチに大文字小文字が区別されない。
69 .SH 返り値
70 \fIstring\fP が \fIpattern\fP にマッチすれば 0 を返す。マッチしなかった場合には \fBFNM_NOMATCH\fP
71 を返す。エラーの場合にはそれ以外の非ゼロ値を返す。
72 .SH 準拠
73 POSIX.2.  \fBFNM_FILE_NAME\fP, \fBFNM_LEADING_DIR\fP, \fBFNM_CASEFOLD\fP フラグは GNU
74 の拡張である。
75 .SH 関連項目
76 \fBsh\fP(1), \fBglob\fP(3), \fBscandir\fP(3), \fBwordexp\fP(3), \fBglob\fP(7)
77 .SH この文書について
78 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.52 の一部
79 である。プロジェクトの説明とバグ報告に関する情報は
80 http://www.kernel.org/doc/man\-pages/ に書かれている。