GDSX Manual

User Exit Descriptions
Extended General Device Support (GDSX) Manual134303
9-17
USER^INITIALIZE
USER^INITIALIZE
This procedure allows you to initialize user data and/or execute special procedures
before the GDSX process is ready to accept open messages.
USER^INITIALIZE is only called once by the monitor task at the beginning of the
GDSX primary process lifecycle and once at the beginning of a backup GDSX process
lifecycle. You can determine if this procedure was called from the primary or backup
process by the value of the variable process, and thus determine whether to execute
code for primary or backup process initialization.
This procedure is called after all the data structures and TSCODE tasks have been
initialized, but before any requester open messages are processed and before the
DEVICE^HANDLER or LINE^HANDLER procedures are called.
You can process parameters captured by the PROCESS^USER^PARAMS and
USER^ASSIGNS procedures, open a disk file to be shared by all user tasks, initialize
user-defined semaphores, or more generally, initialize any user-defined global variable.
In the primary process, data retrieved from external sources, such as files, including
semaphores that are located in a global data block, cannot be checkpointed here because
the backup GDSX process is not running. Checkpointing this type of data must be
deferred until the USER^BACKUP exit is called.
?SECTION make^segment MACRO
== Make a tacl segment containing the SPI,COM, GDSX and USER definitions
xeq DDL/IN userddl/ == Build usertacl
xeq CREATESEG taclseg
xeq ATTACHSEG PRIVATE taclseg :new
xeq #PUSH #HOME result
xeq HOME :new
xeq #LOAD/KEEP 1,LOADED result/zspitacl
xeq #LOAD/KEEP 1,LOADED result/zcomtacl
xeq #LOAD/KEEP 1,LOADED result/zgdstacl
xeq #LOAD/KEEP 1,LOADED result/usertacl
xeq #POP #HOME
xeq DETACHSEG :new
The USERDDL file for this example contains:
?DICT !,NOSAVE
?TACL usertacl !
CONSTANT ugds-cmd-tell VALUE 5999.
CONSTANT ugds-tnm-text VALUE 5101.
CONSTANT ugds-tdt-char VALUE 1.
DEF ugds-ddl-char50 TYPE CHARACTER 50.
TOKEN-TYPE ugds-typ-char50 VALUE ugds-tdt-char
DEF ugds-ddl-char50.
TOKEN-CODE ugds-tkn-text VALUE ugds-tnm-text
TOKEN-TYPE ugds-typ-char50.
PROC USER^INITIALIZE ( process ); !
i
Example 9-1. Listing of TELLGDS File (page 4 of 4)