/*****************************************************************/
/**                                                             **/
/**             (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_form_bool[] = "@(#)form_bool.c	1.10 11/13/92 10:32:55  LLNL ";

/*
	Embedded Language for Remote Operations Services
	ELROS

	AUTHOR:		James A. Guse
			Network Systems Division

	DATE WRITTEN:	11/6/90

	ROUTINE:	__ROr_format_Boolean


PURPOSE:
	This routine converts a Boolean value into printable format

IN:
	value - value to print
	valuelength - length in bytes of value variable
	type_info - parameters vector for lengths of this type

OUT:
RETURNS malloc'ed character string

CALLED ROUTINES:

	
MODIFICATION HISTORY:


*/

#include <elros/exceptions.h>

#include <malloc.h>
#include <memory.h>

char *__ROr_format_Boolean(value,valuelength,maxlength,maxlength2)

	void *value;
	unsigned long valuelength;
	unsigned long maxlength;
	unsigned long maxlength2;

{
   unsigned char *byteptr = (unsigned char *)value;
   char *buffer;
   int i;

   for (i=0; i<maxlength; i++)
      if (*byteptr++)
      {
         buffer = malloc(5);
         memcpy(buffer,"True",5);
         return(buffer);
      }

   buffer = malloc(6);
   memcpy(buffer,"False",6);
   return(buffer);
}


