summaryrefslogtreecommitdiff
path: root/lib/tdb/include/tdb.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tdb/include/tdb.h')
-rw-r--r--lib/tdb/include/tdb.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/tdb/include/tdb.h b/lib/tdb/include/tdb.h
index 5eb95625da..d19439e760 100644
--- a/lib/tdb/include/tdb.h
+++ b/lib/tdb/include/tdb.h
@@ -814,6 +814,28 @@ int tdb_check(struct tdb_context *tdb,
int (*check) (TDB_DATA key, TDB_DATA data, void *private_data),
void *private_data);
+/**
+ * @brief Dump all possible records in a corrupt database.
+ *
+ * This is the only way to get data out of a database where tdb_check() fails.
+ * It will call walk() with anything which looks like a database record; this
+ * may well include invalid, incomplete or duplicate records.
+ *
+ * @param[in] tdb The database to check.
+ *
+ * @param[in] walk The walk function to use.
+ *
+ * @param[in] private_data the private data to pass to the walk function.
+ *
+ * @return 0 on success, -1 on error with error code set.
+ *
+ * @see tdb_error()
+ * @see tdb_errorstr()
+ */
+int tdb_rescue(struct tdb_context *tdb,
+ void (*walk) (TDB_DATA key, TDB_DATA data, void *private_data),
+ void *private_data);
+
/* @} ******************************************************************/
/* Low level locking functions: use with care */