int flags;
u_int32_t flags;
__bam_c_del(dbc, flags)	DBC *dbc;	int flags;{	CURSOR *cp;	DB *dbp;	DB_LOCK lock;	PAGE *h;	db_pgno_t pgno;	db_indx_t indx;	int ret;	DEBUG_LWRITE(dbc->dbp, dbc->txn, "bam_c_del", NULL, NULL, flags);	cp = dbc->internal;	/* Check for invalid flags. */	if ((ret = __db_cdelchk(dbc->dbp, flags,	    F_ISSET(dbc->dbp, DB_AM_RDONLY), cp->pgno != PGNO_INVALID)) != 0)		return (ret);	/* If already deleted, return failure. */	if (F_ISSET(cp, C_DELETED | C_REPLACE))		return (DB_KEYEMPTY);	GETHANDLE(dbc->dbp, dbc->txn, &dbp, ret);	/*	 * We don't physically delete the record until the cursor moves,	 * so we have to have a long-lived write lock on the page instead	 * of a long-lived read lock.  Note, we have to have a read lock	 * to even get here, so we simply discard it.	 */	if (F_ISSET(dbp, DB_AM_LOCKING) && cp->mode != DB_LOCK_WRITE) {		if ((ret = __bam_lget(dbp,		    0, cp->pgno, DB_LOCK_WRITE, &lock)) != 0)			goto err;		(void)__BT_TLPUT(dbp, cp->lock);		cp->lock = lock;		cp->mode = DB_LOCK_WRITE;	}	/*	 * Acquire the underlying page (which may be different from the above	 * page because it may be a duplicate page), and set the on-page and	 * in-cursor delete flags.  We don't need to lock it as we've already	 * write-locked the page leading to it.	 */	if (cp->dpgno == PGNO_INVALID) {		pgno = cp->pgno;		indx = cp->indx;	} else {		pgno = cp->dpgno;		indx = cp->dindx;	}	if ((ret = __bam_pget(dbp, &h, &pgno, 0)) != 0)		goto err;	/* Log the change. */	if (DB_LOGGING(dbp) &&	    (ret = __bam_cdel_log(dbp->dbenv->lg_info, dbp->txn, &LSN(h),	    0, dbp->log_fileid, PGNO(h), &LSN(h), indx)) != 0) {		(void)memp_fput(dbp->mpf, h, 0);		goto err;	}	/* Set the intent-to-delete flag on the page and in all cursors. */	if (cp->dpgno == PGNO_INVALID)		B_DSET(GET_BKEYDATA(h, indx + O_INDX)->type);	else		B_DSET(GET_BKEYDATA(h, indx)->type);	(void)__bam_ca_delete(dbp, pgno, indx, NULL, 0);	ret = memp_fput(dbp->mpf, h, DB_MPOOL_DIRTY);err:	PUTHANDLE(dbp);	return (ret);}