OpenVMS Source Code Demos

VMS_EXTERNALS.INC

!
!23456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
!        1         2         3         4         5         6         7         8         9
!=========================================================================================
! Title  : VMS_Externals.inc
! Author : Neil S. Rieck
! Notes  : this module is used by many (200+) programs on our system. New programs should
!	   include the desired starlet modules directly (i.e. don't use this file) which
!	   should have the effect of speeding up compile times.
! History:
! 100 NSR 940228 1. original work
! 200 NSR 000101 1. "pre Alpha" renovation - modified to use "sys$library:basic$starlet"
!     NSR 000201 2. enabled method #2.b (%include "lib$routines" %from...)
!     NSR 000208 3. copied this original file to "VMS_Externals.inc_old" then cleaned up
!     NSR 000331 4. added calls to $rmsdef + $fabdef and added %nolist + %list directives
!     NSR 001222 5. made the declaration of ItemRec identical to SysItems
!     NSR 010720 6. added call to $uaidef
!     NSR 061216 7. added call to $libdtdef
!     NSR 100602 8. added $rabdef (record access block)
!=========================================================================================
!
%nolist										! keep listing file small
%include "[.inc]VMS_Structures.inc"						! IOSB recs etc.
!
%if %declared(%csmis$vms_externals_declared) = 0				! if the first time through...
%then
    !
    %include "starlet"		%from %library "sys$library:basic$starlet"	! system services
    %include "$ssdef"		%from %library "sys$library:basic$starlet"	! ss$
    %include "$secdef"		%from %library "sys$library:basic$starlet"	! sec$
    %include "$syidef"		%from %library "sys$library:basic$starlet"	! syi$
    %include "$iodef"		%from %library "sys$library:basic$starlet"	! io$
    %include "$jpidef"		%from %library "sys$library:basic$starlet"	! jpi$
    %include "$sjcdef"		%from %library "sys$library:basic$starlet"	! sjc$
    %include "$brkdef"		%from %library "sys$library:basic$starlet"	! brk$
    %include "$dvidef"		%from %library "sys$library:basic$starlet"	! dvi$
    %include "$lnmdef"		%from %library "sys$library:basic$starlet"	! lnm$
    %include "$rmsdef"		%from %library "sys$library:basic$starlet"	! rms$
    %include "$fabdef"		%from %library "sys$library:basic$starlet"	! fab$
    %include "$rabdef"          %from %library "sys$library:basic$starlet"	! rab$
    %include "$uaidef"		%from %library "sys$library:basic$starlet"	! uai$
    %include "$ttdef"		%from %library "sys$library:basic$starlet"	! tt$
    %include "$tt2def"		%from %library "sys$library:basic$starlet"	! tt2$
    %include "lib$routines"	%from %library "sys$library:basic$starlet"	! lib$
    %include "$libdtdef"	%from %library "sys$library:basic$starlet"	! eg. LIB$K_DELTA_SECONDS_F
    %include "$libdef"		%from %library "sys$library:basic$starlet"	! eg. lib$_normal
    %include "$quidef"		%from %library "sys$library:basic$starlet"	! qui$		queue stuff
    %include "$jbcmsgdef"	%from %library "sys$library:basic$starlet"	! jbc$		queue stuff
    %include "$psldef"		%from %library "sys$library:basic$starlet"	! psl$
    !
    !	/// Item Record for system calls ///
    !
    %if %declared (%ITEMREC) = 0 %then
	record ItemRec								! structure of item record
	    variant
		case
		    group one
			word	BuffLen
			word	ItemCode
			long	BuffAddr
			long	RtnLenAdr
		    end group one
		case
		    group two
			long	List_Terminator
			long	Junk1
			long	Junk2
		    end group two
	    end variant
	    end record ItemRec
    %let %ITEMREC = 1
    %end %if
    !+
    !	/// Item Record for system calls ///
    !-
    %if %declared (%SYSITEMS) = 0 %then
	record SysItems								! structure of item record
	    variant
		case
		    group one
			word	BuffLen
			word	ItemCode
			long	BuffAddr
			long	RtnLenAdr
		    end group one
		case
		    group two
			long	List_Terminator
			long	Junk1
			long	Junk2
		    end group two
	    end variant
	end record SysItems
    %let %SYSITEMS = 1
    %end %if
    !
    !	/// I/O Status Block (type #1 - sys$QIO etc.) ///
    !
    %if %declared (%IOSBREC) = 0 %then
	record IosbRec								! structure of I/O Status Block
	    variant
		case
		    group one
			word		rc					! return code
			word		xfer_count				! transfer count
			long		long_0					! device specific info
		    end group one
		case
		    group two
			basic$quadword	quad_0					! unsigned quad (system calls)
		    end group two
	    end variant
	end record IosbRec
    %let %IOSBREC = 1
    %end %if
    !
    !	/// I/O Status Block (type #2 - sys$GetQui) ///
    !
    %if %declared (%IOSBRECQUI) = 0 %then
	record IosbRecQui							! structure of I/O Status Block
	    variant
		case
		    group one
			long		sts					! GetQui completion status code
			long		long_0					! device specific info
		    end group one
		case
		    group two
			basic$quadword	quad_0					! unsigned quad (system calls)
		    end group two
	    end variant
	end record IosbRecQui
    %let %IOSBRECQUI = 1
    %end %if
    !
    !	/// Terminator Descriptor Block (for qio_read) ///
    !
    %if %declared (%TDB_REC) = 0 %then
	record TDB_Rec								! terminator descriptor block
		long	mask_type						! mask type
		long	mask							! character bit mask
	end record								!
    %let %TDB_REC = 1
    %end %if
    !
%let %csmis$vms_externals_declared = 1						! make sure we only do this once
%end %if
%list

Back to Home
Neil Rieck
Waterloo, Ontario, Canada.