68acc15082fc30d0b23c66d9dbbf8b3af036e1c3
[idzebra-moved-to-github.git] / include / rset.h
1 /*
2  * Copyright (C) 1994, Index Data I/S 
3  * All rights reserved.
4  * Sebastian Hammer, Adam Dickmeiss
5  *
6  * $Log: rset.h,v $
7  * Revision 1.2  1994-11-04 13:21:21  quinn
8  * Working.
9  *
10  * Revision 1.1  1994/11/03  14:13:22  quinn
11  * Result set manipulation
12  *
13  */
14
15 #ifndef RSET_H
16 #define RSET_H
17
18 typedef struct rset_control
19 {
20     char *desc; /* text description of set type (for debugging) */
21     char *buf;  /* state data stored by subsystem */
22     struct rset_control *(*f_create)(const struct rset_control *sel, void *parms);
23     int (*f_open)(struct rset_control *ct, int wflag);
24     void (*f_close)(struct rset_control *ct);
25     void (*f_delete)(struct rset_control *ct);
26     void (*f_rewind)(struct rset_control *ct);
27     int (*f_count)(struct rset_control *ct);
28     int (*f_read)(struct rset_control *ct, void *buf);
29     int (*f_write)(struct rset_control *ct, const void *buf);
30 } rset_control;
31
32 typedef struct rset
33 {
34     int is_open;
35     rset_control *control;
36 } rset, *RSET;
37
38 RSET rset_create(const rset_control *sel, void *parms);       /* parameters? */
39
40 /* int rset_open(RSET rs, int wflag); */
41 #define rset_open(rs, wflag) ((*(rs)->control->f_open)((rs)->control, (wflag)))
42
43 /* void rset_close(RSET rs); */
44 #define rset_close(rs) ((*(rs)->control->f_close)((rs)->control))
45
46 void rset_delete(RSET rs);
47
48 /* void rset_rewind(RSET rs); */
49 #define rset_rewind(rs, wflag) ((*(rs)->control->f_rewind)((rs)->control))
50
51 /* int rset_count(RSET rs); */
52 #define rset_count(rs, wflag) ((*(rs)->control->f_count)((rs)->control))
53
54 int rset_read(RSET rs, void *buf);   /* change parameters */
55 int rset_write(RSET rs, void *buf);  /* change parameters */
56
57 #endif