libcollection  0.4.0
 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 
507 typedef void (*col_item_cleanup_fn)(const char *property,
508  int property_len,
509  int type,
510  void *data,
511  int length,
512  void *custom_data);
513 
537  void *custom_data);
538 
563 typedef int (*col_copy_cb)(struct collection_item *item,
564  void *ext_data,
565  int *skip);
566 
593 int col_copy_collection_with_cb(struct collection_item **col_copy,
594  struct collection_item *col_to_copy,
595  const char *name_to_use,
596  int copy_mode,
597  col_copy_cb copy_cb,
598  void *ext_data);
599 
617 int col_copy_collection(struct collection_item **col_copy,
618  struct collection_item *col_to_copy,
619  const char *name_to_use,
620  int copy_mode);
621 
654  const char *subcollection,
655  const char *as_property,
656  struct collection_item *ci_to_add,
657  int mode);
684 typedef int (*col_item_fn)(const char *property,
685  int property_len,
686  int type,
687  void *data,
688  int length,
689  void *custom_data,
690  int *stop);
691 
714  int mode_flags,
715  col_item_fn item_handler,
716  void *custom_data);
717 
752 int col_get_item_and_do(struct collection_item *ci,
753  const char *property_to_find,
754  int type,
755  int mode_flags,
756  col_item_fn item_handler,
757  void *custom_data);
758 
797 int col_get_item(struct collection_item *ci,
798  const char *property_to_find,
799  int type,
800  int mode_flags,
801  struct collection_item **item);
802 
832 int col_sort_collection(struct collection_item *col,
833  unsigned cmp_flags,
834  unsigned sort_flags);
835 
867 int col_delete_property(struct collection_item *ci,
868  const char *property_to_find,
869  int type,
870  int mode_flags);
871 
897  const char *property_to_find,
898  int type,
899  int mode_flags,
900  int *found);
901 
924  struct collection_item **acceptor,
925  const char *col_to_find);
926 
947  struct collection_item **acceptor);
948 
949 
950 
980  unsigned *cclass);
981 
996  unsigned cclass);
997 
1017  unsigned *count);
1018 
1019 
1033 int col_is_of_class(struct collection_item *ci,
1034  unsigned cclass);
1035 
1036 
1109 int col_add_str_property(struct collection_item *ci,
1110  const char *subcollection,
1111  const char *property,
1112  const char *string,
1113  int length);
1114 
1142  const char *subcollection,
1143  const char *property,
1144  void *binary_data,
1145  int length);
1146 
1172 int col_add_int_property(struct collection_item *ci,
1173  const char *subcollection,
1174  const char *property,
1175  int32_t number);
1176 
1203  const char *subcollection,
1204  const char *property,
1205  uint32_t number);
1206 
1232 int col_add_long_property(struct collection_item *ci,
1233  const char *subcollection,
1234  const char *property,
1235  int64_t number);
1236 
1263  const char *subcollection,
1264  const char *property,
1265  uint64_t number);
1266 
1293  const char *subcollection,
1294  const char *property,
1295  double number);
1321 int col_add_bool_property(struct collection_item *ci,
1322  const char *subcollection,
1323  const char *property,
1324  unsigned char logical);
1325 
1326 
1354 int col_add_any_property(struct collection_item *ci,
1355  const char *subcollection,
1356  const char *property,
1357  int type,
1358  void *data,
1359  int length);
1360 
1421  const char *subcollection,
1422  const char *property,
1423  char *string, int length,
1424  struct collection_item **ret_ref);
1425 
1455  const char *subcollection,
1456  const char *property,
1457  void *binary_data, int length,
1458  struct collection_item **ret_ref);
1459 
1488  const char *subcollection,
1489  const char *property, int32_t number,
1490  struct collection_item **ret_ref);
1491 
1520  const char *subcollection,
1521  const char *property, uint32_t number,
1522  struct collection_item **ret_ref);
1523 
1552  const char *subcollection,
1553  const char *property, int64_t number,
1554  struct collection_item **ret_ref);
1555 
1584  const char *subcollection,
1585  const char *property, uint64_t number,
1586  struct collection_item **ret_ref);
1587 
1616  const char *subcollection,
1617  const char *property, double number,
1618  struct collection_item **ret_ref);
1619 
1648  const char *subcollection,
1649  const char *property, unsigned char logical,
1650  struct collection_item **ret_ref);
1651 
1652 
1683  const char *subcollection,
1684  const char *property,
1685  int type, void *data, int length,
1686  struct collection_item **ret_ref);
1687 
1743  const char *subcollection,
1744  int disposition,
1745  const char *refprop,
1746  int idx,
1747  unsigned flags,
1748  const char *property,
1749  const char *string,
1750  int length);
1751 
1754  const char *subcollection,
1755  int disposition,
1756  const char *refprop,
1757  int idx,
1758  unsigned flags,
1759  const char *property,
1760  void *binary_data,
1761  int length);
1762 
1765  const char *subcollection,
1766  int disposition,
1767  const char *refprop,
1768  int idx,
1769  unsigned flags,
1770  const char *property,
1771  int32_t number);
1772 
1775  const char *subcollection,
1776  int disposition,
1777  const char *refprop,
1778  int idx,
1779  unsigned flags,
1780  const char *property,
1781  uint32_t number);
1782 
1785  const char *subcollection,
1786  int disposition,
1787  const char *refprop,
1788  int idx,
1789  unsigned flags,
1790  const char *property,
1791  int64_t number);
1792 
1795  const char *subcollection,
1796  int disposition,
1797  const char *refprop,
1798  int idx,
1799  unsigned flags,
1800  const char *property,
1801  uint64_t number);
1802 
1805  const char *subcollection,
1806  int disposition,
1807  const char *refprop,
1808  int idx,
1809  unsigned flags,
1810  const char *property,
1811  double number);
1812 
1815  const char *subcollection,
1816  int disposition,
1817  const char *refprop,
1818  int idx,
1819  unsigned flags,
1820  const char *property,
1821  unsigned char logical);
1822 
1825  const char *subcollection,
1826  int disposition,
1827  const char *refprop,
1828  int idx,
1829  unsigned flags,
1830  const char *property,
1831  const char *string,
1832  int length,
1833  struct collection_item **ret_ref);
1834 
1837  const char *subcollection,
1838  int disposition,
1839  const char *refprop,
1840  int idx,
1841  unsigned flags,
1842  const char *property,
1843  void *binary_data,
1844  int length,
1845  struct collection_item **ret_ref);
1846 
1849  const char *subcollection,
1850  int disposition,
1851  const char *refprop,
1852  int idx,
1853  unsigned flags,
1854  const char *property,
1855  int32_t number,
1856  struct collection_item **ret_ref);
1857 
1860  const char *subcollection,
1861  int disposition,
1862  const char *refprop,
1863  int idx,
1864  unsigned flags,
1865  const char *property,
1866  uint32_t number,
1867  struct collection_item **ret_ref);
1868 
1871  const char *subcollection,
1872  int disposition,
1873  const char *refprop,
1874  int idx,
1875  unsigned flags,
1876  const char *property,
1877  int64_t number,
1878  struct collection_item **ret_ref);
1879 
1882  const char *subcollection,
1883  int disposition,
1884  const char *refprop,
1885  int idx,
1886  unsigned flags,
1887  const char *property,
1888  uint64_t number,
1889  struct collection_item **ret_ref);
1890 
1896  const char *subcollection,
1897  int disposition,
1898  const char *refprop,
1899  int idx,
1900  unsigned flags,
1901  const char *property,
1902  double number,
1903  struct collection_item **ret_ref);
1904 
1907  const char *subcollection,
1908  int disposition,
1909  const char *refprop,
1910  int idx,
1911  unsigned flags,
1912  const char *property,
1913  unsigned char logical,
1914  struct collection_item **ret_ref);
1915 
1918  const char *subcollection,
1919  int disposition,
1920  const char *refprop,
1921  int idx,
1922  unsigned flags,
1923  const char *property,
1924  int type,
1925  const void *data,
1926  int length,
1927  struct collection_item **ret_ref);
1928 
1929 
1979  const char *property,
1980  int mode_flags,
1981  char *string,
1982  int length);
1987  const char *property,
1988  int mode_flags,
1989  void *binary_data,
1990  int length);
1995  const char *property,
1996  int mode_flags,
1997  int32_t number);
2002  const char *property,
2003  int mode_flags,
2004  uint32_t number);
2009  const char *property,
2010  int mode_flags,
2011  int64_t number);
2016  const char *property,
2017  int mode_flags,
2018  uint64_t number);
2023  const char *property,
2024  int mode_flags,
2025  double number);
2030  const char *property,
2031  int mode_flags,
2032  unsigned char logical);
2033 
2041 int col_update_property(struct collection_item *ci,
2042  const char *property,
2043  int type,
2044  void *new_data,
2045  int length,
2046  int mode_flags);
2047 
2048 
2080 #define COL_CMPIN_PROP_EQU 0x000000004
2081 
2082 #define COL_CMPIN_PROP_BEG 0x000000005
2083 
2084 #define COL_CMPIN_PROP_MID 0x000000006
2085 
2086 #define COL_CMPIN_PROP_END 0x000000007
2087 
2099 #define COL_CMPIN_PROP_DOT 0x000000008
2100 
2102 #define COL_CMPIN_PROP_LEN 0x000000010
2103 
2105 #define COL_CMPIN_TYPE 0x000000020
2106 
2108 #define COL_CMPIN_DATA_LEN 0x000000040
2109 
2118 #define COL_CMPIN_DATA 0x000000080
2119 
2140 #define COL_CMPOUT_PROP_STR 0x00000001
2141 
2148 #define COL_CMPOUT_PROP_LEN 0x00000002
2149 
2155 #define COL_CMPOUT_DATA_LEN 0x00000004
2156 
2164 #define COL_CMPOUT_DATA 0x00000008
2165 
2191 #define COL_DSP_END 0
2192 
2202 #define COL_DSP_FRONT 1
2203 
2215 #define COL_DSP_BEFORE 2
2216 
2228 #define COL_DSP_AFTER 3
2229 
2247 #define COL_DSP_INDEX 4
2248 
2265 #define COL_DSP_FIRSTDUP 5
2266 
2285 #define COL_DSP_LASTDUP 6
2286 
2315 #define COL_DSP_NDUP 7
2316 
2335 #define COL_INSERT_NOCHECK 0
2336 
2340 #define COL_INSERT_DUPOVER 1
2341 
2345 #define COL_INSERT_DUPOVERT 2
2346 
2347 #define COL_INSERT_DUPERROR 3
2348 
2352 #define COL_INSERT_DUPERRORT 4
2353 
2356 #define COL_INSERT_DUPMOVE 5
2357 
2360 #define COL_INSERT_DUPMOVET 6
2361 
2388 const char *col_get_item_property(struct collection_item *ci,
2389  int *property_len);
2390 
2403 int col_get_item_type(struct collection_item *ci);
2404 
2418 int col_get_item_length(struct collection_item *ci);
2419 
2432 void *col_get_item_data(struct collection_item *ci);
2433 
2453 uint64_t col_get_item_hash(struct collection_item *ci);
2454 
2478 uint64_t col_make_hash(const char *string, int sub_len, int *length);
2479 
2480 
2507 int col_compare_items(struct collection_item *first,
2508  struct collection_item *second,
2509  unsigned in_flags,
2510  unsigned *out_flags);
2511 
2512 
2513 
2548 int col_modify_item(struct collection_item *item,
2549  const char *property,
2550  int type,
2551  const void *data,
2552  int length);
2553 
2571 int col_modify_item_property(struct collection_item *item,
2572  const char *property);
2573 
2587 int col_modify_str_item(struct collection_item *item,
2588  const char *property,
2589  const char *string,
2590  int length);
2601 int col_modify_binary_item(struct collection_item *item,
2602  const char *property,
2603  void *binary_data,
2604  int length);
2615 int col_modify_bool_item(struct collection_item *item,
2616  const char *property,
2617  unsigned char logical);
2628 int col_modify_int_item(struct collection_item *item,
2629  const char *property,
2630  int32_t number);
2641 int col_modify_long_item(struct collection_item *item,
2642  const char *property,
2643  int64_t number);
2654 int col_modify_ulong_item(struct collection_item *item,
2655  const char *property,
2656  uint64_t number);
2667 int col_modify_unsigned_item(struct collection_item *item,
2668  const char *property,
2669  uint32_t number);
2680 int col_modify_double_item(struct collection_item *item,
2681  const char *property,
2682  double number);
2683 
2747 int col_extract_item(struct collection_item *ci,
2748  const char *subcollection,
2749  int disposition,
2750  const char *refprop,
2751  int idx,
2752  int type,
2753  struct collection_item **ret_ref);
2754 
2796  int disposition,
2797  const char *refprop,
2798  int idx,
2799  int type,
2800  struct collection_item **ret_ref);
2801 
2849 int col_remove_item(struct collection_item *ci,
2850  const char *subcollection,
2851  int disposition,
2852  const char *refprop,
2853  int idx,
2854  int type);
2855 
2856 
2896  int disposition,
2897  const char *refprop,
2898  int idx,
2899  int type);
2900 
2960 int col_insert_item(struct collection_item *ci,
2961  const char *subcollection,
2962  struct collection_item *item,
2963  int disposition,
2964  const char *refprop,
2965  int idx,
2966  unsigned flags);
2967 
3009  struct collection_item *item,
3010  int disposition,
3011  const char *refprop,
3012  int idx,
3013  unsigned flags);
3014 
3015 
3016 
3030 void col_delete_item(struct collection_item *item);
3031 
3066 int col_bind_iterator(struct collection_iterator **iterator,
3067  struct collection_item *ci,
3068  int mode_flags);
3069 
3075 void col_unbind_iterator(struct collection_iterator *iterator);
3076 
3097 int col_iterate_collection(struct collection_iterator *iterator,
3098  struct collection_item **item);
3099 
3117 int col_iterate_up(struct collection_iterator *iterator, unsigned level);
3118 
3150 int col_get_iterator_depth(struct collection_iterator *iterator, int *depth);
3151 
3166 int col_get_item_depth(struct collection_iterator *iterator, int *depth);
3167 
3213 void col_pin_iterator(struct collection_iterator *iterator);
3214 
3224 void col_rewind_iterator(struct collection_iterator *iterator);
3225 
3226 
3235 #endif
int col_insert_unsigned_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.
Definition: collection_cnv.c:133
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:563
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:684
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_unsigned_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.
Definition: collection_cnv.c:387
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:507
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_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