libcoap  4.1.1
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
Macros
utlist.h File Reference

Go to the source code of this file.

Macros

#define UTLIST_VERSION   1.9.1
 
#define LDECLTYPE(x)   __typeof(x)
 
#define _SV(elt, list)
 
#define _NEXT(elt, list)   ((elt)->next)
 
#define _NEXTASGN(elt, list, to)   ((elt)->next)=(to)
 
#define _PREV(elt, list)   ((elt)->prev)
 
#define _PREVASGN(elt, list, to)   ((elt)->prev)=(to)
 
#define _RS(list)
 
#define _CASTASGN(a, b)   (a)=(b)
 
#define LL_SORT(list, cmp)
 
#define DL_SORT(list, cmp)
 
#define CDL_SORT(list, cmp)
 
#define LL_PREPEND(head, add)
 
#define LL_APPEND(head, add)
 
#define LL_DELETE(head, del)
 
#define LL_APPEND_VS2008(head, add)
 
#define LL_DELETE_VS2008(head, del)
 
#define LL_FOREACH(head, el)   for(el=head;el;el=el->next)
 
#define LL_FOREACH_SAFE(head, el, tmp)   for((el)=(head);(el) && (tmp = (el)->next, 1); (el) = tmp)
 
#define LL_SEARCH_SCALAR(head, out, field, val)
 
#define LL_SEARCH(head, out, elt, cmp)
 
#define DL_PREPEND(head, add)
 
#define DL_APPEND(head, add)
 
#define DL_DELETE(head, del)
 
#define DL_FOREACH(head, el)   for(el=head;el;el=el->next)
 
#define DL_FOREACH_SAFE(head, el, tmp)   for((el)=(head);(el) && (tmp = (el)->next, 1); (el) = tmp)
 
#define DL_SEARCH_SCALAR   LL_SEARCH_SCALAR
 
#define DL_SEARCH   LL_SEARCH
 
#define CDL_PREPEND(head, add)
 
#define CDL_DELETE(head, del)
 
#define CDL_FOREACH(head, el)   for(el=head;el;el=(el->next==head ? 0L : el->next))
 
#define CDL_FOREACH_SAFE(head, el, tmp1, tmp2)
 
#define CDL_SEARCH_SCALAR(head, out, field, val)
 
#define CDL_SEARCH(head, out, elt, cmp)
 

Macro Definition Documentation

#define _CASTASGN (   a,
 
)    (a)=(b)

Definition at line 93 of file utlist.h.

#define _NEXT (   elt,
  list 
)    ((elt)->next)

Definition at line 88 of file utlist.h.

#define _NEXTASGN (   elt,
  list,
  to 
)    ((elt)->next)=(to)

Definition at line 89 of file utlist.h.

#define _PREV (   elt,
  list 
)    ((elt)->prev)

Definition at line 90 of file utlist.h.

#define _PREVASGN (   elt,
  list,
  to 
)    ((elt)->prev)=(to)

Definition at line 91 of file utlist.h.

#define _RS (   list)

Definition at line 92 of file utlist.h.

#define _SV (   elt,
  list 
)

Definition at line 87 of file utlist.h.

#define CDL_DELETE (   head,
  del 
)
Value:
do { \
if ( ((head)==(del)) && ((head)->next == (head))) { \
(head) = 0L; \
} else { \
(del)->next->prev = (del)->prev; \
(del)->prev->next = (del)->next; \
if ((del) == (head)) (head)=(del)->next; \
} \
} while (0);
void * prev
Definition: uthash.h:965
void * next
Definition: uthash.h:966

Definition at line 456 of file utlist.h.

#define CDL_FOREACH (   head,
  el 
)    for(el=head;el;el=(el->next==head ? 0L : el->next))

Definition at line 467 of file utlist.h.

#define CDL_FOREACH_SAFE (   head,
  el,
  tmp1,
  tmp2 
)
Value:
for((el)=(head), ((tmp1)=(head)?((head)->prev):NULL); \
(el) && ((tmp2)=(el)->next, 1); \
((el) = (((el)==(tmp1)) ? 0L : (tmp2))))
void * prev
Definition: uthash.h:965
void * next
Definition: uthash.h:966

Definition at line 470 of file utlist.h.

#define CDL_PREPEND (   head,
  add 
)
Value:
do { \
if (head) { \
(add)->prev = (head)->prev; \
(add)->next = (head); \
(head)->prev = (add); \
(add)->prev->next = (add); \
} else { \
(add)->prev = (add); \
(add)->next = (add); \
} \
(head)=(add); \
} while (0)
void * prev
Definition: uthash.h:965
void * next
Definition: uthash.h:966

Definition at line 442 of file utlist.h.

#define CDL_SEARCH (   head,
  out,
  elt,
  cmp 
)
Value:
do { \
CDL_FOREACH(head,out) { \
if ((cmp(out,elt))==0) break; \
} \
} while(0)
#define CDL_FOREACH(head, el)
Definition: utlist.h:467

Definition at line 482 of file utlist.h.

#define CDL_SEARCH_SCALAR (   head,
  out,
  field,
  val 
)
Value:
do { \
CDL_FOREACH(head,out) { \
if ((out)->field == (val)) break; \
} \
} while(0)
#define CDL_FOREACH(head, el)
Definition: utlist.h:467

Definition at line 475 of file utlist.h.

#define CDL_SORT (   list,
  cmp 
)

Definition at line 214 of file utlist.h.

