1 /* $Id: isamd-p.h,v 1.7 1999-09-20 15:48:06 heikki Exp $
2 * Copyright (c) 1995-1996, Index Data.
3 * See the file LICENSE for details.
21 typedef unsigned ISAMD_BLOCK_SIZE;
23 typedef struct ISAMD_file_s {
28 int no_writes; /* statistics, to be used properly... */
42 int no_op_nodiff; /* existing blocks opened for reading without diffs */
43 int no_op_intdiff; /* - with internal diffs */
44 int no_op_extdiff; /* with separate diff blocks */
45 int no_fbuilds; /* number of first-time builds */
46 int no_appds; /* number of appends */
47 int no_merges; /* number of merges done */
48 int no_remerges; /* number of times more than one merge needed */
50 char *alloc_buf; /* free-list handling (?) */
51 int alloc_entries_num;
52 int alloc_entries_max;
66 typedef struct ISAMD_DIFF_s *ISAMD_DIFF;
69 char *buf; /* buffer for read/write operations */
70 ISAMD_BLOCK_SIZE offset; /* position for next read/write */
71 ISAMD_BLOCK_SIZE size; /* size of actual data */
72 int cat; /* category of this block */
73 int pos; /* block number of this block */
74 int next; /* number of the next block */
75 int diffs; /* not used in the modern isam-d, but kept for stats compatibility */
76 /* never stored on disk, though */
78 void *decodeClientData; /* delta-encoder's own data */
80 char *diffbuf; /* buffer for the diff block */
84 #define ISAMD_BLOCK_OFFSET_N (sizeof(int) + \
85 sizeof(ISAMD_BLOCK_SIZE))
87 #define ISAMD_BLOCK_OFFSET_1 (sizeof(int) + \
88 sizeof(ISAMD_BLOCK_SIZE) + \
89 sizeof(ISAMD_BLOCK_SIZE))
94 int isamd_alloc_block (ISAMD is, int cat);
95 void isamd_release_block (ISAMD is, int cat, int pos);
96 int isamd_read_block (ISAMD is, int cat, int pos, char *dst);
97 int isamd_write_block (ISAMD is, int cat, int pos, char *src);
98 void isamd_free_diffs(ISAMD_PP pp);
107 * $Log: isamd-p.h,v $
108 * Revision 1.7 1999-09-20 15:48:06 heikki
111 * Revision 1.6 1999/08/25 18:09:23 heikki
112 * Starting to optimize
114 * Revision 1.5 1999/08/20 12:25:58 heikki
115 * Statistics in isamd
117 * Revision 1.4 1999/07/21 14:24:50 heikki
118 * isamd write and read functions ok, except when diff block full.
119 * (merge not yet done)
121 * Revision 1.3 1999/07/14 15:05:30 heikki
122 * slow start on isam-d
124 * Revision 1.1 1999/07/14 12:34:43 heikki
125 * Copied from isamh, starting to change things...