1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
|
/* Copyright (c) 2002-2010 Dovecot Sieve authors, see the included COPYING file
*/
#ifndef __EXT_VARIABLES_COMMON_H
#define __EXT_VARIABLES_COMMON_H
#include "sieve-common.h"
#include "sieve-validator.h"
#include "sieve-ext-variables.h"
/*
* Extension
*/
extern const struct sieve_extension_def variables_extension;
/*
* Commands
*/
extern const struct sieve_command_def cmd_set;
extern const struct sieve_command_def tst_string;
/*
* Operands
*/
enum ext_variables_operand {
EXT_VARIABLES_OPERAND_VARIABLE,
EXT_VARIABLES_OPERAND_MATCH_VALUE,
EXT_VARIABLES_OPERAND_NAMESPACE_VARIABLE,
EXT_VARIABLES_OPERAND_MODIFIER
};
/*
* Operations
*/
extern const struct sieve_operation_def cmd_set_operation;
extern const struct sieve_operation_def tst_string_operation;
enum ext_variables_opcode {
EXT_VARIABLES_OPERATION_SET,
EXT_VARIABLES_OPERATION_STRING
};
/*
* Validator context
*/
struct ext_variables_validator_context {
bool active;
struct sieve_validator_object_registry *modifiers;
struct sieve_validator_object_registry *namespaces;
struct sieve_variable_scope *main_scope;
};
void ext_variables_validator_initialize
(const struct sieve_extension *this_ext, struct sieve_validator *validator);
struct ext_variables_validator_context *ext_variables_validator_context_get
(const struct sieve_extension *this_ext, struct sieve_validator *valdtr);
struct sieve_variable *ext_variables_validator_get_variable
(const struct sieve_extension *this_ext, struct sieve_validator *validator,
const char *variable, bool declare);
/*
* Code generation
*/
bool ext_variables_generator_load
(const struct sieve_extension *ext, const struct sieve_codegen_env *cgenv);
/*
* Interpreter context
*/
bool ext_variables_interpreter_load
(const struct sieve_extension *ext, const struct sieve_runtime_env *renv,
sieve_size_t *address);
#endif /* __EXT_VARIABLES_COMMON_H */
|