More work on retrieve.
[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.5  1995-09-27 16:17:32  adam
8  * More work on retrieve.
9  *
10  * Revision 1.4  1995/09/14  11:53:28  adam
11  * First work on regular expressions/truncations.
12  *
13  * Revision 1.3  1995/09/08  08:53:23  adam
14  * Record buffer maintained in server_info.
15  *
16  * Revision 1.2  1995/09/06  16:11:19  adam
17  * Option: only one word key per file.
18  *
19  * Revision 1.1  1995/09/05  15:28:40  adam
20  * More work on search engine.
21  *
22  */
23
24 #include "index.h"
25 #include <proto.h>
26 #include <rset.h>
27
28 typedef struct {
29     size_t size;
30     char *buf;
31 } ZServerRecord;
32
33 typedef struct {
34     int sysno;
35 } ZServerSetSysno;
36
37 typedef struct ZServerSet_ {
38     char *name;
39     RSET rset;
40     int size;
41     struct ZServerSet_ *next;
42 } ZServerSet;
43    
44 typedef struct {
45     ZServerSet *sets;
46     Dict wordDict;
47     ISAM wordIsam;
48     Dict fileDict;
49     int sys_idx_fd;
50     char *recordBuf;
51     int errCode;
52     char *errString;
53 } ZServerInfo;
54
55 int rpn_search (ZServerInfo *zi, 
56                 Z_RPNQuery *rpn, int num_bases, char **basenames, 
57                 const char *setname, int *hits);
58
59 ZServerSet *resultSetAdd (ZServerInfo *zi, const char *name,
60                           int ov, RSET rset);
61 ZServerSet *resultSetGet (ZServerInfo *zi, const char *name);
62 ZServerRecord *resultSetRecordGet (ZServerInfo *zi, const char *name,
63                                    int num, int *positions);
64 void resultSetRecordDel (ZServerInfo *zi, ZServerRecord *records, int num);