/*****************************************************************/
/**                                                             **/
/**             (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_STUBsock_c[] = "@(#)STUBsock.c	1.4 10/19/92 13:32:10  LLNL ";


/*
	Embedded Language for Remote Operations Services
	ELROS

	AUTHOR:		James A. Guse
			Network Systems Division

	DATE WRITTEN:	7/24/90

	ROUTINES:	__ROr_read
			__ROr_write
			__ROr_shutdown

PURPOSE:


IN:

OUT:


CALLED ROUTINES:
	

	
MODIFICATION HISTORY:


*/
#ifdef __RO_PLATFORM_PURESOCKETS

#include <stdio.h>

int __ROr_write(d, buf, nbytes)

   int d;
   char *buf;
   int nbytes;

{

   int i;

   for (i=0; i<nbytes; i++)
   {
      fprintf((FILE *)d,"%2.2x\n",(int)(unsigned char)buf[i]);
   }
   fprintf((FILE *)d,"\n");
   return nbytes;
}


int __ROr_read(d, buf, nbytes)

   int d;
   char *buf;
   int nbytes;

{
   int byte;

   if(fscanf((FILE *)d,"%x",&byte) == 1)
   {
      *buf = byte;
      return 1;
   }
   else if (feof((FILE*)d))
   {
      return 0;
   }
   else
   {
      return -1;
   }

}

int __ROr_shutdown(s,how)

   int s,how;

{
   return(fclose((FILE *)s));
}

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

