DataSource for C SDK
8.0.4.341990-53978ef8
|
Data Structures | |
struct | _ds_data |
A data update object. More... | |
struct | _ds_field |
A field within a data update. More... | |
Macros | |
#define | DS_FIELDS_SEPARATOR |
Defines the separator between multiple type 2/type 3 or permission row updates within a single packet. More... | |
Functions | |
void | ds_add_data (ds_data_t *data, int32_t fieldnum, const char *value) |
Adds a string value to a data object. More... | |
void | ds_add_data_char (ds_data_t *data, int32_t fieldnum, char value) |
Add a value to a data object in the form of a character. More... | |
void | ds_add_data_float32 (ds_data_t *data, int32_t fieldnum, float value) |
Add a value to a data object in the form of a floating point number. More... | |
void | ds_add_data_float64 (ds_data_t *data, int32_t fieldnum, double value) |
Add a value to a data object in the form of a floating point number. More... | |
void | ds_add_data_fmt (ds_data_t *data, int32_t fieldnum, const char *fmt,...) |
Add a sprintf style format string to a data object. More... | |
void | ds_add_data_int16 (ds_data_t *data, int32_t fieldnum, int16_t value) |
Add a value to a data object in the form of a 16 bit integer. More... | |
void | ds_add_data_int32 (ds_data_t *data, int32_t fieldnum, int32_t value) |
Add a value to a data object in the form of a 32 bit integer. More... | |
void | ds_add_data_int64 (ds_data_t *data, int32_t fieldnum, int64_t value) |
Add a value to a data object in the form of a 64 bit integer. More... | |
void | ds_add_data_int8 (ds_data_t *data, int32_t fieldnum, int8_t value) |
Add a value to a data object in the form of an 8 bit integer. More... | |
void | ds_add_data_str (ds_data_t *data, int32_t fieldnum, const char *value) |
Adds a string value to a data object. More... | |
void | ds_add_data_uint16 (ds_data_t *data, int32_t fieldnum, uint16_t value) |
Add a value to a data object in the form of a 16 bit unsigned integer. More... | |
void | ds_add_data_uint32 (ds_data_t *data, int32_t fieldnum, uint32_t value) |
Add a value to a data object in the form of a 32 bit unsigned integer. More... | |
void | ds_add_data_uint64 (ds_data_t *data, int32_t fieldnum, uint64_t value) |
Add a value to a data object in the form of a 64 bit unsigned integer. More... | |
void | ds_add_data_uint8 (ds_data_t *data, int32_t fieldnum, uint8_t value) |
Add a value to a data object in the form of an 8 bit unsigned integer. More... | |
ds_data_t * | ds_clone_data (ds_data_t *data) |
Create a clone of a data object. More... | |
void | ds_free_data (ds_data_t *data) |
Deallocates the memory used by a data object. More... | |
ds_data_t * | ds_init_data (const char *subject, unsigned short type, unsigned short flags) |
Initialise a data object for use. More... | |
void | ds_set_subject (ds_data_t *data, const char *subject) |
Sets a new name for the data object. More... | |
This is the basic API for creating data objects to be sent to other DataSource peers. Typically ds_init_data() will be used to create the object, then any number of the add functions used to add field, value pairs to the object. There are various functions allowing different data types to be added.
#define DS_FIELDS_SEPARATOR |
Defines the separator between multiple type 2/type 3 or permission row updates within a single packet.
void ds_add_data | ( | ds_data_t * | data, |
int32_t | fieldnum, | ||
const char * | value | ||
) |
Adds a string value to a data object.
data | The data object |
fieldnum | The field identifier number |
value | String value for this field |
void ds_add_data_char | ( | ds_data_t * | data, |
int32_t | fieldnum, | ||
char | value | ||
) |
Add a value to a data object in the form of a character.
data | The data object |
fieldnum | The field identifier number |
value | Character value for this field |
void ds_add_data_float32 | ( | ds_data_t * | data, |
int32_t | fieldnum, | ||
float | value | ||
) |
Add a value to a data object in the form of a floating point number.
data | The data object |
fieldnum | The field identifier number |
value | Floating point value for this field |
void ds_add_data_float64 | ( | ds_data_t * | data, |
int32_t | fieldnum, | ||
double | value | ||
) |
Add a value to a data object in the form of a floating point number.
data | The data object |
fieldnum | The field identifier number |
value | Floating point value for this field |
void ds_add_data_fmt | ( | ds_data_t * | data, |
int32_t | fieldnum, | ||
const char * | fmt, | ||
... | |||
) |
Add a sprintf style format string to a data object.
data | The data object |
fieldnum | The field identifier number |
fmt | sprintf style format string |
void ds_add_data_int16 | ( | ds_data_t * | data, |
int32_t | fieldnum, | ||
int16_t | value | ||
) |
Add a value to a data object in the form of a 16 bit integer.
data | The data object |
fieldnum | The field identifier number |
value | Integer value for this field |
void ds_add_data_int32 | ( | ds_data_t * | data, |
int32_t | fieldnum, | ||
int32_t | value | ||
) |
Add a value to a data object in the form of a 32 bit integer.
data | The data object |
fieldnum | The field identifier number |
value | Integer value for this field |
void ds_add_data_int64 | ( | ds_data_t * | data, |
int32_t | fieldnum, | ||
int64_t | value | ||
) |
Add a value to a data object in the form of a 64 bit integer.
data | The data object |
fieldnum | The field identifier number |
value | Integer value for this field |
void ds_add_data_int8 | ( | ds_data_t * | data, |
int32_t | fieldnum, | ||
int8_t | value | ||
) |
Add a value to a data object in the form of an 8 bit integer.
data | The data object |
fieldnum | The field identifier number |
value | Integer value for this field |
void ds_add_data_str | ( | ds_data_t * | data, |
int32_t | fieldnum, | ||
const char * | value | ||
) |
Adds a string value to a data object.
data | The data object |
fieldnum | The field identifier number |
value | String value for this field |
void ds_add_data_uint16 | ( | ds_data_t * | data, |
int32_t | fieldnum, | ||
uint16_t | value | ||
) |
Add a value to a data object in the form of a 16 bit unsigned integer.
data | The data object |
fieldnum | The field identifier number |
value | Unsigned integer value for this field |
void ds_add_data_uint32 | ( | ds_data_t * | data, |
int32_t | fieldnum, | ||
uint32_t | value | ||
) |
Add a value to a data object in the form of a 32 bit unsigned integer.
data | The data object |
fieldnum | The field identifier number |
value | Unsigned integer value for this field |
void ds_add_data_uint64 | ( | ds_data_t * | data, |
int32_t | fieldnum, | ||
uint64_t | value | ||
) |
Add a value to a data object in the form of a 64 bit unsigned integer.
data | The data object |
fieldnum | The field identifier number |
value | Unsigned integer value for this field |
void ds_add_data_uint8 | ( | ds_data_t * | data, |
int32_t | fieldnum, | ||
uint8_t | value | ||
) |
Add a value to a data object in the form of an 8 bit unsigned integer.
data | The data object |
fieldnum | The field identifier number |
value | Unsigned integer value for this field |
Create a clone of a data object.
data | - Data object to be cloned |
void ds_free_data | ( | ds_data_t * | data | ) |
Deallocates the memory used by a data object.
data | The data object to free |
ds_data_t* ds_init_data | ( | const char * | subject, |
unsigned short | type, | ||
unsigned short | flags | ||
) |
void ds_set_subject | ( | ds_data_t * | data, |
const char * | subject | ||
) |
Sets a new name for the data object.
data | The data object |
subject | The new name for the object |
This function should be used instead of setting _ds_data::subject directly since this function respects any patterns defined using the add-pattern
configuration option.