5 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
6 * Copyright (c) 2001-2002 by Hiroyuki Yamamoto & The Sylpheed Claws Team.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 #include "filtering.h"
31 #include "matcher_parser.h"
32 #include "matcher_parser_lex.h"
35 #define MAX_COLORLABELS (MSG_CLABEL_7 - MSG_CLABEL_NONE)
37 static gint error = 0;
38 static gint bool_op = 0;
39 static gint match_type = 0;
40 static gchar *header = NULL;
42 static MatcherProp *prop;
44 static GSList *matchers_list = NULL;
46 static MatcherList *cond;
47 static gint score = 0;
48 static GSList *action_list = NULL;
49 static FilteringAction *action = NULL;
51 static FilteringProp *filtering;
53 static GSList **prefs_filtering = NULL;
58 MATCHER_PARSE_CONDITION,
59 MATCHER_PARSE_FILTERING_ACTION,
62 static int matcher_parse_op = MATCHER_PARSE_NONE;
65 /* ******************************************************************** */
67 void matcher_parser_start_parsing(FILE *f)
69 matcher_parserrestart(f);
70 matcher_parserparse();
74 void * matcher_parser_scan_string(const char * str);
76 FilteringProp *matcher_parser_get_filtering(gchar *str)
80 /* bad coding to enable the sub-grammar matching
82 matcher_parserlineno = 1;
83 matcher_parse_op = MATCHER_PARSE_NO_EOL;
84 matcher_parserrestart(NULL);
85 matcher_parser_init();
86 bufstate = matcher_parser_scan_string((const char *) str);
87 matcher_parser_switch_to_buffer(bufstate);
88 if (matcher_parserparse() != 0)
90 matcher_parse_op = MATCHER_PARSE_NONE;
91 matcher_parser_delete_buffer(bufstate);
95 static gboolean check_quote_symetry(gchar *str)
101 return TRUE; /* heh, that's symetric */
104 for (walk = str; *walk; walk++) {
106 if (walk == str /* first char */
107 || *(walk - 1) != '\\') /* not escaped */
114 MatcherList *matcher_parser_get_cond(gchar *str)
118 if (!check_quote_symetry(str)) {
123 /* bad coding to enable the sub-grammar matching
125 matcher_parserlineno = 1;
126 matcher_parse_op = MATCHER_PARSE_CONDITION;
127 matcher_parserrestart(NULL);
128 matcher_parser_init();
129 bufstate = matcher_parser_scan_string(str);
130 matcher_parserparse();
131 matcher_parse_op = MATCHER_PARSE_NONE;
132 matcher_parser_delete_buffer(bufstate);
136 GSList *matcher_parser_get_action_list(gchar *str)
140 if (!check_quote_symetry(str)) {
145 /* bad coding to enable the sub-grammar matching
147 matcher_parserlineno = 1;
148 matcher_parse_op = MATCHER_PARSE_FILTERING_ACTION;
149 matcher_parserrestart(NULL);
150 matcher_parser_init();
151 bufstate = matcher_parser_scan_string(str);
152 matcher_parserparse();
153 matcher_parse_op = MATCHER_PARSE_NONE;
154 matcher_parser_delete_buffer(bufstate);
158 MatcherProp *matcher_parser_get_prop(gchar *str)
163 matcher_parserlineno = 1;
164 list = matcher_parser_get_cond(str);
168 if (list->matchers == NULL)
171 if (list->matchers->next != NULL)
174 prop = list->matchers->data;
176 g_slist_free(list->matchers);
182 void matcher_parsererror(char *str)
187 for (l = matchers_list; l != NULL; l = g_slist_next(l)) {
188 matcherprop_free((MatcherProp *)
192 g_slist_free(matchers_list);
193 matchers_list = NULL;
196 g_warning("filtering parsing: %i: %s\n",
197 matcher_parserlineno, str);
201 int matcher_parserwrap(void)
212 %token MATCHER_ALL MATCHER_UNREAD MATCHER_NOT_UNREAD
213 %token MATCHER_NEW MATCHER_NOT_NEW MATCHER_MARKED
214 %token MATCHER_NOT_MARKED MATCHER_DELETED MATCHER_NOT_DELETED
215 %token MATCHER_REPLIED MATCHER_NOT_REPLIED MATCHER_FORWARDED
216 %token MATCHER_NOT_FORWARDED MATCHER_SUBJECT MATCHER_NOT_SUBJECT
217 %token MATCHER_FROM MATCHER_NOT_FROM MATCHER_TO MATCHER_NOT_TO
218 %token MATCHER_CC MATCHER_NOT_CC MATCHER_TO_OR_CC MATCHER_NOT_TO_AND_NOT_CC
219 %token MATCHER_AGE_GREATER MATCHER_AGE_LOWER MATCHER_NEWSGROUPS
220 %token MATCHER_NOT_NEWSGROUPS MATCHER_INREPLYTO MATCHER_NOT_INREPLYTO
221 %token MATCHER_REFERENCES MATCHER_NOT_REFERENCES MATCHER_SCORE_GREATER
222 %token MATCHER_SCORE_LOWER MATCHER_HEADER MATCHER_NOT_HEADER
223 %token MATCHER_HEADERS_PART MATCHER_NOT_HEADERS_PART MATCHER_MESSAGE
224 %token MATCHER_NOT_MESSAGE MATCHER_BODY_PART MATCHER_NOT_BODY_PART
225 %token MATCHER_TEST MATCHER_NOT_TEST MATCHER_MATCHCASE MATCHER_MATCH
226 %token MATCHER_REGEXPCASE MATCHER_REGEXP MATCHER_SCORE MATCHER_MOVE
227 %token MATCHER_COPY MATCHER_DELETE MATCHER_MARK MATCHER_UNMARK
228 %token MATCHER_LOCK MATCHER_UNLOCK
229 %token MATCHER_EXECUTE
230 %token MATCHER_MARK_AS_READ MATCHER_MARK_AS_UNREAD MATCHER_FORWARD
231 %token MATCHER_FORWARD_AS_ATTACHMENT MATCHER_EOL MATCHER_STRING
232 %token MATCHER_OR MATCHER_AND
233 %token MATCHER_COLOR MATCHER_SCORE_EQUAL MATCHER_REDIRECT
234 %token MATCHER_SIZE_GREATER MATCHER_SIZE_SMALLER MATCHER_SIZE_EQUAL
235 %token MATCHER_LOCKED MATCHER_NOT_LOCKED
236 %token MATCHER_COLORLABEL MATCHER_NOT_COLORLABEL
237 %token MATCHER_IGNORE_THREAD MATCHER_NOT_IGNORE_THREAD
238 %token MATCHER_ADD_SCORE MATCHER_SET_SCORE
239 %token MATCHER_STOP MATCHER_HIDE
243 %token <str> MATCHER_STRING
244 %token <str> MATCHER_SECTION
245 %token <str> MATCHER_INTEGER
251 if (matcher_parse_op == MATCHER_PARSE_NONE) {
252 prefs_filtering = &global_processing;
266 { action_list = NULL; }
273 section_notification:
274 MATCHER_SECTION MATCHER_EOL
277 FolderItem *item = NULL;
279 if (matcher_parse_op == MATCHER_PARSE_NONE) {
280 if (!strcmp(folder, "global")) {
281 prefs_filtering = &global_processing;
283 else if (!strcmp(folder, "filtering")) {
284 prefs_filtering = &filtering_rules;
287 item = folder_find_item_from_identifier(folder);
289 prefs_filtering = &item->prefs->processing;
291 prefs_filtering = NULL;
299 condition filtering MATCHER_EOL
300 | condition filtering
302 if (matcher_parse_op == MATCHER_PARSE_NO_EOL)
305 matcher_parsererror("parse error");
311 if (matcher_parse_op == MATCHER_PARSE_CONDITION)
314 matcher_parsererror("parse error");
318 | filtering_action_list
320 if (matcher_parse_op == MATCHER_PARSE_FILTERING_ACTION)
323 matcher_parsererror("parse error");
331 filtering_action_list
333 filtering = filteringprop_new(cond, action_list);
336 if ((matcher_parse_op == MATCHER_PARSE_NONE) &&
337 (prefs_filtering != NULL)) {
338 *prefs_filtering = g_slist_append(*prefs_filtering,
345 filtering_action_list:
346 filtering_action_b filtering_action_list
353 action_list = g_slist_append(action_list, action);
361 match_type = MATCHTYPE_MATCHCASE;
365 match_type = MATCHTYPE_MATCH;
369 match_type = MATCHTYPE_REGEXPCASE;
373 match_type = MATCHTYPE_REGEXP;
380 cond = matcherlist_new(matchers_list, (bool_op == MATCHERBOOL_AND));
381 matchers_list = NULL;
386 condition_list bool_op one_condition
388 matchers_list = g_slist_append(matchers_list, prop);
392 matchers_list = NULL;
393 matchers_list = g_slist_append(matchers_list, prop);
400 bool_op = MATCHERBOOL_AND;
404 bool_op = MATCHERBOOL_OR;
413 criteria = MATCHCRITERIA_ALL;
414 prop = matcherprop_unquote_new(criteria, NULL, 0, NULL, 0);
420 criteria = MATCHCRITERIA_UNREAD;
421 prop = matcherprop_unquote_new(criteria, NULL, 0, NULL, 0);
427 criteria = MATCHCRITERIA_NOT_UNREAD;
428 prop = matcherprop_unquote_new(criteria, NULL, 0, NULL, 0);
434 criteria = MATCHCRITERIA_NEW;
435 prop = matcherprop_unquote_new(criteria, NULL, 0, NULL, 0);
441 criteria = MATCHCRITERIA_NOT_NEW;
442 prop = matcherprop_unquote_new(criteria, NULL, 0, NULL, 0);
448 criteria = MATCHCRITERIA_MARKED;
449 prop = matcherprop_unquote_new(criteria, NULL, 0, NULL, 0);
455 criteria = MATCHCRITERIA_NOT_MARKED;
456 prop = matcherprop_unquote_new(criteria, NULL, 0, NULL, 0);
462 criteria = MATCHCRITERIA_DELETED;
463 prop = matcherprop_unquote_new(criteria, NULL, 0, NULL, 0);
465 | MATCHER_NOT_DELETED
469 criteria = MATCHCRITERIA_NOT_DELETED;
470 prop = matcherprop_unquote_new(criteria, NULL, 0, NULL, 0);
476 criteria = MATCHCRITERIA_REPLIED;
477 prop = matcherprop_unquote_new(criteria, NULL, 0, NULL, 0);
479 | MATCHER_NOT_REPLIED
483 criteria = MATCHCRITERIA_NOT_REPLIED;
484 prop = matcherprop_unquote_new(criteria, NULL, 0, NULL, 0);
490 criteria = MATCHCRITERIA_FORWARDED;
491 prop = matcherprop_unquote_new(criteria, NULL, 0, NULL, 0);
493 | MATCHER_NOT_FORWARDED
497 criteria = MATCHCRITERIA_NOT_FORWARDED;
498 prop = matcherprop_unquote_new(criteria, NULL, 0, NULL, 0);
504 criteria = MATCHCRITERIA_LOCKED;
505 prop = matcherprop_unquote_new(criteria, NULL, 0, NULL, 0);
511 criteria = MATCHCRITERIA_NOT_LOCKED;
512 prop = matcherprop_unquote_new(criteria, NULL, 0, NULL, 0);
514 | MATCHER_COLORLABEL MATCHER_INTEGER
519 criteria = MATCHCRITERIA_COLORLABEL;
520 value = strtol($2, NULL, 10);
521 if (value < 0) value = 0;
522 else if (value > MAX_COLORLABELS) value = MAX_COLORLABELS;
523 prop = matcherprop_unquote_new(criteria, NULL, 0, NULL, value);
525 | MATCHER_NOT_COLORLABEL MATCHER_INTEGER
530 criteria = MATCHCRITERIA_NOT_COLORLABEL;
531 value = strtol($2, NULL, 0);
532 if (value < 0) value = 0;
533 else if (value > MAX_COLORLABELS) value = MAX_COLORLABELS;
534 prop = matcherprop_unquote_new(criteria, NULL, 0, NULL, value);
536 | MATCHER_IGNORE_THREAD
540 criteria = MATCHCRITERIA_IGNORE_THREAD;
541 prop = matcherprop_unquote_new(criteria, NULL, 0, NULL, 0);
543 | MATCHER_NOT_IGNORE_THREAD
547 criteria = MATCHCRITERIA_NOT_IGNORE_THREAD;
548 prop = matcherprop_unquote_new(criteria, NULL, 0, NULL, 0);
550 | MATCHER_SUBJECT match_type MATCHER_STRING
555 criteria = MATCHCRITERIA_SUBJECT;
557 prop = matcherprop_unquote_new(criteria, NULL, match_type, expr, 0);
559 | MATCHER_NOT_SUBJECT match_type MATCHER_STRING
564 criteria = MATCHCRITERIA_NOT_SUBJECT;
566 prop = matcherprop_unquote_new(criteria, NULL, match_type, expr, 0);
568 | MATCHER_FROM match_type MATCHER_STRING
573 criteria = MATCHCRITERIA_FROM;
575 prop = matcherprop_unquote_new(criteria, NULL, match_type, expr, 0);
577 | MATCHER_NOT_FROM match_type MATCHER_STRING
582 criteria = MATCHCRITERIA_NOT_FROM;
584 prop = matcherprop_unquote_new(criteria, NULL, match_type, expr, 0);
586 | MATCHER_TO match_type MATCHER_STRING
591 criteria = MATCHCRITERIA_TO;
593 prop = matcherprop_unquote_new(criteria, NULL, match_type, expr, 0);
595 | MATCHER_NOT_TO match_type MATCHER_STRING
600 criteria = MATCHCRITERIA_NOT_TO;
602 prop = matcherprop_unquote_new(criteria, NULL, match_type, expr, 0);
604 | MATCHER_CC match_type MATCHER_STRING
609 criteria = MATCHCRITERIA_CC;
611 prop = matcherprop_unquote_new(criteria, NULL, match_type, expr, 0);
613 | MATCHER_NOT_CC match_type MATCHER_STRING
618 criteria = MATCHCRITERIA_NOT_CC;
620 prop = matcherprop_unquote_new(criteria, NULL, match_type, expr, 0);
622 | MATCHER_TO_OR_CC match_type MATCHER_STRING
627 criteria = MATCHCRITERIA_TO_OR_CC;
629 prop = matcherprop_unquote_new(criteria, NULL, match_type, expr, 0);
631 | MATCHER_NOT_TO_AND_NOT_CC match_type MATCHER_STRING
636 criteria = MATCHCRITERIA_NOT_TO_AND_NOT_CC;
638 prop = matcherprop_unquote_new(criteria, NULL, match_type, expr, 0);
640 | MATCHER_AGE_GREATER MATCHER_INTEGER
645 criteria = MATCHCRITERIA_AGE_GREATER;
646 value = strtol($2, NULL, 0);
647 prop = matcherprop_unquote_new(criteria, NULL, 0, NULL, value);
649 | MATCHER_AGE_LOWER MATCHER_INTEGER
654 criteria = MATCHCRITERIA_AGE_LOWER;
655 value = strtol($2, NULL, 0);
656 prop = matcherprop_unquote_new(criteria, NULL, 0, NULL, value);
658 | MATCHER_NEWSGROUPS match_type MATCHER_STRING
663 criteria = MATCHCRITERIA_NEWSGROUPS;
665 prop = matcherprop_unquote_new(criteria, NULL, match_type, expr, 0);
667 | MATCHER_NOT_NEWSGROUPS match_type MATCHER_STRING
672 criteria = MATCHCRITERIA_NOT_NEWSGROUPS;
674 prop = matcherprop_unquote_new(criteria, NULL, match_type, expr, 0);
676 | MATCHER_INREPLYTO match_type MATCHER_STRING
681 criteria = MATCHCRITERIA_INREPLYTO;
683 prop = matcherprop_unquote_new(criteria, NULL, match_type, expr, 0);
685 | MATCHER_NOT_INREPLYTO match_type MATCHER_STRING
690 criteria = MATCHCRITERIA_NOT_INREPLYTO;
692 prop = matcherprop_unquote_new(criteria, NULL, match_type, expr, 0);
694 | MATCHER_REFERENCES match_type MATCHER_STRING
699 criteria = MATCHCRITERIA_REFERENCES;
701 prop = matcherprop_unquote_new(criteria, NULL, match_type, expr, 0);
703 | MATCHER_NOT_REFERENCES match_type MATCHER_STRING
708 criteria = MATCHCRITERIA_NOT_REFERENCES;
710 prop = matcherprop_unquote_new(criteria, NULL, match_type, expr, 0);
712 | MATCHER_SCORE_GREATER MATCHER_INTEGER
717 criteria = MATCHCRITERIA_SCORE_GREATER;
718 value = strtol($2, NULL, 0);
719 prop = matcherprop_unquote_new(criteria, NULL, 0, NULL, value);
721 | MATCHER_SCORE_LOWER MATCHER_INTEGER
726 criteria = MATCHCRITERIA_SCORE_LOWER;
727 value = strtol($2, NULL, 0);
728 prop = matcherprop_unquote_new(criteria, NULL, 0, NULL, value);
730 | MATCHER_SCORE_EQUAL MATCHER_INTEGER
735 criteria = MATCHCRITERIA_SCORE_EQUAL;
736 value = strtol($2, NULL, 0);
737 prop = matcherprop_unquote_new(criteria, NULL, 0, NULL, value);
739 | MATCHER_SIZE_GREATER MATCHER_INTEGER
743 criteria = MATCHCRITERIA_SIZE_GREATER;
744 value = strtol($2, NULL, 0);
745 prop = matcherprop_unquote_new(criteria, NULL, 0, NULL, value);
747 | MATCHER_SIZE_SMALLER MATCHER_INTEGER
751 criteria = MATCHCRITERIA_SIZE_SMALLER;
752 value = strtol($2, NULL, 0);
753 prop = matcherprop_unquote_new(criteria, NULL, 0, NULL, value);
755 | MATCHER_SIZE_EQUAL MATCHER_INTEGER
759 criteria = MATCHCRITERIA_SIZE_EQUAL;
760 value = strtol($2, NULL, 0);
761 prop = matcherprop_unquote_new(criteria, NULL, 0, NULL, value);
763 | MATCHER_HEADER MATCHER_STRING
765 header = g_strdup($2);
766 } match_type MATCHER_STRING
771 criteria = MATCHCRITERIA_HEADER;
773 prop = matcherprop_unquote_new(criteria, header, match_type, expr, 0);
776 | MATCHER_NOT_HEADER MATCHER_STRING
778 header = g_strdup($2);
779 } match_type MATCHER_STRING
784 criteria = MATCHCRITERIA_NOT_HEADER;
786 prop = matcherprop_unquote_new(criteria, header, match_type, expr, 0);
789 | MATCHER_HEADERS_PART match_type MATCHER_STRING
794 criteria = MATCHCRITERIA_HEADERS_PART;
796 prop = matcherprop_unquote_new(criteria, NULL, match_type, expr, 0);
798 | MATCHER_NOT_HEADERS_PART match_type MATCHER_STRING
803 criteria = MATCHCRITERIA_NOT_HEADERS_PART;
805 prop = matcherprop_unquote_new(criteria, NULL, match_type, expr, 0);
807 | MATCHER_MESSAGE match_type MATCHER_STRING
812 criteria = MATCHCRITERIA_MESSAGE;
814 prop = matcherprop_unquote_new(criteria, NULL, match_type, expr, 0);
816 | MATCHER_NOT_MESSAGE match_type MATCHER_STRING
821 criteria = MATCHCRITERIA_NOT_MESSAGE;
823 prop = matcherprop_unquote_new(criteria, NULL, match_type, expr, 0);
825 | MATCHER_BODY_PART match_type MATCHER_STRING
830 criteria = MATCHCRITERIA_BODY_PART;
832 prop = matcherprop_unquote_new(criteria, NULL, match_type, expr, 0);
834 | MATCHER_NOT_BODY_PART match_type MATCHER_STRING
839 criteria = MATCHCRITERIA_NOT_BODY_PART;
841 prop = matcherprop_unquote_new(criteria, NULL, match_type, expr, 0);
843 | MATCHER_TEST MATCHER_STRING
848 criteria = MATCHCRITERIA_TEST;
850 prop = matcherprop_unquote_new(criteria, NULL, 0, expr, 0);
852 | MATCHER_NOT_TEST MATCHER_STRING
857 criteria = MATCHCRITERIA_NOT_TEST;
859 prop = matcherprop_unquote_new(criteria, NULL, 0, expr, 0);
864 MATCHER_EXECUTE MATCHER_STRING
867 gint action_type = 0;
869 action_type = MATCHACTION_EXECUTE;
871 action = filteringaction_new(action_type, 0, cmd, 0, 0);
873 | MATCHER_MOVE MATCHER_STRING
875 gchar *destination = NULL;
876 gint action_type = 0;
878 action_type = MATCHACTION_MOVE;
880 action = filteringaction_new(action_type, 0, destination, 0, 0);
882 | MATCHER_COPY MATCHER_STRING
884 gchar *destination = NULL;
885 gint action_type = 0;
887 action_type = MATCHACTION_COPY;
889 action = filteringaction_new(action_type, 0, destination, 0, 0);
893 gint action_type = 0;
895 action_type = MATCHACTION_DELETE;
896 action = filteringaction_new(action_type, 0, NULL, 0, 0);
900 gint action_type = 0;
902 action_type = MATCHACTION_MARK;
903 action = filteringaction_new(action_type, 0, NULL, 0, 0);
907 gint action_type = 0;
909 action_type = MATCHACTION_UNMARK;
910 action = filteringaction_new(action_type, 0, NULL, 0, 0);
914 gint action_type = 0;
916 action_type = MATCHACTION_LOCK;
917 action = filteringaction_new(action_type, 0, NULL, 0, 0);
921 gint action_type = 0;
923 action_type = MATCHACTION_UNLOCK;
924 action = filteringaction_new(action_type, 0, NULL, 0, 0);
926 | MATCHER_MARK_AS_READ
928 gint action_type = 0;
930 action_type = MATCHACTION_MARK_AS_READ;
931 action = filteringaction_new(action_type, 0, NULL, 0, 0);
933 | MATCHER_MARK_AS_UNREAD
935 gint action_type = 0;
937 action_type = MATCHACTION_MARK_AS_UNREAD;
938 action = filteringaction_new(action_type, 0, NULL, 0, 0);
940 | MATCHER_FORWARD MATCHER_INTEGER MATCHER_STRING
942 gchar *destination = NULL;
943 gint action_type = 0;
946 action_type = MATCHACTION_FORWARD;
947 account_id = strtol($2, NULL, 10);
949 action = filteringaction_new(action_type,
950 account_id, destination, 0, 0);
952 | MATCHER_FORWARD_AS_ATTACHMENT MATCHER_INTEGER MATCHER_STRING
954 gchar *destination = NULL;
955 gint action_type = 0;
958 action_type = MATCHACTION_FORWARD_AS_ATTACHMENT;
959 account_id = strtol($2, NULL, 10);
961 action = filteringaction_new(action_type,
962 account_id, destination, 0, 0);
964 | MATCHER_REDIRECT MATCHER_INTEGER MATCHER_STRING
966 gchar *destination = NULL;
967 gint action_type = 0;
970 action_type = MATCHACTION_REDIRECT;
971 account_id = strtol($2, NULL, 10);
973 action = filteringaction_new(action_type,
974 account_id, destination, 0, 0);
976 | MATCHER_COLOR MATCHER_INTEGER
978 gint action_type = 0;
981 action_type = MATCHACTION_COLOR;
982 color = strtol($2, NULL, 10);
983 action = filteringaction_new(action_type, 0, NULL, color, 0);
985 | MATCHER_ADD_SCORE MATCHER_INTEGER
989 score = strtol($2, NULL, 10);
990 action = filteringaction_new(MATCHACTION_ADD_SCORE, 0,
993 /* backward compatibility */
994 | MATCHER_SCORE MATCHER_INTEGER
998 score = strtol($2, NULL, 10);
999 action = filteringaction_new(MATCHACTION_ADD_SCORE, 0,
1002 | MATCHER_SET_SCORE MATCHER_INTEGER
1006 score = strtol($2, NULL, 10);
1007 action = filteringaction_new(MATCHACTION_SET_SCORE, 0,
1012 action = filteringaction_new(MATCHACTION_HIDE, 0, NULL, 0, 0);
1016 action = filteringaction_new(MATCHACTION_STOP, 0, NULL, 0, 0);