| 152 * @retval false if the order of elements is unknown |
152 * @retval false if the order of elements is unknown |
| 153 */ |
153 */ |
| 154 #define cxCollectionSorted(c) ((c)->collection.sorted || (c)->collection.size == 0) |
154 #define cxCollectionSorted(c) ((c)->collection.sorted || (c)->collection.size == 0) |
| 155 |
155 |
| 156 /** |
156 /** |
| |
157 * Sets the compare function for a collection. |
| |
158 * |
| |
159 * @param c a pointer to a struct that contains #CX_COLLECTION_BASE |
| |
160 * @param func (@c cx_compare_func) the compare function that shall be used by @c c |
| |
161 */ |
| |
162 #define cxCollectionCompareFunc(c, func) (c)->collection.cmpfunc = (func) |
| |
163 |
| |
164 /** |
| 157 * Sets a simple destructor function for this collection. |
165 * Sets a simple destructor function for this collection. |
| 158 * |
166 * |
| 159 * @param c a pointer to a struct that contains #CX_COLLECTION_BASE |
167 * @param c a pointer to a struct that contains #CX_COLLECTION_BASE |
| 160 * @param destr the destructor function |
168 * @param destr the destructor function |
| 161 */ |
169 */ |