{	Include file for RPC Stubs:	TYPE DECLARATIONS	RPC$TYPES
	==========================	=================

	 9 Oct 86	Courier_xxx made same for all systems!
	21 Oct 86	$w-: Warnings supressed for PACKED 0..255.
	23 Oct 86	m_Index, m_socket, m_status introduced into message
			header, and header used for CERNCROSS too.
	31 Oct 86	rpc_integer introduced
	10 Dec 86	add M6809 and MAC options
	16 Dec 86	rpc_status as long. rest_of_message removed.
			rpc_ch introduced as extra case for rpc_message.
	26 Jan 87	m_next added as a link in an rpc_message list.
	 2 Feb 87	Message header uses rpc_long instead of integer	(TJA)
	12 Feb 87	rpc_message size is f(MAXLENGTH), not 1499.	(TBL)
	20 Feb 87	rpc_message.b made PACKED only for CERNCROSS (to
			allow it to be passed to $QIOW)			(TJA)
	17 Mar 87	M6809: message.rpc_tsdata and rpc_var_name added(TJA)
	 8 Jul 87	rpc_byte_buffer type identifier used		(TBL)
			(Needed for strict pascal for TSCATS)
	16 Nov 87	rpc_ethernet_addr type introduced		(TBL)
	29 Mar 88	socket_descriptor type for TP4 added		(PL)
	27 Apr 88	TP4 becomes PCTURBO				(TBL)
	 8 Jun 88	Extra includes for PCTURBO removed -> rpctp4.	(TBL)
	 8 Jun 88	rpc_pointer introduced.				(RB)
	16 Aug 88	MACTURBO option added.				(RB)
}

*IF DEF VAXVMS
*IF DEF TS 1
	socket_type =	^socket_descriptor;
*IF -DEF TS 1
	socket_type =	^integer; { Painful implementation of private type }
*ENDIF

*IF -DEF VAXVMS
*IF DEF TS 1
	socket_type =	^socket_descriptor;
*IF -DEF TS 1
	socket_type =	integer; { Painful implementation of private type }
*ENDIF

	rpc_char=	char;

*IF DEF M6809
	rpc_byte =	byte;
	rpc_short=	integer;
	rpc_long=	longinteger;
*ENDIF
*IF DEF PCTURBO
	rpc_byte =	byte;
	rpc_short=	integer;
	rpc_long =	longint;
*ENDIF
*IF DEF MACTURBO
	rpc_byte =	0..255;
	rpc_short=	integer;
	rpc_long =	longint;
*ENDIF
*IF DEF VAXVMS
	rpc_byte=	[BYTE] 0..255;
	rpc_short =	[WORD] -32768..32767;
	UWord=		[WORD]	0..65535;	{ not used in rts, only in TS}
	rpc_long =	integer;	{ 32 bit integer }
*ENDIF
*IF DEF CERNCROSS
{$w-}					{ suppress warning for PACKED 0..255 }
	rpc_byte=	PACKED 0..255;
{$w+}					{ Re-enable warnig message }
	rpc_short =	SHORT;
{*	UWord=		SHORT;		 not used in general code  871001*}
	rpc_long =	integer;	{ 32 bit integer }
*ENDIF

*IF DEF PTC
	rpc_byte=	0..255;
	rpc_short =	0..32767;
	rpc_long =	integer;	{ 32 bit integer }
*ENDIF


*IF DEF FALSE
	LWord=  {packed for cerncross - no longer used I think (61210)}
		RECORD case boolean of		{ 32-bit in two halves }
		true: ( all: integer);
		false:( lo, hi: rpc_short)
		END;
*ENDIF

*IF DEF SHORTINT 1
	rpc_integer =	rpc_short;
*IF -DEF SHORTINT 1
	rpc_integer =	integer;	{ generic 16 or 32 bit integer }

	rpc_real32=	real;
	rpc_real48=	real;	{ fudge: not yet supported. }
	rpc_real64=	real;	{ fudge }
	rpc_real128=	real;	{ fudge }

*IF DEF CERNCROSS 1
	rpc_pointer=	address;	{ generic pointer }
*IF DEF PCTURBO 1
	rpc_pointer=	pointer;	{ generic pointer }
*IF DEF MACTURBO 1
	rpc_pointer=	^integer;	{ generic pointer }
*IF DEF PTC 1
	rpc_pointer=	^integer;	{ generic pointer }
*IF DEF FALSE
	{ currently defined by RPCC itself }
	rpc_str=	packed array [1..32767] of char;
	rpc_strpo=	^rpc_str;
	rpc_string=	RECORD
				strlen:	rpc_short;
				dtype, cont: rpc_byte;
				stradr:	rpc_strpo;
			END;
