unsigned int destroyed:1;
};
-static ARRAY_DEFINE(auth_failures_arr, struct auth_request *);
+static ARRAY(struct auth_request *) auth_failures_arr;
static struct aqueue *auth_failures;
static struct timeout *to_auth_failures;
const char **error_r)
{
const char *const *tmp;
- ARRAY_DEFINE(ips_array, struct ip_addr);
+ ARRAY(struct ip_addr) ips_array;
struct ip_addr *ips;
unsigned int ips_count;
int ret;
unsigned int worker_max_count;
- ARRAY_DEFINE(passdbs, struct auth_passdb_settings *);
- ARRAY_DEFINE(userdbs, struct auth_userdb_settings *);
+ ARRAY(struct auth_passdb_settings *) passdbs;
+ ARRAY(struct auth_userdb_settings *) userdbs;
const char *base_dir;
bool verbose_proctitle;
unsigned int shutdown:1;
};
-static ARRAY_DEFINE(connections, struct auth_worker_connection *) = ARRAY_INIT;
+static ARRAY(struct auth_worker_connection *) connections = ARRAY_INIT;
static unsigned int idle_count = 0, auth_workers_with_errors = 0;
-static ARRAY_DEFINE(worker_request_array, struct auth_worker_request *);
+static ARRAY(struct auth_worker_request *) worker_request_array;
static struct aqueue *worker_request_queue;
static time_t auth_worker_last_warn;
static unsigned int auth_workers_throttle_count;
.override_fields = ""
};
-static ARRAY_DEFINE(auths, struct auth *);
+static ARRAY(struct auth *) auths;
static void
auth_passdb_preinit(struct auth *auth, const struct auth_passdb_settings *set,
/* Request queue contains sent requests at tail (msgid != -1) and
queued requests at head (msgid == -1). */
struct aqueue *request_queue;
- ARRAY_DEFINE(request_array, struct ldap_request *);
+ ARRAY(struct ldap_request *) request_array;
/* Number of messages in queue with msgid != -1 */
unsigned int pending_count;
static pool_t auth_set_pool;
static struct module *modules = NULL;
static struct mechanisms_register *mech_reg;
-static ARRAY_DEFINE(listeners, struct auth_socket_listener);
+static ARRAY(struct auth_socket_listener) listeners;
void auth_refresh_proctitle(void)
{
#include "passdb-template.h"
struct passdb_template {
- ARRAY_DEFINE(args, const char *);
+ ARRAY(const char *) args;
};
struct passdb_template *passdb_template_build(pool_t pool, const char *args)
#include <stdlib.h>
-static ARRAY_DEFINE(passdb_interfaces, struct passdb_module_interface *);
-static ARRAY_DEFINE(passdb_modules, struct passdb_module *);
+static ARRAY(struct passdb_module_interface *) passdb_interfaces;
+static ARRAY(struct passdb_module *) passdb_modules;
static const struct passdb_module_interface passdb_iface_deinit = {
.name = "deinit"
#include "userdb-template.h"
struct userdb_template {
- ARRAY_DEFINE(args, const char *);
+ ARRAY(const char *) args;
};
struct userdb_template *
#include <stdlib.h>
-static ARRAY_DEFINE(userdb_interfaces, struct userdb_module_interface *);
-static ARRAY_DEFINE(userdb_modules, struct userdb_module *);
+static ARRAY(struct userdb_module_interface *) userdb_interfaces;
+static ARRAY(struct userdb_module *) userdb_modules;
static const struct userdb_module_interface userdb_iface_deinit = {
.name = "deinit"
const char *path;
const char *module;
- ARRAY_DEFINE(all_parsers, struct config_filter_parser *);
+ ARRAY(struct config_filter_parser *) all_parsers;
struct config_module_parser *root_parsers;
struct config_section_stack *cur_section;
struct input_stack *cur_input;
struct module_dir_load_settings mod_set;
struct module *m;
const struct setting_parser_info **roots;
- ARRAY_DEFINE(new_roots, const struct setting_parser_info *);
+ ARRAY(const struct setting_parser_info *) new_roots;
ARRAY_TYPE(service_settings) new_services;
struct service_settings *const *services, *service_set;
unsigned int i, count;
/* There are only a few transactions per client, so keeping them in
array is fast enough */
- ARRAY_DEFINE(transactions, struct dict_connection_transaction);
+ ARRAY(struct dict_connection_transaction) transactions;
};
struct dict_connection *dict_connection_create(int fd);
struct dict_settings {
const char *base_dir;
const char *dict_db_config;
- ARRAY_DEFINE(dicts, const char *);
+ ARRAY(const char *) dicts;
};
extern const struct setting_parser_info dict_setting_parser_info;
static struct director_connection *director_connections;
static HASH_TABLE(char *, struct user *) users;
static HASH_TABLE(struct ip_addr *, struct host *) hosts;
-static ARRAY_DEFINE(hosts_array, struct host *);
+static ARRAY(struct host *) hosts_array;
static struct admin_connection *admin;
static struct timeout *to_disconnect;
is long. */
struct director_connection *left, *right;
/* all director connections */
- ARRAY_DEFINE(connections, struct director_connection *);
+ ARRAY(struct director_connection *) connections;
struct timeout *to_reconnect;
struct timeout *to_sync;
struct user_directory *users;
/* these requests are waiting for directors to be in synced */
- ARRAY_DEFINE(pending_requests, struct director_request *);
+ ARRAY(struct director_request *) pending_requests;
struct timeout *to_request;
struct timeout *to_handshake_warning;
director_state_change_callback_t *state_change_callback;
/* director hosts are sorted by IP (and port) */
- ARRAY_DEFINE(dir_hosts, struct director_host *);
+ ARRAY(struct director_host *) dir_hosts;
struct timeout *to_remove_dirs;
struct ipc_client *ipc_proxy;
struct mail_host_list {
ARRAY_TYPE(mail_host) hosts;
- ARRAY_DEFINE(vhosts, struct mail_host *);
+ ARRAY(struct mail_host *) vhosts;
bool hosts_unsorted;
};
static void director_state_changed(struct director *dir)
{
struct director_request *const *requestp;
- ARRAY_DEFINE(new_requests, struct director_request *);
+ ARRAY(struct director_request *) new_requests;
bool ret;
if (!dir->ring_synced ||
struct user *head, *tail;
struct user *prev_insert_pos;
- ARRAY_DEFINE(iters, struct user_directory_iter *);
+ ARRAY(struct user_directory_iter *) iters;
char *username_hash_fmt;
unsigned int timeout_secs;
#include <stdio.h>
#include <unistd.h>
-static ARRAY_DEFINE(dumps, const struct doveadm_cmd_dump *);
+static ARRAY(const struct doveadm_cmd_dump *) dumps;
void doveadm_dump_register(const struct doveadm_cmd_dump *dump)
{
struct kick_pid {
pid_t pid;
- ARRAY_DEFINE(users, struct kick_user);
+ ARRAY(struct kick_user) users;
bool kick;
};
struct who_context who;
HASH_TABLE(pid_t, struct kick_pid *) pids;
bool force_kick;
- ARRAY_DEFINE(kicked_users, const char *);
+ ARRAY(const char *) kicked_users;
};
static void
struct doveadm_mailbox_list_iter *iter;
const struct mailbox_info *info;
struct mail_namespace *ns, *prev_ns = NULL;
- ARRAY_DEFINE(purged_storages, struct mail_storage *);
+ ARRAY(struct mail_storage *) purged_storages;
struct mail_storage *const *storages;
unsigned int i, count;
int ret = 0;
struct ostream *output;
struct mail *mail;
- ARRAY_DEFINE(fields, const struct fetch_field);
+ ARRAY(const struct fetch_field) fields;
ARRAY_TYPE(const_string) header_fields;
enum mail_fetch_field wanted_fields;
struct mail_user *cur_mail_user;
struct doveadm_mail_cmd_vfuncs v;
- ARRAY_DEFINE(module_contexts, union doveadm_mail_cmd_module_context *);
+ ARRAY(union doveadm_mail_cmd_module_context *) module_contexts;
/* if non-zero, exit with this code */
int exit_code;
struct doveadm_print_flow_context {
pool_t pool;
- ARRAY_DEFINE(headers, struct doveadm_print_flow_header);
+ ARRAY(struct doveadm_print_flow_header) headers;
unsigned int header_idx;
unsigned int streaming:1;
struct doveadm_print_pager_context {
pool_t pool;
- ARRAY_DEFINE(headers, struct doveadm_print_pager_header);
+ ARRAY(struct doveadm_print_pager_header) headers;
unsigned int header_idx;
unsigned int streaming:1;
struct doveadm_print_table_context {
pool_t pool;
- ARRAY_DEFINE(headers, struct doveadm_print_table_header);
+ ARRAY(struct doveadm_print_table_header) headers;
ARRAY_TYPE(const_string) buffered_values;
unsigned int hdr_idx;
unsigned int columns;
struct doveadm_print_context {
pool_t pool;
- ARRAY_DEFINE(headers, struct doveadm_print_header_context);
+ ARRAY(struct doveadm_print_header_context) headers;
const struct doveadm_print_vfuncs *v;
unsigned int header_idx;
struct doveadm_server {
const char *name;
- ARRAY_DEFINE(connections, struct server_connection *);
+ ARRAY(struct server_connection *) connections;
ARRAY_TYPE(string) queue;
};
const char *dsync_alt_char;
const char *dsync_remote_cmd;
- ARRAY_DEFINE(plugin_envs, const char *);
+ ARRAY(const char *) plugin_envs;
};
extern const struct setting_parser_info doveadm_setting_parser_info;
pool_t prev_pool, cur_pool;
/* id => struct top_line. */
HASH_TABLE(char *, struct top_line *) sessions;
- ARRAY_DEFINE(lines, struct top_line *);
+ ARRAY(struct top_line *) lines;
int (*lines_sort)(struct top_line *const *, struct top_line *const *);
unsigned int last_update_idx, user_idx;
struct who_user {
const char *username;
const char *service;
- ARRAY_DEFINE(ips, struct ip_addr);
- ARRAY_DEFINE(pids, pid_t);
+ ARRAY(struct ip_addr) ips;
+ ARRAY(pid_t) pids;
unsigned int connection_count;
};
int doveadm_exit_code = 0;
-static ARRAY_DEFINE(doveadm_cmds, struct doveadm_cmd);
+static ARRAY(struct doveadm_cmd) doveadm_cmds;
static void failure_exit_callback(int *status)
{
/* UID => struct dsync_mail_change */
HASH_TABLE(uint32_t, struct dsync_mail_change *) changes;
/* changes sorted by UID */
- ARRAY_DEFINE(sorted_changes, struct dsync_mail_change *);
+ ARRAY(struct dsync_mail_change *) sorted_changes;
unsigned int change_idx;
uint32_t highest_changed_uid;
HASH_TABLE_TYPE(dsync_uid_mail_change) local_changes;
ARRAY_TYPE(seq_range) maybe_expunge_uids;
- ARRAY_DEFINE(maybe_saves, struct dsync_mail_change *);
+ ARRAY(struct dsync_mail_change *) maybe_saves;
/* GUID => struct importer_new_mail */
HASH_TABLE_TYPE(guid_new_mail) import_guids;
/* UID => struct importer_new_mail */
HASH_TABLE_TYPE(uid_new_mail) import_uids;
- ARRAY_DEFINE(newmails, struct importer_new_mail *);
+ ARRAY(struct importer_new_mail *) newmails;
ARRAY_TYPE(uint32_t) wanted_uids;
- ARRAY_DEFINE(mail_requests, struct dsync_mail_request);
+ ARRAY(struct dsync_mail_request) mail_requests;
unsigned int mail_request_idx;
uint32_t prev_uid, next_local_seq, local_uid_next;
unsigned int iter_count;
- ARRAY_DEFINE(deletes, struct dsync_mailbox_delete);
+ ARRAY(struct dsync_mailbox_delete) deletes;
/* guid_128_t => struct dsync_mailbox_node */
HASH_TABLE(uint8_t *, struct dsync_mailbox_node *) name128_hash;
struct dsync_mailbox_tree_bfs_iter {
struct dsync_mailbox_tree *tree;
- ARRAY_DEFINE(queue_arr, struct dsync_mailbox_node *);
+ ARRAY(struct dsync_mailbox_node *) queue_arr;
struct aqueue *queue;
struct dsync_mailbox_node *cur;
};
pool_t pool;
struct dsync_mailbox_tree *local_tree, *remote_tree;
- ARRAY_DEFINE(changes, struct dsync_mailbox_tree_sync_change);
+ ARRAY(struct dsync_mailbox_tree_sync_change) changes;
unsigned int change_idx;
};
struct dsync_slave_pipe {
struct dsync_slave slave;
- ARRAY_DEFINE(pools, pool_t);
- ARRAY_DEFINE(item_queue, struct item);
+ ARRAY(pool_t) pools;
+ ARRAY(struct item) item_queue;
struct dsync_slave_pipe *remote;
pool_t pop_pool;
struct mail_namespace *ns;
struct mailbox_list_iterate_context *list_iter;
- ARRAY_DEFINE(ns_prefixes_listed, struct mail_namespace *);
+ ARRAY(struct mail_namespace *) ns_prefixes_listed;
unsigned int lsub:1;
unsigned int lsub_no_unsubscribed:1;
struct mail_namespace *ns = ctx->ns;
const char *cur_ns_prefix, *cur_ref, *const *pat, *pattern;
enum imap_match_result inbox_match;
- ARRAY_DEFINE(used_patterns, const char *);
+ ARRAY(const char *) used_patterns;
bool inboxcase;
cur_ns_prefix = ns->prefix;
const struct imap_arg *args, *list_args;
unsigned int arg_count;
struct cmd_list_context *ctx;
- ARRAY_DEFINE(patterns, const char *) = ARRAY_INIT;
+ ARRAY(const char *) patterns = ARRAY_INIT;
const char *pattern, *const *patterns_strarr;
string_t *str;
void *context;
/* Module-specific contexts. */
- ARRAY_DEFINE(module_contexts, union imap_module_context *);
+ ARRAY(union imap_module_context *) module_contexts;
struct imap_parser *parser;
enum client_command_state state;
/* SEARCHRES extension: Last saved SEARCH result */
ARRAY_TYPE(seq_range) search_saved_uidset;
/* SEARCH=CONTEXT extension: Searches that get updated */
- ARRAY_DEFINE(search_updates, struct imap_search_update);
+ ARRAY(struct imap_search_update) search_updates;
/* NOTIFY extension */
struct imap_notify_context *notify_ctx;
uint32_t notify_uidnext;
struct client_command_context *mailbox_change_lock;
/* Module-specific contexts. */
- ARRAY_DEFINE(module_contexts, union imap_module_context *);
+ ARRAY(union imap_module_context *) module_contexts;
/* syncing marks this TRUE when it sees \Deleted flags. this is by
EXPUNGE for Outlook-workaround. */
{
const char *atom;
enum mail_flags flag;
- ARRAY_DEFINE(keywords, const char *);
+ ARRAY(const char *) keywords;
*flags_r = 0;
*keywords_r = NULL;
ARRAY_TYPE(command) imap_commands;
static bool commands_unsorted;
-static ARRAY_DEFINE(command_hooks, struct command_hook);
+static ARRAY(struct command_hook) command_hooks;
void command_register(const char *name, command_func_t *func,
enum command_flags flags)
#define ENVELOPE_NIL_REPLY \
"(NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL)"
-static ARRAY_DEFINE(fetch_handlers, struct imap_fetch_handler);
+static ARRAY(struct imap_fetch_handler) fetch_handlers;
static int imap_fetch_handler_cmp(const struct imap_fetch_handler *h1,
const struct imap_fetch_handler *h2)
enum mail_fetch_field fetch_data;
ARRAY_TYPE(const_string) all_headers;
- ARRAY_DEFINE(handlers, struct imap_fetch_context_handler);
+ ARRAY(struct imap_fetch_context_handler) handlers;
unsigned int buffered_handlers_count;
ARRAY_TYPE(keywords) tmp_keywords;
struct mail_namespace *ns;
struct mailbox_list_notify *notify;
- ARRAY_DEFINE(mailboxes, struct imap_notify_mailboxes);
+ ARRAY(struct imap_notify_mailboxes) mailboxes;
};
struct imap_notify_context {
struct client *client;
const char *error;
- ARRAY_DEFINE(namespaces, struct imap_notify_namespace);
+ ARRAY(struct imap_notify_namespace) namespaces;
enum imap_notify_event selected_events;
enum imap_notify_event global_used_events;
unsigned int global_max_mailbox_names;
ARRAY_TYPE(seq_range) result;
unsigned int result_count;
- ARRAY_DEFINE(relevancy_scores, float);
+ ARRAY(float) relevancy_scores;
float min_relevancy, max_relevancy;
uint64_t highest_seen_modseq;
struct ostream *output;
char *request_username;
- ARRAY_DEFINE(request_contexts, void *);
+ ARRAY(void *) request_contexts;
struct aqueue *request_queue;
unsigned int process_limit;
unsigned int cmd_tag_counter;
/* running commands */
- ARRAY_DEFINE(cmds, struct ipc_connection_cmd *);
+ ARRAY(struct ipc_connection_cmd *) cmds;
unsigned int version_received:1;
unsigned int handshake_received:1;
char *first_error;
};
-static ARRAY_DEFINE(ipc_groups, struct ipc_group *);
+static ARRAY(struct ipc_group *) ipc_groups;
struct ipc_group *ipc_group_alloc(int listen_fd)
{
unsigned int connect_uid;
char *cookie;
- ARRAY_DEFINE(available_auth_mechs, struct auth_mech_desc);
+ ARRAY(struct auth_mech_desc) available_auth_mechs;
HASH_TABLE(unsigned int, struct auth_client_request *) requests;
struct timeout *to;
struct memcached_ascii_connection conn;
- ARRAY_DEFINE(input_states, enum memcached_ascii_input_state);
- ARRAY_DEFINE(replies, struct memcached_ascii_dict_reply);
+ ARRAY(enum memcached_ascii_input_state) input_states;
+ ARRAY(struct memcached_ascii_dict_reply) replies;
};
static struct connection_list *memcached_ascii_connections;
struct ioloop *ioloop;
struct redis_connection conn;
- ARRAY_DEFINE(input_states, enum redis_input_state);
- ARRAY_DEFINE(replies, struct redis_dict_reply);
+ ARRAY(enum redis_input_state) input_states;
+ ARRAY(struct redis_dict_reply) replies;
bool connected;
bool transaction_open;
enum section_type type;
struct dict_sql_map cur_map;
- ARRAY_DEFINE(cur_fields, struct dict_sql_map_field);
+ ARRAY(struct dict_sql_map_field) cur_fields;
};
#define DEF_STR(name) DEF_STRUCT_STR(name, dict_sql_map)
const char *connect;
unsigned int max_field_count;
- ARRAY_DEFINE(maps, struct dict_sql_map);
+ ARRAY(struct dict_sql_map) maps;
};
struct dict_sql_settings *dict_sql_settings_read(pool_t pool, const char *path);
struct dict_sql_build_query {
struct sql_dict *dict;
- ARRAY_DEFINE(fields, struct dict_sql_build_query_field);
+ ARRAY(struct dict_sql_build_query_field) fields;
const ARRAY_TYPE(const_string) *extra_values;
char key1;
bool inc;
struct dict_transaction_memory_context {
struct dict_transaction_context ctx;
pool_t pool;
- ARRAY_DEFINE(changes, struct dict_transaction_memory_change);
+ ARRAY(struct dict_transaction_memory_change) changes;
};
void dict_transaction_memory_init(struct dict_transaction_memory_context *ctx,
#include "dict-sql.h"
#include "dict-private.h"
-static ARRAY_DEFINE(dict_drivers, struct dict *);
+static ARRAY(struct dict *) dict_drivers;
static struct dict_iterate_context dict_iter_unsupported;
static struct dict *dict_driver_lookup(const char *name)
imapc_untagged_callback_t *untagged_callback;
void *untagged_context;
- ARRAY_DEFINE(conns, struct imapc_client_connection *);
+ ARRAY(struct imapc_client_connection *) conns;
struct ioloop *ioloop;
};
executed */
struct imapc_client_mailbox *box;
- ARRAY_DEFINE(streams, struct imapc_command_stream);
+ ARRAY(struct imapc_command_stream) streams;
imapc_command_callback_t *callback;
void *context;
struct ip_addr *ips;
struct imapc_connection_literal literal;
- ARRAY_DEFINE(literal_files, struct imapc_arg_file);
+ ARRAY(struct imapc_arg_file) literal_files;
unsigned int idling:1;
unsigned int idle_stopping:1;
struct mail_cache *cache;
buffer_t *buffer, *field_seen;
- ARRAY_DEFINE(bitmask_pos, unsigned int);
+ ARRAY(unsigned int) bitmask_pos;
uint32_t *field_file_map;
uint8_t field_seen_value;
struct header_lookup_context {
struct mail_cache_view *view;
- ARRAY_DEFINE(lines, struct header_lookup_line);
+ ARRAY(struct header_lookup_line) lines;
};
enum {
uint32_t first_new_seq;
buffer_t *cache_data;
- ARRAY_DEFINE(cache_data_seq, uint32_t);
+ ARRAY(uint32_t) cache_data_seq;
uint32_t prev_seq;
size_t prev_pos;
- ARRAY_DEFINE(reservations, struct mail_cache_reservation);
+ ARRAY(struct mail_cache_reservation) reservations;
uint32_t reserved_space_offset, reserved_space;
uint32_t last_grow_size;
struct mail_index_map_modseq {
/* indexes use enum modseq_metadata_idx */
- ARRAY_DEFINE(metadata_modseqs, struct metadata_modseqs);
+ ARRAY(struct metadata_modseqs) metadata_modseqs;
};
struct mail_index_modseq_sync {
};
struct mail_index_record_map {
- ARRAY_DEFINE(maps, struct mail_index_map *);
+ ARRAY(struct mail_index_map *) maps;
void *mmap_base;
size_t mmap_size, mmap_used_size;
buffer_t *hdr_copy_buf;
pool_t extension_pool;
- ARRAY_DEFINE(extensions, struct mail_index_ext);
- ARRAY_DEFINE(ext_id_map, uint32_t); /* index -> file */
+ ARRAY(struct mail_index_ext) extensions;
+ ARRAY(uint32_t) ext_id_map; /* index -> file */
- ARRAY_DEFINE(keyword_idx_map, unsigned int); /* file -> index */
+ ARRAY(unsigned int) keyword_idx_map; /* file -> index */
struct mail_index_record_map *rec_map;
char *gid_origin;
pool_t extension_pool;
- ARRAY_DEFINE(extensions, struct mail_index_registered_ext);
+ ARRAY(struct mail_index_registered_ext) extensions;
uint32_t ext_hdr_init_id;
void *ext_hdr_init_data;
- ARRAY_DEFINE(sync_lost_handlers, mail_index_sync_lost_handler_t *);
+ ARRAY(mail_index_sync_lost_handler_t *) sync_lost_handlers;
char *filepath;
int fd;
unsigned int view_count;
/* Module-specific contexts. */
- ARRAY_DEFINE(module_contexts, union mail_index_module_context *);
+ ARRAY(union mail_index_module_context *) module_contexts;
char *error;
unsigned int nodiskspace:1;
struct mail_index_view *view;
ARRAY_TYPE(mail_index_strmap_rec) recs;
- ARRAY_DEFINE(recs_crc32, uint32_t);
+ ARRAY(uint32_t) recs_crc32;
struct hash2_table *hash;
mail_index_strmap_key_cmp_t *key_compare;
uint32_t ext_intro_seq;
uoff_t ext_intro_offset, ext_intro_end_offset;
- ARRAY_DEFINE(expunge_handlers, struct mail_index_expunge_handler);
- ARRAY_DEFINE(extra_contexts, void *);
+ ARRAY(struct mail_index_expunge_handler) expunge_handlers;
+ ARRAY(void *) extra_contexts;
buffer_t *unknown_extensions;
enum mail_index_sync_handler_type type;
const struct mail_transaction_header *hdr;
const void *data;
- ARRAY_DEFINE(sync_list, struct mail_index_sync_list);
+ ARRAY(struct mail_index_sync_list) sync_list;
uint32_t next_uid;
uint32_t last_tail_seq, last_tail_offset;
static void log_append_flag_updates(struct mail_index_export_context *ctx,
struct mail_index_transaction *t)
{
- ARRAY_DEFINE(log_updates, struct mail_transaction_flag_update);
+ ARRAY(struct mail_transaction_flag_update) log_updates;
const struct mail_index_flag_update *updates;
struct mail_transaction_flag_update *log_update;
unsigned int i, count;
/* NOTE: If you add anything new, remember to update
mail_index_transaction_reset_v() to reset it. */
- ARRAY_DEFINE(appends, struct mail_index_record);
+ ARRAY(struct mail_index_record) appends;
uint32_t first_new_seq, last_new_seq;
uint32_t highest_append_uid;
/* lowest/highest sequence that updates flags/keywords */
uint32_t min_flagupdate_seq, max_flagupdate_seq;
- ARRAY_DEFINE(modseq_updates, struct mail_transaction_modseq_update);
- ARRAY_DEFINE(expunges, struct mail_transaction_expunge_guid);
- ARRAY_DEFINE(updates, struct mail_index_flag_update);
+ ARRAY(struct mail_transaction_modseq_update) modseq_updates;
+ ARRAY(struct mail_transaction_expunge_guid) expunges;
+ ARRAY(struct mail_index_flag_update) updates;
size_t last_update_idx;
unsigned char pre_hdr_change[sizeof(struct mail_index_header)];
unsigned char post_hdr_change[sizeof(struct mail_index_header)];
unsigned char post_hdr_mask[sizeof(struct mail_index_header)];
- ARRAY_DEFINE(ext_hdr_updates,
- struct mail_index_transaction_ext_hdr_update);
+ ARRAY(struct mail_index_transaction_ext_hdr_update) ext_hdr_updates;
ARRAY_TYPE(seq_array_array) ext_rec_updates;
ARRAY_TYPE(seq_array_array) ext_rec_atomics;
- ARRAY_DEFINE(ext_resizes, struct mail_transaction_ext_intro);
- ARRAY_DEFINE(ext_resets, struct mail_transaction_ext_reset);
- ARRAY_DEFINE(ext_reset_ids, uint32_t);
- ARRAY_DEFINE(ext_reset_atomic, uint32_t);
+ ARRAY(struct mail_transaction_ext_intro) ext_resizes;
+ ARRAY(struct mail_transaction_ext_reset) ext_resets;
+ ARRAY(uint32_t) ext_reset_ids;
+ ARRAY(uint32_t) ext_reset_atomic;
- ARRAY_DEFINE(keyword_updates,
- struct mail_index_transaction_keyword_update);
+ ARRAY(struct mail_index_transaction_keyword_update) keyword_updates;
uint64_t min_highest_modseq;
uint64_t max_modseq;
ARRAY_TYPE(seq_range) *conflict_seqs;
/* Module-specific contexts. */
- ARRAY_DEFINE(module_contexts,
- union mail_index_transaction_module_context *);
+ ARRAY(union mail_index_transaction_module_context *) module_contexts;
unsigned int no_appends:1;
unsigned int record_size;
unsigned int recs_count;
void *recs;
- ARRAY_DEFINE(all_recs, void *);
+ ARRAY(void *) all_recs;
};
static void tview_close(struct mail_index_view *view)
struct mail_index_map *map;
/* All mappings where we have returned records. They need to be kept
valid until view is synchronized. */
- ARRAY_DEFINE(map_refs, struct mail_index_map *);
+ ARRAY(struct mail_index_map *) map_refs;
/* expunge <= head */
uint32_t log_file_expunge_seq, log_file_head_seq;
ARRAY_TYPE(view_log_sync_area) syncs_hidden;
/* Module-specific contexts. */
- ARRAY_DEFINE(module_contexts, union mail_index_view_module_context *);
+ ARRAY(union mail_index_view_module_context *) module_contexts;
int transactions;
/* a list of log files we've referenced. we have to keep this list
explicitly because more files may be added into the linked list
at any time. */
- ARRAY_DEFINE(file_refs, struct mail_transaction_log_file *);
+ ARRAY(struct mail_transaction_log_file *) file_refs;
struct mail_transaction_log_file *cur, *head, *tail;
uoff_t cur_offset;
void *finish_context;
const char *data_header;
- ARRAY_DEFINE(recipients, struct lmtp_rcpt);
+ ARRAY(struct lmtp_rcpt) recipients;
unsigned int rcpt_next_receive_idx;
unsigned int rcpt_next_data_idx;
unsigned int rcpt_next_send_idx;
pool_t pool;
/* List of INBOX GUIDs where this mail has already been saved to */
- ARRAY_DEFINE(inbox_guids, guid_128_t);
+ ARRAY(guid_128_t) inbox_guids;
};
struct mail_deliver_context {
uoff_t msg_size;
uoff_t encoded_offset;
- ARRAY_DEFINE(streams, struct istream *);
+ ARRAY(struct istream *) streams;
};
struct istream_attachment_connector *
uoff_t last_lf_offset;
unsigned int cur_line, parsed_lines;
- ARRAY_DEFINE(match_change_lines, unsigned int);
+ ARRAY(unsigned int) match_change_lines;
unsigned int header_read:1;
unsigned int seen_eoh:1;
const char *const **result_r)
{
ARRAY_TYPE(const_string) result;
- ARRAY_DEFINE(rfc2231_params_arr, struct rfc2231_parameter);
+ ARRAY(struct rfc2231_parameter) rfc2231_params_arr;
struct rfc2231_parameter rfc2231_param;
const struct rfc2231_parameter *rfc2231_params;
const char *key, *value, *p, *p2;
};
static buffer_t *attachment_data;
-static ARRAY_DEFINE(attachments, struct attachment);
+static ARRAY(struct attachment) attachments;
static int test_open_temp_fd(void *context ATTR_UNUSED)
{
struct timeout *to_reconnect;
time_t last_reconnect;
- ARRAY_DEFINE(queries_arr, struct anvil_query);
+ ARRAY(struct anvil_query) queries_arr;
struct aqueue *queries;
bool (*reconnect_callback)(void);
struct timeout *to;
struct istream *input;
struct ostream *output;
- ARRAY_DEFINE(cmds, struct ipc_client_cmd);
+ ARRAY(struct ipc_client_cmd) cmds;
};
static void ipc_client_disconnect(struct ipc_client *client);
pool_t pool;
const char *path;
- ARRAY_DEFINE(instances, struct master_instance);
+ ARRAY(struct master_instance) instances;
unsigned int locked:1;
unsigned int config_paths_changed:1;
struct master_service_settings_output *output_r,
const char **error_r)
{
- ARRAY_DEFINE(all_roots, const struct setting_parser_info *);
+ ARRAY(const struct setting_parser_info *) all_roots;
const struct setting_parser_info *tmp_root;
struct setting_parser_context *parser;
struct istream *istream;
struct mountpoint_list {
pool_t pool;
const char *perm_path, *state_path;
- ARRAY_DEFINE(recs, struct mountpoint_list_rec *);
+ ARRAY(struct mountpoint_list_rec *) recs;
struct stat load_st;
bool load_failed;
};
const struct dynamic_settings_parser *parsers)
{
/* @UNSAFE */
- ARRAY_DEFINE(defines, struct setting_define);
+ ARRAY(struct setting_define) defines;
ARRAY_TYPE(dynamic_settings_parser) dynamic_parsers;
struct dynamic_settings_parser new_parser;
const struct setting_define *cur_defines;
const char **fields;
const char **values;
- ARRAY_DEFINE(binary_values, struct pgsql_binary_value);
+ ARRAY(struct pgsql_binary_value) binary_values;
sql_query_callback_t *callback;
void *context;
const struct sql_db *driver;
unsigned int connection_limit;
- ARRAY_DEFINE(hosts, struct sqlpool_host);
+ ARRAY(struct sqlpool_host) hosts;
/* all connections from all hosts */
- ARRAY_DEFINE(all_connections, struct sqlpool_connection);
+ ARRAY(struct sqlpool_connection) all_connections;
/* index of last connection in all_connections that was used to
send a query. */
unsigned int last_query_conn_idx;
enum sql_db_flags flags;
struct sql_db_vfuncs v;
- ARRAY_DEFINE(module_contexts, union sql_db_module_context *);
+ ARRAY(union sql_db_module_context *) module_contexts;
void (*state_change_callback)(struct sql_db *db,
enum sql_db_state prev_state,
/* Metadata for the currently seeked metadata block. */
pool_t metadata_pool;
- ARRAY_DEFINE(metadata, const char *);
+ ARRAY(const char *) metadata;
uoff_t metadata_read_offset;
unsigned int appending:1;
struct mdbox_map_atomic_context *atomic;
struct mail_index_transaction *trans;
- ARRAY_DEFINE(file_appends, struct dbox_file_append_context *);
- ARRAY_DEFINE(files, struct dbox_file *);
- ARRAY_DEFINE(appends, struct mdbox_map_append);
+ ARRAY(struct dbox_file_append_context *) file_appends;
+ ARRAY(struct dbox_file *) files;
+ ARRAY(struct mdbox_map_append) appends;
uint32_t first_new_file_id;
struct mdbox_map_atomic_context *atomic;
struct mdbox_map_transaction_context *map_trans;
- ARRAY_DEFINE(mails, struct dbox_save_mail);
+ ARRAY(struct dbox_save_mail) mails;
};
static struct dbox_file *
struct mdbox_map_mail_index_header orig_map_hdr;
HASH_TABLE(uint8_t *, struct mdbox_rebuild_msg *) guid_hash;
- ARRAY_DEFINE(msgs, struct mdbox_rebuild_msg *);
+ ARRAY(struct mdbox_rebuild_msg *) msgs;
ARRAY_TYPE(seq_range) seen_file_ids;
uint32_t rebuild_count;
const char *storage_dir, *alt_storage_dir;
struct mdbox_map *map;
- ARRAY_DEFINE(open_files, struct mdbox_file *);
+ ARRAY(struct mdbox_file *) open_files;
struct timeout *to_close_unused_files;
ARRAY_TYPE(uint32_t) move_to_alt_map_uids;
struct dbox_file_append_context *append_ctx;
uint32_t first_saved_seq;
- ARRAY_DEFINE(files, struct dbox_file *);
+ ARRAY(struct dbox_file *) files;
};
struct dbox_file *
struct mailbox_status *cur_status;
unsigned int reopen_count;
- ARRAY_DEFINE(untagged_callbacks, struct imapc_storage_event_callback);
+ ARRAY(struct imapc_storage_event_callback) untagged_callbacks;
};
struct imapc_mail_cache {
struct mail_index_view *sync_view, *delayed_sync_view;
struct timeout *to_idle_check, *to_idle_delay;
- ARRAY_DEFINE(fetch_mails, struct imapc_mail *);
+ ARRAY(struct imapc_mail *) fetch_mails;
- ARRAY_DEFINE(untagged_callbacks, struct imapc_mailbox_event_callback);
- ARRAY_DEFINE(resp_text_callbacks, struct imapc_mailbox_event_callback);
+ ARRAY(struct imapc_mailbox_event_callback) untagged_callbacks;
+ ARRAY(struct imapc_mailbox_event_callback) resp_text_callbacks;
enum mail_flags permanent_flags;
struct mail *mail;
struct istream *input;
bool has_nuls, converted;
- ARRAY_DEFINE(blocks, struct binary_block);
+ ARRAY(struct binary_block) blocks;
uoff_t copy_start_offset;
};
static const char *const *
index_mail_get_parsed_header(struct index_mail *mail, unsigned int field_idx)
{
- ARRAY_DEFINE(header_values, const char *);
+ ARRAY(const char *) header_values;
const struct index_mail_line *lines;
const unsigned char *header, *value_start, *value_end;
const unsigned int *line_idx;
string_t *dest;
size_t i, len;
int ret;
- ARRAY_DEFINE(header_values, const char *);
+ ARRAY(const char *) header_values;
i_assert(field != NULL);
/* per-mail variables, here for performance reasons: */
uint32_t header_seq;
string_t *header_data;
- ARRAY_DEFINE(header_lines, struct index_mail_line);
+ ARRAY(struct index_mail_line) header_lines;
#define HEADER_MATCH_FLAG_FOUND 1
#define HEADER_MATCH_SKIP_COUNT 2
#define HEADER_MATCH_USABLE(mail, num) \
((num & ~1) == (mail)->header_match_value)
- ARRAY_DEFINE(header_match, uint8_t);
- ARRAY_DEFINE(header_match_lines, unsigned int);
+ ARRAY(uint8_t) header_match;
+ ARRAY(unsigned int) header_match_lines;
uint8_t header_match_value;
unsigned int pop3_state_set:1;
struct index_mail *cur_imail;
struct mail_thread_context *thread_ctx;
- ARRAY_DEFINE(mails, struct mail *);
+ ARRAY(struct mail *) mails;
unsigned int unused_mail_idx;
unsigned int max_mails;
const struct mailbox_update *update)
{
const struct mailbox_cache_field *updates = update->cache_updates;
- ARRAY_DEFINE(new_fields, struct mail_cache_field);
+ ARRAY(struct mail_cache_field) new_fields;
const struct mail_cache_field *old_fields;
struct mail_cache_field field;
unsigned int i, j, old_count;
struct mail_index_view *sync_view;
struct mail_index_transaction *sync_trans;
- ARRAY_DEFINE(syncs, struct mail_index_sync_rec);
+ ARRAY(struct mail_index_sync_rec) syncs;
struct mail_index_sync_rec sync_rec;
bool dirty_flag_updates;
};
struct mail *tmp_mail;
struct mail_thread_cache *cache;
- ARRAY_DEFINE(roots, struct mail_thread_root_node);
- ARRAY_DEFINE(shadow_nodes, struct mail_thread_shadow_node);
+ ARRAY(struct mail_thread_root_node) roots;
+ ARRAY(struct mail_thread_shadow_node) shadow_nodes;
unsigned int next_new_root_idx;
unsigned int use_sent_date:1;
struct mail_index *index;
const ARRAY_TYPE(keywords) *keywords;
- ARRAY_DEFINE(idx_to_chr, char);
+ ARRAY(char) idx_to_chr;
unsigned int chridx_to_idx[MAILDIR_MAX_KEYWORDS];
bool readonly;
};
static int
maildir_save_move_files_to_newcur(struct maildir_save_context *ctx)
{
- ARRAY_DEFINE(files, struct maildir_filename *);
+ ARRAY(struct maildir_filename *) files;
struct maildir_filename *mf, *const *mfp, *prev_mf;
bool newdir, new_changed, cur_changed;
int ret;
uoff_t base_uid_last_offset;
/* mail state: */
- ARRAY_DEFINE(mails, struct mbox_sync_mail);
+ ARRAY(struct mbox_sync_mail) mails;
struct index_sync_changes_context *sync_changes;
/* per-mail pool */
enum mailbox_info_flags info_flags;
/* all files in this directory */
- ARRAY_DEFINE(entries, struct list_dir_entry);
+ ARRAY(struct list_dir_entry) entries;
unsigned int entry_idx;
};
const char *const *valid_patterns;
/* roots can be either /foo, ~user/bar or baz */
- ARRAY_DEFINE(roots, const char *);
+ ARRAY(const char *) roots;
unsigned int root_idx;
char sep;
const char *const *patterns)
{
struct mailbox_list *_list = ctx->ctx.list;
- ARRAY_DEFINE(valid_patterns, const char *);
+ ARRAY(const char *) valid_patterns;
const char *pattern, *test_pattern, *real_pattern;
unsigned int prefix_len;
struct timeout *to_wait, *to_notify;
ARRAY_TYPE(seq_range) new_uids, expunged_uids, changed_uids;
- ARRAY_DEFINE(renames, struct mailbox_list_notify_rename);
+ ARRAY(struct mailbox_list_notify_rename) renames;
struct seq_range_iter new_uids_iter, expunged_uids_iter;
struct seq_range_iter changed_uids_iter;
unsigned int new_uids_n, expunged_uids_n, changed_uids_n;
{
struct mailbox_list_index *ilist =
INDEX_LIST_CONTEXT(inotify->notify.list);
- ARRAY_DEFINE(entries, struct mailbox_list_inotify_entry);
+ ARRAY(struct mailbox_list_inotify_entry) entries;
struct mailbox_status status;
struct mailbox_list_notify_rename *rename;
struct mailbox_list_inotify_entry *entry;
{
struct mailbox_list_iterate_context *iter;
const struct mailbox_info *info;
- ARRAY_DEFINE(names_arr, const char *);
+ ARRAY(const char *) names_arr;
const char *pattern, *oldpath, *newpath, *old_childname, *new_childname;
const char *const *names, *old_vname, *new_vname;
unsigned int i, count, old_vnamelen;
{
struct mail_search_register *reg;
mail_search_register_fallback_t *fallback;
- ARRAY_DEFINE(copy_args, const struct mail_search_register_arg);
+ ARRAY(const struct mail_search_register_arg) copy_args;
const struct mail_search_register_arg *human_args, *imap_args;
unsigned int i, j, human_count, imap_count;
int ret;
#include "mail-search-register.h"
struct mail_search_register {
- ARRAY_DEFINE(args, struct mail_search_register_arg);
+ ARRAY(struct mail_search_register_arg) args;
mail_search_register_fallback_t *fallback;
unsigned int args_sorted:1;
struct hook_stack *head, *tail;
};
-static ARRAY_DEFINE(module_hooks,
- struct mail_storage_module_hooks) = ARRAY_INIT;
-static ARRAY_DEFINE(internal_hooks,
- const struct mail_storage_hooks *) = ARRAY_INIT;
+static ARRAY(struct mail_storage_module_hooks) module_hooks = ARRAY_INIT;
+static ARRAY(const struct mail_storage_hooks *) internal_hooks = ARRAY_INIT;
void mail_storage_hooks_init(void)
{
static void mail_user_add_plugin_hooks(struct mail_user *user)
{
const struct mail_storage_module_hooks *module_hook;
- ARRAY_DEFINE(tmp_hooks, struct mail_storage_module_hooks);
+ ARRAY(struct mail_storage_module_hooks) tmp_hooks;
const char *const *plugins, *name;
/* first get all hooks wanted by the user */
struct mail_binary_cache binary_cache;
/* Module-specific contexts. See mail_storage_module_id. */
- ARRAY_DEFINE(module_contexts, union mail_storage_module_context *);
+ ARRAY(union mail_storage_module_context *) module_contexts;
};
struct mail_attachment_part {
unsigned int generation_sequence;
/* Saved search results */
- ARRAY_DEFINE(search_results, struct mail_search_result *);
+ ARRAY(struct mail_search_result *) search_results;
/* Module-specific contexts. See mail_storage_module_id. */
- ARRAY_DEFINE(module_contexts, union mailbox_module_context *);
+ ARRAY(union mailbox_module_context *) module_contexts;
/* When FAST open flag is used, the mailbox isn't actually opened until
it's synced for the first time. */
struct mailbox_header_lookup_ctx *wanted_headers;
pool_t pool;
- ARRAY_DEFINE(module_contexts, union mail_module_context *);
+ ARRAY(union mail_module_context *) module_contexts;
};
struct mailbox_list_context {
struct mail_cache_transaction_ctx *cache_trans;
struct mail_transaction_commit_changes *changes;
- ARRAY_DEFINE(module_contexts,
- union mailbox_transaction_module_context *);
+ ARRAY(union mailbox_transaction_module_context *) module_contexts;
struct mail_save_context *save_ctx;
static data matches. */
struct mail_search_result *update_result;
/* add matches to these search results */
- ARRAY_DEFINE(results, struct mail_search_result *);
+ ARRAY(struct mail_search_result *) results;
uint32_t seq;
uint32_t progress_cur, progress_max;
- ARRAY_DEFINE(module_contexts, union mail_search_module_context *);
+ ARRAY(union mail_search_module_context *) module_contexts;
unsigned int seen_lost_data:1;
unsigned int progress_hidden:1;
bool subscriptions;
bool ignore_on_failure;
- ARRAY_DEFINE(mailboxes, struct mailbox_settings *);
+ ARRAY(struct mailbox_settings *) mailboxes;
struct mail_user_settings *user_set;
};
const char *mail_log_prefix;
- ARRAY_DEFINE(namespaces, struct mail_namespace_settings *);
- ARRAY_DEFINE(plugin_envs, const char *);
+ ARRAY(struct mail_namespace_settings *) namespaces;
+ ARRAY(const char *) plugin_envs;
};
extern const struct setting_parser_info mail_user_setting_parser_info;
struct mail_user_settings *set;
struct mail_namespace *namespaces;
struct mail_storage *storages;
- ARRAY_DEFINE(hooks, const struct mail_storage_hooks *);
+ ARRAY(const struct mail_storage_hooks *) hooks;
struct mountpoint_list *mountpoints;
/* Module-specific contexts. See mail_storage_module_id. */
- ARRAY_DEFINE(module_contexts, union mail_user_module_context *);
+ ARRAY(union mail_user_module_context *) module_contexts;
/* Either home is set or there is no home for the user. */
unsigned int home_looked_up:1;
struct mail_keywords *kw;
T_BEGIN {
- ARRAY_DEFINE(valid_keywords, const char *);
+ ARRAY(const char *) valid_keywords;
const char *error;
t_array_init(&valid_keywords, 32);
struct mailbox_list_autocreate_iterate_context {
unsigned int idx;
struct mailbox_info new_info;
- ARRAY_DEFINE(boxes, struct autocreate_box);
+ ARRAY(struct autocreate_box) boxes;
ARRAY_TYPE(mailbox_settings) box_sets;
ARRAY_TYPE(mailbox_settings) all_ns_box_sets;
};
enum mail_error error;
bool temporary_error;
- ARRAY_DEFINE(module_contexts, union mailbox_list_module_context *);
+ ARRAY(union mailbox_list_module_context *) module_contexts;
unsigned int index_root_dir_created:1;
};
struct mailbox_list_autocreate_iterate_context *autocreate_ctx;
struct mailbox_info specialuse_info;
- ARRAY_DEFINE(module_contexts,
- union mailbox_list_iterate_module_context *);
+ ARRAY(union mailbox_list_iterate_module_context *) module_contexts;
};
struct mailbox_list_iter_update_context {
struct mailbox_list_module_register mailbox_list_module_register = { 0 };
-static ARRAY_DEFINE(mailbox_list_drivers, const struct mailbox_list *);
+static ARRAY(const struct mailbox_list *) mailbox_list_drivers;
void mailbox_lists_init(void)
{
char separator;
- ARRAY_DEFINE(node_path, struct mailbox_node *);
+ ARRAY(struct mailbox_node *) node_path;
string_t *path_str;
size_t parent_pos;
#ifndef ARRAY_DECL_H
#define ARRAY_DECL_H
-#define ARRAY_DEFINE(name, array_type) union { struct array arr; array_type const *const *v; array_type **v_modifiable; } name
+#define ARRAY(array_type) union { struct array arr; array_type const *const *v; array_type **v_modifiable; }
#define ARRAY_INIT { { 0, 0 } }
#define ARRAY_DEFINE_TYPE(name, array_type) \
Example usage:
struct foo {
- ARRAY_DEFINE(bars, struct bar);
+ ARRAY(struct bar) bars;
...
};
int epfd;
unsigned int deleted_count;
- ARRAY_DEFINE(fd_index, struct io_list *);
- ARRAY_DEFINE(events, struct epoll_event);
+ ARRAY(struct io_list *) fd_index;
+ ARRAY(struct epoll_event) events;
};
void io_loop_handler_init(struct ioloop *ioloop, unsigned int initial_fd_count)
int kq;
unsigned int deleted_count;
- ARRAY_DEFINE(events, struct kevent);
+ ARRAY(struct kevent) events;
};
void io_loop_handler_init(struct ioloop *ioloop, unsigned int initial_fd_count)
struct ioloop_context {
int refcount;
struct ioloop *ioloop;
- ARRAY_DEFINE(callbacks, struct ioloop_context_callback);
+ ARRAY(struct ioloop_context_callback) callbacks;
};
int io_loop_get_wait_time(struct ioloop *ioloop, struct timeval *tv_r);
struct istream;
struct ostream;
-#include "array-decl.h" /* ARRAY_DEFINE()s may exist in any header */
+#include "array-decl.h" /* ARRAY*()s may exist in any header */
#include "hash-decl.h" /* HASH_TABLE*()s may exist in any header */
#include "strfuncs.h"
#include "strnum.h"
// for example: struct STRUCT_NAME_vfuncs super;
};
struct STRUCT_NAME {
- ARRAY_DEFINE(module_contexts, union STRUCT_NAME_module_context *);
+ ARRAY(union STRUCT_NAME_module_context *) module_contexts;
};
extern struct STRUCT_NAME_module_register STRUCT_NAME_module_register;
struct priorityq {
priorityq_cmp_callback_t *cmp_callback;
- ARRAY_DEFINE(items, struct priorityq_item *);
+ ARRAY(struct priorityq_item *) items;
};
struct priorityq *
static const unsigned int aqueue_input[] = { 1, 2, 3, 4, 5, 6 };
static const char *test_aqueue2(unsigned int initial_size)
{
- ARRAY_DEFINE(aqueue_array, unsigned int);
+ ARRAY(unsigned int) aqueue_array;
unsigned int i, j, k;
struct aqueue *aqueue;
static void test_array_foreach(void)
{
- ARRAY_DEFINE(foos, struct foo);
+ ARRAY(struct foo) foos;
const struct foo *foo;
struct foo nfoo;
unsigned int i;
static void test_array_reverse(void)
{
- ARRAY_DEFINE(intarr, int);
+ ARRAY(int) intarr;
int input[] = { -1234567890, -272585721, 272485922, 824725652 };
const int *output;
unsigned int i, j;
const struct var_expand_table *
var_expand_table_build(char key, const char *value, char key2, ...)
{
- ARRAY_DEFINE(variables, struct var_expand_table);
+ ARRAY(struct var_expand_table) variables;
struct var_expand_table *var;
va_list args;
const char *name;
const char *session_id;
const char *mail_from;
- ARRAY_DEFINE(rcpt_to, struct mail_recipient);
+ ARRAY(struct mail_recipient) rcpt_to;
unsigned int rcpt_idx;
unsigned int data_end_idx;
const char *mail_from;
struct lmtp_proxy_settings set;
- ARRAY_DEFINE(connections, struct lmtp_proxy_connection *);
- ARRAY_DEFINE(rcpt_to, struct lmtp_proxy_recipient *);
+ ARRAY(struct lmtp_proxy_connection *) connections;
+ ARRAY(struct lmtp_proxy_recipient *) rcpt_to;
unsigned int next_data_reply_idx;
struct timeout *to_finish;
};
static struct log_connection *log_connections = NULL;
-static ARRAY_DEFINE(logs_by_fd, struct log_connection *);
+static ARRAY(struct log_connection *) logs_by_fd;
static void log_connection_destroy(struct log_connection *log);
struct service_list *old_service_list)
{
struct service *const *services, *old_service, *new_service;
- ARRAY_DEFINE(new_listeners_arr, struct service_listener *);
- ARRAY_DEFINE(old_listeners_arr, struct service_listener *);
+ ARRAY(struct service_listener *) new_listeners_arr;
+ ARRAY(struct service_listener *) old_listeners_arr;
struct service_listener *const *new_listeners, *const *old_listeners;
unsigned int i, j, count, new_count, old_count;
int fd;
struct io *io_write;
struct aqueue *process_queue;
- ARRAY_DEFINE(processes, struct service_process *);
+ ARRAY(struct service_process *) processes;
};
struct service_process_notify *
const char *extra_gids; /* comma-separated list */
/* all listeners, even those that aren't currently listening */
- ARRAY_DEFINE(listeners, struct service_listener *);
+ ARRAY(struct service_listener *) listeners;
/* linked list of all processes belonging to this service */
struct service_process *processes;
int master_dead_pipe_fd[2];
- ARRAY_DEFINE(services, struct service *);
+ ARRAY(struct service *) services;
unsigned int destroying:1;
unsigned int destroyed:1;
struct acl_object aclobj;
pool_t rights_pool;
- ARRAY_DEFINE(rights, struct acl_rights);
+ ARRAY(struct acl_rights) rights;
char *global_path, *local_path;
};
const char *global_dir;
pool_t acllist_pool;
- ARRAY_DEFINE(acllist, struct acl_backend_vfile_acllist);
+ ARRAY(struct acl_backend_vfile_acllist) acllist;
time_t acllist_last_check;
time_t acllist_mtime;
rights can be added to the mapping. */
pool_t right_names_pool;
/* idx => right name. */
- ARRAY_DEFINE(right_idx_name_map, const char *);
+ ARRAY(const char *) right_idx_name_map;
/* name => idx+1 */
HASH_TABLE(char *, unsigned int) right_name_idx_map;
};
struct dict_iterate_context *iter;
HASH_TABLE(char *, enum expire_user_state) user_states;
- ARRAY_DEFINE(queries, struct expire_query);
+ ARRAY(struct expire_query) queries;
time_t oldest_before_time;
bool delete_nonexistent_users;
};
struct expire_set {
pool_t pool;
- ARRAY_DEFINE(globs, struct imap_match_glob *);
+ ARRAY(struct imap_match_glob *) globs;
};
struct expire_set *expire_set_init(const char *const *patterns)
HASH_TABLE_TYPE(wguid_result) guids,
struct fts_multi_result *result)
{
- ARRAY_DEFINE(box_results, struct fts_result);
+ ARRAY(struct fts_result) box_results;
struct fts_result *box_result;
const char *guid;
wchar_t *guid_dup;
IndexSearcher *searcher;
Analyzer *default_analyzer, *cur_analyzer;
- ARRAY_DEFINE(analyzers, struct lucene_analyzer);
+ ARRAY(struct lucene_analyzer) analyzers;
Document *doc;
uint32_t prev_uid;
{
struct solr_result **solr_results;
struct fts_result *fts_result;
- ARRAY_DEFINE(fts_results, struct fts_result);
+ ARRAY(struct fts_result) fts_results;
struct mail_namespace *ns;
struct mailbox_status status;
HASH_TABLE(char *, struct mailbox *) mailboxes;
uint32_t prev_uid;
string_t *cmd, *cur_value, *cur_value2;
string_t *cmd_expunge;
- ARRAY_DEFINE(fields, struct solr_fts_field);
+ ARRAY(struct solr_fts_field) fields;
uint32_t last_indexed_uid;
uint32_t size_warned_uid;
{
struct solr_result **solr_results;
struct fts_result *fts_result;
- ARRAY_DEFINE(fts_results, struct fts_result);
+ ARRAY(struct fts_result) fts_results;
HASH_TABLE(char *, struct mailbox *) mailboxes;
struct mailbox *box;
const char *box_guid;
pool_t result_pool;
/* box_id -> solr_result */
HASH_TABLE(char *, struct solr_result *) mailboxes;
- ARRAY_DEFINE(results, struct solr_result *);
+ ARRAY(struct solr_result *) results;
};
struct solr_connection_post {
struct squat_trie_iterate_context {
struct squat_trie *trie;
struct squat_trie_iterate_node cur;
- ARRAY_DEFINE(parents, struct squat_trie_iterate_node);
+ ARRAY(struct squat_trie_iterate_node) parents;
bool failed;
};
ARRAY_TYPE(uint32_t) block_offsets;
ARRAY_TYPE(uint32_t) block_end_indexes;
- ARRAY_DEFINE(lists, struct uidlist_list);
+ ARRAY(struct uidlist_list) lists;
uint32_t list_start_idx;
struct squat_uidlist_file_header build_hdr;
#include "../virtual/virtual-storage.h"
#include "fts-api-private.h"
-static ARRAY_DEFINE(backends, const struct fts_backend *);
+static ARRAY(const struct fts_backend *) backends;
void fts_backend_register(const struct fts_backend *backend)
{
struct fts_parser_script_user {
union mail_user_module_context module_ctx;
- ARRAY_DEFINE(content, struct content);
+ ARRAY(struct content) content;
};
struct script_fts_parser {
struct mail_search_args *args;
pool_t result_pool;
- ARRAY_DEFINE(levels, struct fts_search_level);
+ ARRAY(struct fts_search_level) levels;
buffer_t *orig_matches;
uint32_t first_unindexed_seq;
const char *pop3_box_vname;
struct mailbox *pop3_box;
- ARRAY_DEFINE(pop3_uidl_map, struct pop3_uidl_map);
+ ARRAY(struct pop3_uidl_map) pop3_uidl_map;
unsigned int all_mailboxes:1;
unsigned int pop3_all_hdr_sha1_set:1;
struct pop3_migration_mailbox {
union mailbox_module_context module_ctx;
- ARRAY_DEFINE(imap_msg_map, struct imap_msg_map);
+ ARRAY(struct imap_msg_map) imap_msg_map;
unsigned int first_unfound_idx;
unsigned int uidl_synced:1;
struct mail_user *user;
struct quota_settings *set;
- ARRAY_DEFINE(roots, struct quota_root *);
- ARRAY_DEFINE(namespaces, struct mail_namespace *);
+ ARRAY(struct quota_root *) roots;
+ ARRAY(struct mail_namespace *) namespaces;
};
struct quota_settings {
pool_t pool;
- ARRAY_DEFINE(root_sets, struct quota_root_settings *);
+ ARRAY(struct quota_root_settings *) root_sets;
int (*test_alloc)(struct quota_transaction_context *ctx,
uoff_t size, bool *too_large_r);
const struct quota_backend *backend;
struct quota_rule default_rule;
- ARRAY_DEFINE(rules, struct quota_rule);
- ARRAY_DEFINE(warning_rules, struct quota_warning_rule);
+ ARRAY(struct quota_rule) rules;
+ ARRAY(struct quota_warning_rule) warning_rules;
/* Limits in default_rule override backend's quota limits */
unsigned int force_default_rule:1;
int resource_ret;
/* Module-specific contexts. See quota_module_id. */
- ARRAY_DEFINE(quota_module_contexts, void);
+ ARRAY(void) quota_module_contexts;
/* don't enforce quota when saving */
unsigned int no_enforcing:1;
struct mailbox_transaction_context *expunge_trans;
struct quota_transaction_context *expunge_qt;
- ARRAY_DEFINE(expunge_uids, uint32_t);
- ARRAY_DEFINE(expunge_sizes, uoff_t);
+ ARRAY(uint32_t) expunge_uids;
+ ARRAY(uoff_t) expunge_sizes;
unsigned int recalculate:1;
};
ret = -1;
else if (ctx->bytes_used != 0 || ctx->count_used != 0 ||
ctx->recalculate) T_BEGIN {
- ARRAY_DEFINE(warn_roots, struct quota_root *);
+ ARRAY(struct quota_root *) warn_roots;
mailbox_name = mailbox_get_vname(ctx->box);
(void)mail_namespace_find_unalias(
union mail_user_module_context module_ctx;
/* ordered by priority, highest first */
- ARRAY_DEFINE(trash_boxes, struct trash_mailbox);
+ ARRAY(struct trash_mailbox) trash_boxes;
};
const char *trash_plugin_version = DOVECOT_VERSION;
/* currently active mail */
struct mail *backend_mail;
/* all allocated mails */
- ARRAY_DEFINE(backend_mails, struct mail *);
+ ARRAY(struct mail *) backend_mails;
/* mail is lost if backend_mail doesn't point to correct mail */
unsigned int lost:1;
ARRAY_TYPE(seq_range) result;
struct seq_range_iter result_iter;
- ARRAY_DEFINE(records, struct virtual_search_record);
+ ARRAY(struct virtual_search_record) records;
enum virtual_search_state search_state;
unsigned int next_result_n;
struct mailbox *box;
/* Messages currently included in the virtual mailbox,
sorted by real_uid */
- ARRAY_DEFINE(uids, struct virtual_backend_uidmap);
+ ARRAY(struct virtual_backend_uidmap) uids;
/* temporary mail used while syncing */
struct mail *sync_mail;
/* messages expunged within this sync */
ARRAY_TYPE(seq_range) sync_expunges;
- ARRAY_DEFINE(all_adds, struct virtual_add_record);
+ ARRAY(struct virtual_add_record) all_adds;
enum mailbox_sync_flags flags;
uint32_t uid_validity;
struct virtual_transaction_context {
struct mailbox_transaction_context t;
- ARRAY_DEFINE(backend_transactions,
- struct mailbox_transaction_context *);
+ ARRAY(struct mailbox_transaction_context *) backend_transactions;
};
struct mailbox_transaction_context *
struct mail_search_context *ctx;
struct mail *mail;
uoff_t size;
- ARRAY_DEFINE(message_sizes, uoff_t);
+ ARRAY(uoff_t) message_sizes;
ARRAY_TYPE(uint32_t) msgnum_to_seq_map = ARRAY_INIT;
unsigned int msgnum;
int ret = 1;
enum uidl_keys uidl_keymask;
/* Module-specific contexts. */
- ARRAY_DEFINE(module_contexts, union pop3_module_context *);
+ ARRAY(union pop3_module_context *) module_contexts;
unsigned int disconnected:1;
unsigned int deleted:1;
const struct replicator_settings *set;
struct timeout *to;
- ARRAY_DEFINE(doveadm_conns, struct doveadm_connection *);
+ ARRAY(struct doveadm_connection *) doveadm_conns;
};
static void replicator_brain_fill(struct replicator_brain *brain);
/* username => struct replicator_user* */
HASH_TABLE(char *, struct replicator_user *) user_hash;
- ARRAY_DEFINE(sync_lookups, struct replicator_sync_lookup);
+ ARRAY(struct replicator_sync_lookup) sync_lookups;
unsigned int full_sync_interval;
struct replicator_user *user)
{
struct replicator_sync_lookup *lookups;
- ARRAY_DEFINE(callbacks, struct replicator_sync_lookup);
+ ARRAY(struct replicator_sync_lookup) callbacks;
unsigned int i, count;
bool success = !user->last_sync_failed;
struct ostream *output;
};
-static ARRAY_DEFINE(delayed_fds, int);
+static ARRAY(int) delayed_fds;
struct ssl_params *param;
static buffer_t *ssl_params;
static struct timeout *to_startup;