f7029a4760ee0411c7ab7d81801ada8858823676
[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.3  1994-11-22 13:15:27  quinn
8  * Simple
9  *
10  * Revision 1.2  1994/11/04  13:21:21  quinn
11  * Working.
12  *
13  * Revision 1.1  1994/11/03  14:13:22  quinn
14  * Result set manipulation
15  *
16  */
17
18 #ifndef RSET_H
19 #define RSET_H
20
21 typedef struct rset_control
22 {
23     char *desc; /* text description of set type (for debugging) */
24     char *buf;  /* state data stored by subsystem */
25     struct rset_control *(*f_create)(const struct rset_control *sel, void *parms);
26     int (*f_open)(struct rset_control *ct, int wflag);
27     void (*f_close)(struct rset_control *ct);
28     void (*f_delete)(struct rset_control *ct);
29     void (*f_rewind)(struct rset_control *ct);
30     int (*f_count)(struct rset_control *ct);
31     int (*f_read)(struct rset_control *ct, void *buf);
32     int (*f_write)(struct rset_control *ct, const void *buf);
33 } rset_control;
34
35 typedef struct rset
36 {
37     int is_open;
38     rset_control *control;
39 } rset, *RSET;
40
41 RSET rset_create(const rset_control *sel, void *parms);       /* parameters? */
42
43 /* int rset_open(RSET rs, int wflag); */
44 #define rset_open(rs, wflag) ((*(rs)->control->f_open)((rs)->control, (wflag)))
45
46 /* void rset_close(RSET rs); */
47 #define rset_close(rs) ((*(rs)->control->f_close)((rs)->control))
48
49 void rset_delete(RSET rs);
50
51 /* void rset_rewind(RSET rs); */
52 #define rset_rewind(rs, wflag) ((*(rs)->control->f_rewind)((rs)->control))
53
54 /* int rset_count(RSET rs); */
55 #define rset_count(rs, wflag) ((*(rs)->control->f_count)((rs)->control))
56
57 /* int rset_read(RSET rs, void *buf); */   /* change parameters */
58 #define rset_read(rs, buf) ((*(rs)->control->f_read)((rs)->control, (buf)))
59
60
61 int rset_write(RSET rs, void *buf);  /* change parameters */
62
63 #endif