#include <list.h>
Data Fields | |
void * | data |
struct list_t * | next |
This implementation for a linked list does not employ a separate data structure for the head or tail node; see the implementation of the Doubly-Linked List Library for what this means. By imposing on its users the responsability to make sure that a list given to the library functions is appropriate for their tasks, it attains simpler implementation.
The detail of struct list_t
is intentionally exposed to the users (as opposed to be hidden in an opaque type) because doing so is more useful. For example, a user does not need to complicate the code by calling, say, list_push() just in order to make a temporary list node. Declaring it as having the type of list_t
(as opposed to list_t
*
) is enough. In addition, an list_t
object can be embedded in a user-created data structure directly.
void* list_t::data |
pointer to data
struct list_t* list_t::next [read] |
pointer to next node