1.3.40
[idzebra-moved-to-github.git] / include / rset.h
index 5830b4e..817bb7f 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: rset.h,v 1.19 2002-08-02 19:26:55 adam Exp $
+/* $Id: rset.h,v 1.23.2.1 2006-08-14 10:38:56 adam Exp $
    Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
    Index Data Aps
 
@@ -15,9 +15,9 @@ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 for more details.
 
 You should have received a copy of the GNU General Public License
-along with Zebra; see the file LICENSE.zebra.  If not, write to the
-Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
 */
 
 
@@ -43,11 +43,21 @@ struct rset_control
     void (*f_close)(RSFD rfd);
     void (*f_delete)(RSET ct);
     void (*f_rewind)(RSFD rfd);
-    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, int *current, int *total);
+       /* FIXME - Should be 64-bit ints !*/
+       /* 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(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, int *current, int *total);
+
 struct rset_term {
     char *name;
     int  nn;
@@ -90,10 +100,14 @@ RSET rset_dup (RSET rs);
 /* void rset_rewind(RSET rs); */
 #define rset_rewind(rs, rfd) (*(rs)->control->f_rewind)((rfd))
 
+/* 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_count(RSET rs); */
 #define rset_count(rs) (*(rs)->control->f_count)(rs)
 
-/* int rset_read(RSET rs, void *buf); */
+/* 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); */