hashit

A generic hash library.
Download

hashit Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL
  • Price:
  • FREE
  • Publisher Name:
  • Pleyades Crew
  • Publisher web site:
  • http://pleyades.net/

hashit Tags


hashit Description

A generic hash library. hashit is a generic hash library.hashit implements diverse collision handling methods.This function creates a hash table which is returned as a hash_t type. 'errno' is set to ENOMEM if there wasn't enough memory avaliable for creating the table.Return value is a reference to the table just created or NULL when the table creation has failed.Parameters:- sizehint: It's used to give an aproximated desired value for the hash table, the function calculates the real size of the table using this parameter as a hint to the final value.- keysize: This is the size for the data type used as a key in the hash table. Keys are void *, so hashit needs to know how long they are. If key size is 0, is assumed that keys are strings.- hfunc: hfunc is a pointer to the hash function for the hash table. Typically you want to put here the value NULL to use the default hash function. Avaliable hash functions are BOB_HASH(Default) and ONEAT_HASH. You can add your own hash function if you know what are you doing.- cfunc: cfunc is the comparation function for the keys data. Semantics are the same that in strcmp function. The function should return 0 if both keys are equal, and a value different from zero if they are not.- flags: flags can have the following values: CHAIN_H: Hash table uses chaining for handling collisions OADDRESS_H: Hash table uses open address hashing for handling collisions OVERFLOW_H: Hasht table uses an overflow area for handling collisionsIf you're not sure about what collision handling your hash table should have, then use CHAIN_H.- int hashit_insert (hash_t htable, void *key, void *data) What's New in This Release: · This release replaces mobs with CMake. · A small bug has been fixed in the oa method. · A getvalues method equivalent to getkeys has been added to get all values with one function call.


hashit Related Software