/*
 * Please do not edit this file. 
 * It was generated using rpcgen.  
 */

#include "ecs.h"
#include <ogdi_macro.h>

bool_t
xdr_ecs_Family(register XDR *xdrs, ecs_Family *objp)
{

//	register long *buf;

	if (!xdr_enum(xdrs, (enum_t *)objp))
		return (FALSE);
	return (TRUE);
}

bool_t
xdr_ecs_Region(register XDR *xdrs, ecs_Region *objp)
{

//	register long *buf;

	if (!xdr_double(xdrs, &objp->north))
		return (FALSE);
	if (!xdr_double(xdrs, &objp->south))
		return (FALSE);
	if (!xdr_double(xdrs, &objp->east))
		return (FALSE);
	if (!xdr_double(xdrs, &objp->west))
		return (FALSE);
	if (!xdr_double(xdrs, &objp->ns_res))
		return (FALSE);
	if (!xdr_double(xdrs, &objp->ew_res))
		return (FALSE);
	return (TRUE);
}

bool_t
xdr_ecs_Resampling(register XDR *xdrs, ecs_Resampling *objp)
{

//        register long *buf;

	if (!xdr_enum(xdrs, (enum_t *)objp))
		return (FALSE);
	return (TRUE);
}

bool_t
xdr_ecs_Transformation(register XDR *xdrs, ecs_Transformation *objp)
{

//	register long *buf;

	if (!xdr_enum(xdrs, (enum_t *)objp))
		return (FALSE);
	return (TRUE);
}

bool_t
xdr_ecs_RasterConversion(register XDR *xdrs, ecs_RasterConversion *objp)
{

//	register long *buf;

	if (!xdr_array(xdrs, (char **)&objp->coef.coef_val, (u_int *) &objp->coef.coef_len, ~0,
		sizeof (double), (xdrproc_t) xdr_double))
		return (FALSE);
	if (!xdr_ecs_Resampling(xdrs, &objp->r_method))
		return (FALSE);
	if (!xdr_ecs_Transformation(xdrs, &objp->t_method))
		return (FALSE);
	return (TRUE);
}

bool_t
xdr_ecs_Coordinate(register XDR *xdrs, ecs_Coordinate *objp)
{

//	register long *buf;

	if (!xdr_double(xdrs, &objp->x))
		return (FALSE);
	if (!xdr_double(xdrs, &objp->y))
		return (FALSE);
	return (TRUE);
}

bool_t
xdr_ecs_FeatureRing(register XDR *xdrs, ecs_FeatureRing *objp)
{

//	register long *buf;

	if (!xdr_ecs_Coordinate(xdrs, &objp->centroid))
		return (FALSE);
	if (!xdr_array(xdrs, (char **)&objp->c.c_val, (u_int *) &objp->c.c_len, ~0,
		sizeof (ecs_Coordinate), (xdrproc_t) xdr_ecs_Coordinate))
		return (FALSE);
	return (TRUE);
}

bool_t
xdr_ecs_Area(register XDR *xdrs, ecs_Area *objp)
{

//	register long *buf;

	if (!xdr_array(xdrs, (char **)&objp->ring.ring_val, (u_int *) &objp->ring.ring_len, ~0,
		sizeof (ecs_FeatureRing), (xdrproc_t) xdr_ecs_FeatureRing))
		return (FALSE);
	return (TRUE);
}

bool_t
xdr_ecs_Line(register XDR *xdrs, ecs_Line *objp)
{

//	register long *buf;

	if (!xdr_array(xdrs, (char **)&objp->c.c_val, (u_int *) &objp->c.c_len, ~0,
		sizeof (ecs_Coordinate), (xdrproc_t) xdr_ecs_Coordinate))
		return (FALSE);
	return (TRUE);
}

bool_t
xdr_ecs_Point(register XDR *xdrs, ecs_Point *objp)
{

//	register long *buf;

	if (!xdr_ecs_Coordinate(xdrs, &objp->c))
		return (FALSE);
	return (TRUE);
}

bool_t
xdr_ecs_Matrix(register XDR *xdrs, ecs_Matrix *objp)
{

//	register long *buf;

	if (!xdr_array(xdrs, (char **)&objp->x.x_val, (u_int *) &objp->x.x_len, ~0,
		sizeof (u_int), (xdrproc_t) xdr_u_int))
		return (FALSE);
	return (TRUE);
}

