Index record exit
You can use an index record exit in ACIF to modify or ignore the records that ACIF writes in the index object file. The program that is run by this exit is defined by the INDXEXIT parameter.
This exit receives control before a record (structured field) is written to the index object file. The exit program can request that the record is ignored or processed. The largest record that can be processed is 32752 bytes (this number does not include the record descriptor word).
AIX or Windows sample index record 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 index record exit C language header
typedef struct _INDXEXIT_PARMS /* Parameters for the index record exit */ { char *work; /* Address of 16-byte static work area */ PFATTR *pfattr; /* Address of print file attribute information*/ char *record; /* Address of the record to be written */ unsigned short recordln;/* Length of the output index record */ char request; /* Delete or process the record */ char eof; /* Last call indicator to ACIF */ } INDXEXIT_PARMS;
The address of the control block that contains the following parameters is passed to the index record 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 it contains, see Attributes of the input print file.
- record(Bytes 9–12)
- A pointer to the first byte of the index record that includes the carriage control character. The record is in a 32 KB buffer (where KB equals 1024 bytes). The buffer is in storage that is allocated by ACIF, but the exit program is allowed to modify the index record.
- recordln(Bytes 13–14)
- The length, in bytes, of the index record. If the index record is modified, this parameter must also be updated to reflect the actual length of the record.
- request(Byte 15)
- An indication of how the record 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 record is to be processed by ACIF.
- X'01'
- Specifies that the record is not to be processed by ACIF.
A value of X'00' on entry to the exit program specifies that the record is to be processed. If you want to ignore the record, change the request byte value to X'01'. Any value greater than X'01' is interpreted as X'00' and the exit processes the record.
Note: Only one record can be in the buffer at any time. - eof(Byte 16)
- An end-of-file (EOF) indicator. This indicator is a 1-byte character code that signals
when ACIF is finished processing the index object file.
When eof is signaled (eof=y), the last record is already presented to the index 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.