/src/pigeonhole/src/lib-sieve/plugins/environment/ext-environment.c
Line | Count | Source |
1 | | /* Copyright (c) Pigeonhole authors, see top-level COPYING file */ |
2 | | |
3 | | /* Extension variables |
4 | | * ------------------- |
5 | | * |
6 | | * Authors: Stephan Bosch |
7 | | * Specification: RFC 5183 |
8 | | * Implementation: full |
9 | | * Status: testing |
10 | | * |
11 | | */ |
12 | | |
13 | | #include "lib.h" |
14 | | #include "str.h" |
15 | | #include "unichar.h" |
16 | | |
17 | | #include "sieve-extensions.h" |
18 | | #include "sieve-commands.h" |
19 | | #include "sieve-binary.h" |
20 | | #include "sieve-interpreter.h" |
21 | | |
22 | | #include "sieve-validator.h" |
23 | | |
24 | | #include "ext-environment-common.h" |
25 | | |
26 | | /* |
27 | | * Extension |
28 | | */ |
29 | | |
30 | | static bool |
31 | | ext_environment_validator_load(const struct sieve_extension *ext, |
32 | | struct sieve_validator *valdtr); |
33 | | static bool |
34 | | ext_environment_interpreter_load(const struct sieve_extension *ext, |
35 | | const struct sieve_runtime_env *renv, |
36 | | sieve_size_t *address); |
37 | | |
38 | | const struct sieve_extension_def environment_extension = { |
39 | | .name = "environment", |
40 | | .validator_load = ext_environment_validator_load, |
41 | | .interpreter_load = ext_environment_interpreter_load, |
42 | | SIEVE_EXT_DEFINE_OPERATION(tst_environment_operation), |
43 | | }; |
44 | | |
45 | | static bool |
46 | | ext_environment_validator_load(const struct sieve_extension *ext, |
47 | | struct sieve_validator *valdtr) |
48 | 0 | { |
49 | 0 | sieve_validator_register_command(valdtr, ext, &tst_environment); |
50 | 0 | return TRUE; |
51 | 0 | } |
52 | | |
53 | | static bool |
54 | | ext_environment_interpreter_load(const struct sieve_extension *ext, |
55 | | const struct sieve_runtime_env *renv, |
56 | | sieve_size_t *address ATTR_UNUSED) |
57 | 0 | { |
58 | 0 | ext_environment_interpreter_init(ext, renv->interp); |
59 | 0 | return TRUE; |
60 | 0 | } |