/*
- * Copyright (C) 1994-1995, Index Data I/S
+ * Copyright (C) 1994-1997, Index Data I/S
* All rights reserved.
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: rset.h,v $
- * Revision 1.10 1995-10-12 12:40:36 adam
+ * Revision 1.12 1997-09-05 15:30:03 adam
+ * Changed prototype for chr_map_input - added const.
+ * Added support for C++, headers uses extern "C" for public definitions.
+ *
+ * Revision 1.11 1995/12/11 09:07:53 adam
+ * New rset member 'flag', that holds various flags about a result set -
+ * currently 'volatile' (set is register dependent) and 'ranked' (set is
+ * ranked).
+ * New set types sand/sor/snot. They handle and/or/not for ranked and
+ * semi-ranked result sets.
+ *
+ * Revision 1.10 1995/10/12 12:40:36 adam
* Private info (buf) moved from struct rset_control to struct rset.
* Member control in rset is statically set in rset_create.
*
#include <stdlib.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
typedef void *RSFD;
typedef struct rset *RSET;
typedef struct rset_control
{
char *desc; /* text description of set type (for debugging) */
- void *(*f_create)(const struct rset_control *sel, void *parms);
+ void *(*f_create)(const struct rset_control *sel, void *parms,
+ int *flags);
RSFD (*f_open)(RSET ct, int wflag);
void (*f_close)(RSFD rfd);
void (*f_delete)(RSET ct);
typedef struct rset
{
const rset_control *control;
+ int flags;
void *buf;
} rset;
/* int rset_score(RSET rs, int *buf); */
#define rset_score(rs, fd, score) ((*(rs)->control->f_score)((fd), (score)))
+/* int rset_type (RSET) */
+#define rset_type(rs) ((rs)->control->desc)
+
+#define RSET_FLAG_VOLATILE 1
+#define RSET_FLAG_RANKED 2
+
+#define rset_is_volatile(rs) ((rs)->flags & RSET_FLAG_VOLATILE)
+#define rset_is_ranked(rs) ((rs)->flags & RSET_FLAG_RANKED)
+
+#ifdef __cplusplus
+}
+#endif
+
#endif