1
/* @(#)patmatch.h 1.7 00/11/12 Copyright 1985 J. Schilling */
6
* Definitions for the pattern matching functions.
8
* Copyright (c) 1985,1995 J. Schilling
11
* This program is free software; you can redistribute it and/or modify
12
* it under the terms of the GNU General Public License as published by
13
* the Free Software Foundation; either version 2, or (at your option)
16
* This program is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
* GNU General Public License for more details.
21
* You should have received a copy of the GNU General Public License
22
* along with this program; see the file COPYING. If not, write to
23
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
26
* The pattern matching functions are based on the algorithm
27
* presented by Martin Richards in:
29
* "A Compact Function for Regular Expression Pattern Matching",
30
* Software-Practice and Experience, Vol. 9, 527-534 (1979)
32
* Several changes have been made to the original source which has been
35
* '/' is replaced by '!' (to allow UNIX filenames)
36
* '(',')' are replaced by '{', '}'
37
* '\'' is replaced by '\\' (UNIX compatible quote)
39
* Character classes have been added to allow "[<character list>]"
41
* Start of line '^' and end of line '$' have been added.
43
* Any number in the following comment is zero or more occurrencies
53
#define ALT '!' /* Alternation in match i.e. this!that!the_other */
54
#define REP '#' /* Any number of occurrences of the following expr */
55
#define NIL '%' /* Empty string (exactly nothing) */
56
#define STAR '*' /* Any number of any character (equivalent of #?) */
57
#define ANY '?' /* Any one character */
58
#define QUOTE '\\' /* Quotes the next character */
59
#define LBRACK '{' /* Begin of precedence grouping */
60
#define RBRACK '}' /* End of precedence grouping */
61
#define LCLASS '[' /* Begin of character set */
62
#define RCLASS ']' /* End of character set */
63
#define NOT '^' /* If first in set: invert set content */
64
#define RANGE '-' /* Range notation in sets */
65
#define START '^' /* Begin of a line */
66
#define END '$' /* End of a line */
68
#define MAXPAT 128 /* Maximum length of pattern */
70
extern int patcompile __PR((const unsigned char * __pat, int __patlen, int * __aux));
72
extern unsigned char *opatmatch __PR((const unsigned char * __pat, const int * __aux,
73
const unsigned char * __str, int __soff, int __slen,
75
extern unsigned char *opatlmatch __PR((const unsigned char * __pat, const int * __aux,
76
const unsigned char * __str, int __soff, int __slen,
78
extern unsigned char *patmatch __PR((const unsigned char * __pat, const int * __aux,
79
const unsigned char * __str, int __soff, int __slen,
80
int __alt, int __state[]));
81
extern unsigned char *patlmatch __PR((const unsigned char * __pat, const int * __aux,
82
const unsigned char * __str, int __soff, int __slen,
83
int __alt, int __state[]));
89
#endif /* _PATMATCH_H */