opied from isamc.p.h, starting to simplify
[idzebra-moved-to-github.git] / isamc / isamh-p.h
1 /*
2  * Copyright (c) 1995-1996, Index Data.
3  * See the file LICENSE for details.
4  * Heikki Levanto
5  *
6  *
7  */
8
9 #include <bfile.h>
10 #include <isamh.h>
11
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15
16 typedef struct {
17     int lastblock;
18     int freelist;
19 } ISAMH_head;
20
21 typedef unsigned ISAMH_BLOCK_SIZE;
22
23 typedef struct ISAMH_file_s {
24     ISAMH_head head;
25     BFile bf;
26     int head_is_dirty;
27     
28     int no_writes;
29     int no_reads;
30     int no_skip_writes;
31     int no_allocated;
32     int no_released;
33     int no_remap;
34
35     int no_forward;
36     int no_backward;
37     int sum_forward;
38     int sum_backward;
39     int no_next;
40     int no_prev;
41
42     char *alloc_buf;
43     int alloc_entries_num;
44     int alloc_entries_max;
45
46     int fc_max;
47     int *fc_list;
48 } *ISAMH_file;
49
50 struct ISAMH_s {
51     int no_files;
52     int max_cat;
53     char *merge_buf;
54     ISAMH_M method;
55     ISAMH_file files;
56 }; 
57
58 struct ISAMH_PP_s {
59     char *buf;
60     ISAMH_BLOCK_SIZE offset;
61     ISAMH_BLOCK_SIZE size;
62     int cat;
63     int pos;
64     int next;
65     ISAMH is;
66     void *decodeClientData;
67     int deleteFlag;
68     int numKeys;
69 };
70
71 #define ISAMH_BLOCK_OFFSET_N (sizeof(int)+sizeof(ISAMH_BLOCK_SIZE)) 
72 #define ISAMH_BLOCK_OFFSET_1 (sizeof(int)+sizeof(ISAMH_BLOCK_SIZE)+sizeof(int)) 
73 int isamh_alloc_block (ISAMH is, int cat);
74 void isamh_release_block (ISAMH is, int cat, int pos);
75 int isamh_read_block (ISAMH is, int cat, int pos, char *dst);
76 int isamh_write_block (ISAMH is, int cat, int pos, char *src);
77
78 #ifdef __cplusplus
79 }
80 #endif
81
82
83
84 /*
85  * $Log: isamh-p.h,v $
86  * Revision 1.1  1999-06-30 15:05:45  heikki
87  * opied from isamc.p.h, starting to simplify
88  *
89  */