1 /* $Id: isamc.h,v 1.4 2005-04-15 10:47:48 adam Exp $
2 Copyright (C) 1995-2005
5 This file is part of the Zebra server.
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
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
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
26 #include <idzebra/isam-codec.h>
27 #include <idzebra/bfile.h>
33 typedef struct ISAMC_s *ISAMC;
34 typedef struct ISAMC_PP_s *ISAMC_PP;
36 typedef struct ISAMC_filecat_s {
37 int bsize; /* block size */
38 int ifill; /* initial fill */
39 int mfill; /* minimum fill */
40 int mblocks; /* maximum blocks */
43 typedef struct ISAMC_M_s {
44 ISAMC_filecat filecat;
46 int (*compare_item)(const void *a, const void *b);
47 void (*log_item)(int logmask, const void *p, const char *txt);
55 typedef struct ISAMC_I_s {
56 int (*read_item)(void *clientData, char **dst, int *insertMode);
61 void isamc_getmethod (ISAMC_M *m);
64 ISAMC isamc_open (BFiles bfs, const char *name, int writeflag,
67 int isamc_close (ISAMC is);
70 void isamc_merge (ISAMC is, ISAM_P *pos, ISAMC_I *data);
73 ISAMC_PP isamc_pp_open (ISAMC is, ISAM_P pos);
76 void isamc_pp_close (ISAMC_PP pp);
79 int isamc_read_item (ISAMC_PP pp, char **dst);
82 int isamc_pp_read (ISAMC_PP pp, void *buf);
85 zint isamc_pp_num (ISAMC_PP pp);
88 zint isamc_block_used (ISAMC is, int type);
91 int isamc_block_size (ISAMC is, int type);
93 #define isamc_type(x) ((x) & 7)
94 #define isamc_block(x) ((x) >> 3)