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