IBM
Contents Index Previous Next



User Data


There is an option to include your own data fields into the buffer type. C-type tUserData is defined in the user_data.h file and it can be included into the buffer by CODER_USER_DATA compile switch (see User data configuration). By default type tUserData is defined as void*, but you can redefine it according to your needs.

tUserData with your own fields might be useful in the user error handling function (see User defined Error Handling) to store the data for the later manipulation outside the decoder or in the USER_BMS_ALLOC_FUNC/USER_BMS_FREE_FUNC (see User defined Memory Handling). The buffer interface BufGetUserData( buffer ) (see Buffer Management Functions) returns a reference to tUserData for your further handling. If you want to use your own data fields as tUserData, perform the following steps:

  1. Create file user_data.h and insert declaration of the tUserData C-structure.
  2. Compile the coder library with the CODER_USER_DATA compile switch.
  3. Add include path for the file user_data.h to the compilation settings.

Example 484 : File user_data.h

#ifndef user_data_h
#define user_data_h

typedef struct {
  int UserInt1;
  int UserInt2;
  int UserInt3;
} tUserData;

#endif

http://www.ibm.com/rational
Contents Index Previous Next