HASH.H 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
  3. SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
  4. END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
  5. ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
  6. IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
  7. SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
  8. FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
  9. CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
  10. AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
  11. COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
  12. */
  13. /*
  14. * $Source: f:/miner/source/main/rcs/hash.h $
  15. * $Revision: 2.0 $
  16. * $Author: john $
  17. * $Date: 1995/02/27 11:26:46 $
  18. *
  19. * .
  20. *
  21. * $Log: hash.h $
  22. * Revision 2.0 1995/02/27 11:26:46 john
  23. * New version 2.0, which has no anonymous unions, builds with
  24. * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
  25. *
  26. * Revision 1.2 1994/05/03 16:45:24 john
  27. * Added hash table lookup to speed up loading.
  28. *
  29. * Revision 1.1 1994/05/03 11:35:16 john
  30. * Initial revision
  31. *
  32. *
  33. */
  34. #ifndef _HASH_H
  35. #define _HASH_H
  36. typedef struct hashtable {
  37. int bitsize;
  38. int and_mask;
  39. int size;
  40. int nitems;
  41. char **key;
  42. int *value;
  43. } hashtable;
  44. int hashtable_init( hashtable *ht, int size );
  45. void hashtable_free( hashtable *ht );
  46. int hashtable_search( hashtable *ht, char *key );
  47. void hashtable_insert( hashtable *ht, char *key, int value );
  48. #endif
  49.