List implementation. More...
#include "list.h"#include <errno.h>#include <stdlib.h>#include "debug.h"
Go to the source code of this file.
Data Structures | |
| struct | list |
| A doubly linked list. More... | |
Functions | |
| int | _list_new (list_t **list, size_t ln_offset) |
| Creates a new doubly linked list. | |
| int | list_free (list_t *list) |
| Frees a list. | |
| struct list_node * | list_head (list_t *list) |
| Gets the head node of a list. | |
| struct list_node * | list_tail (list_t *list) |
| Gets the tail node of a list. | |
| int | list_insert_before (struct list_node *p, struct list_node *q) |
| Inserts a node before another node in a list. | |
| int | list_insert_after (struct list_node *p, struct list_node *q) |
| Inserts a node after another node in a list. | |
| int | list_insert_chain_after (struct list_node *p, struct list_node *first, struct list_node *last) |
| Inserts a chain of nodes after another node in a list. | |
| int | list_delete_chain (struct list_node *first, struct list_node *last) |
| Deletes a chain of nodes from the list. | |
List implementation.
Definition in file list.c.
| int _list_new | ( | list_t ** | list, | |
| size_t | ln_offset | |||
| ) |
Creates a new doubly linked list.
| [out] | list | the created list |
| ln_offset | the offset of the struct list_node in the list entries |
Definition at line 47 of file list.c.
References list::head, list::ln_offset, and list::tail.
| int list_delete_chain | ( | struct list_node * | first, | |
| struct list_node * | last | |||
| ) |
Deletes a chain of nodes from the list.
This operation doesn't free the memory occupied by the nodes.
| first | the first node in the chain to delete | |
| last | the last node in the chain to delete |
Definition at line 186 of file list.c.
Referenced by action_list_clear(), actions_make_private_copy(), bless_buffer_redo(), bless_buffer_undo(), and undo_list_enforce_limit().

| int list_free | ( | list_t * | list | ) |
Frees a list.
This function does not free the data stored in the list.
Definition at line 79 of file list.c.
Referenced by bless_buffer_free(), bless_buffer_new(), free_edge_list(), free_vertex_list(), overlap_graph_get_removed_edges(), overlap_graph_get_vertices_topo(), and segcol_list_new().

| struct list_node* list_head | ( | list_t * | list | ) | [read] |
Gets the head node of a list.
Definition at line 96 of file list.c.
References list::head.
Referenced by action_list_clear(), actions_make_private_copy(), bless_buffer_can_redo(), bless_buffer_can_undo(), bless_buffer_free(), bless_buffer_save(), free_edge_list(), free_vertex_list(), overlap_graph_get_removed_edges(), overlap_graph_get_vertices_topo(), topo_visit(), and undo_list_enforce_limit().

| int list_insert_after | ( | struct list_node * | p, | |
| struct list_node * | q | |||
| ) |
Inserts a node after another node in a list.
| p | the node to which the new noded is inserted after | |
| q | the node to insert |
Definition at line 144 of file list.c.
References list_insert_chain_after().
Referenced by topo_visit().


| int list_insert_before | ( | struct list_node * | p, | |
| struct list_node * | q | |||
| ) |
Inserts a node before another node in a list.
| p | the node to which the new noded is inserted before | |
| q | the node to insert |
Definition at line 121 of file list.c.
Referenced by bless_buffer_redo(), bless_buffer_undo(), buffer_action_multi_add(), overlap_graph_get_removed_edges(), and undo_list_append().

| int list_insert_chain_after | ( | struct list_node * | p, | |
| struct list_node * | first, | |||
| struct list_node * | last | |||
| ) |
Inserts a chain of nodes after another node in a list.
| p | the node after which the node chain is inserted | |
| first | the first node in the chain to insert | |
| last | the last node in the chain to insert |
Definition at line 159 of file list.c.
Referenced by list_insert_after().

| struct list_node* list_tail | ( | list_t * | list | ) | [read] |
Gets the tail node of a list.
Definition at line 108 of file list.c.
References list::tail.
Referenced by actions_make_private_copy(), bless_buffer_redo(), bless_buffer_undo(), buffer_action_multi_add(), overlap_graph_get_removed_edges(), and undo_list_append().

1.6.1