/*****************************************************************/
/**                                                             **/
/**             (C) Copyright 1992 the Regents of the           **/
/**        University of California.  All Rights Reserved.      **/
/**                                                             **/
/**        This work was produced under the sponsorship of      **/
/**         the U.S. Department of Energy.  The Government      **/
/**                retains certain rights therein.              **/
/**                                                             **/
/**                         Written by                          **/
/**         Distributed Programming Environments Project        **/
/**           Computer Software and Networking Division,        **/
/**                   Livermore Computer Center,                **/
/**            Lawrence Livermore National Laboratory           **/
/**                                                             **/
/*****************************************************************/

static char sccsid_STUBisode_c[] = "@(#)STUBisode.c	1.4 10/19/92 13:32:06  LLNL ";


/*
	Embedded Language for Remote Operations Services
	ELROS

	AUTHOR:		James A. Guse
			Network Systems Division

	DATE WRITTEN:	7/24/90

	ROUTINES:	SReadRequest
			SDataRequest

PURPOSE:


IN:

OUT:


CALLED ROUTINES:
	

	
MODIFICATION HISTORY:


*/
#ifdef __RO_PLATFORM_ISODE

#include <stdio.h>
#include <isode/ssap.h>

int SWriteRequest(sd,typed,uv,si)

   int sd;
   int typed;
   struct udvec *uv;
   struct SSAPindication *si;

{
   int i,j;

   for (i=0; uv[i].uv_base; i++)
   {
      for (j=0; j<uv[i].uv_len; j++)
         fprintf((FILE *)sd,"%2.2x\n",(int)(unsigned char)(uv[i].uv_base[j]));
   }
   fprintf((FILE *)sd,"\n");
   return OK;
}


int SReadRequest(sd,sx,secs,si)

   int sd;
   struct SSAPdata *sx;
   int secs;
   struct SSAPindication *si;

{
   int byte;

   sx->sx_type = SX_NORMAL;
   sx->sx_cc = 1;
   sx->sx_qbuf.qb_forw = &(sx->sx_qbuf);
   sx->sx_qbuf.qb_back = &(sx->sx_qbuf);
   sx->sx_qbuf.qb_len = 1;
   sx->sx_qbuf.qb_data = sx->sx_qbuf.qb_base;
   if(fscanf((FILE *)sd,"%x",&byte) == 1)
   {
      sx->sx_qbuf.qb_base[0] = (unsigned char)byte;
      return OK;
   }
   else if (feof((FILE*)sd))
   {
      si->si_type = SI_FINISH;
      return DONE;
   }
   else
   {
      si->si_type = SI_ABORT;
      si->si_abort.sa_reason = SC_BASE-1;
      return NOTOK;
   }

}

int PUAbortRequest(sd,data,cc,pi)

   int sd;
   char *data;
   int cc;
   struct PSAPindication *pi;

{
   return(OK);
}

#else
	int __ROc_STUBisode = 0; /* something so the file isn't empty */
#endif

