DataSource for C SDK  8.0.4.341990-53978ef8
Adding binary data to objects

Functions

void ds_add_binary (ds_data_t *data, int32_t fieldnum, char *value, int len, char type)
 Adds a binary value to a data object. More...
 
void ds_add_binary_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_binary_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_binary_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_binary_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_binary_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_binary_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_binary_opaque (ds_data_t *data, int32_t fieldnum, char *value, int len)
 Add a value to a data object in the form of an opaque value. More...
 
void ds_add_binary_string (ds_data_t *data, int32_t fieldnum, char *value)
 Add a value to a data object in the form of a string. More...
 
void ds_add_binary_time (ds_data_t *data, int32_t fieldnum, time_t value)
 Add a value to a data object in the form of a timestamp. More...
 
void ds_add_binary_time_millis (ds_data_t *data, int32_t fieldnum, int64_t value)
 Add a value to a data object in the form of a timestamp. More...
 
void ds_add_binary_timespec (ds_data_t *data, int32_t fieldnum, struct timespec value)
 Add a value to a data object in the form of a timestamp. More...
 
void ds_add_binary_timeval (ds_data_t *data, int32_t fieldnum, struct timeval value)
 Add a value to a data object in the form of a timestamp. More...
 
void ds_add_binary_uint16 (ds_data_t *data, int32_t fieldnum, uint16_t value)
 Add a value to a data object in the form of an unsigned 16 bit integer. More...
 
void ds_add_binary_uint32 (ds_data_t *data, int32_t fieldnum, uint32_t value)
 Add a value to a data object in the form of an unsigned 32 bit integer. More...
 
void ds_add_binary_uint64 (ds_data_t *data, int32_t fieldnum, uint64_t value)
 Add a value to a data object in the form of an unsigned 64 bit integer. More...
 
void ds_add_binary_uint8 (ds_data_t *data, int32_t fieldnum, uint8_t value)
 Add a value to a data object in the form of an unsigned 8 bit integer. More...
 

Detailed Description

DataSource can be used for sending binary data. If sending a number, the functions below can be used to take primitive data types and encode their binary representations to Base 64 before sending them to DataSource peers. The client can then decode them to extract the original values.

Function Documentation

void ds_add_binary ( ds_data_t data,
int32_t  fieldnum,
char *  value,
int  len,
char  type 
)

Adds a binary value to a data object.

Parameters
dataThe data object
fieldnumThe field identifier number
valueBinary value to be added
lenLength of binary value (number of characters)
typePrefix character to identify value as Base 64 string
void ds_add_binary_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_binary_float64()
void ds_add_binary_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_binary_float32()
void ds_add_binary_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_binary_int8()
ds_add_binary_int32()
ds_add_binary_int64()
void ds_add_binary_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_binary_int8()
ds_add_binary_int16()
ds_add_binary_int64()
void ds_add_binary_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_binary_int8()
ds_add_binary_int16()
ds_add_binary_int32()
void ds_add_binary_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_binary_int16()
ds_add_binary_int32()
ds_add_binary_int64()
void ds_add_binary_opaque ( ds_data_t data,
int32_t  fieldnum,
char *  value,
int  len 
)

Add a value to a data object in the form of an opaque value.

Parameters
dataThe data object
fieldnumThe field identifier number
valueOpaque binary value for this field
lenLength of the opaque data string
void ds_add_binary_string ( ds_data_t data,
int32_t  fieldnum,
char *  value 
)

Add a value to a data object in the form of a string.

Parameters
dataThe data object
fieldnumThe field identifier number
valueBinary value for this field
void ds_add_binary_time ( ds_data_t data,
int32_t  fieldnum,
time_t  value 
)

Add a value to a data object in the form of a timestamp.

Parameters
dataThe data object
fieldnumThe field identifier number
valueTime to be sent in seconds
void ds_add_binary_time_millis ( ds_data_t data,
int32_t  fieldnum,
int64_t  value 
)

Add a value to a data object in the form of a timestamp.

Parameters
dataThe data object
fieldnumThe field identifier number
valueTime to be sent in milliseconds
void ds_add_binary_timespec ( ds_data_t data,
int32_t  fieldnum,
struct timespec  value 
)

Add a value to a data object in the form of a timestamp.

Parameters
dataThe data object
fieldnumThe field identifier number
valueTime to be sent in nanoseconds
void ds_add_binary_timeval ( ds_data_t data,
int32_t  fieldnum,
struct timeval  value 
)

Add a value to a data object in the form of a timestamp.

Parameters
dataThe data object
fieldnumThe field identifier number
valueTime to be sent in microseconds
void ds_add_binary_uint16 ( ds_data_t data,
int32_t  fieldnum,
uint16_t  value 
)

Add a value to a data object in the form of an unsigned 16 bit integer.

Parameters
dataThe data object
fieldnumThe field identifier number
valueInteger value for this field
See also
ds_add_binary_uint8()
ds_add_binary_uint32()
ds_add_binary_uint64()
void ds_add_binary_uint32 ( ds_data_t data,
int32_t  fieldnum,
uint32_t  value 
)

Add a value to a data object in the form of an unsigned 32 bit integer.

Parameters
dataThe data object
fieldnumThe field identifier number
valueInteger value for this field
See also
ds_add_binary_uint8()
ds_add_binary_uint16()
ds_add_binary_uint64()
void ds_add_binary_uint64 ( ds_data_t data,
int32_t  fieldnum,
uint64_t  value 
)

Add a value to a data object in the form of an unsigned 64 bit integer.

Parameters
dataThe data object
fieldnumThe field identifier number
valueInteger value for this field
See also
ds_add_binary_uint8()
ds_add_binary_uint16()
ds_add_binary_uint32()
void ds_add_binary_uint8 ( ds_data_t data,
int32_t  fieldnum,
uint8_t  value 
)

Add a value to a data object in the form of an unsigned 8 bit integer.

Parameters
dataThe data object
fieldnumThe field identifier number
valueInteger value for this field
See also
ds_add_binary_uint16()
ds_add_binary_uint32()
ds_add_binary_uint64()

Generated on Wed Dec 4 2024 14:56:20 for DataSource for C SDK