remove more obsolete options.
[apps/madmutt.git] / pattern.h
1 /*
2  *  This program is free software; you can redistribute it and/or modify
3  *  it under the terms of the GNU General Public License as published by
4  *  the Free Software Foundation; either version 2 of the License, or (at
5  *  your option) any later version.
6  *
7  *  This program is distributed in the hope that it will be useful, but
8  *  WITHOUT ANY WARRANTY; without even the implied warranty of
9  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
10  *  General Public License for more details.
11  *
12  *  You should have received a copy of the GNU General Public License
13  *  along with this program; if not, write to the Free Software
14  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
15  *  MA 02110-1301, USA.
16  *
17  *  Copyright © 2006 Pierre Habouzit
18  */
19 /*
20  * Copyright notice from original mutt:
21  * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org>
22  */
23
24 #ifndef MUTT_PATTERN_H
25 #define MUTT_PATTERN_H
26
27 #include <lib-lib/lib-lib.h>
28
29 /* flag to mutt_pattern_comp() */
30 #define M_FULL_MSG      (1<<0)       /* enable body and header matching */
31
32 typedef enum {
33   M_MATCH_FULL_ADDRESS = 1
34 } pattern_exec_flag;
35
36 struct pattern_t {
37     struct pattern_t *next;
38
39     short op;
40     unsigned not : 1;
41     unsigned alladdr : 1;
42     unsigned stringmatch : 1;
43     int min;
44     int max;
45     struct pattern_t *child;      /* arguments to logical op */
46     char* str;
47     regex_t *rx;
48 };
49
50 DO_INIT(pattern_t, pattern);
51 void pattern_wipe(pattern_t *);
52 DO_NEW(pattern_t, pattern);
53 DO_DELETE(pattern_t, pattern);
54
55 DO_SLIST(pattern_t, pattern, pattern_delete);
56
57 int mutt_pattern_func (int, char *);
58 int mutt_pattern_exec (struct pattern_t *pat, pattern_exec_flag flags,
59                        CONTEXT * ctx, HEADER * h);
60 pattern_t *mutt_pattern_comp(const char *s, int flags, BUFFER * err);
61 void mutt_check_simple (char *s, ssize_t len, const char *simple);
62
63 #endif