First work.
[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.1  1996-10-29 13:40:37  adam
8  * First work.
9  *
10  */
11
12 #ifndef ISAMC_H
13 #define ISAMC_H
14
15 typedef struct ISAMC_s *ISAMC;
16 typedef int ISAMC_P;
17 typedef struct ISAMC_PP_s *ISAMC_PP;
18
19 typedef struct ISAMC_filecat_s {
20     int bsize;         /* block size */
21     int ifill;         /* initial fill */
22     int mfill;         /* minimum fill */
23     int mblocks;       /* maximum blocks */
24 } *ISAMC_filecat;
25
26 typedef struct ISAMC_M_s {
27     ISAMC_filecat filecat;
28
29     int (*compare_item)(const void *a, const void *b);
30
31 #define ISAMC_DECODE 0
32 #define ISAMC_ENCODE 1
33     void *(*code_start)(int mode);
34     void (*code_stop)(int mode, void *p);
35     void (*code_item)(int mode, void *p, char **dst, char **src);
36
37     int debug;
38 } *ISAMC_M;
39
40 typedef struct ISAMC_I_s {
41     int (*read_item)(void *clientData, char **dst, int *insertMode);
42     void *clientData;
43 } *ISAMC_I;
44
45 ISAMC_M isc_getmethod (void);
46
47 ISAMC isc_open (const char *name, int writeflag, ISAMC_M method);
48 int isc_close (ISAMC is);
49 ISAMC_P isc_merge (ISAMC is, ISAMC_P pos, ISAMC_I data);
50
51 ISAMC_PP isc_pp_open (ISAMC is, ISAMC_P pos);
52 void isc_pp_close (ISAMC_PP pp);
53 int isc_read_item (ISAMC_PP pp, char **dst);
54 int isc_read_key (ISAMC_PP pp, void *buf);
55 int isc_numkeys (ISAMC_PP pp);
56
57 #endif