/* Copyright (c) 2003-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "bsearch-insert-pos.h"
#include "mail-index-private.h"
{
offset >>= 2;
return cpu32_to_be(offset);
}
{
return 0;
return (((offset & 0x0000007f)) |
}
{
/* number continues as long as the highest bit is set */
while (num >= 0x80) {
*p += 1;
num >>= 7;
}
**p = num;
*p += 1;
}
{
const uint8_t *c = *p;
unsigned int bits = 0;
for (;;) {
/* we should never see EOF */
*num_r = 0;
return -1;
}
if (*c < 0x80)
break;
bits += 7;
c++;
}
/* broken input */
*p = end;
*num_r = 0;
return -1;
}
*p = c + 1;
return 0;
}
{
}
{
}
{
sizeof(uint32_t) + aligned_record_size,
}
void *old_record)
{
void *p;
/* records need to be 32bit aligned */
if (!array_is_created(array))
/* already there, update */
if (old_record != NULL) {
/* save the old record before overwriting it */
}
return TRUE;
} else {
/* insert */
return FALSE;
}
}