Data Structures | |
struct | col_serial_data |
Structure is used to incrementaly serialize collection. More... | |
Defines | |
#define | COL_TYPE_NAME_STRING "string" |
Name used for string type. | |
#define | COL_TYPE_NAME_BINARY "bin" |
Name used for binary type. | |
#define | COL_TYPE_NAME_INTEGER "int" |
Name used for integer type. | |
#define | COL_TYPE_NAME_UNSIGNED "uint" |
Name used for unsigned integer type. | |
#define | COL_TYPE_NAME_LONG "long" |
Name used for long type. | |
#define | COL_TYPE_NAME_ULONG "ulong" |
Name used for unsigned long type. | |
#define | COL_TYPE_NAME_DOUBLE "double" |
Name used for floating point type. | |
#define | COL_TYPE_NAME_BOOL "bool" |
Name used for boolean type. | |
#define | COL_TYPE_NAME_UNKNOWN "unknown" |
Name used for unknown type. | |
#define | TEXT_COLLECTION "SET" |
Literal used in the default serialization. | |
#define | TEXT_COLLEN 3 |
Length of the TEXT_COLLECTION literal. | |
#define | BLOCK_SIZE 1024 |
The data will be allocated in BLOCK_SIZE blocks during serialization. | |
Functions | |
int | col_get_data_len (int type, int length) |
Calculate the potential size of the item. | |
int | col_grow_buffer (struct col_serial_data *buf_data, int len) |
Grow serialization buffer. | |
int | col_put_marker (struct col_serial_data *buf_data, const void *data, int len) |
Add special data to the serialization output. | |
int | col_serialize (const char *property_in, int property_len_in, int type, void *data_in, int length_in, void *custom_data, int *dummy) |
Serialization of data callback. | |
int | col_debug_handle (const char *property, int property_len, int type, void *data, int length, void *custom_data, int *dummy) |
Debug property callback. | |
int | col_debug_item (struct collection_item *item) |
Convenience function to debug an item. | |
int | col_debug_collection (struct collection_item *handle, int flag) |
Print collection for debugging purposes. | |
int | col_print_collection (struct collection_item *handle) |
Print collection data. | |
int | col_print_collection2 (struct collection_item *handle) |
Print collection data. | |
int | col_print_item (struct collection_item *handle, const char *name) |
Find and print one property. | |
char ** | col_collection_to_list (struct collection_item *handle, int *size, int *error) |
Convert collection to the array of properties. | |
void | col_free_property_list (char **str_list) |
Free list of properties. |
Additional functions retaed to tracing, printing, debugging and serializaing collections.
Functions in this module are more a sample implementation than a part of the interface. There is a chance they will change over time.
char** col_collection_to_list | ( | struct collection_item * | handle, | |
int * | size, | |||
int * | error | |||
) |
Convert collection to the array of properties.
[in] | handle | Collection to convert. |
[in] | size | Will receive the number of the strings in the array. Can be NULL if caller is not interested in the size of the array. |
[in] | error | Will receive error value if any. Can be NULL if the caller does not care about error codes.
|
int col_debug_collection | ( | struct collection_item * | handle, | |
int | flag | |||
) |
Print collection for debugging purposes.
Prints collection internals.
[in] | handle | Collection to debug. |
[in] | flag | See traverse flags. |
int col_debug_handle | ( | const char * | property, | |
int | property_len, | |||
int | type, | |||
void * | data, | |||
int | length, | |||
void * | custom_data, | |||
int * | dummy | |||
) |
Debug property callback.
[in] | property | Property to debug. |
[in] | property_len | Length of the property to debug. |
[in] | type | Type of the value. |
[in] | data | Value to serialize. |
[in] | length | Length of the value. |
[in] | custom_data | State data passed to the callback. |
[in] | dummy | Not used. It is here because the callback needs to comply to the functions signature. |
int col_debug_item | ( | struct collection_item * | item | ) | [inline] |
Convenience function to debug an item.
Prints item internals.
[in] | item | Item to print. |
void col_free_property_list | ( | char ** | str_list | ) |
Free list of properties.
[in] | str_list | List to free. |
int col_get_data_len | ( | int | type, | |
int | length | |||
) |
Calculate the potential size of the item.
[in] | type | Type of the value. |
[in] | length | Length of the value. |
int col_grow_buffer | ( | struct col_serial_data * | buf_data, | |
int | len | |||
) |
Grow serialization buffer.
[in] | buf_data | Serialization object. |
[in] | len | For how much the serialization storage should be incrementally increased. |
int col_print_collection | ( | struct collection_item * | handle | ) |
Print collection data.
Prints collection data. Uses traverse function to iterate through the collection.
[in] | handle | Collection to print. |
int col_print_collection2 | ( | struct collection_item * | handle | ) |
Print collection data.
Prints collection data. Uses iterator to process the collection.
[in] | handle | Collection to print. |
int col_print_item | ( | struct collection_item * | handle, | |
const char * | name | |||
) |
Find and print one property.
Prints item data.
[in] | handle | Collection to search. |
[in] | name | Item to find and print. |
int col_put_marker | ( | struct col_serial_data * | buf_data, | |
const void * | data, | |||
int | len | |||
) |
Add special data to the serialization output.
[in] | buf_data | Serialization object. |
[in] | data | Pointer to special data. |
[in] | len | Length of the data to insert. |
int col_serialize | ( | const char * | property_in, | |
int | property_len_in, | |||
int | type, | |||
void * | data_in, | |||
int | length_in, | |||
void * | custom_data, | |||
int * | dummy | |||
) |
Serialization of data callback.
[in] | property_in | Property to serialize. |
[in] | property_len_in | Length of the property to serialize. |
[in] | type | Type of the value. |
[in] | data_in | Value to serialize. |
[in] | length_in | Length of the value. |
[in] | custom_data | State data passed to callback. It is actually a serialization object. |
[in] | dummy | Not used. It is here because the callback needs to comply to the functions signature. |