*********************************************************************21*/
\f
-/* header include files -- defines (.h) */
-
-#include "envopt.h" /* environment options */
-#include "envdep.h" /* environment dependent */
-#include "envind.h" /* environment independent */
-
-#include "gen.h" /* general */
-#include "ssi.h" /* system services */
-#include "cm_hash.h" /* common hash functions */
-#include "cm_err.h" /* common functions error */
-
-/* header include -- typedef structs (.x) */
-
-#include "gen.x" /* general */
-#include "ssi.x" /* system services */
-#include "cm_lib.x" /* common library functions */
-#include "cm_hash.x" /* common hash functions */
+#include <common_def.h>
\f
/* local defines */
extern "C" {
#endif
-PRIVATE S16 cmHashFuncBCD8 ARGS((CmHashListCp *hashListCp, uint8_t *key,
+static S16 cmHashFuncBCD8 ARGS((CmHashListCp *hashListCp, uint8_t *key,
uint16_t keyLen, uint16_t *idx));
-PRIVATE S16 cmHashFuncConId ARGS((CmHashListCp *hashListCp, uint8_t *key,
+static S16 cmHashFuncConId ARGS((CmHashListCp *hashListCp, uint8_t *key,
uint16_t keyLen, uint16_t *idx));
-PRIVATE S16 cmHashFuncUInt32Mod ARGS((CmHashListCp *hashListCp, uint8_t *key,
+static S16 cmHashFuncU32Mod ARGS((CmHashListCp *hashListCp, uint8_t *key,
uint16_t keyLen, uint16_t *idx));
-PRIVATE S16 cmHashFuncString ARGS((CmHashListCp *hashListCp, uint8_t *key,
+static S16 cmHashFuncString ARGS((CmHashListCp *hashListCp, uint8_t *key,
uint16_t keyLen, uint16_t *idx));
-PRIVATE S16 cmHashFuncDefault ARGS((CmHashListCp *hashListCp, uint8_t *key,
+static S16 cmHashFuncDefault ARGS((CmHashListCp *hashListCp, uint8_t *key,
uint16_t keyLen, uint16_t *idx));
-PRIVATE S16 cmHashFuncAnyKey ARGS((CmHashListCp *hashListCp, uint8_t *key,
+static S16 cmHashFuncAnyKey ARGS((CmHashListCp *hashListCp, uint8_t *key,
uint16_t keyLen, uint16_t *idx));
-PRIVATE S16 cmHashMatchKey ARGS((uint8_t *key1, uint16_t keyLen1, uint8_t *key2, uint16_t keyLen2));
+static S16 cmHashMatchKey ARGS((uint8_t *key1, uint16_t keyLen1, uint8_t *key2, uint16_t keyLen2));
-PRIVATE S16 cmListInsert ARGS((CmListEnt *oldEntry, CmListEnt *newEntry));
+static S16 cmListInsert ARGS((CmListEnt *oldEntry, CmListEnt *newEntry));
-PRIVATE S16 cmListDelete ARGS((CmListEnt *entry));
+static S16 cmListDelete ARGS((CmListEnt *entry));
/* cm_hash_c_001.main_22: Fixing warnings on GCC compiler */
-PRIVATE S16 cmHashFuncMult24 ARGS((CmHashListCp *hashListCp, uint8_t *key, uint16_t keyLen, uint16_t *idx));
+static S16 cmHashFuncMult24 ARGS((CmHashListCp *hashListCp, uint8_t *key, uint16_t keyLen, uint16_t *idx));
-PRIVATE S16 cmHashFuncDirIdx ARGS((CmHashListCp *hashListCp, uint8_t *key, uint16_t keyLen, uint16_t *idx));
+static S16 cmHashFuncDirIdx ARGS((CmHashListCp *hashListCp, uint8_t *key, uint16_t keyLen, uint16_t *idx));
#ifdef __cplusplus
}
*
*/
-#ifdef ANSI
-PRIVATE S16 cmHashFuncAnyKey
+static S16 cmHashFuncAnyKey
(
-CmHashListCp *hashListCp, /* hash list control point */
-uint8_t *key, /* key string */
-uint16_t keyLen, /* length of key string */
-uint16_t *idx /* idx to return */
+CmHashListCp *hashListCp, /* hash list control point */
+uint8_t *key, /* key string */
+uint16_t keyLen, /* length of key string */
+uint16_t *idx /* idx to return */
)
-#else
-PRIVATE S16 cmHashFuncAnyKey (hashListCp, key, keyLen, idx)
-CmHashListCp *hashListCp; /* hash list control point */
-uint8_t *key; /* key string */
-uint16_t keyLen; /* length of key string */
-uint16_t *idx; /* idx to return */
-#endif
{
- uint32_t a; /* hash variables */
- uint32_t b; /* hash variables */
- uint32_t c; /* hash variables */
- uint32_t len; /* length */
+ uint32_t a; /* hash variables */
+ uint32_t b; /* hash variables */
+ uint32_t c; /* hash variables */
+ uint32_t len; /* length */
/*cm_hash_c_001.main_23 : Fix for TRACE5 feature crash due to missing TRC MACRO*/
/* Set up the internal state */
/*
*
-* Fun: cmHashFuncUInt32Mod
+* Fun: cmHashFuncU32Mod
*
* Desc: Computes the hash list index (bin number) for a specified
* key of type CM_HASH_KEYTYPE_MOD.
*
*/
-#ifdef ANSI
-PRIVATE S16 cmHashFuncUInt32Mod
+static S16 cmHashFuncU32Mod
(
-CmHashListCp *hashListCp, /* hash list control point */
-uint8_t *key, /* key string */
-uint16_t keyLen, /* length of key string */
-uint16_t *idx /* idx to return */
+CmHashListCp *hashListCp, /* hash list control point */
+uint8_t *key, /* key string */
+uint16_t keyLen, /* length of key string */
+uint16_t *idx /* idx to return */
)
-#else
-PRIVATE S16 cmHashFuncUInt32Mod (hashListCp, key, keyLen, idx)
-CmHashListCp *hashListCp; /* hash list control point */
-uint8_t *key; /* key string */
-uint16_t keyLen; /* length of key string */
-uint16_t *idx; /* idx to return */
-#endif
{
- uint32_t sum; /* Sum of octets for hash function */
+ uint32_t sum; /* Sum of octets for hash function */
/* keyLen is marked Unused to remove compilation
return ROK;
-} /* end of cmHashFuncUInt32Mod () */
+} /* end of cmHashFuncU32Mod () */
/*
*
*
*/
-#ifdef ANSI
-PRIVATE S16 cmHashFuncBCD8
+static S16 cmHashFuncBCD8
(
CmHashListCp *hashListCp, /* hash list control point */
-uint8_t *key, /* key string */
-uint16_t keyLen, /* length of key string */
-uint16_t *idx /* idx to return */
+uint8_t *key, /* key string */
+uint16_t keyLen, /* length of key string */
+uint16_t *idx /* idx to return */
)
-#else
-PRIVATE S16 cmHashFuncBCD8 (hashListCp, key, keyLen, idx)
-CmHashListCp *hashListCp; /* hash list control point */
-uint8_t *key; /* key string */
-uint16_t keyLen; /* length of key string */
-uint16_t *idx; /* idx to return */
-#endif
{
- uint16_t tmp16 = 0;
- uint32_t firstUInt32 = 0; /* First uint32_t prepared for lower 4 octets */
- uint32_t secondUInt32 = 0; /* Second uint32_t prepared for higher 4 octets */
- uint32_t sum; /* Sum of the above 2 octets to get the index */
+ uint16_t tmp16 = 0;
+ uint32_t firstUInt32 = 0; /* First uint32_t prepared for lower 4 octets */
+ uint32_t secondUInt32 = 0; /* Second uint32_t prepared for higher 4 octets */
+ uint32_t sum; /* Sum of the above 2 octets to get the index */
/* keyLen is marked Unused to remove compilation
*
*/
-#ifdef ANSI
-PRIVATE S16 cmHashFuncString
+static S16 cmHashFuncString
(
-CmHashListCp *hashListCp, /* hash list control point */
-uint8_t *key, /* key string */
-uint16_t keyLen, /* length of key string */
-uint16_t *idx /* idx to return */
+CmHashListCp *hashListCp, /* hash list control point */
+uint8_t *key, /* key string */
+uint16_t keyLen, /* length of key string */
+uint16_t *idx /* idx to return */
)
-#else
-PRIVATE S16 cmHashFuncString (hashListCp, key, keyLen, idx)
-CmHashListCp *hashListCp; /* hash list control point */
-uint8_t *key; /* key string */
-uint16_t keyLen; /* length of key string */
-uint16_t *idx; /* idx to return */
-#endif
{
- uint16_t cntr; /* Index */
- uint32_t sum; /* Sum of octets for hash function */
+ uint16_t cntr; /* Index */
+ uint32_t sum; /* Sum of octets for hash function */
sum = 0;
*
*/
-#ifdef ANSI
-PRIVATE S16 cmHashFuncDefault
+static S16 cmHashFuncDefault
(
-CmHashListCp *hashListCp, /* hash list control point */
-uint8_t *key, /* key string */
-uint16_t keyLen, /* length of key string */
-uint16_t *idx /* index to return */
+CmHashListCp *hashListCp, /* hash list control point */
+uint8_t *key, /* key string */
+uint16_t keyLen, /* length of key string */
+uint16_t *idx /* index to return */
)
-#else
-PRIVATE S16 cmHashFuncDefault(hashListCp, key, keyLen, idx)
-CmHashListCp *hashListCp; /* hash list control point */
-uint8_t *key; /* key string */
-uint16_t keyLen; /* length of key string */
-uint16_t *idx; /* index to return */
-#endif
{
- uint32_t sum; /* sum of key string octets */
+ uint32_t sum; /* sum of key string octets */
/* add all bytes of the key */
*
*/
-#ifdef ANSI
-PRIVATE S16 cmHashFuncMult24
+static S16 cmHashFuncMult24
(
-CmHashListCp *hashListCp, /* hash list control point */
-uint8_t *key, /* key string */
-uint16_t keyLen, /* length of key string */
-uint16_t *idx /* index to return */
+CmHashListCp *hashListCp, /* hash list control point */
+uint8_t *key, /* key string */
+uint16_t keyLen, /* length of key string */
+uint16_t *idx /* index to return */
)
-#else
-PRIVATE S16 cmHashFuncMult24(hashListCp, key, keyLen, idx)
-CmHashListCp *hashListCp; /* hash list control point */
-uint8_t *key; /* key string */
-uint16_t keyLen; /* length of key string */
-uint16_t *idx; /* index to return */
-#endif
{
- uint32_t prod; /* (constant multiplier * key) */
- uint8_t shift; /* Bits to be shifted to get index */
+ uint32_t prod; /* (constant multiplier * key) */
+ uint8_t shift; /* Bits to be shifted to get index */
UNUSED(keyLen);
*
*/
-#ifdef ANSI
-PRIVATE S16 cmHashFuncConId
+static S16 cmHashFuncConId
(
-CmHashListCp *hashListCp, /* hash list control point */
-uint8_t *key, /* key string */
-uint16_t keyLen, /* length of key string */
-uint16_t *idx /* index to return */
+CmHashListCp *hashListCp, /* hash list control point */
+uint8_t *key, /* key string */
+uint16_t keyLen, /* length of key string */
+uint16_t *idx /* index to return */
)
-#else
-PRIVATE S16 cmHashFuncConId(hashListCp, key, keyLen, idx)
-CmHashListCp *hashListCp; /* hash list control point */
-uint8_t *key; /* key string */
-uint16_t keyLen; /* length of key string */
-uint16_t *idx; /* index to return */
-#endif
{
*
*/
-#ifdef ANSI
-PRIVATE S16 cmHashFuncDirIdx
+static S16 cmHashFuncDirIdx
(
-CmHashListCp *hashListCp, /* hash list control point */
-uint8_t *key, /* key string */
-uint16_t keyLen, /* length of key string */
-uint16_t *idx /* index to return */
+CmHashListCp *hashListCp, /* hash list control point */
+uint8_t *key, /* key string */
+uint16_t keyLen, /* length of key string */
+uint16_t *idx /* index to return */
)
-#else
-PRIVATE S16 cmHashFuncDirIdx(hashListCp, key, keyLen, idx)
-CmHashListCp *hashListCp; /* hash list control point */
-uint8_t *key; /* key string */
-uint16_t keyLen; /* length of key string */
-uint16_t *idx; /* index to return */
-#endif
{
UNUSED(hashListCp);
*
*/
-#ifdef ANSI
-PRIVATE S16 cmHashMatchKey
+static S16 cmHashMatchKey
(
uint8_t *key1, /* first key string */
uint16_t keyLen1, /* length of first key string */
uint8_t *key2, /* second key string */
uint16_t keyLen2 /* length of second key string */
)
-#else
-PRIVATE S16 cmHashMatchKey(key1, keyLen1, key2, keyLen2)
-uint8_t *key1; /* first key string */
-uint16_t keyLen1; /* length of first key string */
-uint8_t *key2; /* second key string */
-uint16_t keyLen2; /* length of second key string */
-#endif
{
/* compare key lengths */
*
*/
-#ifdef ANSI
-PRIVATE S16 cmListInsert
+static S16 cmListInsert
(
CmListEnt *oldEntry, /* add new entry after this entry */
CmListEnt *newEntry /* new entry to add */
)
-#else
-PRIVATE S16 cmListInsert(oldEntry, newEntry)
-CmListEnt *oldEntry; /* add new entry after this entry */
-CmListEnt *newEntry; /* new entry to add */
-#endif
{
newEntry->next = oldEntry->next;
*
*/
-#ifdef ANSI
-PRIVATE S16 cmListDelete
+static S16 cmListDelete
(
CmListEnt *entry /* entry to delete */
)
-#else
-PRIVATE S16 cmListDelete(entry)
-CmListEnt *entry; /* entry to delete */
-#endif
{
if (entry == NULLP)
* File: cm_hash.c
*
*/
-#ifdef ANSI
S16 cmHashListInit
(
CmHashListCp *hashListCp, /* hash list to initialize */
-uint16_t nmbBins, /* number of hash list bins */
-uint16_t offset, /* offset of CmHashListEnt in entries */
+uint16_t nmbBins, /* number of hash list bins */
+uint16_t offset, /* offset of CmHashListEnt in entries */
Bool dupFlg, /* allow duplicate keys */
-uint16_t keyType, /* key type for selecting hash fn */
+uint16_t keyType, /* key type for selecting hash fn */
Region region, /* memory region to allocate bins */
Pool pool /* memory pool to allocate bins */
)
-#else
-S16 cmHashListInit(hashListCp, nmbBins, offset, dupFlg, keyType, region, pool)
-CmHashListCp *hashListCp; /* hash list to initialize */
-uint16_t nmbBins; /* number of hash list bins */
-uint16_t offset; /* offset of CmHashListEnt in entries */
-Bool dupFlg; /* allow duplicate keys */
-uint16_t keyType; /* key type for selecting hash fn */
-Region region; /* memory region to allocate bins */
-Pool pool; /* memory pool to allocate bins */
-#endif
{
uint16_t i;
#ifndef CM_MT_HASH_BIN
break;
case CM_HASH_KEYTYPE_UINT32_MOD:
- hashListCp->hashFunc = cmHashFuncUInt32Mod;
+ hashListCp->hashFunc = cmHashFuncU32Mod;
break;
case CM_HASH_KEYTYPE_BCD8:
if (nmbBins)
{
#ifndef CM_MT_HASH_BIN
- if (SGetSBuf(region, pool, (Data **) &hashListCp->hl,
+ if (SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,region, pool, (Data **) &hashListCp->hl,
(Size) (nmbBins * sizeof(CmListEnt))) != ROK)
return RFAILED;
#else
- if (SGetSBuf(region, pool, (Data **) &hashListCp->hl,
+ if (SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,region, pool, (Data **) &hashListCp->hl,
(Size) (nmbBins * sizeof(CmListBinEnt))) != ROK)
return RFAILED;
#endif
* File: cm_hash.c
*
*/
-#ifdef ANSI
S16 cmHashListDeinit
(
CmHashListCp *hashListCp /* hash list to deinitialize */
)
-#else
-S16 cmHashListDeinit(hashListCp)
-CmHashListCp *hashListCp; /* hash list to deinitialize */
-#endif
{
#if (ERRCLASS & ERRCLS_DEBUG)
/* deallocate memory for bins */
if (hashListCp->nmbBins)
#ifndef CM_MT_HASH_BIN
- (Void) SPutSBuf(hashListCp->region, hashListCp->pool,
+ (Void) SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,hashListCp->region, hashListCp->pool,
(Data *) hashListCp->hl,
(Size) (hashListCp->nmbBins * sizeof(CmListEnt)));
#else
- (Void) SPutSBuf(hashListCp->region, hashListCp->pool,
+ (Void) SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,hashListCp->region, hashListCp->pool,
(Data *) hashListCp->hl,
(Size) (hashListCp->nmbBins * sizeof(CmListBinEnt)));
#endif
*
*/
-#ifdef ANSI
S16 cmHashListInsert
(
CmHashListCp *hashListCp, /* hash list to add to */
PTR entry, /* entry to add */
-uint8_t *key, /* pointer to key */
-uint16_t keyLen /* length of key */
+uint8_t *key, /* pointer to key */
+uint16_t keyLen /* length of key */
)
-#else
-S16 cmHashListInsert(hashListCp, entry, key, keyLen)
-CmHashListCp *hashListCp; /* hash list to add to */
-PTR entry; /* entry to add */
-uint8_t *key; /* pointer to key */
-uint16_t keyLen; /* length of key */
-#endif
{
CmHashListEnt *hashListEnt; /* pointer to hash list entry header */
PTR dupEntry; /* pointer to entry with duplicate key */
*
*/
-#ifdef ANSI
S16 cmHashListDelete
(
CmHashListCp *hashListCp, /* hash list to delete from */
PTR entry /* entry to delete */
)
-#else
-S16 cmHashListDelete(hashListCp, entry)
-CmHashListCp *hashListCp; /* hash list to delete from */
-PTR entry; /* entry to delete */
-#endif
{
CmHashListEnt *hashListEnt; /* pointer to hash list entry header */
#ifdef CM_MT_HASH_BIN
*
*/
-#ifdef ANSI
S16 cmHashListFind
(
CmHashListCp *hashListCp, /* hash list to search */
-uint8_t *key, /* pointer to key */
-uint16_t keyLen, /* length of key */
-uint16_t seqNmb, /* used in case of duplicate keys */
+uint8_t *key, /* pointer to key */
+uint16_t keyLen, /* length of key */
+uint16_t seqNmb, /* used in case of duplicate keys */
PTR *entry /* entry to be returned */
)
-#else
-S16 cmHashListFind(hashListCp, key, keyLen, seqNmb, entry)
-CmHashListCp *hashListCp; /* hash list to search */
-uint8_t *key; /* pointer to key */
-uint16_t keyLen; /* length of key */
-uint16_t seqNmb; /* used in case of duplicate keys */
-PTR *entry; /* entry to be returned */
-#endif
{
CmHashListEnt *hashListEnt; /* pointer to hash list entry header */
#ifndef CM_MT_HASH_BIN
* File: cm_hash.c
*
*/
-#ifdef ANSI
S16 cmHashListGetNext
(
CmHashListCp *hashListCp, /* hash list to get from */
PTR prevEnt, /* previous entry */
PTR *entry /* entry to be returned */
)
-#else
-S16 cmHashListGetNext(hashListCp, prevEnt, entry)
-CmHashListCp *hashListCp; /* hash list to get from */
-PTR prevEnt; /* previous entry */
-PTR *entry; /* entry to be returned */
-#endif
{
#ifndef CM_MT_HASH_BIN
CmListEnt *hashListBin; /* temporary hash list bin pointer */
* File: cm_hash.c
*
*/
-#ifdef ANSI
S16 cmHashListBinGetNextEntry
(
CmHashListCp *hashListCp, /* hash list to get from */
-uint16_t binIdx, /* Bin Index to retreive the entry */
+uint16_t binIdx, /* Bin Index to retreive the entry */
PTR prevEnt, /* previous entry */
PTR *entry /* entry to be returned */
)
-#else
-S16 cmHashListBinGetNextEntry(hashListCp, binIdx, prevEnt, entry)
-CmHashListCp *hashListCp; /* hash list to get from */
-uint16_t binIdx; /* Bin Index to retreive the entry */
-PTR prevEnt; /* previous entry */
-PTR *entry; /* entry to be returned */
-#endif
{
CmListBinEnt *hashListBin; /* temporary hash list bin pointer */
CmHashListEnt *hashListEnt; /* temporary hash list entry pointer */
* File: cm_hash.c
*
*/
-#ifdef ANSI
S16 cmHashListQuery
(
CmHashListCp *hashListCp, /* hash list to query */
-uint8_t queryType, /* type of query */
-uint16_t *result /* result of query */
+uint8_t queryType, /* type of query */
+uint16_t *result /* result of query */
)
-#else
-S16 cmHashListQuery(hashListCp, queryType, result)
-CmHashListCp *hashListCp; /* hash list to query */
-uint8_t queryType; /* type of query */
-uint16_t *result; /* result of query */
-#endif
{
#ifdef CM_MT_HASH_BIN
uint8_t i;
*
*/
-#ifdef ANSI
S16 cmHashListOAInsert
(
CmHashListCp *hashListCp, /* hash table to add to */
PTR entry, /* entry to add */
-uint8_t *key, /* pointer to key */
-uint16_t keyLen /* length of key */
+uint8_t *key, /* pointer to key */
+uint16_t keyLen /* length of key */
)
-#else
-S16 cmHashListOAInsert(hashListCp, entry, key, keyLen)
-CmHashListCp *hashListCp; /* hash table to add to */
-PTR entry; /* entry to add */
-uint8_t *key; /* pointer to key */
-uint16_t keyLen; /* length of key */
-#endif
{
/* cm_hash_c_001.main_21. Modify. Compilation Issue resolved. */
#ifndef CM_MT_HASH_BIN