]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
global: Rename array_first and array_last to array_front and back
authorAki Tuomi <aki.tuomi@open-xchange.com>
Mon, 14 Jan 2019 12:00:36 +0000 (14:00 +0200)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 2 Apr 2019 07:24:10 +0000 (10:24 +0300)
This is more consistent with other languages

129 files changed:
src/auth/auth-request-handler.c
src/auth/auth-settings.c
src/auth/auth-worker-server.c
src/auth/db-ldap.c
src/config/config-connection.c
src/config/config-filter.c
src/config/config-parser.c
src/config/doveconf.c
src/dict/dict-commands.c
src/director/director-connection.c
src/director/director-request.c
src/director/director.c
src/dns/dns-client.c
src/doveadm/doveadm-cmd.c
src/doveadm/doveadm-dsync.c
src/doveadm/doveadm-dump-index.c
src/doveadm/doveadm-kick.c
src/doveadm/doveadm-mail-fetch.c
src/doveadm/doveadm-mail-flags.c
src/doveadm/doveadm-mail-server.c
src/doveadm/doveadm-mail.c
src/doveadm/doveadm-mailbox-list-iter.c
src/doveadm/doveadm-print-formatted.c
src/doveadm/doveadm-who.c
src/doveadm/dsync/dsync-brain-mailbox.c
src/doveadm/dsync/dsync-ibc-pipe.c
src/doveadm/dsync/dsync-mailbox-export.c
src/doveadm/dsync/dsync-mailbox-import.c
src/imap-urlauth/imap-urlauth-worker.c
src/imap/cmd-list.c
src/imap/cmd-thread.c
src/imap/imap-client.c
src/imap/imap-commands-util.c
src/imap/imap-fetch.c
src/ipc/ipc-connection.c
src/ipc/ipc-group.c
src/lib-auth/auth-master.c
src/lib-dict-backend/dict-ldap.c
src/lib-dict/dict-redis.c
src/lib-fts/fts-filter-normalizer-icu.c
src/lib-fts/fts-icu.c
src/lib-fts/fts-language.c
src/lib-fts/test-fts-icu.c
src/lib-http/http-client-connection.c
src/lib-http/http-message-parser.c
src/lib-imap-client/imapc-client.c
src/lib-imap-client/imapc-connection.c
src/lib-imap-client/imapc-msgmap.c
src/lib-imap-storage/imap-msgpart.c
src/lib-imap/imap-match.c
src/lib-imap/imap-parser.c
src/lib-index/mail-index-fsck.c
src/lib-index/mail-index-sync-ext.c
src/lib-index/mail-index-sync.c
src/lib-index/mail-index-transaction-update.c
src/lib-index/mail-index-view-sync.c
src/lib-index/mail-transaction-log-view.c
src/lib-lda/mail-deliver.c
src/lib-ldap/ldap-entry.c
src/lib-ldap/ldap-search.c
src/lib-mail/istream-attachment-connector.c
src/lib-mail/message-part-data.c
src/lib-mail/rfc2231-parser.c
src/lib-mail/test-istream-attachment.c
src/lib-master/anvil-client.c
src/lib-master/master-service-settings.c
src/lib-master/master-service.c
src/lib-program-client/program-client-local.c
src/lib-settings/settings-parser.c
src/lib-smtp/smtp-reply-parser.c
src/lib-smtp/smtp-server-cmd-mail.c
src/lib-smtp/smtp-server-cmd-rcpt.c
src/lib-smtp/smtp-server-command.c
src/lib-smtp/smtp-server-transaction.c
src/lib-smtp/smtp-submit.c
src/lib-smtp/smtp-syntax.c
src/lib-sql/driver-cassandra.c
src/lib-sql/driver-sqlpool.c
src/lib-sql/driver-test.c
src/lib-storage/index/dbox-multi/mdbox-map.c
src/lib-storage/index/dbox-multi/mdbox-purge.c
src/lib-storage/index/dbox-multi/mdbox-save.c
src/lib-storage/index/dbox-single/sdbox-save.c
src/lib-storage/index/imapc/imapc-mail-fetch.c
src/lib-storage/index/imapc/imapc-mailbox.c
src/lib-storage/index/index-mail-headers.c
src/lib-storage/index/index-mail.c
src/lib-storage/index/index-search-mime.c
src/lib-storage/index/index-search.c
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/pop3c/pop3c-client.c
src/lib-storage/index/pop3c/pop3c-sync.c
src/lib-storage/list/mailbox-list-fs-iter.c
src/lib-storage/mail-search.c
src/lib-storage/mail-storage-hooks.c
src/lib-storage/mail-storage-settings.c
src/lib-storage/mailbox-get.c
src/lib/array.h
src/lib/event-filter.c
src/lib/priorityq.c
src/lib/strfuncs.c
src/lib/test-array.c
src/lib/test-seq-range-array.c
src/lib/var-expand-if.c
src/lib/var-expand.c
src/login-common/client-common-auth.c
src/master/service-process-notify.c
src/plugins/acl/acl-api.c
src/plugins/acl/acl-cache.c
src/plugins/apparmor/apparmor-plugin.c
src/plugins/expire/doveadm-expire.c
src/plugins/expire/expire-plugin.c
src/plugins/fts-lucene/fts-backend-lucene.c
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-uidlist.c
src/plugins/fts/fts-expunge-log.c
src/plugins/fts/fts-search.c
src/plugins/fts/fts-storage.c
src/plugins/fts/fts-user.c
src/plugins/imap-acl/imap-acl-plugin.c
src/plugins/mail-crypt/test-mail-global-key.c
src/plugins/quota/quota-imapc.c
src/plugins/virtual/virtual-save.c
src/plugins/virtual/virtual-sync.c
src/util/script.c

index dbc41d6f5a94588c95504523de1a8598d7f44a10..88be109ceeab784e16902b1ea35a104a58944865 100644 (file)
@@ -867,7 +867,7 @@ void auth_request_handler_flush_failures(bool flush_all)
                return;
        }
 
-       auth_requests = array_first_modifiable(&auth_failures_arr);
+       auth_requests = array_front_modifiable(&auth_failures_arr);
        /* count the number of requests that we need to flush */
        for (i = 0; i < count; i++) {
                auth_request = auth_requests[aqueue_idx(auth_failures, i)];
index 5af4f9080840b7cee7a206e20859153e6e42c627..3a077ba1b02e7873a51e7869afa93426e1b35444 100644 (file)
@@ -380,7 +380,7 @@ auth_settings_set_self_ips(struct auth_settings *set, pool_t pool,
                array_append(&ips_array, ips, ips_count);
        }
        array_append_zero(&ips_array);
-       set->proxy_self_ips = array_first(&ips_array);
+       set->proxy_self_ips = array_front(&ips_array);
        return TRUE;
 }
 
index 511cd073c5ff68be5c7ba76d4a9b7318577e8f9e..a651b87bf9548d9b034f18e2155d85369ffc77de 100644 (file)
@@ -500,7 +500,7 @@ void auth_worker_server_deinit(void)
        struct auth_worker_connection **connp, *conn;
 
        while (array_count(&connections) > 0) {
-               connp = array_first_modifiable(&connections);
+               connp = array_front_modifiable(&connections);
                conn = *connp;
                auth_worker_destroy(&conn, "Shutting down", FALSE);
        }
