ID list module

A list of uint32_t objects. More...


Functions

GWENHYWFAR_API int GWEN_IdList_AddId (GWEN_IDLIST *idl, uint32_t id)
GWENHYWFAR_API void GWEN_IdList_Clear (GWEN_IDLIST *idl)
GWENHYWFAR_API int GWEN_IdList_DelId (GWEN_IDLIST *idl, uint32_t id)
GWENHYWFAR_API GWEN_IDLISTGWEN_IdList_dup (const GWEN_IDLIST *idl)
GWENHYWFAR_API void GWEN_IdList_free (GWEN_IDLIST *idl)
GWENHYWFAR_API uint32_t GWEN_IdList_GetFirstId (GWEN_IDLIST *idl)
GWENHYWFAR_API uint32_t GWEN_IdList_GetFirstId2 (const GWEN_IDLIST *idl, uint32_t *hdl)
GWENHYWFAR_API uint32_t GWEN_IdList_GetNextId (GWEN_IDLIST *idl)
GWENHYWFAR_API uint32_t GWEN_IdList_GetNextId2 (const GWEN_IDLIST *idl, uint32_t *hdl)
GWENHYWFAR_API int GWEN_IdList_HasId (const GWEN_IDLIST *idl, uint32_t id)
GWENHYWFAR_API GWEN_IDLISTGWEN_IdList_new ()
GWENHYWFAR_API int GWEN_IdList_Sort (GWEN_IDLIST *idl)


Detailed Description

A list of uint32_t objects.

This is basically a list for uint32_t objects, but since it uses tables instead of those list objects normally used throughout Gwen it is less memory consuming.


Function Documentation

GWENHYWFAR_API int GWEN_IdList_AddId ( GWEN_IDLIST idl,
uint32_t  id 
)

Adds an id to the list. This function does no doublecheck.

Definition at line 231 of file idlist.c.

References GWEN_IdTable_AddId(), GWEN_IdTable_IsFull(), and GWEN_IdTable_new().

Referenced by GWEN_IdList_dup(), and GWEN_IdList_Sort().

GWENHYWFAR_API void GWEN_IdList_Clear ( GWEN_IDLIST idl  ) 

Removes all ids from the list thus leaving it empty.

Definition at line 447 of file idlist.c.

GWENHYWFAR_API int GWEN_IdList_DelId ( GWEN_IDLIST idl,
uint32_t  id 
)

Removes the first occurrence of the given id.

Returns:
0 if deleted, !=0 if the id wasn't found

Definition at line 257 of file idlist.c.

References GWEN_IdList_Clean(), and GWEN_IdTable_DelId().

GWENHYWFAR_API GWEN_IDLIST* GWEN_IdList_dup ( const GWEN_IDLIST idl  ) 

Returns a new id list which contains all the ids of the given list in the same order. However, the list returned is compact (i.e. it has no wholes).

Definition at line 456 of file idlist.c.

References GWEN_IdList_AddId(), and GWEN_IdList_new().

GWENHYWFAR_API void GWEN_IdList_free ( GWEN_IDLIST idl  ) 

Destructor.

Definition at line 222 of file idlist.c.

References GWEN_FREE_OBJECT.

GWENHYWFAR_API uint32_t GWEN_IdList_GetFirstId ( GWEN_IDLIST idl  ) 

Returns the first id from the list.

Definition at line 317 of file idlist.c.

References GWEN_IdTable_GetFirstId().

Referenced by GWEN_IdList_Sort().

GWENHYWFAR_API uint32_t GWEN_IdList_GetFirstId2 ( const GWEN_IDLIST idl,
uint32_t *  hdl 
)

This function returns the first id stored in the list. It can also be used with const GWEN_IDLIST.

Parameters:
hdl pointer to a 32 bit value to receive a handle to be used by GWEN_IdList_GetNextId2. This handle is only valid as longs as no ids are removed from the list.

Definition at line 481 of file idlist.c.

References GWEN_IdTable_GetFirstId2().

GWENHYWFAR_API uint32_t GWEN_IdList_GetNextId ( GWEN_IDLIST idl  ) 

Definition at line 342 of file idlist.c.

References GWEN_IdTable_GetFirstId(), and GWEN_IdTable_GetNextId().

Referenced by GWEN_IdList_Sort().

GWENHYWFAR_API uint32_t GWEN_IdList_GetNextId2 ( const GWEN_IDLIST idl,
uint32_t *  hdl 
)

This function returns the next id stored in the list. It can also be used with const GWEN_IDLIST.

Parameters:
hdl pointer to a 32 bit value to receive a handle to be used by GWEN_IdList_GetNextId2. This handle is only valid as longs as no ids are removed from the list.

Definition at line 510 of file idlist.c.

References GWEN_IdTable_GetNextId2().

GWENHYWFAR_API int GWEN_IdList_HasId ( const GWEN_IDLIST idl,
uint32_t  id 
)

Checks whether the given id exists in the idlist.

Returns:
0 if found, !=0 otherwise

Definition at line 279 of file idlist.c.

References GWEN_IdTable_HasId().

GWENHYWFAR_API GWEN_IDLIST* GWEN_IdList_new (  ) 

Constructor.

Definition at line 212 of file idlist.c.

References GWEN_NEW_OBJECT.

Referenced by GWEN_IdList_dup().

GWENHYWFAR_API int GWEN_IdList_Sort ( GWEN_IDLIST idl  ) 

Sorts the ids in ascending order

Definition at line 377 of file idlist.c.

References GWEN_IdList_AddId(), GWEN_IdList_GetFirstId(), GWEN_IdList_GetNextId(), and GWEN_IdTable_GetCount().


Generated on Thu Aug 20 13:54:42 2009 for gwenhywfar by  doxygen 1.5.9