|
libwebsockets
Lightweight C library for HTML5 websockets
|
Data Structures | |
| struct | lws_dll2 |
| struct | lws_dll2_owner |
Macros | |
| #define | lws_start_foreach_ll(type, it, start) |
| #define | lws_end_foreach_ll(it, nxt) |
| #define | lws_start_foreach_ll_safe(type, it, start, nxt) |
| #define | lws_end_foreach_ll_safe(it) |
| #define | lws_start_foreach_llp(type, it, start) |
| #define | lws_start_foreach_llp_safe(type, it, start, nxt) |
| #define | lws_end_foreach_llp(it, nxt) |
| #define | lws_end_foreach_llp_safe(it) |
| #define | lws_ll_fwd_insert(___new_object, ___m_list, ___list_head) |
| #define | lws_ll_fwd_remove(___type, ___m_list, ___target, ___list_head) |
| #define | lws_dll2_search_sz_pl(own, name, namelen, type, membd2list, membptr) |
| #define | lws_dll2_describe(x, y) |
| #define | lws_start_foreach_dll_safe(___type, ___it, ___tmp, ___start) |
| #define | lws_end_foreach_dll_safe(___it, ___tmp) |
| #define | lws_start_foreach_dll(___type, ___it, ___start) |
| #define | lws_end_foreach_dll(___it) |
Typedefs | |
| typedef struct lws_dll2 | lws_dll2_t |
| typedef struct lws_dll2_owner | lws_dll2_owner_t |
Functions | |
| LWS_VISIBLE LWS_EXTERN void | lws_dll2_add_head (struct lws_dll2 *d, struct lws_dll2_owner *owner) |
| LWS_VISIBLE LWS_EXTERN void | lws_dll2_add_tail (struct lws_dll2 *d, struct lws_dll2_owner *owner) |
| LWS_VISIBLE LWS_EXTERN void | lws_dll2_remove (struct lws_dll2 *d) |
| LWS_VISIBLE LWS_EXTERN int | lws_dll2_foreach_safe (struct lws_dll2_owner *owner, void *user, int(*cb)(struct lws_dll2 *d, void *user)) |
| LWS_VISIBLE LWS_EXTERN void | lws_dll2_clear (struct lws_dll2 *d) |
| LWS_VISIBLE LWS_EXTERN void | lws_dll2_owner_clear (struct lws_dll2_owner *d) |
| LWS_VISIBLE LWS_EXTERN void | lws_dll2_add_before (struct lws_dll2 *d, struct lws_dll2 *after) |
| LWS_VISIBLE LWS_EXTERN void | lws_dll2_add_sorted (lws_dll2_t *d, lws_dll2_owner_t *own, int(*compare)(const lws_dll2_t *d, const lws_dll2_t *i)) |
| LWS_VISIBLE LWS_EXTERN void * | _lws_dll2_search_sz_pl (lws_dll2_owner_t *own, const char *name, size_t namelen, size_t dll2_ofs, size_t ptr_ofs) |
simple single and doubly-linked lists
| #define lws_dll2_search_sz_pl | ( | own, | |
| name, | |||
| namelen, | |||
| type, | |||
| membd2list, | |||
| membptr | |||
| ) |
#include <include/libwebsockets/lws-dll2.h>
| #define lws_end_foreach_dll | ( | ___it | ) |
#include <include/libwebsockets/lws-dll2.h>
| #define lws_end_foreach_dll_safe | ( | ___it, | |
| ___tmp | |||
| ) |
#include <include/libwebsockets/lws-dll2.h>
| #define lws_end_foreach_ll | ( | it, | |
| nxt | |||
| ) |
#include <include/libwebsockets/lws-dll2.h>
lws_end_foreach_ll(): linkedlist iterator helper end
| it | same iterator var name given when starting |
| nxt | member name in the iterator pointing to next list element |
This helper is the partner for lws_start_foreach_ll() that ends the while loop.
| #define lws_end_foreach_ll_safe | ( | it | ) |
#include <include/libwebsockets/lws-dll2.h>
lws_end_foreach_ll_safe(): linkedlist iterator helper end (pre increment storage)
| it | same iterator var name given when starting |
This helper is the partner for lws_start_foreach_ll_safe() that ends the while loop. It uses the precreated next_ variable already stored during start.
| #define lws_end_foreach_llp | ( | it, | |
| nxt | |||
| ) |
#include <include/libwebsockets/lws-dll2.h>
lws_end_foreach_llp(): linkedlist pointer iterator helper end
| it | same iterator var name given when starting |
| nxt | member name in the iterator pointing to next list element |
This helper is the partner for lws_start_foreach_llp() that ends the while loop.
| #define lws_end_foreach_llp_safe | ( | it | ) |
#include <include/libwebsockets/lws-dll2.h>
| #define lws_ll_fwd_insert | ( | ___new_object, | |
| ___m_list, | |||
| ___list_head | |||
| ) |
#include <include/libwebsockets/lws-dll2.h>
| #define lws_ll_fwd_remove | ( | ___type, | |
| ___m_list, | |||
| ___target, | |||
| ___list_head | |||
| ) |
#include <include/libwebsockets/lws-dll2.h>
| #define lws_start_foreach_dll | ( | ___type, | |
| ___it, | |||
| ___start | |||
| ) |
#include <include/libwebsockets/lws-dll2.h>
| #define lws_start_foreach_dll_safe | ( | ___type, | |
| ___it, | |||
| ___tmp, | |||
| ___start | |||
| ) |
#include <include/libwebsockets/lws-dll2.h>
| #define lws_start_foreach_ll | ( | type, | |
| it, | |||
| start | |||
| ) |
#include <include/libwebsockets/lws-dll2.h>
lws_start_foreach_ll(): linkedlist iterator helper start
| type | type of iteration, eg, struct xyz * |
| it | iterator var name to create |
| start | start of list |
This helper creates an iterator and starts a while (it) { loop. The iterator runs through the linked list starting at start and ends when it gets a NULL. The while loop should be terminated using lws_start_foreach_ll().
| #define lws_start_foreach_ll_safe | ( | type, | |
| it, | |||
| start, | |||
| nxt | |||
| ) |
#include <include/libwebsockets/lws-dll2.h>
lws_start_foreach_ll_safe(): linkedlist iterator helper start safe against delete
| type | type of iteration, eg, struct xyz * |
| it | iterator var name to create |
| start | start of list |
| nxt | member name in the iterator pointing to next list element |
This helper creates an iterator and starts a while (it) { loop. The iterator runs through the linked list starting at start and ends when it gets a NULL. The while loop should be terminated using lws_end_foreach_ll_safe(). Performs storage of next increment for situations where iterator can become invalidated during iteration.
| #define lws_start_foreach_llp | ( | type, | |
| it, | |||
| start | |||
| ) |
#include <include/libwebsockets/lws-dll2.h>
lws_start_foreach_llp(): linkedlist pointer iterator helper start
| type | type of iteration, eg, struct xyz ** |
| it | iterator var name to create |
| start | start of list |
This helper creates an iterator and starts a while (it) { loop. The iterator runs through the linked list starting at the address of start and ends when it gets a NULL. The while loop should be terminated using lws_start_foreach_llp().
This helper variant iterates using a pointer to the previous linked-list element. That allows you to easily delete list members by rewriting the previous pointer to the element's next pointer.
| #define lws_start_foreach_llp_safe | ( | type, | |
| it, | |||
| start, | |||
| nxt | |||
| ) |
#include <include/libwebsockets/lws-dll2.h>