w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

uthash.h File Reference
#include <string.h>
#include <stddef.h>
#include <stdlib.h>
Include dependency graph for uthash.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  UT_hash_bucket
 
struct  UT_hash_table
 
struct  UT_hash_handle
 

Macros

#define UTHASH_VERSION   2.0.2
 
#define DECLTYPE(x)   (__typeof(x))
 
#define DECLTYPE_ASSIGN(dst, src)
 
#define uthash_malloc(sz)   malloc(sz) /* malloc fcn */
 
#define uthash_free(ptr, sz)   free(ptr) /* free fcn */
 
#define uthash_bzero(a, n)   memset(a,'\0',n)
 
#define uthash_memcmp(a, b, n)   memcmp(a,b,n)
 
#define uthash_strlen(s)   strlen(s)
 
#define uthash_noexpand_fyi(tbl)   /* can be defined to log noexpand */
 
#define uthash_expand_fyi(tbl)   /* can be defined to log expands */
 
#define HASH_NONFATAL_OOM   0
 
#define uthash_fatal(msg)   exit(-1) /* fatal OOM error */
 
#define HASH_RECORD_OOM(oomed)   uthash_fatal("out of memory")
 
#define IF_HASH_NONFATAL_OOM(x)
 
#define HASH_INITIAL_NUM_BUCKETS   32U /* initial number of buckets */
 
#define HASH_INITIAL_NUM_BUCKETS_LOG2   5U /* lg2 of initial number of buckets */
 
#define HASH_BKT_CAPACITY_THRESH   10U /* expand when bucket count reaches */
 
#define ELMT_FROM_HH(tbl, hhp)   ((void*)(((char*)(hhp)) - ((tbl)->hho)))
 
#define HH_FROM_ELMT(tbl, elp)   ((UT_hash_handle *)(((char*)(elp)) + ((tbl)->hho)))
 
#define HASH_ROLLBACK_BKT(hh, head, itemptrhh)
 
#define HASH_VALUE(keyptr, keylen, hashv)
 
#define HASH_FIND_BYHASHVALUE(hh, head, keyptr, keylen, hashval, out)
 
#define HASH_FIND(hh, head, keyptr, keylen, out)
 
#define HASH_BLOOM_MAKE(tbl, oomed)
 
#define HASH_BLOOM_FREE(tbl)
 
#define HASH_BLOOM_ADD(tbl, hashv)
 
#define HASH_BLOOM_TEST(tbl, hashv)   (1)
 
#define HASH_BLOOM_BYTELEN   0U
 
#define HASH_MAKE_TABLE(hh, head, oomed)
 
#define HASH_REPLACE_BYHASHVALUE_INORDER(hh, head, fieldname, keylen_in, hashval, add, replaced, cmpfcn)
 
#define HASH_REPLACE_BYHASHVALUE(hh, head, fieldname, keylen_in, hashval, add, replaced)
 
#define HASH_REPLACE(hh, head, fieldname, keylen_in, add, replaced)
 
#define HASH_REPLACE_INORDER(hh, head, fieldname, keylen_in, add, replaced, cmpfcn)
 
#define HASH_APPEND_LIST(hh, head, add)
 
#define HASH_AKBI_INNER_LOOP(hh, head, add, cmpfcn)
 
#define HASH_ADD_TO_TABLE(hh, head, keyptr, keylen_in, hashval, add, oomed)
 
#define HASH_ADD_KEYPTR_BYHASHVALUE_INORDER(hh, head, keyptr, keylen_in, hashval, add, cmpfcn)
 
#define HASH_ADD_KEYPTR_INORDER(hh, head, keyptr, keylen_in, add, cmpfcn)
 
#define HASH_ADD_BYHASHVALUE_INORDER(hh, head, fieldname, keylen_in, hashval, add, cmpfcn)    HASH_ADD_KEYPTR_BYHASHVALUE_INORDER(hh, head, &((add)->fieldname), keylen_in, hashval, add, cmpfcn)
 
#define HASH_ADD_INORDER(hh, head, fieldname, keylen_in, add, cmpfcn)    HASH_ADD_KEYPTR_INORDER(hh, head, &((add)->fieldname), keylen_in, add, cmpfcn)
 
#define HASH_ADD_KEYPTR_BYHASHVALUE(hh, head, keyptr, keylen_in, hashval, add)
 
#define HASH_ADD_KEYPTR(hh, head, keyptr, keylen_in, add)
 
#define HASH_ADD_BYHASHVALUE(hh, head, fieldname, keylen_in, hashval, add)    HASH_ADD_KEYPTR_BYHASHVALUE(hh, head, &((add)->fieldname), keylen_in, hashval, add)
 
#define HASH_ADD(hh, head, fieldname, keylen_in, add)    HASH_ADD_KEYPTR(hh, head, &((add)->fieldname), keylen_in, add)
 
#define HASH_TO_BKT(hashv, num_bkts, bkt)
 
#define HASH_DELETE(hh, head, delptr)    HASH_DELETE_HH(hh, head, &(delptr)->hh)
 
#define HASH_DELETE_HH(hh, head, delptrhh)
 
#define HASH_FIND_STR(head, findstr, out)    HASH_FIND(hh,head,findstr,(unsigned)uthash_strlen(findstr),out)
 
