C++ compilation.
[idzebra-moved-to-github.git] / isamc / isamc-p.h
1 /*
2  * Copyright (c) 1995-1996, Index Data.
3  * See the file LICENSE for details.
4  * Sebastian Hammer, Adam Dickmeiss
5  *
6  * $Log: isamc-p.h,v $
7  * Revision 1.7  1999-05-26 07:49:14  adam
8  * C++ compilation.
9  *
10  * Revision 1.6  1998/03/18 09:23:55  adam
11  * Blocks are stored in chunks on free list - up to factor 2 in speed.
12  * Fixed bug that could occur in block category rearrangemen.
13  *
14  * Revision 1.5  1998/03/16 10:37:24  adam
15  * Added more statistics.
16  *
17  * Revision 1.4  1996/11/08 11:15:28  adam
18  * Number of keys in chain are stored in first block and the function
19  * to retrieve this information, isc_pp_num is implemented.
20  *
21  * Revision 1.3  1996/11/04 14:08:55  adam
22  * Optimized free block usage.
23  *
24  * Revision 1.2  1996/11/01 08:59:13  adam
25  * First version of isc_merge that supports update/delete.
26  *
27  * Revision 1.1  1996/10/29 13:40:47  adam
28  * First work.
29  *
30  */
31
32 #include <bfile.h>
33 #include <isamc.h>
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39 typedef struct {
40     int lastblock;
41     int freelist;
42 } ISAMC_head;
43
44 typedef unsigned ISAMC_BLOCK_SIZE;
45
46 typedef struct ISAMC_file_s {
47     ISAMC_head head;
48     BFile bf;
49     int head_is_dirty;
50     
51     int no_writes;
52     int no_reads;
53     int no_skip_writes;
54     int no_allocated;
55     int no_released;
56     int no_remap;
57
58     int no_forward;
59     int no_backward;
60     int sum_forward;
61     int sum_backward;
62     int no_next;
63     int no_prev;
64
65     char *alloc_buf;
66     int alloc_entries_num;
67     int alloc_entries_max;
68
69     int fc_max;
70     int *fc_list;
71 } *ISAMC_file;
72
73 struct ISAMC_s {
74     int no_files;
75     int max_cat;
76     char *merge_buf;
77     ISAMC_M method;
78     ISAMC_file files;
79 }; 
80
81 struct ISAMC_PP_s {
82     char *buf;
83     ISAMC_BLOCK_SIZE offset;
84     ISAMC_BLOCK_SIZE size;
85     int cat;
86     int pos;
87     int next;
88     ISAMC is;
89     void *decodeClientData;
90     int deleteFlag;
91     int numKeys;
92 };
93
94 #define ISAMC_BLOCK_OFFSET_N (sizeof(int)+sizeof(ISAMC_BLOCK_SIZE)) 
95 #define ISAMC_BLOCK_OFFSET_1 (sizeof(int)+sizeof(ISAMC_BLOCK_SIZE)+sizeof(int)) 
96 int isc_alloc_block (ISAMC is, int cat);
97 void isc_release_block (ISAMC is, int cat, int pos);
98 int isc_read_block (ISAMC is, int cat, int pos, char *dst);
99 int isc_write_block (ISAMC is, int cat, int pos, char *src);
100
101 #ifdef __cplusplus
102 }
103 #endif
104