Asterisk - The Open Source Telephony Project  GIT-master-a24979a
Data Structures | Macros | Typedefs | Enumerations
hash.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _bufhead
 
struct  hashhdr
 
struct  htab
 

Macros

#define ALL_CLEAR   0
 
#define ALL_SET   ((u_int32_t)0xFFFFFFFF)
 
#define BITMAPS   hdr.bitmaps
 
#define BITS_PER_MAP   32
 
#define BSHIFT   hdr.bshift
 
#define BSIZE   hdr.bsize
 
#define BUCKET_TO_PAGE(B)    (B) + hashp->HDRPAGES + ((B) ? hashp->SPARES[__hash_log2((B)+1)-1] : 0)
 
#define BUF_BUCKET   0x0004
 
#define BUF_DISK   0x0002
 
#define BUF_MOD   0x0001
 
#define BUF_PIN   0x0008
 
#define BYTE_SHIFT   3
 
#define CHARKEY   "%$sniglet^&"
 
#define CLRBIT(A, N)   ((A)[(N)/BITS_PER_MAP] &= ~(1<<((N)%BITS_PER_MAP)))
 
#define DEF_BUCKET_SHIFT   12 /* log2(BUCKET) */
 
#define DEF_BUCKET_SIZE   4096
 
#define DEF_BUFSIZE   65536 /* 64 K */
 
#define DEF_DIRSIZE   256
 
#define DEF_FFACTOR   65536
 
#define DEF_SEGSIZE   256
 
#define DEF_SEGSIZE_SHIFT   8 /* log2(SEGSIZE) */
 
#define DODISK(X)   ((X) = (char *)((ptrdiff_t)(X)|0x2))
 
#define DOMOD(X)   ((X) = (char *)((ptrdiff_t)(X)|0x1))
 
#define DSIZE   hdr.dsize
 
#define FFACTOR   hdr.ffactor
 
#define FULL_KEY   2
 
#define FULL_KEY_DATA   3
 
#define H_CHARKEY   hdr.h_charkey
 
#define HDRPAGES   hdr.hdrpages
 
#define HIGH_MASK   hdr.high_mask
 
#define INT_BYTE_SHIFT   5
 
#define INT_TO_BYTE   2
 
#define IS_BUCKET(X)   ((X) & BUF_BUCKET)
 
#define ISDISK(X)   ((u_int32_t)(ptrdiff_t)(X)&0x2)
 
#define ISMOD(X)   ((u_int32_t)(ptrdiff_t)(X)&0x1)
 
#define ISSET(A, N)   ((A)[(N)/BITS_PER_MAP] & (1<<((N)%BITS_PER_MAP)))
 
#define LAST_FREED   hdr.last_freed
 
#define LORDER   hdr.lorder
 
#define LOW_MASK   hdr.low_mask
 
#define MAGIC   hdr.magic
 
#define MAX_BSIZE   65536 /* 2^16 */
 
#define MAX_BUCKET   hdr.max_bucket
 
#define MIN_BUFFERS   6
 
#define MIN_FFACTOR   4
 
#define MINHDRSIZE   512
 
#define NCACHED
 
#define NEXT_FREE   hdr.next_free
 
#define NKEYS   hdr.nkeys
 
#define NUMKEY   1038583
 
#define OADDR_OF(S, O)   ((u_int32_t)((u_int32_t)(S) << SPLITSHIFT) + (O))
 
#define OADDR_TO_PAGE(B)    BUCKET_TO_PAGE ( (1 << SPLITNUM((B))) -1 ) + OPAGENUM((B));
 
#define OPAGENUM(N)   ((N) & SPLITMASK)
 
#define OVFL_POINT   hdr.ovfl_point
 
#define OVFLPAGE   0
 
#define PARTIAL_KEY   1
 
#define PTROF(X)   ((BUFHEAD *)((ptrdiff_t)(X)&~0x3))
 
#define REAL_KEY   4
 
#define SETBIT(A, N)   ((A)[(N)/BITS_PER_MAP] |= (1<<((N)%BITS_PER_MAP)))
 
#define SGSIZE   hdr.ssize
 
#define SPARES   hdr.spares
 
#define SPLITMASK   0x7FF
 
#define SPLITNUM(N)   (((u_int32_t)(N)) >> SPLITSHIFT)
 
#define SPLITSHIFT   11
 
#define SPLTMAX   8
 
#define SSHIFT   hdr.sshift
 
#define VERSION   hdr.version
 

Typedefs

typedef struct _bufhead BUFHEAD
 
typedef struct hashhdr HASHHDR
 
typedef struct htab HTAB
 
typedef BUFHEAD ** SEGMENT
 

Enumerations

enum  ACTION {
  HASH_GET , HASH_PUT , HASH_PUTNEW , HASH_DELETE ,
  HASH_FIRST , HASH_NEXT , FIND , ENTER
}
 

