1 .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
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.
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.
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
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
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
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
31 .TH FNMATCH 3 2000-10-15 "GNU" "Linux Programmer's Manual"
34 .\"O fnmatch \- match filename or pathname
35 fnmatch \- ¥Õ¥¡¥¤¥ë̾¤Þ¤¿¤Ï¥Ñ¥¹Ì¾¤Ø¤Î¥Þ¥Ã¥Á¤ò¹Ô¤¦
39 .B #include <fnmatch.h>
41 .BI "int fnmatch(const char *" "pattern" ", const char *" string ", int " flags );
47 .\"O function checks whether the
49 .\"O argument matches the
51 .\"O argument, which is a shell wildcard pattern.
57 °ú¤¿ô¤Ë¥Þ¥Ã¥Á¤¹¤ë¤«¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡£
59 ¤Ë¤Ï¥·¥§¥ë¤Î¥ï¥¤¥ë¥É¥«¡¼¥É¥Ñ¥¿¡¼¥ó¤òÍ¿¤¨¤ë¡£
63 .\"O argument modifies the behavior; it is the bitwise OR of zero or more
64 .\"O of the following flags:
66 °ú¤¿ô¤Ë¤è¤êÆ°ºî¤òÊѹ¹¤Ç¤¤ë¡£
68 ¤Ï°Ê²¼¤Î¥Õ¥é¥°¤Î¥Ó¥Ã¥ÈËè¤Î OR ¤Ç»ØÄꤹ¤ë¡£
71 .\"O If this flag is set, treat backslash as an ordinary character,
72 .\"O instead of an escape character.
73 ¤³¤Î¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤È¡¢¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å (\\) ¤ò¥¨¥¹¥±¡¼¥×ʸ»ú
74 ¤Ç¤Ï¤Ê¤¯Ä̾ï¤Îʸ»ú¤È¤·¤Æ°·¤¦¡£
77 .\"O If this flag is set, match a slash in
79 .\"O only with a slash in
81 .\"O and not by an asterisk (*) or a question mark (?) metacharacter,
82 .\"O nor by a bracket expression ([]) containing a slash.
83 ¤³¤Î¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤È¡¢
87 ¤Ë¤¢¤ë¥¹¥é¥Ã¥·¥å¤½¤Î¤â¤Î¤Ë¤À¤±¥Þ¥Ã¥Á¤µ¤»¡¢
88 ¥¢¥¹¥¿¥ê¥¹¥¯ (*) ¤äµ¿ÌäÉä (?) ¤Î¥á¥¿¥¥ã¥é¥¯¥¿¤ä¡¢
89 ¥¹¥é¥Ã¥·¥å¤ò´Þ¤à¥Ö¥é¥±¥Ã¥Èɽ¸½ ([]) ¤Ë¤Ï¥Þ¥Ã¥Á¤µ¤»¤Ê¤¤¡£
92 .\"O If this flag is set, a leading period in
94 .\"O has to be matched exactly by a period in
96 .\"O A period is considered to be leading if it is the first character in
100 .\"O is set and the period immediately follows a slash.
101 ¤³¤Î¥Õ¥é¥°¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤È¡¢
103 ¤ÎÀèƬ¥Ô¥ê¥ª¥É (leading period) ¤Ï
105 Ãæ¤Î¥Ô¥ê¥ª¥É¤½¤Î¤â¤Î¤Ë¤·¤«¥Þ¥Ã¥Á¤·¤Ê¤¤¡£ÀèƬ¥Ô¥ê¥ª¥É¤È¤Ï¡¢
107 ¤ÎºÇ½é¤Îʸ»ú°ÌÃ֤ˤ¢¤ë¥Ô¥ê¥ª¥É¤Î¤³¤È¤Ç¤¢¤ë¡£¤¿¤À¤·
109 ¥Õ¥é¥°¤¬Æ±»þ¤Ë¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢¥¹¥é¥Ã¥·¥å¤Îľ¸å¤Ë³¤¯¥Ô¥ê¥ª¥É
110 ¤âÀèƬ¥Ô¥ê¥ª¥É¤È¤ß¤Ê¤µ¤ì¤ë¡£
113 .\"O This is a GNU synonym for \fBFNM_PATHNAME\fR.
114 ¤³¤ì¤Ï \fBFNM_PATHNAME\fR ¤ËÂФ¹¤ë GNU ¤Ç¤ÎƱµÁ¸ì¤Ç¤¢¤ë.
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
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 ¤Ç¤Î³ÈÄ¥¤Ç¤¢¤ë¡£¤³¤ì¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢
126 ¤ÎºÇ½é¤ÎÉôʬ (¤Ë¥¹¥é¥Ã¥·¥å¤òÉÕ¤±¤¿¤â¤Î) ¤Ë¥Þ¥Ã¥Á¤¹¤ì¤Ð¡¢
127 ¥Þ¥Ã¥Á¤·¤¿¤â¤Î¤È¤ß¤Ê¤µ¤ì¤ë¡£
128 ¤³¤Î¥Õ¥é¥°¤Ï¼ç¤È¤·¤Æ glibc ¤ÇÆâÉôŪ¤Ë»ÈÍѤ·¡¢¤½¤Î¤¿¤á¤Î¤ß¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£
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"
142 .\"O if there is no match or another nonzero value if there is an error.
146 ¤Ë¥Þ¥Ã¥Á¤¹¤ì¤Ð 0 ¤òÊÖ¤¹¡£¥Þ¥Ã¥Á¤·¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï
148 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ë¤Ï¤½¤ì°Ê³°¤ÎÈó¥¼¥íÃͤòÊÖ¤¹¡£
149 .\"O .SH "CONFORMING TO"
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 ¤Î³ÈÄ¥¤Ç¤¢¤ë¡£