#define HASH_ADD_STR(head, strfield, add)    HASH_ADD(hh,head,strfield[0],(unsigned)uthash_strlen(add->strfield),add)
 
#define HASH_REPLACE_STR(head, strfield, add, replaced)    HASH_REPLACE(hh,head,strfield[0],(unsigned)uthash_strlen(add->strfield),add,replaced)
 
#define HASH_FIND_INT(head, findint, out)    HASH_FIND(hh,head,findint,sizeof(int),out)
 
#define HASH_ADD_INT(head, intfield, add)    HASH_ADD(hh,head,intfield,sizeof(int),add)
 
#define HASH_REPLACE_INT(head, intfield, add, replaced)    HASH_REPLACE(hh,head,intfield,sizeof(int),add,replaced)
 
#define HASH_FIND_PTR(head, findptr, out)    HASH_FIND(hh,head,findptr,sizeof(void *),out)
 
#define HASH_ADD_PTR(head, ptrfield, add)    HASH_ADD(hh,head,ptrfield,sizeof(void *),add)
 
#define HASH_REPLACE_PTR(head, ptrfield, add, replaced)    HASH_REPLACE(hh,head,ptrfield,sizeof(void *),add,replaced)
 
#define HASH_DEL(head, delptr)    HASH_DELETE(hh,head,delptr)
 
#define HASH_FSCK(hh, head, where)
 
#define HASH_EMIT_KEY(hh, head, keyptr, fieldlen)
 
#define HASH_FCN   HASH_JEN
 
#define HASH_BER(key, keylen, hashv)
 
#define HASH_SAX(key, keylen, hashv)
 
#define HASH_FNV(key, keylen, hashv)
 
#define HASH_OAT(key, keylen, hashv)
 
#define HASH_JEN_MIX(a, b, c)
 
#define HASH_JEN(key, keylen, hashv)
 
#define get16bits(d)
 
#define HASH_SFH(key, keylen, hashv)
 
#define HASH_FIND_IN_BKT(tbl, hh, head, keyptr, keylen_in, hashval, out)
 
#define HASH_ADD_TO_BKT(head, hh, addhh, oomed)
 
#define HASH_DEL_IN_BKT(head, delhh)
 
#define HASH_EXPAND_BUCKETS(hh, tbl, oomed)
 
#define HASH_SORT(head, cmpfcn)   HASH_SRT(hh,head,cmpfcn)
 
#define HASH_SRT(hh, head, cmpfcn)
 
#define HASH_SELECT(hh_dst, dst, hh_src, src, cond)
 
#define HASH_CLEAR(hh, head)
 
#define HASH_OVERHEAD(hh, head)
 
#define HASH_ITER(hh, head, el, tmp)
 
#define HASH_COUNT(head)   HASH_CNT(hh,head)
 
#define HASH_CNT(hh, head)   ((head != NULL)?((head)->hh.tbl->num_items):0U)
 
#define HASH_SIGNATURE   0xa0111fe1u
 
#define HASH_BLOOM_SIGNATURE   0xb12220f2u
 

Typedefs

typedef unsigned int uint32_t
 
typedef unsigned char uint8_t
 
typedef struct UT_hash_bucket UT_hash_bucket
 
typedef struct UT_hash_table UT_hash_table
 
typedef struct UT_hash_handle UT_hash_handle
 

Macro Definition Documentation

◆ DECLTYPE

#define DECLTYPE (   x)    (__typeof(x))

Definition at line 47 of file uthash.h.

◆ DECLTYPE_ASSIGN

#define DECLTYPE_ASSIGN (   dst,
  src 
)
Value:
do { \
(dst) = DECLTYPE(dst)(src); \
} while (0)
#define DECLTYPE(x)
Definition: uthash.h:47

Definition at line 59 of file uthash.h.

◆ ELMT_FROM_HH

#define ELMT_FROM_HH (   tbl,
  hhp 
)    ((void*)(((char*)(hhp)) - ((tbl)->hho)))

Definition at line 137 of file uthash.h.

◆ get16bits

#define get16bits (   d)
Value:
((((uint32_t)(((const uint8_t *)(d))[1])) << 8) \
+(uint32_t)(((const uint8_t *)(d))[0]) )
#define d(n)
Definition: gpos-common.c:151
unsigned int uint32_t
Definition: stdint.h:80
unsigned char uint8_t
Definition: stdint.h:78
unsigned int uint32_t
Definition: uthash.h:78

Definition at line 690 of file uthash.h.

◆ HASH_ADD

#define HASH_ADD (   hh,
  head,
  fieldname,
  keylen_in,
  add 
)     HASH_ADD_KEYPTR(hh, head, &((add)->fieldname), keylen_in, add)

Definition at line 427 of file uthash.h.

◆ HASH_ADD_BYHASHVALUE

#define HASH_ADD_BYHASHVALUE (   hh,
  head,
  fieldname,
  keylen_in,
  hashval,
  add 
)     HASH_ADD_KEYPTR_BYHASHVALUE(hh, head, &((add)->fieldname), keylen_in, hashval, add)

Definition at line 424 of file uthash.h.

◆ HASH_ADD_BYHASHVALUE_INORDER

#define HASH_ADD_BYHASHVALUE_INORDER (   hh,
  head,
  fieldname,
  keylen_in,
  hashval,
  add,
  cmpfcn 
)     HASH_ADD_KEYPTR_BYHASHVALUE_INORDER(hh, head, &((add)->fieldname), keylen_in, hashval, add, cmpfcn)

Definition at line 390 of file uthash.h.

◆ HASH_ADD_INORDER

#define HASH_ADD_INORDER (   hh,
  head,
  fieldname,
  keylen_in,
  add,
  cmpfcn 
)     HASH_ADD_KEYPTR_INORDER(hh, head, &((add)->fieldname), keylen_in, add, cmpfcn)

Definition at line 393 of file uthash.h.

◆ HASH_ADD_INT

#define HASH_ADD_INT (   head,
  intfield,
  add 
)     HASH_ADD(hh,head,intfield,sizeof(int),add)

Definition at line 488 of file uthash.h.

◆ HASH_ADD_KEYPTR

#define HASH_ADD_KEYPTR (   hh,
  head,
  keyptr,
  keylen_in,
  add 
)
Value:
do { \
unsigned _ha_hashv; \
HASH_VALUE(keyptr, keylen_in, _ha_hashv); \
HASH_ADD_KEYPTR_BYHASHVALUE(hh, head, keyptr, keylen_in, _ha_hashv, add); \
} while (0)
long hh
Definition: dvi2xx.h:579
set set set set set set set set set set set set set set set set set set set set *set set set macro pixldst op &r &cond WK op &r &cond WK op &r &cond WK else op &m &cond &ia op &r &cond WK else op &m &cond &ia elseif elseif else error unsupported base if elseif elseif else error unsupported unaligned pixldst unaligned endm macro pixst base base else pixldst base endif endm macro PF base if bpp PF set rept prefetch_distance PF set OFFSET endr endif endm macro preload_leading_step2 base if bpp ifc DST PF PF else if bpp lsl PF PF lsl PF PF lsl PF PF PF else PF lsl PF add
Definition: ttf.h:354

Definition at line 417 of file uthash.h.

◆ HASH_ADD_KEYPTR_BYHASHVALUE

#define HASH_ADD_KEYPTR_BYHASHVALUE (   hh,
  head,
  keyptr,
  keylen_in,
  hashval,
  add 
)
Value:
do { \
IF_HASH_NONFATAL_OOM( int _ha_oomed = 0; ) \
(add)->hh.hashv = (hashval); \
(add)->hh.key = (char*) (keyptr); \
(add)->hh.keylen = (unsigned) (keylen_in); \
if (!(head)) { \
(add)->hh.next = NULL; \
(add)->hh.prev = NULL; \
HASH_MAKE_TABLE(hh, add, _ha_oomed); \
IF_HASH_NONFATAL_OOM( if (!_ha_oomed) { ) \
(head) = (add); \
IF_HASH_NONFATAL_OOM( } ) \
} else { \
(add)->hh.tbl = (head)->hh.tbl; \
HASH_APPEND_LIST(hh, head, add); \
} \
HASH_ADD_TO_TABLE(hh, head, keyptr, keylen_in, hashval, add, _ha_oomed); \
HASH_FSCK(hh, head, "HASH_ADD_KEYPTR_BYHASHVALUE"); \
} while (0)
#define NULL
Definition: ftobjs.h:61

Definition at line 396 of file uthash.h.

◆ HASH_ADD_KEYPTR_BYHASHVALUE_INORDER

#define HASH_ADD_KEYPTR_BYHASHVALUE_INORDER (   hh,
  head,
  keyptr,
  keylen_in,
  hashval,
  add,
  cmpfcn 
)

Definition at line 350 of file uthash.h.

◆ HASH_ADD_KEYPTR_INORDER

#define HASH_ADD_KEYPTR_INORDER (   hh,
  head,
  keyptr,
  keylen_in,
  add,
  cmpfcn 
)
Value:
do { \
unsigned _hs_hashv; \
HASH_VALUE(keyptr, keylen_in, _hs_hashv); \
HASH_ADD_KEYPTR_BYHASHVALUE_INORDER(hh, head, keyptr, keylen_in, _hs_hashv, add, cmpfcn); \
} while (0)

Definition at line 383 of file uthash.h.

◆ HASH_ADD_PTR

#define HASH_ADD_PTR (   head,
  ptrfield,
  add 
)     HASH_ADD(hh,head,ptrfield,sizeof(void *),add)

Definition at line 494 of file uthash.h.

◆ HASH_ADD_STR

#define HASH_ADD_STR (   head,
  strfield,
  add 
)     HASH_ADD(hh,head,strfield[0],(unsigned)uthash_strlen(add->strfield),add)

Definition at line 482 of file uthash.h.

◆ HASH_ADD_TO_BKT

#define HASH_ADD_TO_BKT (   head,
  hh,
  addhh,
  oomed 
)
Value:
do { \
UT_hash_bucket *_ha_head = &(head); \
_ha_head->count++; \
(addhh)->hh_next = _ha_head->hh_head; \
(addhh)->hh_prev = NULL; \
if (_ha_head->hh_head != NULL) { \
_ha_head->hh_head->hh_prev = (addhh); \
} \
_ha_head->hh_head = (addhh); \
if ((_ha_head->count >= ((_ha_head->expand_mult + 1U) * HASH_BKT_CAPACITY_THRESH)) \
&& !(addhh)->tbl->noexpand) { \
HASH_EXPAND_BUCKETS(addhh,(addhh)->tbl, oomed); \
IF_HASH_NONFATAL_OOM( \
if (oomed) { \
HASH_DEL_IN_BKT(head,addhh); \
} \
) \
} \
} while (0)
#define head
Definition: aptex-macros.h:513
#define HASH_BKT_CAPACITY_THRESH
Definition: uthash.h:134

Definition at line 840 of file uthash.h.

◆ HASH_ADD_TO_TABLE

#define HASH_ADD_TO_TABLE (   hh,
  head,
  keyptr,
  keylen_in,
  hashval,
  add,
  oomed 
)
Value:
do { \
unsigned _ha_bkt; \
(head)->hh.tbl->num_items++; \
HASH_TO_BKT(hashval, (head)->hh.tbl->num_buckets, _ha_bkt); \
HASH_ADD_TO_BKT((head)->hh.tbl->buckets[_ha_bkt], hh, &(add)->hh, oomed); \
HASH_BLOOM_ADD((head)->hh.tbl, hashval); \
HASH_EMIT_KEY(hh, head, keyptr, keylen_in); \
} while (0)
#define HASH_TO_BKT(hashv, num_bkts, bkt)
Definition: uthash.h:430

Definition at line 337 of file uthash.h.

◆ HASH_AKBI_INNER_LOOP

#define HASH_AKBI_INNER_LOOP (   hh,
  head,
  add,
  cmpfcn 
)
Value:
do { \
do { \
if (cmpfcn(DECLTYPE(head)(_hs_iter), add) > 0) { \
break; \
} \
} while ((_hs_iter = HH_FROM_ELMT((head)->hh.tbl, _hs_iter)->next)); \
} while (0)
#define HH_FROM_ELMT(tbl, elp)
Definition: uthash.h:139

Definition at line 286 of file uthash.h.

◆ HASH_APPEND_LIST

#define HASH_APPEND_LIST (   hh,
  head,
  add 
)
Value:
do { \
(add)->hh.next = NULL; \
(add)->hh.prev = ELMT_FROM_HH((head)->hh.tbl, (head)->hh.tbl->tail); \
(head)->hh.tbl->tail->next = (add); \
(head)->hh.tbl->tail = &((add)->hh); \
} while (0)
#define ELMT_FROM_HH(tbl, hhp)
Definition: uthash.h:137

Definition at line 278 of file uthash.h.

◆ HASH_BER

#define HASH_BER (   key,
  keylen,
  hashv 
)
Value:
do { \
unsigned _hb_keylen = (unsigned)keylen; \
const unsigned char *_hb_key = (const unsigned char*)(key); \
(hashv) = 0; \
while (_hb_keylen-- != 0U) { \
(hashv) = (((hashv) << 5) + (hashv)) + *_hb_key++; \
} \
} while (0)
#define key
Definition: tex2xindy.c:753
#define U(a)
Definition: twiddle.h:1

Definition at line 580 of file uthash.h.

◆ HASH_BKT_CAPACITY_THRESH

#define HASH_BKT_CAPACITY_THRESH   10U /* expand when bucket count reaches */

Definition at line 134 of file uthash.h.

◆ HASH_BLOOM_ADD

#define HASH_BLOOM_ADD (   tbl,
  hashv 
)

Definition at line 207 of file uthash.h.

◆ HASH_BLOOM_BYTELEN

#define HASH_BLOOM_BYTELEN   0U

Definition at line 209 of file uthash.h.

◆ HASH_BLOOM_FREE

#define HASH_BLOOM_FREE (   tbl)

Definition at line 206 of file uthash.h.

◆ HASH_BLOOM_MAKE

#define HASH_BLOOM_MAKE (   tbl,
  oomed 
)

Definition at line 205 of file uthash.h.

◆ HASH_BLOOM_SIGNATURE

#define HASH_BLOOM_SIGNATURE   0xb12220f2u

Definition at line 1162 of file uthash.h.

◆ HASH_BLOOM_TEST

#define HASH_BLOOM_TEST (   tbl,
  hashv 
)    (1)

Definition at line 208 of file uthash.h.

◆ HASH_CLEAR

#define HASH_CLEAR (   hh,
  head 
)
Value:
do { \
if ((head) != NULL) { \
HASH_BLOOM_FREE((head)->hh.tbl); \
uthash_free((head)->hh.tbl->buckets, \
(head)->hh.tbl->num_buckets*sizeof(struct UT_hash_bucket)); \
uthash_free((head)->hh.tbl, sizeof(UT_hash_table)); \
(head) = NULL; \
} \
} while (0)

Definition at line 1108 of file uthash.h.

◆ HASH_CNT

#define HASH_CNT (   hh,
  head 
)    ((head != NULL)?((head)->hh.tbl->num_items):0U)

Definition at line 1138 of file uthash.h.

◆ HASH_COUNT

#define HASH_COUNT (   head)    HASH_CNT(hh,head)

Definition at line 1137 of file uthash.h.

◆ HASH_DEL

#define HASH_DEL (   head,
  delptr 
)     HASH_DELETE(hh,head,delptr)

Definition at line 498 of file uthash.h.

◆ HASH_DEL_IN_BKT

#define HASH_DEL_IN_BKT (   head,
  delhh 
)
Value:
do { \
UT_hash_bucket *_hd_head = &(head); \
_hd_head->count--; \
if (_hd_head->hh_head == (delhh)) { \
_hd_head->hh_head = (delhh)->hh_next; \
} \
if ((delhh)->hh_prev) { \
(delhh)->hh_prev->hh_next = (delhh)->hh_next; \
} \
if ((delhh)->hh_next) { \
(delhh)->hh_next->hh_prev = (delhh)->hh_prev; \
} \
} while (0)

Definition at line 862 of file uthash.h.

◆ HASH_DELETE

#define HASH_DELETE (   hh,
  head,
  delptr 
)     HASH_DELETE_HH(hh, head, &(delptr)->hh)

Definition at line 447 of file uthash.h.

◆ HASH_DELETE_HH

#define HASH_DELETE_HH (   hh,
  head,
  delptrhh 
)
Value:
do { \
struct UT_hash_handle *_hd_hh_del = (delptrhh); \
if ((_hd_hh_del->prev == NULL) && (_hd_hh_del->next == NULL)) { \
HASH_BLOOM_FREE((head)->hh.tbl); \
uthash_free((head)->hh.tbl->buckets, \
(head)->hh.tbl->num_buckets * sizeof(struct UT_hash_bucket)); \
uthash_free((head)->hh.tbl, sizeof(UT_hash_table)); \
(head) = NULL; \
} else { \
unsigned _hd_bkt; \
if (_hd_hh_del == (head)->hh.tbl->tail) { \
(head)->hh.tbl->tail = HH_FROM_ELMT((head)->hh.tbl, _hd_hh_del->prev); \
} \
if (_hd_hh_del->prev != NULL) { \
HH_FROM_ELMT((head)->hh.tbl, _hd_hh_del->prev)->next = _hd_hh_del->next; \
} else { \
DECLTYPE_ASSIGN(head, _hd_hh_del->next); \
} \
if (_hd_hh_del->next != NULL) { \
HH_FROM_ELMT((head)->hh.tbl, _hd_hh_del->next)->prev = _hd_hh_del->prev; \
} \
HASH_TO_BKT(_hd_hh_del->hashv, (head)->hh.tbl->num_buckets, _hd_bkt); \
HASH_DEL_IN_BKT((head)->hh.tbl->buckets[_hd_bkt], _hd_hh_del); \
(head)->hh.tbl->num_items--; \
} \
HASH_FSCK(hh, head, "HASH_DELETE_HH"); \
} while (0)

Definition at line 450 of file uthash.h.

◆ HASH_EMIT_KEY

#define HASH_EMIT_KEY (   hh,
  head,
  keyptr,
  fieldlen 
)

Definition at line 569 of file uthash.h.

◆ HASH_EXPAND_BUCKETS

#define HASH_EXPAND_BUCKETS (   hh,
  tbl,
  oomed 
)

Definition at line 906 of file uthash.h.

◆ HASH_FCN

#define HASH_FCN   HASH_JEN

Definition at line 576 of file uthash.h.

◆ HASH_FIND

#define HASH_FIND (   hh,
  head,
  keyptr,
  keylen,
  out 
)
Value:
do { \
unsigned _hf_hashv; \
HASH_VALUE(keyptr, keylen, _hf_hashv); \
HASH_FIND_BYHASHVALUE(hh, head, keyptr, keylen, _hf_hashv, out); \
} while (0)
FILE * out
Definition: hbf2gf.c:286

Definition at line 168 of file uthash.h.

◆ HASH_FIND_BYHASHVALUE

#define HASH_FIND_BYHASHVALUE (   hh,
  head,
  keyptr,
  keylen,
  hashval,
  out 
)
Value:
do { \
(out) = NULL; \
if (head) { \
unsigned _hf_bkt; \
HASH_TO_BKT(hashval, (head)->hh.tbl->num_buckets, _hf_bkt); \
if (HASH_BLOOM_TEST((head)->hh.tbl, hashval) != 0) { \
HASH_FIND_IN_BKT((head)->hh.tbl, hh, (head)->hh.tbl->buckets[ _hf_bkt ], keyptr, keylen, hashval, out); \
} \
} \
} while (0)
#define HASH_BLOOM_TEST(tbl, hashv)
Definition: uthash.h:208

Definition at line 156 of file uthash.h.

◆ HASH_FIND_IN_BKT

#define HASH_FIND_IN_BKT (   tbl,
  hh,
  head,
  keyptr,
  keylen_in,
  hashval,
  out 
)
Value:
do { \
if ((head).hh_head != NULL) { \
DECLTYPE_ASSIGN(out, ELMT_FROM_HH(tbl, (head).hh_head)); \
} else { \
(out) = NULL; \
} \
while ((out) != NULL) { \
if ((out)->hh.hashv == (hashval) && (out)->hh.keylen == (keylen_in)) { \
if (uthash_memcmp((out)->hh.key, keyptr, keylen_in) == 0) { \
break; \
} \
} \
if ((out)->hh.hh_next != NULL) { \
DECLTYPE_ASSIGN(out, ELMT_FROM_HH(tbl, (out)->hh.hh_next)); \
} else { \
(out) = NULL; \
} \
} \
} while (0)
#define uthash_memcmp(a, b, n)
Definition: uthash.h:92

