liba 0.1.15
An algorithm library based on C/C++
|
singly linked list implementation More...
#include "a.h"
Go to the source code of this file.
Data Structures | |
struct | a_slist_node |
instance structure for singly linked list node More... | |
struct | a_slist |
instance structure for singly linked list head More... | |
Macros | |
#define | A_SLIST_NODE {A_NULL} |
#define | A_SLIST_INIT(list) |
#define | a_slist_(_, x) |
cast a list pointer from another type pointer | |
#define | a_slist_entry(ptr, type, member) |
access the struct for this entry | |
#define | a_slist_entry_next(ptr, type, member) |
#define | a_slist_foreach(it, ctx) |
iterate over a list | |
#define | a_slist_forsafe(it, at, ctx) |
iterate over a list safe against removal of list entry | |
Typedefs | |
typedef struct a_slist_node | a_slist_node |
instance structure for singly linked list node | |
typedef struct a_slist | a_slist |
instance structure for singly linked list head | |
Functions | |
void | a_slist_ctor (a_slist *ctx) |
constructor for singly linked list head | |
void | a_slist_init (a_slist *ctx) |
initialize for singly linked list head | |
void | a_slist_dtor (a_slist *ctx) |
destructor for singly linked list head | |
void | a_slist_link (a_slist_node *head, a_slist_node *tail) |
link head node and tail node | |
void | a_slist_add (a_slist *ctx, a_slist_node *prev, a_slist_node *node) |
insert a node to a list | |
void | a_slist_add_head (a_slist *ctx, a_slist_node *node) |
insert a node to a list head | |
void | a_slist_add_tail (a_slist *ctx, a_slist_node *node) |
insert a node to a list tail | |
void | a_slist_del (a_slist *ctx, a_slist_node *prev) |
delete a node from a list | |
void | a_slist_del_head (a_slist *ctx) |
delete a node from a list head | |
void | a_slist_mov (a_slist *ctx, a_slist *to, a_slist_node *at) |
moving a list to another list | |
void | a_slist_rot (a_slist *ctx) |
rotate a node in the list | |
singly linked list implementation