#include <ctype.h>
#include <errno.h>
#include "fnmatch.h"
Go to the source code of this file.
◆ _GNU_SOURCE
◆ FOLD
◆ fnmatch()
int fnmatch |
( |
char * |
pattern, |
|
|
const char * |
string, |
|
|
int |
flags |
|
) |
| const |
Definition at line 60 of file fnmatch.c.
65 register const char *
p = pattern, *
n = string;
66 register unsigned char c;
69 #define FOLD(c) ((flags & FNM_CASEFOLD) && isupper (c) ? tolower (c) : (c))
75 while ((
c = *
p++) !=
'\0') {
95 if (
FOLD ((
unsigned char) *
n) !=
c)
104 for (
c = *
p++;
c ==
'?' ||
c ==
'*';
c = *
p++, ++
n)
106 (
c ==
'?' && *
n ==
'\0'))
114 &&
c ==
'\\') ? *
p :
c;
117 for (--
p; *
n !=
'\0'; ++
n)
118 if ((
c ==
'[' ||
FOLD ((
unsigned char) *
n) ==
c1) &&
138 not = (*
p ==
'!' || *
p ==
'^');
144 register unsigned char cstart =
c, cend =
c;
147 cstart = cend = *
p++;
149 cstart = cend =
FOLD (cstart);
162 if (
c ==
'-' && *
p !=
']') {
173 if (
FOLD ((
unsigned char) *
n) >= cstart
174 &&
FOLD ((
unsigned char) *
n) <= cend)
202 if (
c !=
FOLD ((
unsigned char) *
n))
lsl lsr asr ror lsl lsr asr ror lsl lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror lsl lsr asr ror c1
int fnmatch(char *pattern, const char *string, int flags) const
static struct sockaddr static addrlen static backlog const void static flags void flags
References c, c1, flags, FNM_CASEFOLD, FNM_FILE_NAME, FNM_LEADING_DIR, FNM_NOESCAPE, FNM_NOMATCH, FNM_PERIOD, FOLD, n, and p.
Referenced by process_cabinet().
◆ rcsid
Initial value:=
"$Id: fnmatch.c,v 1.3 2006-03-01 21:11:32 kyz Exp $"
Definition at line 27 of file fnmatch.c.