Back to index

libdrm  2.4.37
Classes | Defines | Typedefs
libdrm_lists.h File Reference
#include <stddef.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _drmMMListHead

Defines

#define DRMINITLISTHEAD(__item)
#define DRMLISTADD(__item, __list)
#define DRMLISTADDTAIL(__item, __list)
#define DRMLISTDEL(__item)
#define DRMLISTDELINIT(__item)
#define DRMLISTENTRY(__type, __item, __field)   ((__type *)(((char *) (__item)) - offsetof(__type, __field)))
#define DRMLISTEMPTY(__item)   ((__item)->next == (__item))
#define DRMLISTSINGLE(__list)   (!DRMLISTEMPTY(__list) && ((__list)->next == (__list)->prev))
#define DRMLISTFOREACH(__item, __list)
#define DRMLISTFOREACHSAFE(__item, __temp, __list)
#define DRMLISTFOREACHSAFEREVERSE(__item, __temp, __list)
#define DRMLISTFOREACHENTRY(__item, __list, __head)
#define DRMLISTFOREACHENTRYSAFE(__item, __temp, __list, __head)
#define DRMLISTJOIN(__list, __join)

Typedefs

typedef struct _drmMMListHead drmMMListHead

Class Documentation

struct _drmMMListHead

Definition at line 34 of file libdrm_lists.h.

Collaboration diagram for _drmMMListHead:
Class Members
struct _drmMMListHead * next
struct _drmMMListHead * prev

Define Documentation

#define DRMINITLISTHEAD (   __item)
Value:
do{                                       \
    (__item)->prev = (__item);                   \
    (__item)->next = (__item);                   \
  } while (0)

Definition at line 40 of file libdrm_lists.h.

#define DRMLISTADD (   __item,
  __list 
)
Value:
do {                                      \
    (__item)->prev = (__list);                   \
    (__item)->next = (__list)->next;             \
    (__list)->next->prev = (__item);             \
    (__list)->next = (__item);                   \
  } while (0)

Definition at line 46 of file libdrm_lists.h.

#define DRMLISTADDTAIL (   __item,
  __list 
)
Value:
do {                                      \
    (__item)->next = (__list);                   \
    (__item)->prev = (__list)->prev;             \
    (__list)->prev->next = (__item);             \
    (__list)->prev = (__item);                   \
  } while(0)

Definition at line 54 of file libdrm_lists.h.

#define DRMLISTDEL (   __item)
Value:
do {                                      \
    (__item)->prev->next = (__item)->next;       \
    (__item)->next->prev = (__item)->prev;       \
  } while(0)

Definition at line 62 of file libdrm_lists.h.

#define DRMLISTDELINIT (   __item)
Value:
do {                                      \
    (__item)->prev->next = (__item)->next;       \
    (__item)->next->prev = (__item)->prev;       \
    (__item)->next = (__item);                   \
    (__item)->prev = (__item);                   \
  } while(0)

Definition at line 68 of file libdrm_lists.h.

#define DRMLISTEMPTY (   __item)    ((__item)->next == (__item))

Definition at line 79 of file libdrm_lists.h.

#define DRMLISTENTRY (   __type,
  __item,
  __field 
)    ((__type *)(((char *) (__item)) - offsetof(__type, __field)))

Definition at line 76 of file libdrm_lists.h.

#define DRMLISTFOREACH (   __item,
  __list 
)
Value:
for ((__item) = (__list)->next;                                \
            (__item) != (__list); (__item) = (__item)->next)

Definition at line 84 of file libdrm_lists.h.

#define DRMLISTFOREACHENTRY (   __item,
  __list,
  __head 
)
Value:
for ((__item) = DRMLISTENTRY(typeof(*__item), (__list)->next, __head); \
            &(__item)->__head != (__list);                                    \
            (__item) = DRMLISTENTRY(typeof(*__item),                          \
                                 (__item)->__head.next, __head))

Definition at line 98 of file libdrm_lists.h.

#define DRMLISTFOREACHENTRYSAFE (   __item,
  __temp,
  __list,
  __head 
)
Value:
for ((__item) = DRMLISTENTRY(typeof(*__item), (__list)->next, __head), \
            (__temp) = DRMLISTENTRY(typeof(*__item),                          \
                                 (__item)->__head.next, __head);           \
            &(__item)->__head != (__list);                                    \
            (__item) = (__temp),                                              \
            (__temp) = DRMLISTENTRY(typeof(*__item),                          \
                                 (__temp)->__head.next, __head))

Definition at line 104 of file libdrm_lists.h.

#define DRMLISTFOREACHSAFE (   __item,
  __temp,
  __list 
)
Value:
for ((__item) = (__list)->next, (__temp) = (__item)->next;     \
            (__item) != (__list);                              \
            (__item) = (__temp), (__temp) = (__item)->next)

Definition at line 88 of file libdrm_lists.h.

#define DRMLISTFOREACHSAFEREVERSE (   __item,
  __temp,
  __list 
)
Value:
for ((__item) = (__list)->prev, (__temp) = (__item)->prev;     \
            (__item) != (__list);                              \
            (__item) = (__temp), (__temp) = (__item)->prev)

Definition at line 93 of file libdrm_lists.h.

#define DRMLISTJOIN (   __list,
  __join 
)
Value:
if (!DRMLISTEMPTY(__list)) {       \
       (__list)->next->prev = (__join);                        \
       (__list)->prev->next = (__join)->next;                         \
       (__join)->next->prev = (__list)->prev;                         \
       (__join)->next = (__list)->next;                        \
}

Definition at line 113 of file libdrm_lists.h.

#define DRMLISTSINGLE (   __list)    (!DRMLISTEMPTY(__list) && ((__list)->next == (__list)->prev))

Definition at line 81 of file libdrm_lists.h.


Typedef Documentation

typedef struct _drmMMListHead drmMMListHead