Definition at line 818 of file uthash.h.

◆ HASH_FIND_INT

#define HASH_FIND_INT (   head,
  findint,
  out 
)     HASH_FIND(hh,head,findint,sizeof(int),out)

Definition at line 486 of file uthash.h.

◆ HASH_FIND_PTR

#define HASH_FIND_PTR (   head,
  findptr,
  out 
)     HASH_FIND(hh,head,findptr,sizeof(void *),out)

Definition at line 492 of file uthash.h.

◆ HASH_FIND_STR

#define HASH_FIND_STR (   head,
  findstr,
  out 
)     HASH_FIND(hh,head,findstr,(unsigned)uthash_strlen(findstr),out)

Definition at line 480 of file uthash.h.

◆ HASH_FNV

#define HASH_FNV (   key,
  keylen,
  hashv 
)
Value:
do { \
unsigned _fn_i; \
const unsigned char *_hf_key = (const unsigned char*)(key); \
(hashv) = 2166136261U; \
for (_fn_i=0; _fn_i < keylen; _fn_i++) { \
hashv = hashv ^ _hf_key[_fn_i]; \
hashv = hashv * 16777619U; \
} \
} while (0)

Definition at line 603 of file uthash.h.

◆ HASH_FSCK

#define HASH_FSCK (   hh,
  head,
  where 
)

Definition at line 555 of file uthash.h.

◆ HASH_INITIAL_NUM_BUCKETS

#define HASH_INITIAL_NUM_BUCKETS   32U /* initial number of buckets */

Definition at line 132 of file uthash.h.

◆ HASH_INITIAL_NUM_BUCKETS_LOG2

#define HASH_INITIAL_NUM_BUCKETS_LOG2   5U /* lg2 of initial number of buckets */

Definition at line 133 of file uthash.h.

◆ HASH_ITER

#define HASH_ITER (   hh,
  head,
  el,
  tmp 
)
Value:
for(((el)=(head)), ((tmp)=DECLTYPE(el)((head!=NULL)?(head)->hh.next:NULL)); \
(el) != NULL; ((el)=(tmp)), ((tmp)=DECLTYPE(el)((tmp!=NULL)?(tmp)->hh.next:NULL)))

Definition at line 1131 of file uthash.h.

◆ HASH_JEN

#define HASH_JEN (   key,
  keylen,
  hashv 
)

Definition at line 642 of file uthash.h.

◆ HASH_JEN_MIX

#define HASH_JEN_MIX (   a,
  b,
  c 
)
Value:
do { \
a -= b; a -= c; a ^= ( c >> 13 ); \
b -= c; b -= a; b ^= ( a << 8 ); \
c -= a; c -= b; c ^= ( b >> 13 ); \
a -= b; a -= c; a ^= ( c >> 12 ); \
b -= c; b -= a; b ^= ( a << 16 ); \
c -= a; c -= b; c ^= ( b >> 5 ); \
a -= b; a -= c; a ^= ( c >> 3 ); \
b -= c; b -= a; b ^= ( a << 10 ); \
c -= a; c -= b; c ^= ( b >> 15 ); \
} while (0)
#define b
Definition: jpegint.h:372
#define c(n)
Definition: gpos-common.c:150
#define a(n)
Definition: gpos-common.c:148

Definition at line 629 of file uthash.h.

◆ HASH_MAKE_TABLE

