The Interface Validation Exit (INTFVAL) allows your exit routine to examine descriptive data for both caller and called at each external reference. The exit can perform audits, such as examining parameter passing conventions, the number of parameters, data types, and environments. It can accept the interface, rename the reference, or leave the interface unresolved.
At the completion of autocall, the exit will be taken once for the Start function and once for each section in the module containing one or more unchecked external references. An external reference is unchecked if the signature in its ER record is either null (binary zeros) or does not match the signature in the LD.
An anchor word will be passed to the exit to provide for persistent storage between invocations. If the binder is invoked as a batch program, the anchor will be allocated and set to zero by the binder on invocation of the Start function; otherwise, the value passed to the binder on the STARTD exit specification will be passed through to the exit. If the exit routine provides its own dynamic storage, that address can be stored in the anchor word for addressability by subsequent invocations. No facilities will be available for trapping errors: If the exit fails, the binder fails. A message can be returned by the exit routine, however, to be printed by the binder.
The message will be initialized to the null string so that the exit routine need not take any action unless a message is issued.
OFF TYPE LEN NAME DESCRIPTION NOTES
--- -------- --- -------------- ---------------------------- -----
(0) Address 4 REFL_NEXT Address of next list entry 3
(4) Address 4 REFL_T_SYMBOL Address of referenced symbol 2
(8) Address 4 REFL_T_SECTION Address of target section name 2,8
(C) Address 4 REFL_T_ELEMENT Address of target element 1,8
(10) Address 4 REFL_T_DESCR Address of target descriptors 1,8
(14) Address 4 REFL_T_IDR Address of target IDR 1,5,8
(18) Bit 4 REFL_T_ENVIR Target environment 1,6,8
(1C) Character 8 REFL_T_SIGN Target signature 8
(24) Address 4 REFL_T_ADCONS Adcon list anchor 1
(28) Address 4 REFL_C_DESCR Address of caller descriptors 1
(2C) Bit 4 REFL_C_ENVIR Caller's environment 1,6
(30) Character 8 REFL_X_SIGN Exit signature 4,9
(38) Address 4 REFL_X_SYMBOL New symbol (Char(*) varying) 4,7,9
(3C) Unsigned 2 REFL_X_ACTION Action code 4,9
(3E) Unsigned 2 Reserved 1
Notes:
1 Must be zero.
2 Points to varying character string. String must begin with a
halfword length field containing current length, excluding length
field.
3 Last entry in list set to zero.
4 Output field. Set by exit routine.
5 IDR data is returned in the following format:
0 CHAR 10 Processor Identification
10 CHAR 2 Processor Version
12 CHAR 2 Processor Modification Level
14 CHAR 7 Date Compiled or Assembled (yyyyddd)
The above 21-byte structure is preceded by a halfword length.
The length can contain zero or any multiple of 21, allowing
for multiple IDRs.
6 Environmental bit settings are not yet defined.
7 The exit routine must allocate and initialize a varying length
character string, consisting of a halfword length field,
containing the length of the symbol, immediately followed
by the symbol itself. The address of this varying string
must be stored in the REFL_X_SYMBOL field in the reference
list.
8 Target fields will contain binary zeros for unresolved references
9 Output fields will be initialized to binary zeros on invocation
of the exit routine.
10 Referenced symbol or section is in the following format:
0 BIN 2 Length of name field.
2 CHAR * Name.
Post Processing:
On return from the exit, the binder will take the action described by the action code for each external reference. If the action code is 1 or 2, the signature returned by the exit will be stored, if nonzero, in both ER and LD, so that the interface will not be reexamined on a subsequent invocation. If the exit elects to rename a reference, the symbol will be changed FOR THAT REFERENCE ONLY. If the renamed reference cannot be resolved from labels already present in the module, another autocall pass will be required.
The exit routine should always return some kind of signature to the binder, if the interface is valid, so that the same reference does not get revalidated on subsequent passes. If the input signature is not null (binary zeros) return it to the binder; otherwise, return any 8-byte string (for example, date/time), which will then be saved in the LD and ER records. The signature can consist of any characters. The binder map, if requested, will indicate those sections that were included as a result of one or more renamed references. The flag position in the map, which normally contains an asterisk for autocalled sections, will be reset to "R". There will be no indication as to the number and location of such renamed references nor their original names.
Default Exit Routine:
0 - unspecified
1 - data
2 - instructions
3-15 - for translator use
If the text type for either caller or called is unspecified, or if the two text types are equal, the interface is considered valid.
If either result is not valid, a warning message will be issued by the binder and the return code set to 4. The reference remains resolved, however.