]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Array API changed: ARRAY_DEFINE(name, type) -> ARRAY(type) name
authorTimo Sirainen <tss@iki.fi>
Sun, 19 Aug 2012 11:21:37 +0000 (14:21 +0300)
committerTimo Sirainen <tss@iki.fi>
Sun, 19 Aug 2012 11:21:37 +0000 (14:21 +0300)
Easy way to update your existing code:
perl -i -pe 's:ARRAY_DEFINE\(([^,]+), *([^)]+)\);:ARRAY($2) $1;:' **/*.[ch]

165 files changed:
src/auth/auth-request-handler.c
src/auth/auth-settings.c
src/auth/auth-settings.h
src/auth/auth-worker-server.c
src/auth/auth.c
src/auth/db-ldap.h
src/auth/main.c
src/auth/passdb-template.c
src/auth/passdb.c
src/auth/userdb-template.c
src/auth/userdb.c
src/config/config-parser-private.h
src/config/config-parser.c
src/dict/dict-connection.h
src/dict/dict-settings.h
src/director/director-test.c
src/director/director.h
src/director/mail-host.c
src/director/main.c
src/director/user-directory.c
src/doveadm/doveadm-dump.c
src/doveadm/doveadm-kick.c
src/doveadm/doveadm-mail-altmove.c
src/doveadm/doveadm-mail-fetch.c
src/doveadm/doveadm-mail.h
src/doveadm/doveadm-print-flow.c
src/doveadm/doveadm-print-pager.c
src/doveadm/doveadm-print-table.c
src/doveadm/doveadm-print.c
src/doveadm/doveadm-server.h
src/doveadm/doveadm-settings.h
src/doveadm/doveadm-stats.c
src/doveadm/doveadm-who.c
src/doveadm/doveadm.c
src/doveadm/dsync/dsync-mailbox-export.c
src/doveadm/dsync/dsync-mailbox-import.c
src/doveadm/dsync/dsync-mailbox-tree-private.h
src/doveadm/dsync/dsync-mailbox-tree-sync.c
src/doveadm/dsync/dsync-slave-pipe.c
src/imap/cmd-list.c
src/imap/imap-client.h
src/imap/imap-commands-util.c
src/imap/imap-commands.c
src/imap/imap-fetch.c
src/imap/imap-fetch.h
src/imap/imap-notify.h
src/imap/imap-search.h
src/indexer/worker-connection.c
src/ipc/ipc-connection.h
src/ipc/ipc-group.c
src/lib-auth/auth-server-connection.h
src/lib-dict/dict-memcached-ascii.c
src/lib-dict/dict-redis.c
src/lib-dict/dict-sql-settings.c
src/lib-dict/dict-sql-settings.h
src/lib-dict/dict-sql.c
src/lib-dict/dict-transaction-memory.h
src/lib-dict/dict.c
src/lib-imap-client/imapc-client-private.h
src/lib-imap-client/imapc-connection.c
src/lib-index/mail-cache-compress.c
src/lib-index/mail-cache-lookup.c
src/lib-index/mail-cache-transaction.c
src/lib-index/mail-index-modseq.c
src/lib-index/mail-index-private.h
src/lib-index/mail-index-strmap.c
src/lib-index/mail-index-sync-private.h
src/lib-index/mail-index-sync.c
src/lib-index/mail-index-transaction-export.c
src/lib-index/mail-index-transaction-private.h
src/lib-index/mail-index-transaction-view.c
src/lib-index/mail-index-view-private.h
src/lib-index/mail-transaction-log-view-private.h
src/lib-lda/lmtp-client.c
src/lib-lda/mail-deliver.h
src/lib-mail/istream-attachment-connector.c
src/lib-mail/istream-header-filter.c
src/lib-mail/rfc2231-parser.c
src/lib-mail/test-istream-attachment.c
src/lib-master/anvil-client.c
src/lib-master/ipc-client.c
src/lib-master/master-instance.c
src/lib-master/master-service-settings.c
src/lib-master/mountpoint-list.c
src/lib-settings/settings-parser.c
src/lib-sql/driver-pgsql.c
src/lib-sql/driver-sqlpool.c
src/lib-sql/sql-api-private.h
src/lib-storage/index/dbox-common/dbox-file.h
src/lib-storage/index/dbox-multi/mdbox-map-private.h
src/lib-storage/index/dbox-multi/mdbox-save.c
src/lib-storage/index/dbox-multi/mdbox-storage-rebuild.c
src/lib-storage/index/dbox-multi/mdbox-storage.h
src/lib-storage/index/dbox-single/sdbox-save.c
src/lib-storage/index/imapc/imapc-storage.h
src/lib-storage/index/index-mail-binary.c
src/lib-storage/index/index-mail-headers.c
src/lib-storage/index/index-mail.h
src/lib-storage/index/index-search-private.h
src/lib-storage/index/index-storage.c
src/lib-storage/index/index-sync-changes.c
src/lib-storage/index/index-thread-finish.c
src/lib-storage/index/maildir/maildir-keywords.c
src/lib-storage/index/maildir/maildir-save.c
src/lib-storage/index/mbox/mbox-sync-private.h
src/lib-storage/list/mailbox-list-fs-iter.c
src/lib-storage/list/mailbox-list-index-notify.c
src/lib-storage/list/mailbox-list-maildir.c
src/lib-storage/mail-search-register-human.c
src/lib-storage/mail-search-register.c
src/lib-storage/mail-storage-hooks.c
src/lib-storage/mail-storage-private.h
src/lib-storage/mail-storage-settings.h
src/lib-storage/mail-user.h
src/lib-storage/mailbox-keywords.c
src/lib-storage/mailbox-list-iter.c
src/lib-storage/mailbox-list-private.h
src/lib-storage/mailbox-list.c
src/lib-storage/mailbox-tree.c
src/lib/array-decl.h
src/lib/array.h
src/lib/ioloop-epoll.c
src/lib/ioloop-kqueue.c
src/lib/ioloop-private.h
src/lib/lib.h
src/lib/module-context.h
src/lib/priorityq.c
src/lib/test-aqueue.c
src/lib/test-array.c
src/lib/var-expand.c
src/lmtp/client.h
src/lmtp/lmtp-proxy.c
src/log/log-connection.c
src/master/service-listen.c
src/master/service-process-notify.c
src/master/service.h
src/plugins/acl/acl-backend-vfile.h
src/plugins/acl/acl-cache.c
src/plugins/expire/doveadm-expire.c
src/plugins/expire/expire-set.c
src/plugins/fts-lucene/fts-backend-lucene.c
src/plugins/fts-lucene/lucene-wrapper.cc
src/plugins/fts-solr/fts-backend-solr-old.c
src/plugins/fts-solr/fts-backend-solr.c
src/plugins/fts-solr/solr-connection.c
src/plugins/fts-squat/squat-trie.c
src/plugins/fts-squat/squat-uidlist.c
src/plugins/fts/fts-api.c
src/plugins/fts/fts-parser-script.c
src/plugins/fts/fts-storage.h
src/plugins/pop3-migration/pop3-migration-plugin.c
src/plugins/quota/quota-private.h
src/plugins/quota/quota-storage.c
src/plugins/quota/quota.c
src/plugins/trash/trash-plugin.c
src/plugins/virtual/virtual-mail.c
src/plugins/virtual/virtual-search.c
src/plugins/virtual/virtual-storage.h
src/plugins/virtual/virtual-sync.c
src/plugins/virtual/virtual-transaction.h
src/pop3/pop3-client.c
src/pop3/pop3-client.h
src/replication/replicator/replicator-brain.c
src/replication/replicator/replicator-queue.c
src/ssl-params/main.c

index 5ed084349171f5dac7872a19af11441525c4dc11..446c69694b2f4869add61de2af7722e5023f7d53 100644 (file)
@@ -33,7 +33,7 @@ struct auth_request_handler {
        unsigned int destroyed:1;
 };
 
-static ARRAY_DEFINE(auth_failures_arr, struct auth_request *);
+static ARRAY(struct auth_request *) auth_failures_arr;
 static struct aqueue *auth_failures;
 static struct timeout *to_auth_failures;
 
index d9c1d4b6fe92f1c213b39f917fd33d84614d2104..1e753c9506e0fc14bcfc5e3f8488cbd09017d1b9 100644 (file)
@@ -278,7 +278,7 @@ auth_settings_set_self_ips(struct auth_settings *set, pool_t pool,
                           const char **error_r)
 {
        const char *const *tmp;
-       ARRAY_DEFINE(ips_array, struct ip_addr);
+       ARRAY(struct ip_addr) ips_array;
        struct ip_addr *ips;
        unsigned int ips_count;
        int ret;
index e813528d1219834ffccf555c3328551501a6bb72..bf244a4cd8ee77e9f4da853cf0cdbc41aeafa56f 100644 (file)
@@ -49,8 +49,8 @@ struct auth_settings {
 
        unsigned int worker_max_count;
 
-       ARRAY_DEFINE(passdbs, struct auth_passdb_settings *);
-       ARRAY_DEFINE(userdbs, struct auth_userdb_settings *);
+       ARRAY(struct auth_passdb_settings *) passdbs;
+       ARRAY(struct auth_userdb_settings *) userdbs;
 
        const char *base_dir;
        bool verbose_proctitle;
index 2c17376e12f477b2e8c7948b08d8058e35aa6c21..6dedbc33430c5b910a8b16d055e14376069de5a8 100644 (file)
@@ -46,9 +46,9 @@ struct auth_worker_connection {
        unsigned int shutdown:1;
 };
 
-static ARRAY_DEFINE(connections, struct auth_worker_connection *) = ARRAY_INIT;
+static ARRAY(struct auth_worker_connection *) connections = ARRAY_INIT;
 static unsigned int idle_count = 0, auth_workers_with_errors = 0;
-static ARRAY_DEFINE(worker_request_array, struct auth_worker_request *);
+static ARRAY(struct auth_worker_request *) worker_request_array;
 static struct aqueue *worker_request_queue;
 static time_t auth_worker_last_warn;
 static unsigned int auth_workers_throttle_count;
index d06784015a0aadf907b4eff3c542353af875f2d9..bcee65ffd449c789366d9233c7fe55c354536d73 100644 (file)
@@ -16,7 +16,7 @@ struct auth_userdb_settings userdb_dummy_set = {
        .override_fields = ""
 };
 
-static ARRAY_DEFINE(auths, struct auth *);
+static ARRAY(struct auth *) auths;
 
 static void
 auth_passdb_preinit(struct auth *auth, const struct auth_passdb_settings *set,
index dffbe0b417de6c7cf1e95b97a113d46d4ff4c060..79439f062d0203fadb022bc99366ca4e4b357b06 100644 (file)
@@ -149,7 +149,7 @@ struct ldap_connection {
        /* Request queue contains sent requests at tail (msgid != -1) and
           queued requests at head (msgid == -1). */
        struct aqueue *request_queue;
-       ARRAY_DEFINE(request_array, struct ldap_request *);
+       ARRAY(struct ldap_request *) request_array;
        /* Number of messages in queue with msgid != -1 */
        unsigned int pending_count;
 
index d22c40ed40e2ec789288ecb206575d8a6b8ddb2d..fd693c6fef3bf9c62877c7c4170118b25dbc5d79 100644 (file)
@@ -56,7 +56,7 @@ struct auth_penalty *auth_penalty;
 static pool_t auth_set_pool;
 static struct module *modules = NULL;
 static struct mechanisms_register *mech_reg;
