4 * Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
26 typedef Eina_List dd_list;
27 #define DD_LIST_PREPEND(a, b) \
28 a = eina_list_prepend(a, b)
29 #define DD_LIST_APPEND(a, b) \
30 a = eina_list_append(a, b)
31 #define DD_LIST_REMOVE(a, b) \
32 a = eina_list_remove(a, b)
33 #define DD_LIST_LENGTH(a) \
35 #define DD_LIST_NTH(a, b) \
37 #define DD_LIST_FREE_LIST(a) \
39 #define DD_LIST_FOREACH(head, elem, node) \
40 EINA_LIST_FOREACH(head, elem, node)
41 #define DD_LIST_FOREACH_SAFE(head, elem, elem_next, node) \
42 EINA_LIST_FOREACH_SAFE(head, elem, elem_next, node)
46 typedef GList dd_list;
47 #define DD_LIST_PREPEND(a, b) \
48 a = g_list_prepend(a, (gpointer)b)
49 #define DD_LIST_APPEND(a, b) \
50 a = g_list_append(a, (gpointer)b)
51 #define DD_LIST_REMOVE(a, b) \
52 a = g_list_remove(a, (gpointer)b)
53 #define DD_LIST_LENGTH(a) \
55 #define DD_LIST_NTH(a, b) \
57 #define DD_LIST_FREE_LIST(a) \
59 #define DD_LIST_FOREACH(head, elem, node) \
60 for (elem = head, node = NULL; elem && ((node = elem->data) != NULL); elem = elem->next, node = NULL)
61 #define DD_LIST_FOREACH_SAFE(head, elem, elem_next, node) \
62 for (elem = head, elem_next = g_list_next(elem), node = NULL; \
63 elem && ((node = elem->data) != NULL); \
64 elem = elem_next, elem_next = g_list_next(elem), node = NULL)