OSDN Git Service

b261573ec93e8806d39fa0d04dc9798c1c6adc91
[linuxjm/LDP_man-pages.git] / draft / man3 / fnmatch.3
1 .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\" License.
23 .\" Modified Sat Jul 24 19:35:54 1993 by Rik Faith (faith@cs.unc.edu)
24 .\" Modified Mon Oct 16 00:16:29 2000 following Joseph S. Myers
25 .\"
26 .\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved.
27 .\" Translated 1998-03-18, NAKANO Takeo <nakano@apm.seikei.ac.jp>
28 .\" Modified 1998-12-18, NAKANO Takeo <nakano@apm.seikei.ac.jp>
29 .\" Updated 2006-03-05, Akihiro MOTOKI, catch up to LDP v2.25
30 .\"
31 .TH FNMATCH 3  2000-10-15 "GNU" "Linux Programmer's Manual"
32 .\"O .SH NAME
33 .SH 名前
34 .\"O fnmatch \- match filename or pathname
35 fnmatch \- ファイル名またはパス名へのマッチを行う
36 .\"O .SH SYNOPSIS
37 .SH 書式
38 .nf
39 .B #include <fnmatch.h>
40 .sp
41 .BI "int fnmatch(const char *" "pattern" ", const char *" string ", int " flags );
42 .fi
43 .\"O .SH DESCRIPTION
44 .SH 説明
45 .\"O The
46 .\"O .BR fnmatch ()
47 .\"O function checks whether the
48 .\"O .I string
49 .\"O argument matches the
50 .\"O .I pattern
51 .\"O argument, which is a shell wildcard pattern.
52 .BR fnmatch ()
53 関数は
54 .I strings
55 引き数が
56 .I pattern
57 引き数にマッチするかをチェックする。
58 .I pattern
59 にはシェルのワイルドカードパターンを与える。
60 .PP
61 .\"O The
62 .\"O .I flags
63 .\"O argument modifies the behavior; it is the bitwise OR of zero or more
64 .\"O of the following flags:
65 .I flags
66 引き数により動作を変更できる。
67 .I flags
68 は以下のフラグのビット毎の OR で指定する。
69 .TP
70 .B FNM_NOESCAPE
71 .\"O If this flag is set, treat backslash as an ordinary character,
72 .\"O instead of an escape character.
73 このフラグがセットされていると、バックスラッシュ (\\) をエスケープ文字
74 ではなく通常の文字として扱う。
75 .TP
76 .B FNM_PATHNAME
77 .\"O If this flag is set, match a slash in
78 .\"O .I string
79 .\"O only with a slash in
80 .\"O .I pattern
81 .\"O and not by an asterisk (*) or a question mark (?) metacharacter,
82 .\"O nor by a bracket expression ([]) containing a slash.
83 このフラグがセットされていると、
84 .I string
85 中のスラッシュ (/) を
86 .I pattern
87 にあるスラッシュそのものにだけマッチさせ、
88 アスタリスク (*) や疑問符 (?) のメタキャラクタや、
89 スラッシュを含むブラケット表現 ([]) にはマッチさせない。
90 .TP
91 .B FNM_PERIOD
92 .\"O If this flag is set, a leading period in
93 .\"O .I string
94 .\"O has to be matched exactly by a period in
95 .\"O .IR pattern .
96 .\"O A period is considered to be leading if it is the first character in
97 .\"O .IR string ,
98 .\"O or if both
99 .\"O .B FNM_PATHNAME
100 .\"O is set and the period immediately follows a slash.
101 このフラグがセットされていると、
102 .I string
103 の先頭ピリオド (leading period) は
104 .I pattern
105 中のピリオドそのものにしかマッチしない。先頭ピリオドとは、
106 .I string
107 の最初の文字位置にあるピリオドのことである。ただし
108 .B FNM_PATHNAME
109 フラグが同時にセットされている場合には、スラッシュの直後に続くピリオド
110 も先頭ピリオドとみなされる。
111 .TP
112 .B FNM_FILE_NAME
113 .\"O This is a GNU synonym for \fBFNM_PATHNAME\fR.
114 これは \fBFNM_PATHNAME\fR に対する GNU での同義語である.
115 .TP
116 .B FNM_LEADING_DIR
117 .\"O If this flag (a GNU extension) is set, the pattern is considered to be
118 .\"O matched if it matches an initial segment of
119 .\"O .I string
120 .\"O which is followed by a slash.
121 .\"O This flag is mainly for the internal
122 .\"O use of glibc and is only implemented in certain cases.
123 このフラグは GNU での拡張である。これがセットされている場合には、
124 パターンが
125 .I string
126 の最初の部分 (にスラッシュを付けたもの) にマッチすれば、
127 マッチしたものとみなされる。
128 このフラグは主として glibc で内部的に使用し、そのためのみ実装されている。
129 .TP
130 .B FNM_CASEFOLD
131 .\"O If this flag (a GNU extension) is set, the pattern is matched
132 .\"O case-insensitively.
133 このフラグは GNU での拡張である。これがセットされている場合には、
134 パターンのマッチに大文字小文字が区別されない。
135 .\"O .SH "RETURN VALUE"
136 .SH 返り値
137 .\"O Zero if
138 .\"O .I string
139 .\"O matches
140 .\"O .IR pattern ,
141 .\"O .B FNM_NOMATCH
142 .\"O if there is no match or another nonzero value if there is an error.
143 .I string
144
145 .I pattern
146 にマッチすれば 0 を返す。マッチしなかった場合には
147 .B FNM_NOMATCH
148 を返す。エラーの場合にはそれ以外の非ゼロ値を返す。
149 .\"O .SH "CONFORMING TO"
150 .SH 準拠
151 POSIX.2.
152 .\"O The
153 .\"O .BR FNM_FILE_NAME ", " FNM_LEADING_DIR ", and " FNM_CASEFOLD
154 .\"O flags are GNU extensions.
155 .BR FNM_FILE_NAME ", " FNM_LEADING_DIR ", " FNM_CASEFOLD
156 フラグは GNU の拡張である。
157 .\"O .SH "SEE ALSO"
158 .SH 関連項目
159 .BR sh (1),
160 .BR glob (3),
161 .BR scandir (3),
162 .BR wordexp (3),
163 .BR glob (7)