| rpmdb.h | | rpmdb.h | |
| | | | |
| skipping to change at line 863 | | skipping to change at line 863 | |
| /** \ingroup dbi | | /** \ingroup dbi | |
| * Return dbi transaction id. | | * Return dbi transaction id. | |
| * @param dbi index database handle | | * @param dbi index database handle | |
| * @return transaction id | | * @return transaction id | |
| */ | | */ | |
| /*@unused@*/ static inline /*@null@*/ | | /*@unused@*/ static inline /*@null@*/ | |
| DB_TXN * dbiTxnid(dbiIndex dbi) | | DB_TXN * dbiTxnid(dbiIndex dbi) | |
| /*@*/ | | /*@*/ | |
| { | | { | |
| rpmdb rpmdb = (dbi ? dbi->dbi_rpmdb : NULL); | | rpmdb rpmdb = (dbi ? dbi->dbi_rpmdb : NULL); | |
|
| DB_TXN * _txn = (rpmdb ? rpmdb->db_txn : NULL); | | DB_TXN * _txn = (DB_TXN*)(rpmdb ? rpmdb->db_txn : NULL); | |
| return _txn; | | return _txn; | |
| } | | } | |
| | | | |
| #if defined(_RPMDB_INTERNAL) | | #if defined(_RPMDB_INTERNAL) | |
| | | | |
| #if !defined(__LCLINT__) | | #if !defined(__LCLINT__) | |
| /*@unused@*/ static inline | | /*@unused@*/ static inline | |
| int rpmlkId(rpmdb rpmdb, uint32_t *_idp) | | int rpmlkId(rpmdb rpmdb, uint32_t *_idp) | |
| { | | { | |
|
| DB_ENV * dbenv = rpmdb->db_dbenv; | | DB_ENV * dbenv = (DB_ENV*)rpmdb->db_dbenv; | |
| int rc = (rpmdb->_dbi[0]->dbi_eflags & 0x080) | | int rc = (rpmdb->_dbi[0]->dbi_eflags & 0x080) | |
| ? dbenv->lock_id(dbenv, _idp) : ENOTSUP; | | ? dbenv->lock_id(dbenv, _idp) : ENOTSUP; | |
| if (_rpmdb_debug) | | if (_rpmdb_debug) | |
| fprintf(stderr, "<-- %s(%p,%p) id 0x%x rc %d\n", "dbenv->lock_id", dbenv, _
idp, *_idp, rc); | | fprintf(stderr, "<-- %s(%p,%p) id 0x%x rc %d\n", "dbenv->lock_id", dbenv, _
idp, *_idp, rc); | |
| return rc; | | return rc; | |
| } | | } | |
| | | | |
| /*@unused@*/ static inline | | /*@unused@*/ static inline | |
| int rpmlkIdFree(rpmdb rpmdb, uint32_t _id) | | int rpmlkIdFree(rpmdb rpmdb, uint32_t _id) | |
| { | | { | |
|
| DB_ENV * dbenv = rpmdb->db_dbenv; | | DB_ENV * dbenv = (DB_ENV*)rpmdb->db_dbenv; | |
| int rc = (rpmdb->_dbi[0]->dbi_eflags & 0x080) | | int rc = (rpmdb->_dbi[0]->dbi_eflags & 0x080) | |
| ? dbenv->lock_id_free(dbenv, _id) : ENOTSUP; | | ? dbenv->lock_id_free(dbenv, _id) : ENOTSUP; | |
| if (_rpmdb_debug) | | if (_rpmdb_debug) | |
| fprintf(stderr, "<-- %s(%p,%u) rc %d\n", "dbenv->lock_id_free", dbenv, (uns
igned)_id, rc); | | fprintf(stderr, "<-- %s(%p,%u) rc %d\n", "dbenv->lock_id_free", dbenv, (uns
igned)_id, rc); | |
| return rc; | | return rc; | |
| } | | } | |
| | | | |
| /*@unused@*/ static inline | | /*@unused@*/ static inline | |
| int rpmlkGet(rpmdb rpmdb, DBT * _object, uint32_t _lockmode, void * _lock) | | int rpmlkGet(rpmdb rpmdb, DBT * _object, uint32_t _lockmode, void * _lock) | |
| { | | { | |
|
| DB_ENV * dbenv = rpmdb->db_dbenv; | | DB_ENV * dbenv = (DB_ENV*)rpmdb->db_dbenv; | |
| uint32_t _locker = 0x12344321; | | uint32_t _locker = 0x12344321; | |
| uint32_t _flags = 0; | | uint32_t _flags = 0; | |
| int rc = (rpmdb->_dbi[0]->dbi_eflags & 0x080) | | int rc = (rpmdb->_dbi[0]->dbi_eflags & 0x080) | |
|
| ? dbenv->lock_get(dbenv, _locker, _flags, _object, _lockmode, _lock) | | ? dbenv->lock_get(dbenv, _locker, _flags, _object, (db_lockmode_t)_l
ockmode, (DB_LOCK*)_lock) | |
| : ENOTSUP; | | : ENOTSUP; | |
| if (_rpmdb_debug) | | if (_rpmdb_debug) | |
| fprintf(stderr, "<-- %s(%p,0x%x,0x%x,%p,0x%x,%p) rc %d\n", "dbenv->lock_get
", dbenv, _locker, _flags, _object, _lockmode, _lock, rc); | | fprintf(stderr, "<-- %s(%p,0x%x,0x%x,%p,0x%x,%p) rc %d\n", "dbenv->lock_get
", dbenv, _locker, _flags, _object, _lockmode, _lock, rc); | |
| return rc; | | return rc; | |
| } | | } | |
| | | | |
| /*@unused@*/ static inline | | /*@unused@*/ static inline | |
| int rpmlkPut(rpmdb rpmdb, void * _lock) | | int rpmlkPut(rpmdb rpmdb, void * _lock) | |
| { | | { | |
|
| DB_ENV * dbenv = rpmdb->db_dbenv; | | DB_ENV * dbenv = (DB_ENV*)rpmdb->db_dbenv; | |
| int rc = (rpmdb->_dbi[0]->dbi_eflags & 0x080) | | int rc = (rpmdb->_dbi[0]->dbi_eflags & 0x080) | |
|
| ? dbenv->lock_put(dbenv, _lock) | | ? dbenv->lock_put(dbenv, (DB_LOCK*)_lock) | |
| : ENOTSUP; | | : ENOTSUP; | |
| if (_rpmdb_debug) | | if (_rpmdb_debug) | |
| fprintf(stderr, "<-- %s(%p,%p) rc %d\n", "dbenv->lock_put", dbenv, _lock, r
c); | | fprintf(stderr, "<-- %s(%p,%p) rc %d\n", "dbenv->lock_put", dbenv, _lock, r
c); | |
| return rc; | | return rc; | |
| } | | } | |
| | | | |
| /*@unused@*/ static inline | | /*@unused@*/ static inline | |
| int rpmlgcOpen(rpmdb rpmdb) | | int rpmlgcOpen(rpmdb rpmdb) | |
| { | | { | |
|
| DB_ENV * dbenv = rpmdb->db_dbenv; | | DB_ENV * dbenv = (DB_ENV*)rpmdb->db_dbenv; | |
| DB_LOGC * _logc = NULL; | | DB_LOGC * _logc = NULL; | |
| uint32_t _flags = 0; | | uint32_t _flags = 0; | |
| int rc = (rpmdb->_dbi[0]->dbi_eflags & 0x100) | | int rc = (rpmdb->_dbi[0]->dbi_eflags & 0x100) | |
| ? dbenv->log_cursor(dbenv, &_logc, _flags) : ENOTSUP; | | ? dbenv->log_cursor(dbenv, &_logc, _flags) : ENOTSUP; | |
| rpmdb->db_logc = (!rc ? _logc : NULL); | | rpmdb->db_logc = (!rc ? _logc : NULL); | |
| if (_rpmdb_debug) | | if (_rpmdb_debug) | |
| fprintf(stderr, "<-- %s(%p,%p,0x%x) logc %p rc %d\n", "dbenv->log_cursor",
dbenv, &_logc, _flags, _logc, rc); | | fprintf(stderr, "<-- %s(%p,%p,0x%x) logc %p rc %d\n", "dbenv->log_cursor",
dbenv, &_logc, _flags, _logc, rc); | |
| return rc; | | return rc; | |
| } | | } | |
| | | | |
| | | | |
| skipping to change at line 957 | | skipping to change at line 957 | |
| int rc = (_logc ? _logc->close(_logc, _flags) : ENOTSUP); | | int rc = (_logc ? _logc->close(_logc, _flags) : ENOTSUP); | |
| rpmdb->db_logc = NULL; | | rpmdb->db_logc = NULL; | |
| if (_rpmdb_debug) | | if (_rpmdb_debug) | |
| fprintf(stderr, "<-- %s(%p) rc %d\n", "logc->close", _logc, rc); | | fprintf(stderr, "<-- %s(%p) rc %d\n", "logc->close", _logc, rc); | |
| return rc; | | return rc; | |
| } | | } | |
| | | | |
| /*@unused@*/ static inline | | /*@unused@*/ static inline | |
| int rpmlgcFile(rpmdb rpmdb, const DB_LSN * _lsn, char * name, size_t len) | | int rpmlgcFile(rpmdb rpmdb, const DB_LSN * _lsn, char * name, size_t len) | |
| { | | { | |
|
| DB_ENV * dbenv = rpmdb->db_dbenv; | | DB_ENV * dbenv = (DB_ENV*)rpmdb->db_dbenv; | |
| int rc = dbenv->log_file(dbenv, _lsn, name, len); | | int rc = dbenv->log_file(dbenv, _lsn, name, len); | |
| if (_rpmdb_debug) | | if (_rpmdb_debug) | |
| fprintf(stderr, "<-- %s(%p,%p,%p[%u]) \"%s\" rc %d\n", "dbenv->log_file", d
benv, _lsn, name, (unsigned)len, name, rc); | | fprintf(stderr, "<-- %s(%p,%p,%p[%u]) \"%s\" rc %d\n", "dbenv->log_file", d
benv, _lsn, name, (unsigned)len, name, rc); | |
| return rc; | | return rc; | |
| } | | } | |
| | | | |
| /*@unused@*/ static inline | | /*@unused@*/ static inline | |
| int rpmlgcFlush(rpmdb rpmdb, const DB_LSN * _lsn) | | int rpmlgcFlush(rpmdb rpmdb, const DB_LSN * _lsn) | |
| { | | { | |
|
| DB_ENV * dbenv = rpmdb->db_dbenv; | | DB_ENV * dbenv = (DB_ENV*)rpmdb->db_dbenv; | |
| int rc = dbenv->log_flush(dbenv, _lsn); | | int rc = dbenv->log_flush(dbenv, _lsn); | |
| if (_rpmdb_debug) | | if (_rpmdb_debug) | |
| fprintf(stderr, "<-- %s(%p,%p) rc %d\n", "dbenv->log_flush", dbenv, _lsn, r
c); | | fprintf(stderr, "<-- %s(%p,%p) rc %d\n", "dbenv->log_flush", dbenv, _lsn, r
c); | |
| return rc; | | return rc; | |
| } | | } | |
| | | | |
| /*@unused@*/ static inline | | /*@unused@*/ static inline | |
| int rpmlgcPrintf(rpmdb rpmdb, const char * fmt, void *_A1, void *_A2, void
*_A3, void *_A4, void *_A5) | | int rpmlgcPrintf(rpmdb rpmdb, const char * fmt, void *_A1, void *_A2, void
*_A3, void *_A4, void *_A5) | |
| { | | { | |
|
| DB_ENV * dbenv = rpmdb->db_dbenv; | | DB_ENV * dbenv = (DB_ENV*)rpmdb->db_dbenv; | |
| DB_TXN * _txnid = rpmdb->db_txn; | | DB_TXN * _txnid = (DB_TXN*)rpmdb->db_txn; | |
| int rc = dbenv->log_printf(dbenv, _txnid, fmt, _A1, _A2, _A3, _A4, _A5)
; | | int rc = dbenv->log_printf(dbenv, _txnid, fmt, _A1, _A2, _A3, _A4, _A5)
; | |
| if (_rpmdb_debug) | | if (_rpmdb_debug) | |
| fprintf(stderr, "<-- %s(%p,%p,\"%s\", ...) rc %d\n", "dbenv->log_printf", d
benv, _txnid, fmt, rc); | | fprintf(stderr, "<-- %s(%p,%p,\"%s\", ...) rc %d\n", "dbenv->log_printf", d
benv, _txnid, fmt, rc); | |
| return rc; | | return rc; | |
| } | | } | |
| | | | |
| /*@unused@*/ static inline | | /*@unused@*/ static inline | |
| int rpmlgcPut(rpmdb rpmdb, DB_LSN * _lsn, const DBT * data, uint32_t flags) | | int rpmlgcPut(rpmdb rpmdb, DB_LSN * _lsn, const DBT * data, uint32_t flags) | |
| { | | { | |
|
| DB_ENV * dbenv = rpmdb->db_dbenv; | | DB_ENV * dbenv = (DB_ENV*)rpmdb->db_dbenv; | |
| int rc = dbenv->log_put(dbenv, _lsn, data, flags); | | int rc = dbenv->log_put(dbenv, _lsn, data, flags); | |
| if (_rpmdb_debug) | | if (_rpmdb_debug) | |
| fprintf(stderr, "<-- %s(%p,%p,%p,0x%x) rc %d\n", "dbenv->log_put", dbenv, _
lsn, data, flags, rc); | | fprintf(stderr, "<-- %s(%p,%p,%p,0x%x) rc %d\n", "dbenv->log_put", dbenv, _
lsn, data, flags, rc); | |
| return rc; | | return rc; | |
| } | | } | |
| | | | |
| /*@unused@*/ static inline | | /*@unused@*/ static inline | |
| int rpmmpfSyncAll(rpmdb rpmdb) | | int rpmmpfSyncAll(rpmdb rpmdb) | |
| { | | { | |
|
| DB_ENV * dbenv = rpmdb->db_dbenv; | | DB_ENV * dbenv = (DB_ENV*)rpmdb->db_dbenv; | |
| DB_LSN * _lsn = NULL; | | DB_LSN * _lsn = NULL; | |
| int rc = (rpmdb->_dbi[0]->dbi_eflags & 0x100) | | int rc = (rpmdb->_dbi[0]->dbi_eflags & 0x100) | |
| ? dbenv->memp_sync(dbenv, _lsn) : ENOTSUP; | | ? dbenv->memp_sync(dbenv, _lsn) : ENOTSUP; | |
| if (_rpmdb_debug) | | if (_rpmdb_debug) | |
| fprintf(stderr, "<-- %s(%p,%p) rc %d\n", "dbenv->memp_sync", dbenv, _lsn, r
c); | | fprintf(stderr, "<-- %s(%p,%p) rc %d\n", "dbenv->memp_sync", dbenv, _lsn, r
c); | |
| return rc; | | return rc; | |
| } | | } | |
| | | | |
| /*@unused@*/ static inline | | /*@unused@*/ static inline | |
| int rpmmpfTrickle(rpmdb rpmdb) | | int rpmmpfTrickle(rpmdb rpmdb) | |
| { | | { | |
|
| DB_ENV * dbenv = rpmdb->db_dbenv; | | DB_ENV * dbenv = (DB_ENV*)rpmdb->db_dbenv; | |
| int _percent = 20; | | int _percent = 20; | |
| int _nwrote = 0; | | int _nwrote = 0; | |
| int rc = (rpmdb->_dbi[0]->dbi_eflags & 0x100) | | int rc = (rpmdb->_dbi[0]->dbi_eflags & 0x100) | |
| ? dbenv->memp_trickle(dbenv, _percent, &_nwrote) : ENOTSUP; | | ? dbenv->memp_trickle(dbenv, _percent, &_nwrote) : ENOTSUP; | |
| if (_rpmdb_debug) | | if (_rpmdb_debug) | |
| fprintf(stderr, "<-- %s(%p,%d) nwrote %d rc %d\n", "dbenv->memp_trickle", d
benv, _percent, _nwrote, rc); | | fprintf(stderr, "<-- %s(%p,%d) nwrote %d rc %d\n", "dbenv->memp_trickle", d
benv, _percent, _nwrote, rc); | |
| return rc; | | return rc; | |
| } | | } | |
| | | | |
| /*@unused@*/ static inline | | /*@unused@*/ static inline | |
| | | | |
| skipping to change at line 1036 | | skipping to change at line 1036 | |
| rpmdb->db_mpf = NULL; | | rpmdb->db_mpf = NULL; | |
| if (_rpmdb_debug) | | if (_rpmdb_debug) | |
| fprintf(stderr, "<-- %s(%p) rc %d\n", "mpf->close", mpf, rc); | | fprintf(stderr, "<-- %s(%p) rc %d\n", "mpf->close", mpf, rc); | |
| return rc; | | return rc; | |
| } | | } | |
| | | | |
| /*@unused@*/ static inline | | /*@unused@*/ static inline | |
| int rpmmpfGet(rpmdb rpmdb, uint32_t * _pgnop, uint32_t _flags, void ** _pag
ep) | | int rpmmpfGet(rpmdb rpmdb, uint32_t * _pgnop, uint32_t _flags, void ** _pag
ep) | |
| { | | { | |
| DB_MPOOLFILE * mpf = rpmdb->db_mpf; | | DB_MPOOLFILE * mpf = rpmdb->db_mpf; | |
|
| DB_TXN * _txnid = rpmdb->db_txn; | | DB_TXN * _txnid = (DB_TXN*)rpmdb->db_txn; | |
| int rc = mpf->get(mpf, _pgnop, _txnid, _flags, _pagep); | | int rc = mpf->get(mpf, _pgnop, _txnid, _flags, _pagep); | |
| if (_rpmdb_debug) | | if (_rpmdb_debug) | |
| fprintf(stderr, "<-- %s(%p,%p,%p,0x%x,%p) rc %d\n", "mpf->get", mpf, _pgnop
, _txnid, _flags, _pagep, rc); | | fprintf(stderr, "<-- %s(%p,%p,%p,0x%x,%p) rc %d\n", "mpf->get", mpf, _pgnop
, _txnid, _flags, _pagep, rc); | |
| return rc; | | return rc; | |
| } | | } | |
| | | | |
| /*@unused@*/ static inline | | /*@unused@*/ static inline | |
| int rpmmpfOpen(rpmdb rpmdb, /*@null@*/ const char * fn, uint32_t flags) | | int rpmmpfOpen(rpmdb rpmdb, /*@null@*/ const char * fn, uint32_t flags) | |
| { | | { | |
|
| DB_ENV * dbenv = rpmdb->db_dbenv; | | DB_ENV * dbenv = (DB_ENV*)rpmdb->db_dbenv; | |
| DB_MPOOLFILE * mpf = NULL; | | DB_MPOOLFILE * mpf = NULL; | |
| int _perms = rpmdb->_dbi[0]->dbi_perms; | | int _perms = rpmdb->_dbi[0]->dbi_perms; | |
| size_t _pagesize = BUFSIZ; | | size_t _pagesize = BUFSIZ; | |
| uint32_t _fcreate_flags = 0; | | uint32_t _fcreate_flags = 0; | |
| int rc = (rpmdb->_dbi[0]->dbi_eflags & 0x100) | | int rc = (rpmdb->_dbi[0]->dbi_eflags & 0x100) | |
| ? dbenv->memp_fcreate(dbenv, &mpf, _fcreate_flags) : ENOTSUP; | | ? dbenv->memp_fcreate(dbenv, &mpf, _fcreate_flags) : ENOTSUP; | |
| | | | |
| if (_rpmdb_debug) | | if (_rpmdb_debug) | |
| fprintf(stderr, "<-- %s(%p,&mpf,0x%x) mpf %p rc %d\n", "dbenv->memp_fcreate
", dbenv, _fcreate_flags, mpf, rc); | | fprintf(stderr, "<-- %s(%p,&mpf,0x%x) mpf %p rc %d\n", "dbenv->memp_fcreate
", dbenv, _fcreate_flags, mpf, rc); | |
| if (rc) goto exit; | | if (rc) goto exit; | |
| | | | |
| skipping to change at line 1071 | | skipping to change at line 1071 | |
| | | | |
| exit: | | exit: | |
| return rc; | | return rc; | |
| } | | } | |
| | | | |
| /*@unused@*/ static inline | | /*@unused@*/ static inline | |
| int rpmmpfPut(rpmdb rpmdb, void * _page, uint32_t flags) | | int rpmmpfPut(rpmdb rpmdb, void * _page, uint32_t flags) | |
| { | | { | |
| DB_MPOOLFILE * mpf = rpmdb->db_mpf; | | DB_MPOOLFILE * mpf = rpmdb->db_mpf; | |
| uint32_t _priority = DB_PRIORITY_DEFAULT; | | uint32_t _priority = DB_PRIORITY_DEFAULT; | |
|
| int rc = mpf->put(mpf, _page, _priority, flags); | | int rc = mpf->put(mpf, _page, (DB_CACHE_PRIORITY)_priority, flags); | |
| if (_rpmdb_debug) | | if (_rpmdb_debug) | |
| fprintf(stderr, "<-- %s(%p,%p,0x%x,0x%x) rc %d\n", "mpf->put", mpf, _page,
_priority, flags, rc); | | fprintf(stderr, "<-- %s(%p,%p,0x%x,0x%x) rc %d\n", "mpf->put", mpf, _page,
_priority, flags, rc); | |
| return rc; | | return rc; | |
| } | | } | |
| | | | |
| /*@unused@*/ static inline | | /*@unused@*/ static inline | |
| int rpmmpfSync(rpmdb rpmdb) | | int rpmmpfSync(rpmdb rpmdb) | |
| { | | { | |
| DB_MPOOLFILE * mpf = rpmdb->db_mpf; | | DB_MPOOLFILE * mpf = rpmdb->db_mpf; | |
| int rc = (mpf ? mpf->sync(mpf) : ENOTSUP); | | int rc = (mpf ? mpf->sync(mpf) : ENOTSUP); | |
| | | | |
End of changes. 17 change blocks. |
| 18 lines changed or deleted | | 18 lines changed or added | |
|