home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / freeWAIS-sf-1.1 / ir / irtfiles.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-01  |  4.9 KB  |  166 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. /* header for irtfiles.c */
  12.  
  13. #ifndef IRTFILES_H
  14. #define IRTFILES_H
  15.  
  16. #include "cdialect.h"
  17. #include "irfiles.h" /* for database struct */
  18.  
  19. #ifdef __cplusplus
  20. /* declare these as C style functions */
  21. extern "C"
  22.     {
  23. #endif /* def __cplusplus */
  24.  
  25. #define kWordBreakNonAlnum    0
  26. #define    kWordBreakSpace            1
  27.  
  28. #ifndef EXTERN_MAKE_COMPILER_HAPPY
  29. #define EXTERN_MAKE_COMPILER_HAPPY extern
  30. #endif /* EXTERN_MAKE_COMPILER_HAPPY */
  31. EXTERN_MAKE_COMPILER_HAPPY int make_compiler_happy;   /* global word break func, dgg */
  32. #undef  EXTERN_MAKE_COMPILER_HAPPY
  33.  
  34. typedef boolean (boolfunc)();
  35. typedef void (voidfunc)();
  36. typedef long (longfunc)();
  37.  
  38. char *make_joint_word _AP((char *word1, char *word2));
  39.  
  40. /* multitype extensions */
  41. typedef struct _dataopsrec {    /* dgg, use this instead of a dozen parameters in several funcs */
  42.         boolean (*separator_function)();
  43.         void (*header_function)();
  44.         long (*date_function)();
  45.         void (*finish_header_function)(); 
  46.         boolean (*wordDelimiter)();      /* ? use global wordDelimiter ? */
  47.         char *type;            /* TEXT, PICT, ... */
  48. #ifdef SOUND
  49.                 char *indextype;                 /* SOUNDEX, PHONIX */
  50. #endif
  51. #ifdef FIELDS /* tung, 1/94 */
  52.                 char *prev_indextype;
  53. #endif
  54.         char *multitype;        /* TEXT, PICT, ... */
  55.         boolean addseparatorwords;     /* add words in line separating documents */
  56.         boolean extraheaderweight;     /* add header weight */
  57.         int repeat_weight;         /* 0 for max of 1 word hit per doc */
  58.         int minwordlen;            /* 2= default, 1=symbols */
  59.         char *delimiters;
  60.         } dataopsrec, *dataopsptr;
  61.  
  62. #ifndef EXTERN_WORD_DELIMITER
  63. #define EXTERN_WORD_DELIMITER extern
  64. #endif /* EXTERN_WORD_DELIMITER */
  65. EXTERN_WORD_DELIMITER boolean (*wordDelimiter)();   /* global word break func, dgg */
  66. #undef EXTERN_WORD_DELIMITER
  67.  
  68.  
  69. typedef long (wordfunc) _AP((char *word, long char_pos,
  70.                  long line_pos, long weight,
  71.                  long doc_id, time_t date,
  72.                  boolean capitalized, database* db,
  73.                  boolean word_position, boolean word_pairs));
  74. #ifdef SOUND
  75. long map_over_words
  76.   _AP((char* line,long document_id,long weight,long file_position_before_line,
  77.        long* line_length,boolean* newline_terminated,database* db,
  78.        wordfunc wordfunction, boolean word_position, boolean word_pairs,
  79.        int minwordlen, 
  80.        char* type));    
  81. #else
  82. long map_over_words
  83.   _AP((char* line,long document_id,long weight,long file_position_before_line,
  84.        long* line_length,boolean* newline_terminated,database* db,
  85.        wordfunc wordfunction, boolean word_position, boolean word_pairs,
  86.        int minwordlen));
  87. #endif
  88.  
  89. #ifdef FIELDS /* tung, 1/94 */
  90. long field_index_text_file _AP((char* filename,
  91.                 dataopsrec* dataops,
  92.                 database* db,
  93.                 boolean check_for_text_file,
  94.                 boolean check_for_file_already_indexed,
  95.                 boolean word_position, boolean word_pairs,
  96.                 long field_id));
  97. long index_text_file _AP((char* filename,
  98.               dataopsrec* dataops,
  99.               database* db,
  100.               boolean check_for_text_file,
  101.               boolean check_for_file_already_indexed,
  102.               boolean word_position, boolean word_pairs,
  103.               long field_id));
  104. #else
  105. long index_text_file _AP((char* filename,
  106.               dataopsrec* dataops,
  107.               database* db,
  108.               boolean check_for_text_file,
  109.               boolean check_for_file_already_indexed,
  110.               boolean word_position, boolean word_pairs));
  111.                 
  112. #endif
  113. /* void index_text_file _AP((char* filename,
  114.               boolean (*separator_function)(),
  115.               void (*header_function)(),
  116.               longfunc *date_function,
  117.               void (*put_together_header_function)(), 
  118.               char *type,
  119.               database* db,
  120.               boolean check_for_text_file,
  121.               boolean check_for_file_already_indexed,
  122.               boolean word_position, boolean word_pairs,
  123.                 int minwordlen));  */
  124.  
  125. boolean directoryp _AP ((char *file));
  126.  
  127. boolean filep _AP((char* file));
  128.  
  129. #ifdef FIELDS /* 5/94, tung */
  130. void index_directory _AP ((char *file,
  131.                 dataopsrec* dataops,              
  132.                database *db,
  133.                boolean check_for_text_file,
  134.                boolean check_for_file_already_indexed,
  135.                boolean word_position, boolean word_pairs,
  136.                boolean index_next_field, long field_id));
  137. #else
  138. void index_directory _AP ((char *file,
  139.                 dataopsrec* dataops,              
  140.                database *db,
  141.                boolean check_for_text_file,
  142.                boolean check_for_file_already_indexed,
  143.                boolean word_position, boolean word_pairs));
  144. #endif
  145.  
  146. /* void index_directory _AP ((char *file,
  147.                boolfunc *separator_function,
  148.                voidfunc *header_function,
  149.                longfunc *date_function,
  150.                voidfunc *finish_header_function, 
  151.                char *type,
  152.                database *db,
  153.                boolean check_for_text_file,
  154.                boolean check_for_file_already_indexed,
  155.                boolean word_position, boolean word_pairs,
  156.                 int minwordlen)); */
  157.  
  158. char *cleanHeadline _AP((char* headline));
  159.  
  160.  
  161. #ifdef __cplusplus
  162.     }
  163. #endif /* def __cplusplus */
  164. #endif /* ndef IRTFILES_H */
  165.  
  166.