120 #define COL_CLASS_DEFAULT 0
127 #define COL_NOMATCH 0
145 #define COL_TYPE_STRING 0x00000001
147 #define COL_TYPE_BINARY 0x00000002
149 #define COL_TYPE_INTEGER 0x00000004
151 #define COL_TYPE_UNSIGNED 0x00000008
153 #define COL_TYPE_LONG 0x00000010
155 #define COL_TYPE_ULONG 0x00000020
157 #define COL_TYPE_DOUBLE 0x00000040
159 #define COL_TYPE_BOOL 0x00000080
166 #define COL_TYPE_COLLECTION 0x00000100
173 #define COL_TYPE_COLLECTIONREF 0x00000200
179 #define COL_TYPE_END 0x10000000
186 #define COL_TYPE_ANY 0x0FFFFFFF
200 #define COL_ADD_MODE_REFERENCE 0
211 #define COL_ADD_MODE_EMBED 1
217 #define COL_ADD_MODE_CLONE 2
225 #define COL_ADD_MODE_FLAT 3
238 #define COL_ADD_MODE_FLATDOT 4
261 #define COL_TRAVERSE_DEFAULT 0x00000000
269 #define COL_TRAVERSE_ONELEVEL 0x00000001
280 #define COL_TRAVERSE_END 0x00000002
282 #define COL_TRAVERSE_IGNORE 0x00000004
296 #define COL_TRAVERSE_FLAT 0x00000008
322 #define COL_TRAVERSE_SHOWSUB 0x00010000
330 #define COL_TRAVERSE_ONLYSUB 0x00020000
353 #define COL_COPY_NORMAL 0
359 #define COL_COPY_FLAT 1
365 #define COL_COPY_FLATDOT 2
367 #define COL_COPY_KEEPREF 3
369 #define COL_COPY_TOP 4
385 #define COL_SORT_ASC 0x00000000
387 #define COL_SORT_DESC 0x00000001
389 #define COL_SORT_SUB 0x00000002
395 #define COL_SORT_MYSUB 0x00000004
402 #ifndef COLLECTION_PRIV_H
596 const char *name_to_use,
620 const char *name_to_use,
655 const char *subcollection,
656 const char *as_property,
754 const char *property_to_find,
799 const char *property_to_find,
835 unsigned sort_flags);
869 const char *property_to_find,
898 const char *property_to_find,
926 const char *col_to_find);
1111 const char *subcollection,
1112 const char *property,
1143 const char *subcollection,
1144 const char *property,
1174 const char *subcollection,
1175 const char *property,
1204 const char *subcollection,
1205 const char *property,
1234 const char *subcollection,
1235 const char *property,
1264 const char *subcollection,
1265 const char *property,
1294 const char *subcollection,
1295 const char *property,
1323 const char *subcollection,
1324 const char *property,
1325 unsigned char logical);
1356 const char *subcollection,
1357 const char *property,
1422 const char *subcollection,
1423 const char *property,
1424 char *
string,
int length,
1456 const char *subcollection,
1457 const char *property,
1458 void *binary_data,
int length,
1489 const char *subcollection,
1490 const char *property, int32_t number,
1521 const char *subcollection,
1522 const char *property, uint32_t number,
1553 const char *subcollection,
1554 const char *property, int64_t number,
1585 const char *subcollection,
1586 const char *property, uint64_t number,
1617 const char *subcollection,
1618 const char *property,
double number,
1649 const char *subcollection,
1650 const char *property,
unsigned char logical,
1684 const char *subcollection,
1685 const char *property,
1686 int type,
void *data,
int length,
1744 const char *subcollection,
1746 const char *refprop,
1749 const char *property,
1755 const char *subcollection,
1757 const char *refprop,
1760 const char *property,
1766 const char *subcollection,
1768 const char *refprop,
1771 const char *property,
1776 const char *subcollection,
1778 const char *refprop,
1781 const char *property,
1786 const char *subcollection,
1788 const char *refprop,
1791 const char *property,
1796 const char *subcollection,
1798 const char *refprop,
1801 const char *property,
1806 const char *subcollection,
1808 const char *refprop,
1811 const char *property,
1816 const char *subcollection,
1818 const char *refprop,
1821 const char *property,
1822 unsigned char logical);
1826 const char *subcollection,
1828 const char *refprop,
1831 const char *property,
1838 const char *subcollection,
1840 const char *refprop,
1843 const char *property,
1850 const char *subcollection,
1852 const char *refprop,
1855 const char *property,
1861 const char *subcollection,
1863 const char *refprop,
1866 const char *property,
1872 const char *subcollection,
1874 const char *refprop,
1877 const char *property,
1883 const char *subcollection,
1885 const char *refprop,
1888 const char *property,
1897 const char *subcollection,
1899 const char *refprop,
1902 const char *property,
1908 const char *subcollection,
1910 const char *refprop,
1913 const char *property,
1914 unsigned char logical,
1919 const char *subcollection,
1921 const char *refprop,
1924 const char *property,
1980 const char *property,
1988 const char *property,
1996 const char *property,
2003 const char *property,
2010 const char *property,
2017 const char *property,
2024 const char *property,
2031 const char *property,
2033 unsigned char logical);
2043 const char *property,
2081 #define COL_CMPIN_PROP_EQU 0x000000004
2083 #define COL_CMPIN_PROP_BEG 0x000000005
2085 #define COL_CMPIN_PROP_MID 0x000000006
2087 #define COL_CMPIN_PROP_END 0x000000007
2100 #define COL_CMPIN_PROP_DOT 0x000000008
2103 #define COL_CMPIN_PROP_LEN 0x000000010
2106 #define COL_CMPIN_TYPE 0x000000020
2109 #define COL_CMPIN_DATA_LEN 0x000000040
2119 #define COL_CMPIN_DATA 0x000000080
2141 #define COL_CMPOUT_PROP_STR 0x00000001
2149 #define COL_CMPOUT_PROP_LEN 0x00000002
2156 #define COL_CMPOUT_DATA_LEN 0x00000004
2165 #define COL_CMPOUT_DATA 0x00000008
2192 #define COL_DSP_END 0
2203 #define COL_DSP_FRONT 1
2216 #define COL_DSP_BEFORE 2
2229 #define COL_DSP_AFTER 3
2248 #define COL_DSP_INDEX 4
2266 #define COL_DSP_FIRSTDUP 5
2286 #define COL_DSP_LASTDUP 6
2316 #define COL_DSP_NDUP 7
2336 #define COL_INSERT_NOCHECK 0
2341 #define COL_INSERT_DUPOVER 1
2346 #define COL_INSERT_DUPOVERT 2
2348 #define COL_INSERT_DUPERROR 3
2353 #define COL_INSERT_DUPERRORT 4
2357 #define COL_INSERT_DUPMOVE 5
2361 #define COL_INSERT_DUPMOVET 6
2479 uint64_t
col_make_hash(
const char *
string,
int sub_len,
int *length);
2511 unsigned *out_flags);
2550 const char *property,
2573 const char *property);
2589 const char *property,
2603 const char *property,
2617 const char *property,
2618 unsigned char logical);
2630 const char *property,
2643 const char *property,
2656 const char *property,
2669 const char *property,
2682 const char *property,
2749 const char *subcollection,
2751 const char *refprop,
2798 const char *refprop,
2851 const char *subcollection,
2853 const char *refprop,
2898 const char *refprop,
2962 const char *subcollection,
2965 const char *refprop,
3012 const char *refprop,
int col_update_property(struct collection_item *ci, const char *property, int type, void *new_data, int length, int mode_flags)
Definition: collection.c:2864
int col_add_binary_property_with_ref(struct collection_item *ci, const char *subcollection, const char *property, void *binary_data, int length, struct collection_item **ret_ref)
Add a binary property to a collection.
Definition: collection_cnv.c:786
void col_unbind_iterator(struct collection_iterator *iterator)
Unbind the iterator from the collection.
Definition: collection_iter.c:187
int col_remove_item_from_current(struct collection_item *ci, int disposition, const char *refprop, int idx, int type)
Remove item from the current collection.
Definition: collection.c:899
int col_add_collection_to_collection(struct collection_item *ci, const char *subcollection, const char *as_property, struct collection_item *ci_to_add, int mode)
Add collection to collection.
Definition: collection.c:2501
int col_create_collection(struct collection_item **ci, const char *name, unsigned cclass)
Create a collection.
Definition: collection.c:2226
void col_destroy_collection(struct collection_item *ci)
Destroy a collection.
Definition: collection.c:2305
int col_get_collection_count(struct collection_item *ci, unsigned *count)
Get count of the elements.
Definition: collection.c:3000
int col_get_collection_class(struct collection_item *ci, unsigned *cclass)
Get collection class.
Definition: collection.c:2981
int col_modify_int_item(struct collection_item *item, const char *property, int32_t number)
Modify item value to be an integer.
Definition: collection_cnv.c:1197
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.
Definition: collection_cnv.c:543
int col_modify_unsigned_item(struct collection_item *item, const char *property, uint32_t number)
Modify item value to be an unsigned integer.
Definition: collection_cnv.c:1244
int(* col_copy_cb)(struct collection_item *item, void *ext_data, int *skip)
Copy item callback.
Definition: collection.h:564
int col_extract_item(struct collection_item *ci, const char *subcollection, int disposition, const char *refprop, int idx, int type, struct collection_item **ret_ref)
Extract item from the collection.
Definition: collection.c:805
int col_insert_int_property(struct collection_item *ci, const char *subcollection, int disposition, const char *refprop, int idx, unsigned flags, const char *property, int32_t number)
Insert an integer property.
Definition: collection_cnv.c:102
int col_insert_ulong_property(struct collection_item *ci, const char *subcollection, int disposition, const char *refprop, int idx, unsigned flags, const char *property, uint64_t number)
Insert an unsigned long property.
Definition: collection_cnv.c:194
int col_bind_iterator(struct collection_iterator **iterator, struct collection_item *ci, int mode_flags)
Bind iterator to a collection.
Definition: collection_iter.c:62
int col_insert_long_property(struct collection_item *ci, const char *subcollection, int disposition, const char *refprop, int idx, unsigned flags, const char *property, int64_t number)
Insert a long property.
Definition: collection_cnv.c:164
uint64_t col_make_hash(const char *string, int sub_len, int *length)
Calculate hash value for a string.
Definition: collection.c:3072
int col_get_item(struct collection_item *ci, const char *property_to_find, int type, int mode_flags, struct collection_item **item)
Search function to get an item.
Definition: collection.c:2817
Opaque iterator structure.
Definition: collection.h:418
int col_set_collection_class(struct collection_item *ci, unsigned cclass)
Set collection class.
Definition: collection.c:2962
int col_insert_item_into_current(struct collection_item *ci, struct collection_item *item, int disposition, const char *refprop, int idx, unsigned flags)
Insert item to the current collection.
Definition: collection.c:362
int col_insert_double_property(struct collection_item *ci, const char *subcollection, int disposition, const char *refprop, int idx, unsigned flags, const char *property, double number)
Insert a property with a floating point value.
Definition: collection_cnv.c:224
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.
Definition: collection_cnv.c:663
int col_modify_item(struct collection_item *item, const char *property, int type, const void *data, int length)
Modify any item element.
Definition: collection.c:2894
int col_sort_collection(struct collection_item *col, unsigned cmp_flags, unsigned sort_flags)
Sort collection.
Definition: collection_cmp.c:296
int col_add_int_property_with_ref(struct collection_item *ci, const char *subcollection, const char *property, int32_t number, struct collection_item **ret_ref)
Add an integer property to a collection.
Definition: collection_cnv.c:812
int col_insert_item(struct collection_item *ci, const char *subcollection, struct collection_item *item, int disposition, const char *refprop, int idx, unsigned flags)
Insert item to the collection.
Definition: collection.c:923
int col_update_bool_property(struct collection_item *ci, const char *property, int mode_flags, unsigned char logical)
Definition: collection_cnv.c:1113
int col_insert_str_property(struct collection_item *ci, const char *subcollection, int disposition, const char *refprop, int idx, unsigned flags, const char *property, const char *string, int length)
Insert a string property.
Definition: collection_cnv.c:37
int col_remove_item(struct collection_item *ci, const char *subcollection, int disposition, const char *refprop, int idx, int type)
Remove item from the collection.
Definition: collection.c:865
int col_get_item_type(struct collection_item *ci)
Get item type.
Definition: collection.c:3044
int col_modify_str_item(struct collection_item *item, const char *property, const char *string, int length)
Modify item value to be a string.
Definition: collection_cnv.c:1145
int col_is_of_class(struct collection_item *ci, unsigned cclass)
Check the class of collection.
Definition: collection.c:3021
int col_get_iterator_depth(struct collection_iterator *iterator, int *depth)
Get current depth.
Definition: collection_iter.c:151
int col_extract_item_from_current(struct collection_item *ci, int disposition, const char *refprop, int idx, int type, struct collection_item **ret_ref)
Extract item from the current collection.
Definition: collection.c:622
int col_modify_binary_item(struct collection_item *item, const char *property, void *binary_data, int length)
Modify item value to be a binary blob.
Definition: collection_cnv.c:1166
int col_insert_bool_property_with_ref(struct collection_item *ci, const char *subcollection, int disposition, const char *refprop, int idx, unsigned flags, const char *property, unsigned char logical, struct collection_item **ret_ref)
Insert a property with a Boolean value and get back a reference.
Definition: collection_cnv.c:511
int col_modify_ulong_item(struct collection_item *item, const char *property, uint64_t number)
Modify item value to be an unsigned long.
Definition: collection_cnv.c:1229
int col_insert_property_with_ref(struct collection_item *ci, const char *subcollection, int disposition, const char *refprop, int idx, unsigned flags, const char *property, int type, const void *data, int length, struct collection_item **ret_ref)
Insert property of any type and get back a reference.
Definition: collection.c:1098
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.
Definition: collection_cnv.c:686
int col_update_unsigned_property(struct collection_item *ci, const char *property, int mode_flags, uint32_t number)
Definition: collection_cnv.c:1044
int col_get_reference_from_item(struct collection_item *item, struct collection_item **acceptor)
Get a reference from the item.
Definition: collection.c:2470
int col_get_item_and_do(struct collection_item *ci, const char *property_to_find, int type, int mode_flags, col_item_fn item_handler, void *custom_data)
Search and do function.
Definition: collection.c:2794
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.
Definition: collection_cnv.c:639
int col_delete_property(struct collection_item *ci, const char *property_to_find, int type, int mode_flags)
Delete property.
Definition: collection.c:2839
int(* col_item_fn)(const char *property, int property_len, int type, void *data, int length, void *custom_data, int *stop)
Search Callback.
Definition: collection.h:685
void col_destroy_collection_with_cb(struct collection_item *ci, col_item_cleanup_fn cb, void *custom_data)
Destroy a collection with callback.
Definition: collection.c:2267
int col_get_item_length(struct collection_item *ci)
Get value length from the item.
Definition: collection.c:3050
int col_modify_item_property(struct collection_item *item, const char *property)
Modify item property.
Definition: collection_cnv.c:1130
int col_insert_unsinged_property(struct collection_item *ci, const char *subcollection, int disposition, const char *refprop, int idx, unsigned flags, const char *property, uint32_t number)
Insert an unsigned property.
int col_update_int_property(struct collection_item *ci, const char *property, int mode_flags, int32_t number)
Definition: collection_cnv.c:1028
int col_get_item_depth(struct collection_iterator *iterator, int *depth)
Get depth of the last returned item.
Definition: collection_iter.c:168
int col_insert_ulong_property_with_ref(struct collection_item *ci, const char *subcollection, int disposition, const char *refprop, int idx, unsigned flags, const char *property, uint64_t number, struct collection_item **ret_ref)
Insert an unsigned long property and get back a reference.
Definition: collection_cnv.c:449
Opaque structure that holds one property.
int col_traverse_collection(struct collection_item *ci, int mode_flags, col_item_fn item_handler, void *custom_data)
Traverse collection.
Definition: collection.c:2738
uint64_t col_get_item_hash(struct collection_item *ci)
Get hash value from the item.
Definition: collection.c:3062
void(* col_item_cleanup_fn)(const char *property, int property_len, int type, void *data, int length, void *custom_data)
Cleanup Callback.
Definition: collection.h:508
int col_get_collection_reference(struct collection_item *ci, struct collection_item **acceptor, const char *col_to_find)
Get a reference to a collection.
Definition: collection.c:2415
int col_iterate_up(struct collection_iterator *iterator, unsigned level)
Move up.
Definition: collection_iter.c:127
int col_update_long_property(struct collection_item *ci, const char *property, int mode_flags, int64_t number)
Definition: collection_cnv.c:1061
int col_insert_unsinged_property_with_ref(struct collection_item *ci, const char *subcollection, int disposition, const char *refprop, int idx, unsigned flags, const char *property, uint32_t number, struct collection_item **ret_ref)
Insert an unsigned property and get back a reference.
int col_insert_str_property_with_ref(struct collection_item *ci, const char *subcollection, int disposition, const char *refprop, int idx, unsigned flags, const char *property, const char *string, int length, struct collection_item **ret_ref)
Insert a string property and get back a reference.
Definition: collection_cnv.c:285
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.
Definition: collection_cnv.c:593
int col_insert_int_property_with_ref(struct collection_item *ci, const char *subcollection, int disposition, const char *refprop, int idx, unsigned flags, const char *property, int32_t number, struct collection_item **ret_ref)
Insert an integer property and get back a reference.
Definition: collection_cnv.c:355
int col_update_binary_property(struct collection_item *ci, const char *property, int mode_flags, void *binary_data, int length)
Definition: collection_cnv.c:1011
int col_copy_collection(struct collection_item **col_copy, struct collection_item *col_to_copy, const char *name_to_use, int copy_mode)
Copy collection without data modification.
Definition: collection.c:2317
int col_is_item_in_collection(struct collection_item *ci, const char *property_to_find, int type, int mode_flags, int *found)
Is property in the collection?
Definition: collection.c:2769
int col_modify_double_item(struct collection_item *item, const char *property, double number)
Modify item value to be a floating point.
Definition: collection_cnv.c:1259
int col_update_double_property(struct collection_item *ci, const char *property, int mode_flags, double number)
Definition: collection_cnv.c:1096
int col_iterate_collection(struct collection_iterator *iterator, struct collection_item **item)
Iterate collection.
Definition: collection_iter.c:200
int col_insert_double_property_with_ref(struct collection_item *ci, const char *subcollection, int disposition, const char *refprop, int idx, unsigned flags, const char *property, double number, struct collection_item **ret_ref)
Insert a property with a floating point value and get back a reference.
Definition: collection_cnv.c:480
void * col_get_item_data(struct collection_item *ci)
Get value from the item.
Definition: collection.c:3056
void col_pin_iterator(struct collection_iterator *iterator)
Pin iterator.
Definition: collection_iter.c:381
int col_add_any_property_with_ref(struct collection_item *ci, const char *subcollection, const char *property, int type, void *data, int length, struct collection_item **ret_ref)
Add a property of a specified type to a collection.
Definition: collection_cnv.c:962
void col_delete_item(struct collection_item *item)
Delete extracted item.
Definition: collection.c:217
int col_modify_long_item(struct collection_item *item, const char *property, int64_t number)
Modify item value to be a long integer.
Definition: collection_cnv.c:1213
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.
Definition: collection_cnv.c:616
int col_insert_binary_property_with_ref(struct collection_item *ci, const char *subcollection, int disposition, const char *refprop, int idx, unsigned flags, const char *property, void *binary_data, int length, struct collection_item **ret_ref)
Insert a binary property and get back a reference.
Definition: collection_cnv.c:323
int col_add_long_property_with_ref(struct collection_item *ci, const char *subcollection, const char *property, int64_t number, struct collection_item **ret_ref)
Add an long property to a collection.
Definition: collection_cnv.c:862
int col_insert_long_property_with_ref(struct collection_item *ci, const char *subcollection, int disposition, const char *refprop, int idx, unsigned flags, const char *property, int64_t number, struct collection_item **ret_ref)
Insert a long property and get back a reference.
Definition: collection_cnv.c:418
int col_update_ulong_property(struct collection_item *ci, const char *property, int mode_flags, uint64_t number)
Definition: collection_cnv.c:1079
int col_add_double_property_with_ref(struct collection_item *ci, const char *subcollection, const char *property, double number, struct collection_item **ret_ref)
Add a property of type double to a collection.
Definition: collection_cnv.c:912
int col_update_str_property(struct collection_item *ci, const char *property, int mode_flags, char *string, int length)
Definition: collection_cnv.c:993
const char * col_get_item_property(struct collection_item *ci, int *property_len)
Get item property.
Definition: collection.c:3036
int col_insert_binary_property(struct collection_item *ci, const char *subcollection, int disposition, const char *refprop, int idx, unsigned flags, const char *property, void *binary_data, int length)
Insert a binary property.
Definition: collection_cnv.c:70
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.
Definition: collection_cnv.c:732
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.
Definition: collection_cnv.c:709
int col_insert_bool_property(struct collection_item *ci, const char *subcollection, int disposition, const char *refprop, int idx, unsigned flags, const char *property, unsigned char logical)
Insert a property with a Boolean value.
Definition: collection_cnv.c:254
int col_add_str_property_with_ref(struct collection_item *ci, const char *subcollection, const char *property, char *string, int length, struct collection_item **ret_ref)
Add a string property to a collection.
Definition: collection_cnv.c:760
int col_compare_items(struct collection_item *first, struct collection_item *second, unsigned in_flags, unsigned *out_flags)
Compare two items.
Definition: collection_cmp.c:51
int col_add_bool_property_with_ref(struct collection_item *ci, const char *subcollection, const char *property, unsigned char logical, struct collection_item **ret_ref)
Add a Boolean property to a collection.
Definition: collection_cnv.c:937
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.
Definition: collection_cnv.c:568
int col_modify_bool_item(struct collection_item *item, const char *property, unsigned char logical)
Modify item value to be a Boolean.
Definition: collection_cnv.c:1182
int col_add_ulong_property_with_ref(struct collection_item *ci, const char *subcollection, const char *property, uint64_t number, struct collection_item **ret_ref)
Add an unsigned long property to a collection.
Definition: collection_cnv.c:887
void col_rewind_iterator(struct collection_iterator *iterator)
Rewind iterator.
Definition: collection_iter.c:410
int col_add_unsigned_property_with_ref(struct collection_item *ci, const char *subcollection, const char *property, uint32_t number, struct collection_item **ret_ref)
Add an unsigned integer property to a collection.
Definition: collection_cnv.c:837
int col_copy_collection_with_cb(struct collection_item **col_copy, struct collection_item *col_to_copy, const char *name_to_use, int copy_mode, col_copy_cb copy_cb, void *ext_data)
Copy collection with data modification.
Definition: collection.c:2338