42
42
* for every tested value? (TRUE = first alternative)
46
46
/* Is the key value allowed to contain formatting to extract multiple keys
47
47
* out of the same string?
49
49
bool allow_key_extract;
52
(struct sieve_validator *valdtr, struct sieve_ast_argument **arg,
52
(struct sieve_validator *valdtr, struct sieve_ast_argument **arg,
53
53
struct sieve_match_type_context *ctx);
54
54
bool (*validate_context)
55
(struct sieve_validator *valdtr, struct sieve_ast_argument *arg,
55
(struct sieve_validator *valdtr, struct sieve_ast_argument *arg,
56
56
struct sieve_match_type_context *ctx, struct sieve_ast_argument *key_arg);
62
62
void (*match_init)(struct sieve_match_context *mctx);
64
/* WARNING: some tests may pass a val == NULL parameter indicating that the
65
* passed value has no significance. For string-type matches this should map
66
* to the empty string "", but for match types that consider the passed values
67
* as objects rather than strings (e.g. :count) this means that the passed
68
* value should be skipped.
64
/* WARNING: some tests may pass a val == NULL parameter indicating that the
65
* passed value has no significance. For string-type matches this should map
66
* to the empty string "", but for match types that consider the passed values
67
* as objects rather than strings (e.g. :count) this means that the passed
68
* value should be skipped.
71
(struct sieve_match_context *mctx, const char *val, size_t val_size,
71
(struct sieve_match_context *mctx, const char *val, size_t val_size,
72
72
const char *key, size_t key_size, int key_index);
73
73
int (*match_deinit)(struct sieve_match_context *mctx);
77
77
* Match type instance
80
80
struct sieve_match_type {
81
81
struct sieve_object object;
83
const struct sieve_match_type_def *def;
83
const struct sieve_match_type_def *def;
86
86
#define SIEVE_MATCH_TYPE_DEFAULT(definition) \
108
108
struct sieve_ast_argument *argument;
110
110
const struct sieve_match_type *match_type;
112
112
/* Only filled in when match_type->validate_context() is called */
113
113
const struct sieve_comparator *comparator;
115
115
/* Context data could be used in the future to pass data between validator and
116
* generator in match types that use extra parameters. Currently not
116
* generator in match types that use extra parameters. Currently not
117
117
* necessary, not even for the relational extension.
136
136
bool sieve_match_values_set_enabled
137
137
(struct sieve_interpreter *interp, bool enable);
138
138
bool sieve_match_values_are_enabled
139
(struct sieve_interpreter *interp);
139
(struct sieve_interpreter *interp);
141
141
struct sieve_match_values *sieve_match_values_start
142
142
(struct sieve_interpreter *interp);
143
143
void sieve_match_values_set
145
145
void sieve_match_values_add
146
146
(struct sieve_match_values *mvalues, string_t *value);
147
147
void sieve_match_values_add_char
148
(struct sieve_match_values *mvalues, char c);
148
(struct sieve_match_values *mvalues, char c);
149
149
void sieve_match_values_skip
150
150
(struct sieve_match_values *mvalues, int num);
152
152
void sieve_match_values_commit
153
153
(struct sieve_interpreter *interp, struct sieve_match_values **mvalues);
154
154
void sieve_match_values_abort
155
155
(struct sieve_match_values **mvalues);
157
157
void sieve_match_values_get
158
158
(struct sieve_interpreter *interp, unsigned int index, string_t **value_r);
161
* Match type tagged argument
161
* Match type tagged argument
164
164
extern const struct sieve_argument_def match_type_tag;
172
172
void sieve_match_types_link_tags
173
(struct sieve_validator *valdtr,
173
(struct sieve_validator *valdtr,
174
174
struct sieve_command_registration *cmd_reg, int id_code);
180
180
bool sieve_match_type_validate
181
181
(struct sieve_validator *valdtr, struct sieve_command *cmd,
182
struct sieve_ast_argument *key_arg,
183
const struct sieve_match_type *mcht_default,
182
struct sieve_ast_argument *key_arg,
183
const struct sieve_match_type *mcht_default,
184
184
const struct sieve_comparator *cmp_default);
187
187
* Match type operand
190
190
extern const struct sieve_operand_def match_type_operand;
191
191
extern const struct sieve_operand_class sieve_match_type_operand_class;
203
203
static inline void sieve_opr_match_type_emit
204
204
(struct sieve_binary *sbin, const struct sieve_match_type *mcht)
206
206
sieve_opr_object_emit(sbin, mcht->object.ext, mcht->object.def);
230
230
bool sieve_match_substring_validate_context
231
231
(struct sieve_validator *valdtr, struct sieve_ast_argument *arg,
232
struct sieve_match_type_context *ctx,
232
struct sieve_match_type_context *ctx,
233
233
struct sieve_ast_argument *key_arg);
235
235
#endif /* __SIEVE_MATCH_TYPES_H */