HASH_CURSOR *hcp, save_curs;
u_int32_t nbytes;
__ham_c_put(cursor, key, data, flags)	DBC *cursor;	DBT *key;	DBT *data;	int flags;{	DB *ldbp;	HTAB *hashp;	HASH_CURSOR *hcp, save_curs;	int ret, t_ret;	u_int32_t nbytes;	DEBUG_LWRITE(cursor->dbp, cursor->txn, "ham_c_put",	    flags == DB_KEYFIRST || flags == DB_KEYLAST ? key : NULL,	    NULL, flags);	ldbp = cursor->dbp;	if (F_ISSET(cursor->dbp, DB_AM_THREAD) &&	    (ret = __db_gethandle(cursor->dbp, __ham_hdup, &ldbp)) != 0)		return (ret);	hashp = (HTAB *)(ldbp->internal);	hcp = (HASH_CURSOR *)cursor->internal;	save_curs = *hcp;	if ((ret = __db_cputchk(hashp->dbp, key, data, flags,	    F_ISSET(ldbp, DB_AM_RDONLY), IS_VALID(hcp))) != 0)		return (ret);	if (F_ISSET(hcp, H_DELETED))		return (DB_NOTFOUND);	SET_LOCKER(hashp->dbp, cursor->txn);	GET_META(hashp->dbp, hashp);	ret = 0;	switch (flags) {	case DB_KEYLAST:	case DB_KEYFIRST:		nbytes = (ISBIG(hashp, key->size) ? HOFFPAGE_PSIZE :		    HKEYDATA_PSIZE(key->size)) +		    (ISBIG(hashp, data->size) ? HOFFPAGE_PSIZE :		    HKEYDATA_PSIZE(data->size));		ret = __ham_lookup(hashp, hcp, key, nbytes, DB_LOCK_WRITE);		break;	case DB_BEFORE:	case DB_AFTER:	case DB_CURRENT:		ret = __ham_item(hashp, hcp, DB_LOCK_WRITE);		break;	}	if (ret == 0) {		if (flags == DB_CURRENT && !F_ISSET(ldbp, DB_AM_DUP))			ret = __ham_overwrite(hashp, hcp, data);		else			ret = __ham_add_dup(hashp, hcp, data, flags);	}	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;	if (ret != 0)		*hcp = save_curs;	RELEASE_META(hashp->dbp, hashp);	if (F_ISSET(cursor->dbp, DB_AM_THREAD))		__db_puthandle(ldbp);	return (ret);}