DataSource for C SDK  6.2.20.310828
Creating Data Objects

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...
 
ds_data_tds_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_tds_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...
 

Detailed Description

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.

See also
Sending Data Objects to Peers
Data Object Flags
Data Object Types

Macro Definition Documentation

#define DS_FIELDS_SEPARATOR

Defines the separator between multiple type 2/type 3 or permission row updates within a single packet.

Function Documentation

void ds_add_data ( ds_data_t data,
int32_t  fieldnum,
const char *  value 
)

Adds a string value to a data object.

Parameters
dataThe data object
fieldnumThe field identifier number
valueString value for this field
See also
ds_add_data_str()
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.

Parameters
dataThe data object
fieldnumThe field identifier number
valueCharacter 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.

Parameters
dataThe data object
fieldnumThe field identifier number
valueFloating point value for this field
See also
ds_add_data_float64()
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.

Parameters
dataThe data object
fieldnumThe field identifier number
valueFloating point value for this field
See also
ds_add_data_float32()
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.

Parameters
dataThe data object
fieldnumThe field identifier number
fmtsprintf style format string
Note
The expanded format string is limited to 255 characters
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.

Parameters
dataThe data object
fieldnumThe field identifier number
valueInteger value for this field
See also
ds_add_data_int8()
ds_add_data_int32()
ds_add_data_int64()
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.

Parameters
dataThe data object
fieldnumThe field identifier number
valueInteger value for this field
See also
ds_add_data_int8()
ds_add_data_int16()
ds_add_data_int64()
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.

Parameters
dataThe data object
fieldnumThe field identifier number
valueInteger value for this field
See also
ds_add_data_int8()
ds_add_data_int16()
ds_add_data_int32()
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.

Parameters
dataThe data object
fieldnumThe field identifier number
valueInteger value for this field
See also
ds_add_data_int16()
ds_add_data_int32()
ds_add_data_int64()
void ds_add_data_str ( ds_data_t data,
int32_t  fieldnum,
const char *  value 
)

Adds a string value to a data object.

Parameters
dataThe data object
fieldnumThe field identifier number
valueString value for this field
See also
ds_add_data()
ds_data_t* ds_clone_data ( ds_data_t data)

Create a clone of a data object.

Parameters
data- Data object to be cloned
Returns
A copy of the input data object
void ds_free_data ( ds_data_t data)

Deallocates the memory used by a data object.

Parameters
dataThe data object to free
ds_data_t* ds_init_data ( const char *  subject,
unsigned short  type,
unsigned short  flags 
)

Initialise a data object for use.

Parameters
subjectThe name of the object
typeThe object's type
flagsThe object's flags
Returns
A ds_data_t object
void ds_set_subject ( ds_data_t data,
const char *  subject 
)

Sets a new name for the data object.

Parameters
dataThe data object
subjectThe 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.


Generated on Wed Jan 24 2018 12:22:46 for DataSource for C SDK