Custom Datatype Checklist

We recommend modeling your custom datatype implementation on our example code; see the file examples/usertypes.c.

 

To define a custom datatype, a program must do these steps:

Procedure 

1. Define the C representation of the new type. This representation is often a C struct.
2. Assign a code number to represent the new type. The new type must be in the range [TIBRVMSG_USER_FIRST, TIBRVMSG_USER_LAST]. All other codes are reserved.
3. Define an encoder function to transfer the new type from a field object into a message’s wire buffer. See tibrvMsgData_Encoder.
4. Define a decoder function to transfer the new type from a message’s wire buffer into t field object. See tibrvMsgData_Decoder.
5. Define a converter function to convert the new type to other datatypes. See tibrvMsgData_Converter.
6. Register the encoder, decoder and converter functions. See tibrvMsg_SetHandlers().
7. Optional: define convenience functions to add, get and update message fields with data of the new type. See Convenience Functions.