libcollection 0.6.2
|
Macros | |
#define | COL_CLASS_STACK 30000 |
Class for the stack object. | |
#define | COL_NAME_STACK "stack" |
All stacks use this name as the name of the collection. | |
Functions | |
int | col_create_stack (struct collection_item **stack) |
Create stack. | |
void | col_destroy_stack (struct collection_item *stack) |
Destroy stack. | |
int | col_push_str_property (struct collection_item *stack, const char *property, const char *string, int length) |
Push string to the stack. | |
int | col_push_binary_property (struct collection_item *stack, const char *property, void *binary_data, int length) |
Push binary value to the stack. | |
int | col_push_int_property (struct collection_item *stack, const char *property, int32_t number) |
Push integer value to the stack. | |
int | col_push_unsigned_property (struct collection_item *stack, const char *property, uint32_t number) |
Push unsigned value to the stack. | |
int | col_push_long_property (struct collection_item *stack, const char *property, int64_t number) |
Push long integer value to the stack. | |
int | col_push_ulong_property (struct collection_item *stack, const char *property, uint64_t number) |
Push unsigned long value to the stack. | |
int | col_push_double_property (struct collection_item *stack, const char *property, double number) |
Push floating point value to the stack. | |
int | col_push_bool_property (struct collection_item *stack, const char *property, unsigned char logical) |
Push Boolean value to the stack. | |
int | col_push_any_property (struct collection_item *stack, const char *property, int type, void *data, int length) |
Push value of any type to the stack. | |
int | col_push_item (struct collection_item *stack, struct collection_item *item) |
Push item into the stack. | |
int | col_pop_item (struct collection_item *stack, struct collection_item **item) |
Pop item from the stack. | |
Stack interface is a wrapper on top of the COLLECTION interface interface. It implements a stack using a collection object.
int col_create_stack | ( | struct collection_item ** | stack | ) |
Create stack.
Function that creates a stack object.
[out] | stack | Newly created stack object. |
void col_destroy_stack | ( | struct collection_item * | stack | ) |
Destroy stack.
Function that destroys a stack object.
[in] | stack | Stack object to destroy. |
int col_push_str_property | ( | struct collection_item * | stack, |
const char * | property, | ||
const char * | string, | ||
int | length | ||
) |
Push string to the stack.
[in] | stack | Stack 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_push_binary_property | ( | struct collection_item * | stack, |
const char * | property, | ||
void * | binary_data, | ||
int | length | ||
) |
Push binary value to the stack.
[in] | stack | Stack 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_push_int_property | ( | struct collection_item * | stack, |
const char * | property, | ||
int32_t | number | ||
) |
Push integer value to the stack.
[in] | stack | Stack 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_push_unsigned_property | ( | struct collection_item * | stack, |
const char * | property, | ||
uint32_t | number | ||
) |
Push unsigned value to the stack.
[in] | stack | Stack 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_push_long_property | ( | struct collection_item * | stack, |
const char * | property, | ||
int64_t | number | ||
) |
Push long integer value to the stack.
[in] | stack | Stack 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_push_ulong_property | ( | struct collection_item * | stack, |
const char * | property, | ||
uint64_t | number | ||
) |
Push unsigned long value to the stack.
[in] | stack | Stack 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_push_double_property | ( | struct collection_item * | stack, |
const char * | property, | ||
double | number | ||
) |
Push floating point value to the stack.
[in] | stack | Stack 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_push_bool_property | ( | struct collection_item * | stack, |
const char * | property, | ||
unsigned char | logical | ||
) |
Push Boolean value to the stack.
[in] | stack | Stack 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_push_any_property | ( | struct collection_item * | stack, |
const char * | property, | ||
int | type, | ||
void * | data, | ||
int | length | ||
) |
Push value of any type to the stack.
[in] | stack | Stack 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_push_item | ( | struct collection_item * | stack, |
struct collection_item * | item | ||
) |
Push item into the stack.
[in] | stack | Stack object. |
[in] | item | Item to push. |
int col_pop_item | ( | struct collection_item * | stack, |
struct collection_item ** | item | ||
) |
Pop item from the stack.
[in] | stack | Stack object. |
[out] | item | Variable receives the value of the retrieved item. Will be set to NULL if there are no more items in the stack. |