Resource exit

You can use a resource exit in ACIF to filter resources so they are not included in the resource file. If you want to exclude a specific type of resource (for example, an overlay), you can control it with the RESTYPE parameter. This exit is useful in controlling resources at the file name level. For example, assume that you are going to send ACIF output to InfoPrint Manager and you only wanted to send those fonts that were not included with the InfoPrint Manager product. You can code this exit program to contain a table of all fonts included with InfoPrint Manager and filter those fonts from the resource file. Security is another consideration for using this exit because you can prevent certain named resources from being included. The program that is run by this exit is defined by the RESEXIT parameter.

This exit receives control before a resource is read from a library. The exit program can request that the resource is processed or ignored (skipped), but it cannot substitute another resource name in place of the requested one. If the exit requests that any overlay to be ignored, ACIF automatically ignores any resources the overlay references (that is, fonts and page segments).

AIX or Windows sample resource exit C language header contains a sample C language header that describes the control block that is passed to the AIX or Windows exit program.

AIX or Windows sample resource exit C language header

typedef struct _RESEXIT_PARMS/*Parameters for the resource record exit */
{
   char           *work;     /*Address of 16-byte static work area     */
   PFATTR         *pfattr;   /*Address print file attribute information*/
   char           resname[8];/*Name of requested resource (8 byte)     */
   char           restype;   /*Type of resource                        */
   char           request;   /*Ignore or process the resource          */
   char           eof;       /*Last call indicator                     */
   unsigned short resnamel;  /*Length of resource name                 */
   char           pad1[3];   /*Padding byte                            */
   char           resnamf[250];/*Resource name if more than 8 bytes    */
   } RESEXIT_PARMS;

The address of the control block that contains the following parameters is passed to the resource exit. For AIX and Windows, the address is passed by the first parameter.

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 fullword boundary and is initialized to binary zeros before to the first call. The user-written exit program must provide the code that is required to manage this work area.
pfattr(Bytes 5–8)
A pointer to the print file attribute data structure. For more information about the format of this data structure and the information that is presented, see Attributes of the input print file.
resname(Bytes 9–16)
The name of the resource to be included. This name can be a file or member name for AFP resources up to 8 characters. For resources names of more than 8 characters, use resnamf. The resource type field defines how the resname is interpreted.
restype(Byte 17)
The type of resource the name refers to. This value is a 1-byte hexadecimal where:
X'03'
Specifies a GOCA (graphics) object
X'05'
Specifies a BCOCA (bar code) object
X'06'
Specifies an IOCA (IO image) object
X'40'
Specifies a font character set
X'41'
Specifies a code page
X'42'
Specifies a coded font
X'92'
Specifies an object container (also applies to color management resources (CMRs) and TrueType and OpenType font objects)
X'9B'
Specifies a PTOCA (presentation text) object
X'FB'
Specifies a page segment
X'FC'
Specifies an overlay

ACIF does not call this exit for these resource types:

Page definition
The page definition (PAGEDEF) is a required resource for processing line data, XML data, mixed-mode data, and unformatted ASCII data. The page definition is never included in the resource file.
Form definition
The form definition (FORMDEF) is a required resource for processing print files. If you do not want the form definition included in the resource file, specify RESTYPE=NONE or explicitly exclude it from the RESTYPE list.
Coded fonts
If MCF2REF=CF is specified, coded fonts are included in the resource file. Otherwise, ACIF does not include any referenced coded fonts in the resource file; therefore, resource filtering is not applicable. ACIF needs to process coded fonts to determine the names of the code pages and font character sets they reference, which is necessary to create MCF-2 structured fields.
COM setup files
A COM setup file is a required resource for processing microfilm files (microfilm can mean either microfiche or 16 mm film). If you do not want a setup file that is included in the resource file, specify RESTYPE=NONE or explicitly exclude OBJCON from the RESTYPE list.
Color mapping tables
A color mapping table (COLORMAP) is used to map color values from a source color space to a target color space. If you do not want a color mapping table included in the resource file, specify RESTYPE=NONE or explicitly exclude OBJCON from the RESTYPE list.

request(Byte 18)
An indication of how the resource is to be processed by ACIF. On entry to the exit program, this parameter is X'00'. When the exit program returns control to ACIF, this parameter must have the value X'00' or X'01' where:
X'00'
Specifies that the resource is to be processed by ACIF.
X'01'
Specifies that the resource is not to be processed by ACIF.

A value of X'00' on entry to the exit program specifies that ACIF processes the resource. If you want to ignore the resource, change the request byte value to X'01'. Any value greater than X'01' is interpreted as X'00' and the exit processes the resource.

eof(Byte 19)
An end-of-file (EOF) indicator. This indicator is a 1-byte character code that signals when ACIF is finished writing the resource file.

When eof is signaled (eof=y), the last record is already presented to the resource exit. The pointer record is no longer valid. Records cannot be inserted when eof is signaled. These values are the only valid values for this parameter:

y
Specifies that the last record is written.
n
Specifies that the last record is not written.

This end-of-file flag, which is used as a last-call indicator, returns control to ACIF. The exit program cannot change this parameter.

resnamel(Bytes 20–21)
The actual length of the meaningful characters in resname and resnamf.
pad1(Bytes 22-24)
Reserved bytes used for padding or future use.
resnamf(Bytes 25–274)
The name of the resource to be included if more than 8 characters. This name can be a full font name for TrueType or OpenType fonts (up to 250 Unicode characters), color management resources (CMRs), or any resources that are installed in the system by using resource access table (RAT) entries (see Processing resources installed with resource access tables for more information about RATs.). The resource type field defines how the resnamf is interpreted.