projects
/
platform
/
core
/
uifw
/
libtdm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8dcd982
)
add LIST_FIRST_ENTRY, LIST_LAST_ENTRY macro
13/174313/1
author
Boram Park
<boram1288.park@samsung.com>
Fri, 30 Mar 2018 04:04:00 +0000
(13:04 +0900)
committer
Boram Park
<boram1288.park@samsung.com>
Fri, 30 Mar 2018 04:08:48 +0000
(13:08 +0900)
Change-Id: I98adf7df5ecb3dd94627e06bda3eb253033b289d
include/tdm_list.h
patch
|
blob
|
history
diff --git
a/include/tdm_list.h
b/include/tdm_list.h
index
7475894
..
3873817
100644
(file)
--- a/
include/tdm_list.h
+++ b/
include/tdm_list.h
@@
-112,6
+112,12
@@
static inline int list_length(struct list_head *item)
#define LIST_ENTRY(__type, __item, __field) \
((__type *)(((char *)(__item)) - offsetof(__type, __field)))
+#define LIST_FIRST_ENTRY(__ptr, __type, __field) \
+ LIST_ENTRY(__type, (__ptr)->next, __field)
+
+#define LIST_LAST_ENTRY(__ptr, __type, __field) \
+ LIST_ENTRY(__type, (__ptr)->prev, __field)
+
#define LIST_IS_EMPTY(__list) \
((__list)->next == (__list))