#include <stdio.h>
#include <rpc/rpc.h>
#include "xdrs.h"


extern XDR_element xdrfile[MAX_NUM_XDR_FILES];

#ifdef cray
     XDR_CLOSE (int *ixdrid)
#else
void xdr_close_(int *ixdrid)
#endif
{
    XDR 	*xdrs;
    FILE	*f;

    xdrs = xdrfile[*ixdrid].xdrs;

/* Get file pointer, saved in user's data area, 
 * to close file after destroying the XDR handle
 */
    f = (FILE *)xdrs->x_public;

    xdr_destroy(xdrs);

    fclose(f);

    xdrfile[*ixdrid].filename = NULL;
}
