X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;f=include%2Frset.h;h=b6da79552f6ce877b537be42d53d2c12d38d5397;hb=1bb217ab477284fd7fee47f19a6e8a780fa2bb50;hp=172ce37d4f9907ef54dc4a104b5e1502e0e0f23a;hpb=b85319b88e7721ed86bbe4981839c6d2a1afea64;p=idzebra-moved-to-github.git diff --git a/include/rset.h b/include/rset.h index 172ce37..b6da795 100644 --- a/include/rset.h +++ b/include/rset.h @@ -1,4 +1,4 @@ -/* $Id: rset.h,v 1.20 2004-01-16 18:04:33 heikki Exp $ +/* $Id: rset.h,v 1.27 2004-08-06 12:28:22 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 Index Data Aps @@ -43,17 +43,23 @@ struct rset_control void (*f_close)(RSFD rfd); void (*f_delete)(RSET ct); void (*f_rewind)(RSFD rfd); - int (*f_forward)(RSFD rfd, void *buf, const void *untilbuf); - int (*f_count)(RSET ct); + int (*f_forward)(RSET ct, RSFD rfd, void *buf, int *term_index, + int (*cmpfunc)(const void *p1, const void *p2), + const void *untilbuf); + void (*f_pos)(RSFD rfd, double *current, double *total); + /* returns -1,-1 if pos function not implemented for this type */ int (*f_read)(RSFD rfd, void *buf, int *term_index); int (*f_write)(RSFD rfd, const void *buf); }; -int rset_default_forward(RSFD rfd, void *buf, const void *untilbuf); +int rset_default_forward(RSET ct, RSFD rfd, void *buf, int *term_index, + int (*cmpfunc)(const void *p1, const void *p2), + const void *untilbuf); +void rset_default_pos(RSFD rfd, double *current, double *total); struct rset_term { char *name; - int nn; + zint nn; char *flags; int count; int type; @@ -93,10 +99,15 @@ RSET rset_dup (RSET rs); /* void rset_rewind(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) +/* int rset_forward(RSET rs, void *buf, int *indx, void *untilbuf); */ +#define rset_forward(rs, fd, buf, indx, cmpfunc, untilbuf) \ + (*(rs)->control->f_forward)((rs), (fd), (buf), (indx), (cmpfunc), (untilbuf)) -/* int rset_read(RSET rs, void *buf); */ +/* int rset_pos(RSET rs, RSFD fd, double *current, double *total); */ +#define rset_pos(rs,fd,cur,tot) \ + (*(rs)->control->f_pos)( (fd),(cur),(tot)) + +/* int rset_read(RSET rs, void *buf, int *indx); */ #define rset_read(rs, fd, buf, indx) (*(rs)->control->f_read)((fd), (buf), indx) /* int rset_write(RSET rs, const void *buf); */