libcollection  0.1.3
 All Data Structures Functions Typedefs Groups Pages
collection.h
1 /*
2  COLLECTION LIBRARY
3 
4  Header file for collection interface.
5 
6  Copyright (C) Dmitri Pal <dpal@redhat.com> 2009
7 
8  Collection Library is free software: you can redistribute it and/or modify
9  it under the terms of the GNU Lesser General Public License as published by
10  the Free Software Foundation, either version 3 of the License, or
11  (at your option) any later version.
12 
13  Collection Library is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public License
19  along with Collection Library. If not, see <http://www.gnu.org/licenses/>.
20 */
21 
22 #ifndef COLLECTION_H
23 #define COLLECTION_H
24 
25 #include <stdint.h>
26 
108 #ifndef EOK
109 #define EOK 0
110 #endif
111 
120 #define COL_CLASS_DEFAULT 0
121 
127 #define COL_NOMATCH 0
128 
133 #define COL_MATCH 1
134 
135 
145 #define COL_TYPE_STRING 0x00000001
146 
147 #define COL_TYPE_BINARY 0x00000002
148 
149 #define COL_TYPE_INTEGER 0x00000004
150 
151 #define COL_TYPE_UNSIGNED 0x00000008
152 
153 #define COL_TYPE_LONG 0x00000010
154 
155 #define COL_TYPE_ULONG 0x00000020
156 
157 #define COL_TYPE_DOUBLE 0x00000040
158 
159 #define COL_TYPE_BOOL 0x00000080
160 
166 #define COL_TYPE_COLLECTION 0x00000100
167 
173 #define COL_TYPE_COLLECTIONREF 0x00000200
174 
179 #define COL_TYPE_END 0x10000000
180 
186 #define COL_TYPE_ANY 0x0FFFFFFF
187 
200 #define COL_ADD_MODE_REFERENCE 0
201 
211 #define COL_ADD_MODE_EMBED 1
212 
217 #define COL_ADD_MODE_CLONE 2
218 
225 #define COL_ADD_MODE_FLAT 3
226 
238 #define COL_ADD_MODE_FLATDOT 4
239 
261 #define COL_TRAVERSE_DEFAULT 0x00000000
262 
269 #define COL_TRAVERSE_ONELEVEL 0x00000001
270 
280 #define COL_TRAVERSE_END 0x00000002
281 
282 #define COL_TRAVERSE_IGNORE 0x00000004
283 
296 #define COL_TRAVERSE_FLAT 0x00000008
297 
322 #define COL_TRAVERSE_SHOWSUB 0x00010000
323 
330 #define COL_TRAVERSE_ONLYSUB 0x00020000
331 
353 #define COL_COPY_NORMAL 0
354 
359 #define COL_COPY_FLAT 1
360 
365 #define COL_COPY_FLATDOT 2
366 
367 #define COL_COPY_KEEPREF 3
368 
369 #define COL_COPY_TOP 4
370 
385 #define COL_SORT_ASC 0x00000000
386 
387 #define COL_SORT_DESC 0x00000001
388 
389 #define COL_SORT_SUB 0x00000002
390 
395 #define COL_SORT_MYSUB 0x00000004
396 
401 /* Public declaration of the private data */
402 #ifndef COLLECTION_PRIV_H
403 
431 struct collection_iterator;
432 
433 #endif /* COLLECTION_PRIV_H */
434 
435 
472 int col_create_collection(struct collection_item **ci,
473  const char *name,
474  unsigned cclass);
475 
484 void col_destroy_collection(struct collection_item *ci);
485 
510 typedef int (*col_copy_cb)(struct collection_item *item,
511  void *ext_data,
512  int *skip);
513 
540 int col_copy_collection_with_cb(struct collection_item **col_copy,
541  struct collection_item *col_to_copy,
542  const char *name_to_use,
543  int copy_mode,
544  col_copy_cb copy_cb,
545  void *ext_data);
546 
564 int col_copy_collection(struct collection_item **col_copy,
565  struct collection_item *col_to_copy,
566  const char *name_to_use,
567  int copy_mode);
568 
601  const char *subcollection,
602  const char *as_property,
603  struct collection_item *ci_to_add,
604  int mode);
631 typedef int (*col_item_fn)(const char *property,
632  int property_len,
633  int type,
634  void *data,
635  int length,
636  void *custom_dat,
637  int *stop);
638 
639 
662  int mode_flags,
663  col_item_fn item_handler,
664  void *custom_data);
665 
700 int col_get_item_and_do(struct collection_item *ci,
701  const char *property_to_find,
702  int type,
703  int mode_flags,
704  col_item_fn item_handler,
705  void *custom_data);
706 
745 int col_get_item(struct collection_item *ci,
746  const char *property_to_find,
747  int type,
748  int mode_flags,
749  struct collection_item **item);
750 
780 int col_sort_collection(struct collection_item *col,
781  unsigned cmp_flags,
782  unsigned sort_flags);
783 
815 int col_delete_property(struct collection_item *ci,
816  const char *property_to_find,
817  int type,
818  int mode_flags);
819 
845  const char *property_to_find,
846  int type,
847  int mode_flags,
848  int *found);
849 
872  struct collection_item **acceptor,
873  const char *col_to_find);
874 
895  struct collection_item **acceptor);
896 
897 
898 
928  unsigned *cclass);
929 
944  unsigned cclass);
945 
965  unsigned *count);
966 
967 
981 int col_is_of_class(struct collection_item *ci,
982  unsigned cclass);
983 
984 
1057 int col_add_str_property(struct collection_item *ci,
1058  const char *subcollection,
1059  const char *property,
1060  const char *string,
1061  int length);
1062 
1090  const char *subcollection,
1091  const char *property,
1092  void *binary_data,
1093  int length);
1094 
1120 int col_add_int_property(struct collection_item *ci,
1121  const char *subcollection,
1122  const char *property,
1123  int32_t number);
1124 
1151  const char *subcollection,
1152  const char *property,
1153  uint32_t number);
1154 
1180 int col_add_long_property(struct collection_item *ci,
1181  const char *subcollection,
1182  const char *property,
1183  int64_t number);
1184 
1211  const char *subcollection,
1212  const char *property,
1213  uint64_t number);
1214 
1241  const char *subcollection,
1242  const char *property,
1243  double number);
1269 int col_add_bool_property(struct collection_item *ci,
1270  const char *subcollection,
1271  const char *property,
1272  unsigned char logical);
1273 
1274 
1302 int col_add_any_property(struct collection_item *ci,
1303  const char *subcollection,
1304  const char *property,
1305  int type,
1306  void *data,
1307  int length);
1308 
1369  const char *subcollection,
1370  const char *property,
1371  char *string, int length,
1372  struct collection_item **ret_ref);
1373 
1403  const char *subcollection,
1404  const char *property,
1405  void *binary_data, int length,
1406  struct collection_item **ret_ref);
1407 
1436  const char *subcollection,
1437  const char *property, int32_t number,
1438  struct collection_item **ret_ref);
1439 
1468  const char *subcollection,
1469  const char *property, uint32_t number,
1470  struct collection_item **ret_ref);
1471 
1500  const char *subcollection,
1501  const char *property, int64_t number,
1502  struct collection_item **ret_ref);
1503 
1532  const char *subcollection,
1533  const char *property, uint64_t number,
1534  struct collection_item **ret_ref);
1535 
1564  const char *subcollection,
1565  const char *property, double number,
1566  struct collection_item **ret_ref);
1567 
1596  const char *subcollection,
1597  const char *property, unsigned char logical,
1598  struct collection_item **ret_ref);
1599 
1600 
1631  const char *subcollection,
1632  const char *property,
1633  int type, void *data, int length,
1634  struct collection_item **ret_ref);
1635 
1691  const char *subcollection,
1692  int disposition,
1693  const char *refprop,
1694  int idx,
1695  unsigned flags,
1696  const char *property,
1697  const char *string,
1698  int length);
1699 
1702  const char *subcollection,
1703  int disposition,
1704  const char *refprop,
1705  int idx,
1706  unsigned flags,
1707  const char *property,
1708  void *binary_data,
1709  int length);
1710 
1713  const char *subcollection,
1714  int disposition,
1715  const char *refprop,
1716  int idx,
1717  unsigned flags,
1718  const char *property,
1719  int32_t number);
1720 
1723  const char *subcollection,
1724  int disposition,
1725  const char *refprop,
1726  int idx,
1727  unsigned flags,
1728  const char *property,
1729  uint32_t number);
1730 
1733  const char *subcollection,
1734  int disposition,
1735  const char *refprop,
1736  int idx,
1737  unsigned flags,
1738  const char *property,
1739  int64_t number);
1740 
1743  const char *subcollection,
1744  int disposition,
1745  const char *refprop,
1746  int idx,
1747  unsigned flags,
1748  const char *property,
1749  uint64_t number);
1750 
1753  const char *subcollection,
1754  int disposition,
1755  const char *refprop,
1756  int idx,
1757  unsigned flags,
1758  const char *property,
1759  double number);
1760 
1763  const char *subcollection,
1764  int disposition,
1765  const char *refprop,
1766  int idx,
1767  unsigned flags,
1768  const char *property,
1769  unsigned char logical);
1770 
1773  const char *subcollection,
1774  int disposition,
1775  const char *refprop,
1776  int idx,
1777  unsigned flags,
1778  const char *property,
1779  const char *string,
1780  int length,
1781  struct collection_item **ret_ref);
1782 
1785  const char *subcollection,
1786  int disposition,
1787  const char *refprop,
1788  int idx,
1789  unsigned flags,
1790  const char *property,
1791  void *binary_data,
1792  int length,
1793  struct collection_item **ret_ref);
1794 
1797  const char *subcollection,
1798  int disposition,
1799  const char *refprop,
1800  int idx,
1801  unsigned flags,
1802  const char *property,
1803  int32_t number,
1804  struct collection_item **ret_ref);
1805 
1808  const char *subcollection,
1809  int disposition,
1810  const char *refprop,
1811  int idx,
1812  unsigned flags,
1813  const char *property,
1814  uint32_t number,
1815  struct collection_item **ret_ref);
1816 
1819  const char *subcollection,
1820  int disposition,
1821  const char *refprop,
1822  int idx,
1823  unsigned flags,
1824  const char *property,
1825  int64_t number,
1826  struct collection_item **ret_ref);
1827 
1830  const char *subcollection,
1831  int disposition,
1832  const char *refprop,
1833  int idx,
1834  unsigned flags,
1835  const char *property,
1836  uint64_t number,
1837  struct collection_item **ret_ref);
1838 
1844  const char *subcollection,
1845  int disposition,
1846  const char *refprop,
1847  int idx,
1848  unsigned flags,
1849  const char *property,
1850  double number,
1851  struct collection_item **ret_ref);
1852 
1855  const char *subcollection,
1856  int disposition,
1857  const char *refprop,
1858  int idx,
1859  unsigned flags,
1860  const char *property,
1861  unsigned char logical,
1862  struct collection_item **ret_ref);
1863 
1866  const char *subcollection,
1867  int disposition,
1868  const char *refprop,
1869  int idx,
1870  unsigned flags,
1871  const char *property,
1872  int type,
1873  const void *data,
1874  int length,
1875  struct collection_item **ret_ref);
1876 
1877 
1927  const char *property,
1928  int mode_flags,
1929  char *string,
1930  int length);
1935  const char *property,
1936  int mode_flags,
1937  void *binary_data,
1938  int length);
1943  const char *property,
1944  int mode_flags,
1945  int32_t number);
1950  const char *property,
1951  int mode_flags,
1952  uint32_t number);
1957  const char *property,
1958  int mode_flags,
1959  int64_t number);
1964  const char *property,
1965  int mode_flags,
1966  uint64_t number);
1971  const char *property,
1972  int mode_flags,
1973  double number);
1978  const char *property,
1979  int mode_flags,
1980  unsigned char logical);
1981 
1989 int col_update_property(struct collection_item *ci,
1990  const char *property,
1991  int type,
1992  void *new_data,
1993  int length,
1994  int mode_flags);
1995 
1996 
2028 #define COL_CMPIN_PROP_EQU 0x000000004
2029 
2030 #define COL_CMPIN_PROP_BEG 0x000000005
2031 
2032 #define COL_CMPIN_PROP_MID 0x000000006
2033 
2034 #define COL_CMPIN_PROP_END 0x000000007
2035 
2047 #define COL_CMPIN_PROP_DOT 0x000000008
2048 
2050 #define COL_CMPIN_PROP_LEN 0x000000010
2051 
2053 #define COL_CMPIN_TYPE 0x000000020
2054 
2056 #define COL_CMPIN_DATA_LEN 0x000000040
2057 
2066 #define COL_CMPIN_DATA 0x000000080
2067 
2088 #define COL_CMPOUT_PROP_STR 0x00000001
2089 
2096 #define COL_CMPOUT_PROP_LEN 0x00000002
2097 
2103 #define COL_CMPOUT_DATA_LEN 0x00000004
2104 
2112 #define COL_CMPOUT_DATA 0x00000008
2113 
2139 #define COL_DSP_END 0
2140 
2150 #define COL_DSP_FRONT 1
2151 
2163 #define COL_DSP_BEFORE 2
2164 
2176 #define COL_DSP_AFTER 3
2177 
2195 #define COL_DSP_INDEX 4
2196 
2213 #define COL_DSP_FIRSTDUP 5
2214 
2233 #define COL_DSP_LASTDUP 6
2234 
2263 #define COL_DSP_NDUP 7
2264 
2283 #define COL_INSERT_NOCHECK 0
2284 
2288 #define COL_INSERT_DUPOVER 1
2289 
2293 #define COL_INSERT_DUPOVERT 2
2294 
2295 #define COL_INSERT_DUPERROR 3
2296 
2300 #define COL_INSERT_DUPERRORT 4
2301 
2304 #define COL_INSERT_DUPMOVE 5
2305 
2308 #define COL_INSERT_DUPMOVET 6
2309 
2336 const char *col_get_item_property(struct collection_item *ci,
2337  int *property_len);
2338 
2351 int col_get_item_type(struct collection_item *ci);
2352 
2366 int col_get_item_length(struct collection_item *ci);
2367 
2380 void *col_get_item_data(struct collection_item *ci);
2381 
2401 uint64_t col_get_item_hash(struct collection_item *ci);
2402 
2426 uint64_t col_make_hash(const char *string, int sub_len, int *length);
2427 
2428 
2455 int col_compare_items(struct collection_item *first,
2456  struct collection_item *second,
2457  unsigned in_flags,
2458  unsigned *out_flags);
2459 
2460 
2461 
2496 int col_modify_item(struct collection_item *item,
2497  const char *property,
2498  int type,
2499  const void *data,
2500  int length);
2501 
2519 int col_modify_item_property(struct collection_item *item,
2520  const char *property);
2521 
2535 int col_modify_str_item(struct collection_item *item,
2536  const char *property,
2537  const char *string,
2538  int length);
2549 int col_modify_binary_item(struct collection_item *item,
2550  const char *property,
2551  void *binary_data,
2552  int length);
2563 int col_modify_bool_item(struct collection_item *item,
2564  const char *property,
2565  unsigned char logical);
2576 int col_modify_int_item(struct collection_item *item,
2577  const char *property,
2578  int32_t number);
2589 int col_modify_long_item(struct collection_item *item,
2590  const char *property,
2591  int64_t number);
2602 int col_modify_ulong_item(struct collection_item *item,
2603  const char *property,
2604  uint64_t number);
2615 int col_modify_unsigned_item(struct collection_item *item,
2616  const char *property,
2617  uint32_t number);
2628 int col_modify_double_item(struct collection_item *item,
2629  const char *property,
2630  double number);
2631 
2695 int col_extract_item(struct collection_item *ci,
2696  const char *subcollection,
2697  int disposition,
2698  const char *refprop,
2699  int idx,
2700  int type,
2701  struct collection_item **ret_ref);
2702 
2744  int disposition,
2745  const char *refprop,
2746  int idx,
2747  int type,
2748  struct collection_item **ret_ref);
2749 
2797 int col_remove_item(struct collection_item *ci,
2798  const char *subcollection,
2799  int disposition,
2800  const char *refprop,
2801  int idx,
2802  int type);
2803 
2804 
2844  int disposition,
2845  const char *refprop,
2846  int idx,
2847  int type);
2848 
2908 int col_insert_item(struct collection_item *ci,
2909  const char *subcollection,
2910  struct collection_item *item,
2911  int disposition,
2912  const char *refprop,
2913  int idx,
2914  unsigned flags);
2915 
2957  struct collection_item *item,
2958  int disposition,
2959  const char *refprop,
2960  int idx,
2961  unsigned flags);
2962 
2963 
2964 
2978 void col_delete_item(struct collection_item *item);
2979 
3014 int col_bind_iterator(struct collection_iterator **iterator,
3015  struct collection_item *ci,
3016  int mode_flags);
3017 
3023 void col_unbind_iterator(struct collection_iterator *iterator);
3024 
3045 int col_iterate_collection(struct collection_iterator *iterator,
3046  struct collection_item **item);
3047 
3065 int col_iterate_up(struct collection_iterator *iterator, unsigned level);
3066 
3098 int col_get_iterator_depth(struct collection_iterator *iterator, int *depth);
3099 
3114 int col_get_item_depth(struct collection_iterator *iterator, int *depth);
3115 
3164 void col_pin_iterator(struct collection_iterator *iterator);
3165 
3178 void col_rewind_iterator(struct collection_iterator *iterator);
3179 
3180 
3189 #endif
int col_update_property(struct collection_item *ci, const char *property_to_find, int type, void *new_data, int length, int mode_flags)
Definition: collection.c:2823
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:787
void col_unbind_iterator(struct collection_iterator *iterator)
Unbind the iterator from the collection.
Definition: collection_iter.c:188
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:877
int col_add_collection_to_collection(struct collection_item *ci, const char *sub_collection_name, const char *as_property, struct collection_item *collection_to_add, int mode)
Add collection to collection.
Definition: collection.c:2460
int col_create_collection(struct collection_item **ci, const char *name, unsigned cclass)
Create a collection.
Definition: collection.c:2197
void col_destroy_collection(struct collection_item *ci)
Destroy a collection.
Definition: collection.c:2238
int col_get_collection_count(struct collection_item *item, unsigned *count)
Get count of the elements.
Definition: collection.c:2959
int col_get_collection_class(struct collection_item *item, unsigned *cclass)
Get collection class.
Definition: collection.c:2940
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:1198
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:544
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:1245
int(* col_copy_cb)(struct collection_item *item, void *ext_data, int *skip)
Copy item callback.
Definition: collection.h:510
int col_extract_item(struct collection_item *collection, 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:783
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:103
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:195
int col_bind_iterator(struct collection_iterator **iterator, struct collection_item *ci, int mode_flags)
Bind iterator to a collection.
Definition: collection_iter.c:63
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:165
uint64_t col_make_hash(const char *string, int sub_len, int *length)
Calculate hash value for a string.
Definition: collection.c:3031
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:2776
Opaque iterator structure.
Definition: collection.h:418
int col_set_collection_class(struct collection_item *item, unsigned cclass)
Set collection class.
Definition: collection.c:2921
int col_insert_item_into_current(struct collection_item *collection, struct collection_item *item, int disposition, const char *refprop, int idx, unsigned flags)
Insert item to the current collection.
Definition: collection.c:340
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:225
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:664
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:2853
int col_sort_collection(struct collection_item *col, unsigned cmp_flags, unsigned sort_flags)
Sort collection.
Definition: collection_cmp.c:297
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:813
int col_insert_item(struct collection_item *collection, const char *subcollection, struct collection_item *item, int disposition, const char *refprop, int idx, unsigned flags)
Insert item to the collection.
Definition: collection.c:901
int col_update_bool_property(struct collection_item *ci, const char *property, int mode_flags, unsigned char logical)
Definition: collection_cnv.c:1114
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:38
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:843
int col_get_item_type(struct collection_item *ci)
Get item type.
Definition: collection.c:3003
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:1146
int col_is_of_class(struct collection_item *item, unsigned cclass)
Check the class of collection.
Definition: collection.c:2980
int col_get_iterator_depth(struct collection_iterator *iterator, int *depth)
Get current depth.
Definition: collection_iter.c:152
int col_extract_item_from_current(struct collection_item *collection, int disposition, const char *refprop, int idx, int type, struct collection_item **ret_ref)
Extract item from the current collection.
Definition: collection.c:600
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:1167
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:512
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:1230
int col_insert_property_with_ref(struct collection_item *collection, 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:1076
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:687
int col_update_unsigned_property(struct collection_item *ci, const char *property, int mode_flags, uint32_t number)
Definition: collection_cnv.c:1045
int col_get_reference_from_item(struct collection_item *ci, struct collection_item **acceptor)
Get a reference from the item.
Definition: collection.c:2429
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:2753
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:640
int col_delete_property(struct collection_item *ci, const char *property_to_find, int type, int mode_flags)
Delete property.
Definition: collection.c:2798
int col_get_item_length(struct collection_item *ci)
Get value length from the item.
Definition: collection.c:3009
int col_modify_item_property(struct collection_item *item, const char *property)
Modify item property.
Definition: collection_cnv.c:1131
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:1029
int col_get_item_depth(struct collection_iterator *iterator, int *depth)
Get depth of the last returned item.
Definition: collection_iter.c:169
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:450
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:2697
uint64_t col_get_item_hash(struct collection_item *ci)
Get hash value from the item.
Definition: collection.c:3021
int col_get_collection_reference(struct collection_item *ci, struct collection_item **acceptor, const char *collection_to_find)
Get a reference to a collection.
Definition: collection.c:2374
int col_iterate_up(struct collection_iterator *iterator, unsigned level)
Move up.
Definition: collection_iter.c:128
int col_update_long_property(struct collection_item *ci, const char *property, int mode_flags, int64_t number)
Definition: collection_cnv.c:1062
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:286
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:594
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:356
int col_update_binary_property(struct collection_item *ci, const char *property, int mode_flags, void *binary_data, int length)
Definition: collection_cnv.c:1012
int col_copy_collection(struct collection_item **collection_copy, struct collection_item *collection_to_copy, const char *name_to_use, int copy_mode)
Copy collection without data modification.
Definition: collection.c:2276
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:2728
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:1260
int col_update_double_property(struct collection_item *ci, const char *property, int mode_flags, double number)
Definition: collection_cnv.c:1097
int col_iterate_collection(struct collection_iterator *iterator, struct collection_item **item)
Iterate collection.
Definition: collection_iter.c:201
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:481
void * col_get_item_data(struct collection_item *ci)
Get property value from the item.
Definition: collection.c:3015
void col_pin_iterator(struct collection_iterator *iterator)
Pin iterator.
Definition: collection_iter.c:382
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:963
void col_delete_item(struct collection_item *item)
Delete extracted item.
Definition: collection.c:176
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:1214
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:617
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:324
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:863
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:419
int col_update_ulong_property(struct collection_item *ci, const char *property, int mode_flags, uint64_t number)
Definition: collection_cnv.c:1080
int(* col_item_fn)(const char *property, int property_len, int type, void *data, int length, void *custom_dat, int *stop)
Search Callback.
Definition: collection.h:631
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:913
int col_update_str_property(struct collection_item *ci, const char *property, int mode_flags, char *string, int length)
Definition: collection_cnv.c:994
const char * col_get_item_property(struct collection_item *ci, int *property_len)
Get item property.
Definition: collection.c:2995
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:71
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:733
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:710
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:255
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:761
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:52
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:938
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:569
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:1183
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:888
void col_rewind_iterator(struct collection_iterator *iterator)
Rewind iterator.
Definition: collection_iter.c:411
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:838
int col_copy_collection_with_cb(struct collection_item **collection_copy, struct collection_item *collection_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:2297