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