Macro Definition Documentation

◆ ALL_CLEAR

#define ALL_CLEAR   0

Definition at line 141 of file hash.h.

◆ ALL_SET

#define ALL_SET   ((u_int32_t)0xFFFFFFFF)

Definition at line 140 of file hash.h.

◆ BITMAPS

#define BITMAPS   hdr.bitmaps

Definition at line 288 of file hash.h.

◆ BITS_PER_MAP

#define BITS_PER_MAP   32

Definition at line 149 of file hash.h.

◆ BSHIFT

#define BSHIFT   hdr.bshift

Definition at line 274 of file hash.h.

◆ BSIZE

#define BSIZE   hdr.bsize

Definition at line 273 of file hash.h.

◆ BUCKET_TO_PAGE

#define BUCKET_TO_PAGE (   B)     (B) + hashp->HDRPAGES + ((B) ? hashp->SPARES[__hash_log2((B)+1)-1] : 0)

Definition at line 171 of file hash.h.

◆ BUF_BUCKET

#define BUF_BUCKET   0x0004

Definition at line 56 of file hash.h.

◆ BUF_DISK

#define BUF_DISK   0x0002

Definition at line 55 of file hash.h.

◆ BUF_MOD

#define BUF_MOD   0x0001

Definition at line 54 of file hash.h.

◆ BUF_PIN

#define BUF_PIN   0x0008

Definition at line 57 of file hash.h.

◆ BYTE_SHIFT

#define BYTE_SHIFT   3

Definition at line 137 of file hash.h.

◆ CHARKEY

#define CHARKEY   "%$sniglet^&"

Definition at line 135 of file hash.h.

◆ CLRBIT

#define CLRBIT (   A,
 
)    ((A)[(N)/BITS_PER_MAP] &= ~(1<<((N)%BITS_PER_MAP)))

Definition at line 152 of file hash.h.

◆ DEF_BUCKET_SHIFT

#define DEF_BUCKET_SHIFT   12 /* log2(BUCKET) */

Definition at line 128 of file hash.h.

◆ DEF_BUCKET_SIZE

#define DEF_BUCKET_SIZE   4096

Definition at line 127 of file hash.h.

◆ DEF_BUFSIZE

#define DEF_BUFSIZE   65536 /* 64 K */

Definition at line 126 of file hash.h.

◆ DEF_DIRSIZE

#define DEF_DIRSIZE   256

Definition at line 131 of file hash.h.

◆ DEF_FFACTOR

#define DEF_FFACTOR   65536

Definition at line 132 of file hash.h.

◆ DEF_SEGSIZE

#define DEF_SEGSIZE   256

Definition at line 129 of file hash.h.

◆ DEF_SEGSIZE_SHIFT

#define DEF_SEGSIZE_SHIFT   8 /* log2(SEGSIZE) */

Definition at line 130 of file hash.h.

◆ DODISK

#define DODISK (   X)    ((X) = (char *)((ptrdiff_t)(X)|0x2))

Definition at line 147 of file hash.h.

◆ DOMOD

#define DOMOD (   X)    ((X) = (char *)((ptrdiff_t)(X)|0x1))

Definition at line 145 of file hash.h.

◆ DSIZE

#define DSIZE   hdr.dsize

Definition at line 275 of file hash.h.

◆ FFACTOR

#define FFACTOR   hdr.ffactor

Definition at line 282 of file hash.h.

◆ FULL_KEY

#define FULL_KEY   2

Definition at line 268 of file hash.h.

◆ FULL_KEY_DATA

#define FULL_KEY_DATA   3

Definition at line 269 of file hash.h.

◆ H_CHARKEY

#define H_CHARKEY   hdr.h_charkey

Definition at line 292 of file hash.h.

◆ HDRPAGES

#define HDRPAGES   hdr.hdrpages

Definition at line 286 of file hash.h.

◆ HIGH_MASK

#define HIGH_MASK   hdr.high_mask

Definition at line 283 of file hash.h.

◆ INT_BYTE_SHIFT

#define INT_BYTE_SHIFT   5

Definition at line 139 of file hash.h.

◆ INT_TO_BYTE

#define INT_TO_BYTE   2

Definition at line 138 of file hash.h.

◆ IS_BUCKET

#define IS_BUCKET (   X)    ((X) & BUF_BUCKET)

Definition at line 60 of file hash.h.

◆ ISDISK

#define ISDISK (   X)    ((u_int32_t)(ptrdiff_t)(X)&0x2)

Definition at line 146 of file hash.h.

◆ ISMOD

#define ISMOD (   X)    ((u_int32_t)(ptrdiff_t)(X)&0x1)

Definition at line 144 of file hash.h.

◆ ISSET

#define ISSET (   A,
 
)    ((A)[(N)/BITS_PER_MAP] & (1<<((N)%BITS_PER_MAP)))

