src/list.c File Reference

List implementation. More...

#include "list.h"
#include <errno.h>
#include <stdlib.h>
#include "debug.h"
Include dependency graph for list.c:

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.

Detailed Description

List implementation.

Definition in file list.c.


Function Documentation

int _list_new ( list_t **  list,
size_t  ln_offset 
)

Creates a new doubly linked list.

Parameters:
[out] list the created list
ln_offset the offset of the struct list_node in the list entries
Returns:
the operation error code

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.

Parameters:
first the first node in the chain to delete
last the last node in the chain to delete
Returns:
the operation error code

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().

Here is the caller graph for this function:

int list_free ( list_t list  ) 

Frees a list.

This function does not free the data stored in the list.

Parameters:
list the list to free
Returns:
the operation error code

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().

Here is the caller graph for this function:

struct list_node* list_head ( list_t list  )  [read]

Gets the head node of a list.

Parameters:
list pointer to the list
Returns:
a list_node pointer to the head node of the 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().

Here is the caller graph for this function:

int list_insert_after ( struct list_node *  p,
struct list_node *  q 
)

Inserts a node after another node in a list.

Parameters:
p the node to which the new noded is inserted after
q the node to insert
Returns:
the operation error code

Definition at line 144 of file list.c.

References list_insert_chain_after().

Referenced by topo_visit().

Here is the call graph for this function:

Here is the caller graph for this function:

int list_insert_before ( struct list_node *  p,
struct list_node *  q 
)

Inserts a node before another node in a list.

Parameters:
p the node to which the new noded is inserted before
q the node to insert
Returns:
the operation error code

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().

Here is the caller graph for this function:

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.

Parameters:
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
Returns:
the operation error code

Definition at line 159 of file list.c.

Referenced by list_insert_after().

Here is the caller graph for this function:

struct list_node* list_tail ( list_t list  )  [read]

Gets the tail node of a list.

Parameters:
list pointer to the list
Returns:
a list_node pointer to the tail node of the 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().

Here is the caller graph for this function:


Generated on Sun Nov 15 15:27:47 2009 for libbls by  doxygen 1.6.1