b04d9e0a1848883a6ebdf1450348471caed2c571
[idzebra-moved-to-github.git] / index / zinfo.h
1 /*
2  * Copyright (C) 1994-1999, Index Data
3  * All rights reserved.
4  * Sebastian Hammer, Adam Dickmeiss
5  *
6  * $Log: zinfo.h,v $
7  * Revision 1.13  2002-05-07 11:05:19  adam
8  * data1 updates. Run number fix
9  *
10  * Revision 1.12  2002/02/20 17:30:01  adam
11  * Work on new API. Locking system re-implemented
12  *
13  * Revision 1.11  2001/10/15 19:53:43  adam
14  * POSIX thread updates. First work on term sets.
15  *
16  * Revision 1.10  2000/05/15 12:56:37  adam
17  * Record offset of size off_t.
18  *
19  * Revision 1.9  2000/03/20 19:08:36  adam
20  * Added remote record import using Z39.50 extended services and Segment
21  * Requests.
22  *
23  * Revision 1.8  1999/11/30 13:48:03  adam
24  * Improved installation. Updated for inclusion of YAZ header files.
25  *
26  * Revision 1.7  1999/05/26 07:49:13  adam
27  * C++ compilation.
28  *
29  * Revision 1.6  1999/02/02 14:51:12  adam
30  * Updated WIN32 code specific sections. Changed header.
31  *
32  * Revision 1.5  1998/06/08 14:43:16  adam
33  * Added suport for EXPLAIN Proxy servers - added settings databasePath
34  * and explainDatabase to facilitate this. Increased maximum number
35  * of databases and attributes in one register.
36  *
37  * Revision 1.4  1998/05/20 10:12:21  adam
38  * Implemented automatic EXPLAIN database maintenance.
39  * Modified Zebra to work with ASN.1 compiled version of YAZ.
40  *
41  * Revision 1.3  1998/03/05 08:45:13  adam
42  * New result set model and modular ranking system. Moved towards
43  * descent server API. System information stored as "SGML" records.
44  *
45  * Revision 1.2  1996/05/22 08:22:00  adam
46  * Added public ZebDatabaseInfo structure.
47  *
48  * Revision 1.1  1996/05/13 14:23:07  adam
49  * Work on compaction of set/use bytes in dictionary.
50  *
51  */
52 #ifndef ZINFO_H
53 #define ZINFO_H
54
55 #include <yaz/data1.h>
56 #include "zebraapi.h"
57 #include "recindex.h"
58
59 YAZ_BEGIN_CDECL
60
61 typedef struct zebraExplainInfo *ZebraExplainInfo;
62 typedef struct zebDatabaseInfo ZebDatabaseInfo;
63 ZebraExplainInfo zebraExplain_open (Records records, data1_handle dh,
64                                     Res res,
65                                     int writeFlag,
66                                     void *updateHandle,
67                                     int (*updateFunc)(void *handle,
68                                                       Record drec,
69                                                       data1_node *n));
70 void zebraExplain_close (ZebraExplainInfo zei);
71 int zebraExplain_curDatabase (ZebraExplainInfo zei, const char *database);
72 int zebraExplain_newDatabase (ZebraExplainInfo zei, const char *database,
73                               int explain_database);
74 int zebraExplain_lookupSU (ZebraExplainInfo zei, int set, int use);
75 int zebraExplain_addSU (ZebraExplainInfo zei, int set, int use);
76 void zebraExplain_addSchema (ZebraExplainInfo zei, Odr_oid *oid);
77 void zebraExplain_recordCountIncrement (ZebraExplainInfo zei, int adjust_num);
78 void zebraExplain_recordBytesIncrement (ZebraExplainInfo zei, int adjust_num);
79 int zebraExplain_runNumberIncrement (ZebraExplainInfo zei, int adjust_num);
80 void zebraExplain_loadAttsets (data1_handle dh, Res res);
81 void zebraExplain_flush (ZebraExplainInfo zei, void *updateHandle);
82
83 int zebraExplain_lookup_ord (ZebraExplainInfo zei, int ord,
84                              const char **db, int *set, int *use);
85
86 typedef struct {
87     int recordSize;
88     off_t recordOffset;
89     int runNumber;
90 } RecordAttr;
91 RecordAttr *rec_init_attr (ZebraExplainInfo zei, Record rec);
92
93 YAZ_END_CDECL
94
95 #endif