d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina/* Copyright (c) 2003-2018 Dovecot authors, see the included COPYING file */
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březinaarray_idx_modifiable_i(const struct array *array, unsigned int idx)
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina i_assert(idx * array->element_size < array->buffer->used);
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina return PTR_OFFSET(array->buffer->data, idx * array->element_size);
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březinavoid *array_idx_get_space_i(struct array *array, unsigned int idx)
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina return buffer_get_space_unsafe(array->buffer, idx * array->element_size,
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březinavoid array_idx_set_i(struct array *array, unsigned int idx, const void *data)
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina buffer_write(array->buffer, idx * array->element_size,
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březinavoid array_idx_clear_i(struct array *array, unsigned int idx)
d3dee2a07f1a8ee9ae6f94e149ced754ef76c248Pavel Březina buffer_write_zero(array->buffer, idx * array->element_size,
return data;
return FALSE;
int (*cmp)(const void *, const void*))
return FALSE;
return FALSE;
for (i = 0; i < count1; i++) {
return FALSE;
return TRUE;
int (*cmp)(const void *, const void *, const void *),
const void *context)
return FALSE;
return FALSE;
for (i = 0; i < count1; i++) {
return FALSE;
return TRUE;
if (count == 0)
int (*cmp)(const void *, const void *))
int (*cmp)(const void *, const void *))
return NULL;