dll.h File Reference

Definitions for doubly linked list library. More...

Go to the source code of this file.

Classes

struct  Node
 A node in a doubly linked list. More...

Functions

struct NodegetFirstNode (struct Node *node)
 Given any node in a list, return the first node in the list.
struct NodegetLastNode (struct Node *node)
 Given any node in a list, return the last node in the list.
void insertBefore (struct Node *rootNode, struct Node *newNode)
 Insert newNode in the list before rootNode.
void insertAfter (struct Node *rootNode, struct Node *newNode)
 Insert newNode in the list after rootNode.
void deleteNode (struct Node *node)
 Delete the node from the list.
struct NodesearchList (struct Node *node, char *searchString)
 Search the list for a node containing searchString.
char * joinList (struct Node *node, char *joinString)
 Join the strings in a list on a given string.


Detailed Description

Definitions for doubly linked list library.


Function Documentation

void deleteNode ( struct Node node  ) 

Delete the node from the list.

Removes the given node from the list. This is done by linking it's previous and next nodes to each other, and setting the given nodes previous and next fields to NULL. Note that the memory used by the Node is not freed.

char* joinList ( struct Node node,
char *  joinString 
)

Join the strings in a list on a given string.

Given any node in a list, and a string, return the strings of all the nodes in the list in list order with joinString inserted inbetween each one. EG if the list contains ['foo', 'bar'], and it is joined with 'ack', the result will be 'fooackbar'.

struct Node* searchList ( struct Node node,
char *  searchString 
) [read]

Search the list for a node containing searchString.

Given any node in a list, search the list for a node containing the given search string and return a pointer to that node. Searches forwards, then backwards from given node.


Generated on Thu Mar 27 15:55:52 2008 for doublylinkedlist by  doxygen 1.5.3