#if 0
length of element is power of two longs (currently only 1 or 2)
HashNone(*(long*)element) => element[0] == 0
Deleted => element[0] == 1
map->argBuf[*element]
must adjust for reserved HashNone and Deleted
#endif

#if defined(HASH_ELEMENT_LOG) && defined(HASH_LENGTH_LOG)
#define HASH_USE_MASK
#endif
#ifndef HASH_TO_INDEX
#if 1
#define HASH_TO_INDEX(hash) \
    (hash & ((1<<HASH_LENGTH_LOG)-1)) << HASH_ELEMENT_LOG
#else
/* NOTE: poor calculation, if last two bits are "capitalization only" */
#define HASH_TO_INDEX(hash) \
    (hash >> (HASH_WORD_LEN - HASH_LENGTH_LOG)) << HASH_ELEMENT_LOG
#endif
#endif
#ifndef HASH_TO_STEP
#define HASH_TO_STEP(hash) HASH_TO_INDEX(((hash)<<1)+1)
#endif
#ifndef HASH_NULL
#define HASH_NULL(element) (*element==(HASH_ELEMENT_TYPE)HashNull)
#endif

    register index, step;
    register HASH_ELEMENT_TYPE *element;
#ifdef HASH_DELETED
    HASH_ELEMENT_TYPE *avail;
#endif
#ifdef HASH_USE_MASK
    int mask;
#else
    int limit;
#endif
    index = HASH_TO_INDEX(hash);
    element = (HASH_ELEMENT_TYPE*)((char*)HASH_DATA + index);
    if (HASH_NULL(element)) return (HASH_ELEMENT_TYPE*)element;
#ifdef HASH_DELETED
    avail = NULL;
    if (HASH_DELETED(element)) avail = element;
    else
#endif
    if (HASH_EQUAL(element, arg)) return (HASH_ELEMENT_TYPE*)element;
    step = HASH_TO_STEP(hash);
#ifdef HASH_USE_MASK
    mask = (1 << ((HASH_LENGTH_LOG) + (HASH_ELEMENT_LOG))) - 1;
#else
    limit = HASH_SIZE * HASH_ELEMENT;
#endif
    for (;;)
      {
	index += step;
#ifdef HASH_USE_MASK
	index &= mask;
#else
	if (index >= limit) index -= limit;
#endif
	element = (HASH_ELEMENT_TYPE*)((char*)HASH_DATA + index);
	if (HASH_NULL(element)) return (HASH_ELEMENT_TYPE*)element;
#ifdef HASH_DELETED
	if (HASH_DELETED(element))
	  { if (!avail) avail = element; }
	else
#endif
        if (HASH_EQUAL(element, arg)) return (HASH_ELEMENT_TYPE*)element;
      }
