2 * Copyright (c) 1995-2000, Index Data.
3 * See the file LICENSE for details.
5 * ISAM-G - Generic interface to all our ISAM types
9 * Detailed log at the end of the file
16 /* #include <bfile.h> */
20 typedef struct ISAMG_s *ISAMG;
22 typedef struct ISAMG_PP_s *ISAMG_PP;
25 /* File categories etc are no business of users of ISAM-G (or what?) */
26 typedef struct ISAMG_filecat_s { /* filecategories, mostly block sizes */
27 int bsize; /* block size */
28 int mblocks; /* maximum keys before switching to larger sizes */
34 /* The (delta?)encoding will be encapsulated so deep in the isams that */
35 /* nobody needs to see it here... If different encodings needed, make */
38 typedef struct ISAMG_M_s {
39 ISAMG_filecat filecat;
41 int (*compare_item)(const void *a, const void *b);
43 #define ISAMG_DECODE 0
44 #define ISAMG_ENCODE 1
45 void *(*code_start)(int mode);
46 void (*code_stop)(int mode, void *p);
47 void (*code_item)(int mode, void *p, char **dst, char **src);
48 void (*code_reset)(void *p);
56 /* Is this needed? Shouldn't they all be using the same encapsulation */
58 typedef struct ISAMG_I_s { /* encapsulation of input data */
59 int (*read_item)(void *clientData, char **dst, int *insertMode);
65 ISAMG_M isamg_getmethod (ISAMG_M me);
66 /* Does anyone really need this method thing ?? */
69 ISAMG isamg_open (BFiles bfs, int writeflag, char *isam_type_name, Res res);
71 int isamg_close (ISAMG is);
73 ISAMG_P isamg_append (ISAMG is, ISAMG_P pos, ISAMG_I data);
74 /* This may be difficult to generalize! */
77 ISAMG_PP isamg_pp_open (ISAMG is, ISAMG_P pos);
78 void isamg_pp_close (ISAMG_PP pp);
79 /* int isamg_read_item (ISAMG_PP pp, char **dst); */
80 /* int isamg_read_main_item (ISAMG_PP pp, char **dst); */
81 int isamg_pp_read (ISAMG_PP pp, void *buf);
82 int isamg_pp_num (ISAMG_PP pp);
85 /* all internal stuff */
86 int isamg_block_used (ISAMG is, int type);
87 int isamg_block_size (ISAMG is, int type);
90 #define isamg_type(x) ((x) & 7)
91 #define isamg_block(x) ((x) >> 3)
92 #define isamg_addr(blk,typ) (((blk)<<3)+(typ))
94 void isamg_buildfirstblock(ISAMG_PP pp);
95 void isamg_buildlaterblock(ISAMG_PP pp);
105 * Revision 1.1 2001-01-16 19:05:11 heikki
106 * Started to add isamg