More work on extract in record control.
[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.11  1995-09-27 12:22:28  adam
8  * More work on extract in record control.
9  * Field name is not in isam keys but in prefix in dictionary words.
10  *
11  * Revision 1.10  1995/09/14  07:48:23  adam
12  * Record control management.
13  *
14  * Revision 1.9  1995/09/11  13:09:33  adam
15  * More work on relevance feedback.
16  *
17  * Revision 1.8  1995/09/08  14:52:27  adam
18  * Minor changes. Dictionary is lower case now.
19  *
20  * Revision 1.7  1995/09/06  16:11:16  adam
21  * Option: only one word key per file.
22  *
23  * Revision 1.6  1995/09/05  15:28:39  adam
24  * More work on search engine.
25  *
26  * Revision 1.5  1995/09/04  12:33:42  adam
27  * Various cleanup. YAZ util used instead.
28  *
29  * Revision 1.4  1995/09/04  09:10:35  adam
30  * More work on index add/del/update.
31  * Merge sort implemented.
32  * Initial work on z39 server.
33  *
34  * Revision 1.3  1995/09/01  14:06:35  adam
35  * Split of work into more files.
36  *
37  * Revision 1.2  1995/09/01  10:30:24  adam
38  * More work on indexing. Not working yet.
39  *
40  * Revision 1.1  1995/08/31  14:50:24  adam
41  * New simple file index tool.
42  *
43  */
44
45 #include <alexutil.h>
46 #include <dict.h>
47 #include <isam.h>
48
49 #define IT_MAX_WORD 256
50 #define IT_KEY_HAVE_SEQNO 1
51 #define IT_KEY_HAVE_FIELD 0
52
53 struct it_key {
54     int   sysno;
55     short seqno;
56 };
57
58 struct dir_entry {
59     char *name;
60 };
61
62 struct dir_entry *dir_open (const char *rep);
63 void dir_sort (struct dir_entry *e);
64 void dir_free (struct dir_entry **e_p);
65 void repository (int cmd, const char *rep, const char *base_path);
66
67 void file_extract (int cmd, const char *fname, const char *kname);
68
69 void key_open (const char *fname);
70 int key_close (void);
71 void key_write (int cmd, struct it_key *k, const char *str);
72 int key_compare (const void *p1, const void *p2);
73 void key_logdump (int mask, const void *p);
74 void key_input (const char *dict_fname, const char *isam_fname, 
75                 const char *key_fname, int cache);
76 int key_sort (const char *key_fname, size_t mem);
77
78 #define FNAME_WORD_DICT "worddict"
79 #define FNAME_WORD_ISAM "wordisam"
80 #define FNAME_FILE_DICT "filedict"
81 #define FNAME_SYS_IDX "sysidx"
82 #define SYS_IDX_ENTRY_LEN 120
83
84 struct strtab *strtab_mk (void);
85 int strtab_src (struct strtab *t, const char *name, void ***infop);
86 void strtab_del (struct strtab *t,
87                  void (*func)(const char *name, void *info, void *data),
88                  void *data);
89 int index_char_cvt (int c);