b_list behaves exactly like b_queue, with two key differences:
1) it is memory-managed like other b_objects, which means it
is stored on the heap and ref-counted.
2) it is not an invasive data structure, and will automatically
create and manage list nodes that contain pointers to the
list items.
20 lines
266 B
C
20 lines
266 B
C
#ifndef _BLUELIB_LIST_H_
|
|
#define _BLUELIB_LIST_H_
|
|
|
|
#include "object.h"
|
|
|
|
#include <blue/core/queue.h>
|
|
|
|
struct b_list {
|
|
struct b_object l_base;
|
|
struct b_queue l_queue;
|
|
size_t l_len;
|
|
};
|
|
|
|
struct b_list_entry {
|
|
struct b_queue_entry e_entry;
|
|
void *e_data;
|
|
};
|
|
|
|
#endif
|