libcollection
0.6.0
|
Macros | |
#define | COL_CLASS_QUEUE 40000 |
Class for the queue object. | |
#define | COL_NAME_QUEUE "queue" |
All queues use this name as the name of the collection. | |
Functions | |
int | col_create_queue (struct collection_item **queue) |
Create queue. More... | |
void | col_destroy_queue (struct collection_item *queue) |
Destroy queue. More... | |
int | col_enqueue_str_property (struct collection_item *queue, const char *property, const char *string, int length) |
Add string to the queue. More... | |
int | col_enqueue_binary_property (struct collection_item *queue, const char *property, void *binary_data, int length) |
Add binary value to the queue. More... | |
int | col_enqueue_int_property (struct collection_item *queue, const char *property, int32_t number) |
Add integer value to the queue. More... | |
int | col_enqueue_unsigned_property (struct collection_item *queue, const char *property, uint32_t number) |
Add unsigned value to the queue. More... | |
int | col_enqueue_long_property (struct collection_item *queue, const char *property, int64_t number) |
Add long integer value to the queue. More... | |
int | col_enqueue_ulong_property (struct collection_item *queue, const char *property, uint64_t number) |
Add unsigned long value to the queue. More... | |
int | col_enqueue_double_property (struct collection_item *queue, const char *property, double number) |
Add floating point value to the queue. More... | |
int | col_enqueue_bool_property (struct collection_item *queue, const char *property, unsigned char logical) |
Add Boolean value to the queue. More... | |
int | col_enqueue_any_property (struct collection_item *queue, const char *property, int type, void *data, int length) |
Add value of any type to the queue. More... | |
int | col_enqueue_item (struct collection_item *queue, struct collection_item *item) |
Push item into the queue. More... | |
int | col_dequeue_item (struct collection_item *queue, struct collection_item **item) |
Get item from the queue. More... | |
Queue interface is a wrapper on top of the COLLECTION interface interface. It implements a queue using a collection object.
int col_create_queue | ( | struct collection_item ** | queue | ) |
Create queue.
Function that creates a queue object.
[out] | queue | Newly created queue object. |
void col_destroy_queue | ( | struct collection_item * | queue | ) |
Destroy queue.
Function that destroys a queue object.
[in] | queue | Queue object to destroy. |
int col_enqueue_str_property | ( | struct collection_item * | queue, |
const char * | property, | ||
const char * | string, | ||
int | length | ||
) |
Add string to the queue.
[in] | queue | Queue object. |
[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_enqueue_binary_property | ( | struct collection_item * | queue, |
const char * | property, | ||
void * | binary_data, | ||
int | length | ||
) |
Add binary value to the queue.
[in] | queue | Queue object. |
[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 binary data. |
int col_enqueue_int_property | ( | struct collection_item * | queue, |
const char * | property, | ||
int32_t | number | ||
) |
Add integer value to the queue.
[in] | queue | Queue object. |
[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 | Value to add. |
int col_enqueue_unsigned_property | ( | struct collection_item * | queue, |
const char * | property, | ||
uint32_t | number | ||
) |
Add unsigned value to the queue.
[in] | queue | Queue object. |
[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 | Value to add. |
int col_enqueue_long_property | ( | struct collection_item * | queue, |
const char * | property, | ||
int64_t | number | ||
) |
Add long integer value to the queue.
[in] | queue | Queue object. |
[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 | Value to add. |
int col_enqueue_ulong_property | ( | struct collection_item * | queue, |
const char * | property, | ||
uint64_t | number | ||
) |
Add unsigned long value to the queue.
[in] | queue | Queue object. |
[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 | Value to add. |
int col_enqueue_double_property | ( | struct collection_item * | queue, |
const char * | property, | ||
double | number | ||
) |
Add floating point value to the queue.
[in] | queue | Queue object. |
[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 | Value to add. |
int col_enqueue_bool_property | ( | struct collection_item * | queue, |
const char * | property, | ||
unsigned char | logical | ||
) |
Add Boolean value to the queue.
[in] | queue | Queue object. |
[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 | Value to add. |
int col_enqueue_any_property | ( | struct collection_item * | queue, |
const char * | property, | ||
int | type, | ||
void * | data, | ||
int | length | ||
) |
Add value of any type to the queue.
[in] | queue | Queue object. |
[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 | Type to use. |
[in] | data | Data to add. |
[in] | length | Length of the data. |
int col_enqueue_item | ( | struct collection_item * | queue, |
struct collection_item * | item | ||
) |
Push item into the queue.
[in] | queue | Queue object. |
[in] | item | Item to push. |
int col_dequeue_item | ( | struct collection_item * | queue, |
struct collection_item ** | item | ||
) |
Get item from the queue.
[in] | queue | Queue object. |
[out] | item | Variable receives the value of the retrieved item. Will be set to NULL if there are no more items in the queue. |