gwenhywfar 4.0.3
Typedefs | Functions

Generic List Handling

Basic Stuff

Typedefs

typedef struct GWEN_LIST GWEN_CONSTLIST
 Doubly-linked list with const objects.
typedef const void *(* GWEN_CONSTLIST_FOREACH_CB )(const void *element, void *user_data)
typedef struct GWEN_LIST_ITERATOR GWEN_CONSTLIST_ITERATOR
typedef struct GWEN_LIST GWEN_LIST
 Doubly-linked list.
typedef void *(* GWEN_LIST_FOREACH_CB )(void *element, void *user_data)
typedef struct GWEN_LIST_ITERATOR GWEN_LIST_ITERATOR

Functions

GWENHYWFAR_API void GWEN_ConstList_Clear (GWEN_CONSTLIST *l)
GWENHYWFAR_API const void * GWEN_ConstList_Contains (const GWEN_CONSTLIST *l, const void *element)
GWENHYWFAR_API void GWEN_ConstList_Erase (GWEN_CONSTLIST *l, GWEN_CONSTLIST_ITERATOR *it)
GWENHYWFAR_API
GWEN_CONSTLIST_ITERATOR
GWEN_ConstList_FindIter (const GWEN_CONSTLIST *l, const void *element)
GWENHYWFAR_API
GWEN_CONSTLIST_ITERATOR
GWEN_ConstList_First (const GWEN_CONSTLIST *l)
GWENHYWFAR_API const void * GWEN_ConstList_ForEach (GWEN_CONSTLIST *list, GWEN_CONSTLIST_FOREACH_CB func, void *user_data)
GWENHYWFAR_API void GWEN_ConstList_free (GWEN_CONSTLIST *l)
GWENHYWFAR_API const void * GWEN_ConstList_GetBack (const GWEN_CONSTLIST *l)
GWENHYWFAR_API const void * GWEN_ConstList_GetFront (const GWEN_CONSTLIST *l)
GWENHYWFAR_API unsigned int GWEN_ConstList_GetSize (const GWEN_CONSTLIST *l)
GWENHYWFAR_API int GWEN_ConstList_IsEmpty (const GWEN_LIST *l)
GWENHYWFAR_API
GWEN_CONSTLIST_ITERATOR
GWEN_ConstList_Last (const GWEN_CONSTLIST *l)
GWENHYWFAR_API GWEN_CONSTLISTGWEN_ConstList_new ()
GWENHYWFAR_API void GWEN_ConstList_PopBack (GWEN_CONSTLIST *l)
GWENHYWFAR_API void GWEN_ConstList_PopFront (GWEN_CONSTLIST *l)
GWENHYWFAR_API void GWEN_ConstList_PushBack (GWEN_CONSTLIST *l, const void *p)
GWENHYWFAR_API void GWEN_ConstList_PushFront (GWEN_CONSTLIST *l, const void *p)
GWENHYWFAR_API void GWEN_ConstList_Remove (GWEN_CONSTLIST *l, const void *element)
GWENHYWFAR_API const void * GWEN_ConstListIterator_Data (GWEN_CONSTLIST_ITERATOR *li)
GWENHYWFAR_API void GWEN_ConstListIterator_free (GWEN_CONSTLIST_ITERATOR *li)
GWENHYWFAR_API
GWEN_CONSTLIST_ITERATOR
GWEN_ConstListIterator_new (const GWEN_CONSTLIST *l)
GWENHYWFAR_API const void * GWEN_ConstListIterator_Next (GWEN_CONSTLIST_ITERATOR *li)
GWENHYWFAR_API const void * GWEN_ConstListIterator_Previous (GWEN_CONSTLIST_ITERATOR *li)
GWENHYWFAR_API void GWEN_List_Clear (GWEN_LIST *l)
GWENHYWFAR_API const void * GWEN_List_Contains (GWEN_LIST *l, const void *element)
GWENHYWFAR_API void GWEN_List_Dump (const GWEN_LIST *l, FILE *f, unsigned int indent)
GWENHYWFAR_API GWEN_LISTGWEN_List_dup (const GWEN_LIST *l)
GWENHYWFAR_API void GWEN_List_Erase (GWEN_LIST *l, GWEN_LIST_ITERATOR *it)
GWENHYWFAR_API GWEN_LIST_ITERATORGWEN_List_FindIter (GWEN_LIST *l, const void *element)
GWENHYWFAR_API GWEN_LIST_ITERATORGWEN_List_First (const GWEN_LIST *l)
GWENHYWFAR_API void * GWEN_List_ForEach (GWEN_LIST *list, GWEN_LIST_FOREACH_CB func, void *user_data)
GWENHYWFAR_API void GWEN_List_free (GWEN_LIST *l)
GWENHYWFAR_API void * GWEN_List_GetBack (const GWEN_LIST *l)
GWENHYWFAR_API GWEN_REFPTRGWEN_List_GetBackRefPtr (const GWEN_LIST *l)
GWENHYWFAR_API void * GWEN_List_GetFront (const GWEN_LIST *l)
GWENHYWFAR_API GWEN_REFPTRGWEN_List_GetFrontRefPtr (const GWEN_LIST *l)
GWENHYWFAR_API GWEN_REFPTR_INFOGWEN_List_GetRefPtrInfo (const GWEN_LIST *l)
GWENHYWFAR_API unsigned int GWEN_List_GetSize (const GWEN_LIST *l)
GWENHYWFAR_API int GWEN_List_IsEmpty (const GWEN_LIST *l)
GWENHYWFAR_API GWEN_LIST_ITERATORGWEN_List_Last (const GWEN_LIST *l)
GWENHYWFAR_API GWEN_LISTGWEN_List_new ()
GWENHYWFAR_API void GWEN_List_PopBack (GWEN_LIST *l)
GWENHYWFAR_API void GWEN_List_PopFront (GWEN_LIST *l)
GWENHYWFAR_API void GWEN_List_PushBack (GWEN_LIST *l, void *p)
GWENHYWFAR_API void GWEN_List_PushBackRefPtr (GWEN_LIST *l, GWEN_REFPTR *rp)
GWENHYWFAR_API void GWEN_List_PushFront (GWEN_LIST *l, void *p)
GWENHYWFAR_API void GWEN_List_PushFrontRefPtr (GWEN_LIST *l, GWEN_REFPTR *rp)
GWENHYWFAR_API void GWEN_List_Remove (GWEN_LIST *l, const void *element)
GWENHYWFAR_API void GWEN_List_SetRefPtrInfo (GWEN_LIST *l, GWEN_REFPTR_INFO *rpi)
GWENHYWFAR_API void GWEN_List_Unshare (GWEN_LIST *l)
GWENHYWFAR_API void * GWEN_ListIterator_Data (GWEN_LIST_ITERATOR *li)
GWENHYWFAR_API GWEN_REFPTRGWEN_ListIterator_DataRefPtr (GWEN_LIST_ITERATOR *li)
GWENHYWFAR_API void GWEN_ListIterator_free (GWEN_LIST_ITERATOR *li)
GWENHYWFAR_API unsigned int GWEN_ListIterator_GetLinkCount (const GWEN_LIST_ITERATOR *li)
GWENHYWFAR_API void GWEN_ListIterator_IncLinkCount (GWEN_LIST_ITERATOR *li)
GWENHYWFAR_API GWEN_LIST_ITERATORGWEN_ListIterator_new (const GWEN_LIST *l)
GWENHYWFAR_API void * GWEN_ListIterator_Next (GWEN_LIST_ITERATOR *li)
GWENHYWFAR_API GWEN_REFPTRGWEN_ListIterator_NextRefPtr (GWEN_LIST_ITERATOR *li)
GWENHYWFAR_API void * GWEN_ListIterator_Previous (GWEN_LIST_ITERATOR *li)
GWENHYWFAR_API GWEN_REFPTRGWEN_ListIterator_PreviousRefPtr (GWEN_LIST_ITERATOR *li)

