bcde9d8e723e43417583f1fff052a8104bd08fc3
[idzebra-moved-to-github.git] / include / isams.h
1 /*
2  * Copyright (c) 1995-1999, Index Data.
3  * See the file LICENSE for details.
4  * Sebastian Hammer, Adam Dickmeiss
5  *
6  * $Id: isams.h,v 1.2 1999-07-14 10:59:26 adam Exp $
7  */
8 #ifndef ISAMS_H
9 #define ISAMS_H
10
11 #include <bfile.h>
12
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16
17 typedef struct ISAMS_s *ISAMS;
18 typedef int ISAMS_P;
19 typedef struct ISAMS_PP_s *ISAMS_PP;
20
21 typedef struct ISAMS_M_s {
22     int (*compare_item)(const void *a, const void *b);
23
24 #define ISAMC_DECODE 0
25 #define ISAMC_ENCODE 1
26     void *(*code_start)(int mode);
27     void (*code_stop)(int mode, void *p);
28     void (*code_item)(int mode, void *p, char **dst, char **src);
29
30     int debug;
31     int block_size;
32 } *ISAMS_M;
33
34 typedef struct ISAMS_I_s {
35     int (*read_item)(void *clientData, char **dst, int *insertMode);
36     void *clientData;
37 } *ISAMS_I;
38
39 void isams_getmethod (ISAMS_M me);
40
41 ISAMS isams_open (BFiles bfs, const char *name, int writeflag,
42                   ISAMS_M method);
43 int isams_close (ISAMS is);
44 ISAMS_P isams_merge (ISAMS is, ISAMS_I data);
45 ISAMS_PP isams_pp_open (ISAMS is, ISAMS_P pos);
46 void isams_pp_close (ISAMS_PP pp);
47 int isams_read_item (ISAMS_PP pp, char **dst);
48 int isams_pp_read (ISAMS_PP pp, void *buf);
49 int isams_pp_num (ISAMS_PP pp);
50
51 #ifdef __cplusplus
52 }
53 #endif
54
55 #endif