gwenhywfar 5.12.0
idlist64.c File Reference
#include "idlist64_p.h"
#include <gwenhywfar/memory.h>
#include <gwenhywfar/debug.h>
#include <stdlib.h>
#include <assert.h>
#include "idlist64-t.c"
Include dependency graph for idlist64.c:

Go to the source code of this file.

Macros

#define DISABLE_DEBUGLOG

Functions

static int __compAscending (const void *pa, const void *pb)
static int __compDescending (const void *pa, const void *pb)
static GWENHYWFAR_CB void _attachToTable (GWEN_SIMPLEPTRLIST *pl, void *p)
static GWENHYWFAR_CB void _attachToTable (GWEN_UNUSED GWEN_SIMPLEPTRLIST *pl, void *p)
static GWENHYWFAR_CB void _detachFromTable (GWEN_SIMPLEPTRLIST *pl, void *p)
static GWENHYWFAR_CB void _detachFromTable (GWEN_UNUSED GWEN_SIMPLEPTRLIST *pl, void *p)
static uint64_t GWEN_IdList64__GetFirstId (const GWEN_IDLIST64 *idl, uint64_t *pos)
static uint64_t GWEN_IdList64__GetNextId (const GWEN_IDLIST64 *idl, uint64_t *pos)
static int GWEN_IdList64__Sort (GWEN_IDLIST64 *idl, int ascending)
int64_t GWEN_IdList64_AddId (GWEN_IDLIST64 *idl, uint64_t entry)
static int64_t GWEN_IdList64_AddTable (GWEN_IDLIST64 *idl, GWEN_IDTABLE64 *t)
void GWEN_IdList64_Attach (GWEN_IDLIST64 *idl)
void GWEN_IdList64_Clear (GWEN_IDLIST64 *idl)
int GWEN_IdList64_DecIdCounter (GWEN_SIMPLEPTRLIST *pl)
int GWEN_IdList64_DelId (GWEN_IDLIST64 *idl, uint64_t wantedId)
GWEN_IDLIST64GWEN_IdList64_dup (const GWEN_IDLIST64 *oldList)
void GWEN_IdList64_free (GWEN_IDLIST64 *idl)
uint64_t GWEN_IdList64_GetEntryCount (const GWEN_SIMPLEPTRLIST *pl)
int64_t GWEN_IdList64_GetIdAt (const GWEN_IDLIST64 *idl, uint64_t idx)
int64_t GWEN_IdList64_GetLastTablePos (const GWEN_IDLIST64 *idl)
static GWEN_IDTABLE64 * GWEN_IdList64_GetTableAt (const GWEN_IDLIST64 *tl, uint64_t idx)
int GWEN_IdList64_GetTableMaxEntries (const GWEN_IDLIST64 *idl)
uint64_t GWEN_IdList64_GetUsedTables (const GWEN_IDLIST64 *idl)
int GWEN_IdList64_HasId (const GWEN_IDLIST64 *idl, uint64_t wantedId)
void GWEN_IdList64_IncIdCounter (GWEN_SIMPLEPTRLIST *pl)
void GWEN_IdList64_Iterator_free (GWEN_IDLIST64_ITERATOR *it)
uint64_t GWEN_IdList64_Iterator_GetFirstId (GWEN_IDLIST64_ITERATOR *it)
uint64_t GWEN_IdList64_Iterator_GetNextId (GWEN_IDLIST64_ITERATOR *it)
GWEN_IDLIST64_ITERATORGWEN_IdList64_Iterator_new (const GWEN_IDLIST64 *idl)
GWEN_IDLIST64GWEN_IdList64_LazyCopy (GWEN_IDLIST64 *oldList)
GWEN_IDLIST64GWEN_IdList64_new ()
GWEN_IDLIST64GWEN_IdList64_newWithSteps (uint64_t steps)
int GWEN_IdList64_ReverseSort (GWEN_IDLIST64 *idl)
int GWEN_IdList64_SetTableAt (GWEN_IDLIST64 *idl, uint64_t idx, GWEN_IDTABLE64 *t)
int GWEN_IdList64_Sort (GWEN_IDLIST64 *idl)
static void GWEN_IdTable64_AddRuntimeFlags (GWEN_IDTABLE64 *ft, uint32_t i)
static void GWEN_IdTable64_Attach (GWEN_IDTABLE64 *ft)
static void GWEN_IdTable64_CheckAndSetHighestEntry (GWEN_IDTABLE64 *ft, uint64_t i)
static GWEN_IDTABLE64 * GWEN_IdTable64_Create (uint64_t maxEntries)
static void GWEN_IdTable64_DecFreeEntries (GWEN_IDTABLE64 *ft)
static GWEN_IDTABLE64 * GWEN_IdTable64_dup (const GWEN_IDTABLE64 *ftOrig)
static void GWEN_IdTable64_free (GWEN_IDTABLE64 *ft)
static uint64_t GWEN_IdTable64_GetFreeEntries (const GWEN_IDTABLE64 *ft)
static uint64_t GWEN_IdTable64_GetHighestEntry (const GWEN_IDTABLE64 *ft)
static uint64_t GWEN_IdTable64_GetMaxEntries (const GWEN_IDTABLE64 *ft)
static uint64_t * GWEN_IdTable64_GetPtrEntries (const GWEN_IDTABLE64 *ft)
int GWEN_IdTable64_GetRefCounter (const GWEN_IDTABLE64 *ft)
static uint32_t GWEN_IdTable64_GetRuntimeFlags (const GWEN_IDTABLE64 *ft)
static GWEN_IDTABLE64 * GWEN_IdTable64_new ()
static void GWEN_IdTable64_SetPtrEntries (GWEN_IDTABLE64 *ft, uint64_t *ptr)

Macro Definition Documentation

◆ DISABLE_DEBUGLOG

#define DISABLE_DEBUGLOG

Definition at line 29 of file idlist64.c.

Function Documentation

◆ __compAscending()

int __compAscending ( const void * pa,
const void * pb )
static

Definition at line 688 of file idlist64.c.

Referenced by GWEN_IdList64__Sort().

Here is the caller graph for this function:

◆ __compDescending()

int __compDescending ( const void * pa,
const void * pb )
static

Definition at line 703 of file idlist64.c.

Referenced by GWEN_IdList64__Sort().

Here is the caller graph for this function:

◆ _attachToTable() [1/2]

GWENHYWFAR_CB void _attachToTable ( GWEN_SIMPLEPTRLIST * pl,
void * p )
static

References GWENHYWFAR_CB.

Referenced by GWEN_IdList64_newWithSteps().

Here is the caller graph for this function:

◆ _attachToTable() [2/2]

GWENHYWFAR_CB void _attachToTable ( GWEN_UNUSED GWEN_SIMPLEPTRLIST * pl,
void * p )
static

Definition at line 513 of file idlist64.c.

References GWEN_IdTable64_Attach(), GWEN_UNUSED, and GWENHYWFAR_CB.

Here is the call graph for this function:

◆ _detachFromTable() [1/2]

GWENHYWFAR_CB void _detachFromTable ( GWEN_SIMPLEPTRLIST * pl,
void * p )
static

References GWENHYWFAR_CB.

Referenced by GWEN_IdList64_newWithSteps().

Here is the caller graph for this function:

◆ _detachFromTable() [2/2]

GWENHYWFAR_CB void _detachFromTable ( GWEN_UNUSED GWEN_SIMPLEPTRLIST * pl,
void * p )
static

Definition at line 523 of file idlist64.c.

References GWEN_IdTable64_free(), GWEN_UNUSED, and GWENHYWFAR_CB.

Here is the call graph for this function:

◆ GWEN_IdList64__GetFirstId()

uint64_t GWEN_IdList64__GetFirstId ( const GWEN_IDLIST64 * idl,
uint64_t * pos )
static

Definition at line 533 of file idlist64.c.

References GWEN_IdList64_GetTableAt(), GWEN_IdList64_GetTableMaxEntries(), and GWEN_IdList64_GetUsedTables().

Referenced by GWEN_IdList64_Iterator_GetFirstId().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_IdList64__GetNextId()

uint64_t GWEN_IdList64__GetNextId ( const GWEN_IDLIST64 * idl,
uint64_t * pos )
static

Definition at line 565 of file idlist64.c.

References DBG_ERROR, GWEN_IdList64_GetTableAt(), GWEN_IdList64_GetTableMaxEntries(), GWEN_IdList64_GetUsedTables(), and GWEN_LOGDOMAIN.

Referenced by GWEN_IdList64_Iterator_GetNextId().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_IdList64__Sort()

int GWEN_IdList64__Sort ( GWEN_IDLIST64 * idl,
int ascending )
static

◆ GWEN_IdList64_AddId()

◆ GWEN_IdList64_AddTable()

int64_t GWEN_IdList64_AddTable ( GWEN_IDLIST64 * idl,
GWEN_IDTABLE64 * t )
static

Definition at line 218 of file idlist64.c.

References GWEN_SimplePtrList_AddPtr().

Referenced by GWEN_IdList64_AddId(), and GWEN_IdList64_dup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_IdList64_Attach()

void GWEN_IdList64_Attach ( GWEN_IDLIST64 * idl)

Definition at line 146 of file idlist64.c.

References GWEN_SimplePtrList_Attach().

Here is the call graph for this function:

◆ GWEN_IdList64_Clear()

void GWEN_IdList64_Clear ( GWEN_IDLIST64 * idl)

Definition at line 160 of file idlist64.c.

References GWEN_SimplePtrList_Clear(), and GWEN_SimplePtrList_SetUserCounter().

Referenced by GWEN_IdList64__Sort().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_IdList64_DecIdCounter()

int GWEN_IdList64_DecIdCounter ( GWEN_SIMPLEPTRLIST * pl)

Definition at line 175 of file idlist64.c.

References GWEN_SimplePtrList_DecUserCounter().

Referenced by GWEN_IdList64_DelId().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_IdList64_DelId()

int GWEN_IdList64_DelId ( GWEN_IDLIST64 * idl,
uint64_t id )

Removes the first occurrence of the given id.

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

Definition at line 484 of file idlist64.c.

References GWEN_IdList64_DecIdCounter(), GWEN_IdList64_GetTableAt(), GWEN_IdList64_GetTableMaxEntries(), and GWEN_IdList64_GetUsedTables().

Here is the call graph for this function:

◆ GWEN_IdList64_dup()

◆ GWEN_IdList64_free()

void GWEN_IdList64_free ( GWEN_IDLIST64 * idl)

Definition at line 153 of file idlist64.c.

References GWEN_SimplePtrList_free().

Referenced by GWEN_IdList64_dup(), and GWEN_MultiCache_Type_GetIdsInCache().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_IdList64_GetEntryCount()

uint64_t GWEN_IdList64_GetEntryCount ( const GWEN_SIMPLEPTRLIST * pl)

Definition at line 182 of file idlist64.c.

References GWEN_SimplePtrList_GetUserCounter().

Referenced by GWEN_IdList64__Sort(), and GWEN_MultiCache_Type_GetIdsInCache().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_IdList64_GetIdAt()

int64_t GWEN_IdList64_GetIdAt ( const GWEN_IDLIST64 * idl,
uint64_t idx )

◆ GWEN_IdList64_GetLastTablePos()

int64_t GWEN_IdList64_GetLastTablePos ( const GWEN_IDLIST64 * idl)

Definition at line 232 of file idlist64.c.

References GWEN_ERROR_NO_DATA, and GWEN_SimplePtrList_GetUsedEntries().

Referenced by GWEN_IdList64_AddId().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_IdList64_GetTableAt()

GWEN_IDTABLE64 * GWEN_IdList64_GetTableAt ( const GWEN_IDLIST64 * tl,
uint64_t idx )
static

Definition at line 204 of file idlist64.c.

References GWEN_SimplePtrList_GetPtrAt().

Referenced by GWEN_IdList64__GetFirstId(), GWEN_IdList64__GetNextId(), GWEN_IdList64_AddId(), GWEN_IdList64_DelId(), GWEN_IdList64_dup(), GWEN_IdList64_GetIdAt(), and GWEN_IdList64_HasId().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_IdList64_GetTableMaxEntries()

int GWEN_IdList64_GetTableMaxEntries ( const GWEN_IDLIST64 * idl)

Definition at line 190 of file idlist64.c.

References GWEN_SimplePtrList_GetUserIntData().

Referenced by GWEN_IdList64__GetFirstId(), GWEN_IdList64__GetNextId(), GWEN_IdList64_AddId(), GWEN_IdList64_DelId(), and GWEN_IdList64_HasId().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_IdList64_GetUsedTables()

uint64_t GWEN_IdList64_GetUsedTables ( const GWEN_IDLIST64 * idl)

Definition at line 225 of file idlist64.c.

References GWEN_SimplePtrList_GetUsedEntries().

Referenced by GWEN_IdList64__GetFirstId(), GWEN_IdList64__GetNextId(), GWEN_IdList64_DelId(), and GWEN_IdList64_HasId().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_IdList64_HasId()

int GWEN_IdList64_HasId ( const GWEN_IDLIST64 * idl,
uint64_t id )

Checks whether the given id exists in the idlist.

Returns
1 if found, 0 otherwise

Definition at line 459 of file idlist64.c.

References GWEN_IdList64_GetTableAt(), GWEN_IdList64_GetTableMaxEntries(), and GWEN_IdList64_GetUsedTables().

Here is the call graph for this function:

◆ GWEN_IdList64_IncIdCounter()

void GWEN_IdList64_IncIdCounter ( GWEN_SIMPLEPTRLIST * pl)

Definition at line 168 of file idlist64.c.

References GWEN_SimplePtrList_IncUserCounter().

Referenced by GWEN_IdList64_AddId().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_IdList64_Iterator_free()

void GWEN_IdList64_Iterator_free ( GWEN_IDLIST64_ITERATOR * it)

Definition at line 742 of file idlist64.c.

References GWEN_FREE_OBJECT.

Referenced by GWEN_IdList64__Sort().

Here is the caller graph for this function:

◆ GWEN_IdList64_Iterator_GetFirstId()

uint64_t GWEN_IdList64_Iterator_GetFirstId ( GWEN_IDLIST64_ITERATOR * it)

Definition at line 751 of file idlist64.c.

References GWEN_IdList64__GetFirstId().

Referenced by GWEN_IdList64__Sort().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_IdList64_Iterator_GetNextId()

uint64_t GWEN_IdList64_Iterator_GetNextId ( GWEN_IDLIST64_ITERATOR * it)

Definition at line 758 of file idlist64.c.

References GWEN_IdList64__GetNextId().

Referenced by GWEN_IdList64__Sort().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_IdList64_Iterator_new()

GWEN_IDLIST64_ITERATOR * GWEN_IdList64_Iterator_new ( const GWEN_IDLIST64 * idl)

Definition at line 728 of file idlist64.c.

References GWEN_NEW_OBJECT.

Referenced by GWEN_IdList64__Sort().

Here is the caller graph for this function:

◆ GWEN_IdList64_LazyCopy()

GWEN_IDLIST64 * GWEN_IdList64_LazyCopy ( GWEN_IDLIST64 * oldList)

Definition at line 197 of file idlist64.c.

References GWEN_SimplePtrList_LazyCopy().

Here is the call graph for this function:

◆ GWEN_IdList64_new()

GWEN_IDLIST64 * GWEN_IdList64_new ( void )

Definition at line 88 of file idlist64.c.

References GWEN_IdList64_newWithSteps().

Referenced by GWEN_MultiCache_Type_GetIdsInCache().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_IdList64_newWithSteps()

◆ GWEN_IdList64_ReverseSort()

int GWEN_IdList64_ReverseSort ( GWEN_IDLIST64 * idl)

Definition at line 681 of file idlist64.c.

References GWEN_IdList64__Sort().

Here is the call graph for this function:

◆ GWEN_IdList64_SetTableAt()

int GWEN_IdList64_SetTableAt ( GWEN_IDLIST64 * idl,
uint64_t idx,
GWEN_IDTABLE64 * t )

Definition at line 211 of file idlist64.c.

References GWEN_SimplePtrList_SetPtrAt().

Referenced by GWEN_IdList64_AddId().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_IdList64_Sort()

int GWEN_IdList64_Sort ( GWEN_IDLIST64 * idl)

Sorts the ids in ascending order

Definition at line 674 of file idlist64.c.

References GWEN_IdList64__Sort().

Here is the call graph for this function:

◆ GWEN_IdTable64_AddRuntimeFlags()

void GWEN_IdTable64_AddRuntimeFlags ( GWEN_IDTABLE64 * ft,
uint32_t i )
static

Definition at line 946 of file idlist64.c.

Referenced by GWEN_IdList64_AddId().

Here is the caller graph for this function:

◆ GWEN_IdTable64_Attach()

