Trees | Indices | Help |
|
---|
|
This class provides thin wrappers around the functions in my doubly linklist C library.
create()
-- Creates and initializes the link list.
This method both creates and initializes the list and should be
used in preference to the next two methods except in rare cases.
createList()
-- List creation method.
initialize()
-- List initialization method.
destroyList()
-- List removal method.
version()
-- Get the version information and a list
of contributers to this project.
isListEmpty()
-- Check if the list is empty.
isListFull()
-- Check if the list is full.
getNumberOfRecords()
-- Get the number of records in
the link list.
setSearchModes()
-- Sets the search
origin
and dir
modes.
getSearchModes()
-- Get the search modes, a tuple of
origin and direction.
getCurrentIndex()
-- Get the current index value.
currentPointerToHead()
-- Moves the current pointer
to the head of the list.
currentPointerToTail()
-- Moves the current pointer
to the tail of the list.
incrementCurrentPointer()
-- Moves the current
pointer to the next Node
.
decrementCurrentPointer()
-- Moves the current
pointer to the prior Node
.
storeCurrentPointer()
-- Store the current pointer
in the control List
class.
restoreCurrentPointer()
-- Restore the current
pointer from the control List
class.
addRecord()
-- Adds a record to the link list.
insertRecord()
-- Inserts a record relative to the
current pointer.
swapRecord()
-- Swaps current record up or down one
position in the list.
updateCurrentRecord()
-- Updates the current record.
deleteCurrentRecord()
-- Delete a record from the
list.
deleteAllNodes()
-- Deletes all the
Info
and their Node
objects from the
list then reinitializes the control List
.
findRecord()
-- Find a record
in the
list with search criteria passed into match
.
findNthRecord()
-- Return the Nth record in the list
based on the setting of origin and direction values in the
control List
.
getCurrentRecord()
-- Return the current record.
getPriorRecord()
-- Return the prior record relative
to the current pointer.
getNextRecord()
-- Return the next record relative
to the current pointer.
saveList()
-- Save list to disk.
loadList()
-- Load list from disk.
compare()
-- A basic compare function. You may need
to write your own.
checkInfoType()
-- Utility method to check that the
Info
object is valid.
|
|||
|
|||
ctypes POINTER
|
|
||
ctypes POINTER
|
|
||
|
|||
|
|||
str
|
|
||
bool
|
|
||
bool
|
|
||
int
|
|
||
tuple
|
|
||
tuple
|
|
||
int
|
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Info
|
|
||
Info
|
|
||
Info
|
|
||
Info
|
|
||
Info
|
|
||
|
|||
|
|||
ctypes POINTER
|
|
||
|
|||
Inherited from |
|
|||
__LIBRARY =
|
|
|||
Inherited from |
|
The constructor creates logging and instantiates the library object.
|
Creates and initializes the link list. This method should be used
instead of the
|
Creates the The List *DLL_CreateList(List **list); Arguments: list -- Pointer to a pointer to a name of a structure to create. Returns : Pointer to created structure NULL if unsuccessful}
|
Initializes the The DLL_Return DLL_InitializeList(List *list, size_t infosize); Arguments: list -- Pointer to type List infosize -- Size of user Info Returns : DLL_NORMAL -- Initialization was done successfully DLL_ZERO_INFO -- sizeof(Info) is zero DLL_NULL_LIST -- Info is NULL
|
Deallocates the memory of all The void DLL_DestroyList(List **list); Arguments: list -- Pointer to a pointer to a name of a structure to destroy. Returns : void
|
Get the version information and a list of contributors to this project. The DLL_Version() : Returns a pointer to version information Arguments: void Return : char * -- Pointer to version info
|
Check if the list is empty. The DLL_Boolean DLL_IsListEmpty(List *list); Arguments: list -- Pointer to type List Returns : DLL_TRUE -- List is empty DLL_FALSE -- List has items in it
|
Check if the list is full, meaning memory is exhausted. The DLL_Boolean DLL_IsListFull(List *list); Arguments: list -- Pointer to type List Returns : DLL_TRUE -- List is full (memory dependent) DLL_FALSE -- List is empty or partially full
|
Get the number of records in the link list. The unsigned long DLL_GetNumberOfRecords(List *list); Arguments: list -- Pointer to type List Returns : Number of records in list
|
Sets the search The DLL_Return DLL_SetSearchModes(List *list, DLL_SrchOrigin origin, DLL_SrchDir dir); Arguments: list -- Pointer to type List origin -- Indicates the start search pointer to use dir -- Indicates the direction to search in Returns : DLL_NORMAL -- Values assigned were accepted DLL_NOT_MODIFIED -- Values were not assigned--invalid type (previous values are still in place)
|
Get the search modes, a tuple of origin and direction. The DLL_SearchModes DLL_GetSearchModes(List *list, DLL_SearchModes *ssp); Arguments: list -- Pointer to type List ssp -- Save structure pointer Returns : Pointer to type DLL_SearchModes
|
Get the current index value. The unsigned long DLL_GetCurrentIndex(List *list); Arguments: list -- Pointer to type List Returns : Current record's index
|
Moves the current pointer to the head of the list. The DLL_Return DLL_CurrentPointerToHead(List *list); Arguments: list -- Pointer to type List Returns : DLL_NORMAL -- Record found DLL_NULL_LIST -- Empty list
|
Moves the current pointer to the tail of the list. The DLL_Return DLL_CurrentPointerToTail(List *list); Arguments: list -- Pointer to type List Returns : DLL_NORMAL -- Record found DLL_NULL_LIST -- Empty list
|
Moves the current pointer to the next The DLL_Return DLL_IncrementCurrentPointer(List *list); Arguments: list -- Pointer to type List Returns : DLL_NORMAL -- Record found DLL_NULL_LIST -- Empty list DLL_NOT_FOUND -- Record not found
|
Moves the current pointer to the prior The DLL_Return DLL_DecrementCurrentPointer(List *list); Arguments: list -- Pointer to type List Returns : DLL_NORMAL -- Record found DLL_NULL_LIST -- Empty list DLL_NOT_FOUND -- Record not found
|
Store the current pointer in the control The DLL_Return DLL_StoreCurrentPointer(List *list); Arguments: list -- Pointer to type List Returns : DLL_NORMAL -- Record found DLL_NOT_FOUND -- Record not found
|
Restore the current pointer from the control The DLL_Return DLL_restoreCurrentPointer(List *list); Arguments: list -- Pointer to type List Returns : DLL_NORMAL -- Record found DLL_NOT_FOUND -- Record not found
|
Adds a record to the link list. If The DLL_Return DLL_AddRecord(List *list, Info *info, int (*pFun)(Info *, Info *)); Arguments: list -- Pointer to type List info -- Pointer to record to add pFun -- Pointer to search function Returns : DLL_NORMAL -- Node was added successfully DLL_MEM_ERROR -- Memory allocation failed
|
Inserts a record relative to the current pointer and is determined by
the The DLL_Return DLL_InsertRecord(List *list, Info *info, DLL_InsertDir dir); Arguments: list -- Pointer to type List info -- Record to add dir -- Direction to insert, can be DLL_ABOVE (toward head) or DLL_BELOW (toward tail) Returns : DLL_NORMAL -- Node was added successfully DLL_MEM_ERROR -- Memory allocation failed DLL_NOT_MODIFIED -- Insert direction is invalid (not DLL_ABOVE or DLL_BELOW)
|
Swaps current record up or down one position in the list. The swapped
record will still be current after completion. If The DLL_Return DLL_SwapRecord(List *list, DLL_InsertDir dir); Arguments: list -- Pointer to type List dir -- Direction to swap, can be DLL_ABOVE (toward head) or DLL_BELOW (toward tail) Returns : DLL_NORMAL -- Node was swapped successfully DLL_NULL_LIST -- list->current is NULL DLL_NOT_MODIFIED -- Swap direction not DLL_ABOVE or DLL_BELOW DLL_NOT_FOUND -- Current record is already at end of list indicated by dir.
|
Updates the current record. The entire record is over written. The DLL_Return DLL_UpdateCurrentRecord(List *list, Info *record); Arguments: list -- Pointer to type List record -- Pointer to an Info structure in list Returns : DLL_NORMAL -- Record updated DLL_NULL_LIST -- Empty list
|
Delete a record from the list. This removes the The DLL_Return DLL_DeleteCurrentRecord(List *list); Arguments: list -- Pointer to type List Returns : DLL_NORMAL -- Record deleted DLL_NULL_LIST -- List is empty
|
Deletes all the The DLL_Return DLL_DeleteEntireList(List *list); Arguments: list -- Pointer to type List Returns : DLL_NORMAL -- List deleted DLL_NULL_LIST -- List is empty
|
Find a The DLL_Return DLL_FindRecord(List *list, Info *record, Info *match, int (*pFun)(Info *, Info *)); Arguments: list -- Pointer to type List record -- Pointer to an Info structure in list match -- Pointer to an Info structure to match to Node in list pFun -- Pointer to search function Returns : DLL_NORMAL -- Record found DLL_NULL_LIST -- Empty list DLL_NOT_FOUND -- Record not found DLL_NULL_FUNCTION -- pFun is NULL
|
Returns the Nth record in the list based on the setting of origin and
direction values in the control The DLL_Return DLL_FindNthRecord(List *list, Info *record, unsigned long skip); Arguments: list -- Pointer to type List record -- Record to hold return data skip -- Number of records to skip (Always a positive number) Returns : DLL_NORMAL -- Node was found successfully DLL_NULL_LIST -- list->current is NULL DLL_NOT_FOUND -- Index value is too large or wrong dir value (current record index remains unchanged)
|
Return the current record. The DLL_Return DLL_GetCurrentRecord(List *list, Info *record); Arguments: list -- Pointer to type List record -- Pointer to an Info structure Returns : DLL_NORMAL -- Record returned DLL_NULL_LIST -- List is empty
|
Return the prior record relative to the current pointer. The DLL_Return DLL_GetPriorRecord(List *list, Info *record); Arguments: list -- Pointer to type List record -- Pointer to an Info structure Returns : DLL_NORMAL -- Record returned DLL_NULL_LIST -- List is empty DLL_NOT_FOUND -- Beginning of list
|
Return the next record relative to the current pointer. The DLL_Return DLL_GetNextRecord(List *list, Info *record); Arguments: list -- Pointer to type List record -- Pointer to an Info structure Returns : DLL_NORMAL -- Record returned DLL_NULL_LIST -- List is empty DLL_NOT_FOUND -- End of list
|
Save list to disk. The file is saved in binary format because the
fields in the The DLL_Return DLL_SaveList(List *list, const char *path); Arguments: list -- Pointer to type List path -- Pointer to path and filename Return : DLL_NORMAL -- File written successfully DLL_NULL_LIST -- List is empty DLL_OPEN_ERROR -- File open error DLL_WRITE_ERROR -- File write error DLL_NOT_MODIFIED -- Unmodified list no save was done
|
Load list from disk. When using the The DLL_Return DLL_LoadList(List *list, const char *path, int (*pFun)(Info *, Info *)); Arguments: list -- Pointer to type List path -- Pointer to path and filename pFun -- Pointer to search function Return : DLL_NORMAL -- File written successfully DLL_MEM_ERROR -- Memory allocation failed DLL_OPEN_ERROR -- File open error DLL_READ_ERROR -- File read error
|
A basic compare function. You may need to write your own.
|
Utility method to check that the
|
|
__LIBRARY
|
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Tue Jan 17 12:57:09 2012 | http://epydoc.sourceforge.net |