src/btree/block.c
/*=======================================
 * crtblock -- Create new BLOCK for BTREE
 *=====================================*/
- Create new BLOCK for BTREE
- Create new BLOCK for BTREE
BLOCK
crtblock (BTREE btree)  
{
	BLOCK block;
	ASSERT(bwrite(btree) == 1);
	block = allocblock();
	ixself(block) = btree->b_kfile.k_fkey;
	nextfkey(btree);
	rewind(bkfp(btree));
	if (fwrite(&bkfile(btree), sizeof(bkfile(btree)), 1, bkfp(btree)) != 1)
		FATAL();
	return block;
}
BLOCK crtblock ( BTREE btree ) { BLOCK block ; ASSERT ( bwrite ( btree ) == 1 ) ; block = allocblock ( ) ; ixself ( block ) = btree -> b_kfile . k_fkey ; nextfkey ( btree ) ; rewind ( bkfp ( btree ) ) ; if ( fwrite ( & bkfile ( btree ) , sizeof ( bkfile ( btree ) ) , 1 , bkfp ( btree ) ) != 1 ) FATAL ( ) ; return block ; }
crtblock -- Create new BLOCK for BTREE
crtblock -- Create new BLOCK for BTREE
/*btree handle*/