--- /dev/null
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
+ * your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * Copyright © 2006 Pierre Habouzit
+ */
+/*
+ * Copyright notice from original mutt:
+ * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org>
+ */
+
+#ifndef MUTT_PATTERN_H
+#define MUTT_PATTERN_H
+
+#include <lib-lib/lib-lib.h>
+
+/* flag to mutt_pattern_comp() */
+#define M_FULL_MSG (1<<0) /* enable body and header matching */
+
+typedef enum {
+ M_MATCH_FULL_ADDRESS = 1
+} pattern_exec_flag;
+
+struct pattern_t {
+ struct pattern_t *next;
+
+ short op;
+ unsigned not : 1;
+ unsigned alladdr : 1;
+ unsigned stringmatch : 1;
+ int min;
+ int max;
+ struct pattern_t *child; /* arguments to logical op */
+ char* str;
+ regex_t *rx;
+};
+
+DO_INIT(pattern_t, pattern);
+void pattern_wipe(pattern_t *);
+DO_NEW(pattern_t, pattern);
+DO_DELETE(pattern_t, pattern);
+
+DO_SLIST(pattern_t, pattern, pattern_delete);
+
+int mutt_pattern_func (int, char *);
+int mutt_pattern_exec (struct pattern_t *pat, pattern_exec_flag flags,
+ CONTEXT * ctx, HEADER * h);
+pattern_t *mutt_pattern_comp(const char *s, int flags, BUFFER * err);
+void mutt_check_simple (char *s, ssize_t len, const char *simple);
+
+#endif