aboutsummaryrefslogtreecommitdiffstats
path: root/libibex/index.h
diff options
context:
space:
mode:
Diffstat (limited to 'libibex/index.h')
-rw-r--r--libibex/index.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/libibex/index.h b/libibex/index.h
index c3c83c1bcf..0cef7948b3 100644
--- a/libibex/index.h
+++ b/libibex/index.h
@@ -27,6 +27,18 @@
#define INDEX_STAT
+struct _IBEXCursor {
+ struct _IBEXCursorClass *klass;
+ struct _IBEXIndex *index;
+};
+
+struct _IBEXCursorClass {
+ void (*close)(struct _IBEXCursor *);
+
+ guint32 (*next)(struct _IBEXCursor *);
+ char *(*next_key)(struct _IBEXCursor *, int *keylenptr);
+};
+
struct _IBEXIndex {
struct _IBEXIndexClass *klass;
struct _memcache *blocks;
@@ -62,6 +74,9 @@ struct _IBEXIndexClass {
/* get the key contents based on the keyid */
blockid_t (*get_data)(struct _IBEXIndex *, guint32 keyid, blockid_t *tail);
+
+ /* get a cursor for iterating over all contents */
+ struct _IBEXCursor *(*get_cursor)(struct _IBEXIndex *);
};
/* a storage class, stores lists of lists of id's */