gwenhywfar 5.14.1
idmap.c File Reference
#include "idmap_p.h"
#include <gwenhywfar/misc.h>
#include <gwenhywfar/debug.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
Include dependency graph for idmap.c:

Go to the source code of this file.

Functions

void GWEN_IdMap_Clear (GWEN_IDMAP *map)
void GWEN_IdMap_Dump (GWEN_IDMAP *map, FILE *f, int indent)
void * GWEN_IdMap_Find (GWEN_IDMAP *map, uint32_t id)
void GWEN_IdMap_free (GWEN_IDMAP *map)
GWEN_IDMAP_RESULT GWEN_IdMap_GetFirst (const GWEN_IDMAP *map, uint32_t *pid)
GWEN_IDMAP_RESULT GWEN_IdMap_GetNext (const GWEN_IDMAP *map, uint32_t *pid)
uint32_t GWEN_IdMap_GetSize (const GWEN_IDMAP *map)
GWEN_IDMAP_RESULT GWEN_IdMap_Insert (GWEN_IDMAP *map, uint32_t id, void *ptr)
GWEN_IDMAPGWEN_IdMap_new (GWEN_IDMAP_ALGO algo)
GWEN_IDMAP_RESULT GWEN_IdMap_Remove (GWEN_IDMAP *map, uint32_t id)
void GWEN_IdMapHex4__Dump (GWEN_IDMAP_HEX4_TABLE *tbl, FILE *f, int indent)
GWEN_IDMAP_HEX4_TABLE * GWEN_IdMapHex4__GetFirstTable (GWEN_IDMAP_HEX4_TABLE *t, uint32_t *pid)
GWEN_IDMAP_HEX4_TABLE * GWEN_IdMapHex4__GetNextTable (GWEN_IDMAP_HEX4_TABLE *t, uint32_t *pid, int incr)
GWEN_IDMAP_HEX4_TABLE * GWEN_IdMapHex4__GetTable (GWEN_IDMAP_HEX4_TABLE *t, uint32_t id)
void GWEN_IdMapHex4_Dump (GWEN_IDMAP *map, FILE *f, int indent)
void GWEN_IdMapHex4_Extend (GWEN_IDMAP *map)
void * GWEN_IdMapHex4_Find (GWEN_IDMAP *map, uint32_t id)
GWEN_IDMAP_RESULT GWEN_IdMapHex4_FindFirst (const GWEN_IDMAP *map, uint32_t *pid)
GWEN_IDMAP_RESULT GWEN_IdMapHex4_FindNext (const GWEN_IDMAP *map, uint32_t *pid)
void GWEN_IdMapHex4_free (GWEN_IDMAP *map)
GWEN_IDMAP_RESULT GWEN_IdMapHex4_Insert (GWEN_IDMAP *map, uint32_t id, void *ptr)
void GWEN_IdMapHex4Map_free (GWEN_IDMAP_HEX4_TABLE *t)
GWEN_IDMAP_HEX4_TABLE * GWEN_IdMapHex4Map_new (GWEN_IDMAP_HEX4_TABLE *p, int isPtrTable)

Function Documentation

◆ GWEN_IdMap_Clear()

void GWEN_IdMap_Clear ( GWEN_IDMAP * map)

Definition at line 136 of file idmap.c.

References DBG_ERROR, GWEN_IdMapAlgo_Hex4, GWEN_IdMapAlgo_Unknown, GWEN_IdMapHex4_Extend(), and GWEN_LOGDOMAIN.

Here is the call graph for this function:

◆ GWEN_IdMap_Dump()

void GWEN_IdMap_Dump ( GWEN_IDMAP * map,
FILE * f,
int indent )

Definition at line 155 of file idmap.c.

References DBG_ERROR, and GWEN_LOGDOMAIN.

◆ GWEN_IdMap_Find()

void * GWEN_IdMap_Find ( GWEN_IDMAP * map,
uint32_t id )

Definition at line 99 of file idmap.c.

