Main Page | Data Structures | File List | Data Fields | Globals

llist.c File Reference

#include "llist.h"

Functions

void llist_node_print (Llist *node, int spaces)
Comparison llist_node_compare (Llist *na, Llist *nb, CompareFunc cfunc)
Llistllist_append (Llist *list, void *data)
Llistllist_prepend (Llist *list, void *data)
Llistllist_remove (Llist *list, void *data)
Llistllist_remove_cfunc (Llist *list, void *data, CompareFunc cfunc)
Llistllist_remove_opfunc (Llist *list, void *data, OperationFunc opfunc)
Llistllist_remove_cfunc_opfunc (Llist *list, void *data, CompareFunc cfunc, OperationFunc opfunc)
Llistllist_duplicate (Llist *origlist)
void llist_free (Llist *list)
void llist_free_opfunc (Llist *list, OperationFunc opfunc)
Llistllist_seek (Llist *list, void *data)
Llistllist_seek_cfunc (Llist *list, void *data, CompareFunc cfunc)
Llistllist_seek_position (Llist *list, unsigned long pos)
Llistllist_rewind (Llist *list)
Llistllist_fastforward (Llist *list)
Llistllist_reverse (Llist *list)
Llistllist_bubblesort (Llist *list, CompareFunc cfunc)
Llistllist_quicksort (Llist *list, CompareFunc cfunc)
Llistllist_data_rise (Llist *list, void *data)
Llistllist_data_fall (Llist *list, void *data)
void llist_autorewind_set (Llist *list, int autorewind)
void llist_default_autorewind_set (int autorewind)
void llist_pivot_threshold_set (Llist *list, int pivot_threshold)
unsigned long llist_length (Llist *list)
unsigned long llist_length_recalculate (Llist *list)
void llist_extras_print (Llist *list)

Detailed Description

A link list implementation. v3.0

Function Documentation

Llist* llist_append Llist list,
void *  data
 

Parameters:
list The list to modify.
data The pointer to append.
Return values:
#Llist * Of the list, pointing to the new node.
NULL On 'out of memory' or error.
Description:
Appends a data pointer to the linked list.
Note:
Its recommended you use lla() instead unless you defiantly need error checking incase an 'out of memory' failure happens.

void llist_autorewind_set Llist list,
int  autorewind
 

Parameters:
list The list you want to update.
autorewind The new autorewind flag setting (TRUE or FALSE).
Description:
Set or Un-set the auto rewind flag. Set this flag if you want all modifying functions to return the first node in the list after their operation.
Note:
The list rewinding is O(1) and does not take up any processor time, this is purely preference.

Llist* llist_bubblesort Llist list,
CompareFunc  cfunc
 

Description:
Depreciated, please do not use this function for new programs, it will be phased out after llist_quicksort is concidered Rock Solid(tm).

Llist* llist_data_fall Llist list,
void *  data
 

Parameters:
list The linked list.
data The data pointer to move.
Description:
Moves the specifyed data pointer tward the end of the list by one node. If this is the last node nothing is done.
Note:
It is recomended you use llfall() instead of calling this function directly.

Llist* llist_data_rise Llist list,
void *  data
 

Parameters:
list The linked list.
data The data pointer to move.
Description:
Moves the specifyed data pointer tward the beginning of the list by one node. If this is the first node nothing is done.
Note:
It is recomended you use llrise() instead of calling this function directly.

void llist_default_autorewind_set int  autorewind  ) 
 

Parameters:
autorewind The default autorewind flag setting (TRUE or FALSE).
Description:
Set or Un-set the default auto rewind flag. This is simular to #llist_autorewind() except that this setting is used for all newly created lists. The default is TRUE.
Note:
The list rewinding is O(1) and does not take up any processor time, this is purely preference.

Llist* llist_duplicate Llist origlist  ) 
 

Parameters:
origlist The list to modify.
Return values:
#Llist * A newly allocated, duplicate list.
NULL On error.
Description:
Duplicates a linked list. Node order is maintained.

void llist_extras_print Llist list  ) 
 

Parameters:
list The list you want to display the extra info from.
Description:
Displays the LlistExtras attached to the supplied list.
Note:
This is only usefull for debugging internal llist functions.

Llist* llist_fastforward Llist list  ) 
 

Parameters:
list The list to fastworward.
Return values:
#Llist * Of the last node in the supplied list.
NULL On error.
Description:
Returns the last node in the suplied list.
Note:
It is recomended you use llff() instead of calling this function directly.

void llist_free Llist list  ) 
 

Parameters:
list The list to free.
Description:
Frees a list and all its member nodes.
Note:
It is recomended you use llfree() instead of calling this function directly.

void llist_free_opfunc Llist list,
OperationFunc  opfunc
 

Parameters:
list The list to free.
opfunc The operation function to call on each nodes data.
Description:
Frees a list and all the member nodes. The operation function is called on each nodes data as the node is removed.
Note:
It is recomended you use llfreeop() instead of calling this function directly.

unsigned long llist_length Llist list  ) 
 

Parameters:
list The list you want the number of nodes from.
Return values:
int With the number of nodes present in the list.
0 On error or NULL list.
Description:
Retrieves the number of nodes present in the linked list.
Note:
It is recomended you use lllen() instead of calling this function directly.

unsigned long llist_length_recalculate Llist list  ) 
 

Parameters:
list The list you want the number of nodes from.
Return values:
int With the number of nodes present in the list.
0 On error or NULL list.
Description:
Forcefully recalculates the number of nodes present in the list the updates internaly and returns the result.

