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.
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.
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,
17 * Copyright © 2006 Pierre Habouzit
20 * Copyright notice from original mutt:
21 * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org>
24 #ifndef MUTT_PATTERN_H
25 #define MUTT_PATTERN_H
27 #include <lib-lib/lib-lib.h>
29 /* flag to mutt_pattern_comp() */
30 #define M_FULL_MSG (1<<0) /* enable body and header matching */
33 M_MATCH_FULL_ADDRESS = 1
37 struct pattern_t *next;
42 unsigned stringmatch : 1;
45 struct pattern_t *child; /* arguments to logical op */
50 DO_INIT(pattern_t, pattern);
51 void pattern_wipe(pattern_t *);
52 DO_NEW(pattern_t, pattern);
53 DO_DELETE(pattern_t, pattern);
55 DO_SLIST(pattern_t, pattern, pattern_delete);
57 int mutt_pattern_func (int, const 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);