Definition at line 154 of file hash.h.

◆ LAST_FREED

#define LAST_FREED   hdr.last_freed

Definition at line 280 of file hash.h.

◆ LORDER

#define LORDER   hdr.lorder

Definition at line 278 of file hash.h.

◆ LOW_MASK

#define LOW_MASK   hdr.low_mask

Definition at line 284 of file hash.h.

◆ MAGIC

#define MAGIC   hdr.magic

Definition at line 290 of file hash.h.

◆ MAX_BSIZE

#define MAX_BSIZE   65536 /* 2^16 */

Definition at line 123 of file hash.h.

◆ MAX_BUCKET

#define MAX_BUCKET   hdr.max_bucket

Definition at line 281 of file hash.h.

◆ MIN_BUFFERS

#define MIN_BUFFERS   6

Definition at line 124 of file hash.h.

◆ MIN_FFACTOR

#define MIN_FFACTOR   4

Definition at line 133 of file hash.h.

◆ MINHDRSIZE

#define MINHDRSIZE   512

Definition at line 125 of file hash.h.

◆ NCACHED

#define NCACHED
Value:
32 /* number of bit maps and spare
* points */

Definition at line 85 of file hash.h.

◆ NEXT_FREE

#define NEXT_FREE   hdr.next_free

Definition at line 291 of file hash.h.

◆ NKEYS

#define NKEYS   hdr.nkeys

Definition at line 285 of file hash.h.

◆ NUMKEY

#define NUMKEY   1038583

Definition at line 136 of file hash.h.

◆ OADDR_OF

#define OADDR_OF (   S,
 
)    ((u_int32_t)((u_int32_t)(S) << SPLITSHIFT) + (O))

Definition at line 169 of file hash.h.

◆ OADDR_TO_PAGE

#define OADDR_TO_PAGE (   B)     BUCKET_TO_PAGE ( (1 << SPLITNUM((B))) -1 ) + OPAGENUM((B));

Definition at line 173 of file hash.h.

◆ OPAGENUM

#define OPAGENUM (   N)    ((N) & SPLITMASK)

Definition at line 168 of file hash.h.

◆ OVFL_POINT

#define OVFL_POINT   hdr.ovfl_point

Definition at line 279 of file hash.h.

◆ OVFLPAGE

#define OVFLPAGE   0

Definition at line 266 of file hash.h.

◆ PARTIAL_KEY

#define PARTIAL_KEY   1

Definition at line 267 of file hash.h.

◆ PTROF

#define PTROF (   X)    ((BUFHEAD *)((ptrdiff_t)(X)&~0x3))

Definition at line 143 of file hash.h.

◆ REAL_KEY

#define REAL_KEY   4

Definition at line 270 of file hash.h.

◆ SETBIT

#define SETBIT (   A,
 
)    ((A)[(N)/BITS_PER_MAP] |= (1<<((N)%BITS_PER_MAP)))

Definition at line 153 of file hash.h.

◆ SGSIZE

#define SGSIZE   hdr.ssize

Definition at line 276 of file hash.h.

◆ SPARES

#define SPARES   hdr.spares

Definition at line 287 of file hash.h.

◆ SPLITMASK

#define SPLITMASK   0x7FF

Definition at line 166 of file hash.h.

◆ SPLITNUM

#define SPLITNUM (   N)    (((u_int32_t)(N)) >> SPLITSHIFT)

Definition at line 167 of file hash.h.

◆ SPLITSHIFT

#define SPLITSHIFT   11

Definition at line 165 of file hash.h.

◆ SPLTMAX

#define SPLTMAX   8

Definition at line 134 of file hash.h.

◆ SSHIFT

#define SSHIFT   hdr.sshift

Definition at line 277 of file hash.h.

◆ VERSION

#define VERSION   hdr.version

Definition at line 289 of file hash.h.

Typedef Documentation

◆ BUFHEAD

typedef struct _bufhead BUFHEAD

Definition at line 1 of file hash.h.

◆ HASHHDR

typedef struct hashhdr HASHHDR

◆ HTAB

typedef struct htab HTAB

◆ SEGMENT

typedef BUFHEAD** SEGMENT

Definition at line 62 of file hash.h.

Enumeration Type Documentation

◆ ACTION

enum ACTION
Enumerator
HASH_GET 
HASH_PUT 
HASH_PUTNEW 
HASH_DELETE 
HASH_FIRST 
HASH_NEXT 
FIND 
ENTER 

Definition at line 40 of file hash.h.

40  {
42 } ACTION;
ACTION
Definition: hash.h:40
@ HASH_DELETE
Definition: hash.h:41
@ HASH_PUT
Definition: hash.h:41
@ HASH_PUTNEW
Definition: hash.h:41
@ HASH_GET
Definition: hash.h:41
@ HASH_NEXT
Definition: hash.h:41
@ HASH_FIRST
Definition: hash.h:41