Added more statistics.
[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.5  1998-03-16 10:37:24  adam
8  * Added more statistics.
9  *
10  * Revision 1.4  1996/11/08 11:15:28  adam
11  * Number of keys in chain are stored in first block and the function
12  * to retrieve this information, isc_pp_num is implemented.
13  *
14  * Revision 1.3  1996/11/04 14:08:55  adam
15  * Optimized free block usage.
16  *
17  * Revision 1.2  1996/11/01 08:59:13  adam
18  * First version of isc_merge that supports update/delete.
19  *
20  * Revision 1.1  1996/10/29 13:40:47  adam
21  * First work.
22  *
23  */
24
25 #include <bfile.h>
26 #include <isamc.h>
27
28 typedef struct {
29     int lastblock;
30     int freelist;
31 } ISAMC_head;
32
33 typedef struct ISAMC_file_s {
34     ISAMC_head head;
35     BFile bf;
36     int head_is_dirty;
37     
38     int no_writes;
39     int no_reads;
40     int no_skip_writes;
41     int no_allocated;
42     int no_released;
43     int no_remap;
44
45     int no_forward;
46     int no_backward;
47     int sum_forward;
48     int sum_backward;
49     int no_next;
50     int no_prev;
51
52     int fc_max;
53     int *fc_list;
54 } *ISAMC_file;
55
56 struct ISAMC_s {
57     int no_files;
58     int max_cat;
59     char *merge_buf;
60     ISAMC_M method;
61     ISAMC_file files;
62 }; 
63
64 struct ISAMC_PP_s {
65     char *buf;
66     unsigned offset;
67     unsigned short size;
68     int cat;
69     int pos;
70     int next;
71     ISAMC is;
72     void *decodeClientData;
73     int deleteFlag;
74     int numKeys;
75 };
76
77 #define ISAMC_BLOCK_OFFSET_N (sizeof(int)+sizeof(short)) 
78 #define ISAMC_BLOCK_OFFSET_1 (sizeof(int)+sizeof(short)+sizeof(int)) 
79
80 int isc_alloc_block (ISAMC is, int cat);
81 void isc_release_block (ISAMC is, int cat, int pos);
82 int isc_read_block (ISAMC is, int cat, int pos, char *dst);
83 int isc_write_block (ISAMC is, int cat, int pos, char *src);