◆ GWEN_IdMap_free()

void GWEN_IdMap_free ( GWEN_IDMAP * map)

Definition at line 67 of file idmap.c.

References GWEN_FREE_OBJECT.

Referenced by GWEN_IdMap_new().

Here is the caller graph for this function:

◆ GWEN_IdMap_GetFirst()

GWEN_IDMAP_RESULT GWEN_IdMap_GetFirst ( const GWEN_IDMAP * map,
uint32_t * pid )

Return the first id in the map.

Parameters
mapmap to browse
pidpointer to a variable to receive the first id in the map. Upon return this variable will be updated to the first id in the map if the result is GWEN_IdMapResult_Ok.

Definition at line 108 of file idmap.c.

◆ GWEN_IdMap_GetNext()

GWEN_IDMAP_RESULT GWEN_IdMap_GetNext ( const GWEN_IDMAP * map,
uint32_t * pid )

Return the next id in the map.

Parameters
mapmap to browse
pidpointer to the id retrieved via GWEN_IdMap_GetFirst. Upon return this variable will be updated to the next id in the map if the result is GWEN_IdMapResult_Ok.

Definition at line 118 of file idmap.c.

◆ GWEN_IdMap_GetSize()

uint32_t GWEN_IdMap_GetSize ( const GWEN_IDMAP * map)

Definition at line 128 of file idmap.c.

◆ GWEN_IdMap_Insert()

GWEN_IDMAP_RESULT GWEN_IdMap_Insert ( GWEN_IDMAP * map,
uint32_t id,
void * ptr )

Definition at line 77 of file idmap.c.

◆ GWEN_IdMap_new()

GWEN_IDMAP * GWEN_IdMap_new ( GWEN_IDMAP_ALGO algo)

Definition at line 45 of file idmap.c.

References DBG_ERROR, GWEN_IdMap_free(), GWEN_IdMapAlgo_Hex4, GWEN_IdMapAlgo_Unknown, GWEN_IdMapHex4_Extend(), GWEN_LOGDOMAIN, and GWEN_NEW_OBJECT.

Here is the call graph for this function:

◆ GWEN_IdMap_Remove()

GWEN_IDMAP_RESULT GWEN_IdMap_Remove ( GWEN_IDMAP * map,
uint32_t id )

Definition at line 89 of file idmap.c.

◆ GWEN_IdMapHex4__Dump()

void GWEN_IdMapHex4__Dump ( GWEN_IDMAP_HEX4_TABLE * tbl,
FILE * f,
int indent )

Definition at line 549 of file idmap.c.

References GWEN_IdMapHex4__Dump().

Referenced by GWEN_IdMapHex4__Dump(), and GWEN_IdMapHex4_Dump().

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

◆ GWEN_IdMapHex4__GetFirstTable()

GWEN_IDMAP_HEX4_TABLE * GWEN_IdMapHex4__GetFirstTable ( GWEN_IDMAP_HEX4_TABLE * t,
uint32_t * pid )

Definition at line 418 of file idmap.c.

References GWEN_IdMapHex4__GetFirstTable().

Referenced by GWEN_IdMapHex4__GetFirstTable(), and GWEN_IdMapHex4_FindFirst().

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

◆ GWEN_IdMapHex4__GetNextTable()

GWEN_IDMAP_HEX4_TABLE * GWEN_IdMapHex4__GetNextTable ( GWEN_IDMAP_HEX4_TABLE * t,
uint32_t * pid,
int incr )

Definition at line 452 of file idmap.c.

References GWEN_IdMapHex4__GetNextTable().

Referenced by GWEN_IdMapHex4__GetNextTable(), and GWEN_IdMapHex4_FindNext().

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

◆ GWEN_IdMapHex4__GetTable()

GWEN_IDMAP_HEX4_TABLE * GWEN_IdMapHex4__GetTable ( GWEN_IDMAP_HEX4_TABLE * t,
uint32_t id )

Definition at line 373 of file idmap.c.

Referenced by GWEN_IdMapHex4_FindNext().

