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