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.
24 #define EINA_LIST_APPEND(a, b) \
25 a = eina_list_append(a, b)
27 #define EINA_LIST_REMOVE(a, b) \
28 a = eina_list_remove(a, b)
30 #define EINA_LIST_REMOVE_LIST(a, b) \
31 a = eina_list_remove_list(a, b)
33 #define EINA_LIST_FREE_LIST(a) \
36 #define EINA_LIST_PROMOTE_LIST(a, b) \
37 a = eina_list_promote_list(a, b)
41 typedef Eina_List dd_list;
42 #define DD_LIST_PREPEND(a, b) \
43 a = eina_list_prepend(a, b)
44 #define DD_LIST_APPEND(a, b) \
45 a = eina_list_append(a, b)
46 #define DD_LIST_REMOVE(a, b) \
47 a = eina_list_remove(a, b)
48 #define DD_LIST_LENGTH(a) \
50 #define DD_LIST_NTH(a, b) \
52 #define DD_LIST_FREE_LIST(a) \
54 #define DD_LIST_FOREACH(head, elem, node) \
55 EINA_LIST_FOREACH(head, elem, node)
56 #define DD_LIST_FOREACH_SAFE(head, elem, elem_next, node) \
57 EINA_LIST_FOREACH_SAFE(head, elem, elem_next, node)
61 typedef GList dd_list;
62 #define DD_LIST_PREPEND(a, b) \
63 a = g_list_prepend(a, (gpointer)b)
64 #define DD_LIST_APPEND(a, b) \
65 a = g_list_append(a, (gpointer)b)
66 #define DD_LIST_REMOVE(a, b) \
67 a = g_list_remove(a, (gpointer)b)
68 #define DD_LIST_LENGTH(a) \
70 #define DD_LIST_NTH(a, b) \
72 #define DD_LIST_FREE_LIST(a) \
74 #define DD_LIST_FOREACH(head, elem, node) \
75 for (elem = head, node = NULL; elem && ((node = elem->data) != NULL); elem = elem->next, node = NULL)
76 #define DD_LIST_FOREACH_SAFE(head, elem, elem_next, node) \
77 for (elem = head, elem_next = g_list_next(elem), node = NULL; \
78 elem && ((node = elem->data) != NULL); \
79 elem = elem_next, elem_next = g_list_next(elem), node = NULL)