ISIX-RTOS - small operating system for ARM microcontrollers 1.2
Data Structures | Defines | Typedefs | Functions

list.h File Reference

#include <stddef.h>
Include dependency graph for list.h:

Go to the source code of this file.

Data Structures

struct  list
struct  list_entry

Defines

#define list_getitem(list, type, member)   (type*)((char*)(list)-offsetof(type,member))
#define list_for_each(list_entryp, iterator)
#define list_for_each_reverse(list_entryp, iterator)
#define list_for_each_entry(list_entryp, iterator, field)
#define list_for_each_entry_reverse(list_entryp, iterator, field)
#define list_get_first(list_entryp, field, type)   (type*)((char*)(list_entryp)->head.next - offsetof(type,field))
#define list_get_last(list_entryp, field, type)   (type*)((char*)(list_entryp)->head.prev - offsetof(type,field))
#define list_isempty(list_entryp)   ((list_entryp)->head.next==&(list_entryp)->head)

Typedefs

typedef struct list list_t
typedef struct list_entry list_entry_t

Functions

static void list_init (list_entry_t *list)
static void list_insert_between (list_t *a, list_t *b, list_t *elem)
static void list_insert_before (list_t *before, list_t *elem)
static void list_insert_after (list_t *after, list_t *elem)
static void list_insert_end (list_entry_t *list, list_t *elem)
static void list_delete (list_t *elem)
static bool list_is_elem_assigned (list_t *elem)

Define Documentation

#define list_for_each (   list_entryp,
  iterator 
)
Value:
for( (iterator)=(list_entryp)->head.next; \
           (iterator)!=&(list_entryp)->head;   \
           (iterator) = (iterator)->next \
         )

Definition at line 63 of file list.h.

#define list_for_each_entry (   list_entryp,
  iterator,
  field 
)
Value:
for( list_t *__ilist__=(list_entryp)->head.next; \
       (iterator) = list_getitem(__ilist__,typeof(*(iterator)),field),__ilist__!=&(list_entryp)->head;   \
           __ilist__ = __ilist__->next \
         )

Definition at line 76 of file list.h.

Referenced by add_vtimer_to_list(), isix_bug(), isixp_add_task_to_ready_list(), isixp_add_task_to_sem_list(), isixp_add_task_to_waiting_list(), isixp_delete_from_multiple_wait_list(), and isixp_wakeup_multiple_waiting_tasks().

#define list_for_each_entry_reverse (   list_entryp,
  iterator,
  field 
)
Value:
for( list_t *__ilist__=(list_entryp)->head.prev; \
       (iterator) = list_getitem(__ilist__,typeof(*(iterator)),field),__ilist__!=&(list_entryp)->head;   \
           __ilist__ = __ilist__->prev \
         )

Definition at line 83 of file list.h.

#define list_for_each_reverse (   list_entryp,
  iterator 
)
Value:
for( (iterator)=(list_entryp)->head.prev; \
           (iterator)!=&(list_entryp)->head;   \
           (iterator) = (iterator)->prev \
         )

Definition at line 69 of file list.h.

#define list_get_first (   list_entryp,
  field,
  type 
)    (type*)((char*)(list_entryp)->head.next - offsetof(type,field))
#define list_get_last (   list_entryp,
  field,
  type 
)    (type*)((char*)(list_entryp)->head.prev - offsetof(type,field))

Definition at line 96 of file list.h.

#define list_getitem (   list,
  type,
  member 
)    (type*)((char*)(list)-offsetof(type,member))

Definition at line 60 of file list.h.

#define list_isempty (   list_entryp)    ((list_entryp)->head.next==&(list_entryp)->head)

Typedef Documentation

typedef struct list_entry list_entry_t
typedef struct list list_t

Function Documentation

static void list_delete ( list_t elem) [inline, static]
static void list_init ( list_entry_t list) [inline, static]
static void list_insert_after ( list_t after,
list_t elem 
) [inline, static]

Definition at line 47 of file list.h.

References list_insert_between(), and list::next.

Referenced by list_insert_end().

static void list_insert_before ( list_t before,
list_t elem 
) [inline, static]
static void list_insert_between ( list_t a,
list_t b,
list_t elem 
) [inline, static]

Definition at line 31 of file list.h.

References list::next, and list::prev.

Referenced by list_insert_after(), and list_insert_before().

static void list_insert_end ( list_entry_t list,
list_t elem 
) [inline, static]
static bool list_is_elem_assigned ( list_t elem) [inline, static]

Definition at line 113 of file list.h.

References list::next, NULL, and list::prev.

Referenced by isix_vtimer_destroy(), and isix_vtimer_start().

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines