X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=include%2Frset.h;h=e6bef930149ee4909bd2a585dd091edf903e762b;hb=6c836c5e8eff1e57360dd0a33197c91301277c2c;hp=79b4ae64a58e382ce9f6f533fffb1ab7ee40f377;hpb=40ca1d08c1d83b92e0b90951d918b252c61c63b2;p=idzebra-moved-to-github.git diff --git a/include/rset.h b/include/rset.h index 79b4ae6..e6bef93 100644 --- a/include/rset.h +++ b/include/rset.h @@ -4,7 +4,21 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: rset.h,v $ - * Revision 1.8 1995-10-06 14:37:53 adam + * 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. + * + * Revision 1.9 1995/10/10 14:00:01 adam + * Function rset_open changed its wflag parameter to general flags. + * + * Revision 1.8 1995/10/06 14:37:53 adam * New result set method: r_score. * Local no (sysno) and score is transferred to retrieveCtrl. * @@ -41,16 +55,18 @@ typedef void *RSFD; +typedef struct rset *RSET; + typedef struct rset_control { char *desc; /* text description of set type (for debugging) */ - void *buf; /* state data stored by subsystem */ - struct rset_control *(*f_create)(const struct rset_control *sel, void *parms); - RSFD (*f_open)(struct rset_control *ct, int wflag); + 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)(struct rset_control *ct); + void (*f_delete)(RSET ct); void (*f_rewind)(RSFD rfd); - int (*f_count)(struct rset_control *ct); + int (*f_count)(RSET ct); int (*f_read)(RSFD rfd, void *buf); int (*f_write)(RSFD rfd, const void *buf); int (*f_score)(RSFD rfd, int *score); @@ -58,13 +74,21 @@ typedef struct rset_control typedef struct rset { - rset_control *control; -} rset, *RSET; + const rset_control *control; + int flags; + void *buf; +} rset; + +#define RSETF_READ 0 +#define RSETF_WRITE 1 + +#define RSETF_SORT_SYSNO 0 +#define RSETF_SORT_RANK 2 RSET rset_create(const rset_control *sel, void *parms); /* parameters? */ /* int rset_open(RSET rs, int wflag); */ -#define rset_open(rs, wflag) ((*(rs)->control->f_open)((rs)->control, (wflag))) +#define rset_open(rs, wflag) ((*(rs)->control->f_open)((rs), (wflag))) /* void rset_close(RSET rs); */ #define rset_close(rs, rfd) ((*(rs)->control->f_close)((rfd))) @@ -75,7 +99,7 @@ void rset_delete(RSET rs); #define rset_rewind(rs, rfd) ((*(rs)->control->f_rewind)((rfd))) /* int rset_count(RSET rs); */ -#define rset_count(rs) ((*(rs)->control->f_count)((rs)->control)) +#define rset_count(rs) ((*(rs)->control->f_count)(rs)) /* int rset_read(RSET rs, void *buf); */ #define rset_read(rs, fd, buf) ((*(rs)->control->f_read)((fd), (buf))) @@ -86,4 +110,12 @@ void rset_delete(RSET rs); /* 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) #endif