1 /* Copyright (c) 2009 The Khronos Group Inc. |
1 /* Copyright (c) 2009 The Khronos Group Inc. |
|
2 * Portions copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies) |
2 * |
3 * |
3 * Permission is hereby granted, free of charge, to any person obtaining a |
4 * Permission is hereby granted, free of charge, to any person obtaining a |
4 * copy of this software and/or associated documentation files (the |
5 * copy of this software and/or associated documentation files (the |
5 * "Materials"), to deal in the Materials without restriction, including |
6 * "Materials"), to deal in the Materials without restriction, including |
6 * without limitation the rights to use, copy, modify, merge, publish, |
7 * without limitation the rights to use, copy, modify, merge, publish, |
129 * \return NULL. |
130 * \return NULL. |
130 */ |
131 */ |
131 OWF_API_CALL OWF_NODE* |
132 OWF_API_CALL OWF_NODE* |
132 OWF_List_Clear(OWF_NODE* root); |
133 OWF_List_Clear(OWF_NODE* root); |
133 |
134 |
134 /*! |
|
135 * Calls given callback function for each node in the list |
|
136 * as long as the callback function returns a non-zero value. |
|
137 * Useful for performing some action on list until some condition |
|
138 * is met. |
|
139 * |
|
140 * \param root List root |
|
141 * \param func Callback function |
|
142 * \param data Data to be passed to callback function |
|
143 */ |
|
144 OWF_API_CALL void |
|
145 OWF_List_ForEach(OWF_NODE* root, NODEITERFUNC func, void* data); |
|
146 |
|
147 /* |
|
148 * Returns first node for which given comparison function |
|
149 * returns a non-zero value. Useful for searching the list |
|
150 * for something of intrest. To find all matching nodes |
|
151 * from the list, use the following pattern: |
|
152 * |
|
153 * node = OWF_List_Find(list, compareFunc, dada); |
|
154 * while (node) { |
|
155 * processFoundNode(node); |
|
156 * node = OWF_List_Find(node->next, compareFunc, dada); |
|
157 * } |
|
158 * |
|
159 * \param root List root |
|
160 * \param func Node equality comparison function |
|
161 * \param data Data to pass to node comparison function. |
|
162 * |
|
163 * \return Node that matches in comparison. |
|
164 */ |
|
165 OWF_API_CALL OWF_NODE* |
|
166 OWF_List_Find(OWF_NODE* root, NODECMPFUNC func, void* data); |
|
167 |
|
168 |
|
169 #ifdef __cplusplus |
135 #ifdef __cplusplus |
170 } |
136 } |
171 #endif |
137 #endif |
172 |
138 |
173 |
139 |