diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2009-03-11 22:59:46 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2009-03-11 22:59:46 (GMT) |
commit | c4231094c9c77c685371d726d28e65c0459486de (patch) | |
tree | 2d4bb57239cb46bd2b1194c853c3a7263e487455 /src/common/dllist.h | |
parent | 29a22c425f492427f45b71de937f2d99587c8d34 (diff) |
Inserted comments into disassembled code.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@53 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/common/dllist.h')
-rw-r--r-- | src/common/dllist.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/common/dllist.h b/src/common/dllist.h index 970edf9..670d3b9 100644 --- a/src/common/dllist.h +++ b/src/common/dllist.h @@ -44,6 +44,7 @@ typedef dl_list_item *dl_list_head; #define DL_LIST_ITEM dl_list_item dummy #define DLL_CAST(item) ((dl_list_item *)item) +#define DLL_HCAST(item) ((dl_list_item **)item) #define DL_LIST_HEAD_INIT(head) \ *(head) = NULL @@ -87,6 +88,17 @@ unsigned int count_dl_list_items(dl_list_head); #define dl_list_add_tail(new, head) \ __dl_list_add(DLL_CAST(new), (head), (dl_list_empty(*(head)) ? DLL_CAST(new) : (*(head))->prev), (dl_list_empty(*(head)) ? DLL_CAST(new) : *(head))) +#define dl_list_insert_before(new, target, head) \ + do \ + { \ + DLL_CAST(new)->prev = DLL_CAST(target)->prev; \ + DLL_CAST(target)->prev->next = DLL_CAST(new); \ + DLL_CAST(new)->next = DLL_CAST(target); \ + DLL_CAST(target)->prev = DLL_CAST(new); \ + if (DLL_CAST(target) == *head) *head = DLL_CAST(target); \ + \ + } while (0) + #define dl_list_del(item, head) \ do \ { \ |