OSDN Git Service

info/GNU_which: Add some explanations.
[linuxjm/jm.git] / manual / LDP_man-pages / draft / 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 .\"
34 .\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved.
35 .\" Translated 1998-03-18, NAKANO Takeo <nakano@apm.seikei.ac.jp>
36 .\" Modified 1998-12-18, NAKANO Takeo <nakano@apm.seikei.ac.jp>
37 .\" Updated 2006-03-05, Akihiro MOTOKI, catch up to LDP v2.25
38 .\"
39 .TH FNMATCH 3 2019\-03\-06 GNU "Linux Programmer's Manual"
40 .SH 名前
41 fnmatch \- ファイル名またはパス名へのマッチを行う
42 .SH 書式
43 .nf
44 \fB#include <fnmatch.h>\fP
45 .PP
46 \fBint fnmatch(const char *\fP\fIpattern\fP\fB, const char *\fP\fIstring\fP\fB, int \fP\fIflags\fP\fB);\fP
47 .fi
48 .SH 説明
49 \fBfnmatch\fP()  関数は \fIstrings\fP 引数が \fIpattern\fP 引数にマッチするかをチェックする。 \fIpattern\fP
50 にはシェルのワイルドカードパターンを与える (\fBglob\fP(7) 参照)。
51 .PP
52 \fIflags\fP 引数により動作を変更できる。 \fIflags\fP は以下のフラグのビット毎の OR で指定する。
53 .TP 
54 \fBFNM_NOESCAPE\fP
55 このフラグがセットされていると、バックスラッシュ (\e) をエスケープ文字 ではなく通常の文字として扱う。
56 .TP 
57 \fBFNM_PATHNAME\fP
58 このフラグがセットされていると、 \fIstring\fP 中のスラッシュ (/) を \fIpattern\fP にあるスラッシュそのものにだけマッチさせ、
59 アスタリスク (*) や疑問符 (?) のメタキャラクターや、 スラッシュを含むブラケット表現 ([]) にはマッチさせない。
60 .TP 
61 \fBFNM_PERIOD\fP
62 このフラグがセットされていると、 \fIstring\fP の先頭ピリオド (leading period) は \fIpattern\fP
63 中のピリオドそのものにしかマッチしない。先頭ピリオドとは、 \fIstring\fP の最初の文字位置にあるピリオドのことである。ただし
64 \fBFNM_PATHNAME\fP フラグが同時にセットされている場合には、スラッシュの直後に続くピリオド も先頭ピリオドとみなされる。
65 .TP 
66 \fBFNM_FILE_NAME\fP
67 これは \fBFNM_PATHNAME\fP に対する GNU での同義語である.
68 .TP 
69 \fBFNM_LEADING_DIR\fP
70 このフラグは GNU での拡張である。これがセットされている場合には、 パターンが \fIstring\fP の最初の部分 (にスラッシュを付けたもの)
71 にマッチすれば、 マッチしたものとみなされる。 このフラグは主として glibc で内部的に使用するもので、そのためにのみ実装されている。
72 .TP 
73 \fBFNM_CASEFOLD\fP
74 このフラグは GNU での拡張である。これがセットされている場合には、 パターンのマッチに大文字小文字が区別されない。
75 .TP 
76 \fBFNM_EXTMATCH\fP
77 If this flag (a GNU extension) is set, extended patterns are supported, as
78 introduced by \&'ksh' and now supported by other shells.  The extended
79 format is as follows, with \fIpattern\-list\fP being a \&'|' separated list of
80 patterns.
81 .TP 
82 \&'?(\fIpattern\-list\fP)'
83 The pattern matches if zero or one occurrences of any of the patterns in the
84 \fIpattern\-list\fP match the input \fIstring\fP.
85 .TP 
86 \&'*(\fIpattern\-list\fP)'
87 The pattern matches if zero or more occurrences of any of the patterns in
88 the \fIpattern\-list\fP match the input \fIstring\fP.
89 .TP 
90 \&'+(\fIpattern\-list\fP)'
91 The pattern matches if one or more occurrences of any of the patterns in the
92 \fIpattern\-list\fP match the input \fIstring\fP.
93 .TP 
94 \&'@(\fIpattern\-list\fP)'
95 The pattern matches if exactly one occurrence of any of the patterns in the
96 \fIpattern\-list\fP match the input \fIstring\fP.
97 .TP 
98 \&'!(\fIpattern\-list\fP)'
99 The pattern matches if the input \fIstring\fP cannot be matched with any of the
100 patterns in the \fIpattern\-list\fP.
101 .SH 返り値
102 \fIstring\fP が \fIpattern\fP にマッチすれば 0 を返す。マッチしなかった場合には \fBFNM_NOMATCH\fP
103 を返す。エラーの場合にはそれ以外の非ゼロ値を返す。
104 .SH 属性
105 この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。
106 .TS
107 allbox;
108 lb lb lb
109 l l l.
110 インターフェース        属性  値
111 T{
112 \fBfnmatch\fP()
113 T}      Thread safety   MT\-Safe env locale
114 .TE
115 .SH 準拠
116 POSIX.1\-2001, POSIX.1\-2008, POSIX.2.  \fBFNM_FILE_NAME\fP, \fBFNM_LEADING_DIR\fP,
117 \fBFNM_CASEFOLD\fP フラグは GNU の拡張である。
118 .SH 関連項目
119 \fBsh\fP(1), \fBglob\fP(3), \fBscandir\fP(3), \fBwordexp\fP(3), \fBglob\fP(7)
120 .SH この文書について
121 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
122 \%https://www.kernel.org/doc/man\-pages/ に書かれている。