diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2010-04-01 11:13:37 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2010-04-01 11:13:37 +0300 |
commit | f30e6d409a19a943224d6697a06dd1996bc61d72 (patch) | |
tree | 26c897dacbe5d04c0f01fe5348b877e99507f69e /lib/rpmdb_internal.h | |
parent | 12236b58b62c0c21048aff843624d7623d43fda7 (diff) | |
download | librpm-tizen-f30e6d409a19a943224d6697a06dd1996bc61d72.tar.gz librpm-tizen-f30e6d409a19a943224d6697a06dd1996bc61d72.tar.bz2 librpm-tizen-f30e6d409a19a943224d6697a06dd1996bc61d72.zip |
Split dbiIndex out of rpmdb_internal.h into header of its own
- the dbi presents an internal api of its own, and deserves a separate
header (baby steps to making dbiIndex opaque outside the backend)
- move dbiVerify() to the backend where it belongs
- mark all the dbiFoo() functions as internal
Diffstat (limited to 'lib/rpmdb_internal.h')
-rw-r--r-- | lib/rpmdb_internal.h | 186 |
1 files changed, 1 insertions, 185 deletions
diff --git a/lib/rpmdb_internal.h b/lib/rpmdb_internal.h index 7c0d6e0a3..7625a4d51 100644 --- a/lib/rpmdb_internal.h +++ b/lib/rpmdb_internal.h @@ -7,51 +7,7 @@ #include <rpm/rpmsw.h> #include <rpm/rpmtypes.h> #include <rpm/rpmutil.h> - -typedef struct _dbiIndex * dbiIndex; - -/** \ingroup dbi - * Describes an index database (implemented on Berkeley db functionality). - */ -struct _dbiIndex { - const char * dbi_file; /*!< file component of path */ - - int dbi_ecflags; /*!< db_env_create flags */ - int dbi_cflags; /*!< db_create flags */ - int dbi_oeflags; /*!< common (db,dbenv}->open flags */ - int dbi_eflags; /*!< dbenv->open flags */ - int dbi_oflags; /*!< db->open flags */ - int dbi_tflags; /*!< dbenv->txn_begin flags */ - - int dbi_type; /*!< db index type */ - unsigned dbi_mode; /*!< mode to use on open */ - int dbi_perms; /*!< file permission to use on open */ - - int dbi_verify_on_close; - int dbi_use_dbenv; /*!< use db environment? */ - int dbi_permit_dups; /*!< permit duplicate entries? */ - int dbi_no_fsync; /*!< no-op fsync for db */ - int dbi_no_dbsync; /*!< don't call dbiSync */ - int dbi_lockdbfd; /*!< do fcntl lock on db fd */ - int dbi_byteswapped; - - /* dbenv parameters */ - /* XXX db-4.3.14 adds dbenv as 1st arg. */ - int dbi_verbose; - /* mpool sub-system parameters */ - int dbi_mmapsize; /*!< (10Mb) */ - int dbi_cachesize; /*!< (128Kb) */ - /* dbinfo parameters */ - int dbi_pagesize; /*!< (fs blksize) */ - - rpmdb dbi_rpmdb; /*!< the parent rpm database */ - rpmTag dbi_rpmtag; /*!< rpm tag used for index */ - int dbi_jlen; /*!< size of join key */ - - DB * dbi_db; /*!< Berkeley DB * handle */ - DB_TXN * dbi_txnid; /*!< Bekerley DB_TXN * transaction id */ - void * dbi_stats; /*!< Berkeley db statistics */ -}; +#include "lib/backend/dbi.h" /** \ingroup rpmdb * Describes the collection of index databases used by rpm. @@ -96,146 +52,6 @@ enum rpmdbFlags { extern "C" { #endif -/** \ingroup dbi - * Return new configured index database handle instance. - * @param rpmdb rpm database - * @param rpmtag rpm tag - * @return index database handle - */ -RPM_GNUC_INTERNAL -dbiIndex dbiNew(rpmdb rpmdb, rpmTag rpmtag); - -/** \ingroup dbi - * Destroy index database handle instance. - * @param dbi index database handle - * @return NULL always - */ -RPM_GNUC_INTERNAL -dbiIndex dbiFree( dbiIndex dbi); - -/** \ingroup dbi - * Format dbi open flags for debugging print. - * @param dbflags db open flags - * @param print_dbenv_flags format db env flags instead? - * @return formatted flags (malloced) - */ -RPM_GNUC_INTERNAL -char * prDbiOpenFlags(int dbflags, int print_dbenv_flags); - -/** \ingroup dbi - * Actually open the database of the index. - * @param db rpm database - * @param rpmtag rpm tag - * @param dbiIndex address of index database handle - * @return 0 on success - */ -RPM_GNUC_INTERNAL -int dbiOpenDB(rpmdb rpmdb, rpmTag rpmtag, dbiIndex * dbip); - - -/* FIX: vector annotations */ -/** \ingroup dbi - * Open a database cursor. - * @param dbi index database handle - * @retval dbcp returned database cursor - * @param flags DB_WRITECURSOR if writing, or 0 - * @return 0 on success - */ -RPM_GNUC_INTERNAL -int dbiCopen(dbiIndex dbi, DBC ** dbcp, unsigned int flags); - -/** \ingroup dbi - * Close a database cursor. - * @param dbi index database handle - * @param dbcursor database cursor - * @param flags (unused) - * @return 0 on success - */ -RPM_GNUC_INTERNAL -int dbiCclose(dbiIndex dbi, DBC * dbcursor, unsigned int flags); - -/** \ingroup dbi - * Delete (key,data) pair(s) from index database. - * @param dbi index database handle - * @param dbcursor database cursor (NULL will use db->del) - * @param key delete key value/length/flags - * @param data delete data value/length/flags - * @param flags (unused) - * @return 0 on success - */ -RPM_GNUC_INTERNAL -int dbiDel(dbiIndex dbi, DBC * dbcursor, DBT * key, DBT * data, - unsigned int flags); - -/** \ingroup dbi - * Retrieve (key,data) pair from index database. - * @param dbi index database handle - * @param dbcursor database cursor (NULL will use db->get) - * @param key retrieve key value/length/flags - * @param data retrieve data value/length/flags - * @param flags (unused) - * @return 0 on success - */ -RPM_GNUC_INTERNAL -int dbiGet(dbiIndex dbi, DBC * dbcursor, DBT * key, DBT * data, - unsigned int flags); - -/** \ingroup dbi - * Store (key,data) pair in index database. - * @param dbi index database handle - * @param dbcursor database cursor (NULL will use db->put) - * @param key store key value/length/flags - * @param data store data value/length/flags - * @param flags (unused) - * @return 0 on success - */ -RPM_GNUC_INTERNAL -int dbiPut(dbiIndex dbi, DBC * dbcursor, DBT * key, DBT * data, - unsigned int flags); - -/** \ingroup dbi - * Retrieve count of (possible) duplicate items. - * @param dbi index database handle - * @param dbcursor database cursor - * @param countp address of count - * @param flags (unused) - * @return 0 on success - */ -int dbiCount(dbiIndex dbi, DBC * dbcursor, unsigned int * countp, - unsigned int flags); - -/** \ingroup dbi - * Close index database. - * @param dbi index database handle - * @param flags (unused) - * @return 0 on success - */ -int dbiClose(dbiIndex dbi, unsigned int flags); - -/** \ingroup dbi - * Flush pending operations to disk. - * @param dbi index database handle - * @param flags (unused) - * @return 0 on success - */ -int dbiSync (dbiIndex dbi, unsigned int flags); - - -/** \ingroup dbi - * Is database byte swapped? - * @param dbi index database handle - * @return 0 same order, 1 swapped order - */ -int dbiByteSwapped(dbiIndex dbi); - -/** \ingroup dbi - * Is database byte swapped? - * @param dbi index database handle - * @param flags DB_FAST_STAT or 0 - * @return 0 on success - */ -int dbiStat(dbiIndex dbi, unsigned int flags); - /** \ingroup rpmdb * Return rpmdb home directory (depending on chroot state) * param db rpmdb handle |