gtpa2m4d | Application Programming |
Periodically, application programmers can want to collect frequently used C code into a common library routine available to all application programs. The following section describes the procedure for doing this.
The format of the CLIBFUN macro is:
CLIBFUN cfun,tpfname,TYPE=,VERSION=,FEATURE=
where:
cfun and tpfname are positional, required parameters. TYPE and VERSION are keyword parameters, and VERSION is optional.
The purpose of segment C000 is to provide a single point of update whenever new library functions are created. C000 contains a CLIBFUN macro call for every library function in the system. When C000 is assembled, 4 sets of objects are automatically produced in the form of comment cards in the object decks:
You can also code the following special form,
CLIBFUN DUMMY,tpfname
which will reserve an entry in the quick enter directory for future use. No comment cards will be generated for this item, but it will serve as a placeholder so that the sequence of CLIBFUN calls is not disturbed when the item is later converted to a normal CLIBFUN call. If any program attempts to call a library function using an index number that corresponds to a dummy slot, segment C246 will be activated and cause the ECB to exit with system error.
You can want to extract only the allocator statements, SPPBLD, and LOADER CALL cards that are actually required for the new library function. However, be sure to replace the entire set of #pragma statements in tpflink.h with those generated by assembling C000 as the new set of #pragma map and #pragma linkage statements are interrelated.
Check if an update to the APSIZxx parameter of the CORREQ macro is required to accommodate the additional code. This can be determined by examining the sum of accumulated code size that appears in the object decks (and in the listings) when C000 is assembled.