summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2010-04-18 22:30:19 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2010-04-18 22:30:19 (GMT)
commitfb12cfc1727ba949b70a48ee042a2aec9ebbb407 (patch)
treee2c7300262312d77c9f57657e5238d269b7189c0 /src/common
parentef29fbc801e23f547b9ee7666b713bcf32d7e787 (diff)
Defined attributes for printing binary content using GLib.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@153 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/common')
-rw-r--r--src/common/dllist.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/common/dllist.h b/src/common/dllist.h
index 504291e..f309dc9 100644
--- a/src/common/dllist.h
+++ b/src/common/dllist.h
@@ -108,11 +108,28 @@ void __dl_list_del(dl_list_item *, dl_list_head *);
} \
while(0)
+#define dl_list_merge(head1, head2, type, member) \
+ do \
+ { \
+ if (dl_list_empty(*head1)) *head1 = *head2; \
+ else if (!dl_list_empty(*head2)) \
+ { \
+ dl_list_item *hmbr1 = &(*head1)->member; \
+ dl_list_item *hmbr2 = &(*head2)->member; \
+ dl_list_item *mid = hmbr1->prev; \
+ mid->next = hmbr2; \
+ hmbr1->prev = hmbr2->prev; \
+ hmbr2->prev->next = hmbr1; \
+ hmbr2->prev = mid; \
+ } \
+ } \
+ while(0)
+
#define dl_list_push dl_list_add_tail
#define dl_list_pop(head, type, member) \
({ \
- type *_result = *head; \
+ type *_result = *head;/* FIXME : ARgh ! */ \
dl_list_del(_result, head, type, member); \
_result; \
})