Detailed Description

The macros of this group facilitates typesafe use of lists.


Typedef Documentation

typedef struct GWEN_LIST GWEN_CONSTLIST

Doubly-linked list with const objects.

The list contains pointer to const data objects, with the ability to iterate over the list in both directions.

Definition at line 64 of file list.h.

typedef const void*(* GWEN_CONSTLIST_FOREACH_CB)(const void *element, void *user_data)

Callback function for one const list element.

Definition at line 67 of file list.h.

An iterator for the const doubly-linked list, i.e. a pointer to a specific element

Definition at line 76 of file list.h.

typedef struct GWEN_LIST GWEN_LIST

Doubly-linked list.

The list contains pointer to data objects, with the ability to iterate over the list in both directions.

Definition at line 55 of file list.h.

typedef void*(* GWEN_LIST_FOREACH_CB)(void *element, void *user_data)

Callback function for one list element.

Definition at line 58 of file list.h.

An iterator for the doubly-linked list, i.e. a pointer to a specific element

Definition at line 72 of file list.h.


Function Documentation

GWENHYWFAR_API void GWEN_ConstList_Clear ( GWEN_CONSTLIST l)

Removes all list elements from the list. The elements are not freed.

Definition at line 838 of file list.c.

References GWEN_List_Clear().

