More work on search engine.
[idzebra-moved-to-github.git] / index / index.h
1 /*
2  * Copyright (C) 1995, Index Data I/S 
3  * All rights reserved.
4  * Sebastian Hammer, Adam Dickmeiss
5  *
6  * $Log: index.h,v $
7  * Revision 1.6  1995-09-05 15:28:39  adam
8  * More work on search engine.
9  *
10  * Revision 1.5  1995/09/04  12:33:42  adam
11  * Various cleanup. YAZ util used instead.
12  *
13  * Revision 1.4  1995/09/04  09:10:35  adam
14  * More work on index add/del/update.
15  * Merge sort implemented.
16  * Initial work on z39 server.
17  *
18  * Revision 1.3  1995/09/01  14:06:35  adam
19  * Split of work into more files.
20  *
21  * Revision 1.2  1995/09/01  10:30:24  adam
22  * More work on indexing. Not working yet.
23  *
24  * Revision 1.1  1995/08/31  14:50:24  adam
25  * New simple file index tool.
26  *
27  */
28
29 #include <alexutil.h>
30 #include <dict.h>
31 #include <isam.h>
32
33 struct it_key {
34     int sysno;
35     int seqno;
36     int field;
37 };
38
39 struct dir_entry {
40     char *name;
41 };
42
43 struct dir_entry *dir_open (const char *rep);
44 void dir_sort (struct dir_entry *e);
45 void dir_free (struct dir_entry **e_p);
46 void repository (int cmd, const char *rep, const char *base_path);
47
48 void file_extract (int cmd, const char *fname, const char *kname);
49
50 void key_open (const char *fname);
51 int key_close (void);
52 void key_flush (void);
53 void key_write (int cmd, struct it_key *k, const char *str);
54 int key_compare (const void *p1, const void *p2);
55 int key_compare_x (const struct it_key *i1, const struct it_key *i2);
56 void key_input (const char *dict_fname, const char *isam_fname, 
57                 const char *key_fname, int cache);
58 int key_sort (const char *key_fname, size_t mem);
59
60 #define FNAME_WORD_DICT "worddict"
61 #define FNAME_WORD_ISAM "wordisam"
62 #define FNAME_FILE_DICT "filedict"
63 #define FNAME_SYS_IDX "sysidx"
64 #define SYS_IDX_ENTRY_LEN 120