Simple data structures / objects in plain C Snapshot
Classes | Defines | Typedefs | Functions
dlistunr.h File Reference
#include <cutils/base.h>
#include <cutils/dring.h>
#include <stdlib.h>
#include <string.h>

Go to the source code of this file.

Classes

struct  tagDLISTUNR_entry
struct  DLISTUNR
struct  DLISTUNR_position

Defines

#define DLISTUNR_FOREACH(loopvarname, list)
 Macro for iterate over all elements of a list, the list is traversed in forward direction from first element to the last element.
#define DLISTUNR_FOREACH_REVERSE(loopvarname, list)
 Macro for iterate over all elements of a list, the list is traversed in reverse direction from last element to the first element.
#define DLISTUNR_FOREACH_SAVE(loopvarname, loopvarnext, list)
 Macro for iterate over all elements of a list, You may delete the current element; the list is traversed in forward direction from first element to the last element.
#define DLISTUNR_FOREACH_REVERSE_SAVE(loopvarname, loopvarnext, list)
 Macro for iterate over all elements of a list, You may delete the current element; the list is traversed in reverse direction from last element to the first element.

Typedefs

typedef struct tagDLISTUNR_entry DLISTUNR_entry
typedef void(* DLISTUNR_VISITOR_V )(DLISTUNR *list, void *entry, void *context)
typedef int(* DLISTUNR_VISITOR )(DLISTUNR *list, void *entry, void *context)

Functions

M_INLINE int DLISTUNR_init (DLISTUNR *list, size_t elmsize, size_t elmmaxcount)
 initialises a new unrolled list. List entries are all of a fixed size.
M_INLINE int DLISTUNR_check (DLISTUNR *list)
 check validity of unrolled list instance
M_INLINE int DLISTUNR_isempty (DLISTUNR *list)
 checks if argument list is empty
M_INLINE size_t DLISTUNR_size (DLISTUNR *list)
M_INLINE size_t DLISTUNR_maxsize (DLISTUNR *list)
M_INLINE DLISTUNR_position DLISTUNR_get_first (DLISTUNR *list)
 Returns position structure of first element in unrolled linked list.
M_INLINE DLISTUNR_position DLISTUNR_get_last (DLISTUNR *list)
 Returns position structure of last element in unrolled linked list.
M_INLINE DLISTUNR_position DLISTUNR_next (DLISTUNR_position pos)
 Returns position to the next element in unrolled linked list.
M_INLINE int DLISTUNR_is_eof (DLISTUNR *list, DLISTUNR_position pos)
M_INLINE DLISTUNR_position DLISTUNR_prev (DLISTUNR_position pos)
 Returns position to the previous element in unrolled linked list.
M_INLINE int DLISTUNR_check_position (DLISTUNR_position pos)
 verify a position structure.
M_INLINE int DLISTUNR_copy_at (DLISTUNR *list, DLISTUNR_position pos, void *data, size_t size)
 copy list entry identified by position structure (pos) into user supplied memory area
M_INLINE uint8_t * DLISTUNR_at (DLISTUNR *list, DLISTUNR_position pos)
 return pointer to list entry identified by position structure (pos).
int DLISTUNR_insert_after (DLISTUNR *list, DLISTUNR_position pos, void *data, size_t size)
 insert new entry after a given entry into this unrolled linked list
M_INLINE int DLISTUNR_insert_before (DLISTUNR *list, DLISTUNR_position pos, void *data, size_t size)
 insert new entry before a given entry into this unrolled linked list
int DLISTUNR_unlink (DLISTUNR *list, DLISTUNR_position pos)
 delete an element from a unrolled list.
M_INLINE int DLISTUNR_push_back (DLISTUNR *list, void *data, size_t size)
 insert element as last in list (used to maintain queue)
M_INLINE int DLISTUNR_push_front (DLISTUNR *list, void *data, size_t size)
 insert element as last in list (used to maintain queue)
M_INLINE int DLISTUNR_pop_back (DLISTUNR *list, void *data, size_t size)
 copy data of last element into user supplied buffer and remove the last element from list (used to maintain double ended queue)
M_INLINE int DLISTUNR_pop_front (DLISTUNR *list, void *data, size_t size)
 copy data of first element into user supplied buffer and remove the first element from list (used to maintain double ended queue)
M_INLINE void DLISTUNR_free (DLISTUNR *list, DLISTUNR_VISITOR_V free_func, void *context)
 list free all entries of the list. The list will then be an empty list.

Typedef Documentation