index 5c2eeee5fc47d7c25ace9e6c8525d069f08609d2..2935f0228ebd1cb02293642f9bcc9a7ede00c43c 100644 (file)
@@ -544,7 +544,7 @@ db_ldap_find_request(struct ldap_connection *conn, int msgid,
        if (count == 0)
                return NULL;
 
-       requests = array_first(&conn->request_array);
+       requests = array_front(&conn->request_array);
        for (i = 0; i < count; i++) {
                request = requests[aqueue_idx(conn->request_queue, i)];
                if (request->msgid == msgid) {
@@ -651,7 +651,7 @@ ldap_request_send_subquery(struct ldap_connection *conn,
                if (field->ldap_attr_name[0] == '\0') {
                        str_truncate(tmp_str, 0);
                        if (var_expand_with_funcs(tmp_str, field->value, table,
-                                                 array_first(&var_funcs_table), &ctx, &error) <= 0) {
+                                                 array_front(&var_funcs_table), &ctx, &error) <= 0) {
                                auth_request_log_error(auth_request,
                                        AUTH_SUBSYS_DB,
                                        "Failed to expand subquery %s: %s",
@@ -672,7 +672,7 @@ ldap_request_send_subquery(struct ldap_connection *conn,
 
        request->request.msgid =
                ldap_search(conn->ld, named_res->dn, LDAP_SCOPE_BASE,
-                           NULL, array_first_modifiable(&ctx.attr_names), 0);
+                           NULL, array_front_modifiable(&ctx.attr_names), 0);
        if (request->request.msgid == -1) {
                auth_request_log_error(auth_request, AUTH_SUBSYS_DB,
                                       "ldap_search(dn=%s) failed: %s",
@@ -1326,7 +1326,7 @@ static void db_ldap_conn_close(struct ldap_connection *conn)
        timeout_remove(&conn->to);
 
        if (conn->pending_count != 0) {
-               requests = array_first(&conn->request_array);
+               requests = array_front(&conn->request_array);
                for (i = 0; i < conn->pending_count; i++) {
                        request = requests[aqueue_idx(conn->request_queue, i)];
 
@@ -1467,7 +1467,7 @@ void db_ldap_set_attrs(struct ldap_connection *conn, const char *attrlist,
                }
        }
        array_append_zero(&ctx.attr_names);
-       *attr_names_r = array_first_modifiable(&ctx.attr_names);
+       *attr_names_r = array_front_modifiable(&ctx.attr_names);
 }
 
 static const struct var_expand_table *
index c3c7b7864e0bfcfccf038b62462a1ada924bddf6..206b0637bcf69b1a545eaf030e1e956b615cc795 100644 (file)
@@ -103,7 +103,7 @@ static int config_connection_request(struct config_connection *conn,
        }
        array_append_zero(&modules);
        wanted_modules = array_count(&modules) == 1 ? NULL :
-               array_first(&modules);
+               array_front(&modules);
 
        if (is_master) {
                /* master reads configuration only when reloading settings */
index 0c248ec8f4a255a31e78e7df7166d3376096b064..3d08e5e4e83575cda511435df9f49cc181b04a52 100644 (file)
@@ -245,12 +245,12 @@ config_filter_find_all(struct config_filter_context *ctx, pool_t pool,
        }
        if (filter->service == NULL) {
                array_append_zero(&service_names);
-               output_r->specific_services = array_first(&service_names);
+               output_r->specific_services = array_front(&service_names);
        }
 
        array_sort(&matches, config_filter_parser_cmp);
        array_append_zero(&matches);
-       return array_first(&matches);
+       return array_front(&matches);
 }
 
 struct config_filter_parser *const *
@@ -265,7 +265,7 @@ config_filter_get_all(struct config_filter_context *ctx)
        }
        array_sort(&filters, config_filter_parser_cmp_rev);
        array_append_zero(&filters);
-       return array_first(&filters);
+       return array_front(&filters);
 }
 
 struct config_filter_parser *const *
@@ -298,7 +298,7 @@ config_filter_find_subset(struct config_filter_context *ctx,
        }
        array_sort(&matches, config_filter_parser_cmp_rev);
        array_append_zero(&matches);
-       return array_first(&matches);
+       return array_front(&matches);
 }
 
 static bool
index 92c232867609a21d1e455d0658846cf895d049d9..6894123ea34a94bd4365d3c246fceae4fccdfac6 100644 (file)
@@ -738,7 +738,7 @@ static int config_parse_finish(struct config_parser_context *ctx, const char **e
 
        new_filter = config_filter_init(ctx->pool);
        array_append_zero(&ctx->all_parsers);
-       config_filter_add_all(new_filter, array_first(&ctx->all_parsers));
+       config_filter_add_all(new_filter, array_front(&ctx->all_parsers));
 
        if (ret < 0)
                ;
@@ -1108,7 +1108,7 @@ void config_parse_load_modules(void)
                for (i = 0; all_roots[i] != NULL; i++)
                        array_push_back(&new_roots, &all_roots[i]);
                array_append_zero(&new_roots);
-               all_roots = array_first(&new_roots);
+               all_roots = array_front(&new_roots);
                roots_free_at_deinit = new_roots;
        } else {
                array_free(&new_roots);
index 93421ae58dbac332ac90f1355e0b3464c6cf3ca8..997946304cb1768000f65adb8ecc2ccc23917e5c 100644 (file)
@@ -938,7 +938,7 @@ int main(int argc, char *argv[])
        }
        array_append_zero(&module_names);
        wanted_modules = array_count(&module_names) == 1 ? NULL :
-               array_first(&module_names);
+               array_front(&module_names);
 
        config_path = master_service_get_config_path(master_service);
        /* use strcmp() instead of !=, because dovecot -n always gives us
index 266e6adb5eeaf0aea5dc14bf3fad9e425588d450..e79aa8bf6f377853c086ff63c437640a43fc998d 100644 (file)
@@ -80,7 +80,7 @@ static void dict_connection_cmds_flush(struct dict_connection *conn)
 
        dict_connection_ref(conn);
        while (array_count(&conn->cmds) > 0) {
-               first_cmdp = array_first(&conn->cmds);
+               first_cmdp = array_front(&conn->cmds);
                cmd = *first_cmdp;
 
                i_assert(cmd->async_reply_id == 0);
@@ -659,7 +659,7 @@ static void dict_connection_cmd_output_more(struct dict_connection_cmd *cmd)
        struct dict_connection_cmd *const *first_cmdp;
 
        if (cmd->conn->minor_version < DICT_CLIENT_PROTOCOL_TIMINGS_MIN_VERSION) {
-               first_cmdp = array_first(&cmd->conn->cmds);
+               first_cmdp = array_front(&cmd->conn->cmds);
                if (*first_cmdp != cmd)
                        return;
        }
index 37e16fac273e28bc13044841bf838f2f8a21fde5..774c231343a2821f4966c936b57a519213d03843 100644 (file)
@@ -942,7 +942,7 @@ director_cmd_host_hand_start(struct director_connection *conn,
                          conn->name);
                hosts = mail_hosts_get(conn->dir->mail_hosts);
                while (array_count(hosts) > 0) {
-                       hostp = array_first(hosts);
+                       hostp = array_front(hosts);
                        director_remove_host(conn->dir, NULL, NULL, *hostp);
                }
        } else if (remote_ring_completed == 0 && conn->dir->ring_handshaked) {
index 7e11a21478d49f3da2f724122502625e89fa9be2..de480ff02efc160fca31cbc54fb43d558245b0b2 100644 (file)
@@ -89,7 +89,7 @@ static void director_request_timeout(struct director *dir)
        string_t *str = t_str_new(128);
 
        while (array_count(&dir->pending_requests) > 0) {
-               requestp = array_first_modifiable(&dir->pending_requests);
+               requestp = array_front_modifiable(&dir->pending_requests);
                request = *requestp;
 
                if (request->create_time +
index c5661ab765222a19b0573e9fe6a3cb3eaadac70a..1b0a9305acd07c32a350ca05f5640fb08d303e3d 100644 (file)
@@ -1465,7 +1465,7 @@ void director_deinit(struct director **_dir)
        *_dir = NULL;
 
        while (array_count(&dir->connections) > 0) {
-               connp = array_first(&dir->connections);
+               connp = array_front(&dir->connections);
                conn = *connp;
                director_connection_deinit(&conn, "Shutting down");
        }
@@ -1481,7 +1481,7 @@ void director_deinit(struct director **_dir)
        timeout_remove(&dir->to_remove_dirs);
        timeout_remove(&dir->to_callback);
        while (array_count(&dir->dir_hosts) > 0) {
-               hostp = array_first(&dir->dir_hosts);
+               hostp = array_front(&dir->dir_hosts);
                host = *hostp;
                director_host_free(&host);
        }
index 0373353c6f5e0089b5f5a8fd0504c048f5753fb9..7305f68a4d9662045487e900ce165539062d759a 100644 (file)
@@ -71,9 +71,9 @@ static int dns_client_input_args(struct connection *client, const char *const *a
                        }
                        array_append_zero(&tmp);
                        e_debug(e->event(), "Resolve success: %s",
-                               t_strarray_join(array_first(&tmp), ", "));
+                               t_strarray_join(array_front(&tmp), ", "));
                        o_stream_nsend_str(client->output,
-                                          t_strarray_join(array_first(&tmp), "\t"));
+                                          t_strarray_join(array_front(&tmp), "\t"));
                        o_stream_nsend_str(client->output, "\n");
                }
        } else if (strcmp(args[0], "NAME") == 0) {
index 1351979a3281fe6e2ac7b574738e8a9851a6e7da..cb0808472c65cb4435846984a964665fc078b923 100644 (file)
@@ -523,7 +523,7 @@ int doveadm_cmd_run_ver2(int argc, const char *const argv[],
        }
        i_assert(pargc == array_count(&opts)-1); /* opts is NULL-terminated */
 
-       while((c = getopt_long(argc, (char*const*)argv, str_c(optbuf), array_first(&opts), &li)) > -1) {
+       while((c = getopt_long(argc, (char*const*)argv, str_c(optbuf), array_front(&opts), &li)) > -1) {
                switch(c) {
                case 0:
                        for(unsigned int i = 0; i < array_count(&pargv); i++) {
index 4604160ebce039b0e5d28f78f52b11918ed4e2c0..c6a5f5c6f96dae6c19c2357b7b95ded16c5a1d78 100644 (file)
@@ -223,7 +223,7 @@ mirror_get_remote_cmd_line(const char *const *argv,
        }
        array_push_back(&cmd_args, &p);
        array_append_zero(&cmd_args);
-       *cmd_args_r = array_first(&cmd_args);
+       *cmd_args_r = array_front(&cmd_args);
 }
 
 static const char *const *
@@ -273,7 +273,7 @@ get_ssh_cmd_args(const char *host, const char *login, const char *mail_user)
                array_push_back(&cmd_args, &value);
        }
        array_append_zero(&cmd_args);
-       return array_first(&cmd_args);
+       return array_front(&cmd_args);
 }
 
 static bool mirror_get_remote_cmd(struct dsync_cmd_context *ctx,
@@ -614,7 +614,7 @@ cmd_dsync_run(struct doveadm_mail_cmd_context *_ctx, struct mail_user *user)
                t_strsplit_spaces(doveadm_settings->dsync_hashed_headers, " ,");
        if (array_count(&ctx->exclude_mailboxes) > 0) {
                /* array is NULL-terminated in init() */
-               set.exclude_mailboxes = array_first(&ctx->exclude_mailboxes);
+               set.exclude_mailboxes = array_front(&ctx->exclude_mailboxes);
        }
        doveadm_user_init_dsync(user);
 
index 250b63a19033a6793695d79e2b8ee49af127d398..5bc017313f96489a7ab21692ed254006eb42f22e 100644 (file)
@@ -376,7 +376,7 @@ static void dump_keywords(struct mail_index *index)
        if (count == 0)
                return;
 
-       keywords = array_first(&index->keywords);
+       keywords = array_front(&index->keywords);
        for (i = 0; i < count; i++)
                printf("%3u = %s\n", i, keywords[kw_indexes[i]]);
 }
index 59f491bcdf85a86f0b839732664f07da3d125e46..6db1bf77cc1e54de8cd6b73973d7e504d30f73f1 100644 (file)
@@ -71,7 +71,7 @@ kick_pid_want_kicked(struct kick_context *ctx, const struct kick_pid *k_pid,
        const struct kick_user *user;
 
        if (array_count(&k_pid->users) == 1) {
-               user = array_first(&k_pid->users);
+               user = array_front(&k_pid->users);
                if (!user->kick_me)
                        return FALSE;
        } else {
index bf8396ba10675ebcf795aa375f7624376f0cb3a4..f65ffb2ef94ef22d57f3235323a0b1c103b6c79c 100644 (file)
@@ -606,7 +606,7 @@ cmd_fetch_box(struct fetch_cmd_context *ctx, const struct mailbox_info *info)
 
        if (doveadm_mail_iter_init(&ctx->ctx, info, ctx->ctx.search_args,
                                   ctx->wanted_fields,
-                                  array_first(&ctx->header_fields),
+                                  array_front(&ctx->header_fields),
                                   FALSE,
                                   &iter) < 0)
                return -1;
index 00ff0aef249042fb6e5b74d02d56c9d398c8ed64..5d3dac91a533a4822e96704b55045b48db4fc5bc 100644 (file)
@@ -108,7 +108,7 @@ static void cmd_flags_init(struct doveadm_mail_cmd_context *_ctx,
        }
        if (array_count(&keywords) > 0 || ctx->modify_type == MODIFY_REPLACE) {
                array_append_zero(&keywords);
-               ctx->keywords = array_first(&keywords);
+               ctx->keywords = array_front(&keywords);
        }
 
        _ctx->search_args = doveadm_mail_build_search_args(args+1);
index b87c45871edc4a1515460b82f548597ddf3785a3..2ee8a19f6c3701a509d0bda1a162cd0df67ae737 100644 (file)
@@ -119,7 +119,7 @@ static void doveadm_cmd_callback(int exit_code, const char *error,
 
        if (array_count(&server->queue) > 0) {
                struct server_connection *conn;
-               char *const *usernamep = array_first(&server->queue);
+               char *const *usernamep = array_front(&server->queue);
                char *username = *usernamep;
 
                conn = doveadm_server_find_unused_conn(server);
@@ -337,7 +337,7 @@ static void doveadm_servers_destroy_all_connections(void)
                while (array_count(&server->connections) > 0) {
                        struct server_connection *const *connp, *conn;
 
-                       connp = array_first(&server->connections);
+                       connp = array_front(&server->connections);
                        conn = *connp;
                        server_connection_destroy(&conn);
                }
index 554e4eda8cbcfb86ac33ad4b9d9cad87c36635b8..d59b74c1300914b2e4416667c7925343335005e0 100644 (file)
@@ -1139,7 +1139,7 @@ doveadm_cmd_ver2_to_mail_cmd_wrapper(struct doveadm_cmd_context *cctx)
        array_append_array(&full_args, &pargv);
 
        mctx->args = array_idx(&full_args, args_pos);
-       mctx->full_args = array_first(&full_args);
+       mctx->full_args = array_front(&full_args);
 
        doveadm_mail_cmd_exec(mctx, wildcard_user);
        doveadm_mail_cmd_free(mctx);
index c713e45bb3faf138c4ef6e13b89373c194cb3810..c77398cc156628ab8c7217d363d674c38ae344ca 100644 (file)
@@ -108,7 +108,7 @@ doveadm_mailbox_list_iter_init_nsmask(struct doveadm_mail_cmd_context *ctx,
        iter->only_selectable = TRUE;
        iter->iter_flags = iter_flags;
        iter->iter = mailbox_list_iter_init_namespaces(user->namespaces,
-                                                      array_first(&iter->patterns),
+                                                      array_front(&iter->patterns),
                                                       ns_mask, iter_flags);
        return iter;
 }
index ba1cc71b4332e716bd28c812ac7e89ffa658560f..d0518b097c32a5a67949233bc069576beb2e476e 100644 (file)
@@ -64,7 +64,7 @@ static void doveadm_print_formatted_print(const char *value)
        entry->value = value;
 
        if (ctx.idx >= array_count(&ctx.headers)) {
-               if (var_expand(ctx.buf, ctx.format, array_first(&ctx.headers), &error) <= 0) {
+               if (var_expand(ctx.buf, ctx.format, array_front(&ctx.headers), &error) <= 0) {
                        i_error("Failed to expand print format '%s': %s",
                                ctx.format, error);
                }
index b57033a71fb919bd3b767cb4a5488416e50a62d7..ef62d2b6d427b47fa8ba9a9a775bdcba3217bd71 100644 (file)
@@ -28,7 +28,7 @@ static void who_user_ip(const struct who_user *user, struct ip_addr *ip_r)
        if (array_count(&user->ips) == 0)
                i_zero(ip_r);
        else {
-               const struct ip_addr *ip = array_first(&user->ips);
+               const struct ip_addr *ip = array_front(&user->ips);
                *ip_r = *ip;
        }
 }
index ec885d82c7757455a766eef2a90d3c7620f3a059..69363e5c27ca180c8b60383b5c9771b3b017369b 100644 (file)
@@ -644,7 +644,7 @@ dsync_cache_fields_update(const struct dsync_mailbox *local_box,
        if (array_count(&local_sorted) == 0) {
                /* local has no cached fields. set them to same as remote. */
                array_append_zero(&remote_sorted);
-               update->cache_updates = array_first(&remote_sorted);
+               update->cache_updates = array_front(&remote_sorted);
                return;
        }
 
@@ -689,7 +689,7 @@ dsync_cache_fields_update(const struct dsync_mailbox *local_box,
        i_assert(li == local_count && ri == remote_count);
        if (array_count(&changes) > 0) {
                array_append_zero(&changes);
-               update->cache_updates = array_first(&changes);
+               update->cache_updates = array_front(&changes);
        }
 }
 
index d965478a66eb850e9b6e7e5c04bc13601b11f3ed..bb552dfa8b18e877f1544e9ac0e5aa6290f483eb 100644 (file)
@@ -111,7 +111,7 @@ dsync_ibc_pipe_pop_item(struct dsync_ibc_pipe *pipe, enum item_type type)
        if (array_count(&pipe->item_queue) == 0)
                return NULL;
 
-       item = array_first_modifiable(&pipe->item_queue);
+       item = array_front_modifiable(&pipe->item_queue);
        i_assert(item->type == type);
        pipe->pop_item = *item;
        array_pop_front(&pipe->item_queue);
@@ -129,7 +129,7 @@ static bool dsync_ibc_pipe_try_pop_eol(struct dsync_ibc_pipe *pipe)
        if (array_count(&pipe->item_queue) == 0)
                return FALSE;
 
-       item = array_first(&pipe->item_queue);
+       item = array_front(&pipe->item_queue);
        if (item->type != ITEM_END_OF_LIST)
                return FALSE;
 
@@ -526,7 +526,7 @@ static void pipe_close_mail_streams(struct dsync_ibc_pipe *pipe)
        struct item *item;
 
        if (array_count(&pipe->item_queue) > 0) {
-               item = array_first_modifiable(&pipe->item_queue);
+               item = array_front_modifiable(&pipe->item_queue);
                if (item->type == ITEM_MAIL &&
                    item->u.mail.input != NULL)
                        i_stream_unref(&item->u.mail.input);
index e99631f0c611e8ef336e61048d9f95f6d8ebf8eb..0994fd0b06d149958ab36b451a30773a807120e0 100644 (file)
@@ -745,7 +745,7 @@ dsync_mailbox_export_body_search_init(struct dsync_mailbox_exporter *exporter)
                    array_count(&instances->seqs) == 0)
                        continue;
 
-               uids = array_first(&instances->seqs);
+               uids = array_front(&instances->seqs);
                seq = uids[0].seq1;
                if (!instances->searched) {
                        instances->searched = TRUE;
@@ -762,7 +762,7 @@ dsync_mailbox_export_body_search_init(struct dsync_mailbox_exporter *exporter)
                                                &const_guid);
                                continue;
                        }
-                       uids = array_first(&instances->seqs);
+                       uids = array_front(&instances->seqs);
                        seq = uids[0].seq1;
                        seq_range_array_add(&sarg->value.seqset, seq);
                }
index babb1457988339fb43dcff96d15daf6e5e32185b..39a694a08a474291fc18f366ebba9e3c757c17a6 100644 (file)
@@ -1185,14 +1185,14 @@ merge_keywords(struct mail *mail, const ARRAY_TYPE(const_string) *local_changes,
        if (array_count(&add_keywords) > 0) {
                array_append_zero(&add_keywords);
                kw = mailbox_keywords_create_valid(mail->box,
-                       array_first(&add_keywords));
+                       array_front(&add_keywords));
                mail_update_keywords(mail, MODIFY_ADD, kw);
                mailbox_keywords_unref(&kw);
        }
        if (array_count(&remove_keywords) > 0) {
                array_append_zero(&remove_keywords);
                kw = mailbox_keywords_create_valid(mail->box,
-                       array_first(&remove_keywords));
+                       array_front(&remove_keywords));
                mail_update_keywords(mail, MODIFY_REMOVE, kw);
                mailbox_keywords_unref(&kw);
        }
@@ -1228,7 +1228,7 @@ dsync_mailbox_import_replace_flags(struct mail *mail,
        }
        array_append_zero(&keywords);
 
-       kw = mailbox_keywords_create_valid(mail->box, array_first(&keywords));
+       kw = mailbox_keywords_create_valid(mail->box, array_front(&keywords));
        mail_update_keywords(mail, MODIFY_REPLACE, kw);
        mailbox_keywords_unref(&kw);
 
@@ -2324,7 +2324,7 @@ dsync_mailbox_get_final_keywords(const struct dsync_mail_change *change)
                return NULL;
 
        array_append_zero(&keywords);
-       return array_first(&keywords);
+       return array_front(&keywords);
 }
 
 static void
index 1816ecb5363bbdbeea2fc810eb1e54b8ef30c3d2..075c734020a1cc71245045d599b6c3898ce23462 100644 (file)
@@ -1015,7 +1015,7 @@ int main(int argc, char *argv[])
                        if (array_count(&access_apps) > 0) {
                                (void)array_append_space(&access_apps);
                                main_stdio_run(access_user,
-                                              array_first(&access_apps));
+                                              array_front(&access_apps));
                        } else {
                                main_stdio_run(access_user, NULL);
                        }
index ebd8fc113df64c9aa1e27dea27312d230080a66e..c38da081869593aaf8116bbe58306684537a4981 100644 (file)
@@ -291,7 +291,7 @@ list_get_ref_patterns(struct cmd_list_context *ctx, const char *ref,
                array_push_back(&full_patterns, &pattern);
        }
        array_append_zero(&full_patterns); /* NULL-terminate */
-       return array_first(&full_patterns);
+       return array_front(&full_patterns);
 }
 
 static void cmd_list_init(struct cmd_list_context *ctx,
@@ -455,7 +455,7 @@ bool cmd_list_full(struct client_command_context *cmd, bool lsub)
        }
 
        array_append_zero(&patterns); /* NULL-terminate */
-       patterns_strarr = array_first(&patterns);
+       patterns_strarr = array_front(&patterns);
        if (!ctx->used_listext && !lsub && *patterns_strarr[0] == '\0') {
                /* Only LIST ref "" gets us here */
                cmd_list_ref_root(client, ref);
index f2872445ae47ad492cd08485c67823e5cebe97ff..64388d527f1531bf9edb01e6b460d0ac98f7483e 100644 (file)
@@ -116,8 +116,8 @@ static int orderedsubject_thread_cmp(const struct orderedsubject_thread *t1,
        if (t1->timestamp > t2->timestamp)
                return 1;
 
-       m1 = array_first(&t1->msgs);
-       m2 = array_first(&t2->msgs);
+       m1 = array_front(&t1->msgs);
+       m2 = array_front(&t2->msgs);
        if (*m1 < *m2)
                return -1;
        if (*m1 > *m2)
index ebde6cb6297d3ef7dcc34058a38d2b3050fbd38c..478a7b6b9127296205957604c62ffcffc657dc48 100644 (file)
@@ -1540,7 +1540,7 @@ const char *const *client_enabled_features(struct client *client)
                }
        }
        array_append_zero(&feature_strings);
-       return array_first(&feature_strings);
+       return array_front(&feature_strings);
 }
 
 struct imap_search_update *
index b64c9f97582bed362fd4cafa8ae38c1961e0fc0a..3e6f0827b7a122e5dbb319c95c940b3fc6a4a39a 100644 (file)
@@ -283,7 +283,7 @@ bool client_parse_mail_flags(struct client_command_context *cmd,
                *keywords_r = NULL;
        else {
                array_append_zero(&keywords); /* NULL-terminate */
-               *keywords_r = array_first(&keywords);
+               *keywords_r = array_front(&keywords);
        }
        return TRUE;
 }
@@ -305,7 +305,7 @@ void client_send_mailbox_flags(struct client *client, bool selecting)
                                &status);
 
        keywords = count == 0 ? NULL :
-               array_first(client->keywords.names);
+               array_front(client->keywords.names);
        str = t_str_new(128);
        str_append(str, "* FLAGS (");
        imap_write_flags(str, status.flags, keywords);
@@ -360,7 +360,7 @@ client_get_keyword_names(struct client *client, ARRAY_TYPE(keywords) *dest,
        }
 
        array_append_zero(dest);
-       return array_first(dest);
+       return array_front(dest);
 }
 
 void msgset_generator_init(struct msgset_generator_context *ctx, string_t *str)
index ffeec50bb78fa7bf17e1292a65403c7f16e2b401..1e45770d1ab86ab27baec93c1092611248299c2d 100644 (file)
@@ -41,7 +41,7 @@ void imap_fetch_handler_unregister(const char *name)
 {
        const struct imap_fetch_handler *handler, *first_handler;
 
-       first_handler = array_first(&fetch_handlers);
+       first_handler = array_front(&fetch_handlers);
        handler = imap_fetch_handler_lookup(name);
        i_assert(handler != NULL);
        array_delete(&fetch_handlers, handler - first_handler, 1);
@@ -200,7 +200,7 @@ expunges_drop_known(struct mailbox *box,
        unsigned int i, count;
 
        seqs = array_get(qresync_args->qresync_sample_seqset, &count);
-       uids = array_first(qresync_args->qresync_sample_uidset);
+       uids = array_front(qresync_args->qresync_sample_uidset);
        i_assert(array_count(qresync_args->qresync_sample_uidset) == count);
        i_assert(count > 0);
 
@@ -380,7 +380,7 @@ void imap_fetch_begin(struct imap_fetch_context *ctx, struct mailbox *box,
                                 MAIL_FETCH_STREAM_BODY)) == 0)) {
                array_append_zero(&ctx->all_headers);
 
-               headers = array_first(&ctx->all_headers);
+               headers = array_front(&ctx->all_headers);
                wanted_headers = mailbox_header_lookup_init(box, headers);
                array_pop_back(&ctx->all_headers);
        }
index f31ca948cdc281c1fe5106784e953e4b87a2def0..7453fac98e8afc497741888af78edb29f163e4e4 100644 (file)
@@ -205,7 +205,7 @@ void ipc_connection_destroy(struct ipc_connection **_conn,
        DLLIST_REMOVE(&conn->group->connections, conn);
 
        while (array_count(&conn->cmds) > 0) {
-               cmdp = array_first(&conn->cmds);
+               cmdp = array_front(&conn->cmds);
                cmd = *cmdp;
 
                ipc_connection_cmd_free(&cmd, error);
index 49a4d0591b868bc1473b88fd77b9644a0d5aadb6..779299fce5c925267680247afa2dbf41b8e75198 100644 (file)
@@ -148,7 +148,7 @@ void ipc_groups_deinit(void)
        struct ipc_group *const *groupp, *group;
 
        while (array_count(&ipc_groups) > 0) {
-               groupp = array_first(&ipc_groups);
+               groupp = array_front(&ipc_groups);
                group = *groupp;
 
                while ((*groupp)->connections != NULL) {
index e843eed2a209acbb659e598691fd945cb78f088c..2afde0b202bffcd227e285b47c47623bfa540fed 100644 (file)
@@ -185,7 +185,7 @@ static const char *const *args_hide_passwords(const char *const *args)
                }
        }
        array_append_zero(&new_args);
-       return array_first(&new_args);
+       return array_front(&new_args);
 }
 
 static bool auth_lookup_reply_callback(const char *cmd, const char *const *args,
index 7c83e580ba06e2505bf953c19d2b623cf848ec27..b5ccf9bb2a2b8f99ceca6e379b834072c97b3741 100644 (file)
@@ -223,7 +223,7 @@ ldap_dict_build_query(struct ldap_dict *dict, const struct dict_ldap_map *map,
 
        array_append_zero(&exp);
 
-       if (var_expand(query_r, template, array_first(&exp), &error) <= 0) {
+       if (var_expand(query_r, template, array_front(&exp), &error) <= 0) {
                *error_r = t_strdup_printf("Failed to expand %s: %s", template, error);
                return FALSE;
        }
index 0888f70d3d06c3d4abb5f792599ea0d020893ccd..1a50c36996f1819e8b7a8ebacdda8a275563831f 100644 (file)
@@ -246,7 +246,7 @@ redis_conn_input_more(struct redis_connection *conn, const char **error_r)
                if (line[0] != '*' || str_to_uint(line+1, &num_replies) < 0)
                        break;
 
-               reply = array_first_modifiable(&dict->replies);
+               reply = array_front_modifiable(&dict->replies);
                i_assert(reply->reply_count > 0);
                if (reply->reply_count != num_replies) {
                        *error_r = t_strdup_printf(
@@ -259,7 +259,7 @@ redis_conn_input_more(struct redis_connection *conn, const char **error_r)
                if (*line != '+' && *line != ':')
                        break;
                /* success, just ignore the actual reply */
-               reply = array_first_modifiable(&dict->replies);
+               reply = array_front_modifiable(&dict->replies);
                i_assert(reply->reply_count > 0);
                if (--reply->reply_count == 0) {
                        const struct dict_commit_result result = {
index 5f0f8e30a1be0ca1b894fafbbf41ae94d72eed52..50a5250a0f0dca52723f391657cc7e6391da45a9 100644 (file)
@@ -90,7 +90,7 @@ fts_filter_normalizer_icu_filter(struct fts_filter *filter, const char **token,
        array_append_zero(&np->utf16_token);
        array_pop_back(&np->utf16_token);
        array_clear(&np->trans_token);
-       if (fts_icu_translate(&np->trans_token, array_first(&np->utf16_token),
+       if (fts_icu_translate(&np->trans_token, array_front(&np->utf16_token),
                              array_count(&np->utf16_token),
                              np->transliterator, error_r) < 0)
                return -1;
@@ -98,7 +98,7 @@ fts_filter_normalizer_icu_filter(struct fts_filter *filter, const char **token,
        if (array_count(&np->trans_token) == 0)
                return 0;
 
-       fts_icu_utf16_to_utf8(np->utf8_token, array_first(&np->trans_token),
+       fts_icu_utf16_to_utf8(np->utf8_token, array_front(&np->trans_token),
                              array_count(&np->trans_token));
        fts_filter_truncate_token(np->utf8_token, np->filter.max_length);
        *token = str_c(np->utf8_token);
index f72b77758f611199c82e0da0707cf3b46cac63bf..ca652c36fb9b2bcc79fe1997baedd48d9770bfa7 100644 (file)
@@ -184,7 +184,7 @@ int fts_icu_transliterator_create(const char *id,
 
        t_array_init(&id_utf16, strlen(id));
        fts_icu_utf8_to_utf16(&id_utf16, id);
-       *transliterator_r = utrans_openU(array_first(&id_utf16),
+       *transliterator_r = utrans_openU(array_front(&id_utf16),
                                         array_count(&id_utf16),
                                         UTRANS_FORWARD, NULL, 0, &perr, &err);
        if (U_FAILURE(err)) {
index b3182a7e6129800e3702f61f685ec80e74456a79..048485571f7290160c0338a95e46ce56d85a8cc9 100644 (file)
@@ -196,7 +196,7 @@ fts_language_list_get_first(struct fts_language_list *list)
 {
        const struct fts_language *const *langp;
 
-       langp = array_first(&list->languages);
+       langp = array_front(&list->languages);
        return *langp;
 }
 
@@ -307,7 +307,7 @@ fts_language_detect(struct fts_language_list *list,
        /* if there's only a single wanted language, return it always. */
        if (array_count(&list->languages) == 1) {
                const struct fts_language *const *langp =
-                       array_first(&list->languages);
+                       array_front(&list->languages);
                *lang_r = *langp;
                return FTS_LANGUAGE_RESULT_OK;
        }
index ad8ec10986afed477f52156b5669b08207ee26ef..b00b613a87d2f6de5380d78613d265ae1e57db7f 100644 (file)
@@ -87,7 +87,7 @@ static UTransliterator *get_translit(const char *id)
 
        t_array_init(&id_utf16, 8);
        fts_icu_utf8_to_utf16(&id_utf16, id);
-       translit = utrans_openU(array_first(&id_utf16),
+       translit = utrans_openU(array_front(&id_utf16),
                                array_count(&id_utf16),
                                UTRANS_FORWARD, NULL, 0, &perr, &err);
        test_assert(!U_FAILURE(err));
@@ -134,7 +134,7 @@ static void test_fts_icu_translate_resize(void)
                fts_icu_utf8_to_utf16(&src_utf16, src_utf8);
                t_array_init(&dest, i);
                test_assert(buffer_get_writable_size(dest.arr.buffer) == i*2);
-               test_assert(fts_icu_translate(&dest, array_first(&src_utf16),
+               test_assert(fts_icu_translate(&dest, array_front(&src_utf16),
                                              array_count(&src_utf16),
                                              translit, &error) == 0);
        }
index 1e290bb9b0ca4cb0ff7a35c7290be8103eb9b13e..c0fa40a785d5e378e93aeb06ac6b44424215e974 100644 (file)
@@ -244,7 +244,7 @@ http_client_connection_get_timing_info(struct http_client_connection *conn)
        string_t *str = t_str_new(64);
 
        if (array_count(&conn->request_wait_list) > 0) {
-               requestp = array_first(&conn->request_wait_list);
+               requestp = array_front(&conn->request_wait_list);
 
                str_append(str, "Request ");
                http_client_request_append_stats_text(*requestp, str);
@@ -589,7 +589,7 @@ void http_client_connection_start_request_timeout(
 
        i_assert(array_is_created(&conn->request_wait_list));
        i_assert(array_count(&conn->request_wait_list) > 0);
-       requestp = array_first(&conn->request_wait_list);
+       requestp = array_front(&conn->request_wait_list);
        timeout_msecs = (*requestp)->attempt_timeout_msecs;
 
        if (timeout_msecs == 0)
index 22ea1cd28d97490f86aa29b30cf86f9e172cc286..a3c4cc797635d3ac62ab5f0c92ba4ca6ad6da571 100644 (file)
@@ -451,7 +451,7 @@ int http_message_parse_body(struct http_message_parser *parser, bool request)
                                        && array_is_created(&coding->parameters)
                                        && array_count(&coding->parameters) > 0) {
                                        const struct http_transfer_param *param =
-                                               array_first(&coding->parameters);
+                                               array_front(&coding->parameters);
 
                                        parser->error_code = HTTP_MESSAGE_PARSE_ERROR_BAD_MESSAGE;
                                        parser->error = t_strdup_printf(
index f2eeccf07c6f8723a2e16c52b6a7ad6fb42cb2fb..3990ed63a4721c0e63c6d272f8f3cdeffa329e66 100644 (file)
@@ -275,7 +275,7 @@ imapc_client_find_connection(struct imapc_client *client)
        /* FIXME: stupid algorithm */
        if (array_count(&client->conns) == 0)
                return imapc_client_add_connection(client)->conn;
-       connp = array_first(&client->conns);
+       connp = array_front(&client->conns);
        return (*connp)->conn;
 }
 
index 7984446b47ddb960eb09781b0ef8a37228749014..5f26fe54c6baac5946c0b6d755b55d2a2dda2490 100644 (file)
@@ -2031,7 +2031,7 @@ static void imapc_command_send_finished(struct imapc_connection *conn,
        cmd->sent = TRUE;
 
        /* everything sent. move command to wait list. */
-       cmdp = array_first(&conn->cmd_send_queue);
+       cmdp = array_front(&conn->cmd_send_queue);
        i_assert(*cmdp == cmd);
        array_pop_front(&conn->cmd_send_queue);
        array_push_back(&conn->cmd_wait_list, &cmd);
@@ -2048,7 +2048,7 @@ imapc_command_get_sending_stream(struct imapc_command *cmd)
        if (!array_is_created(&cmd->streams) || array_count(&cmd->streams) == 0)
                return NULL;
 
-       stream = array_first_modifiable(&cmd->streams);
+       stream = array_front_modifiable(&cmd->streams);
        if (stream->pos != cmd->send_pos)
                return NULL;
        return stream;
index e0ee17acdeb9eb46de009126d2008180aa888b65..6280a248e50b0f6eafd3e6af069ffefda01b47a3 100644 (file)
@@ -59,7 +59,7 @@ bool imapc_msgmap_uid_to_rseq(struct imapc_msgmap *msgmap,
                return FALSE;
        }
 
-       first = array_first(&msgmap->uids);
+       first = array_front(&msgmap->uids);
        *rseq_r = (p - first) + 1;
        return TRUE;
 }
index 258a61571617df089b2e8d946f8ac55fc321d9e7..9ee93895e5509974d6654c93eabbda62523fcc96 100644 (file)
@@ -192,7 +192,7 @@ imap_msgpart_parse_header_fields(struct imap_msgpart *msgpart,
                return -1;
 
        array_append_zero(&fields);
-       msgpart->headers = array_first(&fields);
+       msgpart->headers = array_front(&fields);
        return 0;
 }
 
index 5ad7d0678fbcc6b752ea5d1529bd5ed36faa8ea1..8603e004fb488d85a0813d20baafdb3cddf75760 100644 (file)
@@ -193,7 +193,7 @@ imap_match_dup_real(pool_t pool, const struct imap_match_glob *glob)
                array_push_back(&patterns, &p->pattern);
        }
        array_append_zero(&patterns);
-       return imap_match_init_multiple_real(pool, array_first(&patterns),
+       return imap_match_init_multiple_real(pool, array_front(&patterns),
                                             inboxcase, glob->sep);
 }
 
index 084a4347d86a7033ba5fd286c1dddf9137ea2f73..dddf5518994f8d490d2a29d61d8301df90fd20c6 100644 (file)
@@ -536,7 +536,7 @@ static bool imap_parser_is_next_resp_text(struct imap_parser *parser)
            array_count(parser->cur_list) != 1)
                return FALSE;
 
-       arg = array_first(&parser->root_list);
+       arg = array_front(&parser->root_list);
        if (arg->type != IMAP_ARG_ATOM)
                return FALSE;
 
@@ -554,7 +554,7 @@ static bool imap_parser_is_next_text(struct imap_parser *parser)
        if (parser->cur_list != &parser->root_list)
                return FALSE;
 
-       arg = array_last(&parser->root_list);
+       arg = array_back(&parser->root_list);
        if (arg->type != IMAP_ARG_ATOM)
                return FALSE;
 
index 1a2f4624bac3909f3ad1aff050f9dc3e71c7112d..a8157c241bbd73ceb7a18a68cd1c4cbfbc4ca099 100644 (file)
@@ -197,7 +197,7 @@ mail_index_fsck_keywords(struct mail_index *index, struct mail_index_map *map,
 
        /* give new names to invalid keywords */
        changed_count = 0;
-       name_array = array_first_modifiable(&names);
+       name_array = array_front_modifiable(&names);
        for (i = j = 0; i < keywords_count; i++) {
                while (name_array[i][0] == '\0') {
                        name = t_strdup_printf("unknown-%d", j++);
index 4528a592fc3b119ead5867ba790e132c6e255f81..e13beea56f06d86fffe224e56dcbfcb55ef430c1 100644 (file)
@@ -323,7 +323,7 @@ sync_ext_resize(const struct mail_transaction_ext_intro *u,
                ssize_t diff = (ssize_t)new_padded_hdr_size -
                        (ssize_t)old_padded_hdr_size;
 
-               ext = array_first_modifiable(&map->extensions);
+               ext = array_front_modifiable(&map->extensions);
                for (i = ext_map_idx + 1; i < count; i++) {
                        ext[i].ext_offset += diff;
                        ext[i].hdr_offset += diff;
index 17652f0012ebc1938d6af6e642529609aa289250..f168390bc35a61090fa367999ba53a3e087f6a8a 100644 (file)
@@ -220,7 +220,7 @@ mail_index_sync_read_and_sort(struct mail_index_sync_ctx *ctx)
        }
 
        keyword_updates = keyword_count == 0 ? NULL :
-               array_first(&sync_trans->keyword_updates);
+               array_front(&sync_trans->keyword_updates);
        for (i = 0; i < keyword_count; i++) {
                if (array_is_created(&keyword_updates[i].add_seq)) {
                        synclist = array_append_space(&ctx->sync_list);
index 560d30710f8821d7d2ddd38f5a8f95b2f69f1d53..a578ca7c9d206427b6b13bb601df4a8ad8cc6f0c 100644 (file)
@@ -124,7 +124,7 @@ void mail_index_update_day_headers(struct mail_index_transaction *t,
        int i, days;
 
        hdr = *mail_index_get_header(t->view);
-       rec = array_first(&t->appends);
+       rec = array_front(&t->appends);
 
        stamp = time_to_local_day_start(day_stamp);
        if ((time_t)hdr.day_stamp >= stamp)
index 5dc0ed5cf1e34484ee50aba7878433f9918e8232..4da205ad8b771db6a1cf97aaaa812b50f1f69cce 100644 (file)
@@ -295,7 +295,7 @@ static int view_sync_update_keywords(struct mail_index_view_sync_ctx *ctx,
        kw_idx = array_get(&ctx->lost_new_kw, &count);
        if (count == 0)
                return 0;
-       kw_names = array_first(&ctx->view->index->keywords);
+       kw_names = array_front(&ctx->view->index->keywords);
 
        i_zero(&thdr);
        thdr.type = MAIL_TRANSACTION_KEYWORD_UPDATE | MAIL_TRANSACTION_EXTERNAL;
index 2ecd4bf642c092db1f82183eb51d22d8eff3595d..f42d57fd632f459edc2c9154dfdf74f993035ea2 100644 (file)
@@ -275,7 +275,7 @@ int mail_transaction_log_view_set(struct mail_transaction_log_view *view,
           We're mapping the files in reverse order so that _log_file_map()
           can verify that prev_file_offset matches how far it actually managed
           to sync the file. */
-       files = array_first(&view->file_refs);
+       files = array_front(&view->file_refs);
        for (i = array_count(&view->file_refs); i > 0; i--) {
                file = files[i-1];
                start_offset = file->hdr.file_seq == min_file_seq ?
index 919214a38c1fbbc4456f5a1268bd5b0b363d04c8..de52e080cc41d82bf0725ec711582ad0a8c66975 100644 (file)
@@ -396,7 +396,7 @@ int mail_deliver_save(struct mail_deliver_context *ctx, const char *mailbox,
                           later on. */
                        i_assert(array_count(&changes.saved_uids) == 1);
                        const struct seq_range *range =
-                               array_first(&changes.saved_uids);
+                               array_front(&changes.saved_uids);
                        i_assert(range->seq1 == range->seq2);
                        ctx->dest_mail = mail_deliver_open_mail(box, range->seq1,
                                MAIL_FETCH_STREAM_BODY | MAIL_FETCH_GUID, &t);
@@ -653,7 +653,7 @@ mail_deliver_transaction_commit(struct mailbox_transaction_context *ctx,
 
        if (array_count(&changes_r->saved_uids) > 0) {
                const struct seq_range *range =
-                       array_first(&changes_r->saved_uids);
+                       array_front(&changes_r->saved_uids);
 
                mail_deliver_cache_update_post_commit(box, range->seq1);
        }
index ea4249df3e5298ee3f79ea32c45a57f2e8d9a852..639b93107dad8e76ecf15e192122b419e7cbd9a3 100644 (file)
@@ -45,7 +45,7 @@ int ldap_entry_init(struct ldap_entry *obj, struct ldap_result *result,
        ber_free(bptr, 0);
 
        array_append_zero(&attr_names);
-       obj->attr_names = array_first(&attr_names);
+       obj->attr_names = array_front(&attr_names);
 
        return 0;
 }
@@ -65,7 +65,7 @@ const char *const *ldap_entry_get_attribute(const struct ldap_entry *entry, cons
        const struct ldap_attribute *attr;
        array_foreach(&entry->attributes, attr) {
                if (strcasecmp(attr->name, attribute) == 0) {
-                       return array_first(&attr->values);
+                       return array_front(&attr->values);
                }
        }
        return NULL;
index 9d24135630399609f546bf5eb8c8c2ea874dec1b..962fd08bca52faf1c850024b19f1004941e04dae 100644 (file)
@@ -157,7 +157,7 @@ void ldap_connection_search_start(struct ldap_connection *conn,
                        array_push_back(&arr, &tmp);
                }
                array_append_zero(&arr);
-               req->input.search.attributes = array_first_modifiable(&arr);
+               req->input.search.attributes = array_front_modifiable(&arr);
        }
 
        req->send_request_cb = ldap_search_send;
index cbec0e5ac19ede0c3936b461fdba43a003b073f3..f6a3fec1f3495aef8f632eb84674a2de588b66ca 100644 (file)
@@ -134,7 +134,7 @@ istream_attachment_connector_finish(struct istream_attachment_connector **_conn)
        }
        array_append_zero(&conn->streams);
 
-       inputs = array_first_modifiable(&conn->streams);
+       inputs = array_front_modifiable(&conn->streams);
        input = i_stream_create_concat(inputs);
 
        istream_attachment_connector_free(conn);
index d612a7802a8981b59ae16af60aab7b4014dfc9ac..d3f102ed29b7de58dc6a05f43bcfab2b630af193 100644 (file)
@@ -399,7 +399,7 @@ parse_content_language(struct message_part_data *data,
        if (array_count(&langs) > 0) {
                array_append_zero(&langs);
                data->content_language =
-                       p_strarray_dup(pool, array_first(&langs));
+                       p_strarray_dup(pool, array_front(&langs));
        }
 }
 
index e7c9ee25277d21fda8b453921154940b82cab79b..119d48decc8a9e31cce82673fe8ef177f0340d46 100644 (file)
@@ -108,7 +108,7 @@ int rfc2231_parse(struct rfc822_parser_context *ctx,
        if (array_count(&rfc2231_params_arr) == 0) {
                /* No RFC 2231 parameters */
                array_append_zero(&result); /* NULL-terminate */
-               *result_r = array_first(&result);
+               *result_r = array_front(&result);
                return broken ? -1 : 0;
        }
 
@@ -174,6 +174,6 @@ int rfc2231_parse(struct rfc822_parser_context *ctx,
                }
        }
        array_append_zero(&result); /* NULL-terminate */
-       *result_r = array_first(&result);
+       *result_r = array_front(&result);
        return broken ? -1 : 0;
 }
index ecf7f2492f569b6356d8cde5eba27eb9037ed694..26cf2340f8d1ad88e1ec52dd0b116ffe9dea993e 100644 (file)
@@ -178,7 +178,7 @@ static int test_close_attachment_ostream(struct ostream *output, bool success,
 
        i_assert(success);
 
-       a = array_last_modifiable(&attachments);
+       a = array_back_modifiable(&attachments);
        a->decoded_size = output->offset - a->buffer_offset;
 
        if (o_stream_finish(output) < 0)
index d5ae772b47e0570c59a67f3e2567339ea623bbae..8e25736937be4d66dc295551a6128d7a5e5a7aa3 100644 (file)
@@ -254,7 +254,7 @@ void anvil_client_query_abort(struct anvil_client *client,
        *_query = NULL;
 
        count = aqueue_count(client->queries);
-       queries = array_first(&client->queries_arr);
+       queries = array_front(&client->queries_arr);
        for (i = 0; i < count; i++) {
                if (queries[aqueue_idx(client->queries, i)] == query) {
                        query->callback = NULL;
index be9d8b845865b43ae0905ae1a1bea6019c86a110..fcbcf7d15ee1ad77c7f20c58d4e1e7d7f030ff0d 100644 (file)
@@ -165,11 +165,11 @@ static int parse_query(const char *str, struct event_filter_query *query_r,
 
        if (array_is_created(&categories)) {
                array_append_zero(&categories);
-               query_r->categories = array_first(&categories);
+               query_r->categories = array_front(&categories);
        }
        if (array_is_created(&fields)) {
                array_append_zero(&fields);
-               query_r->fields = array_first(&fields);
+               query_r->fields = array_front(&fields);
        }
        return 0;
 }
@@ -542,7 +542,7 @@ config_read_reply_header(struct istream *istream, const char *path, pool_t pool,
                }
                if (input->service == NULL) {
                        array_append_zero(&services);
-                       output_r->specific_services = array_first(&services);
+                       output_r->specific_services = array_front(&services);
                }
        } T_END;
        return 0;
@@ -615,7 +615,7 @@ int master_service_settings_get_filters(struct master_service *service,
        }
 
        array_append_zero(&filters_tmp);
-       *filters = array_first(&filters_tmp);
+       *filters = array_front(&filters_tmp);
        return 0;
 }
 
@@ -684,7 +684,7 @@ int master_service_settings_read(struct master_service *service,
        }
 
        parser = settings_parser_init_list(service->set_pool,
-                       array_first(&all_roots), array_count(&all_roots),
+                       array_front(&all_roots), array_count(&all_roots),
                        SETTINGS_PARSER_FLAG_IGNORE_UNKNOWN_KEYS);
 
        if (fd != -1) {
index 9c1f397852e53c9dcaa10d223c4cdf4bc9e33e4b..bf7e934c38b32d22cc024b2fda3ae6d068401524 100644 (file)
@@ -655,7 +655,7 @@ static void master_service_import_environment_real(const char *import_environmen
        }
        array_append_zero(&keys);
 
-       value = t_strarray_join(array_first(&keys), " ");
+       value = t_strarray_join(array_front(&keys), " ");
        env_put(t_strconcat(DOVECOT_PRESERVE_ENVS_ENV"=", value, NULL));
 }
 
index 86d6db6426d9954060507c874de7972b3626fd1b..8d1da2b3fdb5ffe5abd67a4ec117d96fea8e759d 100644 (file)
@@ -123,7 +123,7 @@ void exec_child(const char *bin_path, const char *const *args,
 
        /* Execute */
 
-       args = array_first(&exec_args);
+       args = array_front(&exec_args);
        execvp_const(args[0], args);
 }
 
index 2fdfcd03db5ef1ca77f9869f1e2a9a74401a511d..5131b10dc3dcd390ebe397838a50d26f2af5fc40 100644 (file)
@@ -1558,7 +1558,7 @@ setting_copy(enum setting_type type, const void *src, void *dest, pool_t pool,
                i_assert(dest_count % 2 == 0);
                for (i = 0; i < count; i += 2) {
                        if (dest_count > 0) {
-                               dest_strings = array_first(dest_arr);
+                               dest_strings = array_front(dest_arr);
                                for (j = 0; j < dest_count; j += 2) {
                                        if (strcmp(strings[i], dest_strings[j]) == 0)
                                                break;
@@ -1722,7 +1722,7 @@ info_update_real(pool_t pool, struct setting_parser_info *parent,
        }
        new_defines = p_new(pool, struct setting_define,
                            array_count(&defines) + 1);
-       memcpy(new_defines, array_first(&defines),
+       memcpy(new_defines, array_front(&defines),
               sizeof(*parent->defines) * array_count(&defines));
        parent->defines = new_defines;
 
@@ -1756,7 +1756,7 @@ info_update_real(pool_t pool, struct setting_parser_info *parent,
        parent->dynamic_parsers =
                p_new(pool, struct dynamic_settings_parser,
                      array_count(&dynamic_parsers) + 1);
-       memcpy(parent->dynamic_parsers, array_first(&dynamic_parsers),
+       memcpy(parent->dynamic_parsers, array_front(&dynamic_parsers),
               sizeof(*parent->dynamic_parsers) *
               array_count(&dynamic_parsers));
        parent->struct_size = new_struct_size;
index 4113b00ff489678fd8aef9d1b69c0cc10015e3f3..025561f47dee792168093a302dbdd54b83479a60 100644 (file)
@@ -607,7 +607,7 @@ int smtp_reply_parse_next(struct smtp_reply_parser *parser,
 
        parser->state.state = SMTP_REPLY_PARSE_STATE_INIT;
        parser->state.reply->text_lines =
-               array_first(&parser->state.reply_lines);
+               array_front(&parser->state.reply_lines);
        *reply_r = parser->state.reply;
        return 1;
 }
@@ -651,7 +651,7 @@ int smtp_reply_parse_ehlo(struct smtp_reply_parser *parser,
 
        parser->state.state = SMTP_REPLY_PARSE_STATE_INIT;
        parser->state.reply->text_lines =
-               array_first(&parser->state.reply_lines);
+               array_front(&parser->state.reply_lines);
        *reply_r = parser->state.reply;
        return 1;
 }
index 1d7c9c8d58c8a7b77258a8374136dd552a77576e..d4c20f079b31053120e99189822cc4ab837c5f9a 100644 (file)
@@ -135,7 +135,7 @@ void smtp_server_cmd_mail(struct smtp_server_cmd_ctx *cmd,
 
        /* [SP Mail-parameters] */
        if (array_is_created(&conn->mail_param_extensions))
-               param_extensions = array_first(&conn->mail_param_extensions);
+               param_extensions = array_front(&conn->mail_param_extensions);
        if (smtp_params_mail_parse(cmd->pool, params, caps, param_extensions,
                                   NULL, &mail_data->params, &pperror,
                                   &error) < 0) {
index 016825e4a0212765d2811acd0765a573e05bafa3..a40ce8202adb5b501d685504295cd0f04c453657 100644 (file)
@@ -164,7 +164,7 @@ void smtp_server_cmd_rcpt(struct smtp_server_cmd_ctx *cmd,
 
        /* [SP Rcpt-parameters] */
        if (array_is_created(&conn->rcpt_param_extensions))
-               param_extensions = array_first(&conn->rcpt_param_extensions);
+               param_extensions = array_front(&conn->rcpt_param_extensions);
        if (smtp_params_rcpt_parse(rcpt->pool, params, caps, param_extensions,
                                   &rcpt->params, &pperror, &error) < 0) {
                switch (pperror) {
index c44d039e6cd1c13745e8ff3e70baf181b2c56ed5..550a879a5a0c2621fe87043a0ce57a5998a49eb6 100644 (file)
@@ -633,7 +633,7 @@ void smtp_server_command_finished(struct smtp_server_command *cmd)
        conn->stats.reply_count++;
 
        i_assert(array_is_created(&cmd->replies));
-       reply = array_first_modifiable(&cmd->replies);
+       reply = array_front_modifiable(&cmd->replies);
        i_assert(reply->content != NULL);
 
        if (reply->content->status == 221 || reply->content->status == 421) {
index 153843de3c36e7a52c72d969163cb6aa146c59e8..718674dfee60fb9c4eb4e8b513f520cb22bb63a2 100644 (file)
@@ -144,7 +144,7 @@ void smtp_server_transaction_write_trace_record(string_t *str,
 
        if (array_count(&trans->rcpt_to) == 1) {
                struct smtp_server_recipient *const *rcpts =
-                       array_first(&trans->rcpt_to);
+                       array_front(&trans->rcpt_to);
 
                rcpt_to = smtp_address_encode(rcpts[0]->path);
        }
index da7c3b1951e1223da2b80375c67b43af27a687be..ebe88c48d823414dde3eaff4413d90f0538a13f8 100644 (file)
@@ -387,7 +387,7 @@ smtp_submit_send_sendmail(struct smtp_submit *subm)
        restrict_access_init(&pc_set.restrict_set);
 
        pc = program_client_local_create
-               (sendmail_bin, array_first(&args), &pc_set);
+               (sendmail_bin, array_front(&args), &pc_set);
 
        program_client_set_input(pc, subm->input);
        i_stream_unref(&subm->input);
index f4a64a785e29b7f268c70e5576fd821815521c0b..d1c63289f58afb578f3a16810f0e12b61e950146 100644 (file)
@@ -274,7 +274,7 @@ static int smtp_parse_ehlo_line(struct smtp_parser *parser,
                param = p_strdup_until(parser->pool, pbegin, parser->cur);
                array_push_back(&params, &param);
                array_append_zero(&params);
-               *params_r = array_first(&params);
+               *params_r = array_front(&params);
        }
        return 1;
 }
index 3bfbbb3e9d31b932adf64f9c0960da9cb5dd5e59..6863c7acb57df9f9b1ab74efd9d38bc98d310245 100644 (file)
@@ -360,7 +360,7 @@ static void driver_cassandra_close(struct cassandra_db *db, const char *error)
        array_clear(&db->pending_prepares);
 
        while (array_count(&db->results) > 0) {
-               resultp = array_first(&db->results);
+               resultp = array_front(&db->results);
                if ((*resultp)->error == NULL)
                        (*resultp)->error = i_strdup(error);
                result_finish(*resultp);
@@ -1637,7 +1637,7 @@ driver_cassandra_result_get_values(struct sql_result *_result)
 {
        struct cassandra_result *result = (struct cassandra_result *)_result;
 
-       return array_first(&result->fields);
+       return array_front(&result->fields);
 }
 
 static const char *driver_cassandra_result_get_error(struct sql_result *_result)
index 929ce3bfc0ce2c4f4ae654dc7df3dd1ec550654c..52546871174c8bc8964707f7234e710d0468d1e6 100644 (file)
@@ -457,7 +457,7 @@ driver_sqlpool_parse_hosts(struct sqlpool_db *db, const char *connect_string,
 
        /* build a new connect string without our settings or hosts */
        array_append_zero(&connect_args);
-       connect_string = t_strarray_join(array_first(&connect_args), " ");
+       connect_string = t_strarray_join(array_front(&connect_args), " ");
 
        if (array_count(&hostnames) == 0) {
                /* no hosts specified. create a default one. */
index aa6cfec0083847602ef0db63719c298148a28fb8..4af45794b8dc73059fdb397494b199e6ae895cf6 100644 (file)
@@ -248,7 +248,7 @@ static void driver_test_exec(struct sql_db *_db, const char *query)
 {
        struct test_sql_db *db = (struct test_sql_db*)_db;
        struct test_driver_result *result =
-               array_first_modifiable(&db->expected);
+               array_front_modifiable(&db->expected);
        i_assert(result->cur < result->nqueries);
 
 /*     i_debug("DUMMY EXECUTE: %s", query);
@@ -278,7 +278,7 @@ driver_test_query_s(struct sql_db *_db, const char *query)
 {
        struct test_sql_db *db = (struct test_sql_db*)_db;
        struct test_driver_result *result =
-               array_first_modifiable(&db->expected);
+               array_front_modifiable(&db->expected);
        struct test_sql_result *res = i_new(struct test_sql_result, 1);
 
        driver_test_exec(_db, query);
@@ -353,7 +353,7 @@ driver_test_update(struct sql_transaction_context *ctx, const char *query,
 {
        struct test_sql_db *db= (struct test_sql_db*)ctx->db;
        struct test_driver_result *result =
-               array_first_modifiable(&db->expected);
+               array_front_modifiable(&db->expected);
        driver_test_exec(ctx->db, query);
 
        if (affected_rows != NULL)
index cb0cc29f1b19d442dc8c4e04cbcc36ca71d71d2a..e5fdd702fca18f4a05cebfc59e7ed1f51a106e2c 100644 (file)
@@ -1321,7 +1321,7 @@ int mdbox_map_append_assign_map_uids(struct mdbox_map_append_context *ctx,
        hdr = mail_index_get_header(ctx->atomic->sync_view);
        t_array_init(&uids, 1);
        mail_index_append_finish_uids(ctx->trans, hdr->next_uid, &uids);
-       range = array_first(&uids);
+       range = array_front(&uids);
        i_assert(range[0].seq2 - range[0].seq1 + 1 == count);
 
        if (hdr->uid_validity == 0) {
index b65ae1211d449d67da50e237e4f772b1a74bce11..00536b5c7b1a890835080470cdb414a5803d7479 100644 (file)
@@ -538,7 +538,7 @@ static int mdbox_purge_get_primary_files(struct mdbox_purge_context *ctx)
        }
        if (array_count(&ctx->primary_file_ids) > 0) {
                const struct seq_range *range =
-                       array_first(&ctx->primary_file_ids);
+                       array_front(&ctx->primary_file_ids);
                ctx->lowest_primary_file_id = range[0].seq1;
        }
        if (errno != 0) {
index 1588ddb7a329d49ba30d6fb42bf73c197fb38678..b1340dc5721fdcb5ea382f9326f1484e9ffd6392 100644 (file)
@@ -199,7 +199,7 @@ static int mdbox_save_finish_write(struct mail_save_context *_ctx)
 
        dbox_save_end(&ctx->ctx);
 
-       mail = array_last_modifiable(&ctx->mails);
+       mail = array_back_modifiable(&ctx->mails);
        if (!ctx->ctx.failed) T_BEGIN {
                if (mdbox_save_mail_write_metadata(ctx, mail) < 0)
                        ctx->ctx.failed = TRUE;
@@ -331,7 +331,7 @@ int mdbox_transaction_save_commit_pre(struct mail_save_context *_ctx)
                unsigned int highest_pop3_uidl_idx;
                uint32_t uid;
 
-               mails = array_first(&ctx->mails);
+               mails = array_front(&ctx->mails);
                highest_pop3_uidl_idx =
                        ctx->ctx.highest_pop3_uidl_seq - mails[0].seq;
                i_assert(mails[highest_pop3_uidl_idx].seq == ctx->ctx.highest_pop3_uidl_seq);
index a0fb58be9a3c629b0d113ed66e6a1cd780a99c74..b1b72a0ae1ef797cb34892129f8da770340370e3 100644 (file)
@@ -188,7 +188,7 @@ static int dbox_save_finish_write(struct mail_save_context *_ctx)
        }
        dbox_save_end(&ctx->ctx);
 
-       files = array_last_modifiable(&ctx->files);
+       files = array_back_modifiable(&ctx->files);
        if (!ctx->ctx.failed) T_BEGIN {
                if (dbox_save_mail_write_metadata(&ctx->ctx, *files) < 0)
                        ctx->ctx.failed = TRUE;
index 4f902dc8359003e3a82eb60aa5e85b67897fbcad..c20917009af0d4a8d3f26d9c63de3b9bd492be53 100644 (file)
@@ -137,7 +137,7 @@ headers_merge(pool_t pool, const char *const *h1, const char *const *h2)
                }
        }
        array_append_zero(&headers);
-       return array_first(&headers);
+       return array_front(&headers);
 }
 
 static bool
@@ -734,7 +734,7 @@ imapc_fetch_header_stream(struct imapc_mail *mail,
                return;
        array_append_zero(&hdr_arr);
 
-       if (headers_have_subset(array_first(&hdr_arr), mail->fetching_headers))
+       if (headers_have_subset(array_front(&hdr_arr), mail->fetching_headers))
                mail->header_list_fetched = TRUE;
 
        if (args->type == IMAP_ARG_LITERAL_SIZE) {
@@ -752,7 +752,7 @@ imapc_fetch_header_stream(struct imapc_mail *mail,
        }
 
        headers_ctx = mailbox_header_lookup_init(mail->imail.mail.mail.box,
-                                                array_first(&hdr_arr));
+                                                array_front(&hdr_arr));
        index_mail_parse_header_init(&mail->imail, headers_ctx);
 
        parser = message_parse_header_init(input, NULL, hdr_parser_flags);
index 5d08acf68e910cd0a0ffd1fdf0bbb1573cf3a113..56e1d2392a9dd2941758a819c38e60398a9943e8 100644 (file)
@@ -593,7 +593,7 @@ static void imapc_untagged_fetch(const struct imapc_untagged_reply *reply,
 
                array_append_zero(&keywords);
                kw = mail_index_keywords_create(mbox->box.index,
-                                               array_first(&keywords));
+                                               array_front(&keywords));
                if (!keywords_are_equal(kw, &old_kws)) {
                        mail_index_update_keywords(mbox->delayed_sync_trans,
                                                   lseq, MODIFY_REPLACE, kw);
index 926f1072f7080ddf2a88080e2b0c5d869567a9a7..2efa751957eae45c45add7b7fc1f73d3c00cc006 100644 (file)
@@ -621,7 +621,7 @@ index_mail_get_parsed_header(struct index_mail *mail, unsigned int field_idx)
        }
 
        array_append_zero(&header_values);
-       return array_first(&header_values);
+       return array_front(&header_values);
 }
 
 static int
@@ -707,7 +707,7 @@ index_mail_get_raw_headers(struct index_mail *mail, const char *field,
        }
 
        array_append_zero(&header_values);
-       *value_r = array_first(&header_values);
+       *value_r = array_front(&header_values);
        return 0;
 }
 
index 8810b3c93cb3a4ae8ccd840e79b1696118a6d57a..91a6dc1f23a4d8c07544cd60a841ef8423650adf 100644 (file)
@@ -281,7 +281,7 @@ const char *const *index_mail_get_keywords(struct mail *_mail)
        unsigned int i, count, names_count;
 
        if (array_is_created(&data->keywords))
-               return array_first(&data->keywords);
+               return array_front(&data->keywords);
 
        (void)index_mail_get_keyword_indexes(_mail);
 
@@ -298,7 +298,7 @@ const char *const *index_mail_get_keywords(struct mail *_mail)
 
        /* end with NULL */
        array_append_zero(&data->keywords);
-       return array_first(&data->keywords);
+       return array_front(&data->keywords);
 }
 
 const ARRAY_TYPE(keyword_indexes) *
@@ -2085,7 +2085,7 @@ void index_mail_add_temp_wanted_fields(struct mail *_mail,
                array_append_zero(&names);
                new_wanted_headers =
                        mailbox_header_lookup_init(_mail->box,
-                                                  array_first(&names));
+                                                  array_front(&names));
                if (data->wanted_headers != NULL)
                        mailbox_header_lookup_unref(&data->wanted_headers);
                data->wanted_headers = new_wanted_headers;
index 4ded8f019447ffce4d225d436de1b04f74f0bc48..da7e5e170926506b0ba17ab8743343d231264b32 100644 (file)
@@ -514,7 +514,7 @@ static int seach_arg_mime_parts_match(struct search_mimepart_context *mpctx,
                                if (part->parent == NULL)
                                        break;
                                array_pop_back(&mpctx->stack);
-                               level = array_last_modifiable(&mpctx->stack);
+                               level = array_back_modifiable(&mpctx->stack);
                                part = part->parent;
                        }
                        level->index++;
index f1729af243d4610ff979805dc2bd1173cf6c5012..804c2cb8a96735c9b7b253b5fd8a2d9dfec44905 100644 (file)
@@ -1263,7 +1263,7 @@ wanted_sort_fields_get(struct mailbox *box,
        if (array_count(&headers) > 0) {
                array_append_zero(&headers);
                *headers_ctx_r = mailbox_header_lookup_init(box,
-                                                       array_first(&headers));
+                                                       array_front(&headers));
        }
 }
 
@@ -1835,7 +1835,7 @@ bool index_storage_search_next_nonblock(struct mail_search_context *_ctx,
        if (!index_sort_list_next(_ctx->sort_program, &seq))
                return FALSE;
 
-       mailp = array_first(&ctx->mails);
+       mailp = array_front(&ctx->mails);
        mail_set_seq(*mailp, seq);
        index_mail_update_access_parts_pre(*mailp);
        index_mail_update_access_parts_post(*mailp);
index 0efda02ebcdfe5c42b3d5dd27ac161b9261c4a03..247bb7e7f2d00433294392519e9ef186d6afe924 100644 (file)
@@ -501,7 +501,7 @@ index_storage_mailbox_update_cache(struct mailbox *box,
        }
        if (array_count(&new_fields) > 0) {
                mail_cache_register_fields(box->cache,
-                                          array_first_modifiable(&new_fields),
+                                          array_front_modifiable(&new_fields),
                                           array_count(&new_fields));
        }
 }
index ecfd0358a4f34e1696b817ec47957303961ce65a..6d8cd996c2c5e447e066041ec5dd06cbce3498b9 100644 (file)
@@ -76,7 +76,7 @@ index_sync_changes_have_expunges(struct index_sync_changes_context *ctx,
        const struct mail_index_sync_rec *syncs;
        unsigned int i;
 
-       syncs = array_first(&ctx->syncs);
+       syncs = array_front(&ctx->syncs);
        for (i = 0; i < count; i++) {
                if (syncs[i].type == MAIL_INDEX_SYNC_TYPE_EXPUNGE) {
                        memcpy(expunged_guid_128_r, syncs[i].guid_128,
index 927a5d790905495156fe6583f87e6ebdd98ed5d4..47b5967da511f51b49602636991c4b609cbf68e7 100644 (file)
@@ -230,7 +230,7 @@ static void gather_base_subjects(struct thread_finish_context *ctx)
                        /* find the oldest child */
                        thread_sort_children(ctx, roots[i].node.idx,
                                             &sorted_children);
-                       children = array_first(&sorted_children);
+                       children = array_front(&sorted_children);
                        idx = children[0].idx;
                } else {
                        /* dummy without children */
@@ -286,7 +286,7 @@ static void mail_thread_root_thread_merge(struct thread_finish_context *ctx,
        } while (root->parent_root_idx1 != 0);
        i_assert(!root->ignore);
 
-       shadows = array_first_modifiable(&ctx->shadow_nodes);
+       shadows = array_front_modifiable(&ctx->shadow_nodes);
        if (cur->dummy) {
                /* If both messages are dummies, append the current
                    message's children to the children of the message in
@@ -353,7 +353,7 @@ static bool merge_subject_threads(struct thread_finish_context *ctx)
                if (roots[i].parent_root_idx1 != 0 && !roots[i].ignore) {
                        mail_thread_root_thread_merge(ctx, &roots[i]);
                        /* more roots may have been added */
-                       roots = array_first_modifiable(&ctx->roots);
+                       roots = array_front_modifiable(&ctx->roots);
                        changed = TRUE;
                }
        }
@@ -370,7 +370,7 @@ static void sort_root_nodes(struct thread_finish_context *ctx)
        unsigned int i, count, child_count;
 
        i_array_init(&sorted_children, 64);
-       shadows = array_first(&ctx->shadow_nodes);
+       shadows = array_front(&ctx->shadow_nodes);
        roots = array_get_modifiable(&ctx->roots, &count);
        for (i = 0; i < count; i++) {
                if (roots[i].ignore)
@@ -425,7 +425,7 @@ static void sort_root_nodes_ref2(struct thread_finish_context *ctx,
        roots = array_get_modifiable(&ctx->roots, &root_count);
 
        /* drop childless dummy nodes */
-       shadows = array_first(&ctx->shadow_nodes);
+       shadows = array_front(&ctx->shadow_nodes);
        for (idx = 1; idx < root_count; idx++) {
                if (roots[idx].dummy &&
                    shadows[roots[idx].node.idx].first_child_idx == 0)
index 8092174420f985f65246d36ed5aa8c595b35fdfa..a09cd3ae1af37b79e60d492f35efcbae1ef61ac1 100644 (file)
@@ -151,7 +151,7 @@ pop3c_client_async_callback(struct pop3c_client *client,
        i_assert(reply != NULL);
        i_assert(array_count(&client->commands) > 0);
 
-       cmd = array_first_modifiable(&client->commands);
+       cmd = array_front_modifiable(&client->commands);
        if (cmd->input != NULL && state == POP3C_COMMAND_STATE_OK &&
            !cmd->reading_dot) {
                /* read the full input into seekable-istream before calling
index 3dd466ec95ff1e05cd0f2cc69128ebed220a3fb4..fad282ced5846471f56089c9ce6afa4f305196fc 100644 (file)
@@ -72,7 +72,7 @@ int pop3c_sync_get_uidls(struct pop3c_mailbox *mbox)
                /* make msg_uidls non-NULL */
                array_append_zero(&uidls);
        }
-       mbox->msg_uidls = array_first(&uidls);
+       mbox->msg_uidls = array_front(&uidls);
        mbox->msg_count = seq;
        return 0;
 }
index 7cf2b5dde61a16c524496ae54f05ea3d5b95f755..69fefb5d43d60e4280dd4fe98596a6a3f8183b77 100644 (file)
@@ -390,7 +390,7 @@ fs_list_get_valid_patterns(struct fs_list_iterate_context *ctx,
                }
        }
        array_append_zero(&valid_patterns); /* NULL-terminate */
-       ctx->valid_patterns = array_first(&valid_patterns);
+       ctx->valid_patterns = array_front(&valid_patterns);
 
        return array_count(&valid_patterns) > 1;
 }
index ff91399d51e0b4a91b93e5e7785009e379c82b03..6dcc7e22cb78aa4932f1bac95b97bb2d6712365d 100644 (file)
@@ -38,7 +38,7 @@ mailbox_uidset_change(struct mail_search_arg *arg, struct mailbox *box,
                return;
        }
        uids = t_new(struct seq_range, count);
-       memcpy(uids, array_first(&arg->value.seqset), sizeof(*uids) * count);
+       memcpy(uids, array_front(&arg->value.seqset), sizeof(*uids) * count);
 
        /* put them back to the range as sequences */
        array_clear(&arg->value.seqset);
index 88214b2e7cd42378743335ec45262aa36d96df7d..c09c31c67513e4b2c6ed9d102ba5964145eb94a1 100644 (file)
@@ -59,7 +59,7 @@ void mail_storage_hooks_add_forced(struct module *module,
        struct mail_storage_module_hooks *hook;
 
        mail_storage_hooks_add(module, hooks);
-       hook = array_last_modifiable(&module_hooks);
+       hook = array_back_modifiable(&module_hooks);
        hook->forced = TRUE;
 }
 
index fac8b133a4ab853dd75b2eff484bb6578df21a59..b314b529cf4c0c8939cac84f6097a7df11147d73 100644 (file)
@@ -561,7 +561,7 @@ static bool mail_storage_settings_check(void *_set, pool_t pool,
                }
 
                array_append_zero(&content_types);
-               set->parsed_mail_attachment_content_type_filter = array_first(&content_types);
+               set->parsed_mail_attachment_content_type_filter = array_front(&content_types);
        }
 
        return TRUE;
index 0886ef2573ef3f5ccdeb1ecb565c1a2cb08dbe8a..8c77e4ab68f0f585bb18ad844fb60ffba2ea8e3c 100644 (file)
@@ -176,7 +176,7 @@ mailbox_get_expunges_full(struct mailbox *box, uint64_t prev_modseq,
        if (ret != 0)
                return ret > 0;
 
-       range = array_first(uids_filter);
+       range = array_front(uids_filter);
        min_uid = range->seq1;
 
        /* first get UIDs of all actual expunges */
index b3f29ddcb8ef61327eba00e3d1eb3817ee373be6..f761b96d93d96fd776771649ae0ab7a327a937c8 100644 (file)
@@ -235,10 +235,10 @@ array_idx_i(const struct array *array, unsigned int idx)
        return CONST_PTR_OFFSET(array->buffer->data, idx * array->element_size);
 }
 
-#define array_first(array) array_idx(array, 0)
-#define array_first_modifiable(array) array_idx_modifiable(array, 0)
-#define array_last(array) array_idx(array, array_count(array)-1)
-#define array_last_modifiable(array) array_idx_modifiable(array, array_count(array)-1)
+#define array_front(array) array_idx(array, 0)
+#define array_front_modifiable(array) array_idx_modifiable(array, 0)
+#define array_back(array) array_idx(array, array_count(array)-1)
+#define array_back_modifiable(array) array_idx_modifiable(array, array_count(array)-1)
 #define array_pop_back(array) array_delete(array, array_count(array)-1, 1);
 #define array_push_back(array, item) array_append(array, (item), 1)
 #define array_pop_front(array) array_delete(array, 0, 1)
index 02e4497fc69adc20b65486ee9c53c567eaa67796..05364a17d555871c3a8724085c7c66ec727839a2 100644 (file)
@@ -240,7 +240,7 @@ void event_filter_merge(struct event_filter *dest,
                                                &event_filter_log_type_names[i]);
                        }
                        array_append_zero(&categories);
-                       query.categories = array_first(&categories);
+                       query.categories = array_front(&categories);
                }
                if (int_query->fields_count > 0) {
                        ARRAY(struct event_filter_field) fields;
@@ -253,7 +253,7 @@ void event_filter_merge(struct event_filter *dest,
                                field->value = p_strdup(dest->pool, int_query->fields[i].value.str);
                        }
                        array_append_zero(&fields);
-                       query.fields = array_first(&fields);
+                       query.fields = array_front(&fields);
                }
 
                event_filter_add(dest, &query);
@@ -340,11 +340,11 @@ bool event_filter_import_unescaped(struct event_filter *filter,
                        /* finish the query */
                        if (array_count(&categories) > 0) {
                                array_append_zero(&categories);
-                               query.categories = array_first(&categories);
+                               query.categories = array_front(&categories);
                        }
                        if (array_count(&fields) > 0) {
                                array_append_zero(&fields);
-                               query.fields = array_first(&fields);
+                               query.fields = array_front(&fields);
                        }
                        event_filter_add(filter, &query);
 
index f8baa8e25dbfcc1fbb8e0f7c4bb7dd03e735c136..e532de8a72ce55431b27920bd4d8e4e2a9544f9a 100644 (file)
@@ -146,7 +146,7 @@ struct priorityq_item *priorityq_peek(struct priorityq *pq)
        if (array_count(&pq->items) == 0)
                return NULL;
 
-       items = array_first(&pq->items);
+       items = array_front(&pq->items);
        return items[0];
 }
 
@@ -167,5 +167,5 @@ struct priorityq_item *const *priorityq_items(struct priorityq *pq)
        if (array_count(&pq->items) == 0)
                return NULL;
 
-       return array_first(&pq->items);
+       return array_front(&pq->items);
 }
index ef4c3270dc6fb7873217b7a0deec1027be0cf8e3..cf98e127535761ecc29f0829fc8b54f379aa36c3 100644 (file)
@@ -861,6 +861,6 @@ char *p_array_const_string_join(pool_t pool, const ARRAY_TYPE(const_string) *arr
 {
        if (array_count(arr) == 0)
                return "";
-       return p_strarray_join_n(pool, array_first(arr), array_count(arr),
+       return p_strarray_join_n(pool, array_front(arr), array_count(arr),
                                 separator);
 }
index 43ed5fcfab0a0150e8e73c314bebb7fd6faf8566..a8e8bff2ac16edc569f6179bc978cfdb8ca6718b 100644 (file)
@@ -144,7 +144,7 @@ static void test_array_reverse(void)
                array_append(&intarr, input, i);
                array_reverse(&intarr);
 
-               output = i == 0 ? NULL : array_first(&intarr);
+               output = i == 0 ? NULL : array_front(&intarr);
                for (j = 0; j < i; j++)
                        test_assert(input[i-j-1] == output[j]);
        }
@@ -305,7 +305,7 @@ enum fatal_test_state fatal_array(unsigned int stage)
                t_array_init(&ad, 3);
                /* allocation big enough, but memory not initialised */
                test_expect_fatal_string("(array_idx_i): assertion failed: (idx < array->buffer->used / array->element_size)");
-               useless_ptr = array_first(&ad);
+               useless_ptr = array_front(&ad);
                return FATAL_TEST_FAILURE;
        }
 
index 0a23937691113c835099e09470cc78fad55776bd..8ba6ba03a96ad48b32149bc6366ac9a5331bd49b 100644 (file)
@@ -71,10 +71,10 @@ static void test_seq_range_array_remove_nth(void)
        test_assert(array_count(&range) == 3);
 
        seq_range_array_remove_nth(&range, 0, 2);
-       r = array_first(&range); test_assert(r->seq1 == 3 && r->seq2 == 5);
+       r = array_front(&range); test_assert(r->seq1 == 3 && r->seq2 == 5);
 
        seq_range_array_remove_nth(&range, 1, 4);
-       r = array_first(&range); test_assert(r->seq1 == 3 && r->seq2 == 3);
+       r = array_front(&range); test_assert(r->seq1 == 3 && r->seq2 == 3);
        r = array_idx(&range, 1); test_assert(r->seq1 == 11 && r->seq2 == 20);
 
        seq_range_array_remove_nth(&range, 5, (uint32_t)-1);
index 6b784f4103bea33fc93771c5f8024968fb3f4a69..aa0a9b3e9d0f871daff7084561f3ba9f6daec2d4 100644 (file)
@@ -242,7 +242,7 @@ int var_expand_if(struct var_expand_context *ctx,
        }
 
        array_append_zero(&params);
-       parms = array_first(&params);
+       parms = array_front(&params);
        t_array_init(&params, 6);
 
        for(;*parms != NULL; parms++) {
@@ -260,7 +260,7 @@ int var_expand_if(struct var_expand_context *ctx,
        i_assert(array_count(&params) == 5);
 
        /* execute comparison */
-       const char *const *args = array_first(&params);
+       const char *const *args = array_front(&params);
        if (var_expand_if_comp(args[0], args[1], args[2], &result, error_r)<0)
                return -1;
        *result_r = result ? args[3] : args[4];
index 56ea67a05c6a886fedddbedc09770221034d2638..11b930a77eadb62f7bf28c30ac433f1c3233de09 100644 (file)
@@ -824,5 +824,5 @@ var_expand_merge_tables(pool_t pool, const struct var_expand_table *a,
                entry->long_key = p_strdup(pool, b[i].long_key);
        }
        array_append_zero(&table);
-       return array_first_modifiable(&table);
+       return array_front_modifiable(&table);
 }
index 81a5725ebca968ee9c327527bd1998a1a2550e1e..4992c73d116b7e8946ebfc99ff4a8ff1cef422a9 100644 (file)
@@ -224,7 +224,7 @@ static void client_auth_parse_args(struct client *client, bool success,
 
                alt = p_new(client->pool, const char *,
                            array_count(&alt_usernames) + 1);
-               memcpy(alt, array_first(&alt_usernames),
+               memcpy(alt, array_front(&alt_usernames),
                       sizeof(*alt) * array_count(&alt_usernames));
                client->alt_usernames = alt;
        }
index c5df95216bc126bfb3ba020772a38274610da846..1cda677ffa9ae730dee057da73b0ef380c961fea 100644 (file)
@@ -40,7 +40,7 @@ static void service_process_notify_reset(struct service_process_notify *notify)
        if (notify->io_write == NULL)
                return;
 
-       processes = array_first_modifiable(&notify->processes);
+       processes = array_front_modifiable(&notify->processes);
        count = aqueue_count(notify->process_queue);
        for (i = 0; i < count; i++) {
                process = processes[aqueue_idx(notify->process_queue, i)];
@@ -57,7 +57,7 @@ static void notify_flush(struct service_process_notify *notify)
        struct service_process *const *processes, *process;
 
        while (aqueue_count(notify->process_queue) > 0) {
-               processes = array_first_modifiable(&notify->processes);
+               processes = array_front_modifiable(&notify->processes);
                process = processes[aqueue_idx(notify->process_queue, 0)];
 
                if (notify->write_callback(notify->fd, process) < 0) {
index e9fcb60aa14c9f47f67c7abe461dc726739cdfa4..87d76ebd0a7ae4b8f1782d16e3e020d942d9ce0c 100644 (file)
@@ -364,13 +364,13 @@ int acl_rights_update_import(struct acl_rights_update *update,
        }
        if (array_count(&dest_rights) > 0) {
                array_append_zero(&dest_rights);
-               update->rights.rights = array_first(&dest_rights);
+               update->rights.rights = array_front(&dest_rights);
        } else if (update->modify_mode == ACL_MODIFY_MODE_REPLACE) {
                update->modify_mode = ACL_MODIFY_MODE_CLEAR;
        }
        if (array_count(&dest_neg_rights) > 0) {
                array_append_zero(&dest_neg_rights);
-               update->rights.neg_rights = array_first(&dest_neg_rights);
+               update->rights.neg_rights = array_front(&dest_neg_rights);
        } else if (update->neg_modify_mode == ACL_MODIFY_MODE_REPLACE) {
                update->neg_modify_mode = ACL_MODIFY_MODE_CLEAR;
        }
@@ -695,7 +695,7 @@ bool acl_right_names_modify(pool_t pool,
                }
                new_rights = &null;
                modify_rights = array_count(&rights) == 0 ? NULL :
-                       array_first(&rights);
+                       array_front(&rights);
                acl_right_names_merge(pool, &new_rights, modify_rights, TRUE);
                break;
        case ACL_MODIFY_MODE_ADD:
index 36ec97206f568b98b7ac6e4f0ac68f1d240543a5..a139f8b1290e2f4311826b5db41cdd47fd14d90a 100644 (file)
@@ -338,7 +338,7 @@ const char *const *acl_cache_get_names(struct acl_cache *cache,
                                       unsigned int *count_r)
 {
        *count_r = array_count(&cache->right_idx_name_map);
-       return array_first(&cache->right_idx_name_map);
+       return array_front(&cache->right_idx_name_map);
 }
 
 static void
index 94490e1af7257d63e24b5240c8298f77d3e1f681..410c652ac65ef0eb70417ca96b69cc3499a9750f 100644 (file)
@@ -88,7 +88,7 @@ static void apparmor_mail_user_created(struct mail_user *user)
        random_fill(&auser->token, sizeof(auser->token));
 
        /* try change hat */
-       if (aa_change_hatv(array_first_modifiable(&hats), auser->token) < 0) {
+       if (aa_change_hatv(array_front_modifiable(&hats), auser->token) < 0) {
                i_fatal("aa_change_hatv(%s) failed: %m",
                        t_array_const_string_join(&hats, ","));
        }
index c18320ed2c5e9f1aac89e1fb687b943e4ec6e872..b6aab1a6fa9b7930768d1762457b155e498e4942 100644 (file)
@@ -184,7 +184,7 @@ static const char *const *doveadm_expire_get_patterns(void)
                str = doveadm_plugin_getenv(set_name);
        }
        array_append_zero(&patterns);
-       return array_first(&patterns);
+       return array_front(&patterns);
 }
 
 static bool
index 271f4650c55ed3745ddca91e31283e31856cde8a..89bbddd28c860f6bfd70f90002611342d8cfb6c1 100644 (file)
@@ -395,7 +395,7 @@ static const char *const *expire_get_patterns(struct mail_user *user)
                str = mail_user_set_plugin_getenv(user->set, set_name);
        }
        array_append_zero(&patterns);
-       return array_first(&patterns);
+       return array_front(&patterns);
 }
 
 static void expire_mail_user_created(struct mail_user *user)
index 3f5733b691967a608f6ea474eebae51b603202c2..47ea74d04140b86f23eb4af9bc7c8a3c48b9c35f 100644 (file)
@@ -540,7 +540,7 @@ mailboxes_get_guids(struct mailbox *const boxes[],
        }
 
        array_append_zero(&box_results);
-       result->box_results = array_first_modifiable(&box_results);
+       result->box_results = array_front_modifiable(&box_results);
        return 0;
 }
 
index 2521fdf54b1a9c480b566b8058e5af7a35239356..ca98a69ab94ff5296422feffeca85bcd2dbfd588 100644 (file)
@@ -821,7 +821,7 @@ solr_search_multi(struct solr_fts_backend *backend, string_t *str,
                fts_result->scores_sorted = TRUE;
        }
        array_append_zero(&fts_results);
-       result->box_results = array_first_modifiable(&fts_results);
+       result->box_results = array_front_modifiable(&fts_results);
        hash_table_destroy(&mailboxes);
        return 0;
 }
index ffeb5ed9fb7746c2d85134af2e1d8b996c4ac6fb..101a7faae4932e1d46dbe1c124e99339f1ae12d8 100644 (file)
@@ -927,7 +927,7 @@ solr_search_multi(struct fts_backend *_backend, string_t *str,
                fts_result->scores_sorted = TRUE;
        }
        array_append_zero(&fts_results);
-       result->box_results = array_first_modifiable(&fts_results);
+       result->box_results = array_front_modifiable(&fts_results);
        hash_table_destroy(&mailboxes);
        return 0;
 }
index 430403de1d79640d91ba1e6f36b3769657816279..be1ee8f8d704852876f79cc61a437313d0f3e6f9 100644 (file)
@@ -489,7 +489,7 @@ int solr_connection_select(struct solr_connection *conn, const char *query,
        hash_table_destroy(&solr_lookup_context.mailboxes);
 
        array_append_zero(&solr_lookup_context.results);
-       *box_results_r = array_first_modifiable(&solr_lookup_context.results);
+       *box_results_r = array_front_modifiable(&solr_lookup_context.results);
        return parse_ret;
 }
 
index 8844ab2d386ddeeb1b4dd67cb1d9225be00f01e8..00a1eb02c5afd832757a5b898223f469143ce829 100644 (file)
@@ -766,12 +766,12 @@ uidlist_write_block_list_and_header(struct squat_uidlist_build_context *ctx,
        /* write end indexes */
        o_stream_nsend(output, uidlist->cur_block_end_indexes,
                       old_block_count * sizeof(uint32_t));
-       o_stream_nsend(output, array_first(block_end_indexes),
+       o_stream_nsend(output, array_front(block_end_indexes),
                       new_block_count * sizeof(uint32_t));
        /* write offsets */
        o_stream_nsend(output, uidlist->cur_block_offsets,
                       old_block_count * sizeof(uint32_t));
-       o_stream_nsend(output, array_first(block_offsets),
+       o_stream_nsend(output, array_front(block_offsets),
                       new_block_count * sizeof(uint32_t));
        (void)o_stream_flush(output);
 
@@ -977,7 +977,7 @@ uint32_t squat_uidlist_rebuild_next(struct squat_uidlist_rebuild_context *ctx,
        int ret;
 
        T_BEGIN {
-               ret = uidlist_write_array(ctx->output, array_first(uids),
+               ret = uidlist_write_array(ctx->output, array_front(uids),
                                          array_count(uids), 0, 0, FALSE,
                                          &ctx->list_sizes[ctx->list_idx]);
        } T_END;
index 2fd9f883980e595109c24c5822b99e85bba9f7b1..4409585141a5404f9da3c4024a772c6cc048a377 100644 (file)
@@ -278,7 +278,7 @@ fts_expunge_log_export(struct fts_expunge_log_append_ctx *ctx,
                memcpy(rec->guid, mailbox->guid, sizeof(rec->guid));
 
                /* uint32_t expunge_uid_ranges[]; */
-               buffer_append(output, array_first(&mailbox->uids),
+               buffer_append(output, array_front(&mailbox->uids),
                              array_count(&mailbox->uids) *
                              sizeof(struct seq_range));
                /* uint32_t expunge_count; */
index 49ac00d31141636803b1f0e39104635fcdad156c..6afc6aa259bd7c99fa379f7eb19bd985503d4fe4 100644 (file)
@@ -189,7 +189,7 @@ static int fts_search_lookup_level_multi(struct fts_search_context *fctx,
 
                mail_search_args_reset(args, TRUE);
                if (fts_backend_lookup_multi(backend,
-                                            array_first(&tmp_mailboxes),
+                                            array_front(&tmp_mailboxes),
                                             args, flags, &result) < 0)
                        return -1;
 
index caf440019463886d0de29f6cddeeaea2a2acd887..fe72ad8b5aa539a77fc5c957b09ed6fd30bf7f54 100644 (file)
@@ -807,7 +807,7 @@ static const char *const *fts_exclude_get_patterns(struct mail_user *user)
                str = mail_user_plugin_getenv(user, set_name);
        }
        array_append_zero(&patterns);
-       return array_first(&patterns);
+       return array_front(&patterns);
 }
 
 static bool fts_autoindex_exclude_match(struct mailbox *box)
index 2f12b5aea85672bae1868883998eb911d7861d14..4bb1f414e0af2128535e8ac24b80d5c98ddf4b9e 100644 (file)
@@ -46,7 +46,7 @@ static const char *const *str_keyvalues_to_array(const char *str)
                array_push_back(&arr, &value);
        }
        array_append_zero(&arr);
-       return array_first(&arr);
+       return array_front(&arr);
 }
 
 static int
index c32a3942ba400c18448fd86dfedf4c159085e705..df3608b494ef6472247e7e174e733b6664d4f408 100644 (file)
@@ -424,7 +424,7 @@ imap_acl_letters_parse(const char *letters, const char *const **rights_r,
                }
        }
        array_append_zero(&rights);
-       *rights_r = array_first(&rights);
+       *rights_r = array_front(&rights);
        return 0;
 }
 
@@ -526,7 +526,7 @@ static void imap_acl_update_ensure_keep_admins(struct acl_backend *backend,
                return;
        }
        array_append_zero(&new_rights);
-       update->rights.rights = array_first(&new_rights);
+       update->rights.rights = array_front(&new_rights);
 }
 
 static int
index 9f1367f777628157e293def98937c57304aa63d6..4c5ed38db04dd6c245f49b2f6caf28388235e259 100644 (file)
@@ -79,7 +79,7 @@ static void test_try_load_keys(void)
                test_assert(strcmp(binary_to_hex(key_id->data, key_id->used), pubid1) == 0);
 
                const struct mail_crypt_global_private_key *key =
-                       array_first(&keys.private_keys);
+                       array_front(&keys.private_keys);
 
                buffer_set_used_size(key_id, 0);
                test_assert(dcrypt_key_id_private(key->key, MAIL_CRYPT_KEY_ID_ALGORITHM, key_id, &error) == TRUE);
index 4a1be1be713066ef1483e0f3d2c9c85fd8e74ae2..6abdfdc6980457083b1b0b3a8eaa6b70d8ce557e 100644 (file)
@@ -257,7 +257,7 @@ imapc_quota_refresh_update(struct quota *quota,
                return;
        }
        /* use the first quota root for everything */
-       refresh_root = array_first(&refresh->roots);
+       refresh_root = array_front(&refresh->roots);
 
        array_foreach(&quota->roots, rootp) {
                if ((*rootp)->backend.name == quota_backend_imapc.name) {
@@ -348,7 +348,7 @@ static int imapc_quota_refresh_root(struct imapc_quota_root *root,
           anything we didn't expect. */
        while (array_count(&root->refresh.roots) > 0) {
                const struct imapc_quota_refresh_root *refresh_root =
-                       array_first(&root->refresh.roots);
+                       array_front(&root->refresh.roots);
                if (strcmp(refresh_root->name, root->root_name) == 0)
                        break;
                array_pop_front(&root->refresh.roots);
index a8f0c86bc57e0453177b5853b4691859b3bc9ea0..91a2ff47d2b5374d89945196a696ca54734a2cc9 100644 (file)
@@ -72,7 +72,7 @@ virtual_copy_keywords(struct mailbox *src_box,
        }
        array_append_zero(&kw_strings);
        return mailbox_keywords_create_valid(dest_box,
-                                            array_first(&kw_strings));
+                                            array_front(&kw_strings));
 }
 
 int virtual_save_begin(struct mail_save_context *_ctx, struct istream *input)
index c3f7447faedef6aad226d47f22208f881da5a3b0..6727738740d26d5261b907cf49c99062f94b7e90 100644 (file)
@@ -447,7 +447,7 @@ static int virtual_sync_index_changes(struct virtual_sync_context *ctx)
 
        keywords = mail_index_get_keywords(ctx->index);
        ctx->kw_all = array_count(keywords) == 0 ? NULL :
-               array_first(keywords);
+               array_front(keywords);
        while (mail_index_sync_next(ctx->index_sync_ctx, &sync_rec)) {
                if (virtual_sync_index_rec(ctx, &sync_rec) < 0)
                        return -1;
@@ -1078,7 +1078,7 @@ static int virtual_sync_backend_box_sync(struct virtual_sync_context *ctx,
                        if (!virtual_sync_find_seqs(bbox, &sync_rec,
                                                    &idx1, &idx2))
                                break;
-                       uidmap = array_first(&bbox->uids);
+                       uidmap = array_front(&bbox->uids);
                        for (; idx1 <= idx2; idx1++) {
                                vuid = uidmap[idx1].virtual_uid;
                                if (vuid == 0) {
index 9f0207d383960026aaa51bac81596f1f3c0d1b5c..b8bfd6f6fc686f84289e7e224ef4aadd33491ee8 100644 (file)
@@ -66,7 +66,7 @@ exec_child(struct master_service_connection *conn,
                        env_put(*envs);
         }
 
-       args = array_first(&exec_args);
+       args = array_front(&exec_args);
        execvp_const(args[0], args);
 }
 
@@ -187,7 +187,7 @@ static bool client_exec_script(struct master_service_connection *conn)
 
        if (noreply) {
                /* no need to fork and check exit status */
-               exec_child(conn, args, array_first(&envs));
+               exec_child(conn, args, array_front(&envs));
                i_unreached();
        }
 
@@ -198,7 +198,7 @@ static bool client_exec_script(struct master_service_connection *conn)
 
        if (pid == 0) {
                /* child */
-               exec_child(conn, args, array_first(&envs));
+               exec_child(conn, args, array_front(&envs));
                i_unreached();
        }
 
@@ -267,7 +267,7 @@ int main(int argc, char *argv[])
        argv += optind;
 
        array_append_zero(&aenvs);
-       accepted_envs = p_strarray_dup(default_pool, array_first(&aenvs));
+       accepted_envs = p_strarray_dup(default_pool, array_front(&aenvs));
 
        master_service_init_log(master_service, "script: ");
        if (argv[0] == NULL)