Comparison llist_node_compare Llist na,
Llist nb,
CompareFunc  cfunc
 

Parameters:
na The first list node to compare.
nb The second list node to compare.
cfunc The comparison function for the nodes' data.
Return values:
#CLessThan If 'na' is NULL or the compare function determines 'na's data to be less than 'nb's data.
#CEqualTo If 'cfunc' determines 'na's data to beequal to 'nb's data.
#CGreaterThan If 'nb' is NULL or the compare determines 'na's data to be less than 'nb's data.
Description:
This function is used internaly by the sort and seek functions. Its not suggested to call it unless you write an external sorting or seeking function.

void llist_node_print Llist node,
int  spaces
 

Parameters:
node The list node print.
spaces The number of spaces to append to the beginning of the output.
Description:
Prints the memory contents of a Node. Only useful for debugging.

void llist_pivot_threshold_set Llist list,
int  pivot_threshold
 

Parameters:
list The list you want to update.
pivot_threshold The new pivot threshold value.
Description:
Changes the default pivot threshold used when quick sorting. If you are not familiar with this term its best to leave it alone.

Llist* llist_prepend Llist list,
void *  data
 

Parameters:
list The list to modify.
data The pointer to append.
Return values:
#Llist * Of the list, pointing to the new node.
NULL On error.
Description:
Appends a data pointer to the linked list.
Note:
Its recommended you use llp() instead unless you defiantly need error checking incase an 'out of memory' failure happens.

Llist* llist_quicksort Llist list,
CompareFunc  cfunc
 

Parameters:
list The linked list to sort.
cfunc The comparison function
Return values:
#Llist * Of the sorted list.
NULL This should never be returned unless theirs a major bug.
Description:
Sorts the supplied linked list using the comparison function to determine the order of the data.
Note:
The Old list will likely be destroyed during the sort. If you wish to maintain a unsorted copy use llist_duplicate to back up the list before you use this function.

Llist* llist_remove Llist list,
void *  data
 

Parameters:
list The list to modify.
data The pointer to remove.
Return values:
#Llist * Of the list, pointing to the next or first node.
NULL When no more nodes are in the list or on error.
Description:
Removes a data pointer from the linked list.
Note:
Its recommended you use llrm() instead of calling this function directly.

Llist* llist_remove_cfunc Llist list,
void *  data,
CompareFunc  cfunc
 

Parameters:
list The list to modify.
data The pointer to compare.
cfunc The comparison function.
Return values:
#Llist * Of the list, pointing to the next or first node.
NULL When no more nodes are in the list or on error.
Description:
Removes a data pointer from the linked list useing the comparison function to locate the data to be removed.
Note:
Its recommended you use llrmcf() instead of calling this function directly.

Llist* llist_remove_cfunc_opfunc Llist list,
void *  data,
CompareFunc  cfunc,
OperationFunc  opfunc
 

Parameters:
list The list to modify.
data The pointer to compare.
cfunc The comparison function.
opfunc The operation function.
Return values:
#Llist * Of the list, pointing to the next or first node.
NULL When no more nodes are in the list or on error.
Description:
Removes a data pointer from the linked list useing the comparison function to locate the data to be removed. Then calling the operation function on the data to be removed.
Note:
Its recommended you use llrmcfop() instead of calling this function directly.

Llist* llist_remove_opfunc Llist list,
void *  data,
OperationFunc  opfunc
 

Parameters:
list The list to modify.
data The pointer to remove.
opfunc The operation function.
Return values:
#Llist * Of the list, pointing to the next or first node.
NULL When no more nodes are in the list or on error.
Description:
Removes a data pointer from the linked, then calling the operation function on the data to be removed.
Note:
Its recommended you use llrmop() instead of calling this function directly.

Llist* llist_reverse Llist list  ) 
 

Parameters:
list The list to reverse.
Return values:
#Llist * Of the first node in the recorded list.
NULL On error.
Description:
Reverses the contents order of the linked list.
Note:
It is recomended you use llrev() instead of calling this function directly.

Llist* llist_rewind Llist list  ) 
 

Parameters:
list The list to rewind.
Return values:
#Llist * Of the first node in the suplied list.
NULL On error.
Description:
Returns the first node in the supplied list.
Note:
It is recomended you use llrew() instead of calling this function directly.

Llist* llist_seek Llist list,
void *  data
 

Parameters:
list The list to seek through.
data The data pointer to search for.
Return values:
#Llist * The node containing the found data pointer.
NULL When no match is found or error.
Description:
Searches a linked list for the data pointer supplied.
Note:
Not a very usefull function.

Llist* llist_seek_cfunc Llist list,
void *  data,
CompareFunc  cfunc
 

Parameters:
list The list to seek in.
data The pointer to compare.
cfunc The comparison function to call.
Return values:
#Llist * The node containing the found data pointer.
NULL When no match is found or error.
Description:
Searches the linked list using the comparison function to locate the requested data and returns the node containing the found data pointer.
Note:
It is recomended you use llseekcf() instead of calling this function directly.

Llist* llist_seek_position Llist list,
unsigned long  pos
 

Parameters:
list The list to seek in.
pos The desired posistion in the list.
Return values:
#Llist * Of the node containing found data pointer.
NULL When no match is found or error.
Description:
Seeks to the n'th node in the list and returns the node containing the requested data pointer.
Note:
It is recomended you use llseekp() instead of calling this function directly.


Generated on Fri Jun 4 18:35:19 2004 for cuf by doxygen 1.3.6