if (key_einval && (key->data == NULL || key->size == 0)) return (__db_keyempty(dbp->dbenv));
__db_cgetchk(dbp, key, data, flags, isvalid)	const DB *dbp;	DBT *key, *data;	int flags, isvalid;{	int check_key;	check_key = 0;	/* Check for invalid dbc->c_get() function flags. */	switch (flags) {	case DB_CURRENT:	case DB_FIRST:	case DB_LAST:	case DB_NEXT:	case DB_PREV:	case DB_SET_RANGE:		check_key = 1;		break;	case DB_SET:		break;	case DB_GET_RECNO:		if (!F_ISSET(dbp, DB_BT_RECNUM))			goto err;		break;	case DB_SET_RECNO:		if (!F_ISSET(dbp, DB_BT_RECNUM))			goto err;		check_key = 1;		break;	default:err:		return (__db_ferr(dbp->dbenv, "c_get", 0));	}	/* Check for invalid key/data flags. */	if (check_key)		DB_CHECK_FLAGS(dbp->dbenv, "key", key->flags,		    DB_DBT_MALLOC | DB_DBT_USERMEM | DB_DBT_PARTIAL);	DB_CHECK_FLAGS(dbp->dbenv, "data", data->flags,	    DB_DBT_MALLOC | DB_DBT_USERMEM | DB_DBT_PARTIAL);	/* Check dbt's for valid flags when multi-threaded. */	if (F_ISSET(dbp, DB_AM_THREAD)) {		if (!F_ISSET(data, DB_DBT_USERMEM | DB_DBT_MALLOC))			return (__db_ferr(dbp->dbenv, "threaded data", 1));		if (check_key &&		    !F_ISSET(key, DB_DBT_USERMEM | DB_DBT_MALLOC))			return (__db_ferr(dbp->dbenv, "threaded key", 1));	}	/*	 * The cursor must be initialized for DB_CURRENT, return -1 for an	 * invalid cursor, otherwise 0.	 */	return (isvalid || flags != DB_CURRENT ? 0 : EINVAL);}