void GWEN_IdTable64_Attach ( GWEN_IDTABLE64 * ft)
static

Definition at line 787 of file idlist64.c.

Referenced by _attachToTable().

Here is the caller graph for this function:

◆ GWEN_IdTable64_CheckAndSetHighestEntry()

void GWEN_IdTable64_CheckAndSetHighestEntry ( GWEN_IDTABLE64 * ft,
uint64_t i )
static

Definition at line 908 of file idlist64.c.

Referenced by GWEN_IdList64_AddId().

Here is the caller graph for this function:

◆ GWEN_IdTable64_Create()

GWEN_IDTABLE64 * GWEN_IdTable64_Create ( uint64_t maxEntries)
static

Definition at line 849 of file idlist64.c.

References GWEN_IdTable64_new(), and GWEN_IdTable64_SetPtrEntries().

Referenced by GWEN_IdList64_AddId().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_IdTable64_DecFreeEntries()

void GWEN_IdTable64_DecFreeEntries ( GWEN_IDTABLE64 * ft)
static

Definition at line 889 of file idlist64.c.

Referenced by GWEN_IdList64_AddId().

Here is the caller graph for this function:

◆ GWEN_IdTable64_dup()

GWEN_IDTABLE64 * GWEN_IdTable64_dup ( const GWEN_IDTABLE64 * ftOrig)
static

Definition at line 822 of file idlist64.c.

References GWEN_IdTable64_new().

Referenced by GWEN_IdList64_AddId(), and GWEN_IdList64_dup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_IdTable64_free()

void GWEN_IdTable64_free ( GWEN_IDTABLE64 * ft)
static

Definition at line 797 of file idlist64.c.

References GWEN_FREE_OBJECT.

Referenced by _detachFromTable(), GWEN_IdList64_AddId(), and GWEN_IdList64_dup().

Here is the caller graph for this function:

◆ GWEN_IdTable64_GetFreeEntries()

uint64_t GWEN_IdTable64_GetFreeEntries ( const GWEN_IDTABLE64 * ft)
static

Definition at line 880 of file idlist64.c.

Referenced by GWEN_IdList64_AddId().

Here is the caller graph for this function:

◆ GWEN_IdTable64_GetHighestEntry()

uint64_t GWEN_IdTable64_GetHighestEntry ( const GWEN_IDTABLE64 * ft)
static

Definition at line 899 of file idlist64.c.

Referenced by GWEN_IdList64_AddId().

Here is the caller graph for this function:

◆ GWEN_IdTable64_GetMaxEntries()

uint64_t GWEN_IdTable64_GetMaxEntries ( const GWEN_IDTABLE64 * ft)
static

Definition at line 871 of file idlist64.c.

Referenced by GWEN_IdList64_AddId().

Here is the caller graph for this function:

◆ GWEN_IdTable64_GetPtrEntries()

uint64_t * GWEN_IdTable64_GetPtrEntries ( const GWEN_IDTABLE64 * ft)
static

Definition at line 918 of file idlist64.c.

Referenced by GWEN_IdList64_AddId(), and GWEN_IdList64_GetIdAt().

Here is the caller graph for this function:

◆ GWEN_IdTable64_GetRefCounter()

int GWEN_IdTable64_GetRefCounter ( const GWEN_IDTABLE64 * ft)

Definition at line 814 of file idlist64.c.

◆ GWEN_IdTable64_GetRuntimeFlags()

uint32_t GWEN_IdTable64_GetRuntimeFlags ( const GWEN_IDTABLE64 * ft)
static

Definition at line 938 of file idlist64.c.

Referenced by GWEN_IdList64_AddId().

Here is the caller graph for this function:

◆ GWEN_IdTable64_new()

GWEN_IDTABLE64 * GWEN_IdTable64_new ( )
static

Definition at line 775 of file idlist64.c.

References GWEN_NEW_OBJECT.

Referenced by GWEN_IdTable64_Create(), and GWEN_IdTable64_dup().

Here is the caller graph for this function:

◆ GWEN_IdTable64_SetPtrEntries()

void GWEN_IdTable64_SetPtrEntries ( GWEN_IDTABLE64 * ft,
uint64_t * ptr )
static

Definition at line 927 of file idlist64.c.

Referenced by GWEN_IdTable64_Create().

Here is the caller graph for this function: