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