Scan added. 'occurrences' in scan entries not set yet.
[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.7  1995-10-06 10:43:57  adam
8  * Scan added. 'occurrences' in scan entries not set yet.
9  *
10  * Revision 1.6  1995/09/28  09:19:48  adam
11  * xfree/xmalloc used everywhere.
12  * Extract/retrieve method seems to work for text records.
13  *
14  * Revision 1.5  1995/09/27  16:17:32  adam
15  * More work on retrieve.
16  *
17  * Revision 1.4  1995/09/14  11:53:28  adam
18  * First work on regular expressions/truncations.
19  *
20  * Revision 1.3  1995/09/08  08:53:23  adam
21  * Record buffer maintained in server_info.
22  *
23  * Revision 1.2  1995/09/06  16:11:19  adam
24  * Option: only one word key per file.
25  *
26  * Revision 1.1  1995/09/05  15:28:40  adam
27  * More work on search engine.
28  *
29  */
30
31 #include "index.h"
32 #include <backend.h>
33 #include <rset.h>
34
35 typedef struct {
36     size_t size;
37     char *buf;
38 } ZServerRecord;
39
40 typedef struct {
41     int sysno;
42 } ZServerSetSysno;
43
44 typedef struct ZServerSet_ {
45     char *name;
46     RSET rset;
47     int size;
48     struct ZServerSet_ *next;
49 } ZServerSet;
50    
51 typedef struct {
52     ZServerSet *sets;
53     Dict wordDict;
54     ISAM wordIsam;
55     Dict fileDict;
56     int sys_idx_fd;
57     char *recordBuf;
58     int errCode;
59     char *errString;
60     ODR odr;
61 } ZServerInfo;
62
63 int rpn_search (ZServerInfo *zi, 
64                 Z_RPNQuery *rpn, int num_bases, char **basenames, 
65                 const char *setname, int *hits);
66
67 int rpn_scan (ZServerInfo *zi, ODR odr, Z_AttributesPlusTerm *zapt,
68               int *position, int *num_entries, struct scan_entry **list);
69
70 ZServerSet *resultSetAdd (ZServerInfo *zi, const char *name,
71                           int ov, RSET rset);
72 ZServerSet *resultSetGet (ZServerInfo *zi, const char *name);
73 ZServerSetSysno *resultSetSysnoGet (ZServerInfo *zi, const char *name,
74                                     int num, int *positions);
75 void resultSetRecordDel (ZServerInfo *zi, ZServerRecord *records, int num);