NetSurf
|
Ring list structure. More...
Go to the source code of this file.
Macros | |
#define | RING_INSERT(ring, element) |
Insert the given item into the specified ring. More... | |
#define | RING_REMOVE(ring, element) |
Remove the given element from the specified ring. More... | |
#define | RING_FINDBYLWCHOST(ring, element, lwc_hostname) |
Find the element (by hostname) in the given ring, leave it in the provided element variable. More... | |
#define | RING_GETSIZE(ringtype, ring, sizevar) |
Measure the size of a ring and put it in the supplied variable. More... | |
#define | RING_COUNTBYLWCHOST(ringtype, ring, sizevar, lwc_hostname) |
Count the number of elements in the ring which match the provided lwc_hostname. More... | |
#define | RING_ITERATE_START(ringtype, ring, iteratorptr) |
#define | RING_ITERATE_STOP(ring, iteratorptr) goto iteration_end_ring##_##iteratorptr |
#define | RING_ITERATE_END(ring, iteratorptr) |
Ring list structure.
Rings are structures which have an r_next pointer and an r_prev pointer which are always initialised and always point at the next or previous element respectively.
The degenerate case of a single element in the ring simply points at itself in both directions. A zero element ring is NULL.
Some of the ring functions are specific to the fetcher but may be of use to others and are thus included here.
Definition in file ring.h.
#define RING_COUNTBYLWCHOST | ( | ringtype, | |
ring, | |||
sizevar, | |||
lwc_hostname | |||
) |
Count the number of elements in the ring which match the provided lwc_hostname.
#define RING_FINDBYLWCHOST | ( | ring, | |
element, | |||
lwc_hostname | |||
) |
Find the element (by hostname) in the given ring, leave it in the provided element variable.
#define RING_GETSIZE | ( | ringtype, | |
ring, | |||
sizevar | |||
) |
#define RING_INSERT | ( | ring, | |
element | |||
) |
#define RING_ITERATE_END | ( | ring, | |
iteratorptr | |||
) |
#define RING_ITERATE_START | ( | ringtype, | |
ring, | |||
iteratorptr | |||
) |
#define RING_ITERATE_STOP | ( | ring, | |
iteratorptr | |||
) | goto iteration_end_ring##_##iteratorptr |
#define RING_REMOVE | ( | ring, | |
element | |||
) |
Remove the given element from the specified ring.
Will zero the element as needed