core: Add DD_LIST_SORT macro
authorChanwoo Choi <cw00.choi@samsung.com>
Mon, 4 Jul 2016 04:27:26 +0000 (13:27 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Mon, 16 Jan 2017 11:35:37 +0000 (20:35 +0900)
This patch adds the DD_LIST_SORT macro to support the sorting.

Change-Id: Id435a884e14e731b2f4bf7e96ca9bd028571aac0
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
src/core/list.h

index bac4bbd..9555737 100644 (file)
@@ -38,6 +38,8 @@ typedef GList dd_list;
        g_list_find(a, (gpointer)b)
 #define DD_LIST_FREE_LIST(a)        \
        g_list_free(a)
+#define DD_LIST_SORT(a, func)          \
+       a = g_list_sort(a, func)
 #define DD_LIST_FOREACH(head, elem, node)      \
        for (elem = head, node = NULL; \
                        elem && ((node = elem->data) != NULL); \