/*****************************************************************/
/**                                                             **/
/**             (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           **/
/**                                                             **/
/*****************************************************************/

/* Any macros */

#define EncodeAny(interface, exp_type, any_var, exp)	\
do { Data (interface) inst;				\
     Bind_mem(inst, Asn_1, &(any_var), "w")		\
     AnyExceptions;					\
     Encode inst {					\
       (exp) => exp_type;				\
     }							\
     AnyExceptions					\
     Unbind(inst)					\
     AnyExceptions;					\
   } while (0)

#define DecodeAny(interface, var_type, var, any_var)	\
do { Data (interface) inst;				\
     Bind_mem(inst, Asn_1, &(any_var), "r")		\
     AnyExceptions;					\
     Decode inst {					\
       On var_type => (var);				\
     }							\
     AnyExceptions					\
     Unbind(inst)					\
     AnyExceptions;					\
   } while (0)

#define CopyAny(dest, source)						\
do { (dest).pointer = (unsigned char *) malloc((source).count);		\
     memcpy((dest).pointer, (source).pointer, (source).count);		\
     (dest).count = (dest).size = (source).count;			\
   } while (0)

#define ClearAny(any_var)			\
do { if ((any_var).pointer != NULL)		\
       free((any_var).pointer);			\
     (any_var).count = (any_var).size = 0;	\
   } while (0)

#define AnyExceptions

/* Translations for ELROS functions to library routines */
#define get_invokeID(I) __ROr_STDget_invokeID((I))
#define set_invokeID(I,V)	\
{ 	long __RO_temp;  	\
	__ROr_STDset_invokeID((I),(__RO_temp=(V),&__RO_temp)); }

#define get_addr(INST,ADDR)	\
	__ROr_STDget_address((INST),(ADDR))

#define init_addr(TYPE,ADDR)	\
	__ROr_STDinit_address((TYPE),(ADDR))

#define init_puresocket_addr(ADDR,ROLE,ASTRING)	\
	__ROr_init_puresocket_addr((ADDR),(ROLE),(ASTRING))

#define __ROc_type_information_ptr (&__ROc_type_information)

#define PASS_THRU(x)x

#ifdef sun
/* <stdio.h> macro needed for second pass through cpp on the Sun */
PASS_THRU(#define FILE struct _iobuf)
#endif

/*
	Mandatory include information for preprocessor-generated code
*/

#include <elros/instance.h>
#include <elros/sendP_element.h>
#include <elros/typecodes.h>
#include <elros/typecmps.h>
#include <elros/typecopies.h>
#include <elros/typeconsts.h>
#include <elros/typeforms.h>
#include <elros/functiondefs.h>
#include <elros/binds.h>

/* Make sure the epp-generated .h file is included next, on second pass */
PASS_THRU(#include "SOURCEFILE..h")

# line 1 "SOURCEFILE"

