src/clustal/list.c File Reference

#include <assert.h>
#include <string.h>
#include "list.h"
#include <stdlib.h>
Include dependency graph for list.c:
This graph shows which files directly or indirectly include this file:

Functions

void ListInit (list_t *prList, void(*destroy)(void *data))
 Initialise data members of a list.
void ListDestroy (list_t *prList)
 Calls user defined function to free data in list and resets the list to NULL. Call even if your destroy function is NULL.
int ListInsertNext (list_t *prList, list_elem_t *prElement, const void *pvData)
 Insert data next to given element.
int ListRemoveNext (list_t *prList, list_elem_t *prElement, void **pvData_p)
 Remove next element from current element/position.
int IntListInsertNext (list_t *prList, list_elem_t *prElement, const int data)
 Insert int next to given element.
int IntListRemoveNext (list_t *prList, list_elem_t *prElement, int *iData_p)
 Remove next element from current element/position.

Function Documentation

int IntListInsertNext ( list_t prList,
list_elem_t prElement,
const int  data 
)

Insert int next to given element.

Parameters:
[in] prList List into which to insert
[in] prElement Current position/element. Element after which to insert. If NULL head is used.
[in] data int to store
Returns:
Non-zero on failure
int IntListRemoveNext ( list_t prList,
list_elem_t prElement,
int *  iData_p 
)

Remove next element from current element/position.

Parameters:
[in] prList List from which an element is to be removed.
[in] prElement Current element/position. Next item will be removed. If NULL head is used.
[out] iData_p Will be pointed to removed elements data.
Returns:
Non-zero on failure
void ListDestroy ( list_t prList  ) 

Calls user defined function to free data in list and resets the list to NULL. Call even if your destroy function is NULL.

Parameters:
[in] prList The list to destroy
void ListInit ( list_t prList,
void(*)(void *data)  destroy 
)

Initialise data members of a list.

Parameters:
[in] prList List to initialise
[in] destroy A function to be called with pointer to data when destroying the list. NULL if in doubt, free in most other cases. Note: doxygen will always fail to parse this...
int ListInsertNext ( list_t prList,
list_elem_t prElement,
const void *  pvData 
)

Insert data next to given element.

Parameters:
[in] prList List into which to insert
[in] prElement Current position/element. Element after which to insert. If NULL head is used.
[in] pvData Pointer to data to store
Returns:
Non-zero on failure
int ListRemoveNext ( list_t prList,
list_elem_t prElement,
void **  pvData_p 
)

Remove next element from current element/position.

Parameters:
[in] prList List from which an element is to be removed.
[in] prElement Current element/position. Next item will be removed. If NULL head is used.
[out] pvData_p Will be pointed to removed elements data.
Returns:
Non-zero on failure
Generated on Fri Aug 31 05:32:52 2012 for Clustal Omega by  doxygen 1.6.3