/* Machine generated file -- Do NOT edit */

#include "butc.h"

#define TSK_STAT_FIRST 0x1 /* get id of first task */
#define TSK_STAT_END 0x2 /* no more tasks */
#define TSK_STAT_NOTFOUND 0x4 /* couldn't find task id requested */
#define TSK_STAT_XBSA 0x10 /* An XBSA server */
#define TSK_STAT_ADSM 0x20 /* An ADSM XBSA server */
int TC_PerformDump(register struct rx_connection *z_conn,struct tc_dumpInterface * tcdiPtr,tc_dumpArray * dumps,afs_int32 * dumpID)
{
	struct rx_call *z_call = rx_NewCall(z_conn);
	static int z_op = 0;
	int z_result;
	XDR z_xdrs;
	xdrrx_create(&z_xdrs, z_call, XDR_ENCODE);

	/* Marshal the arguments */
	if ((!xdr_int(&z_xdrs, &z_op))
	     || (!xdr_tc_dumpInterface(&z_xdrs, tcdiPtr))
	     || (!xdr_tc_dumpArray(&z_xdrs, dumps))) {
		z_result = RXGEN_CC_MARSHAL;
		goto fail;
	}

	/* Un-marshal the reply arguments */
	z_xdrs.x_op = XDR_DECODE;
	if ((!xdr_afs_int32(&z_xdrs, dumpID))) {
		z_result = RXGEN_CC_UNMARSHAL;
		goto fail;
	}

	z_result = RXGEN_SUCCESS;
fail:
	z_result = rx_EndCall(z_call, z_result);
	return z_result;
}

int TC_PerformRestore(register struct rx_connection *z_conn,char * dumpSetName,tc_restoreArray * restores,afs_int32 * dumpID)
{
	struct rx_call *z_call = rx_NewCall(z_conn);
	static int z_op = 1;
	int z_result;
	XDR z_xdrs;
	xdrrx_create(&z_xdrs, z_call, XDR_ENCODE);

	/* Marshal the arguments */
	if ((!xdr_int(&z_xdrs, &z_op))
	     || (!xdr_string(&z_xdrs, &dumpSetName, TC_MAXNAMELEN))
	     || (!xdr_tc_restoreArray(&z_xdrs, restores))) {
		z_result = RXGEN_CC_MARSHAL;
		goto fail;
	}

	/* Un-marshal the reply arguments */
	z_xdrs.x_op = XDR_DECODE;
	if ((!xdr_afs_int32(&z_xdrs, dumpID))) {
		z_result = RXGEN_CC_UNMARSHAL;
		goto fail;
	}

	z_result = RXGEN_SUCCESS;
fail:
	z_result = rx_EndCall(z_call, z_result);
	return z_result;
}

int TC_LabelTape(register struct rx_connection *z_conn,struct tc_tapeLabel * label,afs_uint32 * taskId)
{
	struct rx_call *z_call = rx_NewCall(z_conn);
	static int z_op = 2;
	int z_result;
	XDR z_xdrs;
	xdrrx_create(&z_xdrs, z_call, XDR_ENCODE);

	/* Marshal the arguments */
	if ((!xdr_int(&z_xdrs, &z_op))
	     || (!xdr_tc_tapeLabel(&z_xdrs, label))) {
		z_result = RXGEN_CC_MARSHAL;
		goto fail;
	}

	/* Un-marshal the reply arguments */
	z_xdrs.x_op = XDR_DECODE;
	if ((!xdr_afs_uint32(&z_xdrs, taskId))) {
		z_result = RXGEN_CC_UNMARSHAL;
		goto fail;
	}

	z_result = RXGEN_SUCCESS;
fail:
	z_result = rx_EndCall(z_call, z_result);
	return z_result;
}

int TC_ReadLabel(register struct rx_connection *z_conn,struct tc_tapeLabel * label,afs_uint32 * taskId)
{
	struct rx_call *z_call = rx_NewCall(z_conn);
	static int z_op = 3;
	int z_result;
	XDR z_xdrs;
	xdrrx_create(&z_xdrs, z_call, XDR_ENCODE);

	/* Marshal the arguments */
	if ((!xdr_int(&z_xdrs, &z_op))) {
		z_result = RXGEN_CC_MARSHAL;
		goto fail;
	}

	/* Un-marshal the reply arguments */
	z_xdrs.x_op = XDR_DECODE;
	if ((!xdr_tc_tapeLabel(&z_xdrs, label))
	     || (!xdr_afs_uint32(&z_xdrs, taskId))) {
		z_result = RXGEN_CC_UNMARSHAL;
		goto fail;
	}

	z_result = RXGEN_SUCCESS;
fail:
	z_result = rx_EndCall(z_call, z_result);
	return z_result;
}

int TC_ScanDumps(register struct rx_connection *z_conn,afs_int32 addDbFlag,afs_uint32 * taskId)
{
	struct rx_call *z_call = rx_NewCall(z_conn);
	static int z_op = 4;
	int z_result;
	XDR z_xdrs;
	xdrrx_create(&z_xdrs, z_call, XDR_ENCODE);

	/* Marshal the arguments */
	if ((!xdr_int(&z_xdrs, &z_op))
	     || (!xdr_afs_int32(&z_xdrs, &addDbFlag))) {
		z_result = RXGEN_CC_MARSHAL;
		goto fail;
	}

	/* Un-marshal the reply arguments */
	z_xdrs.x_op = XDR_DECODE;
	if ((!xdr_afs_uint32(&z_xdrs, taskId))) {
		z_result = RXGEN_CC_UNMARSHAL;
		goto fail;
	}

	z_result = RXGEN_SUCCESS;
fail:
	z_result = rx_EndCall(z_call, z_result);
	return z_result;
}

int TC_TCInfo(register struct rx_connection *z_conn,struct tc_tcInfo * tciptr)
{
	struct rx_call *z_call = rx_NewCall(z_conn);
	static int z_op = 5;
	int z_result;
	XDR z_xdrs;
	xdrrx_create(&z_xdrs, z_call, XDR_ENCODE);

	/* Marshal the arguments */
	if ((!xdr_int(&z_xdrs, &z_op))) {
		z_result = RXGEN_CC_MARSHAL;
		goto fail;
	}

	/* Un-marshal the reply arguments */
	z_xdrs.x_op = XDR_DECODE;
	if ((!xdr_tc_tcInfo(&z_xdrs, tciptr))) {
		z_result = RXGEN_CC_UNMARSHAL;
		goto fail;
	}

	z_result = RXGEN_SUCCESS;
fail:
	z_result = rx_EndCall(z_call, z_result);
	return z_result;
}

int TC_SaveDb(register struct rx_connection *z_conn,afs_uint32 archiveTime,afs_uint32 * taskId)
{
	struct rx_call *z_call = rx_NewCall(z_conn);
	static int z_op = 6;
	int z_result;
	XDR z_xdrs;
	xdrrx_create(&z_xdrs, z_call, XDR_ENCODE);

	/* Marshal the arguments */
	if ((!xdr_int(&z_xdrs, &z_op))
	     || (!xdr_afs_uint32(&z_xdrs, &archiveTime))) {
		z_result = RXGEN_CC_MARSHAL;
		goto fail;
	}

	/* Un-marshal the reply arguments */
	z_xdrs.x_op = XDR_DECODE;
	if ((!xdr_afs_uint32(&z_xdrs, taskId))) {
		z_result = RXGEN_CC_UNMARSHAL;
		goto fail;
	}

	z_result = RXGEN_SUCCESS;
fail:
	z_result = rx_EndCall(z_call, z_result);
	return z_result;
}

int TC_RestoreDb(register struct rx_connection *z_conn,afs_uint32 * taskId)
{
	struct rx_call *z_call = rx_NewCall(z_conn);
	static int z_op = 7;
	int z_result;
	XDR z_xdrs;
	xdrrx_create(&z_xdrs, z_call, XDR_ENCODE);

	/* Marshal the arguments */
	if ((!xdr_int(&z_xdrs, &z_op))) {
		z_result = RXGEN_CC_MARSHAL;
		goto fail;
	}

	/* Un-marshal the reply arguments */
	z_xdrs.x_op = XDR_DECODE;
	if ((!xdr_afs_uint32(&z_xdrs, taskId))) {
		z_result = RXGEN_CC_UNMARSHAL;
		goto fail;
	}

	z_result = RXGEN_SUCCESS;
fail:
	z_result = rx_EndCall(z_call, z_result);
	return z_result;
}

int TC_EndStatus(register struct rx_connection *z_conn,afs_uint32 taskId)
{
	struct rx_call *z_call = rx_NewCall(z_conn);
	static int z_op = 8;
	int z_result;
	XDR z_xdrs;
	xdrrx_create(&z_xdrs, z_call, XDR_ENCODE);

	/* Marshal the arguments */
	if ((!xdr_int(&z_xdrs, &z_op))
	     || (!xdr_afs_uint32(&z_xdrs, &taskId))) {
		z_result = RXGEN_CC_MARSHAL;
		goto fail;
	}

	z_result = RXGEN_SUCCESS;
fail:
	z_result = rx_EndCall(z_call, z_result);
	return z_result;
}

int TC_GetStatus(register struct rx_connection *z_conn,afs_uint32 taskId,struct tciStatusS * statusPtr)
{
	struct rx_call *z_call = rx_NewCall(z_conn);
	static int z_op = 9;
	int z_result;
	XDR z_xdrs;
	xdrrx_create(&z_xdrs, z_call, XDR_ENCODE);

	/* Marshal the arguments */
	if ((!xdr_int(&z_xdrs, &z_op))
	     || (!xdr_afs_uint32(&z_xdrs, &taskId))) {
		z_result = RXGEN_CC_MARSHAL;
		goto fail;
	}

	/* Un-marshal the reply arguments */
	z_xdrs.x_op = XDR_DECODE;
	if ((!xdr_tciStatusS(&z_xdrs, statusPtr))) {
		z_result = RXGEN_CC_UNMARSHAL;
		goto fail;
	}

	z_result = RXGEN_SUCCESS;
fail:
	z_result = rx_EndCall(z_call, z_result);
	return z_result;
}

int TC_RequestAbort(register struct rx_connection *z_conn,afs_uint32 taskId)
{
	struct rx_call *z_call = rx_NewCall(z_conn);
	static int z_op = 10;
	int z_result;
	XDR z_xdrs;
	xdrrx_create(&z_xdrs, z_call, XDR_ENCODE);

	/* Marshal the arguments */
	if ((!xdr_int(&z_xdrs, &z_op))
	     || (!xdr_afs_uint32(&z_xdrs, &taskId))) {
		z_result = RXGEN_CC_MARSHAL;
		goto fail;
	}

	z_result = RXGEN_SUCCESS;
fail:
	z_result = rx_EndCall(z_call, z_result);
	return z_result;
}

int TC_ScanStatus(register struct rx_connection *z_conn,afs_uint32 * taskId,struct tciStatusS * statusPtr,afs_uint32 * flags)
{
	struct rx_call *z_call = rx_NewCall(z_conn);
	static int z_op = 11;
	int z_result;
	XDR z_xdrs;
	xdrrx_create(&z_xdrs, z_call, XDR_ENCODE);

	/* Marshal the arguments */
	if ((!xdr_int(&z_xdrs, &z_op))
	     || (!xdr_afs_uint32(&z_xdrs, taskId))
	     || (!xdr_afs_uint32(&z_xdrs, flags))) {
		z_result = RXGEN_CC_MARSHAL;
		goto fail;
	}

	/* Un-marshal the reply arguments */
	z_xdrs.x_op = XDR_DECODE;
	if ((!xdr_afs_uint32(&z_xdrs, taskId))
	     || (!xdr_tciStatusS(&z_xdrs, statusPtr))
	     || (!xdr_afs_uint32(&z_xdrs, flags))) {
		z_result = RXGEN_CC_UNMARSHAL;
		goto fail;
	}

	z_result = RXGEN_SUCCESS;
fail:
	z_result = rx_EndCall(z_call, z_result);
	return z_result;
}

int TC_DeleteDump(register struct rx_connection *z_conn,afs_uint32 aDumpId,afs_uint32 * taskId)
{
	struct rx_call *z_call = rx_NewCall(z_conn);
	static int z_op = 12;
	int z_result;
	XDR z_xdrs;
	xdrrx_create(&z_xdrs, z_call, XDR_ENCODE);

	/* Marshal the arguments */
	if ((!xdr_int(&z_xdrs, &z_op))
	     || (!xdr_afs_uint32(&z_xdrs, &aDumpId))) {
		z_result = RXGEN_CC_MARSHAL;
		goto fail;
	}

	/* Un-marshal the reply arguments */
	z_xdrs.x_op = XDR_DECODE;
	if ((!xdr_afs_uint32(&z_xdrs, taskId))) {
		z_result = RXGEN_CC_UNMARSHAL;
		goto fail;
	}

	z_result = RXGEN_SUCCESS;
fail:
	z_result = rx_EndCall(z_call, z_result);
	return z_result;
}

