2 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3 * Copyright (C) 2002 by the Sylpheed Claws Team and Hiroyuki Yamamoto
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 #include <sys/types.h>
29 /* constants generated by yacc */
30 #if !defined(YYBISON) && !defined(MATCHER_ALL)
31 # include "matcher_parser_parse.h"
45 typedef struct _MatcherProp MatcherProp;
52 typedef struct _MatcherList MatcherList;
55 /* map MATCHCRITERIA_ to yacc's MATCHER_ */
57 MATCHCRITERIA_ ## name = MATCHER_ ## name
59 /* map MATCHTYPE_ to yacc's MATCHER_ */
61 MATCHTYPE_ ## name = MATCHER_ ## name
63 /* map MATCHACTION_ to yacc's MATCHER_ */
65 MATCHACTION_ ## name = MATCHER_ ## name
67 /* map MATCHBOOL_ to yacc's MATCHER_ */
69 MATCHERBOOL_ ## name = MATCHER_ ## name
74 MC_(UNREAD), MC_(NOT_UNREAD),
75 MC_(NEW), MC_(NOT_NEW),
76 MC_(MARKED), MC_(NOT_MARKED),
77 MC_(DELETED), MC_(NOT_DELETED),
78 MC_(REPLIED), MC_(NOT_REPLIED),
79 MC_(FORWARDED), MC_(NOT_FORWARDED),
80 MC_(LOCKED), MC_(NOT_LOCKED),
81 MC_(COLORLABEL), MC_(NOT_COLORLABEL),
82 MC_(SUBJECT), MC_(NOT_SUBJECT),
83 MC_(FROM), MC_(NOT_FROM),
86 MC_(TO_OR_CC), MC_(NOT_TO_AND_NOT_CC),
87 MC_(AGE_GREATER), MC_(AGE_LOWER),
88 MC_(NEWSGROUPS), MC_(NOT_NEWSGROUPS),
89 MC_(INREPLYTO), MC_(NOT_INREPLYTO),
90 MC_(REFERENCES), MC_(NOT_REFERENCES),
91 MC_(SCORE_GREATER), MC_(SCORE_LOWER),
92 MC_(HEADER), MC_(NOT_HEADER),
93 MC_(HEADERS_PART), MC_(NOT_HEADERS_PART),
94 MC_(MESSAGE), MC_(NOT_MESSAGE),
95 MC_(BODY_PART), MC_(NOT_BODY_PART),
96 MC_(EXECUTE), MC_(NOT_EXECUTE),
117 MA_(FORWARD_AS_ATTACHMENT),
120 MA_(DELETE_ON_SERVER),
121 /* boolean operations */
126 gchar * get_matchparser_tab_str(gint id);
127 MatcherProp * matcherprop_new(gint criteria, gchar * header,
128 gint matchtype, gchar * expr,
131 MatcherProp * matcherprop_unquote_new(gint criteria, gchar * header,
132 gint matchtype, gchar * expr,
135 void matcherprop_free(MatcherProp * prop);
136 MatcherProp * matcherprop_parse(gchar ** str);
138 MatcherProp * matcherprop_copy(MatcherProp *src);
140 gboolean matcherprop_match(MatcherProp * prop, MsgInfo * info);
142 MatcherList * matcherlist_new(GSList * matchers, gboolean bool_and);
143 void matcherlist_free(MatcherList * cond);
144 MatcherList * matcherlist_parse(gchar ** str);
146 gboolean matcherlist_match(MatcherList * cond, MsgInfo * info);
148 gint matcher_parse_keyword(gchar ** str);
149 gint matcher_parse_number(gchar ** str);
150 gboolean matcher_parse_boolean_op(gchar ** str);
151 gchar * matcher_parse_regexp(gchar ** str);
152 gchar * matcher_parse_str(gchar ** str);
153 gchar * matcher_escape_str(const gchar *str);
154 gchar * matcher_unescape_str(gchar *str);
155 gchar * matcherprop_to_string(MatcherProp * matcher);
156 gchar * matcherlist_to_string(MatcherList * matchers);
157 gchar * matching_build_command(gchar * cmd, MsgInfo * info);
160 void prefs_matcher_read_config(void);
161 void prefs_matcher_write_config(void);