1 /* $Id: isamd-p.h,v 1.10 2002-04-29 18:10:24 adam 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... */
35 int no_forward; /* stats from pp_read, for isam-c compatibility */
42 int no_op_diffonly;/* number of opens without mainblock */
43 int no_op_main; /* number of opens with a main block */
45 char *alloc_buf; /* free-list handling (?) */
46 int alloc_entries_num;
47 int alloc_entries_max;
58 int last_pos; /* last read/write position for seek stats */
59 int last_cat; /* same for category */
60 int no_read; /* blocks read (in all categories) */
61 int no_write; /* blocks written (in all categories) */
62 int no_op_single;/* singleton "blocks" opened */
63 int no_read_keys;/* number of keys read (occurences of words) */
64 int no_read_main;/* number of main keys read (not diffs) */
65 int no_read_eof; /* number of key sequence ends read (no of words read) */
66 int no_seek_nxt; /* seeks to the next record (fast) */
67 int no_seek_sam; /* seeks to same record (fast) */
68 int no_seek_fwd; /* seeks forward */
69 int no_seek_prv; /* seeks to previous */
70 int no_seek_bak; /* seeks backwards */
71 int no_seek_cat; /* seeks to different category (expensive) */
72 int no_op_new; /* "open"s for new blocks */
73 int no_fbuilds; /* number of first-time builds */
74 int no_appds; /* number of appends */
75 int no_merges; /* number of merges done */
76 int no_non; /* merges without any work */
77 int no_singles; /* new items resulting in singletons */
81 typedef struct ISAMD_DIFF_s *ISAMD_DIFF;
84 char *buf; /* buffer for read/write operations */
85 ISAMD_BLOCK_SIZE offset; /* position for next read/write */
86 ISAMD_BLOCK_SIZE size; /* size of actual data */
87 int cat; /* category of this block */
88 int pos; /* block number of this block */
89 int next; /* number of the next block */
90 int diffs; /* not used in the modern isam-d, but kept for stats compatibility */
91 /* never stored on disk, though */
93 void *decodeClientData; /* delta-encoder's own data */
95 char *diffbuf; /* buffer for the diff block */
99 #define ISAMD_BLOCK_OFFSET_N (sizeof(int) + \
100 sizeof(ISAMD_BLOCK_SIZE))
102 #define ISAMD_BLOCK_OFFSET_1 (sizeof(int) + \
103 sizeof(ISAMD_BLOCK_SIZE) + \
104 sizeof(ISAMD_BLOCK_SIZE))
109 int isamd_alloc_block (ISAMD is, int cat);
110 void isamd_release_block (ISAMD is, int cat, int pos);
111 int isamd_read_block (ISAMD is, int cat, int pos, char *dst);
112 int isamd_write_block (ISAMD is, int cat, int pos, char *src);
113 void isamd_free_diffs(ISAMD_PP pp);
115 int is_singleton(ISAMD_P ipos);
116 void singleton_decode (int code, struct it_key *k);
117 int singleton_encode(struct it_key *k);
127 * $Log: isamd-p.h,v $
128 * Revision 1.10 2002-04-29 18:10:24 adam
129 * Newline at end of file
131 * Revision 1.9 1999/10/05 09:57:40 heikki
132 * Tuning the isam-d (and fixed a small "detail")
134 * Revision 1.8 1999/09/23 18:01:18 heikki
135 * singleton optimising
137 * Revision 1.7 1999/09/20 15:48:06 heikki
140 * Revision 1.6 1999/08/25 18:09:23 heikki
141 * Starting to optimize
143 * Revision 1.5 1999/08/20 12:25:58 heikki
144 * Statistics in isamd
146 * Revision 1.4 1999/07/21 14:24:50 heikki
147 * isamd write and read functions ok, except when diff block full.
148 * (merge not yet done)
150 * Revision 1.3 1999/07/14 15:05:30 heikki
151 * slow start on isam-d
153 * Revision 1.1 1999/07/14 12:34:43 heikki
154 * Copied from isamh, starting to change things...