Rev 62 | Rev 430 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 62 | Rev 67 | ||
---|---|---|---|
Line 35... | Line 35... | ||
35 | * The membership is defined as pointer equivalence. |
35 | * The membership is defined as pointer equivalence. |
36 | * |
36 | * |
37 | * @param link Item to look for. |
37 | * @param link Item to look for. |
38 | * @param head List to look in. |
38 | * @param head List to look in. |
39 | * |
39 | * |
40 | * @return 1 if link is contained in head, 0 otherwise. |
40 | * @return true if link is contained in head, false otherwise. |
41 | * |
41 | * |
42 | */ |
42 | */ |
43 | int list_member(link_t *link, link_t *head) |
43 | bool list_member(const link_t *link, const link_t *head) |
44 | { |
44 | { |
45 | int found = 0; |
45 | bool found = false; |
46 | link_t *hlp = head->next; |
46 | link_t *hlp = head->next; |
47 | 47 | ||
48 | while (hlp != head) { |
48 | while (hlp != head) { |
49 | if (hlp == link) { |
49 | if (hlp == link) { |
50 | found = 1; |
50 | found = true; |
51 | break; |
51 | break; |
52 | } |
52 | } |
53 | hlp = hlp->next; |
53 | hlp = hlp->next; |
54 | } |
54 | } |
55 | 55 |