bool_t
xdr_ecs_Image(register XDR *xdrs, ecs_Image *objp)
{

//	register long *buf;

	if (!xdr_array(xdrs, (char **)&objp->x.x_val, (u_int *) &objp->x.x_len, ~0,
		sizeof (u_int), (xdrproc_t) xdr_u_int))
		return (FALSE);
	return (TRUE);
}

bool_t
xdr_ecs_Text(register XDR *xdrs, ecs_Text *objp)
{

//	register long *buf;

	if (!xdr_string(xdrs, &objp->desc, ~0))
		return (FALSE);
	if (!xdr_ecs_Coordinate(xdrs, &objp->c))
		return (FALSE);
	return (TRUE);
}

bool_t
xdr_ecs_Node(register XDR *xdrs, ecs_Node *objp)
{

//	register long *buf;

	if (!xdr_int(xdrs, &objp->id))
		return (FALSE);
	if (!xdr_int(xdrs, &objp->containfaceid))
		return (FALSE);
	if (!xdr_ecs_Coordinate(xdrs, &objp->c))
		return (FALSE);
	return (TRUE);
}

bool_t
xdr_ecs_Edge(register XDR *xdrs, ecs_Edge *objp)
{

	register int *buf;

	if (xdrs->x_op == XDR_ENCODE) {
		buf = XDR_INLINE(xdrs, 7 * BYTES_PER_XDR_UNIT);
		if (buf == NULL) {
			if (!xdr_int(xdrs, &objp->id))
				return (FALSE);
			if (!xdr_int(xdrs, &objp->startnodeid))
				return (FALSE);
			if (!xdr_int(xdrs, &objp->endnodeid))
				return (FALSE);
			if (!xdr_int(xdrs, &objp->rightfaceid))
				return (FALSE);
			if (!xdr_int(xdrs, &objp->leftfaceid))
				return (FALSE);
			if (!xdr_int(xdrs, &objp->rightfedgeid))
				return (FALSE);
			if (!xdr_int(xdrs, &objp->leftfedgeid))
				return (FALSE);

		} else {
			ogdi_IXDR_PUT_LONG(buf, objp->id);
			ogdi_IXDR_PUT_LONG(buf, objp->startnodeid);
			ogdi_IXDR_PUT_LONG(buf, objp->endnodeid);
			ogdi_IXDR_PUT_LONG(buf, objp->rightfaceid);
			ogdi_IXDR_PUT_LONG(buf, objp->leftfaceid);
			ogdi_IXDR_PUT_LONG(buf, objp->rightfedgeid);
			ogdi_IXDR_PUT_LONG(buf, objp->leftfedgeid);
		}
		if (!xdr_array(xdrs, (char **)&objp->c.c_val, (u_int *) &objp->c.c_len, ~0,
			sizeof (ecs_Coordinate), (xdrproc_t) xdr_ecs_Coordinate))
			return (FALSE);
		return (TRUE);
	} else if (xdrs->x_op == XDR_DECODE) {
		buf = XDR_INLINE(xdrs, 7 * BYTES_PER_XDR_UNIT);
		if (buf == NULL) {
			if (!xdr_int(xdrs, &objp->id))
				return (FALSE);
			if (!xdr_int(xdrs, &objp->startnodeid))
				return (FALSE);
			if (!xdr_int(xdrs, &objp->endnodeid))
				return (FALSE);
			if (!xdr_int(xdrs, &objp->rightfaceid))
				return (FALSE);
			if (!xdr_int(xdrs, &objp->leftfaceid))
				return (FALSE);
			if (!xdr_int(xdrs, &objp->rightfedgeid))
				return (FALSE);
			if (!xdr_int(xdrs, &objp->leftfedgeid))
				return (FALSE);

		} else {
			objp->id = IXDR_GET_LONG(buf);
			objp->startnodeid = IXDR_GET_LONG(buf);
			objp->endnodeid = IXDR_GET_LONG(buf);
			objp->rightfaceid = IXDR_GET_LONG(buf);
			objp->leftfaceid = IXDR_GET_LONG(buf);
			objp->rightfedgeid = IXDR_GET_LONG(buf);
			objp->leftfedgeid = IXDR_GET_LONG(buf);
		}
		if (!xdr_array(xdrs, (char **)&objp->c.c_val, (u_int *) &objp->c.c_len, ~0,
			sizeof (ecs_Coordinate), (xdrproc_t) xdr_ecs_Coordinate))
			return (FALSE);
		return (TRUE);
	}

	if (!xdr_int(xdrs, &objp->id))
		return (FALSE);
	if (!xdr_int(xdrs, &objp->startnodeid))
		return (FALSE);
	if (!xdr_int(xdrs, &objp->endnodeid))
		return (FALSE);
	if (!xdr_int(xdrs, &objp->rightfaceid))
		return (FALSE);
	if (!xdr_int(xdrs, &objp->leftfaceid))
		return (FALSE);
	if (!xdr_int(xdrs, &objp->rightfedgeid))
		return (FALSE);
	if (!xdr_int(xdrs, &objp->leftfedgeid))
		return (FALSE);
	if (!xdr_array(xdrs, (char **)&objp->c.c_val, (u_int *) &objp->c.c_len, ~0,
		sizeof (ecs_Coordinate), (xdrproc_t) xdr_ecs_Coordinate))
		return (FALSE);
	return (TRUE);
}