#define HASH_MAKE_TABLE (   hh,
  head,
  oomed 
)
Value:
do { \
if (!(head)->hh.tbl) { \
HASH_RECORD_OOM(oomed); \
} else { \
uthash_bzero((head)->hh.tbl, sizeof(UT_hash_table)); \
(head)->hh.tbl->tail = &((head)->hh); \
(head)->hh.tbl->num_buckets = HASH_INITIAL_NUM_BUCKETS; \
(head)->hh.tbl->log2_num_buckets = HASH_INITIAL_NUM_BUCKETS_LOG2; \
(head)->hh.tbl->hho = (char*)(&(head)->hh) - (char*)(head); \
(head)->hh.tbl->buckets = (UT_hash_bucket*)uthash_malloc( \
(head)->hh.tbl->signature = HASH_SIGNATURE; \
if (!(head)->hh.tbl->buckets) { \
HASH_RECORD_OOM(oomed); \
uthash_free((head)->hh.tbl, sizeof(UT_hash_table)); \
} else { \
uthash_bzero((head)->hh.tbl->buckets, \
HASH_BLOOM_MAKE((head)->hh.tbl, oomed); \
IF_HASH_NONFATAL_OOM( \
if (oomed) { \
uthash_free((head)->hh.tbl->buckets, \
uthash_free((head)->hh.tbl, sizeof(UT_hash_table)); \
} \
) \
} \
} \
} while (0)
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro pixld1_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl else error unsupported endif endm macro pixld2_s mem_operand if mov asr add asl add asl mov asr sub UNIT_X add asl mov asr add asl add asl mov asr add UNIT_X add asl else pixld1_s mem_operand pixld1_s mem_operand endif endm macro pixld0_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl endif endm macro pixld_s_internal mem_operand if mem_operand pixld2_s mem_operand pixdeinterleave basereg elseif mem_operand elseif mem_operand elseif mem_operand elseif mem_operand pixld0_s mem_operand else pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else error unsupported mem_operand if bpp mem_operand endif endm macro vuzp8 reg2 vuzp d d &reg2 endm macro vzip8 reg2 vzip d d &reg2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld[DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld if[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro fetch_mask_pixblock pixld mask_basereg pixblock_size MASK endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp skip1(dst_w_bpp<=(lowbit *8)) &&((lowbit *8)<(pixblock_size *dst_w_bpp)) .if lowbit< 16 tst DST_R
#define HASH_INITIAL_NUM_BUCKETS_LOG2
Definition: uthash.h:133
#define HASH_INITIAL_NUM_BUCKETS
Definition: uthash.h:132
#define HASH_SIGNATURE
Definition: uthash.h:1161
#define uthash_malloc(sz)
Definition: uthash.h:83

Definition at line 212 of file uthash.h.

◆ HASH_NONFATAL_OOM

#define HASH_NONFATAL_OOM   0

Definition at line 106 of file uthash.h.

◆ HASH_OAT

#define HASH_OAT (   key,
  keylen,
  hashv 
)
Value:
do { \
unsigned _ho_i; \
const unsigned char *_ho_key=(const unsigned char*)(key); \
hashv = 0; \
for(_ho_i=0; _ho_i < keylen; _ho_i++) { \
hashv += _ho_key[_ho_i]; \
hashv += (hashv << 10); \
hashv ^= (hashv >> 6); \
} \
hashv += (hashv << 3); \
hashv ^= (hashv >> 11); \
hashv += (hashv << 15); \
} while (0)

Definition at line 614 of file uthash.h.

◆ HASH_OVERHEAD

#define HASH_OVERHEAD (   hh,
  head 
)
Value:
(((head) != NULL) ? ( \
(size_t)(((head)->hh.tbl->num_items * sizeof(UT_hash_handle)) + \
((head)->hh.tbl->num_buckets * sizeof(UT_hash_bucket)) + \
sizeof(UT_hash_table) + \
#define size_t
Definition: glob.c:257
struct UT_hash_handle UT_hash_handle
#define HASH_BLOOM_BYTELEN
Definition: uthash.h:209

Definition at line 1119 of file uthash.h.

◆ HASH_RECORD_OOM

#define HASH_RECORD_OOM (   oomed)    uthash_fatal("out of memory")

Definition at line 126 of file uthash.h.

◆ HASH_REPLACE

#define HASH_REPLACE (   hh,
  head,
  fieldname,
  keylen_in,
  add,
  replaced 
)
Value:
do { \
unsigned _hr_hashv; \
HASH_VALUE(&((add)->fieldname), keylen_in, _hr_hashv); \
HASH_REPLACE_BYHASHVALUE(hh, head, fieldname, keylen_in, _hr_hashv, add, replaced); \
} while (0)
static flagT replaced
Definition: execute.c:166

Definition at line 264 of file uthash.h.

◆ HASH_REPLACE_BYHASHVALUE

#define HASH_REPLACE_BYHASHVALUE (   hh,
  head,
  fieldname,
  keylen_in,
  hashval,
  add,
  replaced 
)
Value:
do { \
(replaced) = NULL; \
HASH_FIND_BYHASHVALUE(hh, head, &((add)->fieldname), keylen_in, hashval, replaced); \
if (replaced) { \
HASH_DELETE(hh, head, replaced); \
} \
HASH_ADD_KEYPTR_BYHASHVALUE(hh, head, &((add)->fieldname), keylen_in, hashval, add); \
} while (0)

Definition at line 254 of file uthash.h.

◆ HASH_REPLACE_BYHASHVALUE_INORDER

#define HASH_REPLACE_BYHASHVALUE_INORDER (   hh,
  head,
  fieldname,
  keylen_in,
  hashval,
  add,
  replaced,
  cmpfcn 
)
Value:
do { \
(replaced) = NULL; \
HASH_FIND_BYHASHVALUE(hh, head, &((add)->fieldname), keylen_in, hashval, replaced); \
if (replaced) { \
HASH_DELETE(hh, head, replaced); \
} \
HASH_ADD_KEYPTR_BYHASHVALUE_INORDER(hh, head, &((add)->fieldname), keylen_in, hashval, add, cmpfcn); \
} while (0)

Definition at line 244 of file uthash.h.

◆ HASH_REPLACE_INORDER

#define HASH_REPLACE_INORDER (   hh,
  head,
  fieldname,
  keylen_in,
  add,
  replaced,
  cmpfcn 
)
Value:
do { \
unsigned _hr_hashv; \
HASH_VALUE(&((add)->fieldname), keylen_in, _hr_hashv); \
HASH_REPLACE_BYHASHVALUE_INORDER(hh, head, fieldname, keylen_in, _hr_hashv, add, replaced, cmpfcn); \
} while (0)

Definition at line 271 of file uthash.h.

◆ HASH_REPLACE_INT

#define HASH_REPLACE_INT (   head,
  intfield,
  add,
  replaced 
)     HASH_REPLACE(hh,head,intfield,sizeof(int),add,replaced)

Definition at line 490 of file uthash.h.

◆ HASH_REPLACE_PTR

#define HASH_REPLACE_PTR (   head,
  ptrfield,
  add,
  replaced 
)     HASH_REPLACE(hh,head,ptrfield,sizeof(void *),add,replaced)

