src/cx/collection.h

changeset 857
4d12e34bb130
parent 856
6bbbf219251d
equal deleted inserted replaced
856:6bbbf219251d 857:4d12e34bb130
98 * Use this macro to declare common members for a collection structure. 98 * Use this macro to declare common members for a collection structure.
99 */ 99 */
100 #define CX_COLLECTION_BASE struct cx_collection_s collection 100 #define CX_COLLECTION_BASE struct cx_collection_s collection
101 101
102 /** 102 /**
103 * Sets a simple destructor function for this collection.
104 *
105 * @param c the collection
106 * @param destr the destructor function
107 */
108 #define cxDefineDestructor(c, destr) \
109 (c)->collection.simple_destructor = (cx_destructor_func) destr
110
111 /**
112 * Sets a simple destructor function for this collection.
113 *
114 * @param c the collection
115 * @param destr the destructor function
116 */
117 #define cxDefineAdvancedDestructor(c, destr, data) \
118 (c)->collection.advanced_destructor = (cx_destructor_func2) destr; \
119 (c)->collection.destructor_data = data
120
121 /**
103 * Invokes the simple destructor function for a specific element. 122 * Invokes the simple destructor function for a specific element.
104 * 123 *
105 * Usually only used by collection implementations. There should be no need 124 * Usually only used by collection implementations. There should be no need
106 * to invoke this macro manually. 125 * to invoke this macro manually.
107 * 126 *

mercurial