Referenced by check_constlist().

GWENHYWFAR_API const void* GWEN_ConstList_Contains ( const GWEN_CONSTLIST l,
const void *  element 
)

Searches whether the list contains the given element. If it does, the pointer to the element is returned. Otherwise, NULL is returned.

Definition at line 887 of file list.c.

References GWEN_ConstList_FindIter(), and GWEN_ConstListIterator_free().

GWENHYWFAR_API void GWEN_ConstList_Erase ( GWEN_CONSTLIST l,
GWEN_CONSTLIST_ITERATOR it 
)

Removes the element currently pointed to by the given iterator from the list. (The element is not freed.) The given iterator is move toward the next element in any case (if there is no next element then the iterator will point to 0).

Definition at line 832 of file list.c.

References GWEN_List_Erase().

Referenced by GWEN_ConstList_Remove().

GWENHYWFAR_API GWEN_CONSTLIST_ITERATOR* GWEN_ConstList_FindIter ( const GWEN_CONSTLIST l,
const void *  element 
)

Finds the LIST_ITERATOR position of the given element. The returned LIST_ITERATOR will be owned by the caller and must be freed when no longer in use. If the list does not contain the element, NULL will be returned.

Definition at line 868 of file list.c.

References GWEN_ConstList_First(), GWEN_ConstListIterator_Data(), GWEN_ConstListIterator_free(), and GWEN_ConstListIterator_Next().

Referenced by GWEN_ConstList_Contains(), and GWEN_ConstList_Remove().

GWENHYWFAR_API GWEN_CONSTLIST_ITERATOR* GWEN_ConstList_First ( const GWEN_CONSTLIST l)

Return an iterator pointing to the first element in the list

Definition at line 907 of file list.c.

References GWEN_List_First().

Referenced by check_constlist(), and GWEN_ConstList_FindIter().

GWENHYWFAR_API const void* GWEN_ConstList_ForEach ( GWEN_CONSTLIST list,
GWEN_CONSTLIST_FOREACH_CB  func,
void *  user_data 
)

Traverses the list, calling the callback function 'func' on each list element. Traversal will stop when 'func' returns a non-NULL value, and the routine will return with that value. Otherwise the routine will return NULL.

Parameters:
listThe list to traverse.
funcThe function to be called with each list element.
user_dataA pointer passed on to the function 'func'.
Returns:
The non-NULL pointer returned by 'func' as soon as it returns one. Otherwise (i.e. 'func' always returns NULL) returns NULL.

Definition at line 843 of file list.c.

References GWEN_List_First(), GWEN_ListIterator_Data(), GWEN_ListIterator_free(), and GWEN_ListIterator_Next().

GWENHYWFAR_API void GWEN_ConstList_free ( GWEN_CONSTLIST l)

Destructor. Frees all of the memory used by this list. The list elements are not freed

Definition at line 780 of file list.c.

References GWEN_List_free().

Referenced by check_constlist().

GWENHYWFAR_API const void* GWEN_ConstList_GetBack ( const GWEN_CONSTLIST l)

Returns the last element of the list. (The element is not removed from the list.)

Definition at line 804 of file list.c.

References GWEN_List_GetBack().

Referenced by check_constlist().

GWENHYWFAR_API const void* GWEN_ConstList_GetFront ( const GWEN_CONSTLIST l)

Returns the first element of the list. (The element is not removed from the list.)

Definition at line 798 of file list.c.

References GWEN_List_GetFront().

Referenced by check_constlist().

GWENHYWFAR_API unsigned int GWEN_ConstList_GetSize ( const GWEN_CONSTLIST l)

Returns the size of this list, i.e. the number of elements in this list.

This number is counted in the list metadata, so this is a cheap operation.

Definition at line 810 of file list.c.

References GWEN_List_GetSize().

Referenced by check_constlist(), and GWEN_ConstList_IsEmpty().

GWENHYWFAR_API int GWEN_ConstList_IsEmpty ( const GWEN_LIST l)