-static ARRAY_DEFINE(listeners, struct auth_socket_listener);
+static ARRAY(struct auth_socket_listener) listeners;
 
 void auth_refresh_proctitle(void)
 {
index 150ba78d17a6b5f3365228f1c898a8b8240fca26..fba39c0747961ab06e36abb3be55f6db0da53901 100644 (file)
@@ -8,7 +8,7 @@
 #include "passdb-template.h"
 
 struct passdb_template {
-       ARRAY_DEFINE(args, const char *);
+       ARRAY(const char *) args;
 };
 
 struct passdb_template *passdb_template_build(pool_t pool, const char *args)
index 3628cbefeaf9f09aae6e5078d698b4c4dc3c5b0b..ce675760c6e390c8e0a83e3a42afd3140e47c0dd 100644 (file)
@@ -9,8 +9,8 @@
 
 #include <stdlib.h>
 
-static ARRAY_DEFINE(passdb_interfaces, struct passdb_module_interface *);
-static ARRAY_DEFINE(passdb_modules, struct passdb_module *);
+static ARRAY(struct passdb_module_interface *) passdb_interfaces;
+static ARRAY(struct passdb_module *) passdb_modules;
 
 static const struct passdb_module_interface passdb_iface_deinit = {
        .name = "deinit"
index 327e785656ee699db44c42ecb021971e21a23e2e..6fa4f2a4a54a19aaca82516e587fca38c018a6ea 100644 (file)
@@ -8,7 +8,7 @@
 #include "userdb-template.h"
 
 struct userdb_template {
-       ARRAY_DEFINE(args, const char *);
+       ARRAY(const char *) args;
 };
 
 struct userdb_template *
index 4dd15e1cafe41d442fe660b8bd01d6a62fba61d3..26fdffcf873e0d076b62839577e8a1adab58993f 100644 (file)
@@ -9,8 +9,8 @@
 
 #include <stdlib.h>
 
-static ARRAY_DEFINE(userdb_interfaces, struct userdb_module_interface *);
-static ARRAY_DEFINE(userdb_modules, struct userdb_module *);
+static ARRAY(struct userdb_module_interface *) userdb_interfaces;
+static ARRAY(struct userdb_module *) userdb_modules;
 
 static const struct userdb_module_interface userdb_iface_deinit = {
        .name = "deinit"
index 5247494b8219c2dd4a80fa06307c75d44d4c59be..3c7210f2501d4fe676fb8d2d38ce5d6137a111a4 100644 (file)
@@ -41,7 +41,7 @@ struct config_parser_context {
        const char *path;
        const char *module;
 
-       ARRAY_DEFINE(all_parsers, struct config_filter_parser *);
+       ARRAY(struct config_filter_parser *) all_parsers;
        struct config_module_parser *root_parsers;
        struct config_section_stack *cur_section;
        struct input_stack *cur_input;
index 02ffd3dfbc3fa281e31bff8a5a13ad271753b556..2e7e72a61640c9cb1163be9e729a54f4b88adf95 100644 (file)
@@ -980,7 +980,7 @@ void config_parse_load_modules(void)
        struct module_dir_load_settings mod_set;
        struct module *m;
        const struct setting_parser_info **roots;
-       ARRAY_DEFINE(new_roots, const struct setting_parser_info *);
+       ARRAY(const struct setting_parser_info *) new_roots;
        ARRAY_TYPE(service_settings) new_services;
        struct service_settings *const *services, *service_set;
        unsigned int i, count;
index 1acf0e8d8bce1d2f77323858123b0a3dd6e83d70..ce1e44687d0166194d79ae0392ecd50bcd1ef445 100644 (file)
@@ -27,7 +27,7 @@ struct dict_connection {
 
        /* There are only a few transactions per client, so keeping them in
           array is fast enough */
-       ARRAY_DEFINE(transactions, struct dict_connection_transaction);
+       ARRAY(struct dict_connection_transaction) transactions;
 };
 
 struct dict_connection *dict_connection_create(int fd);
index 75b45175d9a68f46b180817b9166f981c47bda9c..0ca700ecc3e617d49a56492f99c7243012a52405 100644 (file)
@@ -4,7 +4,7 @@
 struct dict_settings {
        const char *base_dir;
        const char *dict_db_config;
-       ARRAY_DEFINE(dicts, const char *);
+       ARRAY(const char *) dicts;
 };
 
 extern const struct setting_parser_info dict_setting_parser_info;
index e9218214c392c00837b90833329f80dde27383e3..5ac5c72f5a77397332cd3ccec0b0490f42837b31 100644 (file)
@@ -91,7 +91,7 @@ static struct imap_client *imap_clients;
 static struct director_connection *director_connections;
 static HASH_TABLE(char *, struct user *) users;
 static HASH_TABLE(struct ip_addr *, struct host *) hosts;
-static ARRAY_DEFINE(hosts_array, struct host *);
+static ARRAY(struct host *) hosts_array;
 static struct admin_connection *admin;
 static struct timeout *to_disconnect;
 
index f507eff92ad880de36be6985bc0a8e20b7179f9d..70ec47a9e2448d818796945461bf13cb9428e66a 100644 (file)
@@ -39,7 +39,7 @@ struct director {
           is long. */
        struct director_connection *left, *right;
        /* all director connections */
-       ARRAY_DEFINE(connections, struct director_connection *);
+       ARRAY(struct director_connection *) connections;
        struct timeout *to_reconnect;
        struct timeout *to_sync;
 
@@ -52,14 +52,14 @@ struct director {
        struct user_directory *users;
 
        /* these requests are waiting for directors to be in synced */
-       ARRAY_DEFINE(pending_requests, struct director_request *);
+       ARRAY(struct director_request *) pending_requests;
        struct timeout *to_request;
        struct timeout *to_handshake_warning;
 
        director_state_change_callback_t *state_change_callback;
 
        /* director hosts are sorted by IP (and port) */
-       ARRAY_DEFINE(dir_hosts, struct director_host *);
+       ARRAY(struct director_host *) dir_hosts;
        struct timeout *to_remove_dirs;
 
        struct ipc_client *ipc_proxy;
index 2e57bed5fb5ea960199094714de3dcdf2b279106..94ff3b831149baa61cbea415efad579563816b6b 100644 (file)
@@ -8,7 +8,7 @@
 
 struct mail_host_list {
        ARRAY_TYPE(mail_host) hosts;
-       ARRAY_DEFINE(vhosts, struct mail_host *);
+       ARRAY(struct mail_host *) vhosts;
        bool hosts_unsorted;
 };
 
index 2f78b98eaa773eb1a39d1799860c941c9954ddfc..cfea0e914817d9134a0cacf847b0c817c7278b32 100644 (file)
@@ -116,7 +116,7 @@ find_inet_listener_port(struct ip_addr *ip_r,
 static void director_state_changed(struct director *dir)
 {
        struct director_request *const *requestp;
-       ARRAY_DEFINE(new_requests, struct director_request *);
+       ARRAY(struct director_request *) new_requests;
        bool ret;
 
        if (!dir->ring_synced ||
index 5f22a8aa5e688d91bf082de0898a42f735533bc9..f0cdac25925e1516859d89d1200ac3baf119778d 100644 (file)
@@ -26,7 +26,7 @@ struct user_directory {
        struct user *head, *tail;
        struct user *prev_insert_pos;
 
-       ARRAY_DEFINE(iters, struct user_directory_iter *);
+       ARRAY(struct user_directory_iter *) iters;
 
        char *username_hash_fmt;
        unsigned int timeout_secs;
index 46f2fd20ee599b181846d220306170c0ec45cdb5..a54e162d5843efe543610af5be6842732d81ade8 100644 (file)
@@ -8,7 +8,7 @@
 #include <stdio.h>
 #include <unistd.h>
 
-static ARRAY_DEFINE(dumps, const struct doveadm_cmd_dump *);
+static ARRAY(const struct doveadm_cmd_dump *) dumps;
 
 void doveadm_dump_register(const struct doveadm_cmd_dump *dump)
 {
index 2be5007fedacff7a0e8eed299bc2e2877907854c..b62b1bd3fe4e02e96b3a67622bb4342db4f00de5 100644 (file)
@@ -21,7 +21,7 @@ struct kick_user {
 
 struct kick_pid {
        pid_t pid;
-       ARRAY_DEFINE(users, struct kick_user);
+       ARRAY(struct kick_user) users;
        bool kick;
 };
 
@@ -29,7 +29,7 @@ struct kick_context {
        struct who_context who;
        HASH_TABLE(pid_t, struct kick_pid *) pids;
        bool force_kick;
-       ARRAY_DEFINE(kicked_users, const char *);
+       ARRAY(const char *) kicked_users;
 };
 
 static void
index 6b2feb7cce7f8d08ed8357ddffafd987f5a7838f..18f686dcff11946f2d7605d5737d5e959696f8be 100644 (file)
@@ -63,7 +63,7 @@ cmd_altmove_run(struct doveadm_mail_cmd_context *_ctx, struct mail_user *user)
        struct doveadm_mailbox_list_iter *iter;
        const struct mailbox_info *info;
        struct mail_namespace *ns, *prev_ns = NULL;
-       ARRAY_DEFINE(purged_storages, struct mail_storage *);
+       ARRAY(struct mail_storage *) purged_storages;
        struct mail_storage *const *storages;
        unsigned int i, count;
        int ret = 0;
index 89a24b5559122b1dac062df568e8e627702cb5dc..9dc959f76d091db4310b90fc071ee1b1b75abda6 100644 (file)
@@ -28,7 +28,7 @@ struct fetch_cmd_context {
        struct ostream *output;
        struct mail *mail;
 
-       ARRAY_DEFINE(fields, const struct fetch_field);
+       ARRAY(const struct fetch_field) fields;
        ARRAY_TYPE(const_string) header_fields;
        enum mail_fetch_field wanted_fields;
 
index 70c62471fe25261c980da00599aee7133c9cc1ec..fb16bb8f2fedb690ed6d6a1476098f8a9ca6dc74 100644 (file)
@@ -56,7 +56,7 @@ struct doveadm_mail_cmd_context {
        struct mail_user *cur_mail_user;
        struct doveadm_mail_cmd_vfuncs v;
 
-       ARRAY_DEFINE(module_contexts, union doveadm_mail_cmd_module_context *);
+       ARRAY(union doveadm_mail_cmd_module_context *) module_contexts;
 
        /* if non-zero, exit with this code */
        int exit_code;
index 9ec339297f851a694a29547345a8ff402dccffb1..fbb2d6716c6499c1eeaf5026366e836c22682fc2 100644 (file)
@@ -13,7 +13,7 @@ struct doveadm_print_flow_header {
 
 struct doveadm_print_flow_context {
        pool_t pool;
-       ARRAY_DEFINE(headers, struct doveadm_print_flow_header);
+       ARRAY(struct doveadm_print_flow_header) headers;
        unsigned int header_idx;
 
        unsigned int streaming:1;
index 9a945210d48a6c1585c420a07ee8509233278d91..c303bbef689488129c807f3ab0cda453a0b9d8b9 100644 (file)
@@ -12,7 +12,7 @@ struct doveadm_print_pager_header {
 
 struct doveadm_print_pager_context {
        pool_t pool;
-       ARRAY_DEFINE(headers, struct doveadm_print_pager_header);
+       ARRAY(struct doveadm_print_pager_header) headers;
        unsigned int header_idx;
 
        unsigned int streaming:1;
index 06e8258ee78b460c724f9e0f17fb67565023d1fc..3495417bed16f74a8903b9fb6e1e34bf45a31128 100644 (file)
@@ -22,7 +22,7 @@ struct doveadm_print_table_header {
 
 struct doveadm_print_table_context {
        pool_t pool;
-       ARRAY_DEFINE(headers, struct doveadm_print_table_header);
+       ARRAY(struct doveadm_print_table_header) headers;
        ARRAY_TYPE(const_string) buffered_values;
        unsigned int hdr_idx;
        unsigned int columns;
index 54cd62820ff1c3ec1a655f1d8fc4e94f0116314f..be11763336b78463adde8f1f8bf480a98c8de763 100644 (file)
@@ -14,7 +14,7 @@ struct doveadm_print_header_context {
 
 struct doveadm_print_context {
        pool_t pool;
-       ARRAY_DEFINE(headers, struct doveadm_print_header_context);
+       ARRAY(struct doveadm_print_header_context) headers;
        const struct doveadm_print_vfuncs *v;
 
        unsigned int header_idx;
index 9dc8b0c6e6534a73787a92a42ce9e842b52db781..1039eee1737c003d5317f1f07bcfd71788f2adbf 100644 (file)
@@ -9,7 +9,7 @@ extern struct doveadm_print_vfuncs doveadm_print_server_vfuncs;
 struct doveadm_server {
        const char *name;
 
-       ARRAY_DEFINE(connections, struct server_connection *);
+       ARRAY(struct server_connection *) connections;
        ARRAY_TYPE(string) queue;
 };
 
index 4c5d5dd67c086b1ad9dc6799b767d48b7fc54237..30b04f4080511254c7cf90d359b9c11f3eb7ac95 100644 (file)
@@ -13,7 +13,7 @@ struct doveadm_settings {
        const char *dsync_alt_char;
        const char *dsync_remote_cmd;
 
-       ARRAY_DEFINE(plugin_envs, const char *);
+       ARRAY(const char *) plugin_envs;
 };
 
 extern const struct setting_parser_info doveadm_setting_parser_info;
index 60a92a50a4eccb721b9a7e718902f13a89dd395d..2e1cc8496e3da169f4b6d61ce9e9f61aafabdf9e 100644 (file)
@@ -38,7 +38,7 @@ struct top_context {
        pool_t prev_pool, cur_pool;
        /* id => struct top_line. */
        HASH_TABLE(char *, struct top_line *) sessions;
-       ARRAY_DEFINE(lines, struct top_line *);
+       ARRAY(struct top_line *) lines;
        int (*lines_sort)(struct top_line *const *, struct top_line *const *);
 
        unsigned int last_update_idx, user_idx;
index fe776722a1ff6186b1d8305819cba0de87812c2b..b2e50402080a734b7baf5c21b910c2611185342e 100644 (file)
@@ -18,8 +18,8 @@
 struct who_user {
        const char *username;
        const char *service;
-       ARRAY_DEFINE(ips, struct ip_addr);
-       ARRAY_DEFINE(pids, pid_t);
+       ARRAY(struct ip_addr) ips;
+       ARRAY(pid_t) pids;
        unsigned int connection_count;
 };
 
index 785cf499d2f3313d8e3ee430e1b9863100409287..e2a035e0db024b84b591995b7f1b6194d3051851 100644 (file)
@@ -28,7 +28,7 @@ const struct doveadm_print_vfuncs *doveadm_print_vfuncs_all[] = {
 
 int doveadm_exit_code = 0;
 
-static ARRAY_DEFINE(doveadm_cmds, struct doveadm_cmd);
+static ARRAY(struct doveadm_cmd) doveadm_cmds;
 
 static void failure_exit_callback(int *status)
 {
index 47c449a9a6f7f5aaae06317e1d6324cf56f67028..6a16bc61b0d22afeb3d742cbc60a13c169abf356 100644 (file)
@@ -38,7 +38,7 @@ struct dsync_mailbox_exporter {
        /* UID => struct dsync_mail_change */
        HASH_TABLE(uint32_t, struct dsync_mail_change *) changes;
        /* changes sorted by UID */
-       ARRAY_DEFINE(sorted_changes, struct dsync_mail_change *);
+       ARRAY(struct dsync_mail_change *) sorted_changes;
        unsigned int change_idx;
        uint32_t highest_changed_uid;
 
index d80cec159ecdd4e8abe2bf274a96af75388e8564..a5f10005ff5b089f0b14f9269401420e148bf80d 100644 (file)
@@ -56,17 +56,17 @@ struct dsync_mailbox_importer {
        HASH_TABLE_TYPE(dsync_uid_mail_change) local_changes;
 
        ARRAY_TYPE(seq_range) maybe_expunge_uids;
-       ARRAY_DEFINE(maybe_saves, struct dsync_mail_change *);
+       ARRAY(struct dsync_mail_change *) maybe_saves;
 
        /* GUID => struct importer_new_mail */
        HASH_TABLE_TYPE(guid_new_mail) import_guids;
        /* UID => struct importer_new_mail */
        HASH_TABLE_TYPE(uid_new_mail) import_uids;
 
-       ARRAY_DEFINE(newmails, struct importer_new_mail *);
+       ARRAY(struct importer_new_mail *) newmails;
        ARRAY_TYPE(uint32_t) wanted_uids;
 
-       ARRAY_DEFINE(mail_requests, struct dsync_mail_request);
+       ARRAY(struct dsync_mail_request) mail_requests;
        unsigned int mail_request_idx;
 
        uint32_t prev_uid, next_local_seq, local_uid_next;
index ccb6813bf57807445c8f407d20130972b1adda31..2a1e0eb92753bdf7bb176d415cefb4ac0d210b12 100644 (file)
@@ -10,7 +10,7 @@ struct dsync_mailbox_tree {
 
        unsigned int iter_count;
 
-       ARRAY_DEFINE(deletes, struct dsync_mailbox_delete);
+       ARRAY(struct dsync_mailbox_delete) deletes;
 
        /* guid_128_t => struct dsync_mailbox_node */
        HASH_TABLE(uint8_t *, struct dsync_mailbox_node *) name128_hash;
index 7c4d4060165189c361b96525947dfb889750787e..d430ef3e6e535cff027331d21283d64afcd912a1 100644 (file)
@@ -9,7 +9,7 @@
 struct dsync_mailbox_tree_bfs_iter {
        struct dsync_mailbox_tree *tree;
 
-       ARRAY_DEFINE(queue_arr, struct dsync_mailbox_node *);
+       ARRAY(struct dsync_mailbox_node *) queue_arr;
        struct aqueue *queue;
        struct dsync_mailbox_node *cur;
 };
@@ -18,7 +18,7 @@ struct dsync_mailbox_tree_sync_ctx {
        pool_t pool;
        struct dsync_mailbox_tree *local_tree, *remote_tree;
 
-       ARRAY_DEFINE(changes, struct dsync_mailbox_tree_sync_change);
+       ARRAY(struct dsync_mailbox_tree_sync_change) changes;
        unsigned int change_idx;
 };
 
index 93c68354cb3fbc8480a72551ec4a00d4aad94b3d..56f4f561875c2e3d82f3d21dc88e9fe4175dfe14 100644 (file)
@@ -45,8 +45,8 @@ struct item {
 struct dsync_slave_pipe {
        struct dsync_slave slave;
 
-       ARRAY_DEFINE(pools, pool_t);
-       ARRAY_DEFINE(item_queue, struct item);
+       ARRAY(pool_t) pools;
+       ARRAY(struct item) item_queue;
        struct dsync_slave_pipe *remote;
 
        pool_t pop_pool;
index 98e2bc14de8a845cdf67e41a88c9e05528ecf1d5..933eefdce41dd31c8e2ce4e5fb7ffb4b08ae34ff 100644 (file)
@@ -23,7 +23,7 @@ struct cmd_list_context {
        struct mail_namespace *ns;
        struct mailbox_list_iterate_context *list_iter;
 
-       ARRAY_DEFINE(ns_prefixes_listed, struct mail_namespace *);
+       ARRAY(struct mail_namespace *) ns_prefixes_listed;
 
        unsigned int lsub:1;
        unsigned int lsub_no_unsubscribed:1;
@@ -726,7 +726,7 @@ static void list_namespace_init(struct cmd_list_context *ctx)
        struct mail_namespace *ns = ctx->ns;
        const char *cur_ns_prefix, *cur_ref, *const *pat, *pattern;
        enum imap_match_result inbox_match;
-       ARRAY_DEFINE(used_patterns, const char *);
+       ARRAY(const char *) used_patterns;
        bool inboxcase;
 
        cur_ns_prefix = ns->prefix;
@@ -889,7 +889,7 @@ bool cmd_list_full(struct client_command_context *cmd, bool lsub)
        const struct imap_arg *args, *list_args;
        unsigned int arg_count;
        struct cmd_list_context *ctx;
-       ARRAY_DEFINE(patterns, const char *) = ARRAY_INIT;
+       ARRAY(const char *) patterns = ARRAY_INIT;
        const char *pattern, *const *patterns_strarr;
        string_t *str;
 
index d65e4edc34fe4db4df48a325a16e8467da4fea0a..a675a906f3d16798fd9de06e158c56a22295d540 100644 (file)
@@ -66,7 +66,7 @@ struct client_command_context {
        void *context;
 
        /* Module-specific contexts. */
-       ARRAY_DEFINE(module_contexts, union imap_module_context *);
+       ARRAY(union imap_module_context *) module_contexts;
 
        struct imap_parser *parser;
        enum client_command_state state;
@@ -126,7 +126,7 @@ struct client {
        /* SEARCHRES extension: Last saved SEARCH result */
        ARRAY_TYPE(seq_range) search_saved_uidset;
        /* SEARCH=CONTEXT extension: Searches that get updated */
-       ARRAY_DEFINE(search_updates, struct imap_search_update);
+       ARRAY(struct imap_search_update) search_updates;
        /* NOTIFY extension */
        struct imap_notify_context *notify_ctx;
        uint32_t notify_uidnext;
@@ -138,7 +138,7 @@ struct client {
        struct client_command_context *mailbox_change_lock;
 
        /* Module-specific contexts. */
-       ARRAY_DEFINE(module_contexts, union imap_module_context *);
+       ARRAY(union imap_module_context *) module_contexts;
 
        /* syncing marks this TRUE when it sees \Deleted flags. this is by
           EXPUNGE for Outlook-workaround. */
index 0a4430ef75ccad5f215b6491e1dda6b9915c2e1d..760ad39b3fd5a8ffbc2d8b71481a24172f790b57 100644 (file)
@@ -198,7 +198,7 @@ bool client_parse_mail_flags(struct client_command_context *cmd,
 {
        const char *atom;
        enum mail_flags flag;
-       ARRAY_DEFINE(keywords, const char *);
+       ARRAY(const char *) keywords;
 
        *flags_r = 0;
        *keywords_r = NULL;
index b851f3e8fd05d2488c0e4d88ce8e8a9982c35b14..9c1d4cfd5af25e5b6e83ba2660081ab1a54c5d2b 100644 (file)
@@ -70,7 +70,7 @@ static const struct command imap_ext_commands[] = {
 
 ARRAY_TYPE(command) imap_commands;
 static bool commands_unsorted;
-static ARRAY_DEFINE(command_hooks, struct command_hook);
+static ARRAY(struct command_hook) command_hooks;
 
 void command_register(const char *name, command_func_t *func,
                      enum command_flags flags)
index 9d82e4cd1d1e8d7270f5d6ed68cb1e097bdb3b2c..c1fbc5f9812d335ba3f38f023df91a971ffc6c73 100644 (file)
@@ -24,7 +24,7 @@
 #define ENVELOPE_NIL_REPLY \
        "(NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL)"
 
-static ARRAY_DEFINE(fetch_handlers, struct imap_fetch_handler);
+static ARRAY(struct imap_fetch_handler) fetch_handlers;
 
 static int imap_fetch_handler_cmp(const struct imap_fetch_handler *h1,
                                  const struct imap_fetch_handler *h2)
index a93202d7d47ab1a4e391ed4104aa4a0724e8f163..448032b9681d6d6329037a9dd35aae49b0bb3f28 100644 (file)
@@ -76,7 +76,7 @@ struct imap_fetch_context {
        enum mail_fetch_field fetch_data;
        ARRAY_TYPE(const_string) all_headers;
 
-       ARRAY_DEFINE(handlers, struct imap_fetch_context_handler);
+       ARRAY(struct imap_fetch_context_handler) handlers;
        unsigned int buffered_handlers_count;
 
        ARRAY_TYPE(keywords) tmp_keywords;
index ac0b3cfd9fc12bf850658222ecc8a2aef48347e1..eef89982173f58822cb5c3c9cfc2566644e9c7a9 100644 (file)
@@ -33,7 +33,7 @@ struct imap_notify_namespace {
        struct mail_namespace *ns;
 
        struct mailbox_list_notify *notify;
-       ARRAY_DEFINE(mailboxes, struct imap_notify_mailboxes);
+       ARRAY(struct imap_notify_mailboxes) mailboxes;
 };
 
 struct imap_notify_context {
@@ -41,7 +41,7 @@ struct imap_notify_context {
        struct client *client;
        const char *error;
 
-       ARRAY_DEFINE(namespaces, struct imap_notify_namespace);
+       ARRAY(struct imap_notify_namespace) namespaces;
        enum imap_notify_event selected_events;
        enum imap_notify_event global_used_events;
        unsigned int global_max_mailbox_names;
index d6dae1d28ed29b6665e3267522cd65d326372dd9..42943dd8d534d9c3339f81508e38ade40a20517e 100644 (file)
@@ -37,7 +37,7 @@ struct imap_search_context {
        ARRAY_TYPE(seq_range) result;
        unsigned int result_count;
 
-       ARRAY_DEFINE(relevancy_scores, float);
+       ARRAY(float) relevancy_scores;
        float min_relevancy, max_relevancy;
 
        uint64_t highest_seen_modseq;
index 1d5076bab88152309b0b165ba68d57939c20472c..9239040ff9fca4100423ba957f86e5dc9dd78905 100644 (file)
@@ -32,7 +32,7 @@ struct worker_connection {
        struct ostream *output;
 
        char *request_username;
-       ARRAY_DEFINE(request_contexts, void *);
+       ARRAY(void *) request_contexts;
        struct aqueue *request_queue;
 
        unsigned int process_limit;
index 6c33d48bddc1528657d1a901164dd6babed743d8..b9354062f6272a5ff92ac7bbc87c57a79f0b1940 100644 (file)
@@ -27,7 +27,7 @@ struct ipc_connection {
        unsigned int cmd_tag_counter;
 
        /* running commands */
-       ARRAY_DEFINE(cmds, struct ipc_connection_cmd *);
+       ARRAY(struct ipc_connection_cmd *) cmds;
 
        unsigned int version_received:1;
        unsigned int handshake_received:1;
index e61d1451984521ffe8a0ab05885034e8dd52966b..eeb47d3ac620ac93d99f3de676806378db0f668c 100644 (file)
@@ -13,7 +13,7 @@ struct ipc_group_cmd {
        char *first_error;
 };
 
-static ARRAY_DEFINE(ipc_groups, struct ipc_group *);
+static ARRAY(struct ipc_group *) ipc_groups;
 
 struct ipc_group *ipc_group_alloc(int listen_fd)
 {
index a585387888668c8fd4e136ee0f59eead12d1fc65..90df8fcc4f04767271e4a064e1ab2bbbdae032fe 100644 (file)
@@ -17,7 +17,7 @@ struct auth_server_connection {
        unsigned int connect_uid;
        char *cookie;
 
-       ARRAY_DEFINE(available_auth_mechs, struct auth_mech_desc);
+       ARRAY(struct auth_mech_desc) available_auth_mechs;
 
        HASH_TABLE(unsigned int, struct auth_client_request *) requests;
 
index b73286f3b49a16f406167913187adc2cf3d3ecef..f765adc8e6670a985901e93362edbf0509fcc099 100644 (file)
@@ -60,8 +60,8 @@ struct memcached_ascii_dict {
        struct timeout *to;
        struct memcached_ascii_connection conn;
 
-       ARRAY_DEFINE(input_states, enum memcached_ascii_input_state);
-       ARRAY_DEFINE(replies, struct memcached_ascii_dict_reply);
+       ARRAY(enum memcached_ascii_input_state) input_states;
+       ARRAY(struct memcached_ascii_dict_reply) replies;
 };
 
 static struct connection_list *memcached_ascii_connections;
index d93de080d249a26edf58cc120cf75e432a5ebdf3..19558bc2ce85020c99d500e52aae9257b14f6b4c 100644 (file)
@@ -51,8 +51,8 @@ struct redis_dict {
        struct ioloop *ioloop;
        struct redis_connection conn;
 
-       ARRAY_DEFINE(input_states, enum redis_input_state);
-       ARRAY_DEFINE(replies, struct redis_dict_reply);
+       ARRAY(enum redis_input_state) input_states;
+       ARRAY(struct redis_dict_reply) replies;
 
        bool connected;
        bool transaction_open;
index 94e2a83b867a39876ee9b223bf6bef223d27f0c8..83b25c031012be6d9e7d852a4a454603d0fc8e64 100644 (file)
@@ -24,7 +24,7 @@ struct setting_parser_ctx {
        enum section_type type;
 
        struct dict_sql_map cur_map;
-       ARRAY_DEFINE(cur_fields, struct dict_sql_map_field);
+       ARRAY(struct dict_sql_map_field) cur_fields;
 };
 
 #define DEF_STR(name) DEF_STRUCT_STR(name, dict_sql_map)
index d173a2fba27605ee37399d191562a852e3427835..81a1a5e32cad2c6f339fe6e43331ea5d62779271 100644 (file)
@@ -16,7 +16,7 @@ struct dict_sql_settings {
        const char *connect;
 
        unsigned int max_field_count;
-       ARRAY_DEFINE(maps, struct dict_sql_map);
+       ARRAY(struct dict_sql_map) maps;
 };
 
 struct dict_sql_settings *dict_sql_settings_read(pool_t pool, const char *path);
index 1629b3a2a2da13c9328d5cd0dbbbf9e1e26a43ad..de95edf9eb44a1b6e9743cb14449b75e2072156e 100644 (file)
@@ -559,7 +559,7 @@ struct dict_sql_build_query_field {
 struct dict_sql_build_query {
        struct sql_dict *dict;
 
-       ARRAY_DEFINE(fields, struct dict_sql_build_query_field);
+       ARRAY(struct dict_sql_build_query_field) fields;
        const ARRAY_TYPE(const_string) *extra_values;
        char key1;
        bool inc;
index fa2c183d8c378d80894cb470f7266713af37b0fa..c07cc7660267f00b6267ff0126ba2d672f5118f8 100644 (file)
@@ -22,7 +22,7 @@ struct dict_transaction_memory_change {
 struct dict_transaction_memory_context {
        struct dict_transaction_context ctx;
        pool_t pool;
-       ARRAY_DEFINE(changes, struct dict_transaction_memory_change);
+       ARRAY(struct dict_transaction_memory_change) changes;
 };
 
 void dict_transaction_memory_init(struct dict_transaction_memory_context *ctx,
index 653a4b3ca2e219db93caa640d8688038999f5daf..3c2c11be7a9e106fc17089b39cfafb5b612b0baa 100644 (file)
@@ -6,7 +6,7 @@
 #include "dict-sql.h"
 #include "dict-private.h"
 
-static ARRAY_DEFINE(dict_drivers, struct dict *);
+static ARRAY(struct dict *) dict_drivers;
 static struct dict_iterate_context dict_iter_unsupported;
 
 static struct dict *dict_driver_lookup(const char *name)
index c940cfdd90d28f8b96ae0868d78877b0d3645535..995a7d5aae2d10db14fe349b8eb23ff74c642b33 100644 (file)
@@ -18,7 +18,7 @@ struct imapc_client {
        imapc_untagged_callback_t *untagged_callback;
        void *untagged_context;
 
-       ARRAY_DEFINE(conns, struct imapc_client_connection *);
+       ARRAY(struct imapc_client_connection *) conns;
 
        struct ioloop *ioloop;
 };
index 9023fa79c35d5b444a12620ec3b9ebf7d9e041ad..fa151bf6d47c1501a90594af375ca15780ff2e44 100644 (file)
@@ -53,7 +53,7 @@ struct imapc_command {
           executed */
        struct imapc_client_mailbox *box;
 
-       ARRAY_DEFINE(streams, struct imapc_command_stream);
+       ARRAY(struct imapc_command_stream) streams;
 
        imapc_command_callback_t *callback;
        void *context;
@@ -113,7 +113,7 @@ struct imapc_connection {
        struct ip_addr *ips;
 
        struct imapc_connection_literal literal;
-       ARRAY_DEFINE(literal_files, struct imapc_arg_file);
+       ARRAY(struct imapc_arg_file) literal_files;
 
        unsigned int idling:1;
        unsigned int idle_stopping:1;
index 39bc9bec15de743d29713266d4c08eccb7bb0f12..aef24e5e4cca13996cf20bb9b95e87e153705c5b 100644 (file)
@@ -16,7 +16,7 @@ struct mail_cache_copy_context {
        struct mail_cache *cache;
 
        buffer_t *buffer, *field_seen;
-       ARRAY_DEFINE(bitmask_pos, unsigned int);
+       ARRAY(unsigned int) bitmask_pos;
        uint32_t *field_file_map;
 
        uint8_t field_seen_value;
index 3828fca3e10b3df6c560f17bfd734e0ed2bbd522..5efc9dbf375deec2ece18c22d24aae2c6d6449e7 100644 (file)
@@ -418,7 +418,7 @@ struct header_lookup_line {
 
 struct header_lookup_context {
        struct mail_cache_view *view;
-       ARRAY_DEFINE(lines, struct header_lookup_line);
+       ARRAY(struct header_lookup_line) lines;
 };
 
 enum {
index 6184698b8595c1b2a4644c02e78b5c8d210adc40..bd836a5305117967a333fc7352725e517bc3bd70 100644 (file)
@@ -37,11 +37,11 @@ struct mail_cache_transaction_ctx {
        uint32_t first_new_seq;
 
        buffer_t *cache_data;
-       ARRAY_DEFINE(cache_data_seq, uint32_t);
+       ARRAY(uint32_t) cache_data_seq;
        uint32_t prev_seq;
        size_t prev_pos;
 
-        ARRAY_DEFINE(reservations, struct mail_cache_reservation);
+        ARRAY(struct mail_cache_reservation) reservations;
        uint32_t reserved_space_offset, reserved_space;
        uint32_t last_grow_size;
 
index a5fb5318ac838f3e10608569fdd59266cf18b733..23d75037c41d6b29cda36ddb3a5259cca08edcc1 100644 (file)
@@ -26,7 +26,7 @@ struct metadata_modseqs {
 
 struct mail_index_map_modseq {
        /* indexes use enum modseq_metadata_idx */
-       ARRAY_DEFINE(metadata_modseqs, struct metadata_modseqs);
+       ARRAY(struct metadata_modseqs) metadata_modseqs;
 };
 
 struct mail_index_modseq_sync {
index 8aa2ef1bfe54b7cc1b9a0d9da867b7fc1fef0ad2..c39fd66e0377069cb5ddbd149c83a30e245bd0fa 100644 (file)
@@ -115,7 +115,7 @@ struct mail_index_registered_ext {
 };
 
 struct mail_index_record_map {
-       ARRAY_DEFINE(maps, struct mail_index_map *);
+       ARRAY(struct mail_index_map *) maps;
 
        void *mmap_base;
        size_t mmap_size, mmap_used_size;
@@ -142,10 +142,10 @@ struct mail_index_map {
        buffer_t *hdr_copy_buf;
 
        pool_t extension_pool;
-       ARRAY_DEFINE(extensions, struct mail_index_ext);
-       ARRAY_DEFINE(ext_id_map, uint32_t); /* index -> file */
+       ARRAY(struct mail_index_ext) extensions;
+       ARRAY(uint32_t) ext_id_map; /* index -> file */
 
-       ARRAY_DEFINE(keyword_idx_map, unsigned int); /* file -> index */
+       ARRAY(unsigned int) keyword_idx_map; /* file -> index */
 
        struct mail_index_record_map *rec_map;
 
@@ -175,12 +175,12 @@ struct mail_index {
        char *gid_origin;
 
        pool_t extension_pool;
-       ARRAY_DEFINE(extensions, struct mail_index_registered_ext);
+       ARRAY(struct mail_index_registered_ext) extensions;
 
        uint32_t ext_hdr_init_id;
        void *ext_hdr_init_data;
 
-       ARRAY_DEFINE(sync_lost_handlers, mail_index_sync_lost_handler_t *);
+       ARRAY(mail_index_sync_lost_handler_t *) sync_lost_handlers;
 
        char *filepath;
        int fd;
@@ -223,7 +223,7 @@ struct mail_index {
        unsigned int view_count;
 
        /* Module-specific contexts. */
-       ARRAY_DEFINE(module_contexts, union mail_index_module_context *);
+       ARRAY(union mail_index_module_context *) module_contexts;
 
        char *error;
        unsigned int nodiskspace:1;
index 57599618baa3c9431eb3d3a9cbb4f5e0f98ecd4d..2062c1ca3459053b19b555965ae7226532ff9c0b 100644 (file)
@@ -31,7 +31,7 @@ struct mail_index_strmap_view {
        struct mail_index_view *view;
 
        ARRAY_TYPE(mail_index_strmap_rec) recs;
-       ARRAY_DEFINE(recs_crc32, uint32_t);
+       ARRAY(uint32_t) recs_crc32;
        struct hash2_table *hash;
 
        mail_index_strmap_key_cmp_t *key_compare;
index 8288ca350f5818948db110bfacf5701ce0acdff7..5ef8293208faeb3def548fe943643cdda1862da3 100644 (file)
@@ -31,8 +31,8 @@ struct mail_index_sync_map_ctx {
        uint32_t ext_intro_seq;
        uoff_t ext_intro_offset, ext_intro_end_offset;
 
-       ARRAY_DEFINE(expunge_handlers, struct mail_index_expunge_handler);
-       ARRAY_DEFINE(extra_contexts, void *);
+       ARRAY(struct mail_index_expunge_handler) expunge_handlers;
+       ARRAY(void *) extra_contexts;
        buffer_t *unknown_extensions;
 
         enum mail_index_sync_handler_type type;
index 446e49d636b02e77c1c9657bcb314c698a9a7b00..cc9328ca0ed6d6956dafda041c24a47de82540d3 100644 (file)
@@ -21,7 +21,7 @@ struct mail_index_sync_ctx {
        const struct mail_transaction_header *hdr;
        const void *data;
 
-       ARRAY_DEFINE(sync_list, struct mail_index_sync_list);
+       ARRAY(struct mail_index_sync_list) sync_list;
        uint32_t next_uid;
        uint32_t last_tail_seq, last_tail_offset;
 
index b7903676768095ae6aaa7e55d8e8514d9cdcd598..afa9e9c00f38691e63f5d82d05535e79caa65946 100644 (file)
@@ -23,7 +23,7 @@ log_append_buffer(struct mail_index_export_context *ctx,
 static void log_append_flag_updates(struct mail_index_export_context *ctx,
                                    struct mail_index_transaction *t)
 {
-       ARRAY_DEFINE(log_updates, struct mail_transaction_flag_update);
+       ARRAY(struct mail_transaction_flag_update) log_updates;
        const struct mail_index_flag_update *updates;
        struct mail_transaction_flag_update *log_update;
        unsigned int i, count;
index 2a57bec079fa88d87affb13581fa58443e76be86..9816a33e3e603740d39b5d97e28ec15ea7d69786 100644 (file)
@@ -45,15 +45,15 @@ struct mail_index_transaction {
 
        /* NOTE: If you add anything new, remember to update
           mail_index_transaction_reset_v() to reset it. */
-        ARRAY_DEFINE(appends, struct mail_index_record);
+        ARRAY(struct mail_index_record) appends;
        uint32_t first_new_seq, last_new_seq;
        uint32_t highest_append_uid;
        /* lowest/highest sequence that updates flags/keywords */
        uint32_t min_flagupdate_seq, max_flagupdate_seq;
 
-       ARRAY_DEFINE(modseq_updates, struct mail_transaction_modseq_update);
-       ARRAY_DEFINE(expunges, struct mail_transaction_expunge_guid);
-       ARRAY_DEFINE(updates, struct mail_index_flag_update);
+       ARRAY(struct mail_transaction_modseq_update) modseq_updates;
+       ARRAY(struct mail_transaction_expunge_guid) expunges;
+       ARRAY(struct mail_index_flag_update) updates;
        size_t last_update_idx;
 
        unsigned char pre_hdr_change[sizeof(struct mail_index_header)];
@@ -61,25 +61,22 @@ struct mail_index_transaction {
        unsigned char post_hdr_change[sizeof(struct mail_index_header)];
        unsigned char post_hdr_mask[sizeof(struct mail_index_header)];
 
-       ARRAY_DEFINE(ext_hdr_updates,
-                    struct mail_index_transaction_ext_hdr_update);
+       ARRAY(struct mail_index_transaction_ext_hdr_update) ext_hdr_updates;
        ARRAY_TYPE(seq_array_array) ext_rec_updates;
        ARRAY_TYPE(seq_array_array) ext_rec_atomics;
-       ARRAY_DEFINE(ext_resizes, struct mail_transaction_ext_intro);
-       ARRAY_DEFINE(ext_resets, struct mail_transaction_ext_reset);
-       ARRAY_DEFINE(ext_reset_ids, uint32_t);
-       ARRAY_DEFINE(ext_reset_atomic, uint32_t);
+       ARRAY(struct mail_transaction_ext_intro) ext_resizes;
+       ARRAY(struct mail_transaction_ext_reset) ext_resets;
+       ARRAY(uint32_t) ext_reset_ids;
+       ARRAY(uint32_t) ext_reset_atomic;
 
-       ARRAY_DEFINE(keyword_updates,
-                    struct mail_index_transaction_keyword_update);
+       ARRAY(struct mail_index_transaction_keyword_update) keyword_updates;
 
        uint64_t min_highest_modseq;
        uint64_t max_modseq;
        ARRAY_TYPE(seq_range) *conflict_seqs;
 
        /* Module-specific contexts. */
-       ARRAY_DEFINE(module_contexts,
-                    union mail_index_transaction_module_context *);
+       ARRAY(union mail_index_transaction_module_context *) module_contexts;
 
        unsigned int no_appends:1;
 
index 71841df5066463bbcf00f8816b79b511c084f269..8b410032eb5c76f4a299e91587f7240b6e67da88 100644 (file)
@@ -22,7 +22,7 @@ struct mail_index_view_transaction {
        unsigned int record_size;
        unsigned int recs_count;
        void *recs;
-       ARRAY_DEFINE(all_recs, void *);
+       ARRAY(void *) all_recs;
 };
 
 static void tview_close(struct mail_index_view *view)
index 7a9bef5ebb0aee6f7c44fbec41b502a97957c81a..d9d26ac29549a7108f9459644fa6ec8f79a305ca 100644 (file)
@@ -57,7 +57,7 @@ struct mail_index_view {
        struct mail_index_map *map;
        /* All mappings where we have returned records. They need to be kept
           valid until view is synchronized. */
-       ARRAY_DEFINE(map_refs, struct mail_index_map *);
+       ARRAY(struct mail_index_map *) map_refs;
 
        /* expunge <= head */
        uint32_t log_file_expunge_seq, log_file_head_seq;
@@ -67,7 +67,7 @@ struct mail_index_view {
        ARRAY_TYPE(view_log_sync_area) syncs_hidden;
 
        /* Module-specific contexts. */
-       ARRAY_DEFINE(module_contexts, union mail_index_view_module_context *);
+       ARRAY(union mail_index_view_module_context *) module_contexts;
 
        int transactions;
 
index 86a6cefc912fc349945c4f177207abaf5a58f7ed..b35d25adceebb159f88191e4454bb112308b29af 100644 (file)
@@ -15,7 +15,7 @@ struct mail_transaction_log_view {
        /* a list of log files we've referenced. we have to keep this list
           explicitly because more files may be added into the linked list
           at any time. */
-       ARRAY_DEFINE(file_refs, struct mail_transaction_log_file *);
+       ARRAY(struct mail_transaction_log_file *) file_refs;
         struct mail_transaction_log_file *cur, *head, *tail;
        uoff_t cur_offset;
 
index 916f5807f3b7d36f3b0e5172c54e45794a01296e..d3336db8fb61b1ece4576f06773238a870439329 100644 (file)
@@ -62,7 +62,7 @@ struct lmtp_client {
        void *finish_context;
 
        const char *data_header;
-       ARRAY_DEFINE(recipients, struct lmtp_rcpt);
+       ARRAY(struct lmtp_rcpt) recipients;
        unsigned int rcpt_next_receive_idx;
        unsigned int rcpt_next_data_idx;
        unsigned int rcpt_next_send_idx;
index 2289d94a10f18287ea12dc9a647b6aa818928ddd..abd7f79dd3e89cf097668618725667d294363bd5 100644 (file)
@@ -13,7 +13,7 @@ struct mail_deliver_session {
        pool_t pool;
 
        /* List of INBOX GUIDs where this mail has already been saved to */
-       ARRAY_DEFINE(inbox_guids, guid_128_t);
+       ARRAY(guid_128_t) inbox_guids;
 };
 
 struct mail_deliver_context {
index 2aa1ba5bde766cf971c94b7b16a4c5c91598af21..7a6cb3c1438b500e0b193cb8ea7a98ba5cbd0b76 100644 (file)
@@ -14,7 +14,7 @@ struct istream_attachment_connector {
        uoff_t msg_size;
 
        uoff_t encoded_offset;
-       ARRAY_DEFINE(streams, struct istream *);
+       ARRAY(struct istream *) streams;
 };
 
 struct istream_attachment_connector *
index 33549e58d39fd67fcb7b3b1c1937bd862df23a20..8211d56354dc2a5ac1b6b9e657f0e5c3af1649d0 100644 (file)
@@ -26,7 +26,7 @@ struct header_filter_istream {
        uoff_t last_lf_offset;
 
        unsigned int cur_line, parsed_lines;
-       ARRAY_DEFINE(match_change_lines, unsigned int);
+       ARRAY(unsigned int) match_change_lines;
 
        unsigned int header_read:1;
        unsigned int seen_eoh:1;
index b0bcb6c6827f63dcce73222aaa3e77c40834b347..e31dc02c6012caa2ac9d754335228a75de1f5b19 100644 (file)
@@ -41,7 +41,7 @@ int rfc2231_parse(struct rfc822_parser_context *ctx,
                  const char *const **result_r)
 {
        ARRAY_TYPE(const_string) result;
-       ARRAY_DEFINE(rfc2231_params_arr, struct rfc2231_parameter);
+       ARRAY(struct rfc2231_parameter) rfc2231_params_arr;
        struct rfc2231_parameter rfc2231_param;
        const struct rfc2231_parameter *rfc2231_params;
        const char *key, *value, *p, *p2;
index 370451301c32345c3928e8b7e3185169d2473b6a..6cd31220a6370197bd7415cd054d6c45336b2367 100644 (file)
@@ -67,7 +67,7 @@ struct attachment {
 };
 
 static buffer_t *attachment_data;
-static ARRAY_DEFINE(attachments, struct attachment);
+static ARRAY(struct attachment) attachments;
 
 static int test_open_temp_fd(void *context ATTR_UNUSED)
 {
index 14ee0bae5b9651d2a646068f8610cc17093f35f2..acbb1c2e418abed0cd42d4d4123ce76bb2b3eb20 100644 (file)
@@ -24,7 +24,7 @@ struct anvil_client {
        struct timeout *to_reconnect;
        time_t last_reconnect;
 
-       ARRAY_DEFINE(queries_arr, struct anvil_query);
+       ARRAY(struct anvil_query) queries_arr;
        struct aqueue *queries;
 
        bool (*reconnect_callback)(void);
index 6cc86dd2cd3d0536be75a34910aef9c4b3aa6190..eda8dd994f1b7796004535c8106dd823d0abd442 100644 (file)
@@ -26,7 +26,7 @@ struct ipc_client {
        struct timeout *to;
        struct istream *input;
        struct ostream *output;
-       ARRAY_DEFINE(cmds, struct ipc_client_cmd);
+       ARRAY(struct ipc_client_cmd) cmds;
 };
 
 static void ipc_client_disconnect(struct ipc_client *client);
index e05af0123871e8cabf3ac165d0ffe83a7f222d8e..a6150c9454e79753305f3c2604ab312b6f4545c9 100644 (file)
@@ -17,7 +17,7 @@ struct master_instance_list {
        pool_t pool;
        const char *path;
 
-       ARRAY_DEFINE(instances, struct master_instance);
+       ARRAY(struct master_instance) instances;
 
        unsigned int locked:1;
        unsigned int config_paths_changed:1;
index 3da549b5473b463dfef141a2ccfe9427f40d4cd2..4cc9751c62c97b89b0c605b17e03349ec50552d7 100644 (file)
@@ -331,7 +331,7 @@ int master_service_settings_read(struct master_service *service,
                                 struct master_service_settings_output *output_r,
                                 const char **error_r)
 {
-       ARRAY_DEFINE(all_roots, const struct setting_parser_info *);
+       ARRAY(const struct setting_parser_info *) all_roots;
        const struct setting_parser_info *tmp_root;
        struct setting_parser_context *parser;
        struct istream *istream;
index 0e07d80c7b633cb38264f134704ad597997ab577..3b378fe7720bbb57e16bfa65e40bf816570dc3aa 100644 (file)
@@ -17,7 +17,7 @@
 struct mountpoint_list {
        pool_t pool;
        const char *perm_path, *state_path;
-       ARRAY_DEFINE(recs, struct mountpoint_list_rec *);
+       ARRAY(struct mountpoint_list_rec *) recs;
        struct stat load_st;
        bool load_failed;
 };
index 6187db7c426df0978b116eddf5225f2ef9ad438b..134d12ab643f3b5fe9cc502bd5b2caf8e7d2d0ce 100644 (file)
@@ -1523,7 +1523,7 @@ info_update_real(pool_t pool, struct setting_parser_info *parent,
                 const struct dynamic_settings_parser *parsers)
 {
        /* @UNSAFE */
-       ARRAY_DEFINE(defines, struct setting_define);
+       ARRAY(struct setting_define) defines;
        ARRAY_TYPE(dynamic_settings_parser) dynamic_parsers;
        struct dynamic_settings_parser new_parser;
        const struct setting_define *cur_defines;
index 5008bd9265eddd0196733fa27a521199b2d0dbf3..0f928d507a4dbfb494c64cce45c0d6ccbc0e9ea5 100644 (file)
@@ -45,7 +45,7 @@ struct pgsql_result {
        const char **fields;
        const char **values;
 
-       ARRAY_DEFINE(binary_values, struct pgsql_binary_value);
+       ARRAY(struct pgsql_binary_value) binary_values;
 
        sql_query_callback_t *callback;
        void *context;
index f471a8d49ac506176c5ec65821d9dbaf77dbaef6..12d9d4b05eee57b4e12a208fac0e1a200b583f06 100644 (file)
@@ -28,9 +28,9 @@ struct sqlpool_db {
        const struct sql_db *driver;
        unsigned int connection_limit;
 
-       ARRAY_DEFINE(hosts, struct sqlpool_host);
+       ARRAY(struct sqlpool_host) hosts;
        /* all connections from all hosts */
-       ARRAY_DEFINE(all_connections, struct sqlpool_connection);
+       ARRAY(struct sqlpool_connection) all_connections;
        /* index of last connection in all_connections that was used to
           send a query. */
        unsigned int last_query_conn_idx;
index 1b9f2435dfe8fb1f6d827c2328d823aeb1df0030..f59d47cfda94a9ff7fa11f182431ec9eba225dda 100644 (file)
@@ -83,7 +83,7 @@ struct sql_db {
        enum sql_db_flags flags;
 
        struct sql_db_vfuncs v;
-       ARRAY_DEFINE(module_contexts, union sql_db_module_context *);
+       ARRAY(union sql_db_module_context *) module_contexts;
 
        void (*state_change_callback)(struct sql_db *db,
                                      enum sql_db_state prev_state,
index bb7b81d0af105362fce2b6f2a2b5dce826491734..cecc6839e3cac6e22481ef3dba61e51f05b19fbd 100644 (file)
@@ -113,7 +113,7 @@ struct dbox_file {
 
        /* Metadata for the currently seeked metadata block. */
        pool_t metadata_pool;
-       ARRAY_DEFINE(metadata, const char *);
+       ARRAY(const char *) metadata;
        uoff_t metadata_read_offset;
 
        unsigned int appending:1;
index 6ac13e099545002927392c06a6b792b77d71f273..3276d3d5b0dda7e5fae40358baef73248984de48 100644 (file)
@@ -37,9 +37,9 @@ struct mdbox_map_append_context {
        struct mdbox_map_atomic_context *atomic;
        struct mail_index_transaction *trans;
 
-       ARRAY_DEFINE(file_appends, struct dbox_file_append_context *);
-       ARRAY_DEFINE(files, struct dbox_file *);
-       ARRAY_DEFINE(appends, struct mdbox_map_append);
+       ARRAY(struct dbox_file_append_context *) file_appends;
+       ARRAY(struct dbox_file *) files;
+       ARRAY(struct mdbox_map_append) appends;
 
        uint32_t first_new_file_id;
 
index 015166943e2d033209c72e4aeec2b895f98a6f8f..1a5c6815d19fd63ba2544a8f698a84e9f039b857 100644 (file)
@@ -39,7 +39,7 @@ struct mdbox_save_context {
        struct mdbox_map_atomic_context *atomic;
        struct mdbox_map_transaction_context *map_trans;
 
-       ARRAY_DEFINE(mails, struct dbox_save_mail);
+       ARRAY(struct dbox_save_mail) mails;
 };
 
 static struct dbox_file *
index 0f94c687d99dd9d7fb9d46f9e9a6a6c207bef1ad..889ee247e6f208f79b91ea9c998f4f128f2291d1 100644 (file)
@@ -46,7 +46,7 @@ struct mdbox_storage_rebuild_context {
 
        struct mdbox_map_mail_index_header orig_map_hdr;
        HASH_TABLE(uint8_t *, struct mdbox_rebuild_msg *) guid_hash;
-       ARRAY_DEFINE(msgs, struct mdbox_rebuild_msg *);
+       ARRAY(struct mdbox_rebuild_msg *) msgs;
        ARRAY_TYPE(seq_range) seen_file_ids;
 
        uint32_t rebuild_count;
index cb0d2e34e5963e7a28a0130ecbcaba8997d82385..3afa0f936e42fcc32ec9eb769e393d0086efb2b3 100644 (file)
@@ -27,7 +27,7 @@ struct mdbox_storage {
        const char *storage_dir, *alt_storage_dir;
        struct mdbox_map *map;
 
-       ARRAY_DEFINE(open_files, struct mdbox_file *);
+       ARRAY(struct mdbox_file *) open_files;
        struct timeout *to_close_unused_files;
 
        ARRAY_TYPE(uint32_t) move_to_alt_map_uids;
index 1a6099a86fc10aebc2c5dc5b9e0658a8d1834ffb..3d649a186e567f8292985d38ce03fb03f1feb9cc 100644 (file)
@@ -28,7 +28,7 @@ struct sdbox_save_context {
        struct dbox_file_append_context *append_ctx;
 
        uint32_t first_saved_seq;
-       ARRAY_DEFINE(files, struct dbox_file *);
+       ARRAY(struct dbox_file *) files;
 };
 
 struct dbox_file *
index 9ad038fed02983817fa19df027b245b0532ab45e..50de1c0c7b1b5a33f68c236602cd0fdd461fd2c7 100644 (file)
@@ -46,7 +46,7 @@ struct imapc_storage {
        struct mailbox_status *cur_status;
        unsigned int reopen_count;
 
-       ARRAY_DEFINE(untagged_callbacks, struct imapc_storage_event_callback);
+       ARRAY(struct imapc_storage_event_callback) untagged_callbacks;
 };
 
 struct imapc_mail_cache {
@@ -66,10 +66,10 @@ struct imapc_mailbox {
        struct mail_index_view *sync_view, *delayed_sync_view;
        struct timeout *to_idle_check, *to_idle_delay;
 
-       ARRAY_DEFINE(fetch_mails, struct imapc_mail *);
+       ARRAY(struct imapc_mail *) fetch_mails;
 
-       ARRAY_DEFINE(untagged_callbacks, struct imapc_mailbox_event_callback);
-       ARRAY_DEFINE(resp_text_callbacks, struct imapc_mailbox_event_callback);
+       ARRAY(struct imapc_mailbox_event_callback) untagged_callbacks;
+       ARRAY(struct imapc_mailbox_event_callback) resp_text_callbacks;
 
        enum mail_flags permanent_flags;
 
index ee7ab9da6c5b6a38401b590028a7afb2aac4975c..1101547183bb5bf9c8c1d8ab6e338c1ee30048be 100644 (file)
@@ -32,7 +32,7 @@ struct binary_ctx {
        struct mail *mail;
        struct istream *input;
        bool has_nuls, converted;
-       ARRAY_DEFINE(blocks, struct binary_block);
+       ARRAY(struct binary_block) blocks;
 
        uoff_t copy_start_offset;
 };
index 7ad39329e1fa2761d1dbe313dc17825bdd194f7b..187bb72f0f79579bee4786800654cced5579870d 100644 (file)
@@ -544,7 +544,7 @@ static bool skip_header(const unsigned char **data, size_t len)
 static const char *const *
 index_mail_get_parsed_header(struct index_mail *mail, unsigned int field_idx)
 {
-       ARRAY_DEFINE(header_values, const char *);
+       ARRAY(const char *) header_values;
         const struct index_mail_line *lines;
        const unsigned char *header, *value_start, *value_end;
        const unsigned int *line_idx;
@@ -591,7 +591,7 @@ index_mail_get_raw_headers(struct index_mail *mail, const char *field,
        string_t *dest;
        size_t i, len;
        int ret;
-       ARRAY_DEFINE(header_values, const char *);
+       ARRAY(const char *) header_values;
 
        i_assert(field != NULL);
 
index f594ebc74911bb83ecf13b538159be2c83fd14e7..a719df42ab974a072df5e9ed2ea7b0bbdc386cf2 100644 (file)
@@ -136,13 +136,13 @@ struct index_mail {
        /* per-mail variables, here for performance reasons: */
        uint32_t header_seq;
        string_t *header_data;
-       ARRAY_DEFINE(header_lines, struct index_mail_line);
+       ARRAY(struct index_mail_line) header_lines;
 #define HEADER_MATCH_FLAG_FOUND 1
 #define HEADER_MATCH_SKIP_COUNT 2
 #define HEADER_MATCH_USABLE(mail, num) \
        ((num & ~1) == (mail)->header_match_value)
-       ARRAY_DEFINE(header_match, uint8_t);
-       ARRAY_DEFINE(header_match_lines, unsigned int);
+       ARRAY(uint8_t) header_match;
+       ARRAY(unsigned int) header_match_lines;
        uint8_t header_match_value;
 
        unsigned int pop3_state_set:1;
index 4e2cfa30d81dad393b42379850bc9b233efc0b3f..44999d1c5f4190395879f9957ab3a1b0f3ca007e 100644 (file)
@@ -20,7 +20,7 @@ struct index_search_context {
        struct index_mail *cur_imail;
        struct mail_thread_context *thread_ctx;
 
-       ARRAY_DEFINE(mails, struct mail *);
+       ARRAY(struct mail *) mails;
        unsigned int unused_mail_idx;
        unsigned int max_mails;
 
index 620d08cb8a56b216ae426328e66a0fa96146ece1..9d4da1904a60282b331ee21b254da44379009e13 100644 (file)
@@ -363,7 +363,7 @@ void index_storage_mailbox_update_cache(struct mailbox *box,
                                        const struct mailbox_update *update)
 {
        const struct mailbox_cache_field *updates = update->cache_updates;
-       ARRAY_DEFINE(new_fields, struct mail_cache_field);
+       ARRAY(struct mail_cache_field) new_fields;
        const struct mail_cache_field *old_fields;
        struct mail_cache_field field;
        unsigned int i, j, old_count;
index c882381ca5ce31cf80bea94c7c6a3a9a0621bb7d..073e8c2075274570a6f926ecc3d56cfa41d34f24 100644 (file)
@@ -10,7 +10,7 @@ struct index_sync_changes_context {
        struct mail_index_view *sync_view;
        struct mail_index_transaction *sync_trans;
 
-       ARRAY_DEFINE(syncs, struct mail_index_sync_rec);
+       ARRAY(struct mail_index_sync_rec) syncs;
        struct mail_index_sync_rec sync_rec;
        bool dirty_flag_updates;
 };
index eb73d9730a3b0cc18e54ff6948c11802319be465..368cc8e1dd8feece54dd50ae575ec438a96d2694 100644 (file)
@@ -39,8 +39,8 @@ struct thread_finish_context {
        struct mail *tmp_mail;
        struct mail_thread_cache *cache;
 
-       ARRAY_DEFINE(roots, struct mail_thread_root_node);
-       ARRAY_DEFINE(shadow_nodes, struct mail_thread_shadow_node);
+       ARRAY(struct mail_thread_root_node) roots;
+       ARRAY(struct mail_thread_shadow_node) shadow_nodes;
        unsigned int next_new_root_idx;
 
        unsigned int use_sent_date:1;
index 8626fa33e11674d9157fe56cf52b6096ee1e68ab..ae2d5b2eb31bfe0698e6e3ff7b3d38e770aa3ab8 100644 (file)
@@ -46,7 +46,7 @@ struct maildir_keywords_sync_ctx {
        struct mail_index *index;
 
        const ARRAY_TYPE(keywords) *keywords;
-       ARRAY_DEFINE(idx_to_chr, char);
+       ARRAY(char) idx_to_chr;
        unsigned int chridx_to_idx[MAILDIR_MAX_KEYWORDS];
        bool readonly;
 };
index c41dca496660c6deaeaeaf4805fbf2c8a6090072..8ee8095ff9aece937ef6db35c0203949cb3ca1c6 100644 (file)
@@ -852,7 +852,7 @@ maildir_filename_dest_basename_cmp(struct maildir_filename *const *f1,
 static int
 maildir_save_move_files_to_newcur(struct maildir_save_context *ctx)
 {
-       ARRAY_DEFINE(files, struct maildir_filename *);
+       ARRAY(struct maildir_filename *) files;
        struct maildir_filename *mf, *const *mfp, *prev_mf;
        bool newdir, new_changed, cur_changed;
        int ret;
index 91147bda5025eee15a88e227ad6bc81b92177c8f..7624c14dfb10d2252284293f6b606a6b82ebd499 100644 (file)
@@ -121,7 +121,7 @@ struct mbox_sync_context {
        uoff_t base_uid_last_offset;
 
        /* mail state: */
-       ARRAY_DEFINE(mails, struct mbox_sync_mail);
+       ARRAY(struct mbox_sync_mail) mails;
        struct index_sync_changes_context *sync_changes;
 
        /* per-mail pool */
index 713efefe7e9731793d38e3777c4f4acd6500ea05..be810a6d436628c0b8342627b49977ea6edd76e6 100644 (file)
@@ -30,7 +30,7 @@ struct list_dir_context {
        enum mailbox_info_flags info_flags;
 
        /* all files in this directory */
-       ARRAY_DEFINE(entries, struct list_dir_entry);
+       ARRAY(struct list_dir_entry) entries;
        unsigned int entry_idx;
 };
 
@@ -39,7 +39,7 @@ struct fs_list_iterate_context {
 
        const char *const *valid_patterns;
        /* roots can be either /foo, ~user/bar or baz */
-       ARRAY_DEFINE(roots, const char *);
+       ARRAY(const char *) roots;
        unsigned int root_idx;
        char sep;
 
@@ -340,7 +340,7 @@ fs_list_get_valid_patterns(struct fs_list_iterate_context *ctx,
                           const char *const *patterns)
 {
        struct mailbox_list *_list = ctx->ctx.list;
-       ARRAY_DEFINE(valid_patterns, const char *);
+       ARRAY(const char *) valid_patterns;
        const char *pattern, *test_pattern, *real_pattern;
        unsigned int prefix_len;
 
index db90a45fb38becdc92178f8239c397069047c79e..4a0941f005c54bdd65a692fa6f564b25564b62c7 100644 (file)
@@ -47,7 +47,7 @@ struct mailbox_list_notify_index {
        struct timeout *to_wait, *to_notify;
 
        ARRAY_TYPE(seq_range) new_uids, expunged_uids, changed_uids;
-       ARRAY_DEFINE(renames, struct mailbox_list_notify_rename);
+       ARRAY(struct mailbox_list_notify_rename) renames;
        struct seq_range_iter new_uids_iter, expunged_uids_iter;
        struct seq_range_iter changed_uids_iter;
        unsigned int new_uids_n, expunged_uids_n, changed_uids_n;
@@ -343,7 +343,7 @@ mailbox_list_index_notify_find_renames(struct mailbox_list_notify_index *inotify
 {
        struct mailbox_list_index *ilist =
                INDEX_LIST_CONTEXT(inotify->notify.list);
-       ARRAY_DEFINE(entries, struct mailbox_list_inotify_entry);
+       ARRAY(struct mailbox_list_inotify_entry) entries;
        struct mailbox_status status;
        struct mailbox_list_notify_rename *rename;
        struct mailbox_list_inotify_entry *entry;
index 77a6e96bfcb7563a59829607c4116d806fd65523..d205a17c6128254b1f2abecc289296254cc3459c 100644 (file)
@@ -464,7 +464,7 @@ maildir_rename_children(struct mailbox_list *oldlist, const char *oldname,
 {
        struct mailbox_list_iterate_context *iter;
         const struct mailbox_info *info;
-       ARRAY_DEFINE(names_arr, const char *);
+       ARRAY(const char *) names_arr;
        const char *pattern, *oldpath, *newpath, *old_childname, *new_childname;
        const char *const *names, *old_vname, *new_vname;
        unsigned int i, count, old_vnamelen;
index 68a468fa44ad87843016f63390e99ee7e6f3412f..034ac3e60ff5bcf812e6abfba44303cc6d5e8e4c 100644 (file)
@@ -191,7 +191,7 @@ mail_search_register_init_human(struct mail_search_register *imap_register)
 {
        struct mail_search_register *reg;
        mail_search_register_fallback_t *fallback;
-       ARRAY_DEFINE(copy_args, const struct mail_search_register_arg);
+       ARRAY(const struct mail_search_register_arg) copy_args;
        const struct mail_search_register_arg *human_args, *imap_args;
        unsigned int i, j, human_count, imap_count;
        int ret;
index ce8f4f9d33f5f5561e5a9dbac9686997ae4c3010..b2522c71927df442eb621761b79c6e434e2adadf 100644 (file)
@@ -6,7 +6,7 @@
 #include "mail-search-register.h"
 
 struct mail_search_register {
-       ARRAY_DEFINE(args, struct mail_search_register_arg);
+       ARRAY(struct mail_search_register_arg) args;
        mail_search_register_fallback_t *fallback;
 
        unsigned int args_sorted:1;
index 41d06b13bb895e5ea8af55d0d01e054c5e7db84e..6f54e3dddaa2be2ab4743a6de73db6ef72d49ec4 100644 (file)
@@ -36,10 +36,8 @@ struct hook_build_context {
        struct hook_stack *head, *tail;
 };
 
-static ARRAY_DEFINE(module_hooks,
-                   struct mail_storage_module_hooks) = ARRAY_INIT;
-static ARRAY_DEFINE(internal_hooks,
-                   const struct mail_storage_hooks *) = ARRAY_INIT;
+static ARRAY(struct mail_storage_module_hooks) module_hooks = ARRAY_INIT;
+static ARRAY(const struct mail_storage_hooks *) internal_hooks = ARRAY_INIT;
 
 void mail_storage_hooks_init(void)
 {
@@ -119,7 +117,7 @@ mail_storage_module_hooks_cmp(const struct mail_storage_module_hooks *h1,
 static void mail_user_add_plugin_hooks(struct mail_user *user)
 {
        const struct mail_storage_module_hooks *module_hook;
-       ARRAY_DEFINE(tmp_hooks, struct mail_storage_module_hooks);
+       ARRAY(struct mail_storage_module_hooks) tmp_hooks;
        const char *const *plugins, *name;
 
        /* first get all hooks wanted by the user */
index 41a384688d2641af0769f7f40a9a16846d1e5df7..b7528182d62624a0b0af3f1d74647535ac3a4d6c 100644 (file)
@@ -109,7 +109,7 @@ struct mail_storage {
        struct mail_binary_cache binary_cache;
 
        /* Module-specific contexts. See mail_storage_module_id. */
-       ARRAY_DEFINE(module_contexts, union mail_storage_module_context *);
+       ARRAY(union mail_storage_module_context *) module_contexts;
 };
 
 struct mail_attachment_part {
@@ -275,10 +275,10 @@ struct mailbox {
        unsigned int generation_sequence;
 
        /* Saved search results */
-       ARRAY_DEFINE(search_results, struct mail_search_result *);
+       ARRAY(struct mail_search_result *) search_results;
 
        /* Module-specific contexts. See mail_storage_module_id. */
-       ARRAY_DEFINE(module_contexts, union mailbox_module_context *);
+       ARRAY(union mailbox_module_context *) module_contexts;
 
        /* When FAST open flag is used, the mailbox isn't actually opened until
           it's synced for the first time. */
@@ -381,7 +381,7 @@ struct mail_private {
        struct mailbox_header_lookup_ctx *wanted_headers;
 
        pool_t pool;
-       ARRAY_DEFINE(module_contexts, union mail_module_context *);
+       ARRAY(union mail_module_context *) module_contexts;
 };
 
 struct mailbox_list_context {
@@ -426,8 +426,7 @@ struct mailbox_transaction_context {
        struct mail_cache_transaction_ctx *cache_trans;
 
        struct mail_transaction_commit_changes *changes;
-       ARRAY_DEFINE(module_contexts,
-                    union mailbox_transaction_module_context *);
+       ARRAY(union mailbox_transaction_module_context *) module_contexts;
 
        struct mail_save_context *save_ctx;
 
@@ -457,12 +456,12 @@ struct mail_search_context {
           static data matches. */
        struct mail_search_result *update_result;
        /* add matches to these search results */
-       ARRAY_DEFINE(results, struct mail_search_result *);
+       ARRAY(struct mail_search_result *) results;
 
        uint32_t seq;
        uint32_t progress_cur, progress_max;
 
-       ARRAY_DEFINE(module_contexts, union mail_search_module_context *);
+       ARRAY(union mail_search_module_context *) module_contexts;
 
        unsigned int seen_lost_data:1;
        unsigned int progress_hidden:1;
index e1b8e620c2c80826a62109ca22062c9920bcff29..b37ff08a589920cb060281b446a5b7cea6c778b1 100644 (file)
@@ -55,7 +55,7 @@ struct mail_namespace_settings {
        bool subscriptions;
        bool ignore_on_failure;
 
-       ARRAY_DEFINE(mailboxes, struct mailbox_settings *);
+       ARRAY(struct mailbox_settings *) mailboxes;
        struct mail_user_settings *user_set;
 };
 
@@ -91,8 +91,8 @@ struct mail_user_settings {
 
        const char *mail_log_prefix;
 
-       ARRAY_DEFINE(namespaces, struct mail_namespace_settings *);
-       ARRAY_DEFINE(plugin_envs, const char *);
+       ARRAY(struct mail_namespace_settings *) namespaces;
+       ARRAY(const char *) plugin_envs;
 };
 
 extern const struct setting_parser_info mail_user_setting_parser_info;
index 4db4615e2dfd47973c8a06d32db458bfc2a595dc..10018b365bf6550c458bcb7e49f533c5ffe01dc1 100644 (file)
@@ -33,12 +33,12 @@ struct mail_user {
        struct mail_user_settings *set;
        struct mail_namespace *namespaces;
        struct mail_storage *storages;
-       ARRAY_DEFINE(hooks, const struct mail_storage_hooks *);
+       ARRAY(const struct mail_storage_hooks *) hooks;
 
        struct mountpoint_list *mountpoints;
 
        /* Module-specific contexts. See mail_storage_module_id. */
-       ARRAY_DEFINE(module_contexts, union mail_user_module_context *);
+       ARRAY(union mail_user_module_context *) module_contexts;
 
        /* Either home is set or there is no home for the user. */
        unsigned int home_looked_up:1;
index a3ef71b30e65c19505b44ec0cb98e4e09f980eab..2dda17a4c249ea33df3680bc777c6146b0845808 100644 (file)
@@ -11,7 +11,7 @@ mailbox_keywords_create_skip(struct mailbox *box,
        struct mail_keywords *kw;
 
        T_BEGIN {
-               ARRAY_DEFINE(valid_keywords, const char *);
+               ARRAY(const char *) valid_keywords;
                const char *error;
 
                t_array_init(&valid_keywords, 32);
index 68ae3bd0cc7946f1a4862cbba0046dcb9449e6b4..437cb5f67c105186a38bc01a6353f7e22ca68cab 100644 (file)
@@ -27,7 +27,7 @@ ARRAY_DEFINE_TYPE(mailbox_settings, struct mailbox_settings *);
 struct mailbox_list_autocreate_iterate_context {
        unsigned int idx;
        struct mailbox_info new_info;
-       ARRAY_DEFINE(boxes, struct autocreate_box);
+       ARRAY(struct autocreate_box) boxes;
        ARRAY_TYPE(mailbox_settings) box_sets;
        ARRAY_TYPE(mailbox_settings) all_ns_box_sets;
 };
index 45dfb702e2a2bdc77063abd2497c9ef53e35495e..24881da34848f7947266fe1941537cdb3391e800 100644 (file)
@@ -142,7 +142,7 @@ struct mailbox_list {
        enum mail_error error;
        bool temporary_error;
 
-       ARRAY_DEFINE(module_contexts, union mailbox_list_module_context *);
+       ARRAY(union mailbox_list_module_context *) module_contexts;
 
        unsigned int index_root_dir_created:1;
 };
@@ -161,8 +161,7 @@ struct mailbox_list_iterate_context {
        struct mailbox_list_autocreate_iterate_context *autocreate_ctx;
        struct mailbox_info specialuse_info;
 
-       ARRAY_DEFINE(module_contexts,
-                    union mailbox_list_iterate_module_context *);
+       ARRAY(union mailbox_list_iterate_module_context *) module_contexts;
 };
 
 struct mailbox_list_iter_update_context {
index bb0af1aa54578377a3b54b1ef6d316c54176ee3f..53b9c592651a3fd18cd70118e65ca849d4dd3e6e 100644 (file)
@@ -34,7 +34,7 @@
 
 struct mailbox_list_module_register mailbox_list_module_register = { 0 };
 
-static ARRAY_DEFINE(mailbox_list_drivers, const struct mailbox_list *);
+static ARRAY(const struct mailbox_list *) mailbox_list_drivers;
 
 void mailbox_lists_init(void)
 {
index f96a9aa615920e633311b93537316575f5c0770e..6e7b9b6eb06828ff8dc25c67a78cd80e772fd7e1 100644 (file)
@@ -20,7 +20,7 @@ struct mailbox_tree_iterate_context {
 
        char separator;
 
-       ARRAY_DEFINE(node_path, struct mailbox_node *);
+       ARRAY(struct mailbox_node *) node_path;
        string_t *path_str;
        size_t parent_pos;
 
index 8c2fc94a70772fdf7a4d1b7a9e5d9045cc008b1a..a8c2f90d3aca1fe39f770d97845f88577633f97a 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef ARRAY_DECL_H
 #define ARRAY_DECL_H
 
-#define ARRAY_DEFINE(name, array_type) union { struct array arr; array_type const *const *v; array_type **v_modifiable; } name
+#define ARRAY(array_type) union { struct array arr; array_type const *const *v; array_type **v_modifiable; }
 #define ARRAY_INIT { { 0, 0 } }
 
 #define ARRAY_DEFINE_TYPE(name, array_type) \
index 870dc781c8285554307ce300796ebca5d4ebae64..6bf59e921203fae1671347448cffe35597f682e3 100644 (file)
@@ -9,7 +9,7 @@
    Example usage:
 
    struct foo {
-       ARRAY_DEFINE(bars, struct bar);
+       ARRAY(struct bar) bars;
        ...
    };
 
index d3477c680e3e4f3807c47add3fa351034cfb8ca8..772618379ecc3fd4c9bdcfbe3d0e56e8f281979e 100644 (file)
@@ -21,8 +21,8 @@ struct ioloop_handler_context {
        int epfd;
 
        unsigned int deleted_count;
-       ARRAY_DEFINE(fd_index, struct io_list *);
-       ARRAY_DEFINE(events, struct epoll_event);
+       ARRAY(struct io_list *) fd_index;
+       ARRAY(struct epoll_event) events;
 };
 
 void io_loop_handler_init(struct ioloop *ioloop, unsigned int initial_fd_count)
index 588700d4bdfa75ed59b56fc5f8f3d384521a149f..d534842f58c531834329cee1e9e2921ed0d70942 100644 (file)
@@ -32,7 +32,7 @@ struct ioloop_handler_context {
        int kq;
 
        unsigned int deleted_count;
-       ARRAY_DEFINE(events, struct kevent);
+       ARRAY(struct kevent) events;
 };
 
 void io_loop_handler_init(struct ioloop *ioloop, unsigned int initial_fd_count)
index 2b11732c105bec73468f0dcd945747992a9cd7c6..e24202b11b485c1d2df40dde463828bb6e0fc975 100644 (file)
@@ -71,7 +71,7 @@ struct ioloop_context_callback {
 struct ioloop_context {
        int refcount;
        struct ioloop *ioloop;
-       ARRAY_DEFINE(callbacks, struct ioloop_context_callback);
+       ARRAY(struct ioloop_context_callback) callbacks;
 };
 
 int io_loop_get_wait_time(struct ioloop *ioloop, struct timeval *tv_r);
index 5fa2a7c7221a9abea96fb9c497bf0273a9e2add9..9a69a593b95e30c0c8a490a504067e696240e827 100644 (file)
@@ -35,7 +35,7 @@ typedef struct buffer string_t;
 struct istream;
 struct ostream;
 
-#include "array-decl.h" /* ARRAY_DEFINE()s may exist in any header */
+#include "array-decl.h" /* ARRAY*()s may exist in any header */
 #include "hash-decl.h" /* HASH_TABLE*()s may exist in any header */
 #include "strfuncs.h"
 #include "strnum.h"
index 5c0738a653674bb80d46e2dcda53818fdf19109c..1916a174f72a435fd6da7c1f336a13b1c05d8839 100644 (file)
@@ -19,7 +19,7 @@
           // for example: struct STRUCT_NAME_vfuncs super;
    };
    struct STRUCT_NAME {
-       ARRAY_DEFINE(module_contexts, union STRUCT_NAME_module_context *);
+       ARRAY(union STRUCT_NAME_module_context *) module_contexts;
    };
    extern struct STRUCT_NAME_module_register STRUCT_NAME_module_register;
 
index bedfb237d930c932170682b5968d09594f7d47b5..10e775d244e0649384ad1956758c7c1374ecfbe0 100644 (file)
@@ -16,7 +16,7 @@
 struct priorityq {
        priorityq_cmp_callback_t *cmp_callback;
 
-       ARRAY_DEFINE(items, struct priorityq_item *);
+       ARRAY(struct priorityq_item *) items;
 };
 
 struct priorityq *
index 1b6d3dd642065fb5c4178d6eca1afd85fb4b73bf..060bcb7223d1f33ebe350ceef37acf7b9a7c928b 100644 (file)
@@ -23,7 +23,7 @@ static bool aqueue_is_ok(struct aqueue *aqueue, unsigned int deleted_n)
 static const unsigned int aqueue_input[] = { 1, 2, 3, 4, 5, 6 };
 static const char *test_aqueue2(unsigned int initial_size)
 {
-       ARRAY_DEFINE(aqueue_array, unsigned int);
+       ARRAY(unsigned int) aqueue_array;
        unsigned int i, j, k;
        struct aqueue *aqueue;
 
index e5e29252f65db5d4cb9bcba73340d65c79cbc7e9..bfe976842d6dc3264aecde043ce0426f7e98adcb 100644 (file)
@@ -9,7 +9,7 @@ struct foo {
 
 static void test_array_foreach(void)
 {
-       ARRAY_DEFINE(foos, struct foo);
+       ARRAY(struct foo) foos;
        const struct foo *foo;
        struct foo nfoo;
        unsigned int i;
@@ -32,7 +32,7 @@ static void test_array_foreach(void)
 
 static void test_array_reverse(void)
 {
-       ARRAY_DEFINE(intarr, int);
+       ARRAY(int) intarr;
        int input[] = { -1234567890, -272585721, 272485922, 824725652 };
        const int *output;
        unsigned int i, j;
index c2512ffa1983ee3a22dbaf3801919d51d5697cbb..442120a3b7689c80e0bee83ad307d152ccf0df80 100644 (file)
@@ -436,7 +436,7 @@ bool var_has_key(const char *str, char key, const char *long_key)
 const struct var_expand_table *
 var_expand_table_build(char key, const char *value, char key2, ...)
 {
-       ARRAY_DEFINE(variables, struct var_expand_table);
+       ARRAY(struct var_expand_table) variables;
        struct var_expand_table *var;
        va_list args;
 
index 488797cd04229892162313f84400a8685bf1e7fe..7d0d942114f1738cd1c0400ce13a9e10c8a2c37c 100644 (file)
@@ -15,7 +15,7 @@ struct client_state {
        const char *name;
        const char *session_id;
        const char *mail_from;
-       ARRAY_DEFINE(rcpt_to, struct mail_recipient);
+       ARRAY(struct mail_recipient) rcpt_to;
        unsigned int rcpt_idx;
 
        unsigned int data_end_idx;
index 2786f5c59ff6f1a5e8af5905c0993ad80d00a414..f802979fe86028daa1927212b024093719f90189 100644 (file)
@@ -36,8 +36,8 @@ struct lmtp_proxy {
        const char *mail_from;
        struct lmtp_proxy_settings set;
 
-       ARRAY_DEFINE(connections, struct lmtp_proxy_connection *);
-       ARRAY_DEFINE(rcpt_to, struct lmtp_proxy_recipient *);
+       ARRAY(struct lmtp_proxy_connection *) connections;
+       ARRAY(struct lmtp_proxy_recipient *) rcpt_to;
        unsigned int next_data_reply_idx;
 
        struct timeout *to_finish;
index 955c8e0bfe0bfa14c7c23b68062e4a1499173039..a97dc870ecf4fa795ee8cb1d48f479f0c7af9b0c 100644 (file)
@@ -40,7 +40,7 @@ struct log_connection {
 };
 
 static struct log_connection *log_connections = NULL;
-static ARRAY_DEFINE(logs_by_fd, struct log_connection *);
+static ARRAY(struct log_connection *) logs_by_fd;
 
 static void log_connection_destroy(struct log_connection *log);
 
index 613b232b37d574afd740e3c5d7219485e0a66a14..144548885740165119baccb7cacf57a13bd5a2ce 100644 (file)
@@ -375,8 +375,8 @@ int services_listen_using(struct service_list *new_service_list,
                          struct service_list *old_service_list)
 {
        struct service *const *services, *old_service, *new_service;
-       ARRAY_DEFINE(new_listeners_arr, struct service_listener *);
-       ARRAY_DEFINE(old_listeners_arr, struct service_listener *);
+       ARRAY(struct service_listener *) new_listeners_arr;
+       ARRAY(struct service_listener *) old_listeners_arr;
        struct service_listener *const *new_listeners, *const *old_listeners;
        unsigned int i, j, count, new_count, old_count;
 
index 49d5f4cfab0eeb76deff5ef7726d8326cbba807f..d7bc3fb8d061dc8d357d80f9f69f0bc4945d1303 100644 (file)
@@ -14,7 +14,7 @@ struct service_process_notify {
        int fd;
        struct io *io_write;
        struct aqueue *process_queue;
-       ARRAY_DEFINE(processes, struct service_process *);
+       ARRAY(struct service_process *) processes;
 };
 
 struct service_process_notify *
index d61d33e9561570053a8a11791125838699bdc6ed..5beb6361a325a4be338599249c6afc39ac990899 100644 (file)
@@ -55,7 +55,7 @@ struct service {
        const char *extra_gids; /* comma-separated list */
 
        /* all listeners, even those that aren't currently listening */
-       ARRAY_DEFINE(listeners, struct service_listener *);
+       ARRAY(struct service_listener *) listeners;
        /* linked list of all processes belonging to this service */
        struct service_process *processes;
 
@@ -134,7 +134,7 @@ struct service_list {
 
        int master_dead_pipe_fd[2];
 
-       ARRAY_DEFINE(services, struct service *);
+       ARRAY(struct service *) services;
 
        unsigned int destroying:1;
        unsigned int destroyed:1;
index e0793a21ee7bd46533ebea67f6dafa1673da0f40..5132fbcd4013a716e8e760b3f7581844161324f8 100644 (file)
@@ -10,7 +10,7 @@ struct acl_object_vfile {
        struct acl_object aclobj;
 
        pool_t rights_pool;
-       ARRAY_DEFINE(rights, struct acl_rights);
+       ARRAY(struct acl_rights) rights;
 
        char *global_path, *local_path;
 };
@@ -25,7 +25,7 @@ struct acl_backend_vfile {
        const char *global_dir;
 
        pool_t acllist_pool;
-       ARRAY_DEFINE(acllist, struct acl_backend_vfile_acllist);
+       ARRAY(struct acl_backend_vfile_acllist) acllist;
 
        time_t acllist_last_check;
        time_t acllist_mtime;
index 838d2513f1ec0beb18743747662c778ea2056ef6..dc09b20f47495049d409d8569389731756dcc743 100644 (file)
@@ -31,7 +31,7 @@ struct acl_cache {
           rights can be added to the mapping. */
        pool_t right_names_pool;
        /* idx => right name. */
-       ARRAY_DEFINE(right_idx_name_map, const char *);
+       ARRAY(const char *) right_idx_name_map;
        /* name => idx+1 */
        HASH_TABLE(char *, unsigned int) right_name_idx_map;
 };
index 3b32c730d34719e8b3be8079f10fc6ad74c6e999..70aa104bd2931cf2e8cf13b513dc0ac74a4d148b 100644 (file)
@@ -34,7 +34,7 @@ struct doveadm_expire_mail_cmd_context {
        struct dict_iterate_context *iter;
 
        HASH_TABLE(char *, enum expire_user_state) user_states;
-       ARRAY_DEFINE(queries, struct expire_query);
+       ARRAY(struct expire_query) queries;
        time_t oldest_before_time;
        bool delete_nonexistent_users;
 };
index f719fb78d19e828ca12d9617661d99d9f1760c2e..32740b8a15ed17a33cdccc60f0d2434cfabf1e95 100644 (file)
@@ -9,7 +9,7 @@
 
 struct expire_set {
        pool_t pool;
-       ARRAY_DEFINE(globs, struct imap_match_glob *);
+       ARRAY(struct imap_match_glob *) globs;
 };
 
 struct expire_set *expire_set_init(const char *const *patterns)
index e5dfa350c599663b98e8d327558677acade2fbe9..e0143efd32ca26ce4a8209349f5394226dfe4652 100644 (file)
@@ -492,7 +492,7 @@ mailboxes_get_guids(struct mailbox *const boxes[],
                    HASH_TABLE_TYPE(wguid_result) guids,
                    struct fts_multi_result *result)
 {
-       ARRAY_DEFINE(box_results, struct fts_result);
+       ARRAY(struct fts_result) box_results;
        struct fts_result *box_result;
        const char *guid;
        wchar_t *guid_dup;
index 85b519bb2ec1f4c6feb1a6d6f88e1f57c4317311..be2f48f0686001d4af1309530e058b64dcdb06e7 100644 (file)
@@ -66,7 +66,7 @@ struct lucene_index {
        IndexSearcher *searcher;
 
        Analyzer *default_analyzer, *cur_analyzer;
-       ARRAY_DEFINE(analyzers, struct lucene_analyzer);
+       ARRAY(struct lucene_analyzer) analyzers;
 
        Document *doc;
        uint32_t prev_uid;
index 112a4f7524cd39267026dbea88d539ad8c846172..c8afb693eacf29187a9a57da0db7dddac4485179 100644 (file)
@@ -721,7 +721,7 @@ solr_search_multi(struct solr_fts_backend *backend, string_t *str,
 {
        struct solr_result **solr_results;
        struct fts_result *fts_result;
-       ARRAY_DEFINE(fts_results, struct fts_result);
+       ARRAY(struct fts_result) fts_results;
        struct mail_namespace *ns;
        struct mailbox_status status;
        HASH_TABLE(char *, struct mailbox *) mailboxes;
index 5123065e555b89c468f60d5fcd77bc4511fc3a66..7b1e7ccf696847b919cff14f6643033204cd6c6e 100644 (file)
@@ -39,7 +39,7 @@ struct solr_fts_backend_update_context {
        uint32_t prev_uid;
        string_t *cmd, *cur_value, *cur_value2;
        string_t *cmd_expunge;
-       ARRAY_DEFINE(fields, struct solr_fts_field);
+       ARRAY(struct solr_fts_field) fields;
 
        uint32_t last_indexed_uid;
        uint32_t size_warned_uid;
@@ -800,7 +800,7 @@ solr_search_multi(struct fts_backend *_backend, string_t *str,
 {
        struct solr_result **solr_results;
        struct fts_result *fts_result;
-       ARRAY_DEFINE(fts_results, struct fts_result);
+       ARRAY(struct fts_result) fts_results;
        HASH_TABLE(char *, struct mailbox *) mailboxes;
        struct mailbox *box;
        const char *box_guid;
index a82d37c93ac8b6806f414c34308858f8a4452549..bb0cb4806512689b62bb1778fb3354ffc68288af 100644 (file)
@@ -41,7 +41,7 @@ struct solr_lookup_xml_context {
        pool_t result_pool;
        /* box_id -> solr_result */
        HASH_TABLE(char *, struct solr_result *) mailboxes;
-       ARRAY_DEFINE(results, struct solr_result *);
+       ARRAY(struct solr_result *) results;
 };
 
 struct solr_connection_post {
index 9c1863460e92c28dcbbd7112aa5ae1252771b0f8..88ed22f5e2190d34a7031856cf263591ba3d3252 100644 (file)
@@ -52,7 +52,7 @@ struct squat_trie_iterate_node {
 struct squat_trie_iterate_context {
        struct squat_trie *trie;
        struct squat_trie_iterate_node cur;
-       ARRAY_DEFINE(parents, struct squat_trie_iterate_node);
+       ARRAY(struct squat_trie_iterate_node) parents;
        bool failed;
 };
 
index 105df9315c63d0f9cc5bc27ddfd5b3ee315b498e..cbaf442344e7c64f87e0e86f214adcf0066ed7f7 100644 (file)
@@ -65,7 +65,7 @@ struct squat_uidlist_build_context {
        ARRAY_TYPE(uint32_t) block_offsets;
        ARRAY_TYPE(uint32_t) block_end_indexes;
 
-       ARRAY_DEFINE(lists, struct uidlist_list);
+       ARRAY(struct uidlist_list) lists;
        uint32_t list_start_idx;
 
        struct squat_uidlist_file_header build_hdr;
index 8a91113327ffc7df6e5cb81699675142d18666bf..20ab12002f469a45245a9e8168becf13a3a6b487 100644 (file)
@@ -10,7 +10,7 @@
 #include "../virtual/virtual-storage.h"
 #include "fts-api-private.h"
 
-static ARRAY_DEFINE(backends, const struct fts_backend *);
+static ARRAY(const struct fts_backend *) backends;
 
 void fts_backend_register(const struct fts_backend *backend)
 {
index 8dac7c108349a90a4e4a850eb0e601c727d0d1c6..4e09c9d72990a67db426833321599ac40c661493 100644 (file)
@@ -25,7 +25,7 @@ struct content {
 struct fts_parser_script_user {
        union mail_user_module_context module_ctx;
 
-       ARRAY_DEFINE(content, struct content);
+       ARRAY(struct content) content;
 };
 
 struct script_fts_parser {
index fa925d9d589716776489e4722ac7e189c002b104..b66bae741408d93611d7cd14630340a3829d327d 100644 (file)
@@ -24,7 +24,7 @@ struct fts_search_context {
        struct mail_search_args *args;
 
        pool_t result_pool;
-       ARRAY_DEFINE(levels, struct fts_search_level);
+       ARRAY(struct fts_search_level) levels;
        buffer_t *orig_matches;
 
        uint32_t first_unindexed_seq;
index a8cc2f8296bf0109785dc1edea16bfe9298ad2ce..26094a40f88d7e2086a417f93c3d610950e115e1 100644 (file)
@@ -44,7 +44,7 @@ struct pop3_migration_mail_storage {
 
        const char *pop3_box_vname;
        struct mailbox *pop3_box;
-       ARRAY_DEFINE(pop3_uidl_map, struct pop3_uidl_map);
+       ARRAY(struct pop3_uidl_map) pop3_uidl_map;
 
        unsigned int all_mailboxes:1;
        unsigned int pop3_all_hdr_sha1_set:1;
@@ -53,7 +53,7 @@ struct pop3_migration_mail_storage {
 struct pop3_migration_mailbox {
        union mailbox_module_context module_ctx;
 
-       ARRAY_DEFINE(imap_msg_map, struct imap_msg_map);
+       ARRAY(struct imap_msg_map) imap_msg_map;
        unsigned int first_unfound_idx;
 
        unsigned int uidl_synced:1;
index 573c70d744b6df0ad522ac3c7b79e1abaaee4ad5..149dca8e65b965b962cbb1a3a921a81b085c8d00 100644 (file)
@@ -13,14 +13,14 @@ struct quota {
        struct mail_user *user;
        struct quota_settings *set;
 
-       ARRAY_DEFINE(roots, struct quota_root *);
-       ARRAY_DEFINE(namespaces, struct mail_namespace *);
+       ARRAY(struct quota_root *) roots;
+       ARRAY(struct mail_namespace *) namespaces;
 };
 
 struct quota_settings {
        pool_t pool;
 
-       ARRAY_DEFINE(root_sets, struct quota_root_settings *);
+       ARRAY(struct quota_root_settings *) root_sets;
        int (*test_alloc)(struct quota_transaction_context *ctx,
                          uoff_t size, bool *too_large_r);
 
@@ -85,8 +85,8 @@ struct quota_root_settings {
 
        const struct quota_backend *backend;
        struct quota_rule default_rule;
-       ARRAY_DEFINE(rules, struct quota_rule);
-       ARRAY_DEFINE(warning_rules, struct quota_warning_rule);
+       ARRAY(struct quota_rule) rules;
+       ARRAY(struct quota_warning_rule) warning_rules;
 
        /* Limits in default_rule override backend's quota limits */
        unsigned int force_default_rule:1;
@@ -117,7 +117,7 @@ struct quota_root {
        int resource_ret;
 
        /* Module-specific contexts. See quota_module_id. */
-       ARRAY_DEFINE(quota_module_contexts, void);
+       ARRAY(void) quota_module_contexts;
 
        /* don't enforce quota when saving */
        unsigned int no_enforcing:1;
index 7b8abee8839ba7bcc3ceb7230d983f95e06fea86..1ee2d46e112b1b4af3a10e20bbb4b7b14e8e388e 100644 (file)
@@ -28,8 +28,8 @@ struct quota_mailbox {
 
        struct mailbox_transaction_context *expunge_trans;
        struct quota_transaction_context *expunge_qt;
-       ARRAY_DEFINE(expunge_uids, uint32_t);
-       ARRAY_DEFINE(expunge_sizes, uoff_t);
+       ARRAY(uint32_t) expunge_uids;
+       ARRAY(uoff_t) expunge_sizes;
 
        unsigned int recalculate:1;
 };
index a0fb6824d7366b9299535ef3f26b01626c58a77c..fd761f5733dbc72ca4d2dee291be348f67a1aae6 100644 (file)
@@ -1114,7 +1114,7 @@ int quota_transaction_commit(struct quota_transaction_context **_ctx)
                ret = -1;
        else if (ctx->bytes_used != 0 || ctx->count_used != 0 ||
                 ctx->recalculate) T_BEGIN {
-               ARRAY_DEFINE(warn_roots, struct quota_root *);
+               ARRAY(struct quota_root *) warn_roots;
 
                mailbox_name = mailbox_get_vname(ctx->box);
                (void)mail_namespace_find_unalias(
index f1830a2e52df9d491c6d7bc6fb686cdf52b1bdd6..c9158dd5f5a717272818ea34f8f3a103f31bed57 100644 (file)
@@ -37,7 +37,7 @@ struct trash_user {
        union mail_user_module_context module_ctx;
 
        /* ordered by priority, highest first */
-       ARRAY_DEFINE(trash_boxes, struct trash_mailbox);
+       ARRAY(struct trash_mailbox) trash_boxes;
 };
 
 const char *trash_plugin_version = DOVECOT_VERSION;
index 161d873db53ae502d70570c215013a57e26502bc..870c077d7673e72ea910f39717a562f690b544a4 100644 (file)
@@ -15,7 +15,7 @@ struct virtual_mail {
        /* currently active mail */
        struct mail *backend_mail;
        /* all allocated mails */
-       ARRAY_DEFINE(backend_mails, struct mail *);
+       ARRAY(struct mail *) backend_mails;
 
        /* mail is lost if backend_mail doesn't point to correct mail */
        unsigned int lost:1;
index 51f8eb6563738e5fab634988a6eac04e5c1f2e2e..17f57b98028e7735a8a4c0f7941577ab642c21d1 100644 (file)
@@ -26,7 +26,7 @@ struct virtual_search_context {
 
        ARRAY_TYPE(seq_range) result;
        struct seq_range_iter result_iter;
-       ARRAY_DEFINE(records, struct virtual_search_record);
+       ARRAY(struct virtual_search_record) records;
 
        enum virtual_search_state search_state;
        unsigned int next_result_n;
index 980070f21766ad51a8e5ae56e7ef05a174a44ac5..ff5722586d50ab5056f7e34586d5253dd12f8c1e 100644 (file)
@@ -79,7 +79,7 @@ struct virtual_backend_box {
        struct mailbox *box;
        /* Messages currently included in the virtual mailbox,
           sorted by real_uid */
-       ARRAY_DEFINE(uids, struct virtual_backend_uidmap);
+       ARRAY(struct virtual_backend_uidmap) uids;
 
        /* temporary mail used while syncing */
        struct mail *sync_mail;
index 894a7018bbc8e40f4267055dcc06d91f4bb66772..de0b777e9a457b35d601827ecb27385c65bcdff7 100644 (file)
@@ -35,7 +35,7 @@ struct virtual_sync_context {
        /* messages expunged within this sync */
        ARRAY_TYPE(seq_range) sync_expunges;
 
-       ARRAY_DEFINE(all_adds, struct virtual_add_record);
+       ARRAY(struct virtual_add_record) all_adds;
        enum mailbox_sync_flags flags;
        uint32_t uid_validity;
 
index 232ea6662663571295004839d99665a678af31f0..ce979a3a667976ce45fe9f6935b54cc28ef5081a 100644 (file)
@@ -6,8 +6,7 @@
 struct virtual_transaction_context {
        struct mailbox_transaction_context t;
 
-       ARRAY_DEFINE(backend_transactions,
-                    struct mailbox_transaction_context *);
+       ARRAY(struct mailbox_transaction_context *) backend_transactions;
 };
 
 struct mailbox_transaction_context *
index 48fe679bcef6a9108b286680c4fa8dbc68e89e41..580a5d4d27459860df50040cc8a9c7835fd93a29 100644 (file)
@@ -137,7 +137,7 @@ static int read_mailbox(struct client *client, uint32_t *failed_uid_r)
        struct mail_search_context *ctx;
        struct mail *mail;
        uoff_t size;
-       ARRAY_DEFINE(message_sizes, uoff_t);
+       ARRAY(uoff_t) message_sizes;
        ARRAY_TYPE(uint32_t) msgnum_to_seq_map = ARRAY_INIT;
        unsigned int msgnum;
        int ret = 1;
index 890a9e0743ed1c0da08fd7564788fb2e4daf3bc5..5613db9caf44c94781163b3dfdc0871887de89b5 100644 (file)
@@ -79,7 +79,7 @@ struct client {
        enum uidl_keys uidl_keymask;
 
        /* Module-specific contexts. */
-       ARRAY_DEFINE(module_contexts, union pop3_module_context *);
+       ARRAY(union pop3_module_context *) module_contexts;
 
        unsigned int disconnected:1;
        unsigned int deleted:1;
index cddd31251aafb9553e077a46e32d16e2f5d05286..39094d250be955db858ae0ca932ff2cf6394764b 100644 (file)
@@ -19,7 +19,7 @@ struct replicator_brain {
        const struct replicator_settings *set;
        struct timeout *to;
 
-       ARRAY_DEFINE(doveadm_conns, struct doveadm_connection *);
+       ARRAY(struct doveadm_connection *) doveadm_conns;
 };
 
 static void replicator_brain_fill(struct replicator_brain *brain);
index 15e50b05dd0da3b89791291b7e1be5241746dcec..c67538a89051b1b6c601ef2aa93aeed9012b65b7 100644 (file)
@@ -27,7 +27,7 @@ struct replicator_queue {
        /* username => struct replicator_user* */
        HASH_TABLE(char *, struct replicator_user *) user_hash;
 
-       ARRAY_DEFINE(sync_lookups, struct replicator_sync_lookup);
+       ARRAY(struct replicator_sync_lookup) sync_lookups;
 
        unsigned int full_sync_interval;
 
@@ -214,7 +214,7 @@ replicator_queue_handle_sync_lookups(struct replicator_queue *queue,
                                     struct replicator_user *user)
 {
        struct replicator_sync_lookup *lookups;
-       ARRAY_DEFINE(callbacks, struct replicator_sync_lookup);
+       ARRAY(struct replicator_sync_lookup) callbacks;
        unsigned int i, count;
        bool success = !user->last_sync_failed;
 
index 4247668f1ebc7f7a4828afdd40ac0a9f5e80bebd..aa5b7a3494f0772ee99ce17c1324ac59cdd9bd41 100644 (file)
@@ -19,7 +19,7 @@ struct client {
        struct ostream *output;
 };
 
-static ARRAY_DEFINE(delayed_fds, int);
+static ARRAY(int) delayed_fds;
 struct ssl_params *param;
 static buffer_t *ssl_params;
 static struct timeout *to_startup;