Implemented detection of database availability.
[idzebra-moved-to-github.git] / index / index.h
1 /*
2  * Copyright (C) 1994-1995, Index Data I/S 
3  * All rights reserved.
4  * Sebastian Hammer, Adam Dickmeiss
5  *
6  * $Log: index.h,v $
7  * Revision 1.19  1995-10-27 14:00:11  adam
8  * Implemented detection of database availability.
9  *
10  * Revision 1.18  1995/10/17  18:02:08  adam
11  * New feature: databases. Implemented as prefix to words in dictionary.
12  *
13  * Revision 1.17  1995/10/13  16:01:49  adam
14  * Work on relations.
15  *
16  * Revision 1.16  1995/10/10  12:24:38  adam
17  * Temporary sort files are compressed.
18  *
19  * Revision 1.15  1995/10/04  16:57:19  adam
20  * Key input and merge sort in one pass.
21  *
22  * Revision 1.14  1995/09/29  14:01:40  adam
23  * Bug fixes.
24  *
25  * Revision 1.13  1995/09/28  14:22:56  adam
26  * Sort uses smaller temporary files.
27  *
28  * Revision 1.12  1995/09/28  12:10:32  adam
29  * Bug fixes. Field prefix used in queries.
30  *
31  * Revision 1.11  1995/09/27  12:22:28  adam
32  * More work on extract in record control.
33  * Field name is not in isam keys but in prefix in dictionary words.
34  *
35  * Revision 1.10  1995/09/14  07:48:23  adam
36  * Record control management.
37  *
38  * Revision 1.9  1995/09/11  13:09:33  adam
39  * More work on relevance feedback.
40  *
41  * Revision 1.8  1995/09/08  14:52:27  adam
42  * Minor changes. Dictionary is lower case now.
43  *
44  * Revision 1.7  1995/09/06  16:11:16  adam
45  * Option: only one word key per file.
46  *
47  * Revision 1.6  1995/09/05  15:28:39  adam
48  * More work on search engine.
49  *
50  * Revision 1.5  1995/09/04  12:33:42  adam
51  * Various cleanup. YAZ util used instead.
52  *
53  * Revision 1.4  1995/09/04  09:10:35  adam
54  * More work on index add/del/update.
55  * Merge sort implemented.
56  * Initial work on z39 server.
57  *
58  * Revision 1.3  1995/09/01  14:06:35  adam
59  * Split of work into more files.
60  *
61  * Revision 1.2  1995/09/01  10:30:24  adam
62  * More work on indexing. Not working yet.
63  *
64  * Revision 1.1  1995/08/31  14:50:24  adam
65  * New simple file index tool.
66  *
67  */
68
69 #include <alexutil.h>
70 #include <dict.h>
71 #include <isam.h>
72
73 #define IT_MAX_WORD 256
74 #define IT_KEY_HAVE_SEQNO 1
75 #define IT_KEY_HAVE_FIELD 0
76
77 struct it_key {
78     int   sysno;
79     int   seqno;
80 };
81
82 struct dir_entry {
83     char *name;
84 };
85
86 struct dir_entry *dir_open (const char *rep);
87 void dir_sort (struct dir_entry *e);
88 void dir_free (struct dir_entry **e_p);
89 void repository (int cmd, const char *rep, const char *base_path,
90                  char *databaseName);
91
92 void file_extract (int cmd, const char *fname, const char *kname,
93                    char *databaseName);
94
95 void key_open (int mem);
96 int key_close (void);
97 void key_write (int cmd, struct it_key *k, const char *str);
98 int key_compare (const void *p1, const void *p2);
99 int key_qsort_compare (const void *p1, const void *p2);
100 void key_logdump (int mask, const void *p);
101 void key_input (const char *dict_fname, const char *isam_fname,
102                  int nkeys, int cache);
103 int merge_sort (char **buf, int from, int to);
104
105 #define TEMP_FNAME  "keys%d.tmp"
106 #define FNAME_WORD_DICT "worddict"
107 #define FNAME_WORD_ISAM "wordisam"
108 #define FNAME_FILE_DICT "filedict"
109 #define FNAME_SYS_IDX "sysidx"
110 #define SYS_IDX_ENTRY_LEN 120
111
112 struct strtab *strtab_mk (void);
113 int strtab_src (struct strtab *t, const char *name, void ***infop);
114 void strtab_del (struct strtab *t,
115                  void (*func)(const char *name, void *info, void *data),
116                  void *data);
117 int index_char_cvt (int c);
118 int index_word_prefix (char *string, int attset_ordinal,
119                        int local_attribute, char *databaseName);