OSDN Git Service

Convert release and draft pages to UTF-8.
[linuxjm/jm.git] / manual / LDP_man-pages / release / 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 .SH 名前
33 fnmatch \- ファイル名またはパス名へのマッチを行う
34 .SH 書式
35 .nf
36 .B #include <fnmatch.h>
37 .sp
38 .BI "int fnmatch(const char *" "pattern" ", const char *" string ", int " flags );
39 .fi
40 .SH 説明
41 .BR fnmatch ()
42 関数は
43 .I strings
44 引き数が
45 .I pattern
46 引き数にマッチするかをチェックする。
47 .I pattern
48 にはシェルのワイルドカードパターンを与える。
49 .PP
50 .I flags
51 引き数により動作を変更できる。
52 .I flags
53 は以下のフラグのビット毎の OR で指定する。
54 .TP
55 .B FNM_NOESCAPE
56 このフラグがセットされていると、バックスラッシュ (\\) をエスケープ文字
57 ではなく通常の文字として扱う。
58 .TP
59 .B FNM_PATHNAME
60 このフラグがセットされていると、
61 .I string
62 中のスラッシュ (/) を
63 .I pattern
64 にあるスラッシュそのものにだけマッチさせ、
65 アスタリスク (*) や疑問符 (?) のメタキャラクタや、
66 スラッシュを含むブラケット表現 ([]) にはマッチさせない。
67 .TP
68 .B FNM_PERIOD
69 このフラグがセットされていると、
70 .I string
71 の先頭ピリオド (leading period) は
72 .I pattern
73 中のピリオドそのものにしかマッチしない。先頭ピリオドとは、
74 .I string
75 の最初の文字位置にあるピリオドのことである。ただし
76 .B FNM_PATHNAME
77 フラグが同時にセットされている場合には、スラッシュの直後に続くピリオド
78 も先頭ピリオドとみなされる。
79 .TP
80 .B FNM_FILE_NAME
81 これは \fBFNM_PATHNAME\fR に対する GNU での同義語である.
82 .TP
83 .B FNM_LEADING_DIR
84 このフラグは GNU での拡張である。これがセットされている場合には、
85 パターンが
86 .I string
87 の最初の部分 (にスラッシュを付けたもの) にマッチすれば、
88 マッチしたものとみなされる。
89 このフラグは主として glibc で内部的に使用し、そのためのみ実装されている。
90 .TP
91 .B FNM_CASEFOLD
92 このフラグは GNU での拡張である。これがセットされている場合には、
93 パターンのマッチに大文字小文字が区別されない。
94 .SH 返り値
95 .I string
96
97 .I pattern
98 にマッチすれば 0 を返す。マッチしなかった場合には
99 .B FNM_NOMATCH
100 を返す。エラーの場合にはそれ以外の非ゼロ値を返す。
101 .SH 準拠
102 POSIX.2.
103 .BR FNM_FILE_NAME ", " FNM_LEADING_DIR ", " FNM_CASEFOLD
104 フラグは GNU の拡張である。
105 .SH 関連項目
106 .BR sh (1),
107 .BR glob (3),
108 .BR scandir (3),
109 .BR wordexp (3),
110 .BR glob (7)