Writing Exit Routines

You can write exit routines in any programming language; however, calls to subroutines must conform to conventions used in the C programming language.

Header Files

To define the parameters, structures, and return codes used in the exit routine, an exit routine must include two C program header files, PSTEXIT.H and, depending on the character format of the metadata (table names, column names, etc.), either PSTCMXIT.H or PSTCMWXT.H:

PSTEXIT.H
Specifies the data types, return codes, and structures for Optim-defined data types.
PSTCMXIT.H
For metadata in single-byte (e.g., ASCII) format.

Provides the prototypes for Column Map call‑back routines and specifies the defines and structure definitions for the Column Map exit parameters.

PSTCMWXT.H
For metadata in UTF-16 (WCHAR) format.

Provides the prototypes for Column Map call‑back routines and specifies the defines and structure definitions for the Column Map exit parameters.

These header files are located in the same directory with the Optim application files.

Note: If a parameter has a single-byte form and a UTF-16 form, this chapter provides the UTF-16 form in parentheses.

Using DLLs

You must compile and link each exit routine as a separate DLL. Optim loads each DLL dynamically at run time. A DLL can contain only one occurrence of a particular type of Column Map exit. However, you can include one of each type of Column Map exit routine in the same DLL.

You must use the name of the DLL in the Column Map. Specify the DLL name as it is defined to the platform (that is, do not use the generic name). Write the DLL to name and export the actual functions that implement the exit routine:

Standard Exit
PSTColMapExit
(PSTColMapWExit)
Source Format Exit
PSTColMapAgeSrcExit
(PSTColMapAgeSrcWExit)
Destination Format Exit
PSTColMapAgeDstExit
(PSTColMapAgeDstWExit)

Requirements

Each Column Map exit routine must satisfy the following requirements: