2 * Copyright (C) 1994-1999, Index Data
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.16 1999-02-02 14:50:38 adam
8 * Updated WIN32 code specific sections. Changed header.
10 * Revision 1.15 1998/03/05 08:37:44 adam
11 * New result set model.
13 * Revision 1.14 1998/02/10 11:56:46 adam
14 * Implemented rset_dup.
16 * Revision 1.13 1997/12/18 10:54:24 adam
17 * New method result set method rs_hits that returns the number of
18 * hits in result-set (if known). The ranked result set returns real
19 * number of hits but only when not combined with other operands.
21 * Revision 1.12 1997/09/05 15:30:03 adam
22 * Changed prototype for chr_map_input - added const.
23 * Added support for C++, headers uses extern "C" for public definitions.
25 * Revision 1.11 1995/12/11 09:07:53 adam
26 * New rset member 'flag', that holds various flags about a result set -
27 * currently 'volatile' (set is register dependent) and 'ranked' (set is
29 * New set types sand/sor/snot. They handle and/or/not for ranked and
30 * semi-ranked result sets.
32 * Revision 1.10 1995/10/12 12:40:36 adam
33 * Private info (buf) moved from struct rset_control to struct rset.
34 * Member control in rset is statically set in rset_create.
36 * Revision 1.9 1995/10/10 14:00:01 adam
37 * Function rset_open changed its wflag parameter to general flags.
39 * Revision 1.8 1995/10/06 14:37:53 adam
40 * New result set method: r_score.
41 * Local no (sysno) and score is transferred to retrieveCtrl.
43 * Revision 1.7 1995/09/07 13:58:08 adam
44 * New parameter: result-set file descriptor (RSFD) to support multiple
45 * positions within the same result-set.
46 * Boolean operators: and, or, not implemented.
48 * Revision 1.6 1995/09/06 16:10:58 adam
49 * More work on boolean sets.
51 * Revision 1.5 1995/09/04 15:20:13 adam
52 * More work on temp sets. is_open member removed.
54 * Revision 1.4 1995/09/04 09:09:52 adam
55 * String arg in dict lookup is const.
58 * Revision 1.3 1994/11/22 13:15:27 quinn
61 * Revision 1.2 1994/11/04 13:21:21 quinn
64 * Revision 1.1 1994/11/03 14:13:22 quinn
65 * Result set manipulation
79 typedef struct rset *RSET;
80 typedef struct rset_term *RSET_TERM;
84 char *desc; /* text description of set type (for debugging) */
85 void *(*f_create)(RSET ct, const struct rset_control *sel, void *parms);
86 RSFD (*f_open)(RSET ct, int wflag);
87 void (*f_close)(RSFD rfd);
88 void (*f_delete)(RSET ct);
89 void (*f_rewind)(RSFD rfd);
90 int (*f_count)(RSET ct);
91 int (*f_read)(RSFD rfd, void *buf, int *term_index);
92 int (*f_write)(RSFD rfd, const void *buf);
103 const struct rset_control *control;
107 RSET_TERM *rset_terms;
111 RSET_TERM rset_term_create (const char *name, int length, const char *flags);
112 void rset_term_destroy (RSET_TERM t);
113 RSET_TERM rset_term_dup (RSET_TERM t);
116 #define RSETF_WRITE 1
118 RSET rset_create(const struct rset_control *sel, void *parms);
121 /* int rset_open(RSET rs, int wflag); */
122 #define rset_open(rs, wflag) (*(rs)->control->f_open)((rs), (wflag))
124 /* void rset_close(RSET rs); */
125 #define rset_close(rs, rfd) (*(rs)->control->f_close)(rfd)
127 void rset_delete(RSET rs);
129 RSET rset_dup (RSET rs);
131 /* void rset_rewind(RSET rs); */
132 #define rset_rewind(rs, rfd) (*(rs)->control->f_rewind)((rfd))
134 /* int rset_count(RSET rs); */
135 #define rset_count(rs) (*(rs)->control->f_count)(rs)
137 /* int rset_read(RSET rs, void *buf); */
138 #define rset_read(rs, fd, buf, indx) (*(rs)->control->f_read)((fd), (buf), indx)
140 /* int rset_write(RSET rs, const void *buf); */
141 #define rset_write(rs, fd, buf) (*(rs)->control->f_write)((fd), (buf))
143 /* int rset_type (RSET) */
144 #define rset_type(rs) ((rs)->control->desc)
146 #define RSET_FLAG_VOLATILE 1
148 #define rset_is_volatile(rs) ((rs)->flags & RSET_FLAG_VOLATILE)