Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- inline void *__list_find(struct list_head *head, size_t offset, char (*equality_func)(void*, void*), void *context)
- {
- struct list_head *pos, *n;
- list_for_each_safe(pos, n, head)
- {
- void *obj = (void*)((unsigned long)pos-offset);
- if(equality_func(obj, context))
- return obj;
- }
- return NULL;
- }
- #define list_find(type, member, head, equality_func, context) \
- __list_find(head, offsetof(type, member), equality_func, context)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement