summaryrefslogtreecommitdiff
path: root/lib/backend
diff options
context:
space:
mode:
authorFlorian Festi <ffesti@redhat.com>2009-01-09 15:25:56 +0100
committerFlorian Festi <ffesti@redhat.com>2009-01-09 15:25:56 +0100
commita3d682200bd0a74f2c05f9f618700ebcbc00e0c7 (patch)
treeaffa5f33751509fb1c9494f98128027c64d398f5 /lib/backend
parent6e816c44dc70197477845de924b9d58f35d01e6c (diff)
downloadrpm-a3d682200bd0a74f2c05f9f618700ebcbc00e0c7.tar.gz
rpm-a3d682200bd0a74f2c05f9f618700ebcbc00e0c7.tar.bz2
rpm-a3d682200bd0a74f2c05f9f618700ebcbc00e0c7.zip
Remove unused database intex functions: dbiCdup, dbiAssociate, dbiPget, dbiJoin
and their implementations in the backends
Diffstat (limited to 'lib/backend')
-rw-r--r--lib/backend/db3.c64
-rw-r--r--lib/backend/sqlite.c71
2 files changed, 2 insertions, 133 deletions
diff --git a/lib/backend/db3.c b/lib/backend/db3.c
index 55b853311..806270990 100644
--- a/lib/backend/db3.c
+++ b/lib/backend/db3.c
@@ -405,18 +405,6 @@ static int db3sync(dbiIndex dbi, unsigned int flags)
return rc;
}
-static int db3cdup(dbiIndex dbi, DBC * dbcursor, DBC ** dbcp,
- unsigned int flags)
-{
- int rc;
-
- if (dbcp) *dbcp = NULL;
- rc = dbcursor->c_dup(dbcursor, dbcp, flags);
- rc = cvtdberr(dbi, "dbcursor->c_dup", rc, _debug);
- /* FIX: *dbcp can be NULL */
- return rc;
-}
-
static int db3cclose(dbiIndex dbi, DBC * dbcursor,
unsigned int flags)
{
@@ -529,25 +517,6 @@ static int db3cget(dbiIndex dbi, DBC * dbcursor, DBT * key, DBT * data,
return rc;
}
-static int db3cpget(dbiIndex dbi, DBC * dbcursor, DBT * key, DBT * pkey,
- DBT * data, unsigned int flags)
-{
- DB * db = dbi->dbi_db;
- int _printit;
- int rc;
-
- assert(db != NULL);
- assert(dbcursor != NULL);
-
- /* XXX db3 does DB_FIRST on uninitialized cursor */
- rc = dbcursor->c_pget(dbcursor, key, pkey, data, flags);
- /* XXX DB_NOTFOUND can be returned */
- _printit = (rc == DB_NOTFOUND ? 0 : _debug);
- rc = cvtdberr(dbi, "dbcursor->c_pget", rc, _printit);
-
- return rc;
-}
-
static int db3ccount(dbiIndex dbi, DBC * dbcursor,
unsigned int * countp,
unsigned int flags)
@@ -604,34 +573,6 @@ static int db3stat(dbiIndex dbi, unsigned int flags)
return rc;
}
-static int db3associate(dbiIndex dbi, dbiIndex dbisecondary,
- int (*callback)(DB *, const DBT *, const DBT *, DBT *),
- unsigned int flags)
-{
- DB * db = dbi->dbi_db;
- DB * secondary = dbisecondary->dbi_db;
- int rc;
-
- DB_TXN * txnid = NULL;
-
-assert(db != NULL);
- rc = db->associate(db, txnid, secondary, callback, flags);
- rc = cvtdberr(dbi, "db->associate", rc, _debug);
- return rc;
-}
-
-static int db3join(dbiIndex dbi, DBC ** curslist, DBC ** dbcp,
- unsigned int flags)
-{
- DB * db = dbi->dbi_db;
- int rc;
-
-assert(db != NULL);
- rc = db->join(db, curslist, dbcp, flags);
- rc = cvtdberr(dbi, "db->join", rc, _debug);
- return rc;
-}
-
static int db3close(dbiIndex dbi, unsigned int flags)
{
rpmdb rpmdb = dbi->dbi_rpmdb;
@@ -1179,7 +1120,6 @@ static int db3open(rpmdb rpmdb, rpmTag rpmtag, dbiIndex * dbip)
RPM_GNUC_INTERNAL
const struct _dbiVec db3vec = {
DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
- db3open, db3close, db3sync, db3associate, db3join,
- db3copen, db3cclose, db3cdup, db3cdel, db3cget, db3cpget, db3cput, db3ccount,
- db3byteswapped, db3stat
+ db3open, db3close, db3sync, db3copen, db3cclose, db3cdel,
+ db3cget, db3cput, db3ccount, db3byteswapped, db3stat
};
diff --git a/lib/backend/sqlite.c b/lib/backend/sqlite.c
index 8466c5c71..f939eec53 100644
--- a/lib/backend/sqlite.c
+++ b/lib/backend/sqlite.c
@@ -1252,73 +1252,6 @@ leaveChroot(dbi);
**************************************************/
/**
- * Associate secondary database with primary.
- * @param dbi index database handle
- * @param dbisecondary secondary index database handle
- * @param callback create secondary key from primary (NULL if DB_RDONLY)
- * @param flags DB_CREATE or 0
- * @return 0 on success
- */
-static int sql_associate (dbiIndex dbi, dbiIndex dbisecondary,
- int (*callback) (DB *, const DBT *, const DBT *, DBT *),
- unsigned int flags)
-{
-if (_debug)
-fprintf(stderr, "*** %s:\n", __FUNCTION__);
- return EINVAL;
-}
-
-/**
- * Return join cursor for list of cursors.
- * @param dbi index database handle
- * @param curslist NULL terminated list of database cursors
- * @retval dbcp address of join database cursor
- * @param flags DB_JOIN_NOSORT or 0
- * @return 0 on success
- */
-static int sql_join (dbiIndex dbi, DBC ** curslist, DBC ** dbcp,
- unsigned int flags)
-{
-if (_debug)
-fprintf(stderr, "*** %s:\n", __FUNCTION__);
- return EINVAL;
-}
-
-/**
- * Duplicate a database cursor.
- * @param dbi index database handle
- * @param dbcursor database cursor
- * @retval dbcp address of new database cursor
- * @param flags DB_POSITION for same position, 0 for uninitialized
- * @return 0 on success
- */
-static int sql_cdup (dbiIndex dbi, DBC * dbcursor, DBC ** dbcp,
- unsigned int flags)
-{
-if (_debug)
-fprintf(stderr, "*** %s:\n", __FUNCTION__);
- return EINVAL;
-}
-
-/**
- * Retrieve (key,data) pair using dbcursor->c_pget.
- * @param dbi index database handle
- * @param dbcursor database cursor
- * @param key secondary retrieve key value/length/flags
- * @param pkey primary retrieve key value/length/flags
- * @param data primary retrieve data value/length/flags
- * @param flags DB_NEXT, DB_SET, or 0
- * @return 0 on success
- */
-static int sql_cpget (dbiIndex dbi, DBC * dbcursor,
- DBT * key, DBT * pkey, DBT * data, unsigned int flags)
-{
-if (_debug)
-fprintf(stderr, "*** %s:\n", __FUNCTION__);
- return EINVAL;
-}
-
-/**
* Retrieve count of (possible) duplicate items using dbcursor->c_count.
* @param dbi index database handle
* @param dbcursor database cursor
@@ -1394,14 +1327,10 @@ const struct _dbiVec sqlitevec = {
sql_open,
sql_close,
sql_sync,
- sql_associate,
- sql_join,
sql_copen,
sql_cclose,
- sql_cdup,
sql_cdel,
sql_cget,
- sql_cpget,
sql_cput,
sql_ccount,
sql_byteswapped,