Use of cisam system - enabled if setting isamc is 1.
[idzebra-moved-to-github.git] / index / zserver.h
1 /*
2  * Copyright (C) 1994-1996, Index Data I/S 
3  * All rights reserved.
4  * Sebastian Hammer, Adam Dickmeiss
5  *
6  * $Log: zserver.h,v $
7  * Revision 1.21  1996-10-29 14:09:58  adam
8  * Use of cisam system - enabled if setting isamc is 1.
9  *
10  * Revision 1.20  1996/06/04 10:19:02  adam
11  * Minor changes - removed include of ctype.h.
12  *
13  * Revision 1.19  1996/05/14  11:34:01  adam
14  * Scan support in multiple registers/databases.
15  *
16  * Revision 1.18  1996/05/14  06:16:50  adam
17  * Compact use/set bytes used in search service.
18  *
19  * Revision 1.17  1995/12/08 16:22:57  adam
20  * Work on update while servers are running. Three lock files introduced.
21  * The servers reload their registers when necessary, but they don't
22  * reestablish result sets yet.
23  *
24  * Revision 1.16  1995/12/07  17:38:48  adam
25  * Work locking mechanisms for concurrent updates/commit.
26  *
27  * Revision 1.15  1995/11/21  15:29:13  adam
28  * Config file 'base' read by default by both indexer and server.
29  *
30  * Revision 1.14  1995/11/16  17:00:57  adam
31  * Better logging of rpn query.
32  *
33  * Revision 1.13  1995/11/16  15:34:56  adam
34  * Uses new record management system in both indexer and server.
35  *
36  * Revision 1.12  1995/10/27  14:00:12  adam
37  * Implemented detection of database availability.
38  *
39  * Revision 1.11  1995/10/17  18:02:12  adam
40  * New feature: databases. Implemented as prefix to words in dictionary.
41  *
42  * Revision 1.10  1995/10/09  16:18:38  adam
43  * Function dict_lookup_grep got extra client data parameter.
44  *
45  * Revision 1.9  1995/10/06  14:38:01  adam
46  * New result set method: r_score.
47  * Local no (sysno) and score is transferred to retrieveCtrl.
48  *
49  * Revision 1.8  1995/10/06  13:52:06  adam
50  * Bug fixes. Handler may abort further scanning.
51  *
52  * Revision 1.7  1995/10/06  10:43:57  adam
53  * Scan added. 'occurrences' in scan entries not set yet.
54  *
55  * Revision 1.6  1995/09/28  09:19:48  adam
56  * xfree/xmalloc used everywhere.
57  * Extract/retrieve method seems to work for text records.
58  *
59  * Revision 1.5  1995/09/27  16:17:32  adam
60  * More work on retrieve.
61  *
62  * Revision 1.4  1995/09/14  11:53:28  adam
63  * First work on regular expressions/truncations.
64  *
65  * Revision 1.3  1995/09/08  08:53:23  adam
66  * Record buffer maintained in server_info.
67  *
68  * Revision 1.2  1995/09/06  16:11:19  adam
69  * Option: only one word key per file.
70  *
71  * Revision 1.1  1995/09/05  15:28:40  adam
72  * More work on search engine.
73  *
74  */
75
76 #include <backend.h>
77 #include <rset.h>
78
79 #include "index.h"
80 #include "zinfo.h"
81
82 typedef struct {
83     int sysno;
84     int score;
85 } ZServerSetSysno;
86
87 typedef struct ZServerSet_ {
88     char *name;
89     RSET rset;
90     int size;
91     struct ZServerSet_ *next;
92 } ZServerSet;
93    
94 typedef struct {
95     int registerState; /* 0 (no commit pages), 1 (use commit pages) */
96     time_t registerChange;
97     ZServerSet *sets;
98     Dict dict;
99     ISAM isam;
100     ISAMC isamc;
101     Records records;
102     int errCode;
103     char *errString;
104     ODR odr;
105     ZebTargetInfo *zti;
106 } ZServerInfo;
107
108 int rpn_search (ZServerInfo *zi, 
109                 Z_RPNQuery *rpn, int num_bases, char **basenames, 
110                 const char *setname, int *hits);
111
112 int rpn_scan (ZServerInfo *zi, Z_AttributesPlusTerm *zapt,
113               oid_value attributeset,
114               int num_bases, char **basenames,
115               int *position, int *num_entries, struct scan_entry **list,
116               int *status);
117
118 ZServerSet *resultSetAdd (ZServerInfo *zi, const char *name,
119                           int ov, RSET rset);
120 ZServerSet *resultSetGet (ZServerInfo *zi, const char *name);
121 ZServerSetSysno *resultSetSysnoGet (ZServerInfo *zi, const char *name,
122                                     int num, int *positions);
123 void resultSetSysnoDel (ZServerInfo *zi, ZServerSetSysno *records, int num);
124 void zlog_rpn (Z_RPNQuery *rpn);
125
126 int zebraServerLock (int lockCommit);
127 void zebraServerUnlock (int commitPhase);
128 int zebraServerLockGetState (time_t *timep);