Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset e0f52bf in mainline


Ignore:
Timestamp:
2011-05-13T14:49:17Z (11 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master
Children:
d61c3a7, f9061b4
Parents:
8f466fc
Message:

add list iterator macro

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/adt/list.h

    r8f466fc re0f52bf  
    208208        ((type *) (((void *)(link)) - ((void *) &(((type *) NULL)->member))))
    209209
    210 extern int list_member(const link_t *link, const link_t *head);
    211 extern void list_concat(link_t *head1, link_t *head2);
    212 extern unsigned int list_count(const link_t *link);
     210#define list_foreach(list, iterator) \
     211        for (link_t *iterator = (list).next; \
     212            iterator != &(list); iterator = iterator->next)
     213
     214extern int list_member(const link_t *, const link_t *);
     215extern void list_concat(link_t *, link_t *);
     216extern unsigned int list_count(const link_t *);
    213217
    214218#endif
Note: See TracChangeset for help on using the changeset viewer.