diff --git a/src/lib-sieve/plugins/comparator-i-ascii-numeric/ext-cmp-i-ascii-numeric.c b/src/lib-sieve/plugins/comparator-i-ascii-numeric/ext-cmp-i-ascii-numeric.c index 72209b6112785cd10f01baf4a1030804f556d1f3..6301f4ae180a17f29464ed59e9877a266ecd4984 100644 --- a/src/lib-sieve/plugins/comparator-i-ascii-numeric/ext-cmp-i-ascii-numeric.c +++ b/src/lib-sieve/plugins/comparator-i-ascii-numeric/ext-cmp-i-ascii-numeric.c @@ -71,7 +71,7 @@ static bool ext_cmp_i_ascii_numeric_validator_load * Operand */ -static const struct sieve_extension_obj_registry ext_comparators = +static const struct sieve_extension_objects ext_comparators = SIEVE_EXT_DEFINE_COMPARATOR(i_ascii_numeric_comparator); static const struct sieve_operand my_comparator_operand = { diff --git a/src/lib-sieve/plugins/copy/ext-copy.c b/src/lib-sieve/plugins/copy/ext-copy.c index b72caac3093f3eb140402a3b29af20d90afe3cd6..fe5021d94d5db1a8ad53906ab5ddec19e689556c 100644 --- a/src/lib-sieve/plugins/copy/ext-copy.c +++ b/src/lib-sieve/plugins/copy/ext-copy.c @@ -115,7 +115,7 @@ static const struct sieve_argument copy_tag = { * Operand */ -static const struct sieve_extension_obj_registry ext_side_effects = +static const struct sieve_extension_objects ext_side_effects = SIEVE_EXT_DEFINE_SIDE_EFFECT(copy_side_effect); static const struct sieve_operand copy_side_effect_operand = { diff --git a/src/lib-sieve/plugins/enotify/vmodf-encodeurl.c b/src/lib-sieve/plugins/enotify/vmodf-encodeurl.c index aa2e29aa8093eb989cfe8ebb80ae291e3e8caac7..4feef104e943635302083f45c559def7ac272757 100644 --- a/src/lib-sieve/plugins/enotify/vmodf-encodeurl.c +++ b/src/lib-sieve/plugins/enotify/vmodf-encodeurl.c @@ -27,7 +27,7 @@ const struct sieve_variables_modifier encodeurl_modifier = { * Modifier operand */ -static const struct sieve_extension_obj_registry ext_enotify_modifiers = +static const struct sieve_extension_objects ext_enotify_modifiers = SIEVE_VARIABLES_DEFINE_MODIFIER(encodeurl_modifier); const struct sieve_operand encodeurl_operand = { diff --git a/src/lib-sieve/plugins/imapflags/tag-flags.c b/src/lib-sieve/plugins/imapflags/tag-flags.c index a77bdfd517b21fa4e2a356f0a64e026761e80493..6a04426b94ef70dae8d5390691d77615071be356 100644 --- a/src/lib-sieve/plugins/imapflags/tag-flags.c +++ b/src/lib-sieve/plugins/imapflags/tag-flags.c @@ -89,7 +89,7 @@ const struct sieve_side_effect flags_side_effect = { * Operand */ -static const struct sieve_extension_obj_registry ext_side_effects = +static const struct sieve_extension_objects ext_side_effects = SIEVE_EXT_DEFINE_SIDE_EFFECT(flags_side_effect); const struct sieve_operand flags_side_effect_operand = { diff --git a/src/lib-sieve/plugins/regex/ext-regex-common.c b/src/lib-sieve/plugins/regex/ext-regex-common.c index 37521741692a53961a72aad14a5e6975da9c4b4b..4601047333d735cee76508a38dc1b22b8c4589b3 100644 --- a/src/lib-sieve/plugins/regex/ext-regex-common.c +++ b/src/lib-sieve/plugins/regex/ext-regex-common.c @@ -10,7 +10,7 @@ * Regex match type operand */ -static const struct sieve_extension_obj_registry ext_match_types = +static const struct sieve_extension_objects ext_match_types = SIEVE_EXT_DEFINE_MATCH_TYPE(regex_match_type); const struct sieve_operand regex_match_type_operand = { diff --git a/src/lib-sieve/plugins/relational/ext-relational-common.c b/src/lib-sieve/plugins/relational/ext-relational-common.c index 92c6dc39697054afe4862271982459a5bf13361e..bf688d47e5c3d7d9ca1b6201da6c1fffb9bb5218 100644 --- a/src/lib-sieve/plugins/relational/ext-relational-common.c +++ b/src/lib-sieve/plugins/relational/ext-relational-common.c @@ -147,7 +147,7 @@ const const struct sieve_match_type *rel_match_types[] = { &rel_match_count_le, &rel_match_count_eq, &rel_match_count_ne }; -static const struct sieve_extension_obj_registry ext_match_types = +static const struct sieve_extension_objects ext_match_types = SIEVE_EXT_DEFINE_MATCH_TYPES(rel_match_types); const struct sieve_operand rel_match_type_operand = { diff --git a/src/lib-sieve/plugins/subaddress/ext-subaddress.c b/src/lib-sieve/plugins/subaddress/ext-subaddress.c index 7c1f74885f4494d897bf6802a3d04a9e1226a80c..10021e3add9f26a138a03e5e2befb55f0acd4283 100644 --- a/src/lib-sieve/plugins/subaddress/ext-subaddress.c +++ b/src/lib-sieve/plugins/subaddress/ext-subaddress.c @@ -136,7 +136,7 @@ const struct sieve_address_part *ext_subaddress_parts[] = { &user_address_part, &detail_address_part }; -static const struct sieve_extension_obj_registry ext_address_parts = +static const struct sieve_extension_objects ext_address_parts = SIEVE_EXT_DEFINE_ADDRESS_PARTS(ext_subaddress_parts); static struct sieve_operand subaddress_operand = { diff --git a/src/lib-sieve/plugins/variables/ext-variables-modifiers.c b/src/lib-sieve/plugins/variables/ext-variables-modifiers.c index f91f357b312e6df826c7df42eb5adb3914050da2..d1eeeb0100811834c14f15b24e71ea0f83751c44 100644 --- a/src/lib-sieve/plugins/variables/ext-variables-modifiers.c +++ b/src/lib-sieve/plugins/variables/ext-variables-modifiers.c @@ -87,7 +87,7 @@ void ext_variables_register_core_modifiers const struct sieve_operand_class sieve_variables_modifier_operand_class = { "modifier" }; -static const struct sieve_extension_obj_registry core_modifiers = +static const struct sieve_extension_objects core_modifiers = SIEVE_VARIABLES_DEFINE_MODIFIERS(ext_variables_core_modifiers); const struct sieve_operand modifier_operand = { diff --git a/src/lib-sieve/sieve-address-parts.c b/src/lib-sieve/sieve-address-parts.c index 85b83c4ac2fe35b7eff9eb23f35470d6f240dcc0..9660f23bf64a7aabcc9023a77633735b0e209694 100644 --- a/src/lib-sieve/sieve-address-parts.c +++ b/src/lib-sieve/sieve-address-parts.c @@ -198,7 +198,7 @@ static bool tag_address_part_generate struct sieve_operand_class sieve_address_part_operand_class = { "address part" }; -static const struct sieve_extension_obj_registry core_address_parts = +static const struct sieve_extension_objects core_address_parts = SIEVE_EXT_DEFINE_MATCH_TYPES(sieve_core_address_parts); const struct sieve_operand address_part_operand = { diff --git a/src/lib-sieve/sieve-binary.c b/src/lib-sieve/sieve-binary.c index 133f4a89968505e30e998f553b5a66b8f4336765..ce22a8aa7dd3328109c7ea93d4c115160de53d80 100644 --- a/src/lib-sieve/sieve-binary.c +++ b/src/lib-sieve/sieve-binary.c @@ -1547,10 +1547,10 @@ sieve_size_t sieve_binary_emit_extension } void sieve_binary_emit_extension_object -(struct sieve_binary *sbin, const struct sieve_extension_obj_registry *reg, +(struct sieve_binary *sbin, const struct sieve_extension_objects *objs, unsigned int code) { - if ( reg->count > 1 ) + if ( objs->count > 1 ) _sieve_binary_emit_byte(sbin, code); } @@ -1698,15 +1698,15 @@ bool sieve_binary_read_extension const void *sieve_binary_read_extension_object (struct sieve_binary *sbin, sieve_size_t *address, - const struct sieve_extension_obj_registry *reg) + const struct sieve_extension_objects *objs) { unsigned int code; - if ( reg->count == 0 ) + if ( objs->count == 0 ) return NULL; - if ( reg->count == 1 ) - return reg->objects; + if ( objs->count == 1 ) + return objs->objects; if ( ADDR_BYTES_LEFT(sbin, address) <= 0 ) return NULL; @@ -1714,8 +1714,8 @@ const void *sieve_binary_read_extension_object code = ADDR_DATA_AT(sbin, address); ADDR_JUMP(address, 1); - if ( code >= reg->count ) + if ( code >= objs->count ) return NULL; - return ((const void *const *) reg->objects)[code]; + return ((const void *const *) objs->objects)[code]; } diff --git a/src/lib-sieve/sieve-binary.h b/src/lib-sieve/sieve-binary.h index edb0e0f17da68f11f02db3d15888f722e7cef450..adac68cc0b3f902b4f7ad515e0c4b3231789f497 100644 --- a/src/lib-sieve/sieve-binary.h +++ b/src/lib-sieve/sieve-binary.h @@ -144,7 +144,7 @@ sieve_size_t sieve_binary_emit_extension (struct sieve_binary *sbin, const struct sieve_extension *ext, unsigned int offset); void sieve_binary_emit_extension_object - (struct sieve_binary *sbin, const struct sieve_extension_obj_registry *reg, + (struct sieve_binary *sbin, const struct sieve_extension_objects *objs, unsigned int code); /* @@ -182,6 +182,6 @@ bool sieve_binary_read_extension const struct sieve_extension **ext_r); const void *sieve_binary_read_extension_object (struct sieve_binary *binary, sieve_size_t *address, - const struct sieve_extension_obj_registry *reg); + const struct sieve_extension_objects *objs); #endif diff --git a/src/lib-sieve/sieve-common.h b/src/lib-sieve/sieve-common.h index f8400bcdcf9e150ce4b7184ec38b179d4e0c75d6..f6dd3debd9bb24f17e71f4bb7094b8f91d7c4c75 100644 --- a/src/lib-sieve/sieve-common.h +++ b/src/lib-sieve/sieve-common.h @@ -70,7 +70,7 @@ struct sieve_code_dumper; /* sieve-extension.h */ struct sieve_extension; -struct sieve_extension_obj_registry; +struct sieve_extension_objects; /* sieve-code.h */ struct sieve_operand; diff --git a/src/lib-sieve/sieve-comparators.c b/src/lib-sieve/sieve-comparators.c index 09ebfaf0c69337029d15622e5e4ed38e1ab060a4..b3f38307380111af636e5590afea12fe9724a9a3 100644 --- a/src/lib-sieve/sieve-comparators.c +++ b/src/lib-sieve/sieve-comparators.c @@ -252,7 +252,7 @@ const struct sieve_comparator *sieve_comparator_tag_get const struct sieve_operand_class sieve_comparator_operand_class = { "comparator" }; -static const struct sieve_extension_obj_registry core_comparators = +static const struct sieve_extension_objects core_comparators = SIEVE_EXT_DEFINE_COMPARATORS(sieve_core_comparators); const struct sieve_operand comparator_operand = { diff --git a/src/lib-sieve/sieve-extensions.h b/src/lib-sieve/sieve-extensions.h index 06c6569940dfd269ed91efdef31e6198eeff076c..0fc4d815734ecff98d18a2825f5642d0a32ae6d5 100644 --- a/src/lib-sieve/sieve-extensions.h +++ b/src/lib-sieve/sieve-extensions.h @@ -11,7 +11,7 @@ * Per-extension object registry */ -struct sieve_extension_obj_registry { +struct sieve_extension_objects { const void *objects; unsigned int count; }; @@ -41,8 +41,8 @@ struct sieve_extension { bool (*code_dump) (const struct sieve_dumptime_env *denv, sieve_size_t *address); - struct sieve_extension_obj_registry operations; - struct sieve_extension_obj_registry operands; + struct sieve_extension_objects operations; + struct sieve_extension_objects operands; }; #define SIEVE_EXT_DEFINE_NO_OBJECTS \ diff --git a/src/lib-sieve/sieve-match-types.c b/src/lib-sieve/sieve-match-types.c index 7b4e35c5d17b0c34c1e4eb6d2bc71ee96f0efc6b..cc253c6a6e988f213221506421d85f3afb6f5f64 100644 --- a/src/lib-sieve/sieve-match-types.c +++ b/src/lib-sieve/sieve-match-types.c @@ -484,7 +484,7 @@ bool sieve_match_type_validate struct sieve_operand_class sieve_match_type_operand_class = { "match type" }; -static const struct sieve_extension_obj_registry core_match_types = +static const struct sieve_extension_objects core_match_types = SIEVE_EXT_DEFINE_MATCH_TYPES(sieve_core_match_types); const struct sieve_operand match_type_operand = { diff --git a/src/lib-sieve/sieve-objects.c b/src/lib-sieve/sieve-objects.c index ce2a461e9504dee8b10e4f05355ea4fbd5e6b56a..3c09df81a83d5a4d245e04ecc9c0c0ecea166616 100644 --- a/src/lib-sieve/sieve-objects.c +++ b/src/lib-sieve/sieve-objects.c @@ -17,12 +17,12 @@ void sieve_opr_object_emit (struct sieve_binary *sbin, const struct sieve_object *obj) { - struct sieve_extension_obj_registry *reg = - (struct sieve_extension_obj_registry *) obj->operand->interface; + struct sieve_extension_objects *objs = + (struct sieve_extension_objects *) obj->operand->interface; (void) sieve_operand_emit_code(sbin, obj->operand); - if ( reg->count > 1 ) { + if ( objs->count > 1 ) { (void) sieve_binary_emit_byte(sbin, obj->code); } } @@ -31,28 +31,28 @@ const struct sieve_object *sieve_opr_object_read_data (struct sieve_binary *sbin, const struct sieve_operand *operand, const struct sieve_operand_class *opclass, sieve_size_t *address) { - const struct sieve_extension_obj_registry *reg; + const struct sieve_extension_objects *objs; unsigned int obj_code; if ( operand == NULL || operand->class != opclass ) return NULL; - reg = (struct sieve_extension_obj_registry *) operand->interface; - if ( reg == NULL ) + objs = (struct sieve_extension_objects *) operand->interface; + if ( objs == NULL ) return NULL; - if ( reg->count > 1 ) { + if ( objs->count > 1 ) { if ( !sieve_binary_read_byte(sbin, address, &obj_code) ) return NULL; - if ( obj_code < reg->count ) { + if ( obj_code < objs->count ) { const struct sieve_object *const *objects = - (const struct sieve_object* const *) reg->objects; + (const struct sieve_object* const *) objs->objects; return objects[obj_code]; } } - return (const struct sieve_object *) reg->objects; + return (const struct sieve_object *) objs->objects; } const struct sieve_object *sieve_opr_object_read diff --git a/src/testsuite/testsuite-objects.c b/src/testsuite/testsuite-objects.c index c26c6fd2f70abf88e8e67a4dbf2c54b09daa2b48..2ecfd62f2f01b4aa30463b1cc7a8b3f227380ffa 100644 --- a/src/testsuite/testsuite-objects.c +++ b/src/testsuite/testsuite-objects.c @@ -80,7 +80,7 @@ void testsuite_register_core_objects const struct sieve_operand_class sieve_testsuite_object_operand_class = { "testsuite object" }; -static const struct sieve_extension_obj_registry core_testsuite_objects = +static const struct sieve_extension_objects core_testsuite_objects = SIEVE_EXT_DEFINE_OBJECTS(testsuite_core_objects); const struct sieve_operand testsuite_object_operand = { diff --git a/src/testsuite/testsuite-objects.h b/src/testsuite/testsuite-objects.h index 6a0fc122e2f6459bf1079b8fbe9cb0e9bfecda78..e467e60e916b912828b445354406d1face8a6073 100644 --- a/src/testsuite/testsuite-objects.h +++ b/src/testsuite/testsuite-objects.h @@ -14,7 +14,7 @@ */ struct testsuite_object_operand_interface { - struct sieve_extension_obj_registry testsuite_objects; + struct sieve_extension_objects testsuite_objects; }; extern const struct sieve_operand_class testsuite_object_oprclass;