2 * Copyright (c) 1995-1997, Index Data.
3 * See the file LICENSE for details.
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.9 1999-07-14 10:59:26 adam
8 * Changed functions isc_getmethod, isams_getmethod.
9 * Improved fatal error handling (such as missing EXPLAIN schema).
11 * Revision 1.8 1999/06/30 09:08:23 adam
12 * Added coder to reset.
14 * Revision 1.7 1998/03/13 15:30:50 adam
15 * New functions isc_block_used and isc_block_size. Fixed 'leak'
18 * Revision 1.6 1997/09/17 12:19:10 adam
19 * Zebra version corresponds to YAZ version 1.4.
20 * Changed Zebra server so that it doesn't depend on global common_resource.
22 * Revision 1.5 1997/09/05 15:30:00 adam
23 * Changed prototype for chr_map_input - added const.
24 * Added support for C++, headers uses extern "C" for public definitions.
26 * Revision 1.4 1996/11/08 11:08:01 adam
27 * New internal release.
29 * Revision 1.3 1996/11/01 13:35:03 adam
30 * New element, max_blocks_mem, that control how many blocks of max size
31 * to store in memory during isc_merge.
33 * Revision 1.2 1996/10/29 16:44:42 adam
34 * Added isc_type, isc_block macros.
36 * Revision 1.1 1996/10/29 13:40:37 adam
50 typedef struct ISAMC_s *ISAMC;
52 typedef struct ISAMC_PP_s *ISAMC_PP;
54 typedef struct ISAMC_filecat_s {
55 int bsize; /* block size */
56 int ifill; /* initial fill */
57 int mfill; /* minimum fill */
58 int mblocks; /* maximum blocks */
61 typedef struct ISAMC_M_s {
62 ISAMC_filecat filecat;
64 int (*compare_item)(const void *a, const void *b);
66 #define ISAMC_DECODE 0
67 #define ISAMC_ENCODE 1
68 void *(*code_start)(int mode);
69 void (*code_stop)(int mode, void *p);
70 void (*code_item)(int mode, void *p, char **dst, char **src);
71 void (*code_reset)(void *p);
77 typedef struct ISAMC_I_s {
78 int (*read_item)(void *clientData, char **dst, int *insertMode);
82 void isc_getmethod (ISAMC_M m);
84 ISAMC isc_open (BFiles bfs, const char *name, int writeflag, ISAMC_M method);
85 int isc_close (ISAMC is);
86 ISAMC_P isc_merge (ISAMC is, ISAMC_P pos, ISAMC_I data);
88 ISAMC_PP isc_pp_open (ISAMC is, ISAMC_P pos);
89 void isc_pp_close (ISAMC_PP pp);
90 int isc_read_item (ISAMC_PP pp, char **dst);
91 int isc_pp_read (ISAMC_PP pp, void *buf);
92 int isc_pp_num (ISAMC_PP pp);
94 int isc_block_used (ISAMC is, int type);
95 int isc_block_size (ISAMC is, int type);
97 #define isc_type(x) ((x) & 7)
98 #define isc_block(x) ((x) >> 3)