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