bool_t
xdr_ecs_TopoLevel(register XDR *xdrs, ecs_TopoLevel *objp)
{

//	register long *buf;

	if (!xdr_enum(xdrs, (enum_t *)objp))
		return (FALSE);
	return (TRUE);
}

bool_t
xdr_ecs_Face(register XDR *xdrs, ecs_Face *objp)
{

//	register long *buf;

	if (!xdr_int(xdrs, &objp->id))
		return (FALSE);
	if (!xdr_array(xdrs, (char **)&objp->edgeid.edgeid_val, (u_int *) &objp->edgeid.edgeid_len, ~0,
		sizeof (int), (xdrproc_t) xdr_int))
		return (FALSE);
	return (TRUE);
}

bool_t
xdr_ecs_AreaPrim(register XDR *xdrs, ecs_AreaPrim *objp)
{

//	register long *buf;

	if (!xdr_ecs_TopoLevel(xdrs, &objp->level))
		return (FALSE);
	switch (objp->level) {
	case Level012:
		if (!xdr_array(xdrs, (char **)&objp->ecs_AreaPrim_u.edgeid.edgeid_val, (u_int *) &objp->ecs_AreaPrim_u.edgeid.edgeid_len, ~0,
			sizeof (int), (xdrproc_t) xdr_int))
			return (FALSE);
		break;
	case Level3:
		if (!xdr_array(xdrs, (char **)&objp->ecs_AreaPrim_u.fedgeid.fedgeid_val, (u_int *) &objp->ecs_AreaPrim_u.fedgeid.fedgeid_len, ~0,
			sizeof (ecs_Face), (xdrproc_t) xdr_ecs_Face))
			return (FALSE);
		break;
	}
	return (TRUE);
}

bool_t
xdr_ecs_Geometry(register XDR *xdrs, ecs_Geometry *objp)
{

//	register long *buf;

	if (!xdr_ecs_Family(xdrs, &objp->family))
		return (FALSE);
	switch (objp->family) {
	case Area:
		if (!xdr_ecs_Area(xdrs, &objp->ecs_Geometry_u.area))
			return (FALSE);
		break;
	case Line:
		if (!xdr_ecs_Line(xdrs, &objp->ecs_Geometry_u.line))
			return (FALSE);
		break;
	case Point:
		if (!xdr_ecs_Point(xdrs, &objp->ecs_Geometry_u.point))
			return (FALSE);
		break;
	case Matrix:
		if (!xdr_ecs_Matrix(xdrs, &objp->ecs_Geometry_u.matrix))
			return (FALSE);
		break;
	case Image:
		if (!xdr_ecs_Image(xdrs, &objp->ecs_Geometry_u.image))
			return (FALSE);
		break;
	case Text:
		if (!xdr_ecs_Text(xdrs, &objp->ecs_Geometry_u.text))
			return (FALSE);
		break;
	case Node:
		if (!xdr_ecs_Node(xdrs, &objp->ecs_Geometry_u.node))
			return (FALSE);
		break;
	case Edge:
		if (!xdr_ecs_Edge(xdrs, &objp->ecs_Geometry_u.edge))
			return (FALSE);
		break;
	case Ring:
		if (!xdr_ecs_AreaPrim(xdrs, &objp->ecs_Geometry_u.ring))
			return (FALSE);
		break;
	case Face:
		break;
	}
	return (TRUE);
}

bool_t
xdr_ecs_Object(register XDR *xdrs, ecs_Object *objp)
{

//	register long *buf;

	if (!xdr_string(xdrs, &objp->Id, ~0))
		return (FALSE);
	if (!xdr_ecs_Geometry(xdrs, &objp->geom))
		return (FALSE);
	if (!xdr_string(xdrs, &objp->attr, ~0))
		return (FALSE);
	if (!xdr_double(xdrs, &objp->xmin))
		return (FALSE);
	if (!xdr_double(xdrs, &objp->ymin))
		return (FALSE);
	if (!xdr_double(xdrs, &objp->xmax))
		return (FALSE);
	if (!xdr_double(xdrs, &objp->ymax))
		return (FALSE);
	return (TRUE);
}

