summaryrefslogtreecommitdiff
path: root/lib/rpmdb.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rpmdb.h')
-rw-r--r--lib/rpmdb.h48
1 files changed, 29 insertions, 19 deletions
diff --git a/lib/rpmdb.h b/lib/rpmdb.h
index 3c7aac2c8..78765bb15 100644
--- a/lib/rpmdb.h
+++ b/lib/rpmdb.h
@@ -3,7 +3,7 @@
/** \ingroup rpmdb dbi
* \file lib/rpmdb.h
- * Access RPM indices using Berkeley DB interface(s).
+ * RPM database API.
*/
#include <rpm/rpmtypes.h>
@@ -30,6 +30,14 @@ typedef enum rpmdbOpX_e {
RPMDB_OP_MAX = 4
} rpmdbOpX;
+typedef enum rpmdbCtrlOp_e {
+ RPMDB_CTRL_LOCK_RO = 1,
+ RPMDB_CTRL_UNLOCK_RO = 2,
+ RPMDB_CTRL_LOCK_RW = 3,
+ RPMDB_CTRL_UNLOCK_RW = 4,
+ RPMDB_CTRL_INDEXSYNC = 5
+} rpmdbCtrlOp;
+
/** \ingroup rpmdb
* Retrieve operation timestamp from rpm database.
* @param db rpm database
@@ -79,7 +87,7 @@ unsigned int rpmdbGetIteratorFileNum(rpmdbMatchIterator mi);
* @return 0 on success, 1 on failure (bad args)
*/
int rpmdbAppendIterator(rpmdbMatchIterator mi,
- const int * hdrNums, int nHdrNums);
+ const unsigned int * hdrNums, unsigned int nHdrNums);
/** \ingroup rpmdb
* Add pattern to iterator selector.
@@ -138,21 +146,6 @@ rpmdbMatchIterator rpmdbInitIterator(rpmdb db, rpmDbiTagVal rpmtag,
Header rpmdbNextIterator(rpmdbMatchIterator mi);
/** \ingroup rpmdb
- * Check for and exit on termination signals.
- */
-int rpmdbCheckSignals(void);
-
-/** \ingroup rpmdb
- * Check rpmdb signal handler for trapped signal and/or requested exit,
- * clean up any open iterators and databases on termination condition.
- * On non-zero exit any open references to rpmdb are invalid and cannot
- * be accessed anymore, calling process should terminate immediately.
- * @param terminate 0 to only check for signals, 1 to terminate anyway
- * @return 0 to continue, 1 if termination cleanup was done.
- */
-int rpmdbCheckTerminate(int terminate);
-
-/** \ingroup rpmdb
* Destroy rpm database iterator.
* @param mi rpm database iterator
* @return NULL always
@@ -171,13 +164,23 @@ rpmdbIndexIterator rpmdbIndexIteratorInit(rpmdb db, rpmDbiTag rpmtag);
* Get the next key - Warning! Keys are not zero terminated!
* Binary tags may even contain zero bytes
* @param ii index iterator
- * @param key adress to save the pointer to the key
- * @param keylen adress to save the length of the key to
+ * @param key address to save the pointer to the key
+ * @param keylen address to save the length of the key to
* @return 0 on success; != 0 on error or end of index
*/
int rpmdbIndexIteratorNext(rpmdbIndexIterator ii, const void ** key, size_t * keylen);
/** \ingroup rpmdb
+ * Get the next key into a tag data container.
+ * Caller is responsible for calling rpmtdFreeData() to freeing the
+ * data returned in keytd once done with it.
+ * @param ii index iterator
+ * @param keytd tag container to store the key in
+ * @return 0 on success; != 0 on error or end of index
+ */
+int rpmdbIndexIteratorNextTd(rpmdbIndexIterator ii, rpmtd keytd);
+
+/** \ingroup rpmdb
* Get number of entries for current key
* @param ii index iterator
* @return number of entries. 0 on error.
@@ -207,6 +210,13 @@ unsigned int rpmdbIndexIteratorTagNum(rpmdbIndexIterator ii, unsigned int nr);
*/
rpmdbIndexIterator rpmdbIndexIteratorFree(rpmdbIndexIterator ii);
+/** \ingroup rpmdb
+ * manipulate the rpm database
+ * @param db rpm database
+ * @param ctrl operation
+ * @return 0 on success; != 0 on error
+ */
+int rpmdbCtrl(rpmdb db, rpmdbCtrlOp ctrl);
#ifdef __cplusplus
}