src/cx/collection.h

changeset 1605
55b13f583356
parent 1464
9a10af83cfab
equal deleted inserted replaced
1604:68b75c091028 1605:55b13f583356
157 * Sets the compare function for a collection. 157 * Sets the compare function for a collection.
158 * 158 *
159 * @param c a pointer to a struct that contains #CX_COLLECTION_BASE 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 160 * @param func (@c cx_compare_func) the compare function that shall be used by @c c
161 */ 161 */
162 #define cxCollectionCompareFunc(c, func) (c)->collection.cmpfunc = (func) 162 #define cxSetCompareFunc(c, func) (c)->collection.cmpfunc = (cx_compare_func)(func)
163 163
164 /** 164 /**
165 * Sets a simple destructor function for this collection. 165 * Sets a simple destructor function for this collection.
166 * 166 *
167 * @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
168 * @param destr the destructor function 168 * @param destr the destructor function
169 */ 169 */
170 #define cxDefineDestructor(c, destr) \ 170 #define cxSetDestructor(c, destr) \
171 (c)->collection.simple_destructor = (cx_destructor_func) destr 171 (c)->collection.simple_destructor = (cx_destructor_func) destr
172 172
173 /** 173 /**
174 * Sets a simple destructor function for this collection. 174 * Sets a simple destructor function for this collection.
175 * 175 *
176 * @param c a pointer to a struct that contains #CX_COLLECTION_BASE 176 * @param c a pointer to a struct that contains #CX_COLLECTION_BASE
177 * @param destr the destructor function 177 * @param destr the destructor function
178 */ 178 */
179 #define cxDefineAdvancedDestructor(c, destr, data) \ 179 #define cxSetAdvancedDestructor(c, destr, data) \
180 (c)->collection.advanced_destructor = (cx_destructor_func2) destr; \ 180 (c)->collection.advanced_destructor = (cx_destructor_func2) destr; \
181 (c)->collection.destructor_data = data 181 (c)->collection.destructor_data = data
182 182
183 /** 183 /**
184 * Invokes the simple destructor function for a specific element. 184 * Invokes the simple destructor function for a specific element.

mercurial