/src/pigeonhole/src/lib-sieve/plugins/date/ext-date.c
Line | Count | Source |
1 | | /* Copyright (c) Pigeonhole authors, see top-level COPYING file */ |
2 | | |
3 | | /* Extension date |
4 | | * ------------------ |
5 | | * |
6 | | * Authors: Stephan Bosch |
7 | | * Specification: RFC 5260 |
8 | | * Implementation: full |
9 | | * Status: testing |
10 | | * |
11 | | */ |
12 | | |
13 | | #include "lib.h" |
14 | | #include "array.h" |
15 | | |
16 | | #include "sieve-common.h" |
17 | | |
18 | | #include "sieve-extensions.h" |
19 | | #include "sieve-commands.h" |
20 | | #include "sieve-comparators.h" |
21 | | #include "sieve-match-types.h" |
22 | | #include "sieve-address-parts.h" |
23 | | |
24 | | #include "sieve-validator.h" |
25 | | #include "sieve-generator.h" |
26 | | #include "sieve-binary.h" |
27 | | #include "sieve-interpreter.h" |
28 | | #include "sieve-dump.h" |
29 | | |
30 | | #include "ext-date-common.h" |
31 | | |
32 | | /* |
33 | | * Extension |
34 | | */ |
35 | | |
36 | | static bool |
37 | | ext_date_validator_load(const struct sieve_extension *ext, |
38 | | struct sieve_validator *validator); |
39 | | |
40 | | const struct sieve_operation_def *ext_date_operations[] = { |
41 | | &date_operation, |
42 | | ¤tdate_operation, |
43 | | }; |
44 | | |
45 | | const struct sieve_extension_def date_extension = { |
46 | | .name = "date", |
47 | | .validator_load = ext_date_validator_load, |
48 | | .interpreter_load = ext_date_interpreter_load, |
49 | | SIEVE_EXT_DEFINE_OPERATIONS(ext_date_operations), |
50 | | }; |
51 | | |
52 | | static bool |
53 | | ext_date_validator_load(const struct sieve_extension *ext, |
54 | | struct sieve_validator *valdtr) |
55 | 0 | { |
56 | | /* Register new tests */ |
57 | 0 | sieve_validator_register_command(valdtr, ext, &date_test); |
58 | 0 | sieve_validator_register_command(valdtr, ext, ¤tdate_test); |
59 | |
|
60 | 0 | return TRUE; |
61 | 0 | } |