int flags;
u_int32_t flags;
__ham_put(dbp, txn, key, data, flags)	DB *dbp;	DB_TXN *txn;	DBT *key;	DBT *data;	int flags;{	DB *ldbp;	HTAB *hashp;	HASH_CURSOR *hcp;	DBT tmp_val, *myval;	int ret, t_ret;	u_int32_t nbytes;	DEBUG_LWRITE(dbp, txn, "ham_put", key, data, flags);	if ((ret = __db_putchk(dbp, key, data,	    flags, F_ISSET(dbp, DB_AM_RDONLY), F_ISSET(dbp, DB_AM_DUP))) != 0)		return (ret);	ldbp = dbp;	if (F_ISSET(dbp, DB_AM_THREAD) &&	    (ret = __db_gethandle(dbp, __ham_hdup, &ldbp)) != 0)		return (ret);	hashp = (HTAB *)ldbp->internal;	SET_LOCKER(ldbp, txn);	GET_META(ldbp, hashp);	hcp = TAILQ_FIRST(&ldbp->curs_queue)->internal;	nbytes = (ISBIG(hashp, key->size) ? HOFFPAGE_PSIZE :	    HKEYDATA_PSIZE(key->size)) +	    (ISBIG(hashp, data->size) ? HOFFPAGE_PSIZE :	    HKEYDATA_PSIZE(data->size));	hashp->hash_accesses++;	ret = __ham_lookup(hashp, hcp, key, nbytes, DB_LOCK_WRITE);	if (ret == DB_NOTFOUND) {		ret = 0;		if (hcp->seek_found_page != PGNO_INVALID &&		    hcp->seek_found_page != hcp->pgno) {			if ((ret = __ham_item_done(hashp, hcp, 0)) != 0)				goto out;			hcp->pgno = hcp->seek_found_page;			hcp->bndx = NDX_INVALID;		}		if (F_ISSET(data, DB_DBT_PARTIAL) && data->doff != 0) {			/*			 * Doing a partial put, but the key does not exist			 * and we are not beginning the write at 0.  We			 * must create a data item padded up to doff and			 * then write the new bytes represented by val.			 */			ret = __ham_init_dbt(&tmp_val, data->size + data->doff,			    &hcp->big_data, &hcp->big_datalen);			if (ret == 0) {				memset(tmp_val.data, 0, data->doff);				memcpy((u_int8_t *)tmp_val.data + data->doff,				    data->data, data->size);				myval = &tmp_val;			}		} else			myval = (DBT *)data;		if (ret == 0)			ret = __ham_add_el(hashp, hcp, key, myval, H_KEYDATA);	} else if (ret == 0 && F_ISSET(hcp, H_OK)) {		if (flags == DB_NOOVERWRITE)			ret = DB_KEYEXIST;		else if (F_ISSET(ldbp, DB_AM_DUP))			ret = __ham_add_dup(hashp, hcp, data, DB_KEYLAST);		else			ret = __ham_overwrite(hashp, hcp, data);	}	/* Free up all the cursor pages. */	if ((t_ret = __ham_item_done(hashp, hcp, ret == 0)) != 0 && ret == 0)		ret = t_ret;	/* Now check if we have to grow. */out:	if (ret == 0 && F_ISSET(hcp, H_EXPAND)) {		ret = __ham_expand_table(hashp);		F_CLR(hcp, H_EXPAND);	}	if ((t_ret = __ham_item_done(hashp, hcp, ret == 0)) != 0 && ret == 0)		ret = t_ret;	RELEASE_META(ldbp, hashp);	if (F_ISSET(dbp, DB_AM_THREAD))		__db_puthandle(ldbp);	return (ret);}