The Routine Line

A zcentry must have one and only one routine line. External call table processing does not currently detect missing or multiple routine lines, but may cause linker warnings and/or run-time errors. The routine line describes general information about the external routine.

The format for the routine line is:

	ROUTINE rtnkeyword=value [, ... ]
	Valid rtnkeywords:
	(*)CALLNAME=string
	(*)LINKNAME=string
	INPUTS=number
	OUTPUTS=number
	OUTOFBAND=keyword		
	

(*) - Denotes required keyword

Routine line keywords and their values must appear on a single MACRO line. MACRO lines may be continued by terminating them with a dash.

The argument to the CALLNAME keyword specifies the name by which the routine invocation recognizes the external routine. extended calls respect the case of CALLNAMEs and restricts them to a maximum of 32 characters. Do not enclose the CALLNAME in quotes (""). When the name in an externref or the first argument in a $ZCALL() matches this CALLNAME, GT.M uses the information in this external call table entry to form the external routine call.

The argument to the LINKNAME keyword specifies the real name of the routine invoked by the external invocation. VMS does not respect case in routine names and restricts them to 32 characters. When linking an external call table, the VMS Linker uses the LINKNAME to identify an object module for inclusion in the image. External call tables and external routines must be linked with the VMS Linker; they cannot be ZLINKed.

The argument to the INPUTS keyword specifies the positive integer number of input arguments passed to the external routine. INPUTS is an optional keyword and defaults to 0. The INPUTS argument must have a value equal to the number of input lines in the zcentry.

The argument to the OUTPUTS keyword must be a positive integer specifying the number of output arguments returned from the external routine. OUTPUTS is an optional keyword and defaults to 0. The OUTPUTS argument must have a value equal to the number of output lines in the zcentry.

The argument to the OUTOFBAND keyword specifies whether GT.M out-of-band asynchronous trap (AST) handling should be suspended during the external call. The keyword arguments are DEFAULT to leave the GT.M out-of-band handling in place, and RESET to suspend the GT.M out-of-band AST handling until the external routine returns control to GT.M. OUTOFBAND is an optional keyword and defaults to DEFAULT. GT.M out-of-band AST handling within M is controlled by the CTRAP=character-string and [NO]CENABLE device-parameters. For information on passing interrupt information from an external routine back to M, refer to the description of GTM$INTERRUPT in the "Database Access Library" chapter in this manual.

Example:

	zcinit
	routine callname=lexp, linkname=lexp
	[...other routine lines...]
	zcallfin
	.end
	

This routine line shows a CALLNAME of lower-case "lexp" and a LINKNAME of "LEXP", with no inputs and no outputs.

Example:

	zcinit
	routine callname=LEXP, linkname=lexptst, inputs=1
	.
	.
	.
	zcallfin
	.end
	

This routine line shows a CALLNAME of "LEXP" and a LINKNAME of "lexptst", with one input and no outputs.

Example:

	zcinit
	routinecallname=lexp, linkname=lexp, inputs=5, outp uts=2
	.
	.
	.
	zcallfin
	.end
	

This is the same as the first example except that it has five inputs and two outputs.