Nico Golde:
[apps/madmutt.git] / mutt_regex.h
1 /*
2  * Copyright notice from original mutt:
3  * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org>
4  *
5  * This file is part of mutt-ng, see http://www.muttng.org/.
6  * It's licensed under the GNU General Public License,
7  * please see the file GPL in the top level source directory.
8  */
9
10 /*
11  * A (more) generic interface to regular expression matching
12  */
13
14 #ifndef MUTT_REGEX_H
15 #define MUTT_REGEX_H
16
17 #ifdef USE_GNU_REGEX
18 #include "_regex.h"
19 #else
20 #include <regex.h>
21 #endif
22
23 /* this is a non-standard option supported by Solaris 2.5.x which allows
24  * patterns of the form \<...\>
25  */
26 #ifndef REG_WORDS
27 #define REG_WORDS 0
28 #endif
29
30 #define REGCOMP(X,Y,Z) regcomp(X, Y, REG_WORDS|REG_EXTENDED|(Z))
31 #define REGEXEC(X,Y) regexec(&X, Y, (size_t)0, (regmatch_t *)0, (int)0)
32
33 typedef struct {
34   char *pattern;                /* printable version */
35   regex_t *rx;                  /* compiled expression */
36   int not;                      /* do not match */
37 } REGEXP;
38
39 WHERE REGEXP Mask;
40 WHERE REGEXP QuoteRegexp;
41 WHERE REGEXP ReplyRegexp;
42 WHERE REGEXP Smileys;
43 WHERE REGEXP GecosMask;
44 WHERE REGEXP StripWasRegexp;
45
46 #endif /* MUTT_REGEX_H */