2 * Copyright (C) 1994-1999, Index Data
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.11 1999-02-02 14:51:36 adam
8 * Updated WIN32 code specific sections. Changed header.
10 * Revision 1.10 1998/03/05 08:36:28 adam
11 * New result set model.
13 * Revision 1.9 1997/12/18 10:54:25 adam
14 * New method result set method rs_hits that returns the number of
15 * hits in result-set (if known). The ranked result set returns real
16 * number of hits but only when not combined with other operands.
18 * Revision 1.8 1996/10/29 13:55:24 adam
19 * Include of zebrautl.h instead of alexutil.h.
21 * Revision 1.7 1995/12/11 09:15:25 adam
22 * New set types: sand/sor/snot - ranked versions of and/or/not in
23 * ranked/semi-ranked result sets.
24 * Note: the snot not finished yet.
25 * New rset member: flag.
26 * Bug fix: r_delete in rsrel.c did free bad memory block.
28 * Revision 1.6 1995/10/12 12:41:57 adam
29 * Private info (buf) moved from struct rset_control to struct rset.
30 * Bug fixes in relevance.
32 * Revision 1.5 1995/10/10 14:00:04 adam
33 * Function rset_open changed its wflag parameter to general flags.
35 * Revision 1.4 1995/10/06 14:38:06 adam
36 * New result set method: r_score.
37 * Local no (sysno) and score is transferred to retrieveCtrl.
39 * Revision 1.3 1995/09/08 14:52:42 adam
40 * Work on relevance feedback.
42 * Revision 1.2 1995/09/07 13:58:43 adam
43 * New parameter: result-set file descriptor (RSFD) to support multiple
44 * positions within the same result-set.
45 * Boolean operators: and, or, not implemented.
47 * Revision 1.1 1995/09/06 10:35:44 adam
48 * Null set implemented.
56 static void *r_create(RSET ct, const struct rset_control *sel, void *parms);
57 static RSFD r_open (RSET ct, int flag);
58 static void r_close (RSFD rfd);
59 static void r_delete (RSET ct);
60 static void r_rewind (RSFD rfd);
61 static int r_count (RSET ct);
62 static int r_read (RSFD rfd, void *buf, int *term_index);
63 static int r_write (RSFD rfd, const void *buf);
65 static const struct rset_control control =
78 const struct rset_control *rset_kind_null = &control;
80 static void *r_create(RSET ct, const struct rset_control *sel, void *parms)
82 rset_null_parms *null_parms = parms;
84 ct->no_rset_terms = 1;
85 ct->rset_terms = xmalloc (sizeof(*ct->rset_terms));
87 ct->rset_terms[0] = null_parms->rset_term;
89 ct->rset_terms[0] = rset_term_create ("term", -1, "rank-0");
90 ct->rset_terms[0]->nn = 0;
95 static RSFD r_open (RSET ct, int flag)
97 if (flag & RSETF_WRITE)
99 logf (LOG_FATAL, "NULL set type is read-only");
105 static void r_close (RSFD rfd)
109 static void r_delete (RSET ct)
111 rset_term_destroy (ct->rset_terms[0]);
112 xfree (ct->rset_terms);
115 static void r_rewind (RSFD rfd)
117 logf (LOG_DEBUG, "rsnull_rewind");
120 static int r_count (RSET ct)
125 static int r_read (RSFD rfd, void *buf, int *term_index)
131 static int r_write (RSFD rfd, const void *buf)
133 logf (LOG_FATAL, "NULL set type is read-only");