2 * Copyright (c) 1995-1997, Index Data.
3 * See the file LICENSE for details.
5 * IsamH is a simple ISAM that can only append to the end of the list.
6 * It will need a clean-up process occasionally... Code stolen from
11 * Detailed log at the end of the file
24 typedef struct ISAMH_s *ISAMH;
26 typedef struct ISAMH_PP_s *ISAMH_PP;
28 typedef struct ISAMH_filecat_s { /* filecategories, mostly block sizes */
29 int bsize; /* block size */
30 int mblocks; /* maximum keys before switching to larger sizes */
33 typedef struct ISAMH_M_s {
34 ISAMH_filecat filecat;
36 int (*compare_item)(const void *a, const void *b);
38 #define ISAMH_DECODE 0
39 #define ISAMH_ENCODE 1
40 void *(*code_start)(int mode);
41 void (*code_stop)(int mode, void *p);
42 void (*code_item)(int mode, void *p, char **dst, char **src);
43 void (*code_reset)(void *p);
49 typedef struct ISAMH_I_s { /* encapsulation of input data */
50 int (*read_item)(void *clientData, char **dst, int *insertMode);
54 ISAMH_M isamh_getmethod (void);
56 ISAMH isamh_open (BFiles bfs, const char *name, int writeflag, ISAMH_M method);
57 int isamh_close (ISAMH is);
58 ISAMH_P isamh_append (ISAMH is, ISAMH_P pos, ISAMH_I data);
59 /* corresponds to isc_merge */
62 ISAMH_PP isamh_pp_open (ISAMH is, ISAMH_P pos);
63 void isamh_pp_close (ISAMH_PP pp);
64 int isamh_read_item (ISAMH_PP pp, char **dst);
65 int isamh_pp_read (ISAMH_PP pp, void *buf);
66 int isamh_pp_num (ISAMH_PP pp);
68 int isamh_block_used (ISAMH is, int type);
69 int isamh_block_size (ISAMH is, int type);
72 #define isamh_type(x) ((x) & 7)
73 #define isamh_block(x) ((x) >> 3)
74 #define isamh_addr(blk,typ) (((blk)<<3)+(typ))
76 void isamh_buildfirstblock(ISAMH_PP pp);
77 void isamh_buildlaterblock(ISAMH_PP pp);
88 * Revision 1.3 1999-07-06 16:30:20 heikki
89 * IsamH startss to work - at least it builds indexes. Can not search yet...
91 * Revision 1.2 1999/07/06 09:37:04 heikki
92 * Working on isamh - not ready yet.
94 * Revision 1.1 1999/06/30 15:06:28 heikki
95 * copied from isamc.h, simplifying