Work locking mechanisms for concurrent updates/commit.
[idzebra-moved-to-github.git] / index / zserver.h
1 /*
2  * Copyright (C) 1994-1995, Index Data I/S 
3  * All rights reserved.
4  * Sebastian Hammer, Adam Dickmeiss
5  *
6  * $Log: zserver.h,v $
7  * Revision 1.16  1995-12-07 17:38:48  adam
8  * Work locking mechanisms for concurrent updates/commit.
9  *
10  * Revision 1.15  1995/11/21  15:29:13  adam
11  * Config file 'base' read by default by both indexer and server.
12  *
13  * Revision 1.14  1995/11/16  17:00:57  adam
14  * Better logging of rpn query.
15  *
16  * Revision 1.13  1995/11/16  15:34:56  adam
17  * Uses new record management system in both indexer and server.
18  *
19  * Revision 1.12  1995/10/27  14:00:12  adam
20  * Implemented detection of database availability.
21  *
22  * Revision 1.11  1995/10/17  18:02:12  adam
23  * New feature: databases. Implemented as prefix to words in dictionary.
24  *
25  * Revision 1.10  1995/10/09  16:18:38  adam
26  * Function dict_lookup_grep got extra client data parameter.
27  *
28  * Revision 1.9  1995/10/06  14:38:01  adam
29  * New result set method: r_score.
30  * Local no (sysno) and score is transferred to retrieveCtrl.
31  *
32  * Revision 1.8  1995/10/06  13:52:06  adam
33  * Bug fixes. Handler may abort further scanning.
34  *
35  * Revision 1.7  1995/10/06  10:43:57  adam
36  * Scan added. 'occurrences' in scan entries not set yet.
37  *
38  * Revision 1.6  1995/09/28  09:19:48  adam
39  * xfree/xmalloc used everywhere.
40  * Extract/retrieve method seems to work for text records.
41  *
42  * Revision 1.5  1995/09/27  16:17:32  adam
43  * More work on retrieve.
44  *
45  * Revision 1.4  1995/09/14  11:53:28  adam
46  * First work on regular expressions/truncations.
47  *
48  * Revision 1.3  1995/09/08  08:53:23  adam
49  * Record buffer maintained in server_info.
50  *
51  * Revision 1.2  1995/09/06  16:11:19  adam
52  * Option: only one word key per file.
53  *
54  * Revision 1.1  1995/09/05  15:28:40  adam
55  * More work on search engine.
56  *
57  */
58
59 #include <backend.h>
60 #include <rset.h>
61
62 #include "index.h"
63 #include "recindex.h"
64
65 typedef struct {
66     int sysno;
67     int score;
68 } ZServerSetSysno;
69
70 typedef struct ZServerSet_ {
71     char *name;
72     RSET rset;
73     int size;
74     struct ZServerSet_ *next;
75 } ZServerSet;
76    
77 typedef struct {
78     int registerState; /* 0 (no commit pages), 1 (use commit pages) */
79     ZServerSet *sets;
80     Dict wordDict;
81     ISAM wordIsam;
82     Records records;
83     int errCode;
84     char *errString;
85     ODR odr;
86 } ZServerInfo;
87
88 int rpn_search (ZServerInfo *zi, 
89                 Z_RPNQuery *rpn, int num_bases, char **basenames, 
90                 const char *setname, int *hits);
91
92 int rpn_scan (ZServerInfo *zi, Z_AttributesPlusTerm *zapt,
93               int num_bases, char **basenames,
94               int *position, int *num_entries, struct scan_entry **list,
95               int *status);
96
97 ZServerSet *resultSetAdd (ZServerInfo *zi, const char *name,
98                           int ov, RSET rset);
99 ZServerSet *resultSetGet (ZServerInfo *zi, const char *name);
100 ZServerSetSysno *resultSetSysnoGet (ZServerInfo *zi, const char *name,
101                                     int num, int *positions);
102 void resultSetSysnoDel (ZServerInfo *zi, ZServerSetSysno *records, int num);
103 void zlog_rpn (Z_RPNQuery *rpn);