⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cm_hash.h

📁 中国石油二期加油站IC系统后台通讯软件
💻 H
字号:
/********************************************************************20**
  
     Name:     common hash functions
  
     Type:     C include file
  
     Desc:     Defines required by common functions.
               (Newer version of functions in cm_bdy1)
  
     File:     cm_hash.h

     Sid:      cm_hash.h 1.6  -  02/11/00 11:55:49
  
     Prg:      rg
  
*********************************************************************21*/
  
#ifndef __CMHASHH__
#define __CMHASHH__ 

  
/* defines */

/* key types */

#define CM_HASH_KEYTYPE_DEF         0  /* default key type - selects 
                                          Trillium supplied default function */
#define CM_HASH_KEYTYPE_MULT24      1  /* key type which uses multiplication 
                                          method to compute hash list index 
                                          - function supplied by Trillium */
#define CM_HASH_KEYTYPE_DIRIDX      2  /* direct indexing of hash tables */

#define CM_HASH_KEYTYPE_STR         3  /* Hash Function for Strings */

/* Constants */
#define CM_STR_HASHFUNC_CONSTANT    31 /* Constant for CM_HASH_KEYTYPE_STR */

/* query types */

#define CM_HASH_QUERYTYPE_BINS     1  /* number of bins */
#define CM_HASH_QUERYTYPE_BINSIZE  2  /* storage for each bin */
#define CM_HASH_QUERYTYPE_ENTRIES  3  /* current number of entries */
#define CM_HASH_QUERYTYPE_OFFSET   4  /* offset of CmHashListEnt in entries */
#define CM_HASH_QUERYTYPE_DUPFLG   5  /* allow duplicate keys */
#define CM_HASH_QUERYTYPE_KEYTYPE  6  /* key type for selecting hash functions */

#define CM_HASH_VALUE(entry)       (entry)->hashVal  /* computed hash value */
#define CM_HASH_SIZE(tbl)          (tbl)->nmbBins    /* hash table size */

#define CM_HASH_NMBENT(tbl)        (tbl)->nmbEnt     /* number of entries in
                                                      * table
                                                      */

#define CM_HASH_DUPFLG(tbl)        (tbl)->dupFlg     /* allow duplicate keys */

#define CM_HASH_OFFSET(tbl)        (tbl)->offset     /* offset of CmHashListEnt
                                                      * structure in hash list
                                                      * entry
                                                      */

#define CM_HASH_KEYTYPE(tbl)       (tbl)->keyType    /* key type for selecting
                                                      * hash function
                                                      */

#define CM_HASH_BINSIZE       sizeof(CmListEnt) /* size of a single bin
                                                 */
/* bin bit mask */

#define CM_HASH_NOBITMASK          0x8000  /* illegal bin bit mask */

/* constant multiplier for multiplication method of computing hash index */
#define CM_HASH_MULT24_CONST       10368890   /* when key is of max 24 bits */

/* bit position where the hash index is extracted in multiplication method */
#define CM_HASH_MULT24_BITPOS        24       /* when key is of max 24 bits */

/*
 *  delete an entry from the hash table with open addressing
 */
#define cmHashListOADelete(hashListCp, entry) cmHashListDelete(hashListCp, (PTR)entry)


#endif /* __CMHASHH__ */

  
/********************************************************************30**
  
         End of file: cm_hash.h 1.6  -  02/11/00 11:55:49
  
*********************************************************************31*/


/********************************************************************40**
  
        Notes:
  
*********************************************************************41*/

/********************************************************************50**

*********************************************************************51*/

   
/********************************************************************60**
  
        Revision history:
  
*********************************************************************61*/
  
/********************************************************************80**

  version    pat  init                   description
----------- ----- ----  ------------------------------------------------
1.1          ---  rg    1. initial release.

1.2          ---  bw    1. add define's CM_HASH_VALUE & CM_HASH_SIZE
             ---  bw    2. add support for hash table with open addressing
             ---  vk    3. change copyright header

*********************************************************************81*/
/********************************************************************90**
 
    ver       pat    init                  description
----------- -------- ---- -----------------------------------------------
1.3          ---      ak   1. added macros for all queries in
                             cmHashListQuery
             ---      sg   2. changed CM_HASH_BINSIZE definition  
             ---      rg   3. add define for CM_HASH_NOBITMASK.
             ---      rg   4. removed define for CM_HASH_SIZE.
             ---      kvm  5. added defines CM_HASH_KEYTYPE_MULT24,    
                                           CM_HASH_MULT24_CONST,      
                                           CM_HASH_MULT24_BITPOS,      
                                       and CM_HASH_KEYTYPE_DIRIDX.

1.4          ---      bbk  1. Changed copyright header date.

1.5          ---      tej  1. Changed copyright header date.
1.6          ---      bbk  1. Added CM_HASH_KEYTYPE_STR, 
                              CM_STR_HASHFUNC_CONSTANT
*********************************************************************91*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -