Introduction
Some text at the beginning of the program, called the preamble, indicates how the following program is to be compiled and installed in the system. This text is not processed by the PL/I macro facilities -- it controls those facilities.
PLAPACK is an object that takes: (1) a key to a segment holding a program, (2) a key to a directory from which to fetch keys referred to in the program's preamble, (3) a spacebank, (4) a output port upon which troubles will be reported. PLIPACK returns a factory that produces objects that obey the compiled program.
The preamble is composed of statements terminated by semicolons. PL/I style comments may occur within these statements. Some preamble statements refer to keys by name. These names are interpreted via a directory that is made available to the compiler controller by the requestor of the compilation. In such contexts "*" may be used to refer to DK(0).
REQUESTOR return key to factory caller
DOMCRE domain creator of domain executing your code
SYN_DOMKEY your synthetic domain key
PBANK prompt bank argument to requestor key.
METER meter argument to requestor key,
BANK Key parameter two to the requestor's key. It must be a bank.
OSCOM {(p2,oscom)}
OSFD {(p2,osfd)}
The functions S and SI are automatically available along with their declarations.
"x" is either "H", "F" or "S" depending on the clause under which the key is to be included as a factory component. See (p2,bf) for suitable circumstances for each sort of key.
"exname" is the name of the key within a directory provided by the user. The key is retrieved from the directory at compile time.
"inname" is a name that the key is known by in the program. If "inname" is omitted then the portion of "exname" to the right of all periods in "exname" is used in its place.
".DEFOUT" indicates that the key is to be placed in c-slot 4. It is slot 4 that gets the stream of output for undefined files. Your program may place another key there with a command such as "KALL (RETR, 0) KEYSFROM(SOKLIKE) KEYSTO(4);". That key must behave as a consuming byte stream.
Similarly, input for undefined files is supplied by the key in c-slot 3.
The statement "SEGMENT c, c, c, ...;" or "SEG c, c, c, ...;" defines segments that are to appear in the address space of the program. Each "c" is of the form "n segkey inname" where "segkey" is the name of a memory key to be located in the directory provided by the user and "inname" is the name of an external variable whose declaration is provided by the programmer and n is "12", "16" or "20" and is the code for the segment size. "n" is the log-base-2 of the segment size.
References to the external variable will be references to the segment.
The statement "CALL MAP_SEG(#zot, memkey);" causes the memory key memkey to be accessible via the external variable zot where zot occurs as the inname in some SEGMENTREFERENCES statement.
Using the SEGMENTREFERENCE facility costs more than using the SEGMENTS facility and there is a limit (about 14) to how many such uses there can be in one program.
Each facility module consists of a segment with two portions: some text to be included in your program before your text; and some compiler or assembler output.
Today such facility modules may be created merely by bringing the text deck from CMS by a command such as "AUXFILE GET SEGMENT TYMNET.ZZZ 85 FACIL TEXT" and then using the editor simply to add the textual information to the beginning of the object. Such information may include declarations for external entry points which are supplied by the following compiler output.
DCL NEWKEY ENTRY(CHAR(8)) RETURNS(CHAR(128)), (CIPHER, DECIHER) ENTRY(CHAR(8), CHAR (128)) RETURNS(CHAR(8));
CIPHER(pt, NEWKEY(key)) provides the encryption of plain text pt with key. DECIHER(CIPHER(pt, NEWKEY(key)), NEWKEY(key)) = pt
CIPHER and DECIHER are several times faster than NEWKEY. Saving NEWKEY's value saves time when keys are reused.
The following structure is declared whose value you provide by assignment statments and which is passed to the sort entry point "PLSRT" thus "CALL PLSRT(ARGS);".
Undefined output files, such as SYSPRINT will then appear as output on such a branch and undeclared input files such as SYSIN will get their data from that branch. See example at end for use of this.
The code: "DO I = 1 TO 3; KALL(CCK6, 4) KEYSTO(,,CCK6); END;" will delete the extra storage required by this facility and that storage will not otherwise be reclaimed as you exit your program.
A macro library in Gnosis is merely a record collection holding as members segments or record collections that hold the text to be included. These records must hold the text to be included within the traditional columns: 2 through 72.
Each clause in the SUPPRESS statement deletes a class of error messages produced by the preprocessor and compiler.
The clause begins with an eight character token that must exactly match the first token of any error message that it deletes.
Some error messages may be given special handling. Messages such as "Dummy argument created for parameter 7 of PLIJMPC" are important in some cases and not in others.
Imagine a statement such as:
We would like to support object and value locking {(p2,ob-lock) & (p2,val-lock)}.
When your program proceeds beyond the last statement that you provided, the object deletes itself and then replies with a null message to key "requestor".
The following program illustrates much of this:
See (p2,bf) concerning NEW_BUILDERS_KEY. You must learn about sealing factories and perhaps how to change factory components.
The factory USER.SYS.PLIPACKC {USER.PUB.KEYPLI for prerelease
version that corresponds to this document} is a factory
that produces a packer. If P is a packer then
P(0;SOURCE,DIRECTORY,SYSP
==> c;,,,CO) -- CO(0;bank,SWITCHER ==> c1;REQ,list.,BUILD)
returns a factory requestor's key, REQ, to a new factory
that will produce objects obeying the program provided in
the segment SOURCE. The New factory requires a space bank
as key parameter two which need not be prompt.
In a future version of PLIPACK the key SWITCHER may be a node key. In this case DDT's will have that key as their key 19 and will appear on a branch under switcher key found in slot 15 of the node.
The key "list." will refer to a directory with the compiler output as "list.LIST".
CMP F SYS.TSSC; FAC SYS.FACS.MAKE_ZMK; PL1; DCL LBN FIXED BIN INIT(-1); KALL (REQUESTOR, kt+5) KEYSFROM(ZMK) KEYSTO(LBN);
This would provide an expected ZMK to the creator and accept a node to hold late bound values.