/* We have to know that the key will fit, but the last entry on the page is an overflow pair, so we need to shift things.  */
static void squeeze_key(u_int16_t *sp, const DBT *key, const DBT *val)
/* We have to know that the key will fit, but the last entry on the page is an overflow pair, so we need to shift things.  */
static void squeeze_key(u_int16_t *sp, const DBT *key, const DBT *val)
{
	register char *p;
	u_int16_t free_space, n, off, pageno;
	p = (char *)sp;
	n = sp[0];
	free_space = FREESPACE(sp);
	off = OFFSET(sp);
	pageno = sp[n - 1];
	off -= key->size;
	sp[n - 1] = off;
	memmove(p + off, key->data, key->size);
	off -= val->size;
	sp[n] = off;
	memmove(p + off, val->data, val->size);
	sp[0] = n + 2;
	sp[n + 1] = pageno;
	sp[n + 2] = OVFLPAGE;
	FREESPACE(sp) = free_space - PAIRSIZE(key, val);
	OFFSET(sp) = off;
}