/* (C) Copyright International Business Machines Corporation 23 January */
/* 1990.  All Rights Reserved. */
/*  */
/* See the file USERAGREEMENT distributed with this software for full */
/* terms and conditions of use. */
/* File: porting.c */
/* Author: David F. Bacon */
#ifndef lint
static char sccsinfo[] = "@(#)porting.c	1.3 3/13/90";
#endif

/* routines to support portability of the interpreter */

#include "sysdep.h"

#ifndef HAVE_VXPRINTF

#include <stdio.h>
#include <varargs.h>

char *
vsprintf(s, format, ap)
char *s;
char *format;
va_list ap;
{
    FILE fakefile;


    fakefile._cnt = 4096;
    fakefile._flag = _IOSTRG|_IOWRT;
    fakefile._ptr = s;

    _doprnt(format, ap, &fakefile);
    putc('\0', &fakefile);

    return(s);
}


#endif

#ifndef HAVE_XDRFREE

#include <rpc/rpc.h>

void
xdr_free(proc, objp)
xdrproc_t proc;
char *objp;
{
    XDR xdrs;

         
    xdrs.x_op = XDR_FREE;
    (*proc)(&xdrs, objp);
}

#endif
