Add a fast way to search for Message-ID (at least)
[claws.git] / src / matcher.h
index d4257a3d0fe42bd0561644b0737d6e44bdf1ce6d..66cd8c7da88b376aa685f17c0b23a88fc72fe27b 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 2002-2012 by the Claws Mail Team and Hiroyuki Yamamoto
+ * Copyright (C) 2002-2014 by the Claws Mail Team and Hiroyuki Yamamoto
  *
  * 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
@@ -36,7 +36,9 @@ struct _MatcherProp {
        gchar *header;
        gchar *expr;
        int value;
+#ifndef G_OS_WIN32
        regex_t *preg;
+#endif
        int error;
        gboolean result;
        gboolean done;
@@ -87,12 +89,15 @@ enum {
        MC_(CC), MC_(NOT_CC),
        MC_(TO_OR_CC), MC_(NOT_TO_AND_NOT_CC),
        MC_(AGE_GREATER), MC_(AGE_LOWER),
+       MC_(AGE_GREATER_HOURS), MC_(AGE_LOWER_HOURS),
        MC_(NEWSGROUPS), MC_(NOT_NEWSGROUPS),
+       MC_(MESSAGEID), MC_(NOT_MESSAGEID),
        MC_(INREPLYTO), MC_(NOT_INREPLYTO),
        MC_(REFERENCES), MC_(NOT_REFERENCES),
        MC_(SCORE_GREATER), MC_(SCORE_LOWER),
        MC_(HEADER), MC_(NOT_HEADER),
        MC_(HEADERS_PART), MC_(NOT_HEADERS_PART),
+       MC_(HEADERS_CONT), MC_(NOT_HEADERS_CONT),
        MC_(MESSAGE), MC_(NOT_MESSAGE),
        MC_(BODY_PART), MC_(NOT_BODY_PART),
        MC_(TEST), MC_(NOT_TEST),
@@ -142,6 +147,9 @@ enum {
        MB_(AND)
 };
 
+void matcher_init(void);
+void matcher_done(void);
+
 const gchar *get_matchparser_tab_str   (gint id);
 gint get_matchparser_tab_id            (const gchar *str); 
 
@@ -158,6 +166,9 @@ MatcherProp *matcherprop_copy               (const MatcherProp *src);
 
 MatcherList * matcherlist_new          (GSList         *matchers, 
                                         gboolean       bool_and);
+MatcherList * matcherlist_new_from_lines(gchar         *lines,
+                                        gboolean       bool_and,
+                                        gboolean       case_sensitive);
 void matcherlist_free                  (MatcherList    *cond);
 
 MatcherList *matcherlist_parse         (gchar          **str);