Guardian Programmer's Guide

Table Of Contents
Writing a Terminal Simulator
Guardian Programmer’s Guide 421922-014
24 - 2
Specifying Device Subtype 30
Specifying Device Subtype 30
A terminal-simulation process must have a device subtype of 30. The device subtype
of a process is an attribute that is stored in the object file. By default, the subtype is 0;
however, you can specify some value for this attribute when you compile or bind the
program.
Why Device Subtype 30 Must Be Specified
Specifying device subtype 30 tells the system that the terminal-simulation process will
supply device information in response to a request for the device-type information.
A requester that communicates with a real terminal can call a procedure such as
FILE_GETINFO_ to get the device type of that device. For a real terminal, the
FILE_GETINFO_ procedure returns a device type of 6 to the requester. Processes
normally return device type 0; however, a terminal simulator must be able to return
device type 6 just like a real terminal. This operation is called device-type substitution.
To allow the terminal-simulation process to specify its own device type, you must
specify device subtype 30 for the process. Specifying device subtype 30 for the
terminal-simulation process specifies that the process performs device-type
substitution.
The mechanism for your terminal-simulation program to return the device type itself is
described later in this section under Processing System Messages.
How to Specify Device Subtype 30
You can specify the subtype attribute using either a compiler directive or a linker
command:
You can place a compiler directive at the beginning of your TAL program:
?SUBTYPE 30
For a TNS or accelerated program, you can use the SET SUBTYPE command in
Binder when linking the program:
@ SET SUBTYPE 30
For a TNS/R native program, you can use the set subtype command in the nld
utility when linking the program. The following nld command links two object files,
ofile1 and ofile2, sets the subtype attribute of the resultant object file to 30, and
names it objfile:
30> nld ofile1 ofile2 -set subtype 30 -o objfile