Returns nonzero (TRUE) if this list is empty, and zero (FALSE) if this list is not empty.

Definition at line 814 of file list.c.

References GWEN_ConstList_GetSize().

GWENHYWFAR_API GWEN_CONSTLIST_ITERATOR* GWEN_ConstList_Last ( const GWEN_CONSTLIST l)

Returns an iterator pointing to the last element in the list.

Definition at line 913 of file list.c.

References GWEN_List_Last().

GWENHYWFAR_API GWEN_CONSTLIST* GWEN_ConstList_new ( )

Constructor. Returns a new empty list.

Definition at line 774 of file list.c.

References GWEN_List_new().

Referenced by check_constlist().

GWENHYWFAR_API void GWEN_ConstList_PopBack ( GWEN_CONSTLIST l)

Removes the list's last element from the list. (The element is not freed.)

Definition at line 820 of file list.c.

References GWEN_List_PopBack().

Referenced by check_constlist().

GWENHYWFAR_API void GWEN_ConstList_PopFront ( GWEN_CONSTLIST l)

Removes the list's first element from the list. (The element is not freed.)

Definition at line 826 of file list.c.

References GWEN_List_PopFront().

GWENHYWFAR_API void GWEN_ConstList_PushBack ( GWEN_CONSTLIST l,
const void *  p 
)

Appends an element to a list, making it the new last element.

Definition at line 786 of file list.c.

References GWEN_List_PushBack().

Referenced by check_constlist().

GWENHYWFAR_API void GWEN_ConstList_PushFront ( GWEN_CONSTLIST l,
const void *  p 
)

Inserts an element at the start of the list, making it the new first element.

Definition at line 792 of file list.c.

References GWEN_List_PushFront().

Referenced by check_constlist().

GWENHYWFAR_API void GWEN_ConstList_Remove ( GWEN_CONSTLIST l,
const void *  element 
)

Searches for the first occurrence of the "element" pointer and erases that element from the list. (The element itself is not freed.) I.e. this function calls GWEN_List_Erase on the first occurrence found of "element".

Definition at line 898 of file list.c.

References GWEN_ConstList_Erase(), and GWEN_ConstList_FindIter().

GWENHYWFAR_API const void* GWEN_ConstListIterator_Data ( GWEN_CONSTLIST_ITERATOR li)

Returns the pointer to the element stored at the list position the iterator currently points to.

Definition at line 943 of file list.c.

References GWEN_ListIterator_Data().

Referenced by check_constlist(), and GWEN_ConstList_FindIter().

GWENHYWFAR_API void GWEN_ConstListIterator_free ( GWEN_CONSTLIST_ITERATOR li)

Frees a list iterator.

Definition at line 925 of file list.c.

References GWEN_ListIterator_free().

Referenced by check_constlist(), GWEN_ConstList_Contains(), and GWEN_ConstList_FindIter().

GWENHYWFAR_API GWEN_CONSTLIST_ITERATOR* GWEN_ConstListIterator_new ( const GWEN_CONSTLIST l)

Creates a list iterator for the given list.

Definition at line 919 of file list.c.

References GWEN_ListIterator_new().

GWENHYWFAR_API const void* GWEN_ConstListIterator_Next ( GWEN_CONSTLIST_ITERATOR li)

Moves the list iterator to the successor of the currenty selected element and returns that successor element.

Definition at line 937 of file list.c.

References GWEN_ListIterator_Next().

Referenced by check_constlist(), and GWEN_ConstList_FindIter().

GWENHYWFAR_API const void* GWEN_ConstListIterator_Previous ( GWEN_CONSTLIST_ITERATOR li)

Moves the list iterator to the predecessor of the currenty selected element and returns that predecessor element.

Definition at line 931 of file list.c.

References GWEN_ListIterator_Previous().

Referenced by check_constlist().

GWENHYWFAR_API void GWEN_List_Clear ( GWEN_LIST l)

Removes all list elements from the list. The elements are not freed.

Definition at line 400 of file list.c.

References GWEN__ListPtr_Clear(), GWEN__ListPtr_dup(), and GWEN__ListPtr_free().

Referenced by check_list(), and GWEN_ConstList_Clear().

GWENHYWFAR_API const void* GWEN_List_Contains ( GWEN_LIST l,
const void *  element 
)

Searches whether the list contains the given element. If it does, the pointer to the element is returned. Otherwise, NULL is returned.

