Commit 3242feb0 3242feb0d3e1bb98a41e72096abd204ea96aeeb2 by Sergey Poznyakoff

(struct sieve_machine) New member action_count.

(sieve_register_standard_comparators): New function.
(sieve_require_comparator): New function.
1 parent 564bb3f0
...@@ -51,6 +51,7 @@ struct sieve_machine { ...@@ -51,6 +51,7 @@ struct sieve_machine {
51 mailbox_t mailbox; /* Mailbox to operate upon */ 51 mailbox_t mailbox; /* Mailbox to operate upon */
52 size_t msgno; /* Current message number */ 52 size_t msgno; /* Current message number */
53 message_t msg; /* Current message */ 53 message_t msg; /* Current message */
54 int action_count; /* Number of actions executed over this message */
54 55
55 /* User supplied data */ 56 /* User supplied data */
56 sieve_parse_error_t parse_error_printer; 57 sieve_parse_error_t parse_error_printer;
...@@ -68,6 +69,17 @@ extern int sieve_line_num; ...@@ -68,6 +69,17 @@ extern int sieve_line_num;
68 extern sieve_machine_t sieve_machine; 69 extern sieve_machine_t sieve_machine;
69 extern int sieve_error_count; 70 extern int sieve_error_count;
70 71
72 #define TAG_LOCALPART 0
73 #define TAG_DOMAIN 1
74 #define TAG_ALL 2
75 #define TAG_COMPARATOR 3
76 #define TAG_IS 4
77 #define TAG_CONTAINS 5
78 #define TAG_MATCHES 6
79 #define TAG_REGEX 7
80 #define TAG_UNDER 8
81 #define TAG_OVER 9
82
71 void sieve_compile_error __P((const char *filename, int linenum, 83 void sieve_compile_error __P((const char *filename, int linenum,
72 const char *fmt, ...)); 84 const char *fmt, ...));
73 void sieve_debug_internal __P((sieve_printf_t printer, void *data, 85 void sieve_debug_internal __P((sieve_printf_t printer, void *data,
...@@ -90,6 +102,7 @@ void sieve_lex_finish __P((void)); ...@@ -90,6 +102,7 @@ void sieve_lex_finish __P((void));
90 102
91 void sieve_register_standard_actions __P((void)); 103 void sieve_register_standard_actions __P((void));
92 void sieve_register_standard_tests __P((void)); 104 void sieve_register_standard_tests __P((void));
105 void sieve_register_standard_comparators __P((void));
93 106
94 int sieve_code __P((sieve_op_t *op)); 107 int sieve_code __P((sieve_op_t *op));
95 int sieve_code_instr __P((sieve_instr_t instr)); 108 int sieve_code_instr __P((sieve_instr_t instr));
...@@ -110,3 +123,4 @@ void instr_branch __P((sieve_machine_t mach)); ...@@ -110,3 +123,4 @@ void instr_branch __P((sieve_machine_t mach));
110 void instr_brz __P((sieve_machine_t mach)); 123 void instr_brz __P((sieve_machine_t mach));
111 124
112 int sieve_mark_deleted __P((message_t msg, int deleted)); 125 int sieve_mark_deleted __P((message_t msg, int deleted));
126 int sieve_require_comparator __P((const char *name));
......