3e8714c0d9a4ac2c8317a88a9aff4122f0beb871
[idzebra-moved-to-github.git] / index / zinfo.h
1 /* $Id: zinfo.h,v 1.14 2002-08-02 19:26:56 adam Exp $
2    Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
3    Index Data Aps
4
5 This file is part of the Zebra server.
6
7 Zebra is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
10 version.
11
12 Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15 for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with Zebra; see the file LICENSE.zebra.  If not, write to the
19 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
20 02111-1307, USA.
21 */
22
23
24 #ifndef ZINFO_H
25 #define ZINFO_H
26
27 #include <yaz/data1.h>
28 #include "zebraapi.h"
29 #include "recindex.h"
30
31 YAZ_BEGIN_CDECL
32
33 typedef struct zebraExplainInfo *ZebraExplainInfo;
34 typedef struct zebDatabaseInfo ZebDatabaseInfo;
35 ZebraExplainInfo zebraExplain_open (Records records, data1_handle dh,
36                                     Res res,
37                                     int writeFlag,
38                                     void *updateHandle,
39                                     int (*updateFunc)(void *handle,
40                                                       Record drec,
41                                                       data1_node *n));
42 void zebraExplain_close (ZebraExplainInfo zei);
43 int zebraExplain_curDatabase (ZebraExplainInfo zei, const char *database);
44 int zebraExplain_newDatabase (ZebraExplainInfo zei, const char *database,
45                               int explain_database);
46 int zebraExplain_lookupSU (ZebraExplainInfo zei, int set, int use);
47 int zebraExplain_addSU (ZebraExplainInfo zei, int set, int use);
48 void zebraExplain_addSchema (ZebraExplainInfo zei, Odr_oid *oid);
49 void zebraExplain_recordCountIncrement (ZebraExplainInfo zei, int adjust_num);
50 void zebraExplain_recordBytesIncrement (ZebraExplainInfo zei, int adjust_num);
51 int zebraExplain_runNumberIncrement (ZebraExplainInfo zei, int adjust_num);
52 void zebraExplain_loadAttsets (data1_handle dh, Res res);
53 void zebraExplain_flush (ZebraExplainInfo zei, void *updateHandle);
54
55 int zebraExplain_lookup_ord (ZebraExplainInfo zei, int ord,
56                              const char **db, int *set, int *use);
57
58 typedef struct {
59     int recordSize;
60     off_t recordOffset;
61     int runNumber;
62 } RecordAttr;
63 RecordAttr *rec_init_attr (ZebraExplainInfo zei, Record rec);
64
65 YAZ_END_CDECL
66
67 #endif