ucx/list.h

changeset 129
61edec666928
parent 128
b79b1ce438dd
child 146
aa376dba1ba8
equal deleted inserted replaced
128:b79b1ce438dd 129:61edec666928
58 */ 58 */
59 #define UCX_FOREACH(elem,list) \ 59 #define UCX_FOREACH(elem,list) \
60 for (UcxList* elem = list ; elem != NULL ; elem = elem->next) 60 for (UcxList* elem = list ; elem != NULL ; elem = elem->next)
61 61
62 /** 62 /**
63 * UCX list type 63 * UCX list type.
64 * @see UcxList 64 * @see UcxList
65 */ 65 */
66 typedef struct UcxList UcxList; 66 typedef struct UcxList UcxList;
67 /**
68 * UCX list structure.
69 */
67 struct UcxList { 70 struct UcxList {
68 /** 71 /**
69 * List element payload. 72 * List element payload.
70 */ 73 */
71 void *data; 74 void *data;
103 * 106 *
104 * Keep in mind, that you might want to pass the allocator as an (part of the) 107 * Keep in mind, that you might want to pass the allocator as an (part of the)
105 * argument for the <code>data</code> parameter, if you want the copy_func() to 108 * argument for the <code>data</code> parameter, if you want the copy_func() to
106 * make use of the allocator. 109 * make use of the allocator.
107 * 110 *
111 * @param allocator the allocator to use
108 * @param list the list to copy 112 * @param list the list to copy
109 * @param cpyfnc a pointer to the function that shall copy an element (may be 113 * @param cpyfnc a pointer to the function that shall copy an element (may be
110 * <code>NULL</code>) 114 * <code>NULL</code>)
111 * @param data additional data for the copy_func() 115 * @param data additional data for the copy_func()
112 * @return a pointer to the copy 116 * @return a pointer to the copy

mercurial