Documentation

Posted on January 24th, 2008 by hgndgtl

The documentation discusses the aspect how to utilize the library for the first time. How to fine-tune some parameters, illustrate some basic structures and whose impact (e.g. lists, arrays ...) and last but not least, a doxygen generated documentation explain all interfaces. The document is splited in several sections:

Quick Start Guide

  1. Install libhashish
    The preferred way is to checkout the current subversion repository. There are no bleeding edge (alpha) releases, you can therefor check out the developer repository.
    svn co https://libhashish.svn.sourceforge.net/svnroot/libhashish libhashish
    

  2. Configure, build and install Libhashish
    cd libhashish
    ./configure
    make
    make test
    su -c 'make install; ldconfig'
    
    Libhashish is now usable - go out and use it!
  3. Create a minimal application
    cat >/tmp/hashtest.c <<EOF
    #include <libhashish.h>
    
    int main(void) {
      hi_handle_t *hi_handle;
      const char *key = "23";
      const char *data = "data element";
      const char *data_ptr;
    
      /* initialize hashish handle */
      hi_init_str(&hi_handle, 23);
    
      /* insert an key/data pair */
      ret = hi_insert_str(hi_handle, key, data);
    
      /* search for a pair with a string key and store result */
      hi_get_str(hi_handle, key, &data_ptr);
    
      fprintf(stdout, "Key: %s Data: %s\n", key, data_ptr);
    
      /* free the hashish handle */
      hi_fini(hi_handle);
    
      return 0;
    }
    EOF
            
  4. Compile and run the program
    gcc -pipe -Os -Wall -W /tmp/hashtest.c -lm -lhashish -o /tmp/hashtest
    /tmp/hashtest
    

Detailed User Guide

  • Implemented Collision Engines
  • Implemented Hashing Functions
  • Additional Tips

Implemented Collision Engines

Libhashish implement the following Collision resolution strategies (collision engine called internally). All of them are chaining based (no linear probing, quadratic probing or double hashing). There are three main categories and several sub-flavors:
  • List based:
    • COLL_ENG_LIST
    • COLL_ENG_LIST_HASH
    • COLL_ENG_LIST_MTF
    • COLL_ENG_LIST_MTF_HASH
  • Array based:
    • COLL_ENG_ARRAY
    • COLL_ENG_ARRAY_HASH
    • COLL_ENG_ARRAY_DYN
    • COLL_ENG_ARRAY_DYN_HASH
  • Tree based:
    • COLL_ENG_RBTREE

Implemented Hashing Functions

Additional Tips