FCPE-SPI
FLAM Column Processing Exit (FCPE) Service Provider Interface (SPI)
Function structures

Definition of the function code dependent structures for FCPE. More...

Data Structures

struct  FcpeOpn
 FCPE parameter structure for function code FCPE_FUNC_OPN. More...
 
struct  FcpeRun
 FCPE Run structure. More...
 
struct  FcpeCls
 FCPE Close structure. More...
 
union  FcpePar
 FCPE Union of function structures. More...
 

Typedefs

typedef struct FcpeOpn TsFcpeOpn
 FCPE parameter structure for function code FCPE_FUNC_OPN.
 
typedef struct FcpeRun TsFcpeRun
 FCPE Run structure.
 
typedef struct FcpeCls TsFcpeCls
 FCPE Close structure.
 
typedef union FcpePar TuFcpePar
 FCPE Union of function structures.
 

Detailed Description

Definition of the function code dependent structures for FCPE.

Typedef Documentation

◆ TsFcpeCls

typedef struct FcpeCls TsFcpeCls

FCPE Close structure.

This structure is used when the exit function is called with the function code FCPE_FUNC_CLS. It is always called after data processing is finished, no matter if there was error or not.

The only member pair is a 1024 bytes buffer for an error message. The corresponding length must be set to the length of the error message.

◆ TsFcpeOpn

typedef struct FcpeOpn TsFcpeOpn

FCPE parameter structure for function code FCPE_FUNC_OPN.

This structure is used when the exit function is called with the function code FCPE_FUNC_OPN.

The first member contains flags that can be set in both directions. If the exit is opened for converting output data, the flag bit FCPE_FLAG_WRITE is set. If it is not set, the exit is opened for converting input data. The exit function may set the FCPE_FLAG_NOCPY flag if it does not write to the output buffer in the TsFcpeRun structure (i.e. it only validates or changes the data in-place).

The second member contains the CCSID in the low order 24 bits. The high order 8 bits contain the combined character form. The member is set by the exit driver to a value corresponding to the input data and must be changed by the exit function only if its output is in a different character set. A CCSID of 0 indicates binary data. For example, if the exit function implements encryption of strings, the input text may be in UTF-8 (CCSID=1208). Since the encryption produces binary output, the CCSID must be set to 0.

The next three member pairs contain the length and a pointer to the corresponding string with the table name, the column name and the parameter string. The parameter string must be interpreted by the service provider.

The following member pair may be set by the exit function if the operation is invertible. The exit function must the pointer to the inverse parameter string and is responsible for allocating and freeing memory for this string. If the length is zero or the pointer is NULL, the exit is considered not invertible.

The last member pair is a 1024 bytes buffer for an error message. The corresponding length must be set to the length of the error message.

◆ TsFcpeRun

typedef struct FcpeRun TsFcpeRun

FCPE Run structure.

This structure is used when the exit function is called with the function code FCPE_FUNC_RUN. It is called for each data item of this column, allowing the exit to manipulate the data as needed.

The exit drivers passes the length and a pointer to the input data of the current column as the first pair of members of the structure.

The second member pair is the size and a pointer to an already allocated buffer where the exit function may write its output to and set the output length accordingly. The input and output buffers are managed by the exit driver. If the output buffer is too small, then FLMRTC_LEN must be set as return code and the output length must contain the minimum required buffer length. The exit driver then repeats the call with a buffer of at least the desired size. This is repeated until the exit function no longer sets the FLMRTC_LEN error code. If the FCPE_FLAG_NOCPY flag is set, the output pointer and length is set to NULL/0 by the exit driver and the exit function must set the output length to the input length and the output pointer to the input pointer for plausibility checks by the exit driver.

If the FCPE_FLAG_NOCPY flag has been set during the FCPE_FUNC_RUN function code call, the input buffer may be modified in-place. However, the output pointer must be set to the input pointer. This prevents unnessary copy operation if the exit function only perform minor changes or none at all.

The flag word can be used to set indication flags bits when reading and to use these flags when writing. Currently, the bit definitions below are defined:

FLMELM_TYPTAB_FLAG_NULLID FLMELM_TYPTAB_FLAG_EMPTID

At normal pre- or post-processing the flag word is not touched.

The last member pair is a 1024 bytes buffer for an error message. The corresponding length must be set to the length of the error message.

◆ TuFcpePar

typedef union FcpePar TuFcpePar

FCPE Union of function structures.

This union must be used to access structure fields depending on the function code that was passed to exit function. Only the member that corresponds to the function code may be accessed. Failing to do so results in undefined behavior!