Go to the source code of this file.
|
PCASC_MAP | Map_Create (DWORD dwMaxItems, DWORD dwKeyLength, DWORD dwKeyOffset) |
|
size_t | Map_EnumObjects (PCASC_MAP pMap, void **ppvArray) |
|
void * | Map_FindObject (PCASC_MAP pMap, void *pvKey, PDWORD PtrIndex) |
|
bool | Map_InsertObject (PCASC_MAP pMap, void *pvNewObject, void *pvKey) |
|
const char * | Map_FindString (PCASC_MAP pMap, const char *szString, const char *szStringEnd) |
|
bool | Map_InsertString (PCASC_MAP pMap, const char *szString, bool bCutExtension) |
|
void | Map_Free (PCASC_MAP pMap) |
|
#define KEY_LENGTH_STRING 0xFFFFFFFF |
typedef bool(* MAP_COMPARE)(PCASC_MAP pMap, void *pvObject, void *pvKey) |
100 dwTableSize = (dwMaxItems * 3 / 2) | 0x01;
103 cbToAllocate =
sizeof(
CASC_MAP) + (dwTableSize *
sizeof(
void *));
107 memset(pMap, 0, cbToAllocate);
size_t KeyOffset
Definition: Map.h:23
#define CASC_ALLOC(type, count)
Definition: CascCommon.h:302
arena_t NULL
Definition: jemalloc_internal.h:624
struct _CASC_MAP CASC_MAP
BYTE * LPBYTE
Definition: CascPort.h:152
size_t TableSize
Definition: Map.h:21
struct _CASC_MAP * PCASC_MAP
size_t KeyLength
Definition: Map.h:24
size_t Map_EnumObjects |
( |
PCASC_MAP |
pMap, |
|
|
void ** |
ppvArray |
|
) |
| |
122 if(pMap !=
NULL && ppvArray !=
NULL)
125 for(
size_t i = 0; i < pMap->
TableSize; i++)
arena_t NULL
Definition: jemalloc_internal.h:624
size_t TableSize
Definition: Map.h:21
void * HashTable[1]
Definition: Map.h:25
size_t ItemCount
Definition: Map.h:22
157 PtrIndex[0] = dwHashIndex;
162 dwHashIndex = (dwHashIndex + 1) % pMap->
TableSize;
arena_t NULL
Definition: jemalloc_internal.h:624
size_t TableSize
Definition: Map.h:21
static DWORD CalcHashIndex_Key(PCASC_MAP pMap, void *pvKey)
Definition: Map.cpp:25
unsigned int DWORD
Definition: CascPort.h:139
static bool CompareObject_Key(PCASC_MAP pMap, void *pvObject, void *pvKey)
Definition: Map.cpp:61
void * HashTable[1]
Definition: Map.h:25
253 const char * szExistingString;
264 szExistingString = (
const char *)pMap->
HashTable[dwHashIndex];
268 return szExistingString;
271 dwHashIndex = (dwHashIndex + 1) % pMap->
TableSize;
arena_t NULL
Definition: jemalloc_internal.h:624
size_t TableSize
Definition: Map.h:21
unsigned int DWORD
Definition: CascPort.h:139
void * HashTable[1]
Definition: Map.h:25
static bool CompareObject_String(PCASC_MAP pMap, const char *szExistingString, const char *szString, const char *szStringEnd)
Definition: Map.cpp:68
static DWORD CalcHashIndex_String(PCASC_MAP pMap, const char *szString, const char *szStringEnd)
Definition: Map.cpp:44
arena_t NULL
Definition: jemalloc_internal.h:624
#define CASC_FREE(ptr)
Definition: CascCommon.h:303
bool Map_InsertObject |
( |
PCASC_MAP |
pMap, |
|
|
void * |
pvNewObject, |
|
|
void * |
pvKey |
|
) |
| |
172 void * pvExistingObject;
187 pvExistingObject = pMap->
HashTable[dwHashIndex];
194 dwHashIndex = (dwHashIndex + 1) % pMap->
TableSize;
198 pMap->
HashTable[dwHashIndex] = pvNewObject;
arena_t NULL
Definition: jemalloc_internal.h:624
size_t TableSize
Definition: Map.h:21
static DWORD CalcHashIndex_Key(PCASC_MAP pMap, void *pvKey)
Definition: Map.cpp:25
unsigned int DWORD
Definition: CascPort.h:139
static bool CompareObject_Key(PCASC_MAP pMap, void *pvObject, void *pvKey)
Definition: Map.cpp:61
void * HashTable[1]
Definition: Map.h:25
size_t ItemCount
Definition: Map.h:22
209 const char * szExistingString;
210 const char * szStringEnd =
NULL;
223 if(szStringEnd ==
NULL)
224 szStringEnd = szString + strlen(szString);
231 szExistingString = (
const char *)pMap->
HashTable[dwHashIndex];
238 dwHashIndex = (dwHashIndex + 1) % pMap->
TableSize;
242 pMap->
HashTable[dwHashIndex] = (
void *)szString;
static const char * String_GetExtension(const char *szString)
Definition: Map.cpp:19
arena_t NULL
Definition: jemalloc_internal.h:624
size_t TableSize
Definition: Map.h:21
unsigned int DWORD
Definition: CascPort.h:139
void * HashTable[1]
Definition: Map.h:25
size_t ItemCount
Definition: Map.h:22
static bool CompareObject_String(PCASC_MAP pMap, const char *szExistingString, const char *szString, const char *szStringEnd)
Definition: Map.cpp:68
static DWORD CalcHashIndex_String(PCASC_MAP pMap, const char *szString, const char *szStringEnd)
Definition: Map.cpp:44