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_IDLIST * | GWEN_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_IDLIST * | GWEN_IdList_new () |
GWENHYWFAR_API int | GWEN_IdList_Sort (GWEN_IDLIST *idl) |
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.
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 | ) |
GWENHYWFAR_API int GWEN_IdList_DelId | ( | GWEN_IDLIST * | idl, | |
uint32_t | id | |||
) |
Removes the first occurrence of the given id.
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 | ) |
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.
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.
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.
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().