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