gtpa2m49Application Programming

DLM Call Stub Generator

This section describes the DLM call stub generator.

Purpose

The DLM call stub generator adds stubs to an object library of call stubs. Any entry point function called by an ISO-C load module must have a stub produced by the generator. The stubs are statically linked to an ISO-C program using the autocall mechanism during prelinking. The program name and PAT displacement is generated as a weak TPF VCON in the stub object module. The weak VCON is resolved when the offline loader runs.

Note

All load modules need the DLM call stub generator to generate the stubs for other E-type programs external to themselves that are called with TPF Enter/Back services.

Requirements and Restrictions

Format for a DLM Stub Generator Statement




Notes:

  1. Each repetition takes place on a new line.

Function Name
Name of a function found in any DLM.

Running the Generator

Table 27 lists the data sets required by the stub generator.

Table 27. File Specifications for the DLM Call Stub Generator

DD Name DCB Characteristics Purpose
SYSIN LRECL=80,
RECFM=F or
RECFM=FB
Input file of DLM call stub generator statements - the generator script.
SYSPRINT   Output file for generator messages.
STUBS LRECL=80,
RECFM=F or
RECFM=FB
Output object partitioned dataset (PDS) generated.

The JCL needed to run the stub generator is quite simple. The generator (CSTUBGvv) is set up to run using the version on the ACP.LINK.RELvv library. The listing goes to SYSPRINT, which is set to standard output. The object file file containing the stubs is written through DD name STUB in the PDS ACP.STUB.RELvv. The input to the generator appears right after the SYSIN DD *.

There are 3 comment lines followed by 3 lines indicating routines to put into the stub object file. Comments follow each routine showing where the calling routines are.

//CSTUBGEN EXEC PGM=STUBvv,REGION=4M
//STEPLIB  DD DSN=ACP.LINK.RELvv.BSS,DISP=SHR
//         DD DSN=LE.V1R3M0.SEDCLINK,DISP=SHR
//         DD DSN=SYS1.PLI.SIBMLINK,DISP=SHR
//STUB     DD DSN=ACP.STUB.RELxx.BSS,DISP=OLD
//SYSPRINT DD SYSOUT=A
//SYSIN    DD  *
#
# Generate 3 stub object modules
#
PGM1             # called by DLM1
PGM2             # called by DLM2
UIIO             # called by DLM1 and DLM2
/*

Return codes indicate if the generator successfully built the stub object file. A stub is generated for each program name in the input file. If an error occurs or a problem prevents stub generation, an error message is displayed in SYSPRINT and a nonzero return code is set. Each error message contains the line number of the corresponding input line. The return codes are:

 0 
indicates successful completion and all stub object modules generated

 4 
indicates a warning that there were no program names provided in the input file, so no stubs were generated.

 8 
indicates an error that prevented 1 or more stub object modules from being generated.

 16 
indicates that the error message file could not be opened.