int type;
u_int type;
__db_isbad(h, die)	PAGE *h;	int die;{	BINTERNAL *bi;	BKEYDATA *bk;	FILE *fp;	db_indx_t i;	int type;	fp = __db_prinit(NULL);	switch (TYPE(h)) {	case P_DUPLICATE:	case P_HASH:	case P_IBTREE:	case P_INVALID:	case P_IRECNO:	case P_LBTREE:	case P_LRECNO:	case P_OVERFLOW:		break;	default:		fprintf(fp, "ILLEGAL PAGE TYPE: page: %lu type: %lu\n",		    (u_long)h->pgno, (u_long)TYPE(h));		goto bad;	}	for (i = 0; i < NUM_ENT(h); i++) {		if (P_ENTRY(h, i) - (u_int8_t *)h < P_OVERHEAD ||		    (size_t)(P_ENTRY(h, i) - (u_int8_t *)h) >= set_psize) {			fprintf(fp,			    "ILLEGAL PAGE OFFSET: indx: %lu of %lu\n",			    (u_long)i, (u_long)h->inp[i]);			goto bad;		}		switch (TYPE(h)) {		case P_HASH:			type = HPAGE_TYPE(h, i);			if (type != H_OFFDUP &&			    type != H_DUPLICATE &&			    type != H_KEYDATA &&			    type != H_OFFPAGE) {				fprintf(fp, "ILLEGAL HASH TYPE: %lu\n",				    (u_long)type);				goto bad;			}			break;		case P_IBTREE:			bi = GET_BINTERNAL(h, i);			if (B_TYPE(bi->type) != B_KEYDATA &&			    B_TYPE(bi->type) != B_DUPLICATE &&			    B_TYPE(bi->type) != B_OVERFLOW) {				fprintf(fp, "ILLEGAL BINTERNAL TYPE: %lu\n",				    (u_long)B_TYPE(bi->type));				goto bad;			}			break;		case P_IRECNO:		case P_LBTREE:		case P_LRECNO:			break;		case P_DUPLICATE:			bk = GET_BKEYDATA(h, i);			if (B_TYPE(bk->type) != B_KEYDATA &&			    B_TYPE(bk->type) != B_DUPLICATE &&			    B_TYPE(bk->type) != B_OVERFLOW) {				fprintf(fp,			    "ILLEGAL DUPLICATE/LBTREE/LRECNO TYPE: %lu\n",				    (u_long)B_TYPE(bk->type));				goto bad;			}			break;		default:			fprintf(fp,			    "ILLEGAL PAGE ITEM: %lu\n", (u_long)TYPE(h));			goto bad;		}	}	return (0);bad:	if (die) {		abort();		/* NOTREACHED */	}	return (1);}