Definition at line 496 of file uthash.h.

◆ HASH_REPLACE_STR

#define HASH_REPLACE_STR (   head,
  strfield,
  add,
  replaced 
)     HASH_REPLACE(hh,head,strfield[0],(unsigned)uthash_strlen(add->strfield),add,replaced)

Definition at line 484 of file uthash.h.

◆ HASH_ROLLBACK_BKT

#define HASH_ROLLBACK_BKT (   hh,
  head,
  itemptrhh 
)
Value:
do { \
struct UT_hash_handle *_hd_hh_item = (itemptrhh); \
unsigned _hd_bkt; \
HASH_TO_BKT(_hd_hh_item->hashv, (head)->hh.tbl->num_buckets, _hd_bkt); \
(head)->hh.tbl->buckets[_hd_bkt].count++; \
_hd_hh_item->hh_next = NULL; \
_hd_hh_item->hh_prev = NULL; \
} while (0)

Definition at line 141 of file uthash.h.

◆ HASH_SAX

#define HASH_SAX (   key,
  keylen,
  hashv 
)
Value:
do { \
unsigned _sx_i; \
const unsigned char *_hs_key = (const unsigned char*)(key); \
hashv = 0; \
for (_sx_i=0; _sx_i < keylen; _sx_i++) { \
hashv ^= (hashv << 5) + (hashv >> 2) + _hs_key[_sx_i]; \
} \
} while (0)

Definition at line 593 of file uthash.h.

◆ HASH_SELECT

#define HASH_SELECT (   hh_dst,
  dst,
  hh_src,
  src,
  cond 
)

Definition at line 1050 of file uthash.h.

◆ HASH_SFH

#define HASH_SFH (   key,
  keylen,
  hashv 
)

Definition at line 693 of file uthash.h.

◆ HASH_SIGNATURE

#define HASH_SIGNATURE   0xa0111fe1u

Definition at line 1161 of file uthash.h.

◆ HASH_SORT

#define HASH_SORT (   head,
  cmpfcn 
)    HASH_SRT(hh,head,cmpfcn)

Definition at line 960 of file uthash.h.

◆ HASH_SRT

#define HASH_SRT (   hh,
  head,
  cmpfcn 
)

Definition at line 961 of file uthash.h.

◆ HASH_TO_BKT

#define HASH_TO_BKT (   hashv,
  num_bkts,
  bkt 
)
Value:
do { \
bkt = ((hashv) & ((num_bkts) - 1U)); \
} while (0)

Definition at line 430 of file uthash.h.

◆ HASH_VALUE

#define HASH_VALUE (   keyptr,
  keylen,
  hashv 
)
Value:
do { \
HASH_FCN(keyptr, keylen, hashv); \
} while (0)

Definition at line 151 of file uthash.h.

◆ HH_FROM_ELMT

#define HH_FROM_ELMT (   tbl,
  elp 
)    ((UT_hash_handle *)(((char*)(elp)) + ((tbl)->hho)))

Definition at line 139 of file uthash.h.

◆ IF_HASH_NONFATAL_OOM

#define IF_HASH_NONFATAL_OOM (   x)

Definition at line 127 of file uthash.h.

◆ uthash_bzero

#define uthash_bzero (   a,
  n 
)    memset(a,'\0',n)

Definition at line 89 of file uthash.h.

◆ uthash_expand_fyi

#define uthash_expand_fyi (   tbl)    /* can be defined to log expands */

Definition at line 102 of file uthash.h.

◆ uthash_fatal

#define uthash_fatal (   msg)    exit(-1) /* fatal OOM error */

Definition at line 123 of file uthash.h.

◆ uthash_free

#define uthash_free (   ptr,
  sz 
)    free(ptr) /* free fcn */

Definition at line 86 of file uthash.h.

◆ uthash_malloc

#define uthash_malloc (   sz)    malloc(sz) /* malloc fcn */

Definition at line 83 of file uthash.h.

◆ uthash_memcmp

#define uthash_memcmp (   a,
  b,
  n 
)    memcmp(a,b,n)

Definition at line 92 of file uthash.h.

◆ uthash_noexpand_fyi

#define uthash_noexpand_fyi (   tbl)    /* can be defined to log noexpand */

Definition at line 99 of file uthash.h.

◆ uthash_strlen

#define uthash_strlen (   s)    strlen(s)

Definition at line 95 of file uthash.h.

◆ UTHASH_VERSION

#define UTHASH_VERSION   2.0.2

Definition at line 27 of file uthash.h.

Typedef Documentation

◆ uint32_t

typedef unsigned int uint32_t

Definition at line 78 of file uthash.h.

◆ uint8_t

typedef unsigned char uint8_t

Definition at line 79 of file uthash.h.

◆ UT_hash_bucket

◆ UT_hash_handle

◆ UT_hash_table

typedef struct UT_hash_table UT_hash_table