bool_t
xdr_ecs_AttributeFormat(register XDR *xdrs, ecs_AttributeFormat *objp)
{

//	register long *buf;

	if (!xdr_enum(xdrs, (enum_t *)objp))
		return (FALSE);
	return (TRUE);
}

bool_t
xdr_ecs_ObjAttribute(register XDR *xdrs, ecs_ObjAttribute *objp)
{

//	register long *buf;

	if (!xdr_string(xdrs, &objp->name, ~0))
		return (FALSE);
	if (!xdr_ecs_AttributeFormat(xdrs, &objp->type))
		return (FALSE);
	if (!xdr_int(xdrs, &objp->lenght))
		return (FALSE);
	if (!xdr_int(xdrs, &objp->precision))
		return (FALSE);
	if (!xdr_int(xdrs, &objp->nullable))
		return (FALSE);
	return (TRUE);
}

bool_t
xdr_ecs_ObjAttributeFormat(register XDR *xdrs, ecs_ObjAttributeFormat *objp)
{

//	register long *buf;

	if (!xdr_array(xdrs, (char **)&objp->oa.oa_val, (u_int *) &objp->oa.oa_len, ~0,
		sizeof (ecs_ObjAttribute), (xdrproc_t) xdr_ecs_ObjAttribute))
		return (FALSE);
	return (TRUE);
}

bool_t
xdr_ecs_Category(register XDR *xdrs, ecs_Category *objp)
{

//	register long *buf;

	if (!xdr_long(xdrs, &objp->no_cat))
		return (FALSE);
	if (!xdr_u_int(xdrs, &objp->r))
		return (FALSE);
	if (!xdr_u_int(xdrs, &objp->g))
		return (FALSE);
	if (!xdr_u_int(xdrs, &objp->b))
		return (FALSE);
	if (!xdr_string(xdrs, &objp->label, ~0))
		return (FALSE);
	if (!xdr_u_long(xdrs, &objp->qty))
		return (FALSE);
	return (TRUE);
}

bool_t
xdr_ecs_RasterInfo(register XDR *xdrs, ecs_RasterInfo *objp)
{

//	register long *buf;

	if (!xdr_long(xdrs, &objp->mincat))
		return (FALSE);
	if (!xdr_long(xdrs, &objp->maxcat))
		return (FALSE);
	if (!xdr_int(xdrs, &objp->width))
		return (FALSE);
	if (!xdr_int(xdrs, &objp->height))
		return (FALSE);
	if (!xdr_array(xdrs, (char **)&objp->cat.cat_val, (u_int *) &objp->cat.cat_len, ~0,
		sizeof (ecs_Category), (xdrproc_t) xdr_ecs_Category))
		return (FALSE);
	return (TRUE);
}

bool_t
xdr_ecs_Compression(register XDR *xdrs, ecs_Compression *objp)
{

	register int *buf;

	if (xdrs->x_op == XDR_ENCODE) {
		buf = XDR_INLINE(xdrs, 6 * BYTES_PER_XDR_UNIT);
		if (buf == NULL) {
			if (!xdr_u_int(xdrs, &objp->cachesize))
				return (FALSE);
			if (!xdr_u_int(xdrs, &objp->ctype))
				return (FALSE);
			if (!xdr_u_int(xdrs, &objp->cversion))
				return (FALSE);
			if (!xdr_u_int(xdrs, &objp->clevel))
				return (FALSE);
			if (!xdr_u_int(xdrs, &objp->cblksize))
				return (FALSE);
			if (!xdr_u_int(xdrs, &objp->cfullsize))
				return (FALSE);
		} else {
			ogdi_IXDR_PUT_U_LONG(buf, objp->cachesize);
			ogdi_IXDR_PUT_U_LONG(buf, objp->ctype);
			ogdi_IXDR_PUT_U_LONG(buf, objp->cversion);
			ogdi_IXDR_PUT_U_LONG(buf, objp->clevel);
			ogdi_IXDR_PUT_U_LONG(buf, objp->cblksize);
			ogdi_IXDR_PUT_U_LONG(buf, objp->cfullsize);
		}
		return (TRUE);
	} else if (xdrs->x_op == XDR_DECODE) {
		buf = XDR_INLINE(xdrs, 6 * BYTES_PER_XDR_UNIT);
		if (buf == NULL) {
			if (!xdr_u_int(xdrs, &objp->cachesize))
				return (FALSE);
			if (!xdr_u_int(xdrs, &objp->ctype))
				return (FALSE);
			if (!xdr_u_int(xdrs, &objp->cversion))
				return (FALSE);
			if (!xdr_u_int(xdrs, &objp->clevel))
				return (FALSE);
			if (!xdr_u_int(xdrs, &objp->cblksize))
				return (FALSE);
			if (!xdr_u_int(xdrs, &objp->cfullsize))
				return (FALSE);
		} else {
			objp->cachesize = IXDR_GET_U_LONG(buf);
			objp->ctype = IXDR_GET_U_LONG(buf);
			objp->cversion = IXDR_GET_U_LONG(buf);
			objp->clevel = IXDR_GET_U_LONG(buf);
			objp->cblksize = IXDR_GET_U_LONG(buf);
			objp->cfullsize = IXDR_GET_U_LONG(buf);
		}
		return (TRUE);
	}

	if (!xdr_u_int(xdrs, &objp->cachesize))
		return (FALSE);
	if (!xdr_u_int(xdrs, &objp->ctype))
		return (FALSE);
	if (!xdr_u_int(xdrs, &objp->cversion))
		return (FALSE);
	if (!xdr_u_int(xdrs, &objp->clevel))
		return (FALSE);
	if (!xdr_u_int(xdrs, &objp->cblksize))
		return (FALSE);
	if (!xdr_u_int(xdrs, &objp->cfullsize))
		return (FALSE);
	return (TRUE);
}

bool_t
xdr_ecs_ResultType(register XDR *xdrs, ecs_ResultType *objp)
{

//	register long *buf;

	if (!xdr_enum(xdrs, (enum_t *)objp))
		return (FALSE);
	return (TRUE);
}

bool_t
xdr_ecs_ResultUnion(register XDR *xdrs, ecs_ResultUnion *objp)
{

//	register long *buf;

	if (!xdr_ecs_ResultType(xdrs, &objp->type))
		return (FALSE);
	switch (objp->type) {
	case Object:
		if (!xdr_ecs_Object(xdrs, &objp->ecs_ResultUnion_u.dob))
			return (FALSE);
		break;
	case GeoRegion:
		if (!xdr_ecs_Region(xdrs, &objp->ecs_ResultUnion_u.gr))
			return (FALSE);
		break;
	case objAttributeFormat:
		if (!xdr_ecs_ObjAttributeFormat(xdrs, &objp->ecs_ResultUnion_u.oaf))
			return (FALSE);
		break;
	case RasterInfo:
		if (!xdr_ecs_RasterInfo(xdrs, &objp->ecs_ResultUnion_u.ri))
			return (FALSE);
		break;
	case AText:
		if (!xdr_string(xdrs, &objp->ecs_ResultUnion_u.s, ~0))
			return (FALSE);
		break;
	case MultiResult:
		if (!xdr_array(xdrs, (char **)&objp->ecs_ResultUnion_u.results.results_val, (u_int *) &objp->ecs_ResultUnion_u.results.results_len, ~0,
			sizeof (ecs_ResultUnion), (xdrproc_t) xdr_ecs_ResultUnion))
			return (FALSE);
		break;
	case SimpleError:
		break;
	}
	return (TRUE);
}

bool_t
xdr_ecs_Result_Work(register XDR *xdrs, ecs_Result *objp)
{

//	register long *buf;

	if (!xdr_int(xdrs, &objp->error))
		return (FALSE);
	if (!xdr_string(xdrs, &objp->message, ~0))
		return (FALSE);
	if (!xdr_ecs_ResultUnion(xdrs, &objp->res))
		return (FALSE);
	return (TRUE);
}

bool_t
xdr_ecs_LayerSelection(register XDR *xdrs, ecs_LayerSelection *objp)
{

//	register long *buf;

	if (!xdr_string(xdrs, &objp->Select, ~0))
		return (FALSE);
	if (!xdr_ecs_Family(xdrs, &objp->F))
		return (FALSE);
	return (TRUE);
}

bool_t
xdr_ecs_ProxyCreateServer(register XDR *xdrs, ecs_ProxyCreateServer *objp)
{

//	register long *buf;

	if (!xdr_string(xdrs, &objp->server_name, ~0))
		return (FALSE);
	if (!xdr_string(xdrs, &objp->server_url, ~0))
		return (FALSE);
	return (TRUE);
}
