IDZEBRA  2.1.2
isamc.h
Go to the documentation of this file.
1 /* This file is part of the Zebra server.
2  Copyright (C) Index Data
3 
4 Zebra is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 2, or (at your option) any later
7 version.
8 
9 Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 for more details.
13 
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 
18 */
19 
20 #ifndef ISAMC_H
21 #define ISAMC_H
22 
23 #include <idzebra/isam-codec.h>
24 #include <idzebra/bfile.h>
25 
26 YAZ_BEGIN_CDECL
27 
28 typedef zint ISAM_P;
29 
30 typedef struct ISAMC_s *ISAMC;
31 typedef struct ISAMC_PP_s *ISAMC_PP;
32 
33 typedef struct ISAMC_filecat_s {
34  int bsize; /* block size */
35  int ifill; /* initial fill */
36  int mfill; /* minimum fill */
37  int mblocks; /* maximum blocks */
38 } *ISAMC_filecat;
39 
40 typedef struct ISAMC_M_s {
42 
43  int (*compare_item)(const void *a, const void *b);
44  void (*log_item)(int logmask, const void *p, const char *txt);
45 
47 
49  int debug;
50 } ISAMC_M;
51 
52 typedef struct ISAMC_I_s {
53  int (*read_item)(void *clientData, char **dst, int *insertMode);
54  void *clientData;
55 } ISAMC_I;
56 
57 YAZ_EXPORT
58 void isamc_getmethod(ISAMC_M *m);
59 
60 YAZ_EXPORT
61 ISAMC isamc_open(BFiles bfs, const char *name, int writeflag,
62  ISAMC_M *method);
63 YAZ_EXPORT
64 int isamc_close(ISAMC is);
65 
66 YAZ_EXPORT
67 void isamc_merge(ISAMC is, ISAM_P *pos, ISAMC_I *data);
68 
69 YAZ_EXPORT
70 ISAMC_PP isamc_pp_open(ISAMC is, ISAM_P pos);
71 
72 YAZ_EXPORT
73 void isamc_pp_close(ISAMC_PP pp);
74 
75 YAZ_EXPORT
76 int isamc_read_item(ISAMC_PP pp, char **dst);
77 
78 YAZ_EXPORT
79 int isamc_pp_read(ISAMC_PP pp, void *buf);
80 
81 YAZ_EXPORT
82 zint isamc_pp_num(ISAMC_PP pp);
83 
84 YAZ_EXPORT
85 zint isamc_block_used(ISAMC is, int type);
86 
87 YAZ_EXPORT
88 int isamc_block_size(ISAMC is, int type);
89 
90 #define isamc_type(x) ((x) & 7)
91 #define isamc_block(x) ((x) >> 3)
92 
93 YAZ_END_CDECL
94 
95 #endif
96 /*
97  * Local variables:
98  * c-basic-offset: 4
99  * c-file-style: "Stroustrup"
100  * indent-tabs-mode: nil
101  * End:
102  * vim: shiftwidth=4 tabstop=8 expandtab
103  */
104 
void isamc_pp_close(ISAMC_PP pp)
Definition: isamc.c:457
zint ISAM_P
Definition: isamc.h:28
struct ISAMC_I_s ISAMC_I
Zebra Block File Layer.
struct ISAMC_filecat_s * ISAMC_filecat
zint isamc_block_used(ISAMC is, int type)
Definition: isamc.c:171
int compare_item(const void *a, const void *b)
Definition: benchisamb.c:51
int mblocks
Definition: isamc.h:37
ISAM_CODEC codec
Definition: isamc.h:46
void isamc_getmethod(ISAMC_M *m)
Definition: isamc.c:44
ISAMC isamc_open(BFiles bfs, const char *name, int writeflag, ISAMC_M *method)
Definition: isamc.c:76
int isamc_block_size(ISAMC is, int type)
Definition: isamc.c:178
int debug
Definition: isamc.h:49
struct ISAMC_PP_s * ISAMC_PP
Definition: isamc.h:31
ISAMC_filecat filecat
Definition: isamc.h:41
long zint
Zebra integer.
Definition: util.h:66
int isamc_close(ISAMC is)
Definition: isamc.c:186
int isamc_read_item(ISAMC_PP pp, char **dst)
Definition: isamc.c:521
int max_blocks_mem
Definition: isamc.h:48
void isamc_merge(ISAMC is, ISAM_P *pos, ISAMC_I *data)
Definition: merge.c:154
struct ISAMC_s * ISAMC
Definition: isamc.h:30
zint isamc_pp_num(ISAMC_PP pp)
Definition: isamc.c:586
int isamc_pp_read(ISAMC_PP pp, void *buf)
Definition: isamc.c:510
void * clientData
Definition: isamc.h:54
ISAMC_PP isamc_pp_open(ISAMC is, ISAM_P pos)
Definition: isamc.c:466
static void log_item(int level, const void *b, const char *txt)
Definition: benchisamb.c:39
struct ISAMC_M_s ISAMC_M