Furhter code reductions because of string attributes
[idzebra-moved-to-github.git] / index / zinfo.h
1 /* $Id: zinfo.h,v 1.33 2006-05-19 23:20:24 adam Exp $
2    Copyright (C) 1995-2006
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 <d1_absyn.h>
28 #include <idzebra/api.h>
29 #include "recindex.h"
30
31 /* Compare string (ignore case) */
32 #ifdef WIN32
33 #define STRCASECMP      stricmp
34 #else
35 #define STRCASECMP      strcasecmp
36 #endif
37
38 YAZ_BEGIN_CDECL
39
40 typedef struct zebraExplainInfo *ZebraExplainInfo;
41 typedef struct zebDatabaseInfo ZebDatabaseInfo;
42 ZebraExplainInfo zebraExplain_open (Records records, data1_handle dh,
43                                     Res res,
44                                     int writeFlag,
45                                     void *updateHandle,
46                                     int (*updateFunc)(void *handle,
47                                                       Record drec,
48                                                       data1_node *n));
49 void zebraExplain_close (ZebraExplainInfo zei);
50 int zebraExplain_curDatabase (ZebraExplainInfo zei, const char *database);
51 int zebraExplain_newDatabase (ZebraExplainInfo zei, const char *database,
52                               int explain_database);
53 int zebraExplain_add_attr_su(ZebraExplainInfo zei, int index_type,
54                              int set, int use);
55 int zebraExplain_lookup_attr_str(ZebraExplainInfo zei, int index_type,
56                                  const char *str);
57 int zebraExplain_add_attr_str(ZebraExplainInfo zei, int index_type,
58                               const char *str);
59 void zebraExplain_addSchema (ZebraExplainInfo zei, Odr_oid *oid);
60 void zebraExplain_recordCountIncrement (ZebraExplainInfo zei, int adjust_num);
61 void zebraExplain_recordBytesIncrement (ZebraExplainInfo zei, int adjust_num);
62 zint zebraExplain_runNumberIncrement (ZebraExplainInfo zei, int adjust_num);
63 void zebraExplain_loadAttsets (data1_handle dh, Res res);
64 void zebraExplain_flush (ZebraExplainInfo zei, void *updateHandle);
65
66 int zebraExplain_lookup_ord (ZebraExplainInfo zei, int ord,
67                              int *index_type, const char **db,
68                              const char **string_index);
69
70 int zebraExplain_ord_adjust_occurrences(ZebraExplainInfo zei, int ord,
71                                         int term_delta, int doc_delta);
72
73 zint zebraExplain_ord_get_term_occurrences(ZebraExplainInfo zei, int ord);
74 zint zebraExplain_ord_get_doc_occurrences(ZebraExplainInfo zei, int ord);
75
76 int zebraExplain_trav_ord(ZebraExplainInfo zei, void *handle,
77                           int (*f)(void *handle, int ord));
78
79 int zebraExplain_get_database_ord(ZebraExplainInfo zei);
80 int zebraExplain_removeDatabase(ZebraExplainInfo zei, void *updateHandle);
81
82 typedef struct {
83     int recordSize;
84     off_t recordOffset;
85     zint runNumber;
86     zint staticrank;
87 } RecordAttr;
88 RecordAttr *rec_init_attr (ZebraExplainInfo zei, Record rec);
89
90 YAZ_END_CDECL
91
92 #endif
93 /*
94  * Local variables:
95  * c-basic-offset: 4
96  * indent-tabs-mode: nil
97  * End:
98  * vim: shiftwidth=4 tabstop=8 expandtab
99  */
100