2 * Copyright (C) 1994-1995, Index Data I/S
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.28 1995-11-27 13:58:53 adam
8 * New option -t. storeStore data implemented in server.
10 * Revision 1.27 1995/11/25 10:24:06 adam
11 * More record fields - they are enumerated now.
12 * New options: flagStoreData flagStoreKey.
14 * Revision 1.26 1995/11/22 17:19:17 adam
15 * Record management uses the bfile system.
17 * Revision 1.25 1995/11/21 15:29:12 adam
18 * Config file 'base' read by default by both indexer and server.
20 * Revision 1.24 1995/11/21 15:01:15 adam
21 * New general match criteria implemented.
22 * New feature: document groups.
24 * Revision 1.23 1995/11/20 16:59:45 adam
25 * New update method: the 'old' keys are saved for each records.
27 * Revision 1.22 1995/11/20 11:56:26 adam
28 * Work on new traversal.
30 * Revision 1.21 1995/11/16 15:34:55 adam
31 * Uses new record management system in both indexer and server.
33 * Revision 1.20 1995/11/15 14:46:18 adam
34 * Started work on better record management system.
36 * Revision 1.19 1995/10/27 14:00:11 adam
37 * Implemented detection of database availability.
39 * Revision 1.18 1995/10/17 18:02:08 adam
40 * New feature: databases. Implemented as prefix to words in dictionary.
42 * Revision 1.17 1995/10/13 16:01:49 adam
45 * Revision 1.16 1995/10/10 12:24:38 adam
46 * Temporary sort files are compressed.
48 * Revision 1.15 1995/10/04 16:57:19 adam
49 * Key input and merge sort in one pass.
51 * Revision 1.14 1995/09/29 14:01:40 adam
54 * Revision 1.13 1995/09/28 14:22:56 adam
55 * Sort uses smaller temporary files.
57 * Revision 1.12 1995/09/28 12:10:32 adam
58 * Bug fixes. Field prefix used in queries.
60 * Revision 1.11 1995/09/27 12:22:28 adam
61 * More work on extract in record control.
62 * Field name is not in isam keys but in prefix in dictionary words.
64 * Revision 1.10 1995/09/14 07:48:23 adam
65 * Record control management.
67 * Revision 1.9 1995/09/11 13:09:33 adam
68 * More work on relevance feedback.
70 * Revision 1.8 1995/09/08 14:52:27 adam
71 * Minor changes. Dictionary is lower case now.
73 * Revision 1.7 1995/09/06 16:11:16 adam
74 * Option: only one word key per file.
76 * Revision 1.6 1995/09/05 15:28:39 adam
77 * More work on search engine.
79 * Revision 1.5 1995/09/04 12:33:42 adam
80 * Various cleanup. YAZ util used instead.
82 * Revision 1.4 1995/09/04 09:10:35 adam
83 * More work on index add/del/update.
84 * Merge sort implemented.
85 * Initial work on z39 server.
87 * Revision 1.3 1995/09/01 14:06:35 adam
88 * Split of work into more files.
90 * Revision 1.2 1995/09/01 10:30:24 adam
91 * More work on indexing. Not working yet.
93 * Revision 1.1 1995/08/31 14:50:24 adam
94 * New simple file index tool.
102 #define IT_MAX_WORD 256
103 #define IT_KEY_HAVE_SEQNO 1
104 #define IT_KEY_HAVE_FIELD 0
111 enum dirsKind { dirs_dir, dirs_file };
136 struct dirs_info *dirs_open (Dict dict, const char *rep);
137 struct dirs_entry *dirs_read (struct dirs_info *p);
138 struct dirs_entry *dirs_last (struct dirs_info *p);
139 void dirs_mkdir (struct dirs_info *p, const char *src, int ctime);
140 void dirs_rmdir (struct dirs_info *p, const char *src);
141 void dirs_add (struct dirs_info *p, const char *src, int sysno, int ctime);
142 void dirs_del (struct dirs_info *p, const char *src);
143 void dirs_free (struct dirs_info **pp);
145 struct dir_entry *dir_open (const char *rep);
146 void dir_sort (struct dir_entry *e);
147 void dir_free (struct dir_entry **e_p);
149 void repositoryUpdate (struct recordGroup *rGroup);
150 void repositoryAdd (struct recordGroup *rGroup);
151 void repositoryDelete (struct recordGroup *rGroup);
153 void key_open (int mem);
154 int key_close (void);
155 void key_write (int cmd, struct it_key *k, const char *str);
156 int key_compare (const void *p1, const void *p2);
157 int key_qsort_compare (const void *p1, const void *p2);
158 void key_logdump (int mask, const void *p);
159 void key_input (const char *dict_fname, const char *isam_fname,
160 int nkeys, int cache);
161 int merge_sort (char **buf, int from, int to);
163 #define TEMP_FNAME "keys%d.tmp"
164 #define FNAME_WORD_DICT "worddict"
165 #define FNAME_WORD_ISAM "wordisam"
167 struct strtab *strtab_mk (void);
168 int strtab_src (struct strtab *t, const char *name, void ***infop);
169 void strtab_del (struct strtab *t,
170 void (*func)(const char *name, void *info, void *data),
172 int index_char_cvt (int c);
173 int index_word_prefix (char *string, int attset_ordinal,
174 int local_attribute, const char *databaseName);
176 int fileExtract (SYSNO *sysno, const char *fname,
177 struct recordGroup *rGroup, int deleteFlag);