home *** CD-ROM | disk | FTP | other *** search
/ Internet Publisher's Toolbox 2.0 / Internet Publisher's Toolbox.iso / internet / ntserver / wtsource / irhash.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-15  |  2.2 KB  |  72 lines

  1. /* WIDE AREA INFORMATION SERVER SOFTWARE:
  2.    No guarantees or restrictions.  See the readme file for the full standard
  3.    disclaimer.
  4.  
  5.    Brewster@think.com
  6. */
  7.  
  8. /* Copyright (c) CNIDR (see ../COPYRIGHT) */
  9.  
  10.  
  11. /* Include file for the irhash.c file.
  12.    Implements the building functions in irext.h */
  13.  
  14. #ifndef IRHASH_H
  15. #define IRHASH_H
  16.  
  17. #include "cdialect.h"
  18. #include "cutil.h"
  19. #include "irlex.h"
  20. #include "hash.h"
  21. #include "irlex.h" /* for MAX_WORD_LENGTH */
  22.  
  23. /* the amount of memory for word occurances (bytes) */
  24. #define WORD_MEMORY_INIT_BLOCK_SIZE 10
  25.  
  26. /* this is the maximum number of occurances that will be stored in the 
  27.  * disk table.  The number of occurances will reflect the total number in
  28.  * all files.  The theory is that if a word is very common, then it
  29.  * is not very useful in descriminating between files.  Also, if it
  30.  * is very common, then it takes up alot of space.
  31.  * Maybe this should be dependent on the number of documents indexed.
  32.  * Therefore if a word is in every document, then it probably does not mean
  33.  * much.  
  34.  * In increasing this, it may not keep all the references in the 
  35.  * inverted file because the max length of an index block is governed
  36.  * by a size that can be represented in INDEX_BLOCK_SIZE_SIZE bytes.
  37.  */
  38. #ifdef BIO
  39. #define MAX_OCCURANCES 100000L /* need 100000L, was 20000L, dgg */
  40. #else
  41. #define MAX_OCCURANCES 20000L  
  42. #endif
  43.  
  44. /* this is a flag to be put in the number_of_occurances field of a
  45. word_entry so that it is always greater than the limit and no words will be
  46. collected. */ 
  47. #define STOP_WORD_FLAG 0x40000000
  48.  
  49. #ifdef __cplusplus
  50. /* declare these as C style functions */
  51. extern "C"
  52.     {
  53. #endif /* def __cplusplus */
  54.  
  55. unsigned char *make_word_occurrance_block _AP((long size));
  56.  
  57. void free_word_occurance_block _AP((unsigned char *block));
  58.  
  59. void flush_word_occurance_buffers _AP((void));
  60.  
  61. void gc_word_occurance_buffers _AP((hashtable * the_word_memory_hashtable));
  62.  
  63. void add_stop_words _AP((hashtable *the_word_memory_hashtable));
  64.  
  65. long write_bytes_to_memory _AP((long value,long size,unsigned char* ptr));
  66.  
  67. #ifdef __cplusplus
  68.     }
  69. #endif /* def __cplusplus */
  70.  
  71. #endif /* nded IRHASH_H */
  72.