Here is the caller graph for this function:

◆ GWEN_IdMapHex4_Dump()

void GWEN_IdMapHex4_Dump ( GWEN_IDMAP * map,
FILE * f,
int indent )

Definition at line 569 of file idmap.c.

References GWEN_IdMapHex4__Dump().

Referenced by GWEN_IdMapHex4_Extend().

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

◆ GWEN_IdMapHex4_Extend()

void GWEN_IdMapHex4_Extend ( GWEN_IDMAP * map)

Definition at line 176 of file idmap.c.

References GWEN_IdMapHex4_Dump(), GWEN_IdMapHex4_Find(), GWEN_IdMapHex4_FindFirst(), GWEN_IdMapHex4_FindNext(), GWEN_IdMapHex4_free(), GWEN_IdMapHex4_Insert(), GWEN_IdMapHex4Map_new(), and GWEN_NEW_OBJECT.

Referenced by GWEN_IdMap_Clear(), and GWEN_IdMap_new().

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

◆ GWEN_IdMapHex4_Find()

void * GWEN_IdMapHex4_Find ( GWEN_IDMAP * map,
uint32_t id )

Definition at line 336 of file idmap.c.

Referenced by GWEN_IdMapHex4_Extend().

Here is the caller graph for this function:

◆ GWEN_IdMapHex4_FindFirst()

GWEN_IDMAP_RESULT GWEN_IdMapHex4_FindFirst ( const GWEN_IDMAP * map,
uint32_t * pid )

Definition at line 503 of file idmap.c.

References GWEN_IdMapHex4__GetFirstTable(), GWEN_IdMapResult_NotFound, and GWEN_IdMapResult_Ok.

Referenced by GWEN_IdMapHex4_Extend().

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

◆ GWEN_IdMapHex4_FindNext()

GWEN_IDMAP_RESULT GWEN_IdMapHex4_FindNext ( const GWEN_IDMAP * map,
uint32_t * pid )

Definition at line 524 of file idmap.c.

References GWEN_IdMapHex4__GetNextTable(), GWEN_IdMapHex4__GetTable(), GWEN_IdMapResult_NotFound, and GWEN_IdMapResult_Ok.

Referenced by GWEN_IdMapHex4_Extend().

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

◆ GWEN_IdMapHex4_free()

void GWEN_IdMapHex4_free ( GWEN_IDMAP * map)

Definition at line 193 of file idmap.c.

References GWEN_FREE_OBJECT, and GWEN_IdMapHex4Map_free().

Referenced by GWEN_IdMapHex4_Extend().

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

◆ GWEN_IdMapHex4_Insert()

GWEN_IDMAP_RESULT GWEN_IdMapHex4_Insert ( GWEN_IDMAP * map,
uint32_t id,
void * ptr )

Definition at line 234 of file idmap.c.

References GWEN_IdMapHex4Map_free(), GWEN_IdMapHex4Map_new(), GWEN_IdMapResult_NotFound, and GWEN_IdMapResult_Ok.

Referenced by GWEN_IdMapHex4_Extend().

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

◆ GWEN_IdMapHex4Map_free()

void GWEN_IdMapHex4Map_free ( GWEN_IDMAP_HEX4_TABLE * t)

Definition at line 217 of file idmap.c.

References GWEN_FREE_OBJECT, and GWEN_IdMapHex4Map_free().

Referenced by GWEN_IdMapHex4_free(), GWEN_IdMapHex4_Insert(), and GWEN_IdMapHex4Map_free().

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

◆ GWEN_IdMapHex4Map_new()

GWEN_IDMAP_HEX4_TABLE * GWEN_IdMapHex4Map_new ( GWEN_IDMAP_HEX4_TABLE * p,
int isPtrTable )

Definition at line 204 of file idmap.c.

References GWEN_NEW_OBJECT.

Referenced by GWEN_IdMapHex4_Extend(), and GWEN_IdMapHex4_Insert().

Here is the caller graph for this function: