/* Do not edit: automatically built by gen_rpc.awk. */
#include "db_config.h"

#ifndef NO_SYSTEM_INCLUDES
#include <sys/types.h>
#include <rpc/rpc.h>

#include <errno.h>
#include <string.h>
#endif

#include "db_server.h"
#include "db_int.h"
#include "db_page.h"
#include "db_ext.h"
#include "txn.h"

#include "gen_client_ext.h"

int
__dbcl_envclose_ret(dbenv, flags, replyp)
	DB_ENV * dbenv;
	u_int32_t flags;
	__envclose_reply *replyp;
{
	int ret;

	if (replyp->status != 0)
		return (replyp->status);

	/*
	 * XXX Code goes here
	 */

	return (replyp->status);
}

int
__dbcl_envopen_ret(dbenv, home, config, flags, mode, replyp)
	DB_ENV * dbenv;
	const char * home;
	char * const * config;
	u_int32_t flags;
	int mode;
	__envopen_reply *replyp;
{
	int ret;

	if (replyp->status != 0)
		return (replyp->status);

	/*
	 * XXX Code goes here
	 */

	return (replyp->status);
}

int
__dbcl_envremove_ret(dbenv, home, config, flags, replyp)
	DB_ENV * dbenv;
	const char * home;
	char * const * config;
	u_int32_t flags;
	__envremove_reply *replyp;
{
	int ret;

	if (replyp->status != 0)
		return (replyp->status);

	/*
	 * XXX Code goes here
	 */

	return (replyp->status);
}

int
__dbcl_txnabort_ret(txnp, replyp)
	DB_TXN * txnp;
	__txnabort_reply *replyp;
{
	int ret;

	if (replyp->status != 0)
		return (replyp->status);

	/*
	 * XXX Code goes here
	 */

	return (replyp->status);
}

int
__dbcl_txnbegin_ret(envp, parent, txnpp, flags, replyp)
	DB_ENV * envp;
	DB_TXN * parent;
	DB_TXN ** txnpp;
	u_int32_t flags;
	__txnbegin_reply *replyp;
{
	int ret;
	long txnid;

	if (replyp->status != 0)
		return (replyp->status);
	txnid = replyp->txnidcl_id;

	/*
	 * XXX Code goes here
	 */

	return (replyp->status);
}

int
__dbcl_txncommit_ret(txnp, flags, replyp)
	DB_TXN * txnp;
	u_int32_t flags;
	__txncommit_reply *replyp;
{
	int ret;

	if (replyp->status != 0)
		return (replyp->status);

	/*
	 * XXX Code goes here
	 */

	return (replyp->status);
}

int
__dbcl_dbclose_ret(dbp, flags, replyp)
	DB * dbp;
	u_int32_t flags;
	__dbclose_reply *replyp;
{
	int ret;

	if (replyp->status != 0)
		return (replyp->status);

	/*
	 * XXX Code goes here
	 */

	return (replyp->status);
}

int
__dbcl_dbget_ret(dbp, txnp, key, data, flags, replyp)
	DB * dbp;
	DB_TXN * txnp;
	DBT * key;
	DBT * data;
	u_int32_t flags;
	__dbget_reply *replyp;
{
	int ret;
	/* DBT key; */
	/* DBT data; */

	if (replyp->status != 0)
		return (replyp->status);
	/* Handle replyp->keydata; */
	/* Handle replyp->datadata; */

	/*
	 * XXX Code goes here
	 */

	return (replyp->status);
}

int
__dbcl_dbopen_ret(dbp, name, subdb, type, flags, mode, replyp)
	DB * dbp;
	const char * name;
	const char * subdb;
	DBTYPE type;
	u_int32_t flags;
	int mode;
	__dbopen_reply *replyp;
{
	int ret;
	DBTYPE type;
	u_int32_t dbflags;

	if (replyp->status != 0)
		return (replyp->status);
	type = replyp->type;
	dbflags = replyp->dbflags;

	/*
	 * XXX Code goes here
	 */

	return (replyp->status);
}

int
__dbcl_dbput_ret(dbp, txnp, key, data, flags, replyp)
	DB * dbp;
	DB_TXN * txnp;
	DBT * key;
	DBT * data;
	u_int32_t flags;
	__dbput_reply *replyp;
{
	int ret;
	/* DBT key; */

	if (replyp->status != 0)
		return (replyp->status);
	/* Handle replyp->keydata; */

	/*
	 * XXX Code goes here
	 */

	return (replyp->status);
}

int
__dbcl_dbremove_ret(dbp, name, subdb, flags, replyp)
	DB * dbp;
	const char * name;
	const char * subdb;
	u_int32_t flags;
	__dbremove_reply *replyp;
{
	int ret;

	if (replyp->status != 0)
		return (replyp->status);

	/*
	 * XXX Code goes here
	 */

	return (replyp->status);
}

int __db_dbstat_statsreplist __P((__dbstat_statsreplist, u_int32_t **));
void __db_dbstat_statsfree __P((u_int32_t *));

int
__dbcl_dbstat_ret(dbp, sp, func, flags, replyp)
	DB * dbp;
	void * sp;
	void *(*func) __P((size_t));
	u_int32_t flags;
	__dbstat_reply *replyp;
{
	int ret;
	u_int32_t *__db_statslist;

	if (replyp->status != 0)
		return (replyp->status);

	if ((ret = __db_dbstat_statslist(replyp->statslist, &__db_statslist)) != 0)
		return (ret);

	/*
	 * XXX Handle list
	 */

	__db_dbstat_statsfree(__db_statslist);

	/*
	 * XXX Code goes here
	 */

	return (replyp->status);
}

int
__db_dbstat_statsreplist(locp, ppp)
	__dbstat_statsreplist *locp;
	u_int32_t **ppp;
{
	u_int32_t *pp;
	int cnt, ret, size;
	__dbstat_statsreplist *nl;

	for (cnt = 0, nl = locp; nl != NULL; cnt++, nl = nl->next)
		;

	if (cnt == 0) {
		*ppp = NULL;
		return (0);
	}
	size = sizeof(*pp) * cnt;
	if ((ret = __os_malloc(size, NULL, ppp)) != 0)
		return (ret);
	memset(*ppp, 0, size);
	for (pp = *ppp, nl = locp; nl != NULL; nl = nl->next, pp++) {
		*pp = *(u_int32_t *)nl->ent.ent_val;
	}
	return (0);
out:
	__db_dbstat_statsfree(*ppp);
	return (ret);
}

void
__db_dbstat_statsfree(pp)
	u_int32_t *pp;
{
	size_t size;
	u_int32_t *p;

	if (pp == NULL)
		return;
	size = sizeof(*p);
	for (p = pp; *p != 0; p++) {
		size += sizeof(*p);
	}
	__os_free(pp, size);
}

int
__dbcl_dbcursor_ret(dbp, txnp, dbcpp, flags, replyp)
	DB * dbp;
	DB_TXN * txnp;
	DBC ** dbcpp;
	u_int32_t flags;
	__dbcursor_reply *replyp;
{
	int ret;
	long dbcid;

	if (replyp->status != 0)
		return (replyp->status);
	dbcid = replyp->dbcidcl_id;

	/*
	 * XXX Code goes here
	 */

	return (replyp->status);
}

int
__dbcl_dbjoin_ret(dbp, curs, dbcp, flags, replyp)
	DB * dbp;
	DBC ** curs;
	DBC ** dbcp;
	u_int32_t flags;
	__dbjoin_reply *replyp;
{
	int ret;
	long dbcid;

	if (replyp->status != 0)
		return (replyp->status);
	dbcid = replyp->dbcidcl_id;

	/*
	 * XXX Code goes here
	 */

	return (replyp->status);
}

int
__dbcl_dbc_close_ret(dbc, replyp)
	DBC * dbc;
	__dbc_close_reply *replyp;
{
	int ret;

	if (replyp->status != 0)
		return (replyp->status);

	/*
	 * XXX Code goes here
	 */

	return (replyp->status);
}

int
__dbcl_dbc_count_ret(dbc, countp, flags, replyp)
	DBC * dbc;
	db_recno_t * countp;
	u_int32_t flags;
	__dbc_count_reply *replyp;
{
	int ret;
	db_recno_t dupcount;

	if (replyp->status != 0)
		return (replyp->status);
	dupcount = replyp->dupcount;

	/*
	 * XXX Code goes here
	 */

	return (replyp->status);
}

int
__dbcl_dbc_dup_ret(dbc, dbcp, flags, replyp)
	DBC * dbc;
	DBC ** dbcp;
	u_int32_t flags;
	__dbc_dup_reply *replyp;
{
	int ret;
	long dbcid;

	if (replyp->status != 0)
		return (replyp->status);
	dbcid = replyp->dbcidcl_id;

	/*
	 * XXX Code goes here
	 */

	return (replyp->status);
}

int
__dbcl_dbc_get_ret(dbc, key, data, flags, replyp)
	DBC * dbc;
	DBT * key;
	DBT * data;
	u_int32_t flags;
	__dbc_get_reply *replyp;
{
	int ret;
	/* DBT key; */
	/* DBT data; */

	if (replyp->status != 0)
		return (replyp->status);
	/* Handle replyp->keydata; */
	/* Handle replyp->datadata; */

	/*
	 * XXX Code goes here
	 */

	return (replyp->status);
}

