Skip to content
Snippets Groups Projects
Commit a4176570 authored by Stephan Bosch's avatar Stephan Bosch
Browse files

Validator: added support for checking loaded extensions.

parent 06949d2b
No related branches found
No related tags found
No related merge requests found
......@@ -65,6 +65,8 @@ struct sieve_validator_extension_reg {
const struct sieve_validator_extension *val_ext;
struct sieve_ast_argument *arg;
void *context;
bool loaded;
};
/*
......@@ -543,6 +545,7 @@ const struct sieve_extension *sieve_validator_extension_load
if ( ext_id >= 0 ) {
reg = array_idx_modifiable(&valdtr->extensions, (unsigned int) ext_id);
reg->arg = ext_arg;
reg->loaded = TRUE;
}
return ext;
......@@ -562,6 +565,17 @@ void sieve_validator_extension_register
reg->context = context;
}
bool sieve_validator_extension_loaded
(struct sieve_validator *valdtr, const struct sieve_extension *ext)
{
int ext_id = SIEVE_EXT_ID(ext);
const struct sieve_validator_extension_reg *reg;
reg = array_idx(&valdtr->extensions, (unsigned int) ext_id);
return ( reg->loaded );
}
void sieve_validator_extension_set_context
(struct sieve_validator *valdtr, const struct sieve_extension *ext,
void *context)
......
......@@ -134,6 +134,9 @@ const struct sieve_extension *sieve_validator_extension_load
void sieve_validator_extension_register
(struct sieve_validator *valdtr,
const struct sieve_validator_extension *val_ext, void *context);
bool sieve_validator_extension_loaded
(struct sieve_validator *valdtr, const struct sieve_extension *ext);
void sieve_validator_extension_set_context
(struct sieve_validator *valdtr, const struct sieve_extension *ext,
void *context);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.