Resource Exit
ACIF provides an exit that enables you to “filter” resources from being included in
the resource file. If you want to exclude a specific type of resource (for example, an
overlay), you can control this with the restype parameter. This exit is useful in
controlling resources at the file name level. For example, assume you were going
to send the output of ACIF to PSF for AIX and you only wanted to send those fonts
that were not shipped with the PSF for AIX product. You could code this exit
program to contain a table of all fonts shipped with PSF for AIX and filter those
from the resource file. Security is another consideration for using this exit because
you could prevent certain named resources from being included. The program
invoked at this exit is defined by the ACIF resexit parameter.
This exit receives control before a resource is read from a directory. The exit
program can request that the resource be processed or ignored (skipped), but it
cannot substitute another resource name in place of the requested one. If the exit
requests any overlay to be ignored, ACIF will automatically ignore any resources
the overlay may have referenced (that is, fonts and page segments).
Figure 17 contains a sample C language header that describes the control block
that is passed to the exit program.
typedef struct _RESEXIT_PARMS /\ Parameters for the resource record exit \/
{
char \work; /\ Address of 16-byte static work area \/
PFATTR \pfattr; /\ Address of print file attribute information \/
char resname[8]; /\ Name of requested resource \/
char restype; /\ Type of resource \/
char request; /\ Ignore or process the resource \/
char eof; /\ Last call indicator \/
} RESEXIT_PARMS;
Figure 17. Sample Resource Exit C Language Header
The address of the control block containing the following parameters is passed to
the resource record exit:
work (Bytes 1–4)
A pointer to a static, 16-byte memory block. The exit program can use this
parameter to save information across calls (for example, pointers to work
areas). The 16-byte work area is aligned on a full word boundary and is
initialized to binary zeros prior to the first call. The user-written exit program
must provide the code required to manage this work area.
pfattr (Bytes 5–8)
A pointer to the print file attribute data structure. See “Attributes of the Input
Print File” on page 74 for more information on the format of this data structure
and the information presented.
resname (Bytes 9–16)
Specifies the name of the requested resource. This value cannot be modified
(changed) by the exit program.
restype (Byte 17)
Specifies the type of resource the name refers to. This is a 1-byte hexadecimal
value where:
72 ACIF User’s Guide