0cbd7f10d2a8205d8ee8b3f3e50e1511c0041bb4
[idzebra-moved-to-github.git] / include / idzebra / isams.h
1 /* This file is part of the Zebra server.
2    Copyright (C) 1994-2009 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
21 #ifndef ISAMS_H
22 #define ISAMS_H
23
24 #include <idzebra/isam-codec.h>
25 #include <idzebra/bfile.h>
26 #include <idzebra/isamc.h>
27
28 YAZ_BEGIN_CDECL
29
30 typedef struct ISAMS_s *ISAMS;
31 typedef struct ISAMS_PP_s *ISAMS_PP;
32
33 typedef struct ISAMS_M_s {
34     int (*compare_item)(const void *a, const void *b);
35     void (*log_item)(int logmask, const void *p, const char *txt);
36
37     ISAM_CODEC codec;
38
39     int debug;
40     int block_size;
41 } ISAMS_M;
42
43 typedef struct ISAMS_I_s {
44     int (*read_item)(void *clientData, char **dst, int *insertMode);
45     void *clientData;
46 } *ISAMS_I;
47
48 void isams_getmethod (ISAMS_M *me);
49
50 ISAMS isams_open (BFiles bfs, const char *name, int writeflag,
51                   ISAMS_M *method);
52 int isams_close (ISAMS is);
53 ISAM_P isams_merge (ISAMS is, ISAMS_I data);
54 ISAMS_PP isams_pp_open (ISAMS is, ISAM_P pos);
55 void isams_pp_close (ISAMS_PP pp);
56 int isams_read_item (ISAMS_PP pp, char **dst);
57 int isams_pp_read (ISAMS_PP pp, void *buf);
58 int isams_pp_num (ISAMS_PP pp);
59
60 YAZ_END_CDECL
61
62 #endif
63 /*
64  * Local variables:
65  * c-basic-offset: 4
66  * c-file-style: "Stroustrup"
67  * indent-tabs-mode: nil
68  * End:
69  * vim: shiftwidth=4 tabstop=8 expandtab
70  */
71