QuickIO  0.2
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
list.h
Go to the documentation of this file.
1 
13 #include "qev.h"
14 
18 typedef struct qev_list qev_list_t;
19 
24 typedef void (*qev_list_cb)(void *item, void *data);
25 
38  const gint32 size,
39  const qev_free_fn free_fn);
40 
58 struct qev_list* qev_list_new_resizable(
59  const gint32 min_size,
60  const gint32 max_size,
61  const qev_free_fn free_fn);
62 
70 void qev_list_free(qev_list_t *list);
71 
93 gboolean qev_list_add(
94  qev_list_t *list,
95  void *thing,
96  gint32 *idx);
97 
116 gboolean qev_list_try_add(
117  qev_list_t *list,
118  void *thing,
119  gint32 *idx);
120 
130 void qev_list_remove(
131  qev_list_t *list,
132  gint32 *idx);
133 
146 void* qev_list_steal(
147  qev_list_t *list,
148  gint32 *idx);
149 
159 void qev_list_empty(qev_list_t *list);
160 
191 void qev_list_foreach(
192  qev_list_t *list,
193  qev_list_cb cb,
194  guint threads,
195  gboolean unlocked,
196  void *data);
197 
207 guint32 qev_list_size(qev_list_t *list);
void qev_list_foreach(qev_list_t *list, qev_list_cb cb, guint threads, gboolean unlocked, void *data)
Iterates through the list, calling cb on each item.
void qev_list_remove(qev_list_t *list, gint32 *idx)
Remove an item from the list.
void qev_list_free(qev_list_t *list)
Cleans up the list and frees everything in it.
void(* qev_list_cb)(void *item, void *data)
A callback for iterating the list: takes the item in the list and any supplied data.
Definition: list.h:24
guint32 qev_list_size(qev_list_t *list)
The number of items in the list.
void qev_list_empty(qev_list_t *list)
Empties out the entire list.
void * qev_list_steal(qev_list_t *list, gint32 *idx)
Steal an item from the list without calling free_fn on it.
struct qev_list qev_list_t
Bitch, stop looking at me.
Definition: list.h:18
gboolean qev_list_try_add(qev_list_t *list, void *thing, gint32 *idx)
Insert an item into the list without blocking.
gboolean qev_list_add(qev_list_t *list, void *thing, gint32 *idx)
Insert an item into the list.
Provides all the qev_* functions that are needed for creating an event loop.
void(* qev_free_fn)(void *)
Function type for a typical free function.
Definition: qev.h:185
qev_list_t * qev_list_new(const gint32 size, const qev_free_fn free_fn)
Create a new list.
struct qev_list * qev_list_new_resizable(const gint32 min_size, const gint32 max_size, const qev_free_fn free_fn)
Create a new list that expands in size as necessary.