Remove isamd. It's not been in use for a long time and isamb is better
[idzebra-moved-to-github.git] / isamc / isamc-p.h
1 /* $Id: isamc-p.h,v 1.10 2004-08-04 08:35:24 adam Exp $
2    Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
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
25 #include <bfile.h>
26 #include <isamc.h>
27
28 YAZ_BEGIN_CDECL
29
30 typedef struct {
31     zint lastblock;
32     zint freelist;
33 } ISAMC_head;
34
35 typedef unsigned ISAMC_BLOCK_SIZE;
36
37 typedef struct ISAMC_file_s {
38     ISAMC_head head;
39     BFile bf;
40     int head_is_dirty;
41     
42     int no_writes;
43     int no_reads;
44     int no_skip_writes;
45     int no_allocated;
46     int no_released;
47     int no_remap;
48
49     int no_forward;
50     int no_backward;
51     int sum_forward;
52     int sum_backward;
53     int no_next;
54     int no_prev;
55
56     char *alloc_buf;
57     int alloc_entries_num;
58     int alloc_entries_max;
59
60     int fc_max;
61     int *fc_list;
62 } *ISAMC_file;
63
64 struct ISAMC_s {
65     int no_files;
66     int max_cat;
67     char *merge_buf;
68     ISAMC_M *method;
69     ISAMC_file files;
70 }; 
71
72 struct ISAMC_PP_s {
73     char *buf;
74     ISAMC_BLOCK_SIZE offset;
75     ISAMC_BLOCK_SIZE size;
76     int cat;
77     zint pos;
78     zint next;
79     ISAMC is;
80     void *decodeClientData;
81     int deleteFlag;
82     zint numKeys;
83 };
84
85 /* 
86   first block consists of
87       next pointer : zint
88       size         : ISAMC_BLOCK_SIZE (int)
89       numkeys      : zint
90       data
91   other blocks consists of
92       next pointer : zint
93       size :         ISAMC_BLOCK_SIZE (int)
94       data
95 */
96 #define ISAMC_BLOCK_OFFSET_1 (sizeof(zint)+sizeof(ISAMC_BLOCK_SIZE)+sizeof(zint)) 
97 #define ISAMC_BLOCK_OFFSET_N (sizeof(zint)+sizeof(ISAMC_BLOCK_SIZE)) 
98
99 zint isc_alloc_block (ISAMC is, int cat);
100 void isc_release_block (ISAMC is, int cat, zint pos);
101 int isc_read_block (ISAMC is, int cat, zint pos, char *dst);
102 int isc_write_block (ISAMC is, int cat, zint pos, char *src);
103
104 YAZ_END_CDECL
105
106