libcollection 0.6.2
|
Topics | |
Add properties with reference | |
Functions | |
int | col_add_str_property (struct collection_item *ci, const char *subcollection, const char *property, const char *string, int length) |
Add a string property to a collection. | |
int | col_add_binary_property (struct collection_item *ci, const char *subcollection, const char *property, void *binary_data, int length) |
Add a binary property to a collection. | |
int | col_add_int_property (struct collection_item *ci, const char *subcollection, const char *property, int32_t number) |
Add an integer property to a collection. | |
int | col_add_unsigned_property (struct collection_item *ci, const char *subcollection, const char *property, uint32_t number) |
Add an unsigned integer property to a collection. | |
int | col_add_long_property (struct collection_item *ci, const char *subcollection, const char *property, int64_t number) |
Add an long property to a collection. | |
int | col_add_ulong_property (struct collection_item *ci, const char *subcollection, const char *property, uint64_t number) |
Add an unsigned long property to a collection. | |
int | col_add_double_property (struct collection_item *ci, const char *subcollection, const char *property, double number) |
Add a property of type double to a collection. | |
int | col_add_bool_property (struct collection_item *ci, const char *subcollection, const char *property, unsigned char logical) |
Add a Boolean property to a collection. | |
int | col_add_any_property (struct collection_item *ci, const char *subcollection, const char *property, int type, void *data, int length) |
Add a property of a specified type to a collection. | |
Functions in this section add properties to a collection.
All the functions in this section add a property of the specified type to the collection object. They are convenience wrappers around the col_insert_xxx_property functions. They always append property to the end of the collection.
Common parameters for these functions are:
[in] | ci | Root collection object. |
[in] | subcollection | Name of the inner collection to add property to. If NULL the property is added to the root collection. |
[in] | property | Name of the property. Name should consist of the ASCII characters with codes non less than space. Exclamation mark character is a special character and can't be used in name of collection or property. Maximum allowed length is defined at compile time. The default value is 64k. |
int col_add_str_property | ( | struct collection_item * | ci, |
const char * | subcollection, | ||
const char * | property, | ||
const char * | string, | ||
int | length ) |
Add a string property to a collection.
[in] | ci | Root collection object. |
[in] | subcollection | Name of the inner collection to add property to. If NULL the property is added to the root collection. |
[in] | property | Name of the property. Name should consist of the ASCII characters with codes non less than space. Exclamation mark character is a special character and can't be used in name of collection or property. Maximum allowed length is defined at compile time. The default value is 64k. |
[in] | string | Null terminated string to add. |
[in] | length | Length of the string. Should include the length of the terminating 0. If the length is shorter than the full string the string will be truncated. If the length is longer than the actual string there might be garbage at end of the actual string. Library will always properly NULL terminate the string at the given position dictated by length but in no way will inspect the validity of the passed in data. This is left to the calling application. |
int col_add_binary_property | ( | struct collection_item * | ci, |
const char * | subcollection, | ||
const char * | property, | ||
void * | binary_data, | ||
int | length ) |
Add a binary property to a collection.
[in] | ci | Root collection object. |
[in] | subcollection | Name of the inner collection to add property to. If NULL the property is added to the root collection. |
[in] | property | Name of the property. Name should consist of the ASCII characters with codes non less than space. Exclamation mark character is a special character and can't be used in name of collection or property. Maximum allowed length is defined at compile time. The default value is 64k. |
[in] | binary_data | Data to add. |
[in] | length | Length of the data. |
int col_add_int_property | ( | struct collection_item * | ci, |
const char * | subcollection, | ||
const char * | property, | ||
int32_t | number ) |
Add an integer property to a collection.
[in] | ci | Root collection object. |
[in] | subcollection | Name of the inner collection to add property to. If NULL the property is added to the root collection. |
[in] | property | Name of the property. Name should consist of the ASCII characters with codes non less than space. Exclamation mark character is a special character and can't be used in name of collection or property. Maximum allowed length is defined at compile time. The default value is 64k. |
[in] | number | Integer value to add. Value is signed. |
int col_add_unsigned_property | ( | struct collection_item * | ci, |
const char * | subcollection, | ||
const char * | property, | ||
uint32_t | number ) |
Add an unsigned integer property to a collection.
[in] | ci | Root collection object. |
[in] | subcollection | Name of the inner collection to add property to. If NULL the property is added to the root collection. |
[in] | property | Name of the property. Name should consist of the ASCII characters with codes non less than space. Exclamation mark character is a special character and can't be used in name of collection or property. Maximum allowed length is defined at compile time. The default value is 64k. |
[in] | number | Unsigned integer value to add. |
int col_add_long_property | ( | struct collection_item * | ci, |
const char * | subcollection, | ||
const char * | property, | ||
int64_t | number ) |
Add an long property to a collection.
[in] | ci | Root collection object. |
[in] | subcollection | Name of the inner collection to add property to. If NULL the property is added to the root collection. |
[in] | property | Name of the property. Name should consist of the ASCII characters with codes non less than space. Exclamation mark character is a special character and can't be used in name of collection or property. Maximum allowed length is defined at compile time. The default value is 64k. |
[in] | number | Long integer value to add. Value is signed. |
int col_add_ulong_property | ( | struct collection_item * | ci, |
const char * | subcollection, | ||
const char * | property, | ||
uint64_t | number ) |
Add an unsigned long property to a collection.
[in] | ci | Root collection object. |
[in] | subcollection | Name of the inner collection to add property to. If NULL the property is added to the root collection. |
[in] | property | Name of the property. Name should consist of the ASCII characters with codes non less than space. Exclamation mark character is a special character and can't be used in name of collection or property. Maximum allowed length is defined at compile time. The default value is 64k. |
[in] | number | Unsigned long integer value to add. |
int col_add_double_property | ( | struct collection_item * | ci, |
const char * | subcollection, | ||
const char * | property, | ||
double | number ) |
Add a property of type double to a collection.
[in] | ci | Root collection object. |
[in] | subcollection | Name of the inner collection to add property to. If NULL the property is added to the root collection. |
[in] | property | Name of the property. Name should consist of the ASCII characters with codes non less than space. Exclamation mark character is a special character and can't be used in name of collection or property. Maximum allowed length is defined at compile time. The default value is 64k. |
[in] | number | Floating point value. |
int col_add_bool_property | ( | struct collection_item * | ci, |
const char * | subcollection, | ||
const char * | property, | ||
unsigned char | logical ) |
Add a Boolean property to a collection.
[in] | ci | Root collection object. |
[in] | subcollection | Name of the inner collection to add property to. If NULL the property is added to the root collection. |
[in] | property | Name of the property. Name should consist of the ASCII characters with codes non less than space. Exclamation mark character is a special character and can't be used in name of collection or property. Maximum allowed length is defined at compile time. The default value is 64k. |
[in] | logical | Boolean value. 0 - false, nonzero - true. |
int col_add_any_property | ( | struct collection_item * | ci, |
const char * | subcollection, | ||
const char * | property, | ||
int | type, | ||
void * | data, | ||
int | length ) |
Add a property of a specified type to a collection.
[in] | ci | Root collection object. |
[in] | subcollection | Name of the inner collection to add property to. If NULL the property is added to the root collection. |
[in] | property | Name of the property. Name should consist of the ASCII characters with codes non less than space. Exclamation mark character is a special character and can't be used in name of collection or property. Maximum allowed length is defined at compile time. The default value is 64k. |
[in] | type | See type definitions here. |
[in] | data | Data to add. |
[in] | length | Length of the data. |