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