#define DL_APPEND (   head,
  add 
)
Value:
do { \
if (head) { \
(add)->prev = (head)->prev; \
(head)->prev->next = (add); \
(head)->prev = (add); \
(add)->next = NULL; \
} else { \
(head)=(add); \
(head)->prev = (head); \
(head)->next = NULL; \
} \
} while (0);
void * prev
Definition: uthash.h:965
void * next
Definition: uthash.h:966

Definition at line 396 of file utlist.h.

#define DL_DELETE (   head,
  del 
)
Value:
do { \
if ((del)->prev == (del)) { \
(head)=NULL; \
} else if ((del)==(head)) { \
(del)->next->prev = (del)->prev; \
(head) = (del)->next; \
} else { \
(del)->prev->next = (del)->next; \
if ((del)->next) { \
(del)->next->prev = (del)->prev; \
} else { \
(head)->prev = (del)->prev; \
} \
} \
} while (0);
void * prev
Definition: uthash.h:965
void * next
Definition: uthash.h:966

Definition at line 410 of file utlist.h.

#define DL_FOREACH (   head,
  el 
)    for(el=head;el;el=el->next)

Definition at line 428 of file utlist.h.

#define DL_FOREACH_SAFE (   head,
  el,
  tmp 
)    for((el)=(head);(el) && (tmp = (el)->next, 1); (el) = tmp)

Definition at line 432 of file utlist.h.

#define DL_PREPEND (   head,
  add 
)
Value:
do { \
(add)->next = head; \
if (head) { \
(add)->prev = (head)->prev; \
(head)->prev = (add); \
} else { \
(add)->prev = (add); \
} \
(head) = (add); \
} while (0)
void * prev
Definition: uthash.h:965
void * next
Definition: uthash.h:966

Definition at line 384 of file utlist.h.

#define DL_SEARCH   LL_SEARCH

Definition at line 437 of file utlist.h.

#define DL_SEARCH_SCALAR   LL_SEARCH_SCALAR

Definition at line 436 of file utlist.h.

#define DL_SORT (   list,
  cmp 
)

Definition at line 156 of file utlist.h.

#define LDECLTYPE (   x)    __typeof(x)

Definition at line 72 of file utlist.h.

#define LL_APPEND (   head,
  add 
)
Value:
do { \
LDECLTYPE(head) _tmp; \
(add)->next=NULL; \
if (head) { \
_tmp = head; \
while (_tmp->next) { _tmp = _tmp->next; } \
_tmp->next=(add); \
} else { \
(head)=(add); \
} \
} while (0)
#define LDECLTYPE(x)
Definition: utlist.h:72
void * next
Definition: uthash.h:966

Definition at line 293 of file utlist.h.

#define LL_APPEND_VS2008 (   head,
  add 
)
Value:
do { \
if (head) { \
(add)->next = head; /* use add->next as a temp variable */ \
while ((add)->next->next) { (add)->next = (add)->next->next; } \
(add)->next->next=(add); \
} else { \
(head)=(add); \
} \
(add)->next=NULL; \
} while (0)
void * next
Definition: uthash.h:966

Definition at line 323 of file utlist.h.

#define LL_DELETE (   head,
  del 
)
Value:
do { \
LDECLTYPE(head) _tmp; \
if ((head) == (del)) { \
(head)=(head)->next; \
} else { \
_tmp = head; \
while (_tmp->next && (_tmp->next != (del))) { \
_tmp = _tmp->next; \
} \
if (_tmp->next) { \
_tmp->next = ((del)->next); \
} \
} \
} while (0)
#define LDECLTYPE(x)
Definition: utlist.h:72
void * next
Definition: uthash.h:966

Definition at line 306 of file utlist.h.

#define LL_DELETE_VS2008 (   head,
  del 
)
Value:
do { \
if ((head) == (del)) { \
(head)=(head)->next; \
} else { \
char *_tmp = (char*)(head); \
while (head->next && (head->next != (del))) { \
head = head->next; \
} \
if (head->next) { \
head->next = ((del)->next); \
} \
{ \
char **_head_alias = (char**)&(head); \
*_head_alias = _tmp; \
} \
} \
} while (0)
void * next
Definition: uthash.h:966

Definition at line 335 of file utlist.h.

#define LL_FOREACH (   head,
  el 
)    for(el=head;el;el=el->next)

Definition at line 361 of file utlist.h.

#define LL_FOREACH_SAFE (   head,
  el,
  tmp 
)    for((el)=(head);(el) && (tmp = (el)->next, 1); (el) = tmp)

Definition at line 364 of file utlist.h.

#define LL_PREPEND (   head,
  add 
)
Value:
do { \
(add)->next = head; \
head = add; \
} while (0)
void * next
Definition: uthash.h:966

Definition at line 287 of file utlist.h.

#define LL_SEARCH (   head,
  out,
  elt,
  cmp 
)
Value:
do { \
LL_FOREACH(head,out) { \
if ((cmp(out,elt))==0) break; \
} \
} while(0)
#define LL_FOREACH(head, el)
Definition: utlist.h:361

Definition at line 374 of file utlist.h.

#define LL_SEARCH_SCALAR (   head,
  out,
  field,
  val 
)
Value:
do { \
LL_FOREACH(head,out) { \
if ((out)->field == (val)) break; \
} \
} while(0)
#define LL_FOREACH(head, el)
Definition: utlist.h:361

Definition at line 367 of file utlist.h.

#define LL_SORT (   list,
  cmp 
)

Definition at line 100 of file utlist.h.

#define UTLIST_VERSION   1.9.1

Definition at line 27 of file utlist.h.