IDZEBRA  2.2.7
isamc-p.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 
21 
22 #include <idzebra/bfile.h>
23 #include <idzebra/isamc.h>
24 
25 YAZ_BEGIN_CDECL
26 
27 typedef struct {
30 } ISAMC_head;
31 
32 typedef unsigned ISAMC_BLOCK_SIZE;
33 
34 typedef struct ISAMC_file_s {
38 
39  int no_writes;
40  int no_reads;
44  int no_remap;
45 
50  int no_next;
51  int no_prev;
52 
53  char *alloc_buf;
56 
57  int fc_max;
60 
61 struct ISAMC_s {
62  int no_files;
63  int max_cat;
64  char *merge_buf;
67 };
68 
69 struct ISAMC_PP_s {
70  char *buf;
73  int cat;
80 };
81 
82 /*
83  first block consists of
84  next pointer : zint
85  size : ISAMC_BLOCK_SIZE (int)
86  numkeys : zint
87  data
88  other blocks consists of
89  next pointer : zint
90  size : ISAMC_BLOCK_SIZE (int)
91  data
92 */
93 #define ISAMC_BLOCK_OFFSET_1 (sizeof(zint)+sizeof(ISAMC_BLOCK_SIZE)+sizeof(zint))
94 #define ISAMC_BLOCK_OFFSET_N (sizeof(zint)+sizeof(ISAMC_BLOCK_SIZE))
95 
96 zint isamc_alloc_block (ISAMC is, int cat);
97 void isamc_release_block (ISAMC is, int cat, zint pos);
98 int isamc_read_block (ISAMC is, int cat, zint pos, char *dst);
99 int isamc_write_block (ISAMC is, int cat, zint pos, char *src);
100 
101 YAZ_END_CDECL
102 
103 
104 /*
105  * Local variables:
106  * c-basic-offset: 4
107  * c-file-style: "Stroustrup"
108  * indent-tabs-mode: nil
109  * End:
110  * vim: shiftwidth=4 tabstop=8 expandtab
111  */
112 
Zebra Block File Layer.
int isamc_write_block(ISAMC is, int cat, zint pos, char *src)
Definition: isamc.c:244
unsigned ISAMC_BLOCK_SIZE
Definition: isamc-p.h:32
zint isamc_alloc_block(ISAMC is, int cat)
Definition: isamc.c:394
void isamc_release_block(ISAMC is, int cat, zint pos)
Definition: isamc.c:417
int isamc_read_block(ISAMC is, int cat, zint pos, char *dst)
Definition: isamc.c:238
struct ISAMC_file_s * ISAMC_file
ISAMC_BLOCK_SIZE offset
Definition: isamc-p.h:71
ISAMC_BLOCK_SIZE size
Definition: isamc-p.h:72
char * buf
Definition: isamc-p.h:70
void * decodeClientData
Definition: isamc-p.h:77
zint next
Definition: isamc-p.h:75
zint pos
Definition: isamc-p.h:74
ISAMC is
Definition: isamc-p.h:76
zint numKeys
Definition: isamc-p.h:79
int cat
Definition: isamc-p.h:73
int deleteFlag
Definition: isamc-p.h:78
int fc_max
Definition: isamc-p.h:57
int alloc_entries_max
Definition: isamc-p.h:55
int no_backward
Definition: isamc-p.h:47
int no_forward
Definition: isamc-p.h:46
ISAMC_head head
Definition: isamc-p.h:35
int alloc_entries_num
Definition: isamc-p.h:54
zint sum_backward
Definition: isamc-p.h:49
int no_allocated
Definition: isamc-p.h:42
int no_released
Definition: isamc-p.h:43
int no_next
Definition: isamc-p.h:50
char * alloc_buf
Definition: isamc-p.h:53
zint sum_forward
Definition: isamc-p.h:48
int no_skip_writes
Definition: isamc-p.h:41
int head_is_dirty
Definition: isamc-p.h:37
int no_writes
Definition: isamc-p.h:39
int no_reads
Definition: isamc-p.h:40
int no_prev
Definition: isamc-p.h:51
zint * fc_list
Definition: isamc-p.h:58
int no_remap
Definition: isamc-p.h:44
BFile bf
Definition: isamc-p.h:36
zint lastblock
Definition: isamc-p.h:28
zint freelist
Definition: isamc-p.h:29
char * merge_buf
Definition: isamc-p.h:64
int max_cat
Definition: isamc-p.h:63
int no_files
Definition: isamc-p.h:62
ISAMC_file files
Definition: isamc-p.h:66
ISAMC_M * method
Definition: isamc-p.h:65
long zint
Zebra integer.
Definition: util.h:66