static bool client_command_input(struct client_command_context *cmd)
{
struct client *client = cmd->client;
- struct command *command;
+ const struct command *command;
const char *tag, *name;
int ret;
return strcasecmp(name, cmd->name);
}
-struct command *command_find(const char *name)
+const struct command *command_find(const char *name)
{
if (commands_unsorted) {
array_sort(&imap_commands, command_cmp);
needed during command_exec(). */
void command_stats_flush(struct client_command_context *cmd);
-struct command *command_find(const char *name);
+const struct command *command_find(const char *name);
void commands_init(void);
void commands_deinit(void);
if (client->state_import_idle_continue) {
/* IDLE command continues */
struct client_command_context *cmd;
- struct command *command;
+ const struct command *command;
cmd = client_command_alloc(client);
cmd->tag = p_strdup(cmd->pool, tag);
return strcasecmp(name, cmd->name);
}
-static struct smtp_server_command_reg *
+static const struct smtp_server_command_reg *
smtp_server_command_find(struct smtp_server *server, const char *name)
{
if (server->commands_unsorted) {
{
struct mdbox_map *map = ctx->storage->map;
const struct mail_index_header *hdr;
- struct mdbox_rebuild_msg **pos;
+ struct mdbox_rebuild_msg *const *pos;
struct mdbox_rebuild_msg search_msg, *search_msgp = &search_msg;
struct dbox_mail_lookup_rec rec;
uint32_t seq;
uint32_t map_uid)
{
struct mdbox_rebuild_msg search_msg, *search_msgp = &search_msg;
- struct mdbox_rebuild_msg **pos;
+ struct mdbox_rebuild_msg *const *pos;
search_msg.map_uid = map_uid;
pos = array_bsearch(&ctx->msgs, &search_msgp,
count, array->element_size, cmp);
}
-void *array_bsearch_i(struct array *array, const void *key,
- int (*cmp)(const void *, const void *))
+const void *array_bsearch_i(const struct array *array, const void *key,
+ int (*cmp)(const void *, const void *))
{
unsigned int count;
&(array)->arr, (const void *)key, \
(int (*)(const void *, const void *))cmp))
-void *array_bsearch_i(struct array *array, const void *key,
- int (*cmp)(const void *, const void *));
+const void *array_bsearch_i(const struct array *array, const void *key,
+ int (*cmp)(const void *, const void *));
static inline void *array_bsearch_modifiable_i(struct array *array, const void *key,
int (*cmp)(const void *, const void *))
{
}
#define array_bsearch(array, key, cmp) \
- ARRAY_TYPE_CAST_MODIFIABLE(array) \
+ ARRAY_TYPE_CAST_CONST(array) \
ARRAY_SEARCH_CALL(bsearch, array, key, cmp)
#define array_bsearch_modifiable(array, key, cmp) \
ARRAY_TYPE_CAST_MODIFIABLE(array) \
struct mail_private *mail = (struct mail_private *)_mail;
union mail_module_context *mmail = POP3_MIGRATION_MAIL_CONTEXT(mail);
struct pop3_migration_mailbox *mbox = POP3_MIGRATION_CONTEXT_REQUIRE(_mail->box);
- struct imap_msg_map map_key, *map;
+ const struct imap_msg_map *map;
+ struct imap_msg_map map_key;
if (field == MAIL_FETCH_UIDL_BACKEND ||
field == MAIL_FETCH_POP3_ORDER) {
const ARRAY_TYPE(seq_range) *uids_arr)
{
unsigned int i, uid, vseq;
- struct virtual_backend_uidmap *vuid;
+ const struct virtual_backend_uidmap *vuid;
struct seq_range_iter iter;
i = 0;