gwenhywfar  4.20.2
Functions
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 (void)
 
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

◆ GWEN_IdList_AddId()

GWENHYWFAR_API int GWEN_IdList_AddId ( GWEN_IDLIST idl,
uint32_t  id 
)

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

◆ GWEN_IdList_Clear()

GWENHYWFAR_API void GWEN_IdList_Clear ( GWEN_IDLIST idl)

Removes all ids from the list thus leaving it empty.

◆ GWEN_IdList_DelId()

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

◆ GWEN_IdList_dup()

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).

◆ GWEN_IdList_free()

GWENHYWFAR_API void GWEN_IdList_free ( GWEN_IDLIST idl)

Destructor.

◆ GWEN_IdList_GetFirstId()

GWENHYWFAR_API uint32_t GWEN_IdList_GetFirstId ( GWEN_IDLIST idl)

Returns the first id from the list.

◆ GWEN_IdList_GetFirstId2()

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
hdlpointer 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.

◆ GWEN_IdList_GetNextId()

GWENHYWFAR_API uint32_t GWEN_IdList_GetNextId ( GWEN_IDLIST idl)

◆ GWEN_IdList_GetNextId2()

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
hdlpointer 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.

◆ GWEN_IdList_HasId()

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

◆ GWEN_IdList_new()

GWENHYWFAR_API GWEN_IDLIST* GWEN_IdList_new ( void  )

Constructor.

◆ GWEN_IdList_Sort()

GWENHYWFAR_API int GWEN_IdList_Sort ( GWEN_IDLIST idl)

Sorts the ids in ascending order