Changed prototype for chr_map_input - added const.
[idzebra-moved-to-github.git] / include / isamc.h
1 /*
2  * Copyright (c) 1995-1997, Index Data.
3  * See the file LICENSE for details.
4  * Sebastian Hammer, Adam Dickmeiss
5  *
6  * $Log: isamc.h,v $
7  * Revision 1.5  1997-09-05 15:30:00  adam
8  * Changed prototype for chr_map_input - added const.
9  * Added support for C++, headers uses extern "C" for public definitions.
10  *
11  * Revision 1.4  1996/11/08 11:08:01  adam
12  * New internal release.
13  *
14  * Revision 1.3  1996/11/01 13:35:03  adam
15  * New element, max_blocks_mem, that control how many blocks of max size
16  * to store in memory during isc_merge.
17  *
18  * Revision 1.2  1996/10/29  16:44:42  adam
19  * Added isc_type, isc_block macros.
20  *
21  * Revision 1.1  1996/10/29  13:40:37  adam
22  * First work.
23  *
24  */
25
26 #ifndef ISAMC_H
27 #define ISAMC_H
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 typedef struct ISAMC_s *ISAMC;
34 typedef int ISAMC_P;
35 typedef struct ISAMC_PP_s *ISAMC_PP;
36
37 typedef struct ISAMC_filecat_s {
38     int bsize;         /* block size */
39     int ifill;         /* initial fill */
40     int mfill;         /* minimum fill */
41     int mblocks;       /* maximum blocks */
42 } *ISAMC_filecat;
43
44 typedef struct ISAMC_M_s {
45     ISAMC_filecat filecat;
46
47     int (*compare_item)(const void *a, const void *b);
48
49 #define ISAMC_DECODE 0
50 #define ISAMC_ENCODE 1
51     void *(*code_start)(int mode);
52     void (*code_stop)(int mode, void *p);
53     void (*code_item)(int mode, void *p, char **dst, char **src);
54
55     int max_blocks_mem;
56     int debug;
57 } *ISAMC_M;
58
59 typedef struct ISAMC_I_s {
60     int (*read_item)(void *clientData, char **dst, int *insertMode);
61     void *clientData;
62 } *ISAMC_I;
63
64 ISAMC_M isc_getmethod (void);
65
66 ISAMC isc_open (const char *name, int writeflag, ISAMC_M method);
67 int isc_close (ISAMC is);
68 ISAMC_P isc_merge (ISAMC is, ISAMC_P pos, ISAMC_I data);
69
70 ISAMC_PP isc_pp_open (ISAMC is, ISAMC_P pos);
71 void isc_pp_close (ISAMC_PP pp);
72 int isc_read_item (ISAMC_PP pp, char **dst);
73 int isc_pp_read (ISAMC_PP pp, void *buf);
74 int isc_pp_num (ISAMC_PP pp);
75
76 #define isc_type(x) ((x) & 7)
77 #define isc_block(x) ((x) >> 3)
78
79 #ifdef __cplusplus
80 }
81 #endif
82
83 #endif