Definition at line 557 of file list.c.

References GWEN_List_FindIter(), and GWEN_ListIterator_free().

GWENHYWFAR_API void GWEN_List_Dump ( const GWEN_LIST l,
FILE *  f,
unsigned int  indent 
)

Dumps the contents of the list to an open file (e.g. stderr).

Definition at line 615 of file list.c.

References GWEN_RefPtr_GetData().

GWENHYWFAR_API GWEN_LIST* GWEN_List_dup ( const GWEN_LIST l)

Duplicates a list by returning a reference and using reference-counting.

Definition at line 178 of file list.c.

References GWEN__ListPtr_Attach(), GWEN_INHERIT_INIT, and GWEN_NEW_OBJECT.

Referenced by GWEN_StringList2_dup().

GWENHYWFAR_API void GWEN_List_Erase ( GWEN_LIST l,
GWEN_LIST_ITERATOR it 
)

Removes the element currently pointed to by the given iterator from the list. (The element is not freed.) The given iterator is move toward the next element in any case (if there is no next element then the iterator will point to 0).

Definition at line 455 of file list.c.

References GWEN__ListPtr_dup(), GWEN__ListPtr_free(), and GWEN_ListEntry_free().

Referenced by check_list(), GWEN_ConstList_Erase(), GWEN_List_Remove(), and GWEN_StringList2_RemoveString().

GWENHYWFAR_API GWEN_LIST_ITERATOR* GWEN_List_FindIter ( GWEN_LIST l,
const void *  element 
)

Finds the LIST_ITERATOR position of the given element. The returned LIST_ITERATOR will be owned by the caller and must be freed when no longer in use. If the list does not contain the element, NULL will be returned.

Definition at line 536 of file list.c.

References GWEN_List_First(), GWEN_ListIterator_Data(), GWEN_ListIterator_free(), and GWEN_ListIterator_Next().

Referenced by GWEN_List_Contains(), and GWEN_List_Remove().

GWENHYWFAR_API GWEN_LIST_ITERATOR* GWEN_List_First ( const GWEN_LIST l)

Return an iterator pointing to the first element in the list

Definition at line 582 of file list.c.

References GWEN_ListIterator_new().

Referenced by check_list(), GWEN_ConstList_First(), GWEN_ConstList_ForEach(), GWEN_List_FindIter(), GWEN_List_ForEach(), and GWEN_StringList2_First().

GWENHYWFAR_API void* GWEN_List_ForEach ( GWEN_LIST list,
GWEN_LIST_FOREACH_CB  func,
void *  user_data 
)

Traverses the list, calling the callback function 'func' on each list element. Traversal will stop when 'func' returns a non-NULL value, and the routine will return with that value. Otherwise the routine will return NULL.

Parameters:
listThe list to traverse.
funcThe function to be called with each list element.
user_dataA pointer passed on to the function 'func'.
Returns:
The non-NULL pointer returned by 'func' as soon as it returns one. Otherwise (i.e. 'func' always returns NULL) returns NULL.

Definition at line 418 of file list.c.

References GWEN_List_First(), GWEN_ListIterator_Data(), GWEN_ListIterator_free(), and GWEN_ListIterator_Next().

GWENHYWFAR_API void GWEN_List_free ( GWEN_LIST l)

Destructor. Frees all of the memory used by this list. The list elements are not freed.

Definition at line 167 of file list.c.

References GWEN__ListPtr_free(), GWEN_FREE_OBJECT, GWEN_INHERIT_FINI, and GWEN_RefPtrInfo_free().

Referenced by check_list(), GWEN_ConstList_free(), and GWEN_StringList2_free().

GWENHYWFAR_API void* GWEN_List_GetBack ( const GWEN_LIST l)

Returns the last element of the list. (The element is not removed from the list.)

Definition at line 297 of file list.c.

References GWEN_RefPtr_GetData().

Referenced by check_list(), and GWEN_ConstList_GetBack().

GWENHYWFAR_API GWEN_REFPTR* GWEN_List_GetBackRefPtr ( const GWEN_LIST l)

Returns the last element of the list. (The element is not removed from the list.)

Definition at line 307 of file list.c.

GWENHYWFAR_API void* GWEN_List_GetFront ( const GWEN_LIST l)

Returns the first element of the list. (The element is not removed from the list.)

Definition at line 277 of file list.c.

References GWEN_RefPtr_GetData().

Referenced by check_list(), and GWEN_ConstList_GetFront().

GWENHYWFAR_API GWEN_REFPTR* GWEN_List_GetFrontRefPtr ( const GWEN_LIST l)

Returns the first element of the list. (The element is not removed from the list.)

Definition at line 287 of file list.c.

GWENHYWFAR_API GWEN_REFPTR_INFO* GWEN_List_GetRefPtrInfo ( const GWEN_LIST l)

Definition at line 192 of file list.c.

Referenced by GWEN_StringList2_AppendString(), and GWEN_StringList2_InsertString().

GWENHYWFAR_API unsigned int GWEN_List_GetSize ( const GWEN_LIST l)

Returns the size of this list, i.e. the number of elements in this list.

This number is counted in the list metadata, so this is a cheap operation.

Definition at line 317 of file list.c.

Referenced by check_list(), GWEN_ConstList_GetSize(), and GWEN_List_IsEmpty().

GWENHYWFAR_API int GWEN_List_IsEmpty ( const GWEN_LIST l)

Returns nonzero (TRUE) if this list is empty, and zero (FALSE) if this list is not empty.

Definition at line 323 of file list.c.

References GWEN_List_GetSize().

GWENHYWFAR_API GWEN_LIST_ITERATOR* GWEN_List_Last ( const GWEN_LIST l)

Returns an iterator pointing to the last element in the list.

Definition at line 599 of file list.c.

References GWEN_ListIterator_new().

Referenced by GWEN_ConstList_Last(), and GWEN_StringList2_Last().

GWENHYWFAR_API GWEN_LIST* GWEN_List_new ( )

allow inheriting of lists Constructor. Returns a new empty list.

Definition at line 156 of file list.c.

References GWEN__ListPtr_new(), GWEN_INHERIT_INIT, and GWEN_NEW_OBJECT.

Referenced by check_list(), GWEN_ConstList_new(), and GWEN_StringList2_new().

GWENHYWFAR_API void GWEN_List_PopBack ( GWEN_LIST l)

Removes the list's last element from the list. (The element is not freed.)

Definition at line 328 of file list.c.

References GWEN__ListPtr_dup(), GWEN__ListPtr_free(), and GWEN_ListEntry_free().

Referenced by check_list(), and GWEN_ConstList_PopBack().

GWENHYWFAR_API void GWEN_List_PopFront ( GWEN_LIST l)

Removes the list's first element from the list. (The element is not freed.)

Definition at line 364 of file list.c.

References GWEN__ListPtr_dup(), GWEN__ListPtr_free(), and GWEN_ListEntry_free().

Referenced by GWEN_ConstList_PopFront().

GWENHYWFAR_API void GWEN_List_PushBack ( GWEN_LIST l,
void *  p 
)

Appends an element to a list, making it the new last element.

Definition at line 237 of file list.c.

References GWEN_List_PushBackRefPtr(), and GWEN_RefPtr_new().

Referenced by check_list(), and GWEN_ConstList_PushBack().

GWENHYWFAR_API void GWEN_List_PushBackRefPtr ( GWEN_LIST l,
GWEN_REFPTR rp 
)

Appends an element to a list, making it the new last element.

Definition at line 209 of file list.c.

References GWEN__ListPtr_dup(), GWEN__ListPtr_free(), and GWEN_ListEntry_new().

Referenced by GWEN_List_PushBack(), and GWEN_StringList2_AppendString().

GWENHYWFAR_API void GWEN_List_PushFront ( GWEN_LIST l,
void *  p 
)

Inserts an element at the start of the list, making it the new first element.

Definition at line 271 of file list.c.

References GWEN_List_PushFrontRefPtr(), and GWEN_RefPtr_new().

Referenced by check_list(), and GWEN_ConstList_PushFront().

GWENHYWFAR_API void GWEN_List_PushFrontRefPtr ( GWEN_LIST l,
GWEN_REFPTR rp 
)

Inserts an element at the start of the list, making it the new first element.

Definition at line 243 of file list.c.

References GWEN__ListPtr_dup(), GWEN__ListPtr_free(), and GWEN_ListEntry_new().

Referenced by GWEN_List_PushFront(), and GWEN_StringList2_InsertString().

GWENHYWFAR_API void GWEN_List_Remove ( GWEN_LIST l,
const void *  element 
)

Searches for the first occurrence of the "element" pointer and erases that element from the list. (The element itself is not freed.) I.e. this function calls GWEN_List_Erase on the first occurrence found of "element".

