Add cursor method for retrieving the underlying db index handle
authorPanu Matilainen <pmatilai@redhat.com>
Wed, 8 Jun 2011 15:44:39 +0000 (18:44 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Wed, 8 Jun 2011 15:44:39 +0000 (18:44 +0300)
lib/backend/db3.c
lib/backend/dbi.h

index e06aa96..38f14de 100644 (file)
@@ -354,6 +354,11 @@ unsigned int dbiCursorCount(dbiCursor dbc)
     return count;
 }
 
+dbiIndex dbiCursorIndex(dbiCursor dbc)
+{
+    return (dbc != NULL) ? dbc->dbi : NULL;
+}
+
 int dbiByteSwapped(dbiIndex dbi)
 {
     DB * db = dbi->dbi_db;
index 50b9751..848f288 100644 (file)
@@ -249,6 +249,13 @@ int dbiCursorDel(dbiCursor dbc, DBT * key, DBT * data, unsigned int flags);
 RPM_GNUC_INTERNAL
 unsigned int dbiCursorCount(dbiCursor dbc);
 
+/** \ingroup dbi
+ * Retrieve underlying index database handle.
+ * @param dbcursor     database cursor
+ * @return             index database handle
+ */
+RPM_GNUC_INTERNAL
+dbiIndex dbiCursorIndex(dbiCursor dbc);
 #ifdef __cplusplus
 }
 #endif