IDZEBRA  2.2.7
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 */
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;
51 
52 typedef struct ISAMC_I_s {
53  int (*read_item)(void *clientData, char **dst, int *insertMode);
54  void *clientData;
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
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
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 
Zebra Block File Layer.
ISAMC isamc_open(BFiles bfs, const char *name, int writeflag, ISAMC_M *method)
Definition: isamc.c:77
int isamc_block_size(ISAMC is, int type)
Definition: isamc.c:179
zint isamc_pp_num(ISAMC_PP pp)
Definition: isamc.c:587
int isamc_close(ISAMC is)
Definition: isamc.c:187
struct ISAMC_filecat_s * ISAMC_filecat
void isamc_getmethod(ISAMC_M *m)
Definition: isamc.c:45
struct ISAMC_M_s ISAMC_M
int isamc_read_item(ISAMC_PP pp, char **dst)
Definition: isamc.c:522
int isamc_pp_read(ISAMC_PP pp, void *buf)
Definition: isamc.c:511
struct ISAMC_s * ISAMC
Definition: isamc.h:30
void isamc_merge(ISAMC is, ISAM_P *pos, ISAMC_I *data)
Definition: merge.c:154
void isamc_pp_close(ISAMC_PP pp)
Definition: isamc.c:458
ISAMC_PP isamc_pp_open(ISAMC is, ISAM_P pos)
Definition: isamc.c:467
zint isamc_block_used(ISAMC is, int type)
Definition: isamc.c:172
zint ISAM_P
Definition: isamc.h:28
struct ISAMC_PP_s * ISAMC_PP
Definition: isamc.h:31
struct ISAMC_I_s ISAMC_I
int(* read_item)(void *clientData, char **dst, int *insertMode)
Definition: isamc.h:53
void * clientData
Definition: isamc.h:54
int(* compare_item)(const void *a, const void *b)
Definition: isamc.h:43
ISAMC_filecat filecat
Definition: isamc.h:41
ISAM_CODEC codec
Definition: isamc.h:46
int max_blocks_mem
Definition: isamc.h:48
void(* log_item)(int logmask, const void *p, const char *txt)
Definition: isamc.h:44
int debug
Definition: isamc.h:49
int mblocks
Definition: isamc.h:37
long zint
Zebra integer.
Definition: util.h:66