Definition at line 570 of file list.c.

References GWEN_List_Erase(), GWEN_List_FindIter(), and GWEN_ListIterator_free().

Referenced by check_list().

GWENHYWFAR_API void GWEN_List_SetRefPtrInfo ( GWEN_LIST l,
GWEN_REFPTR_INFO rpi 
)

Definition at line 199 of file list.c.

References GWEN_RefPtrInfo_Attach(), and GWEN_RefPtrInfo_free().

Referenced by GWEN_StringList2_new().

GWENHYWFAR_API void GWEN_List_Unshare ( GWEN_LIST l)

Definition at line 442 of file list.c.

References GWEN__ListPtr_dup(), and GWEN__ListPtr_free().

GWENHYWFAR_API void* GWEN_ListIterator_Data ( GWEN_LIST_ITERATOR li)

Returns the pointer to the element stored at the list position the iterator currently points to.

Definition at line 723 of file list.c.

References GWEN_RefPtr_GetData().

Referenced by check_list(), GWEN_ConstList_ForEach(), GWEN_ConstListIterator_Data(), GWEN_List_FindIter(), GWEN_List_ForEach(), and GWEN_StringList2Iterator_Data().

GWENHYWFAR_API GWEN_REFPTR* GWEN_ListIterator_DataRefPtr ( GWEN_LIST_ITERATOR li)

Returns the pointer to the element stored at the list position the iterator currently points to.

Definition at line 733 of file list.c.

Referenced by GWEN_StringList2__GetString(), and GWEN_StringList2Iterator_DataRefPtr().

GWENHYWFAR_API void GWEN_ListIterator_free ( GWEN_LIST_ITERATOR li)
GWENHYWFAR_API unsigned int GWEN_ListIterator_GetLinkCount ( const GWEN_LIST_ITERATOR li)

Definition at line 752 of file list.c.

Referenced by GWEN_StringList2_RemoveString(), and GWEN_StringList2Iterator_GetLinkCount().

GWENHYWFAR_API void GWEN_ListIterator_IncLinkCount ( GWEN_LIST_ITERATOR li)

Definition at line 743 of file list.c.

Referenced by GWEN_StringList2_AppendString(), and GWEN_StringList2_InsertString().

GWENHYWFAR_API GWEN_LIST_ITERATOR* GWEN_ListIterator_new ( const GWEN_LIST l)

Creates a list iterator for the given list.

Definition at line 639 of file list.c.

References GWEN_NEW_OBJECT.

Referenced by GWEN_ConstListIterator_new(), GWEN_List_First(), and GWEN_List_Last().

GWENHYWFAR_API void* GWEN_ListIterator_Next ( GWEN_LIST_ITERATOR li)

Moves the list iterator to the successor of the currenty selected element and returns that successor element.

Definition at line 691 of file list.c.

References GWEN_ListIterator_NextRefPtr(), and GWEN_RefPtr_GetData().

Referenced by check_list(), GWEN_ConstList_ForEach(), GWEN_ConstListIterator_Next(), GWEN_List_FindIter(), GWEN_List_ForEach(), and GWEN_StringList2Iterator_Next().

GWENHYWFAR_API GWEN_REFPTR* GWEN_ListIterator_NextRefPtr ( GWEN_LIST_ITERATOR li)

Moves the list iterator to the successor of the currenty selected element and returns that successor element.

Definition at line 703 of file list.c.

References GWEN_ListEntry_free().

Referenced by GWEN_ListIterator_Next(), and GWEN_StringList2__GetString().

GWENHYWFAR_API void* GWEN_ListIterator_Previous ( GWEN_LIST_ITERATOR li)

Moves the list iterator to the predecessor of the currenty selected element and returns that predecessor element.

Definition at line 659 of file list.c.

References GWEN_ListIterator_PreviousRefPtr(), and GWEN_RefPtr_GetData().

Referenced by check_list(), GWEN_ConstListIterator_Previous(), and GWEN_StringList2Iterator_Previous().

GWENHYWFAR_API GWEN_REFPTR* GWEN_ListIterator_PreviousRefPtr ( GWEN_LIST_ITERATOR li)

Moves the list iterator to the predecessor of the currenty selected element and returns that predecessor element.

Definition at line 671 of file list.c.

References GWEN_ListEntry_free().

Referenced by GWEN_ListIterator_Previous().