From:	CSBVAX::CSBVAX::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 22-MAR-1989 18:51
To:	MRGATE::"ARISIA::EVERHART"
Subj:	Some VAX C include files


Received: From KL.SRI.COM by CRVAX.SRI.COM with TCP; Wed, 22 MAR 89 15:31:19 PDT
Received: from ucbvax.Berkeley.EDU by KL.SRI.COM with TCP; Wed, 22 Mar 89 15:06:56 PST
Received: by ucbvax.Berkeley.EDU (5.61/1.36)
	id AA17786; Wed, 22 Mar 89 13:28:58 -0800
Received: from USENET by ucbvax.Berkeley.EDU with netnews
	for info-vax@kl.sri.com (info-vax@kl.sri.com)
	(contact usenet@ucbvax.Berkeley.EDU if you have questions)
Date: 22 Mar 89 16:50:15 GMT
From: pitt!cisunx!wpn@cadre.dsl.pittsburgh.edu  (Bill Nixon)
Organization: University of Pittsburgh, Information Services
Subject: Some VAX C include files
Message-Id: <16973@cisunx.UUCP>
Sender: info-vax-request@kl.sri.com
To: info-vax@kl.sri.com

Here are two VAX C include files I use to work with the system services
and rtl routines of VMS.

The first file, vmstype.h, defines some VMS Data types which correspond
to the standard VMS usage.  Almost all of these are from taken form the
VMS manual which describes how to use VAX C with the library and system
calls.  I think using something like WORD_UNSIGNED is easier to read
than the standard C 'unsigned short int' on VMS, since all the
definitons and help files for calls use this notation.  Not all the
possible VMS data types are defined, merely the most simple and widely
used.

The second file, item_list.h, sets up a item_list structure as defined
in VMS.  It is a bit clumsy to work with, buts reads easy to me.

--[Begin vmstype.h]-------------------------------------------------------
/* File: vmstype.h							*/
/*									*/
/* VAX C implementation of VMS Data Types 				*/

typedef unsigned long int 	BOOLEAN;
typedef char 			BYTE_SIGNED;
typedef unsigned char 		BYTE_UNSIGNED;
typedef unsigned short int 	CHANNEL;
typedef unsigned long int 	COND_VALUE;
typedef unsigned long int 	CONTEXT;
typedef unsigned short int 	FILE_PROTECTION;
typedef unsigned long int	FUNCTION_CODE;
typedef unsigned long int	LOCK_ID;
typedef long int		LONGWORD_SIGNED;
typedef unsigned long int	LONGWORD_UNSIGNED;
typedef unsigned char		MASK_BYTE;
typedef unsigned long int	MASK_LONGWORD;
typedef	unsigned short int	MASK_WORD;
typedef unsigned long int	NULL_ARG;
typedef unsigned long int	PAGE_PROTECTION;
typedef unsigned long int	PROCESS_ID;
typedef unsigned long int	RIGHTS_ID;
typedef unsigned long int	UIC;
typedef short int		WORD_SIGNED;
typedef unsigned short int	WORD_UNSIGNED;
--[End vmstype.h]---------------------------------------------------------

--[Begin item_list.h]-----------------------------------------------------
/* File: item_list.h							*/

/* Macros to manipulate item lists */

#define def_itm(X,Y)		X.buffer_length = 0; X.item_code = Y;
#define def_end(X)		X.buffer_length = 0; X.item_code = 0;


/* Item List definition in C */

union pointer { int *intbuf;
		char *charbuf;
		short *wordbuf; };

typedef struct { unsigned short int buffer_length;
		   unsigned short int item_code;
		   union pointer buffer_address;
		   unsigned long int return_length_address; } ITEM_LIST;


ITEM_LIST null_list = { 0, 0 };
--[End item_list.h]-------------------------------------------------------
-- 
William Nixon, University of Pittsburgh, Information Services
Bitnet:	WPN@PITTVMS		CC-Net:	CISVMS::WPN
UUCP:  	{decwrl!allegra,bellcore,cadre,psuvax1}!pitt!cisunx!wpn
InterNet: wpn%vms.cis.pittsburgh.edu@vb.cc.cmu.edu

