tibrvMsg_SetHandlers()

Function

Declaration

tibrv_status tibrvMsg_SetHandlers(
    tibrv_u8                 type,
    tibrvMsgData_Encoder     encoder,
    tibrvMsgData_Decoder     decoder,
    tibrvMsgData_Converter   converter);

Purpose

Define a program-specific datatype, by registering functions to transfer it between local format and wire format, and convert it to other datatypes.

Remarks

Programs that define custom data handler functions must register them before any message operations involving the custom datatype.

The program’s data handler functions must properly address byte order and endian issues.

Parameter

Description

type

Use this number as a unique identifier for the new datatype.

The type identifier must be in the range [TIBRVMSG_USER_FIRST, TIBRVMSG_USER_LAST]; all other identifiers are reserved.

encoder

This function translates a local format instance of the datatype into wire format. See tibrvMsgData_Encoder.

NULL indicates that the program cannot add or update fields of this datatype.

decoder

This function translates wire format to a local format instance of the datatype. See tibrvMsgData_Decoder.

NULL indicates that the program cannot get fields of this datatype.

converter

This function translates a field of this datatype to other datatypes. See tibrvMsgData_Converter.

NULL indicates that the program cannot force conversion to another datatype during get and update calls.

See Also

tibrvMsgData_Converter

tibrvMsgData_Decoder

tibrvMsgData_Encoder