*ENDIF

*IF DEF M6809 1
	rpc_var_name=	string[rpc_name_length];  {Variable length string}
*IF DEF PCTURBO 1
	rpc_var_name=	string[rpc_name_length];  {Variable length string}
*IF DEF MACTURBO 1
	rpc_var_name=	string[rpc_name_length];  {Variable length string}
*IF DEF VAXVMS 1
	rpc_var_name=	varying [rpc_name_length] of char;


{ Words stored in their Courier order WHATEVER the system: }

	Courier_word=
*IF DEF MACTURBO 1
			PACKED
*IF DEF CERNCROSS 1
			PACKED
			RECORD	h, l: rpc_byte END;

	Courier_long=
*IF DEF MACTURBO 1
			PACKED
*IF DEF CERNCROSS 1
			PACKED
			RECORD	h, l: Courier_word END;

	rpc_status=	rpc_long;			{ returned status }

	rpc_name=	packed array[1..rpc_name_length] of char;

{ Courier RPC types: }

 
	message_type=	rpc_short;	{ takes the following values: }
	message_type_values=	0..3;			{ For record case }

	protocol_header_tag=	1..3;	{ Possible variants }
	rpc_message_tag	=	1..4;	{ Possible variants }
{

The "protocol header" is information not part of the logical message at
layer 6.  It is available to the transport service if this helps it go faster. 

The fields in this part are RIGHT ADJUSTED -- this needs some care.
The total length for each case must be exactly 16 bytes.

}
	rpc_ethernet_address=	packed array [1..6] of rpc_byte;

	protocol_header=

*IF DEF MACTURBO 1
			PACKED
*IF DEF CERNCROSS 1
			PACKED
			RECORD
			CASE protocol_header_tag of

{ For DRX11: }		1: (	dum1a, dum1b, dum1c,
				lw:	rpc_long);		{ for DRX11 }

{ For V24: }		2: (	dum2:	packed array[1..3] of rpc_long;
				hb:
*IF DEF MACTURBO 1
						packed
*IF DEF CERNCROSS 1
						packed
						array[0..3] of rpc_byte);

{ Ethernet use: }	3: (	dum3:		rpc_short;
				dest, source:	rpc_ethernet_address;
				ptype:		courier_word);

			END;

	rpc_byte_buffer =
*IF DEF MACTURBO 1
				packed
*IF DEF CERNCROSS 1
				packed
					array [0..MAXLENGTH] of rpc_byte;


{	RPC MESSAGE FORMAT
	------------------

The information kept in this block is in three parts:  there is internal
information about the state of the transaction kept by the RPCRTS; there
is a space left for use by the transport service ("protocol header")
and there is the logical rpc message itself, in courier format.

}
	rpc_message_pointer=	^ rpc_message;

	rpc_message=
*IF DEF MACTURBO 1
		PACKED
*IF DEF CERNCROSS 1
		PACKED
		RECORD

{	Internal RPCRTS use: }

		     m_next:	rpc_message_pointer;
		     m_status:	rpc_status;
		     m_socket:	socket_type;
		     m_index:	integer;		{ byte index }

{	Transport layer use: }

		     header:		protocol_header;

{	Logical message at layer 6: }

		     CASE rpc_message_tag OF
		     1: (b:	rpc_byte_buffer);

		     2: (rpc_ch:
*IF DEF MACTURBO 1
				packed
*IF DEF CERNCROSS 1
				packed
					array [0..MAXLENGTH] of rpc_char); 
		     3: (
			which: message_type;
			CASE message_type_values of
			0:    (	call_transaction_id:	Courier_word;
				program_number:		Courier_long;
				version_number:		Courier_word; 
				procedure_number:	Courier_word);

			1:    ( reject_transaction_id:	Courier_word;
				why:			Courier_word;
				reject_status:		Courier_long);

			2:    (	return_transaction_id:	Courier_word);
                                 
			3:    (	abort_transaction_id:	Courier_word;
			        abort_code:		Courier_word)
		      );

*IF DEF TS
*IF DEF CATS
		     4: (m_ts_data:	TS_data); { TS_data defined in CATS }
*ENDIF
*IF -DEF CATS
		     4:	(m_dummy_4: integer);	{ Value 4 not needed }
*ENDIF
*ENDIF
*IF -DEF TS
		     4:	(m_dummy_4: integer);	{ Value 4 not needed }
*ENDIF
		END;

	program_index =	integer;
	unit_index =	integer;	{ Force integer allocation for address}
                                                                              

