db.h   db.h 
/* /*
* See the file LICENSE for redistribution information. * See the file LICENSE for redistribution information.
* *
* Copyright (c) 1996,2008 Oracle. All rights reserved. * Copyright (c) 1996, 2010 Oracle and/or its affiliates. All rights reser ved.
* *
* $Id: db.in,v 12.193 2008/05/07 12:33:12 bschmeck Exp $ * $Id$
* *
* db.h include file layout: * db.h include file layout:
* General. * General.
* Database Environment. * Database Environment.
* Locking subsystem. * Locking subsystem.
* Logging subsystem. * Logging subsystem.
* Shared buffer cache (mpool) subsystem. * Shared buffer cache (mpool) subsystem.
* Transaction subsystem. * Transaction subsystem.
* Access methods. * Access methods.
* Access method cursors. * Access method cursors.
skipping to change at line 43 skipping to change at line 43
#if defined(__cplusplus) #if defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
#undef __P #undef __P
#define __P(protos) protos #define __P(protos) protos
/* /*
* Berkeley DB version information. * Berkeley DB version information.
*/ */
#define DB_VERSION_MAJOR 4 #define DB_VERSION_FAMILY 11
#define DB_VERSION_MINOR 7 #define DB_VERSION_RELEASE 2
#define DB_VERSION_PATCH 25 #define DB_VERSION_MAJOR 5
#define DB_VERSION_STRING "Berkeley DB 4.7.25: (May 15, 2008)" #define DB_VERSION_MINOR 0
#define DB_VERSION_PATCH 21
#define DB_VERSION_STRING "Berkeley DB 5.0.21: (March 30, 2010
)"
#define DB_VERSION_FULL_STRING "Berkeley DB 11g Release 2, library
version 11.2.5.0.21: (March 30, 2010)"
/* /*
* !!! * !!!
* Berkeley DB uses specifically sized types. If they're not provided by * Berkeley DB uses specifically sized types. If they're not provided by
* the system, typedef them here. * the system, typedef them here.
* *
* We protect them against multiple inclusion using __BIT_TYPES_DEFINED__, * We protect them against multiple inclusion using __BIT_TYPES_DEFINED__,
* as does BIND and Kerberos, since we don't know for sure what #include * as does BIND and Kerberos, since we don't know for sure what #include
* files the user is using. * files the user is using.
* *
skipping to change at line 157 skipping to change at line 160
struct __db_rep_stat; typedef struct __db_rep_stat DB_REP_STAT; struct __db_rep_stat; typedef struct __db_rep_stat DB_REP_STAT;
struct __db_repmgr_site;typedef struct __db_repmgr_site DB_REPMGR_SITE; struct __db_repmgr_site;typedef struct __db_repmgr_site DB_REPMGR_SITE;
struct __db_repmgr_stat;typedef struct __db_repmgr_stat DB_REPMGR_STAT; struct __db_repmgr_stat;typedef struct __db_repmgr_stat DB_REPMGR_STAT;
struct __db_seq_record; typedef struct __db_seq_record DB_SEQ_RECORD; struct __db_seq_record; typedef struct __db_seq_record DB_SEQ_RECORD;
struct __db_seq_stat; typedef struct __db_seq_stat DB_SEQUENCE_STAT; struct __db_seq_stat; typedef struct __db_seq_stat DB_SEQUENCE_STAT;
struct __db_sequence; typedef struct __db_sequence DB_SEQUENCE; struct __db_sequence; typedef struct __db_sequence DB_SEQUENCE;
struct __db_thread_info;typedef struct __db_thread_info DB_THREAD_INFO; struct __db_thread_info;typedef struct __db_thread_info DB_THREAD_INFO;
struct __db_txn; typedef struct __db_txn DB_TXN; struct __db_txn; typedef struct __db_txn DB_TXN;
struct __db_txn_active; typedef struct __db_txn_active DB_TXN_ACTIVE ; struct __db_txn_active; typedef struct __db_txn_active DB_TXN_ACTIVE ;
struct __db_txn_stat; typedef struct __db_txn_stat DB_TXN_STAT; struct __db_txn_stat; typedef struct __db_txn_stat DB_TXN_STAT;
struct __db_txn_token; typedef struct __db_txn_token DB_TXN_TOKEN;
struct __db_txnmgr; typedef struct __db_txnmgr DB_TXNMGR; struct __db_txnmgr; typedef struct __db_txnmgr DB_TXNMGR;
struct __dbc; typedef struct __dbc DBC; struct __dbc; typedef struct __dbc DBC;
struct __dbc_internal; typedef struct __dbc_internal DBC_INTERNAL; struct __dbc_internal; typedef struct __dbc_internal DBC_INTERNAL;
struct __env; typedef struct __env ENV; struct __env; typedef struct __env ENV;
struct __fh_t; typedef struct __fh_t DB_FH; struct __fh_t; typedef struct __fh_t DB_FH;
struct __fname; typedef struct __fname FNAME; struct __fname; typedef struct __fname FNAME;
struct __key_range; typedef struct __key_range DB_KEY_RANGE; struct __key_range; typedef struct __key_range DB_KEY_RANGE;
/*@=incondefs@*/ /*@=incondefs@*/
struct __mpoolfile; typedef struct __mpoolfile MPOOLFILE; struct __mpoolfile; typedef struct __mpoolfile MPOOLFILE;
struct __db_logvrfy_config;
typedef struct __db_logvrfy_config DB_LOG_VERIFY_CONFIG;
/* /*
* The Berkeley DB API flags are automatically-generated -- the following f * The Berkeley DB API flags are automatically-generated -- the following f
lag names are lag
* no longer used, but remain for compatibility reasons. * names are no longer used, but remain for compatibility reasons.
*/ */
#define DB_DEGREE_2 DB_READ_COMMITTED #define DB_DEGREE_2 DB_READ_COMMITTED
#define DB_DIRTY_READ DB_READ_UNCOMMITTED #define DB_DIRTY_READ DB_READ_UNCOMMITTED
#define DB_JOINENV 0x0 #define DB_JOINENV 0x0
/* Key/data structure -- a Data-Base Thang. */ /* Key/data structure -- a Data-Base Thang. */
struct __db_dbt { struct __db_dbt {
void *data; /* Key/data */ void *data; /* Key/data */
u_int32_t size; /* key/data length */ u_int32_t size; /* key/data length */
u_int32_t ulen; /* RO: length of user buffer. */ u_int32_t ulen; /* RO: length of user buffer. */
u_int32_t dlen; /* RO: get/put record length. */ u_int32_t dlen; /* RO: get/put record length. */
u_int32_t doff; /* RO: get/put record offset. */ u_int32_t doff; /* RO: get/put record offset. */
void *app_data; void *app_data;
#define DB_DBT_APPMALLOC 0x001 /* Callback allocated memory . */ #define DB_DBT_APPMALLOC 0x001 /* Callback allocated memory . */
#define DB_DBT_DUPOK 0x002 /* Insert if duplicate. */ #define DB_DBT_BULK 0x002 /* Internal: Insert if dupli
#define DB_DBT_ISSET 0x004 /* Lower level calls set val cate. */
ue. */ #define DB_DBT_DUPOK 0x004 /* Internal: Insert if dupli
#define DB_DBT_MALLOC 0x008 /* Return in malloc'd memory cate. */
. */ #define DB_DBT_ISSET 0x008 /* Lower level calls set val
#define DB_DBT_MULTIPLE 0x010 /* References multiple recor ue. */
ds. */ #define DB_DBT_MALLOC 0x010 /* Return in malloc'd memory
#define DB_DBT_PARTIAL 0x020 /* Partial put/get. */ . */
#define DB_DBT_REALLOC 0x040 /* Return in realloc'd memor #define DB_DBT_MULTIPLE 0x020 /* References multiple recor
y. */ ds. */
#define DB_DBT_USERCOPY 0x080 /* Use the user-supplied cal #define DB_DBT_PARTIAL 0x040 /* Partial put/get. */
lback. */ #define DB_DBT_REALLOC 0x080 /* Return in realloc'd memor
#define DB_DBT_USERMEM 0x100 /* Return in user's memory. y. */
*/ #define DB_DBT_STREAMING 0x100 /* Internal: DBT is being st
reamed. */
#define DB_DBT_USERCOPY 0x200 /* Use the user-supplied cal
lback. */
#define DB_DBT_USERMEM 0x400 /* Return in user's memory.
*/
u_int32_t flags; u_int32_t flags;
}; };
/******************************************************* /*******************************************************
* Mutexes. * Mutexes.
*******************************************************/ *******************************************************/
typedef u_int32_t db_mutex_t; typedef u_int32_t db_mutex_t;
struct __db_mutex_stat { struct __db_mutex_stat {
/* The following fields are maintained in the region's copy. */ /* The following fields are maintained in the region's copy. */
u_int32_t st_mutex_align; /* Mutex alignment */ u_int32_t st_mutex_align; /* Mutex alignment */
u_int32_t st_mutex_tas_spins; /* Mutex test-and-set spins */ u_int32_t st_mutex_tas_spins; /* Mutex test-and-set spins */
u_int32_t st_mutex_cnt; /* Mutex count */ u_int32_t st_mutex_cnt; /* Mutex count */
u_int32_t st_mutex_free; /* Available mutexes */ u_int32_t st_mutex_free; /* Available mutexes */
u_int32_t st_mutex_inuse; /* Mutexes in use */ u_int32_t st_mutex_inuse; /* Mutexes in use */
u_int32_t st_mutex_inuse_max; /* Maximum mutexes ever in use */ u_int32_t st_mutex_inuse_max; /* Maximum mutexes ever in use */
/* The following fields are filled-in from other places. */ /* The following fields are filled-in from other places. */
#ifndef __TEST_DB_NO_STATISTICS #ifndef __TEST_DB_NO_STATISTICS
u_int32_t st_region_wait; /* Region lock granted after wait. * uintmax_t st_region_wait; /* Region lock granted after wait. *
/ /
u_int32_t st_region_nowait; /* Region lock granted without wait. uintmax_t st_region_nowait; /* Region lock granted without wait.
*/ */
roff_t st_regsize; /* Region size. */ roff_t st_regsize; /* Region size. */
#endif #endif
}; };
/* This is the length of the buffer passed to DB_ENV->thread_id_string() */ /* This is the length of the buffer passed to DB_ENV->thread_id_string() */
#define DB_THREADID_STRLEN 128 #define DB_THREADID_STRLEN 128
/******************************************************* /*******************************************************
* Locking. * Locking.
*******************************************************/ *******************************************************/
skipping to change at line 310 skipping to change at line 318
u_int32_t st_maxlocks; /* Maximum number of locks in table. */ u_int32_t st_maxlocks; /* Maximum number of locks in table. */
u_int32_t st_maxlockers; /* Maximum num of lockers in table. */ u_int32_t st_maxlockers; /* Maximum num of lockers in table. */
u_int32_t st_maxobjects; /* Maximum num of objects in table. */ u_int32_t st_maxobjects; /* Maximum num of objects in table. */
u_int32_t st_partitions; /* number of partitions. */ u_int32_t st_partitions; /* number of partitions. */
int st_nmodes; /* Number of lock modes. */ int st_nmodes; /* Number of lock modes. */
u_int32_t st_nlockers; /* Current number of lockers. */ u_int32_t st_nlockers; /* Current number of lockers. */
#ifndef __TEST_DB_NO_STATISTICS #ifndef __TEST_DB_NO_STATISTICS
u_int32_t st_nlocks; /* Current number of locks. */ u_int32_t st_nlocks; /* Current number of locks. */
u_int32_t st_maxnlocks; /* Maximum number of locks so far. * / u_int32_t st_maxnlocks; /* Maximum number of locks so far. * /
u_int32_t st_maxhlocks; /* Maximum number of locks in any bu cket. */ u_int32_t st_maxhlocks; /* Maximum number of locks in any bu cket. */
u_int32_t st_locksteals; /* Number of lock steals so far. */ uintmax_t st_locksteals; /* Number of lock steals so far. */
u_int32_t st_maxlsteals; /* Maximum number steals in any part uintmax_t st_maxlsteals; /* Maximum number steals in any part
ition. */ ition. */
u_int32_t st_maxnlockers; /* Maximum number of lockers so far. */ u_int32_t st_maxnlockers; /* Maximum number of lockers so far. */
u_int32_t st_nobjects; /* Current number of objects. */ u_int32_t st_nobjects; /* Current number of objects. */
u_int32_t st_maxnobjects; /* Maximum number of objects so far. */ u_int32_t st_maxnobjects; /* Maximum number of objects so far. */
u_int32_t st_maxhobjects; /* Maximum number of objectsin any b ucket. */ u_int32_t st_maxhobjects; /* Maximum number of objectsin any b ucket. */
u_int32_t st_objectsteals; /* Number of objects steals so far. uintmax_t st_objectsteals; /* Number of objects steals so far.
*/ */
u_int32_t st_maxosteals; /* Maximum number of steals in any p uintmax_t st_maxosteals; /* Maximum number of steals in any p
artition. */ artition. */
u_int32_t st_nrequests; /* Number of lock gets. */ uintmax_t st_nrequests; /* Number of lock gets. */
u_int32_t st_nreleases; /* Number of lock puts. */ uintmax_t st_nreleases; /* Number of lock puts. */
u_int32_t st_nupgrade; /* Number of lock upgrades. */ uintmax_t st_nupgrade; /* Number of lock upgrades. */
u_int32_t st_ndowngrade; /* Number of lock downgrades. */ uintmax_t st_ndowngrade; /* Number of lock downgrades. */
u_int32_t st_lock_wait; /* Lock conflicts w/ subsequent wait uintmax_t st_lock_wait; /* Lock conflicts w/ subsequent wait
*/ */
u_int32_t st_lock_nowait; /* Lock conflicts w/o subsequent wai uintmax_t st_lock_nowait; /* Lock conflicts w/o subsequent wai
t */ t */
u_int32_t st_ndeadlocks; /* Number of lock deadlocks. */ uintmax_t st_ndeadlocks; /* Number of lock deadlocks. */
db_timeout_t st_locktimeout; /* Lock timeout. */ db_timeout_t st_locktimeout; /* Lock timeout. */
u_int32_t st_nlocktimeouts; /* Number of lock timeouts. */ uintmax_t st_nlocktimeouts; /* Number of lock timeouts. */
db_timeout_t st_txntimeout; /* Transaction timeout. */ db_timeout_t st_txntimeout; /* Transaction timeout. */
u_int32_t st_ntxntimeouts; /* Number of transaction timeouts. * uintmax_t st_ntxntimeouts; /* Number of transaction timeouts. *
/ /
u_int32_t st_part_wait; /* Partition lock granted after wait uintmax_t st_part_wait; /* Partition lock granted after wait
. */ . */
u_int32_t st_part_nowait; /* Partition lock granted without wa uintmax_t st_part_nowait; /* Partition lock granted without wa
it. */ it. */
u_int32_t st_part_max_wait; /* Max partition lock granted after uintmax_t st_part_max_wait; /* Max partition lock granted after
wait. */ wait. */
u_int32_t st_part_max_nowait; /* Max partition lock granted withou uintmax_t st_part_max_nowait; /* Max partition lock granted withou
t wait. */ t wait. */
u_int32_t st_objs_wait; /* Object lock granted after wait. * uintmax_t st_objs_wait; /* Object lock granted after wait. */
/ uintmax_t st_objs_nowait; /* Object lock granted without wait.
u_int32_t st_objs_nowait; /* Object lock granted without wait. */
*/ uintmax_t st_lockers_wait; /* Locker lock granted after wait. *
u_int32_t st_lockers_wait; /* Locker lock granted after wait. * /
/ uintmax_t st_lockers_nowait; /* Locker lock granted without wait.
u_int32_t st_lockers_nowait; /* Locker lock granted without wait. */
*/ uintmax_t st_region_wait; /* Region lock granted after wait. *
u_int32_t st_region_wait; /* Region lock granted after wait. * /
/ uintmax_t st_region_nowait; /* Region lock granted without wait.
u_int32_t st_region_nowait; /* Region lock granted without wait. */
*/
u_int32_t st_hash_len; /* Max length of bucket. */ u_int32_t st_hash_len; /* Max length of bucket. */
roff_t st_regsize; /* Region size. */ roff_t st_regsize; /* Region size. */
#endif #endif
}; };
struct __db_lock_hstat { struct __db_lock_hstat {
u_int32_t st_nrequests; /* Number of lock gets. */ uintmax_t st_nrequests; /* Number of lock gets. */
u_int32_t st_nreleases; /* Number of lock puts. */ uintmax_t st_nreleases; /* Number of lock puts. */
u_int32_t st_nupgrade; /* Number of lock upgrades. */ uintmax_t st_nupgrade; /* Number of lock upgrades. */
u_int32_t st_ndowngrade; /* Number of lock downgrades. */ uintmax_t st_ndowngrade; /* Number of lock downgrades. */
u_int32_t st_nlocks; /* Current number of locks. */ u_int32_t st_nlocks; /* Current number of locks. */
u_int32_t st_maxnlocks; /* Maximum number of locks so far. * / u_int32_t st_maxnlocks; /* Maximum number of locks so far. * /
u_int32_t st_nobjects; /* Current number of objects. */ u_int32_t st_nobjects; /* Current number of objects. */
u_int32_t st_maxnobjects; /* Maximum number of objects so far. */ u_int32_t st_maxnobjects; /* Maximum number of objects so far. */
u_int32_t st_lock_wait; /* Lock conflicts w/ subsequent wait uintmax_t st_lock_wait; /* Lock conflicts w/ subsequent wait
*/ */
u_int32_t st_lock_nowait; /* Lock conflicts w/o subsequent wai uintmax_t st_lock_nowait; /* Lock conflicts w/o subsequent wai
t */ t */
u_int32_t st_nlocktimeouts; /* Number of lock timeouts. */ uintmax_t st_nlocktimeouts; /* Number of lock timeouts. */
u_int32_t st_ntxntimeouts; /* Number of transaction timeouts. * uintmax_t st_ntxntimeouts; /* Number of transaction timeouts. *
/ /
u_int32_t st_hash_len; /* Max length of bucket. */ u_int32_t st_hash_len; /* Max length of bucket. */
}; };
struct __db_lock_pstat { struct __db_lock_pstat {
u_int32_t st_nlocks; /* Current number of locks. */ u_int32_t st_nlocks; /* Current number of locks. */
u_int32_t st_maxnlocks; /* Maximum number of locks so far. * / u_int32_t st_maxnlocks; /* Maximum number of locks so far. * /
u_int32_t st_nobjects; /* Current number of objects. */ u_int32_t st_nobjects; /* Current number of objects. */
u_int32_t st_maxnobjects; /* Maximum number of objects so far. */ u_int32_t st_maxnobjects; /* Maximum number of objects so far. */
u_int32_t st_locksteals; /* Number of lock steals so far. */ uintmax_t st_locksteals; /* Number of lock steals so far. */
u_int32_t st_objectsteals; /* Number of objects steals so far. uintmax_t st_objectsteals; /* Number of objects steals so far.
*/ */
}; };
/* /*
* DB_LOCK_ILOCK -- * DB_LOCK_ILOCK --
* Internal DB access method lock. * Internal DB access method lock.
*/ */
struct __db_ilock { struct __db_ilock {
db_pgno_t pgno; /* Page being locked. */ db_pgno_t pgno; /* Page being locked. */
u_int8_t fileid[DB_FILE_ID_LEN];/* File id. */ u_int8_t fileid[DB_FILE_ID_LEN];/* File id. */
#define DB_HANDLE_LOCK 1 #define DB_HANDLE_LOCK 1
skipping to change at line 407 skipping to change at line 415
db_lockop_t op; /* Operation. */ db_lockop_t op; /* Operation. */
db_lockmode_t mode; /* Requested mode. */ db_lockmode_t mode; /* Requested mode. */
db_timeout_t timeout; /* Time to expire lock. */ db_timeout_t timeout; /* Time to expire lock. */
DBT *obj; /* Object being locked. */ DBT *obj; /* Object being locked. */
DB_LOCK lock; /* Lock returned. */ DB_LOCK lock; /* Lock returned. */
}; };
/******************************************************* /*******************************************************
* Logging. * Logging.
*******************************************************/ *******************************************************/
#define DB_LOGVERSION 14 /* Current log version. */ #define DB_LOGVERSION 17 /* Current log version. */
#define DB_LOGVERSION_LATCHING 15 /* Log version using latching. */
#define DB_LOGCHKSUM 12 /* Check sum headers. */
#define DB_LOGOLDVER 8 /* Oldest log version suppor ted. */ #define DB_LOGOLDVER 8 /* Oldest log version suppor ted. */
#define DB_LOGMAGIC 0x040988 #define DB_LOGMAGIC 0x040988
/* /*
* A DB_LSN has two parts, a fileid which identifies a specific file, and a n * A DB_LSN has two parts, a fileid which identifies a specific file, and a n
* offset within that file. The fileid is an unsigned 4-byte quantity that * offset within that file. The fileid is an unsigned 4-byte quantity that
* uniquely identifies a file within the log directory -- currently a simpl e * uniquely identifies a file within the log directory -- currently a simpl e
* counter inside the log. The offset is also an unsigned 4-byte value. T he * counter inside the log. The offset is also an unsigned 4-byte value. T he
* log manager guarantees the offset is never more than 4 bytes by switchin g * log manager guarantees the offset is never more than 4 bytes by switchin g
* to a new log file before the maximum length imposed by an unsigned 4-byt e * to a new log file before the maximum length imposed by an unsigned 4-byt e
skipping to change at line 482 skipping to change at line 492
/* Log statistics structure. */ /* Log statistics structure. */
struct __db_log_stat { struct __db_log_stat {
u_int32_t st_magic; /* Log file magic number. */ u_int32_t st_magic; /* Log file magic number. */
u_int32_t st_version; /* Log file version number. */ u_int32_t st_version; /* Log file version number. */
int st_mode; /* Log file permissions mode. */ int st_mode; /* Log file permissions mode. */
u_int32_t st_lg_bsize; /* Log buffer size. */ u_int32_t st_lg_bsize; /* Log buffer size. */
u_int32_t st_lg_size; /* Log file size. */ u_int32_t st_lg_size; /* Log file size. */
u_int32_t st_wc_bytes; /* Bytes to log since checkpoint. */ u_int32_t st_wc_bytes; /* Bytes to log since checkpoint. */
u_int32_t st_wc_mbytes; /* Megabytes to log since checkpoint . */ u_int32_t st_wc_mbytes; /* Megabytes to log since checkpoint . */
#ifndef __TEST_DB_NO_STATISTICS #ifndef __TEST_DB_NO_STATISTICS
u_int32_t st_record; /* Records entered into the log. */ uintmax_t st_record; /* Records entered into the log. */
u_int32_t st_w_bytes; /* Bytes to log. */ u_int32_t st_w_bytes; /* Bytes to log. */
u_int32_t st_w_mbytes; /* Megabytes to log. */ u_int32_t st_w_mbytes; /* Megabytes to log. */
u_int32_t st_wcount; /* Total I/O writes to the log. */ uintmax_t st_wcount; /* Total I/O writes to the log. */
u_int32_t st_wcount_fill; /* Overflow writes to the log. */ uintmax_t st_wcount_fill; /* Overflow writes to the log. */
u_int32_t st_rcount; /* Total I/O reads from the log. */ uintmax_t st_rcount; /* Total I/O reads from the log. */
u_int32_t st_scount; /* Total syncs to the log. */ uintmax_t st_scount; /* Total syncs to the log. */
u_int32_t st_region_wait; /* Region lock granted after wait. * uintmax_t st_region_wait; /* Region lock granted after wait. *
/ /
u_int32_t st_region_nowait; /* Region lock granted without wait. uintmax_t st_region_nowait; /* Region lock granted without wait.
*/ */
u_int32_t st_cur_file; /* Current log file number. */ u_int32_t st_cur_file; /* Current log file number. */
u_int32_t st_cur_offset; /* Current log file offset. */ u_int32_t st_cur_offset; /* Current log file offset. */
u_int32_t st_disk_file; /* Known on disk log file number. */ u_int32_t st_disk_file; /* Known on disk log file number. */
u_int32_t st_disk_offset; /* Known on disk log file offset. */ u_int32_t st_disk_offset; /* Known on disk log file offset. */
u_int32_t st_maxcommitperflush; /* Max number of commits in a flush. */ u_int32_t st_maxcommitperflush; /* Max number of commits in a flush. */
u_int32_t st_mincommitperflush; /* Min number of commits in a flush. */ u_int32_t st_mincommitperflush; /* Min number of commits in a flush. */
roff_t st_regsize; /* Region size. */ roff_t st_regsize; /* Region size. */
#endif #endif
}; };
/* /*
* We need to record the first log record of a transaction. For user * We need to record the first log record of a transaction. For user
* defined logging this macro returns the place to put that information, * defined logging this macro returns the place to put that information,
* if it is need in rlsnp, otherwise it leaves it unchanged. We also * if it is need in rlsnp, otherwise it leaves it unchanged. We also
* need to track the last record of the transaction, this returns the * need to track the last record of the transaction, this returns the
* place to put that info. * place to put that info.
*/ */
#define DB_SET_TXN_LSNP(txn, blsnp, llsnp) \ #define DB_SET_TXN_LSNP(txn, blsnp, llsnp) \
((txn)->set_txn_lsnp(txn, blsnp, llsnp)) ((txn)->set_txn_lsnp(txn, blsnp, llsnp))
/*
* Definition of the structure which specifies marshalling of log records.
*/
typedef enum {
LOGREC_Done,
LOGREC_ARG,
LOGREC_HDR,
LOGREC_DATA,
LOGREC_DB,
LOGREC_DBOP,
LOGREC_DBT,
LOGREC_LOCKS,
LOGREC_OP,
LOGREC_PGDBT,
LOGREC_PGDDBT,
LOGREC_PGLIST,
LOGREC_POINTER,
LOGREC_TIME
} log_rec_type_t;
typedef const struct __log_rec_spec {
log_rec_type_t type;
u_int32_t offset;
const char *name;
const char fmt[4];
} DB_LOG_RECSPEC;
/*
* Size of a DBT in a log record.
*/
#define LOG_DBT_SIZE(dbt)
\
(sizeof(u_int32_t) + ((dbt) == NULL ? 0 : (dbt)->size))
/******************************************************* /*******************************************************
* Shared buffer cache (mpool). * Shared buffer cache (mpool).
*******************************************************/ *******************************************************/
/* Priority values for DB_MPOOLFILE->{put,set_priority}. */ /* Priority values for DB_MPOOLFILE->{put,set_priority}. */
typedef enum { typedef enum {
DB_PRIORITY_UNCHANGED=0, DB_PRIORITY_UNCHANGED=0,
DB_PRIORITY_VERY_LOW=1, DB_PRIORITY_VERY_LOW=1,
DB_PRIORITY_LOW=2, DB_PRIORITY_LOW=2,
DB_PRIORITY_DEFAULT=3, DB_PRIORITY_DEFAULT=3,
DB_PRIORITY_HIGH=4, DB_PRIORITY_HIGH=4,
skipping to change at line 629 skipping to change at line 672
u_int32_t st_bytes; /* Total cache size: B. */ u_int32_t st_bytes; /* Total cache size: B. */
u_int32_t st_ncache; /* Number of cache regions. */ u_int32_t st_ncache; /* Number of cache regions. */
u_int32_t st_max_ncache; /* Maximum number of regions. */ u_int32_t st_max_ncache; /* Maximum number of regions. */
size_t st_mmapsize; /* Maximum file size for mmap. */ size_t st_mmapsize; /* Maximum file size for mmap. */
int st_maxopenfd; /* Maximum number of open fd's. */ int st_maxopenfd; /* Maximum number of open fd's. */
int st_maxwrite; /* Maximum buffers to write. */ int st_maxwrite; /* Maximum buffers to write. */
db_timeout_t st_maxwrite_sleep; /* Sleep after writing max buffers. */ db_timeout_t st_maxwrite_sleep; /* Sleep after writing max buffers. */
u_int32_t st_pages; /* Total number of pages. */ u_int32_t st_pages; /* Total number of pages. */
#ifndef __TEST_DB_NO_STATISTICS #ifndef __TEST_DB_NO_STATISTICS
u_int32_t st_map; /* Pages from mapped files. */ u_int32_t st_map; /* Pages from mapped files. */
u_int32_t st_cache_hit; /* Pages found in the cache. */ uintmax_t st_cache_hit; /* Pages found in the cache. */
u_int32_t st_cache_miss; /* Pages not found in the cache. */ uintmax_t st_cache_miss; /* Pages not found in the cache. */
u_int32_t st_page_create; /* Pages created in the cache. */ uintmax_t st_page_create; /* Pages created in the cache. */
u_int32_t st_page_in; /* Pages read in. */ uintmax_t st_page_in; /* Pages read in. */
u_int32_t st_page_out; /* Pages written out. */ uintmax_t st_page_out; /* Pages written out. */
u_int32_t st_ro_evict; /* Clean pages forced from the cache uintmax_t st_ro_evict; /* Clean pages forced from the cache
. */ . */
u_int32_t st_rw_evict; /* Dirty pages forced from the cache uintmax_t st_rw_evict; /* Dirty pages forced from the cache
. */ . */
u_int32_t st_page_trickle; /* Pages written by memp_trickle. */ uintmax_t st_page_trickle; /* Pages written by memp_trickle. */
u_int32_t st_page_clean; /* Clean pages. */ u_int32_t st_page_clean; /* Clean pages. */
u_int32_t st_page_dirty; /* Dirty pages. */ u_int32_t st_page_dirty; /* Dirty pages. */
u_int32_t st_hash_buckets; /* Number of hash buckets. */ u_int32_t st_hash_buckets; /* Number of hash buckets. */
u_int32_t st_pagesize; /* Assumed page size. */
u_int32_t st_hash_searches; /* Total hash chain searches. */ u_int32_t st_hash_searches; /* Total hash chain searches. */
u_int32_t st_hash_longest; /* Longest hash chain searched. */ u_int32_t st_hash_longest; /* Longest hash chain searched. */
u_int32_t st_hash_examined; /* Total hash entries searched. */ uintmax_t st_hash_examined; /* Total hash entries searched. */
u_int32_t st_hash_nowait; /* Hash lock granted with nowait. */ uintmax_t st_hash_nowait; /* Hash lock granted with nowait. */
u_int32_t st_hash_wait; /* Hash lock granted after wait. */ uintmax_t st_hash_wait; /* Hash lock granted after wait. */
u_int32_t st_hash_max_nowait; /* Max hash lock granted with nowait uintmax_t st_hash_max_nowait; /* Max hash lock granted with nowait
. */ . */
u_int32_t st_hash_max_wait; /* Max hash lock granted after wait. uintmax_t st_hash_max_wait; /* Max hash lock granted after wait.
*/ */
u_int32_t st_region_nowait; /* Region lock granted with nowait. uintmax_t st_region_nowait; /* Region lock granted with nowait.
*/ */
u_int32_t st_region_wait; /* Region lock granted after wait. * uintmax_t st_region_wait; /* Region lock granted after wait. *
/ /
u_int32_t st_mvcc_frozen; /* Buffers frozen. */ uintmax_t st_mvcc_frozen; /* Buffers frozen. */
u_int32_t st_mvcc_thawed; /* Buffers thawed. */ uintmax_t st_mvcc_thawed; /* Buffers thawed. */
u_int32_t st_mvcc_freed; /* Frozen buffers freed. */ uintmax_t st_mvcc_freed; /* Frozen buffers freed. */
u_int32_t st_alloc; /* Number of page allocations. */ uintmax_t st_alloc; /* Number of page allocations. */
u_int32_t st_alloc_buckets; /* Buckets checked during allocation uintmax_t st_alloc_buckets; /* Buckets checked during allocation
. */ . */
u_int32_t st_alloc_max_buckets; /* Max checked during allocation. */ uintmax_t st_alloc_max_buckets;/* Max checked during allocation. */
u_int32_t st_alloc_pages; /* Pages checked during allocation. uintmax_t st_alloc_pages; /* Pages checked during allocation.
*/ */
u_int32_t st_alloc_max_pages; /* Max checked during allocation. */ uintmax_t st_alloc_max_pages; /* Max checked during allocation. */
u_int32_t st_io_wait; /* Thread waited on buffer I/O. */ uintmax_t st_io_wait; /* Thread waited on buffer I/O. */
uintmax_t st_sync_interrupted; /* Number of times sync interrupted.
*/
roff_t st_regsize; /* Region size. */ roff_t st_regsize; /* Region size. */
#endif #endif
}; };
/* Mpool file statistics structure. */ /* Mpool file statistics structure. */
struct __db_mpool_fstat { struct __db_mpool_fstat {
char *file_name; /* File name. */ char *file_name; /* File name. */
u_int32_t st_pagesize; /* Page size. */ u_int32_t st_pagesize; /* Page size. */
#ifndef __TEST_DB_NO_STATISTICS #ifndef __TEST_DB_NO_STATISTICS
u_int32_t st_map; /* Pages from mapped files. */ u_int32_t st_map; /* Pages from mapped files. */
u_int32_t st_cache_hit; /* Pages found in the cache. */ uintmax_t st_cache_hit; /* Pages found in the cache. */
u_int32_t st_cache_miss; /* Pages not found in the cache. */ uintmax_t st_cache_miss; /* Pages not found in the cache. */
u_int32_t st_page_create; /* Pages created in the cache. */ uintmax_t st_page_create; /* Pages created in the cache. */
u_int32_t st_page_in; /* Pages read in. */ uintmax_t st_page_in; /* Pages read in. */
u_int32_t st_page_out; /* Pages written out. */ uintmax_t st_page_out; /* Pages written out. */
#endif #endif
}; };
/******************************************************* /*******************************************************
* Transactions and recovery. * Transactions and recovery.
*******************************************************/ *******************************************************/
#define DB_TXNVERSION 1 #define DB_TXNVERSION 1
typedef enum { typedef enum {
DB_TXN_ABORT=0, /* Public. */ DB_TXN_ABORT=0, /* Public. */
DB_TXN_APPLY=1, /* Public. */ DB_TXN_APPLY=1, /* Public. */
DB_TXN_BACKWARD_ROLL=3, /* Public. */ DB_TXN_BACKWARD_ROLL=3, /* Public. */
DB_TXN_FORWARD_ROLL=4, /* Public. */ DB_TXN_FORWARD_ROLL=4, /* Public. */
DB_TXN_OPENFILES=5, /* Internal. */ DB_TXN_OPENFILES=5, /* Internal. */
DB_TXN_POPENFILES=6, /* Internal. */ DB_TXN_POPENFILES=6, /* Internal. */
DB_TXN_PRINT=7 /* Public. */ DB_TXN_PRINT=7, /* Public. */
DB_TXN_LOG_VERIFY=8 /* Internal. */
} db_recops; } db_recops;
/* /*
* BACKWARD_ALLOC is used during the forward pass to pick up any aborted * BACKWARD_ALLOC is used during the forward pass to pick up any aborted
* allocations for files that were created during the forward pass. * allocations for files that were created during the forward pass.
* The main difference between _ALLOC and _ROLL is that the entry for * The main difference between _ALLOC and _ROLL is that the entry for
* the file not exist during the rollforward pass. * the file not exist during the rollforward pass.
*/ */
#define DB_UNDO(op) ((op) == DB_TXN_ABORT || (op) == DB_TXN_BACK WARD_ROLL) #define DB_UNDO(op) ((op) == DB_TXN_ABORT || (op) == DB_TXN_BACK WARD_ROLL)
#define DB_REDO(op) ((op) == DB_TXN_FORWARD_ROLL || (op) == DB_T XN_APPLY) #define DB_REDO(op) ((op) == DB_TXN_FORWARD_ROLL || (op) == DB_T XN_APPLY)
struct __db_txn { struct __db_txn {
DB_TXNMGR *mgrp; /* Pointer to transaction manager. * / DB_TXNMGR *mgrp; /* Pointer to transaction manager. * /
DB_TXN *parent; /* Pointer to transaction's parent. */ DB_TXN *parent; /* Pointer to transaction's parent. */
DB_THREAD_INFO *thread_info; /* Pointer to thread information. */ DB_THREAD_INFO *thread_info; /* Pointer to thread information. */
u_int32_t txnid; /* Unique transaction id. */ u_int32_t txnid; /* Unique transaction id. */
char *name; /* Transaction name. */ char *name; /* Transaction name. */
DB_LOCKER *locker; /* Locker for this txn. */ DB_LOCKER *locker; /* Locker for this txn. */
db_threadid_t tid; /* Thread id for use in MT XA. */
void *td; /* Detail structure within region. * / void *td; /* Detail structure within region. * /
db_timeout_t lock_timeout; /* Timeout for locks for this txn. * / db_timeout_t lock_timeout; /* Timeout for locks for this txn. * /
db_timeout_t expire; /* Time transaction expires. */ db_timeout_t expire; /* Time transaction expires. */
void *txn_list; /* Undo information for parent. */ void *txn_list; /* Undo information for parent. */
/* /*
* !!! * !!!
* Explicit representations of structures from queue.h. * Explicit representations of structures from queue.h.
* TAILQ_ENTRY(__db_txn) links; * TAILQ_ENTRY(__db_txn) links;
* TAILQ_ENTRY(__db_txn) xalinks;
*/ */
struct { struct {
struct __db_txn *tqe_next; struct __db_txn *tqe_next;
struct __db_txn **tqe_prev; struct __db_txn **tqe_prev;
} links; /* Links transactions off manager. * / } links; /* Links transactions off manager. * /
struct {
struct __db_txn *tqe_next;
struct __db_txn **tqe_prev;
} xalinks; /* Links active XA transactions. */
/* /*
* !!! * !!!
* Explicit representations of structures from queue.h. * Explicit representations of structures from queue.h.
* TAILQ_HEAD(__kids, __db_txn) kids; * TAILQ_HEAD(__kids, __db_txn) kids;
*/ */
struct __kids { struct __kids {
struct __db_txn *tqh_first; struct __db_txn *tqh_first;
struct __db_txn **tqh_last; struct __db_txn **tqh_last;
} kids; } kids;
skipping to change at line 770 skipping to change at line 810
/* /*
* !!! * !!!
* Explicit representations of structures from queue.h. * Explicit representations of structures from queue.h.
* TAILQ_ENTRY(__db_txn) klinks; * TAILQ_ENTRY(__db_txn) klinks;
*/ */
struct { struct {
struct __db_txn *tqe_next; struct __db_txn *tqe_next;
struct __db_txn **tqe_prev; struct __db_txn **tqe_prev;
} klinks; } klinks;
/*
* !!!
* Explicit representations of structures from queue.h.
* TAILQ_HEAD(__my_cursors, __dbc) my_cursors;
*/
struct __my_cursors {
struct __dbc *tqh_first;
struct __dbc **tqh_last;
} my_cursors;
DB_TXN_TOKEN *token_buffer; /* User's commit token buffer. */
void *api_internal; /* C++ API private. */ void *api_internal; /* C++ API private. */
void *xml_internal; /* XML API private. */ void *xml_internal; /* XML API private. */
u_int32_t cursors; /* Number of cursors open for txn */ u_int32_t cursors; /* Number of cursors open for txn */
/* DB_TXN PUBLIC HANDLE LIST BEGIN */ /* DB_TXN PUBLIC HANDLE LIST BEGIN */
int (*abort) __P((DB_TXN *)); int (*abort) __P((DB_TXN *));
int (*commit) __P((DB_TXN *, u_int32_t)); int (*commit) __P((DB_TXN *, u_int32_t));
int (*discard) __P((DB_TXN *, u_int32_t)); int (*discard) __P((DB_TXN *, u_int32_t));
int (*get_name) __P((DB_TXN *, const char **)); int (*get_name) __P((DB_TXN *, const char **));
int (*get_priority) __P((DB_TXN *, u_int32_t *));
u_int32_t (*id) __P((DB_TXN *)); u_int32_t (*id) __P((DB_TXN *));
int (*prepare) __P((DB_TXN *, u_int8_t *)); int (*prepare) __P((DB_TXN *, u_int8_t *));
int (*set_commit_token) __P((DB_TXN *, DB_TXN_TOKEN *));
int (*set_name) __P((DB_TXN *, const char *)); int (*set_name) __P((DB_TXN *, const char *));
int (*set_priority) __P((DB_TXN *, u_int32_t));
int (*set_timeout) __P((DB_TXN *, db_timeout_t, u_int32_t)); int (*set_timeout) __P((DB_TXN *, db_timeout_t, u_int32_t));
/* DB_TXN PUBLIC HANDLE LIST END */ /* DB_TXN PUBLIC HANDLE LIST END */
/* DB_TXN PRIVATE HANDLE LIST BEGIN */ /* DB_TXN PRIVATE HANDLE LIST BEGIN */
void (*set_txn_lsnp) __P((DB_TXN *txn, DB_LSN **, DB_LSN **)); void (*set_txn_lsnp) __P((DB_TXN *txn, DB_LSN **, DB_LSN **));
/* DB_TXN PRIVATE HANDLE LIST END */ /* DB_TXN PRIVATE HANDLE LIST END */
#define TXN_CHILDCOMMIT 0x0001 /* Txn has committed. */ #define TXN_CHILDCOMMIT 0x00001 /* Txn has committed. */
#define TXN_CDSGROUP 0x0002 /* CDS group handle. */ #define TXN_COMPENSATE 0x00002 /* Compensating transaction.
#define TXN_COMPENSATE 0x0004 /* Compensating transaction. */
*/ #define TXN_DEADLOCK 0x00004 /* Txn has deadlocked. */
#define TXN_DEADLOCK 0x0008 /* Txn has deadlocked. */ #define TXN_FAMILY 0x00008 /* Cursors/children are inde
#define TXN_LOCKTIMEOUT 0x0010 /* Txn has a lock timeout. * pendent. */
/ #define TXN_IGNORE_LEASE 0x00010 /* Skip lease check at commi
#define TXN_MALLOC 0x0020 /* Structure allocated by TX t time. */
N system. */ #define TXN_INFAMILY 0x00020 /* Part of a transaction fam
#define TXN_NOSYNC 0x0040 /* Do not sync on prepare an ily. */
d commit. */ #define TXN_LOCKTIMEOUT 0x00040 /* Txn has a lock timeout. *
#define TXN_NOWAIT 0x0080 /* Do not wait on locks. */ /
#define TXN_PRIVATE 0x0100 /* Txn owned by cursor.. */ #define TXN_MALLOC 0x00080 /* Structure allocated by TX
#define TXN_READ_COMMITTED 0x0200 /* Txn has degree 2 isolatio N system. */
n. */ #define TXN_NOSYNC 0x00100 /* Do not sync on prepare an
#define TXN_READ_UNCOMMITTED 0x0400 /* Txn has degree 1 isolatio d commit. */
n. */ #define TXN_NOWAIT 0x00200 /* Do not wait on locks. */
#define TXN_RESTORED 0x0800 /* Txn has been restored. */ #define TXN_PRIVATE 0x00400 /* Txn owned by cursor. */
#define TXN_SNAPSHOT 0x1000 /* Snapshot Isolation. */ #define TXN_READONLY 0x00800 /* CDS group handle. */
#define TXN_SYNC 0x2000 /* Write and sync on prepare #define TXN_READ_COMMITTED 0x01000 /* Txn has degree 2 isolatio
/commit. */ n. */
#define TXN_WRITE_NOSYNC 0x4000 /* Write only on prepare/com #define TXN_READ_UNCOMMITTED 0x02000 /* Txn has degree 1 isolatio
mit. */ n. */
#define TXN_RESTORED 0x04000 /* Txn has been restored. */
#define TXN_SNAPSHOT 0x08000 /* Snapshot Isolation. */
#define TXN_SYNC 0x10000 /* Write and sync on prepare
/commit. */
#define TXN_WRITE_NOSYNC 0x20000 /* Write only on prepare/com
mit. */
u_int32_t flags; u_int32_t flags;
}; };
#define TXN_SYNC_FLAGS (TXN_SYNC | TXN_NOSYNC | TXN_WRITE_NOSYNC) #define TXN_SYNC_FLAGS (TXN_SYNC | TXN_NOSYNC | TXN_WRITE_NOSYNC)
/* /*
* Structure used for two phase commit interface. Berkeley DB support for * Structure used for two phase commit interface.
two * We set the size of our global transaction id (gid) to be 128 in order
* phase commit is compatible with the X/Open XA interface. * to match that defined by the XA X/Open standard.
*
* The XA #define XIDDATASIZE defines the size of a global transaction ID.
We
* have our own version here (for name space reasons) which must have the s
ame
* value.
*/ */
#define DB_XIDDATASIZE 128 #define DB_GID_SIZE 128
struct __db_preplist { struct __db_preplist {
DB_TXN *txn; DB_TXN *txn;
u_int8_t gid[DB_XIDDATASIZE]; u_int8_t gid[DB_GID_SIZE];
}; };
/* Transaction statistics structure. */ /* Transaction statistics structure. */
struct __db_txn_active { struct __db_txn_active {
u_int32_t txnid; /* Transaction ID */ u_int32_t txnid; /* Transaction ID */
u_int32_t parentid; /* Transaction ID of parent */ u_int32_t parentid; /* Transaction ID of parent */
pid_t pid; /* Process owning txn ID */ pid_t pid; /* Process owning txn ID */
db_threadid_t tid; /* Thread owning txn ID */ db_threadid_t tid; /* Thread owning txn ID */
DB_LSN lsn; /* LSN when transaction began */ DB_LSN lsn; /* LSN when transaction began */
DB_LSN read_lsn; /* Read LSN for MVCC */ DB_LSN read_lsn; /* Read LSN for MVCC */
u_int32_t mvcc_ref; /* MVCC reference count */ u_int32_t mvcc_ref; /* MVCC reference count */
u_int32_t priority; /* Deadlock resolution priority */
#define TXN_ABORTED 1 #define TXN_ABORTED 1
#define TXN_COMMITTED 2 #define TXN_COMMITTED 2
#define TXN_PREPARED 3 #define TXN_PREPARED 3
#define TXN_RUNNING 4 #define TXN_RUNNING 4
u_int32_t status; /* Status of the transaction */ u_int32_t status; /* Status of the transaction */
#define TXN_XA_ABORTED 1 u_int8_t gid[DB_GID_SIZE]; /* Global transaction ID */
#define TXN_XA_DEADLOCKED 2
#define TXN_XA_ENDED 3
#define TXN_XA_PREPARED 4
#define TXN_XA_STARTED 5
#define TXN_XA_SUSPENDED 6
u_int32_t xa_status; /* XA status */
u_int8_t xid[DB_XIDDATASIZE]; /* Global transaction ID */
char name[51]; /* 50 bytes of name, nul termination */ char name[51]; /* 50 bytes of name, nul termination */
}; };
struct __db_txn_stat { struct __db_txn_stat {
u_int32_t st_nrestores; /* number of restored transactions u_int32_t st_nrestores; /* number of restored transactions
after recovery. */ after recovery. */
#ifndef __TEST_DB_NO_STATISTICS #ifndef __TEST_DB_NO_STATISTICS
DB_LSN st_last_ckp; /* lsn of the last checkpoint */ DB_LSN st_last_ckp; /* lsn of the last checkpoint */
time_t st_time_ckp; /* time of last checkpoint */ time_t st_time_ckp; /* time of last checkpoint */
u_int32_t st_last_txnid; /* last transaction id given out */ u_int32_t st_last_txnid; /* last transaction id given out */
u_int32_t st_maxtxns; /* maximum txns possible */ u_int32_t st_maxtxns; /* maximum txns possible */
u_int32_t st_naborts; /* number of aborted transactions */ uintmax_t st_naborts; /* number of aborted transactions */
u_int32_t st_nbegins; /* number of begun transactions */ uintmax_t st_nbegins; /* number of begun transactions */
u_int32_t st_ncommits; /* number of committed transactions uintmax_t st_ncommits; /* number of committed transactions
*/ */
u_int32_t st_nactive; /* number of active transactions */ u_int32_t st_nactive; /* number of active transactions */
u_int32_t st_nsnapshot; /* number of snapshot transactions * / u_int32_t st_nsnapshot; /* number of snapshot transactions * /
u_int32_t st_maxnactive; /* maximum active transactions */ u_int32_t st_maxnactive; /* maximum active transactions */
u_int32_t st_maxnsnapshot; /* maximum snapshot transactions */ u_int32_t st_maxnsnapshot; /* maximum snapshot transactions */
DB_TXN_ACTIVE *st_txnarray; /* array of active transactions */ DB_TXN_ACTIVE *st_txnarray; /* array of active transactions */
u_int32_t st_region_wait; /* Region lock granted after wait. * uintmax_t st_region_wait; /* Region lock granted after wait. *
/ /
u_int32_t st_region_nowait; /* Region lock granted without wait. uintmax_t st_region_nowait; /* Region lock granted without wait.
*/ */
roff_t st_regsize; /* Region size. */ roff_t st_regsize; /* Region size. */
#endif #endif
}; };
#define DB_TXN_TOKEN_SIZE 20
struct __db_txn_token {
u_int8_t buf[DB_TXN_TOKEN_SIZE];
};
/******************************************************* /*******************************************************
* Replication. * Replication.
*******************************************************/ *******************************************************/
/* Special, out-of-band environment IDs. */ /* Special, out-of-band environment IDs. */
#define DB_EID_BROADCAST -1 #define DB_EID_BROADCAST -1
#define DB_EID_INVALID -2 #define DB_EID_INVALID -2
#define DB_REP_DEFAULT_PRIORITY 100 #define DB_REP_DEFAULT_PRIORITY 100
/* Acknowledgement policies. */ /* Acknowledgement policies. */
skipping to change at line 905 skipping to change at line 958
#define DB_REP_CHECKPOINT_DELAY 2 /* Master checkpoint delay. */ #define DB_REP_CHECKPOINT_DELAY 2 /* Master checkpoint delay. */
#define DB_REP_CONNECTION_RETRY 3 /* RepMgr connection s. */ #define DB_REP_CONNECTION_RETRY 3 /* RepMgr connection s. */
#define DB_REP_ELECTION_RETRY 4 /* RepMgr elect retr ies. */ #define DB_REP_ELECTION_RETRY 4 /* RepMgr elect retr ies. */
#define DB_REP_ELECTION_TIMEOUT 5 /* Rep normal electi ons. */ #define DB_REP_ELECTION_TIMEOUT 5 /* Rep normal electi ons. */
#define DB_REP_FULL_ELECTION_TIMEOUT 6 /* Rep full election s. */ #define DB_REP_FULL_ELECTION_TIMEOUT 6 /* Rep full election s. */
#define DB_REP_HEARTBEAT_MONITOR 7 /* RepMgr client HB monitor. */ #define DB_REP_HEARTBEAT_MONITOR 7 /* RepMgr client HB monitor. */
#define DB_REP_HEARTBEAT_SEND 8 /* RepMgr master sen d freq. */ #define DB_REP_HEARTBEAT_SEND 8 /* RepMgr master sen d freq. */
#define DB_REP_LEASE_TIMEOUT 9 /* Master leases. */ #define DB_REP_LEASE_TIMEOUT 9 /* Master leases. */
/* Event notification types. */ /* Event notification types. */
#define DB_EVENT_NO_SUCH_EVENT 0 /* out-of-band sentinel va #define DB_EVENT_PANIC 0
lue */ #define DB_EVENT_REG_ALIVE 1
#define DB_EVENT_PANIC 1 #define DB_EVENT_REG_PANIC 2
#define DB_EVENT_REP_CLIENT 2 #define DB_EVENT_REP_CLIENT 3
#define DB_EVENT_REP_ELECTED 3 #define DB_EVENT_REP_DUPMASTER 4
#define DB_EVENT_REP_MASTER 4 #define DB_EVENT_REP_ELECTED 5
#define DB_EVENT_REP_NEWMASTER 5 #define DB_EVENT_REP_ELECTION_FAILED 6
#define DB_EVENT_REP_PERM_FAILED 6 #define DB_EVENT_REP_JOIN_FAILURE 7
#define DB_EVENT_REP_STARTUPDONE 7 #define DB_EVENT_REP_MASTER 8
#define DB_EVENT_WRITE_FAILED 8 #define DB_EVENT_REP_MASTER_FAILURE 9
#define DB_EVENT_REP_NEWMASTER 10
#define DB_EVENT_REP_PERM_FAILED 11
#define DB_EVENT_REP_STARTUPDONE 12
#define DB_EVENT_WRITE_FAILED 13
#define DB_EVENT_NO_SUCH_EVENT 0xffffffff /* OOB sentinel
value */
/* Replication Manager site status. */ /* Replication Manager site status. */
struct __db_repmgr_site { struct __db_repmgr_site {
int eid; int eid;
char *host; char *host;
u_int port; u_int port;
#define DB_REPMGR_CONNECTED 0x01 #define DB_REPMGR_CONNECTED 1
#define DB_REPMGR_DISCONNECTED 0x02 #define DB_REPMGR_DISCONNECTED 2
u_int32_t status; u_int32_t status;
#define DB_REPMGR_ISPEER 0x01
u_int32_t flags;
}; };
/* Replication statistics. */ /* Replication statistics. */
struct __db_rep_stat { struct __db_rep_stat {
/* !!! /* !!!
* Many replication statistics fields cannot be protected by a mutex * Many replication statistics fields cannot be protected by a mutex
* without an unacceptable performance penalty, since most message * without an unacceptable performance penalty, since most message
* processing is done without the need to hold a region-wide lock. * processing is done without the need to hold a region-wide lock.
* Fields whose comments end with a '+' may be updated without holdi ng * Fields whose comments end with a '+' may be updated without holdi ng
* the replication or log mutexes (as appropriate), and thus may be * the replication or log mutexes (as appropriate), and thus may be
* off somewhat (or, on unreasonable architectures under unlucky * off somewhat (or, on unreasonable architectures under unlucky
* circumstances, garbaged). * circumstances, garbaged).
*/ */
u_int32_t st_log_queued; /* Log records currently queued.+ */
u_int32_t st_startup_complete; /* Site completed client sync-up. */ u_int32_t st_startup_complete; /* Site completed client sync-up. */
#ifndef __TEST_DB_NO_STATISTICS #ifndef __TEST_DB_NO_STATISTICS
uintmax_t st_log_queued; /* Log records currently queued.+ */
u_int32_t st_status; /* Current replication status. */ u_int32_t st_status; /* Current replication status. */
DB_LSN st_next_lsn; /* Next LSN to use or expect. */ DB_LSN st_next_lsn; /* Next LSN to use or expect. */
DB_LSN st_waiting_lsn; /* LSN we're awaiting, if any. */ DB_LSN st_waiting_lsn; /* LSN we're awaiting, if any. */
DB_LSN st_max_perm_lsn; /* Maximum permanent LSN. */ DB_LSN st_max_perm_lsn; /* Maximum permanent LSN. */
db_pgno_t st_next_pg; /* Next pg we expect. */ db_pgno_t st_next_pg; /* Next pg we expect. */
db_pgno_t st_waiting_pg; /* pg we're awaiting, if any. */ db_pgno_t st_waiting_pg; /* pg we're awaiting, if any. */
u_int32_t st_dupmasters; /* # of times a duplicate master u_int32_t st_dupmasters; /* # of times a duplicate master
condition was detected.+ */ condition was detected.+ */
int st_env_id; /* Current environment ID. */ int st_env_id; /* Current environment ID. */
u_int32_t st_env_priority; /* Current environment priority. */ u_int32_t st_env_priority; /* Current environment priority. */
u_int32_t st_bulk_fills; /* Bulk buffer fills. */ uintmax_t st_bulk_fills; /* Bulk buffer fills. */
u_int32_t st_bulk_overflows; /* Bulk buffer overflows. */ uintmax_t st_bulk_overflows; /* Bulk buffer overflows. */
u_int32_t st_bulk_records; /* Bulk records stored. */ uintmax_t st_bulk_records; /* Bulk records stored. */
u_int32_t st_bulk_transfers; /* Transfers of bulk buffers. */ uintmax_t st_bulk_transfers; /* Transfers of bulk buffers. */
u_int32_t st_client_rerequests; /* Number of forced rerequests. */ uintmax_t st_client_rerequests;/* Number of forced rerequests. */
u_int32_t st_client_svc_req; /* Number of client service requests uintmax_t st_client_svc_req; /* Number of client service requests
received by this client. */ received by this client. */
u_int32_t st_client_svc_miss; /* Number of client service requests uintmax_t st_client_svc_miss; /* Number of client service requests
missing on this client. */ missing on this client. */
u_int32_t st_gen; /* Current generation number. */ u_int32_t st_gen; /* Current generation number. */
u_int32_t st_egen; /* Current election gen number. */ u_int32_t st_egen; /* Current election gen number. */
u_int32_t st_log_duplicated; /* Log records received multiply.+ * uintmax_t st_log_duplicated; /* Log records received multiply.+ *
/ /
u_int32_t st_log_queued_max; /* Max. log records queued at once.+ uintmax_t st_log_queued_max; /* Max. log records queued at once.+
*/ */
u_int32_t st_log_queued_total; /* Total # of log recs. ever queued. uintmax_t st_log_queued_total; /* Total # of log recs. ever queued.
+ */ + */
u_int32_t st_log_records; /* Log records received and put.+ */ uintmax_t st_log_records; /* Log records received and put.+ */
u_int32_t st_log_requested; /* Log recs. missed and requested.+ uintmax_t st_log_requested; /* Log recs. missed and requested.+
*/ */
int st_master; /* Env. ID of the current master. */ int st_master; /* Env. ID of the current master. */
u_int32_t st_master_changes; /* # of times we've switched masters uintmax_t st_master_changes; /* # of times we've switched masters
. */ . */
u_int32_t st_msgs_badgen; /* Messages with a bad generation #. uintmax_t st_msgs_badgen; /* Messages with a bad generation #.
+ */ + */
u_int32_t st_msgs_processed; /* Messages received and processed.+ uintmax_t st_msgs_processed; /* Messages received and processed.+
*/ */
u_int32_t st_msgs_recover; /* Messages ignored because this sit uintmax_t st_msgs_recover; /* Messages ignored because this sit
e e
was a client in recovery.+ */ was a client in recovery.+ */
u_int32_t st_msgs_send_failures;/* # of failed message sends.+ */ uintmax_t st_msgs_send_failures;/* # of failed message sends.+ */
u_int32_t st_msgs_sent; /* # of successful message sends.+ * uintmax_t st_msgs_sent; /* # of successful message sends.+ */
/ uintmax_t st_newsites; /* # of NEWSITE msgs. received.+ */
u_int32_t st_newsites; /* # of NEWSITE msgs. received.+ */
u_int32_t st_nsites; /* Current number of sites we will u_int32_t st_nsites; /* Current number of sites we will
assume during elections. */ assume during elections. */
u_int32_t st_nthrottles; /* # of times we were throttled. */ uintmax_t st_nthrottles; /* # of times we were throttled. */
u_int32_t st_outdated; /* # of times we detected and return uintmax_t st_outdated; /* # of times we detected and return
ed ed
an OUTDATED condition.+ */ an OUTDATED condition.+ */
u_int32_t st_pg_duplicated; /* Pages received multiply.+ */ uintmax_t st_pg_duplicated; /* Pages received multiply.+ */
u_int32_t st_pg_records; /* Pages received and stored.+ */ uintmax_t st_pg_records; /* Pages received and stored.+ */
u_int32_t st_pg_requested; /* Pages missed and requested.+ */ uintmax_t st_pg_requested; /* Pages missed and requested.+ */
u_int32_t st_txns_applied; /* # of transactions applied.+ */ uintmax_t st_txns_applied; /* # of transactions applied.+ */
u_int32_t st_startsync_delayed; /* # of STARTSYNC msgs delayed.+ */ uintmax_t st_startsync_delayed;/* # of STARTSYNC msgs delayed.+ */
/* Elections generally. */ /* Elections generally. */
u_int32_t st_elections; /* # of elections held.+ */ uintmax_t st_elections; /* # of elections held.+ */
u_int32_t st_elections_won; /* # of elections won by this site.+ uintmax_t st_elections_won; /* # of elections won by this site.+
*/ */
/* Statistics about an in-progress election. */ /* Statistics about an in-progress election. */
int st_election_cur_winner; /* Current front-runner. */ int st_election_cur_winner; /* Current front-runner. */
u_int32_t st_election_gen; /* Election generation number. */ u_int32_t st_election_gen; /* Election generation number. */
DB_LSN st_election_lsn; /* Max. LSN of current winner. */ DB_LSN st_election_lsn; /* Max. LSN of current winner. */
u_int32_t st_election_nsites; /* # of "registered voters". */ u_int32_t st_election_nsites; /* # of "registered voters". */
u_int32_t st_election_nvotes; /* # of "registered voters" needed. */ u_int32_t st_election_nvotes; /* # of "registered voters" needed. */
u_int32_t st_election_priority; /* Current election priority. */ u_int32_t st_election_priority; /* Current election priority. */
int st_election_status; /* Current election status. */ int st_election_status; /* Current election status. */
u_int32_t st_election_tiebreaker;/* Election tiebreaker value. */ u_int32_t st_election_tiebreaker;/* Election tiebreaker value. */
u_int32_t st_election_votes; /* Votes received in this round. */ u_int32_t st_election_votes; /* Votes received in this round. */
u_int32_t st_election_sec; /* Last election time seconds. */ u_int32_t st_election_sec; /* Last election time seconds. */
u_int32_t st_election_usec; /* Last election time useconds. */ u_int32_t st_election_usec; /* Last election time useconds. */
u_int32_t st_max_lease_sec; /* Maximum lease timestamp seconds. */ u_int32_t st_max_lease_sec; /* Maximum lease timestamp seconds. */
u_int32_t st_max_lease_usec; /* Maximum lease timestamp useconds. */ u_int32_t st_max_lease_usec; /* Maximum lease timestamp useconds. */
/* Undocumented statistics only used by the test system. */
#ifdef CONFIG_TEST
u_int32_t st_filefail_cleanups; /* # of FILE_FAIL cleanups done. */
#endif
#endif #endif
}; };
/* Replication Manager statistics. */ /* Replication Manager statistics. */
struct __db_repmgr_stat { struct __db_repmgr_stat {
u_int32_t st_perm_failed; /* # of insufficiently ack'ed msgs. uintmax_t st_perm_failed; /* # of insufficiently ack'ed msgs.
*/ */
u_int32_t st_msgs_queued; /* # msgs queued for network delay. uintmax_t st_msgs_queued; /* # msgs queued for network delay.
*/ */
u_int32_t st_msgs_dropped; /* # msgs discarded due to excessive uintmax_t st_msgs_dropped; /* # msgs discarded due to excessive
queue length. */ queue length. */
u_int32_t st_connection_drop; /* Existing connections dropped. */ uintmax_t st_connection_drop; /* Existing connections dropped. */
u_int32_t st_connect_fail; /* Failed new connection attempts. * uintmax_t st_connect_fail; /* Failed new connection attempts. *
/ /
uintmax_t st_elect_threads; /* # of active election threads. */
uintmax_t st_max_elect_threads; /* Max concurrent e-threads ever. */
}; };
/******************************************************* /*******************************************************
* Sequences. * Sequences.
*******************************************************/ *******************************************************/
/* /*
* The storage record for a sequence. * The storage record for a sequence.
*/ */
struct __db_seq_record { struct __db_seq_record {
u_int32_t seq_version; /* Version size/number. */ u_int32_t seq_version; /* Version size/number. */
skipping to change at line 1072 skipping to change at line 1141
int (*set_cachesize) __P((DB_SEQUENCE *, int32_t)); int (*set_cachesize) __P((DB_SEQUENCE *, int32_t));
int (*set_flags) __P((DB_SEQUENCE *, u_int32_t)); int (*set_flags) __P((DB_SEQUENCE *, u_int32_t));
int (*set_range) __P((DB_SEQUENCE *, db_seq_t, db_seq_t) ); int (*set_range) __P((DB_SEQUENCE *, db_seq_t, db_seq_t) );
int (*stat) __P((DB_SEQUENCE *, int (*stat) __P((DB_SEQUENCE *,
DB_SEQUENCE_STAT **, u_int32_t)); DB_SEQUENCE_STAT **, u_int32_t));
int (*stat_print) __P((DB_SEQUENCE *, u_int32_t)); int (*stat_print) __P((DB_SEQUENCE *, u_int32_t));
/* DB_SEQUENCE PUBLIC HANDLE LIST END */ /* DB_SEQUENCE PUBLIC HANDLE LIST END */
}; };
struct __db_seq_stat { struct __db_seq_stat {
u_int32_t st_wait; /* Sequence lock granted w/o wait. * uintmax_t st_wait; /* Sequence lock granted w/o wait. *
/ /
u_int32_t st_nowait; /* Sequence lock granted after wait. uintmax_t st_nowait; /* Sequence lock granted after wait.
*/ */
db_seq_t st_current; /* Current value in db. */ db_seq_t st_current; /* Current value in db. */
db_seq_t st_value; /* Current cached value. */ db_seq_t st_value; /* Current cached value. */
db_seq_t st_last_value; /* Last cached value. */ db_seq_t st_last_value; /* Last cached value. */
db_seq_t st_min; /* Minimum value. */ db_seq_t st_min; /* Minimum value. */
db_seq_t st_max; /* Maximum value. */ db_seq_t st_max; /* Maximum value. */
int32_t st_cache_size; /* Cache size. */ int32_t st_cache_size; /* Cache size. */
u_int32_t st_flags; /* Flag value. */ u_int32_t st_flags; /* Flag value. */
}; };
/******************************************************* /*******************************************************
skipping to change at line 1136 skipping to change at line 1205
#define DB_JOIN_ITEM 12 /* Dbc.get; don't do primary lookup */ #define DB_JOIN_ITEM 12 /* Dbc.get; don't do primary lookup */
#define DB_KEYFIRST 13 /* Dbc.put */ #define DB_KEYFIRST 13 /* Dbc.put */
#define DB_KEYLAST 14 /* Dbc.put */ #define DB_KEYLAST 14 /* Dbc.put */
#define DB_LAST 15 /* Dbc.get, DbLogc->get */ #define DB_LAST 15 /* Dbc.get, DbLogc->get */
#define DB_NEXT 16 /* Dbc.get, DbLogc->get */ #define DB_NEXT 16 /* Dbc.get, DbLogc->get */
#define DB_NEXT_DUP 17 /* Dbc.get */ #define DB_NEXT_DUP 17 /* Dbc.get */
#define DB_NEXT_NODUP 18 /* Dbc.get */ #define DB_NEXT_NODUP 18 /* Dbc.get */
#define DB_NODUPDATA 19 /* Db.put, Dbc.put */ #define DB_NODUPDATA 19 /* Db.put, Dbc.put */
#define DB_NOOVERWRITE 20 /* Db.put */ #define DB_NOOVERWRITE 20 /* Db.put */
#define DB_NOSYNC 21 /* Db.close */ #define DB_NOSYNC 21 /* Db.close */
#define DB_POSITION 22 /* Dbc.dup */ #define DB_OVERWRITE_DUP 22 /* Dbc.put, Db.put; no DB_KE
#define DB_PREV 23 /* Dbc.get, DbLogc->get */ YEXIST */
#define DB_PREV_DUP 24 /* Dbc.get */ #define DB_POSITION 23 /* Dbc.dup */
#define DB_PREV_NODUP 25 /* Dbc.get */ #define DB_PREV 24 /* Dbc.get, DbLogc->get */
#define DB_SET 26 /* Dbc.get, DbLogc->get */ #define DB_PREV_DUP 25 /* Dbc.get */
#define DB_SET_RANGE 27 /* Dbc.get */ #define DB_PREV_NODUP 26 /* Dbc.get */
#define DB_SET_RECNO 28 /* Db.get, Dbc.get */ #define DB_SET 27 /* Dbc.get, DbLogc->get */
#define DB_UPDATE_SECONDARY 29 /* Dbc.get, Dbc.del (interna #define DB_SET_RANGE 28 /* Dbc.get */
l) */ #define DB_SET_RECNO 29 /* Db.get, Dbc.get */
#define DB_WRITECURSOR 30 /* Db.cursor */ #define DB_UPDATE_SECONDARY 30 /* Dbc.get, Dbc.del (interna
#define DB_WRITELOCK 31 /* Db.cursor (internal) */ l) */
#define DB_SET_LTE 31 /* Dbc.get (internal) */
#define DB_GET_BOTH_LTE 32 /* Dbc.get (internal) */
/* This has to change when the max opcode hits 255. */ /* This has to change when the max opcode hits 255. */
#define DB_OPFLAGS_MASK 0x000000ff /* Mask for operations flags . */ #define DB_OPFLAGS_MASK 0x000000ff /* Mask for operations flags . */
/* /*
* DB (user visible) error return codes. * DB (user visible) error return codes.
* *
* !!! * !!!
* We don't want our error returns to conflict with other packages where * We don't want our error returns to conflict with other packages where
* possible, so pick a base error value that's hopefully not common. We * possible, so pick a base error value that's hopefully not common. We
skipping to change at line 1167 skipping to change at line 1237
*/ */
/* DB (public) error return codes. */ /* DB (public) error return codes. */
#define DB_BUFFER_SMALL (-30999)/* User memory too small for return. */ #define DB_BUFFER_SMALL (-30999)/* User memory too small for return. */
#define DB_DONOTINDEX (-30998)/* "Null" return from 2ndary callbk. */ #define DB_DONOTINDEX (-30998)/* "Null" return from 2ndary callbk. */
#define DB_FOREIGN_CONFLICT (-30997)/* A foreign db constraint t riggered. */ #define DB_FOREIGN_CONFLICT (-30997)/* A foreign db constraint t riggered. */
#define DB_KEYEMPTY (-30996)/* Key/data deleted or never created. */ #define DB_KEYEMPTY (-30996)/* Key/data deleted or never created. */
#define DB_KEYEXIST (-30995)/* The key/data pair already exists. */ #define DB_KEYEXIST (-30995)/* The key/data pair already exists. */
#define DB_LOCK_DEADLOCK (-30994)/* Deadlock. */ #define DB_LOCK_DEADLOCK (-30994)/* Deadlock. */
#define DB_LOCK_NOTGRANTED (-30993)/* Lock unavailable. */ #define DB_LOCK_NOTGRANTED (-30993)/* Lock unavailable. */
#define DB_LOG_BUFFER_FULL (-30992)/* In-memory log buffer full . */ #define DB_LOG_BUFFER_FULL (-30992)/* In-memory log buffer full . */
#define DB_NOSERVER (-30991)/* Server panic return. */ #define DB_LOG_VERIFY_BAD (-30991)/* Log verification failed.
#define DB_NOSERVER_HOME (-30990)/* Bad home sent to server. */
*/ #define DB_NOSERVER (-30990)/* Server panic return. */
#define DB_NOSERVER_ID (-30989)/* Bad ID sent to server. */ #define DB_NOSERVER_HOME (-30989)/* Bad home sent to server.
#define DB_NOTFOUND (-30988)/* Key/data pair not found ( */
EOF). */ #define DB_NOSERVER_ID (-30988)/* Bad ID sent to server. */
#define DB_OLD_VERSION (-30987)/* Out-of-date version. */ #define DB_NOTFOUND (-30987)/* Key/data pair not found (
#define DB_PAGE_NOTFOUND (-30986)/* Requested page not found. EOF). */
*/ #define DB_OLD_VERSION (-30986)/* Out-of-date version. */
#define DB_REP_DUPMASTER (-30985)/* There are two masters. */ #define DB_PAGE_NOTFOUND (-30985)/* Requested page not found.
#define DB_REP_HANDLE_DEAD (-30984)/* Rolled back a commit. */ */
#define DB_REP_HOLDELECTION (-30983)/* Time to hold an election. #define DB_REP_DUPMASTER (-30984)/* There are two masters. */
*/ #define DB_REP_HANDLE_DEAD (-30983)/* Rolled back a commit. */
#define DB_REP_IGNORE (-30982)/* This msg should be ignore #define DB_REP_HOLDELECTION (-30982)/* Time to hold an election.
d.*/ */
#define DB_REP_ISPERM (-30981)/* Cached not written perm w #define DB_REP_IGNORE (-30981)/* This msg should be ignore
ritten.*/ d.*/
#define DB_REP_JOIN_FAILURE (-30980)/* Unable to join replicatio #define DB_REP_ISPERM (-30980)/* Cached not written perm w
n group. */ ritten.*/
#define DB_REP_LEASE_EXPIRED (-30979)/* Master lease has expired. #define DB_REP_JOIN_FAILURE (-30979)/* Unable to join replicatio
*/ n group. */
#define DB_REP_LOCKOUT (-30978)/* API/Replication lockout n #define DB_REP_LEASE_EXPIRED (-30978)/* Master lease has expired.
ow. */ */
#define DB_REP_NEWSITE (-30977)/* New site entered system. #define DB_REP_LOCKOUT (-30977)/* API/Replication lockout n
*/ ow. */
#define DB_REP_NOTPERM (-30976)/* Permanent log record not #define DB_REP_NEWSITE (-30976)/* New site entered system.
written. */ */
#define DB_REP_UNAVAIL (-30975)/* Site cannot currently be #define DB_REP_NOTPERM (-30975)/* Permanent log record not
reached. */ written. */
#define DB_RUNRECOVERY (-30974)/* Panic return. */ #define DB_REP_UNAVAIL (-30974)/* Site cannot currently be
#define DB_SECONDARY_BAD (-30973)/* Secondary index corrupt. reached. */
*/ #define DB_RUNRECOVERY (-30973)/* Panic return. */
#define DB_VERIFY_BAD (-30972)/* Verify failed; bad format #define DB_SECONDARY_BAD (-30972)/* Secondary index corrupt.
. */ */
#define DB_VERSION_MISMATCH (-30971)/* Environment version misma #define DB_TIMEOUT (-30971)/* Timed out on read consist
tch. */ ency. */
#define DB_VERIFY_BAD (-30970)/* Verify failed; bad format
. */
#define DB_VERSION_MISMATCH (-30969)/* Environment version misma
tch. */
/* DB (private) error return codes. */ /* DB (private) error return codes. */
#define DB_ALREADY_ABORTED (-30899) #define DB_ALREADY_ABORTED (-30899)
#define DB_DELETED (-30898)/* Recovery file marked dele ted. */ #define DB_DELETED (-30898)/* Recovery file marked dele ted. */
#define DB_EVENT_NOT_HANDLED (-30897)/* Forward event to applicat ion. */ #define DB_EVENT_NOT_HANDLED (-30897)/* Forward event to applicat ion. */
#define DB_NEEDSPLIT (-30896)/* Page needs to be split. * / #define DB_NEEDSPLIT (-30896)/* Page needs to be split. * /
#define DB_REP_BULKOVF (-30895)/* Rep bulk buffer overflow. */ #define DB_REP_BULKOVF (-30895)/* Rep bulk buffer overflow. */
#define DB_REP_EGENCHG (-30894)/* Egen changed while in ele #define DB_REP_LOGREADY (-30894)/* Rep log ready for recover
ction. */ y. */
#define DB_REP_LOGREADY (-30893)/* Rep log ready for recover #define DB_REP_NEWMASTER (-30893)/* We have learned of a new
y. */ master. */
#define DB_REP_NEWMASTER (-30892)/* We have learned of a new #define DB_REP_PAGEDONE (-30892)/* This page was already don
master. */ e. */
#define DB_REP_PAGEDONE (-30891)/* This page was already don #define DB_SURPRISE_KID (-30891)/* Child commit where parent
e. */
#define DB_SURPRISE_KID (-30890)/* Child commit where parent
didn't know it was a parent. */ didn't know it was a parent. */
#define DB_SWAPBYTES (-30889)/* Database needs byte swapp #define DB_SWAPBYTES (-30890)/* Database needs byte swapp
ing. */ ing. */
#define DB_TIMEOUT (-30888)/* Timed out waiting for ele #define DB_TXN_CKP (-30889)/* Encountered ckp record in
ction. */ log. */
#define DB_TXN_CKP (-30887)/* Encountered ckp record in #define DB_VERIFY_FATAL (-30888)/* DB->verify cannot proceed
log. */ . */
#define DB_VERIFY_FATAL (-30886)/* DB->verify cannot proceed
. */
/* Database handle. */ /* Database handle. */
struct __db { struct __db {
/******************************************************* /*******************************************************
* Public: owned by the application. * Public: owned by the application.
*******************************************************/ *******************************************************/
u_int32_t pgsize; /* Database logical page size. */ u_int32_t pgsize; /* Database logical page size. */
DB_CACHE_PRIORITY priority; /* Database priority in cache. */ DB_CACHE_PRIORITY priority; /* Database priority in cache. */
/* Callbacks. */ /* Callbacks. */
skipping to change at line 1234 skipping to change at line 1304
DB_ENV *dbenv; /* Backing public environment. */ DB_ENV *dbenv; /* Backing public environment. */
ENV *env; /* Backing private environment. */ ENV *env; /* Backing private environment. */
DBTYPE type; /* DB access method type. */ DBTYPE type; /* DB access method type. */
DB_MPOOLFILE *mpf; /* Backing buffer pool. */ DB_MPOOLFILE *mpf; /* Backing buffer pool. */
db_mutex_t mutex; /* Synchronization for free threadin g */ db_mutex_t mutex; /* Synchronization for free threadin g */
char *fname, *dname; /* File/database passed to DB->open. */ char *fname, *dname; /* File/database passed to DB->open. */
const char *dirname; /* Direcory of DB file. */
u_int32_t open_flags; /* Flags passed to DB->open. */ u_int32_t open_flags; /* Flags passed to DB->open. */
u_int8_t fileid[DB_FILE_ID_LEN];/* File's unique ID for locking. */ u_int8_t fileid[DB_FILE_ID_LEN];/* File's unique ID for locking. */
u_int32_t adj_fileid; /* File's unique ID for curs. adj. * / u_int32_t adj_fileid; /* File's unique ID for curs. adj. * /
#define DB_LOGFILEID_INVALID -1 #define DB_LOGFILEID_INVALID -1
FNAME *log_filename; /* File's naming info for logging. * / FNAME *log_filename; /* File's naming info for logging. * /
db_pgno_t meta_pgno; /* Meta page number */ db_pgno_t meta_pgno; /* Meta page number */
skipping to change at line 1376 skipping to change at line 1447
/* Reference to foreign -- set in the secondary. */ /* Reference to foreign -- set in the secondary. */
DB *s_foreign; DB *s_foreign;
/* API-private structure: used by DB 1.85, C++, Java, Perl and Tcl * / /* API-private structure: used by DB 1.85, C++, Java, Perl and Tcl * /
void *api_internal; void *api_internal;
/* Subsystem-private structure. */ /* Subsystem-private structure. */
void *bt_internal; /* Btree/Recno access method. */ void *bt_internal; /* Btree/Recno access method. */
void *h_internal; /* Hash access method. */ void *h_internal; /* Hash access method. */
void *p_internal; /* Partition informaiton. */
void *q_internal; /* Queue access method. */ void *q_internal; /* Queue access method. */
void *xa_internal; /* XA. */
/* DB PUBLIC HANDLE LIST BEGIN */ /* DB PUBLIC HANDLE LIST BEGIN */
int (*associate) __P((DB *, DB_TXN *, DB *, int (*associate) __P((DB *, DB_TXN *, DB *,
int (*)(DB *, const DBT *, const DBT *, DBT *), u_int32_t)); int (*)(DB *, const DBT *, const DBT *, DBT *), u_int32_t));
int (*associate_foreign) __P((DB *, DB *, int (*associate_foreign) __P((DB *, DB *,
int (*)(DB *, const DBT *, DBT *, const DBT *, int *), int (*)(DB *, const DBT *, DBT *, const DBT *, int *),
u_int32_t)); u_int32_t));
int (*close) __P((DB *, u_int32_t)); int (*close) __P((DB *, u_int32_t));
int (*compact) __P((DB *, int (*compact) __P((DB *,
DB_TXN *, DBT *, DBT *, DB_COMPACT *, u_int32_t, DBT *)); DB_TXN *, DBT *, DBT *, DB_COMPACT *, u_int32_t, DBT *));
int (*cursor) __P((DB *, DB_TXN *, DBC **, u_int32_t)); int (*cursor) __P((DB *, DB_TXN *, DBC **, u_int32_t));
int (*del) __P((DB *, DB_TXN *, DBT *, u_int32_t)); int (*del) __P((DB *, DB_TXN *, DBT *, u_int32_t));
void (*err) __P((DB *, int, const char *, ...)); void (*err) __P((DB *, int, const char *, ...));
void (*errx) __P((DB *, const char *, ...)); void (*errx) __P((DB *, const char *, ...));
int (*exists) __P((DB *, DB_TXN *, DBT *, u_int32_t)); int (*exists) __P((DB *, DB_TXN *, DBT *, u_int32_t));
int (*fd) __P((DB *, int *)); int (*fd) __P((DB *, int *));
int (*get) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t)); int (*get) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
int (*get_alloc) __P((DB *, void *(**)(size_t),
void *(**)(void *, size_t), void (**)(void *)));
int (*get_append_recno) __P((DB *, int (**)(DB *, DBT *, db_recno_t
)));
int (*get_bt_compare)
__P((DB *, int (**)(DB *, const DBT *, const DBT *)));
int (*get_bt_compress) __P((DB *,
int (**)(DB *,
const DBT *, const DBT *, const DBT *, const DBT *, DBT *),
int (**)(DB *, const DBT *, const DBT *, DBT *, DBT *, DBT *
)));
int (*get_bt_minkey) __P((DB *, u_int32_t *)); int (*get_bt_minkey) __P((DB *, u_int32_t *));
int (*get_bt_prefix)
__P((DB *, size_t (**)(DB *, const DBT *, const DBT *)));
int (*get_byteswapped) __P((DB *, int *)); int (*get_byteswapped) __P((DB *, int *));
int (*get_cachesize) __P((DB *, u_int32_t *, u_int32_t *, int *)); int (*get_cachesize) __P((DB *, u_int32_t *, u_int32_t *, int *));
int (*get_create_dir) __P((DB *, const char **));
int (*get_dbname) __P((DB *, const char **, const char **)); int (*get_dbname) __P((DB *, const char **, const char **));
int (*get_dup_compare)
__P((DB *, int (**)(DB *, const DBT *, const DBT *)));
int (*get_encrypt_flags) __P((DB *, u_int32_t *)); int (*get_encrypt_flags) __P((DB *, u_int32_t *));
DB_ENV *(*get_env) __P((DB *)); DB_ENV *(*get_env) __P((DB *));
void (*get_errcall) __P((DB *, void (*get_errcall) __P((DB *,
void (**)(const DB_ENV *, const char *, const char *))); void (**)(const DB_ENV *, const char *, const char *)));
void (*get_errfile) __P((DB *, FILE **)); void (*get_errfile) __P((DB *, FILE **));
void (*get_errpfx) __P((DB *, const char **)); void (*get_errpfx) __P((DB *, const char **));
int (*get_feedback) __P((DB *, void (**)(DB *, int, int)));
int (*get_flags) __P((DB *, u_int32_t *)); int (*get_flags) __P((DB *, u_int32_t *));
int (*get_h_compare)
__P((DB *, int (**)(DB *, const DBT *, const DBT *)));
int (*get_h_ffactor) __P((DB *, u_int32_t *)); int (*get_h_ffactor) __P((DB *, u_int32_t *));
int (*get_h_hash)
__P((DB *, u_int32_t (**)(DB *, const void *, u_int32_t)));
int (*get_h_nelem) __P((DB *, u_int32_t *)); int (*get_h_nelem) __P((DB *, u_int32_t *));
int (*get_lorder) __P((DB *, int *)); int (*get_lorder) __P((DB *, int *));
DB_MPOOLFILE *(*get_mpf) __P((DB *)); DB_MPOOLFILE *(*get_mpf) __P((DB *));
void (*get_msgcall) __P((DB *,
void (**)(const DB_ENV *, const char *)));
void (*get_msgfile) __P((DB *, FILE **)); void (*get_msgfile) __P((DB *, FILE **));
int (*get_multiple) __P((DB *)); int (*get_multiple) __P((DB *));
int (*get_open_flags) __P((DB *, u_int32_t *)); int (*get_open_flags) __P((DB *, u_int32_t *));
int (*get_pagesize) __P((DB *, u_int32_t *)); int (*get_pagesize) __P((DB *, u_int32_t *));
int (*get_partition_callback) __P((DB *,
u_int32_t *, u_int32_t (**)(DB *, DBT *key)));
int (*get_partition_dirs) __P((DB *, const char ***));
int (*get_partition_keys) __P((DB *, u_int32_t *, DBT **));
int (*get_priority) __P((DB *, DB_CACHE_PRIORITY *)); int (*get_priority) __P((DB *, DB_CACHE_PRIORITY *));
int (*get_q_extentsize) __P((DB *, u_int32_t *)); int (*get_q_extentsize) __P((DB *, u_int32_t *));
int (*get_re_delim) __P((DB *, int *)); int (*get_re_delim) __P((DB *, int *));
int (*get_re_len) __P((DB *, u_int32_t *)); int (*get_re_len) __P((DB *, u_int32_t *));
int (*get_re_pad) __P((DB *, int *)); int (*get_re_pad) __P((DB *, int *));
int (*get_re_source) __P((DB *, const char **)); int (*get_re_source) __P((DB *, const char **));
int (*get_transactional) __P((DB *)); int (*get_transactional) __P((DB *));
int (*get_type) __P((DB *, DBTYPE *)); int (*get_type) __P((DB *, DBTYPE *));
int (*join) __P((DB *, DBC **, DBC **, u_int32_t)); int (*join) __P((DB *, DBC **, DBC **, u_int32_t));
int (*key_range) int (*key_range)
skipping to change at line 1437 skipping to change at line 1533
int (*pget) __P((DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t)); int (*pget) __P((DB *, DB_TXN *, DBT *, DBT *, DBT *, u_int32_t));
int (*put) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t)); int (*put) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
int (*remove) __P((DB *, const char *, const char *, u_int32_t)); int (*remove) __P((DB *, const char *, const char *, u_int32_t));
int (*rename) __P((DB *, int (*rename) __P((DB *,
const char *, const char *, const char *, u_int32_t)); const char *, const char *, const char *, u_int32_t));
int (*set_alloc) __P((DB *, void *(*)(size_t), int (*set_alloc) __P((DB *, void *(*)(size_t),
void *(*)(void *, size_t), void (*)(void *))); void *(*)(void *, size_t), void (*)(void *)));
int (*set_append_recno) __P((DB *, int (*)(DB *, DBT *, db_recno_t) )); int (*set_append_recno) __P((DB *, int (*)(DB *, DBT *, db_recno_t) ));
int (*set_bt_compare) int (*set_bt_compare)
__P((DB *, int (*)(DB *, const DBT *, const DBT *))); __P((DB *, int (*)(DB *, const DBT *, const DBT *)));
int (*set_bt_compress) __P((DB *,
int (*)(DB *, const DBT *, const DBT *, const DBT *, const D
BT *, DBT *),
int (*)(DB *, const DBT *, const DBT *, DBT *, DBT *, DBT *)
));
int (*set_bt_minkey) __P((DB *, u_int32_t)); int (*set_bt_minkey) __P((DB *, u_int32_t));
int (*set_bt_prefix) int (*set_bt_prefix)
__P((DB *, size_t (*)(DB *, const DBT *, const DBT *))); __P((DB *, size_t (*)(DB *, const DBT *, const DBT *)));
int (*set_cachesize) __P((DB *, u_int32_t, u_int32_t, int)); int (*set_cachesize) __P((DB *, u_int32_t, u_int32_t, int));
int (*set_create_dir) __P((DB *, const char *));
int (*set_dup_compare) int (*set_dup_compare)
__P((DB *, int (*)(DB *, const DBT *, const DBT *))); __P((DB *, int (*)(DB *, const DBT *, const DBT *)));
int (*set_encrypt) __P((DB *, const char *, u_int32_t)); int (*set_encrypt) __P((DB *, const char *, u_int32_t));
void (*set_errcall) __P((DB *, void (*set_errcall) __P((DB *,
void (*)(const DB_ENV *, const char *, const char *))); void (*)(const DB_ENV *, const char *, const char *)));
void (*set_errfile) __P((DB *, FILE *)); void (*set_errfile) __P((DB *, FILE *));
void (*set_errpfx) __P((DB *, const char *)); void (*set_errpfx) __P((DB *, const char *));
int (*set_feedback) __P((DB *, void (*)(DB *, int, int))); int (*set_feedback) __P((DB *, void (*)(DB *, int, int)));
int (*set_flags) __P((DB *, u_int32_t)); int (*set_flags) __P((DB *, u_int32_t));
int (*set_h_compare) int (*set_h_compare)
__P((DB *, int (*)(DB *, const DBT *, const DBT *))); __P((DB *, int (*)(DB *, const DBT *, const DBT *)));
int (*set_h_ffactor) __P((DB *, u_int32_t)); int (*set_h_ffactor) __P((DB *, u_int32_t));
int (*set_h_hash) int (*set_h_hash)
__P((DB *, u_int32_t (*)(DB *, const void *, u_int32_t))); __P((DB *, u_int32_t (*)(DB *, const void *, u_int32_t)));
int (*set_h_nelem) __P((DB *, u_int32_t)); int (*set_h_nelem) __P((DB *, u_int32_t));
int (*set_lorder) __P((DB *, int)); int (*set_lorder) __P((DB *, int));
void (*set_msgcall) __P((DB *, void (*)(const DB_ENV *, const char * ))); void (*set_msgcall) __P((DB *, void (*)(const DB_ENV *, const char * )));
void (*set_msgfile) __P((DB *, FILE *)); void (*set_msgfile) __P((DB *, FILE *));
int (*set_pagesize) __P((DB *, u_int32_t)); int (*set_pagesize) __P((DB *, u_int32_t));
int (*set_paniccall) __P((DB *, void (*)(DB_ENV *, int))); int (*set_paniccall) __P((DB *, void (*)(DB_ENV *, int)));
int (*set_partition) __P((DB *,
u_int32_t, DBT *, u_int32_t (*)(DB *, DBT *key)));
int (*set_partition_dirs) __P((DB *, const char **));
int (*set_priority) __P((DB *, DB_CACHE_PRIORITY)); int (*set_priority) __P((DB *, DB_CACHE_PRIORITY));
int (*set_q_extentsize) __P((DB *, u_int32_t)); int (*set_q_extentsize) __P((DB *, u_int32_t));
int (*set_re_delim) __P((DB *, int)); int (*set_re_delim) __P((DB *, int));
int (*set_re_len) __P((DB *, u_int32_t)); int (*set_re_len) __P((DB *, u_int32_t));
int (*set_re_pad) __P((DB *, int)); int (*set_re_pad) __P((DB *, int));
int (*set_re_source) __P((DB *, const char *)); int (*set_re_source) __P((DB *, const char *));
int (*sort_multiple) __P((DB *, DBT *, DBT *, u_int32_t));
int (*stat) __P((DB *, DB_TXN *, void *, u_int32_t)); int (*stat) __P((DB *, DB_TXN *, void *, u_int32_t));
int (*stat_print) __P((DB *, u_int32_t)); int (*stat_print) __P((DB *, u_int32_t));
int (*sync) __P((DB *, u_int32_t)); int (*sync) __P((DB *, u_int32_t));
int (*truncate) __P((DB *, DB_TXN *, u_int32_t *, u_int32_t)); int (*truncate) __P((DB *, DB_TXN *, u_int32_t *, u_int32_t));
int (*upgrade) __P((DB *, const char *, u_int32_t)); int (*upgrade) __P((DB *, const char *, u_int32_t));
int (*verify) int (*verify)
__P((DB *, const char *, const char *, FILE *, u_int32_t)); __P((DB *, const char *, const char *, FILE *, u_int32_t));
/* DB PUBLIC HANDLE LIST END */ /* DB PUBLIC HANDLE LIST END */
/* DB PRIVATE HANDLE LIST BEGIN */ /* DB PRIVATE HANDLE LIST BEGIN */
int (*dump) __P((DB *, const char *, int (*dump) __P((DB *, const char *,
int (*)(void *, const void *), void *, int, int)); int (*)(void *, const void *), void *, int, int));
int (*db_am_remove) __P((DB *, DB_TXN *, const char *, const char * int (*db_am_remove) __P((DB *, DB_THREAD_INFO *,
)); DB_TXN *, const char *, const char *, u_int32_t));
int (*db_am_rename) __P((DB *, DB_TXN *, int (*db_am_rename) __P((DB *, DB_THREAD_INFO *,
const char *, const char *, const char *)); DB_TXN *, const char *, const char *, const char *));
/* DB PRIVATE HANDLE LIST END */ /* DB PRIVATE HANDLE LIST END */
/* /*
* Never called; these are a place to save function pointers * Never called; these are a place to save function pointers
* so that we can undo an associate. * so that we can undo an associate.
*/ */
int (*stored_get) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t)); int (*stored_get) __P((DB *, DB_TXN *, DBT *, DBT *, u_int32_t));
int (*stored_close) __P((DB *, u_int32_t)); int (*stored_close) __P((DB *, u_int32_t));
/* Alternative handle close function, used by C++ API. */
int (*alt_close) __P((DB *, u_int32_t));
#define DB_OK_BTREE 0x01 #define DB_OK_BTREE 0x01
#define DB_OK_HASH 0x02 #define DB_OK_HASH 0x02
#define DB_OK_QUEUE 0x04 #define DB_OK_QUEUE 0x04
#define DB_OK_RECNO 0x08 #define DB_OK_RECNO 0x08
u_int32_t am_ok; /* Legal AM choices. */ u_int32_t am_ok; /* Legal AM choices. */
/* /*
* This field really ought to be an AM_FLAG, but we have * This field really ought to be an AM_FLAG, but we have
* have run out of bits. If/when we decide to split up * have run out of bits. If/when we decide to split up
* the flags, we can incorporate it. * the flags, we can incorporate it.
*/ */
int preserve_fid; /* Do not free fileid on close. */ int preserve_fid; /* Do not free fileid on close. */
#define DB_AM_CHKSUM 0x00000001 /* Checksumming */ #define DB_AM_CHKSUM 0x00000001 /* Checksumming */
#define DB_AM_COMPENSATE 0x00000002 /* Created by compensatin g txn */ #define DB_AM_COMPENSATE 0x00000002 /* Created by compensatin g txn */
#define DB_AM_CREATED 0x00000004 /* Database was created u #define DB_AM_COMPRESS 0x00000004 /* Compressed BTree */
pon open */ #define DB_AM_CREATED 0x00000008 /* Database was created u
#define DB_AM_CREATED_MSTR 0x00000008 /* Encompassing file was pon open */
created */ #define DB_AM_CREATED_MSTR 0x00000010 /* Encompassing file was
#define DB_AM_DBM_ERROR 0x00000010 /* Error in DBM/NDBM data created */
base */ #define DB_AM_DBM_ERROR 0x00000020 /* Error in DBM/NDBM data
#define DB_AM_DELIMITER 0x00000020 /* Variable length delimi base */
ter set */ #define DB_AM_DELIMITER 0x00000040 /* Variable length delimi
#define DB_AM_DISCARD 0x00000040 /* Discard any cached pag ter set */
es */ #define DB_AM_DISCARD 0x00000080 /* Discard any cached pag
#define DB_AM_DUP 0x00000080 /* DB_DUP */ es */
#define DB_AM_DUPSORT 0x00000100 /* DB_DUPSORT */ #define DB_AM_DUP 0x00000100 /* DB_DUP */
#define DB_AM_ENCRYPT 0x00000200 /* Encryption */ #define DB_AM_DUPSORT 0x00000200 /* DB_DUPSORT */
#define DB_AM_FIXEDLEN 0x00000400 /* Fixed-length records * #define DB_AM_ENCRYPT 0x00000400 /* Encryption */
/ #define DB_AM_FIXEDLEN 0x00000800 /* Fixed-length records *
#define DB_AM_INMEM 0x00000800 /* In-memory; no sync on /
close */ #define DB_AM_INMEM 0x00001000 /* In-memory; no sync on
#define DB_AM_INORDER 0x00001000 /* DB_INORDER */ close */
#define DB_AM_IN_RENAME 0x00002000 /* File is being renamed #define DB_AM_INORDER 0x00002000 /* DB_INORDER */
*/ #define DB_AM_IN_RENAME 0x00004000 /* File is being renamed
#define DB_AM_NOT_DURABLE 0x00004000 /* Do not log changes */ */
#define DB_AM_OPEN_CALLED 0x00008000 /* DB->open called */ #define DB_AM_NOT_DURABLE 0x00008000 /* Do not log changes */
#define DB_AM_PAD 0x00010000 /* Fixed-length record pa #define DB_AM_OPEN_CALLED 0x00010000 /* DB->open called */
d */ #define DB_AM_PAD 0x00020000 /* Fixed-length record pa
#define DB_AM_PGDEF 0x00020000 /* Page size was defaulte d */
d */ #define DB_AM_PGDEF 0x00040000 /* Page size was defaulte
#define DB_AM_RDONLY 0x00040000 /* Database is readonly * d */
/ #define DB_AM_RDONLY 0x00080000 /* Database is readonly *
#define DB_AM_READ_UNCOMMITTED 0x00080000 /* Support degree 1 isola /
tion */ #define DB_AM_READ_UNCOMMITTED 0x00100000 /* Support degree 1 isola
#define DB_AM_RECNUM 0x00100000 /* DB_RECNUM */ tion */
#define DB_AM_RECOVER 0x00200000 /* DB opened by recovery #define DB_AM_RECNUM 0x00200000 /* DB_RECNUM */
routine */ #define DB_AM_RECOVER 0x00400000 /* DB opened by recovery
#define DB_AM_RENUMBER 0x00400000 /* DB_RENUMBER */ routine */
#define DB_AM_REVSPLITOFF 0x00800000 /* DB_REVSPLITOFF */ #define DB_AM_RENUMBER 0x00800000 /* DB_RENUMBER */
#define DB_AM_SECONDARY 0x01000000 /* Database is a secondar #define DB_AM_REVSPLITOFF 0x01000000 /* DB_REVSPLITOFF */
y index */ #define DB_AM_SECONDARY 0x02000000 /* Database is a secondar
#define DB_AM_SNAPSHOT 0x02000000 /* DB_SNAPSHOT */ y index */
#define DB_AM_SUBDB 0x04000000 /* Subdatabases supported #define DB_AM_SNAPSHOT 0x04000000 /* DB_SNAPSHOT */
*/ #define DB_AM_SUBDB 0x08000000 /* Subdatabases supported
#define DB_AM_SWAP 0x08000000 /* Pages need to be byte- */
swapped */ #define DB_AM_SWAP 0x10000000 /* Pages need to be byte-
#define DB_AM_TXN 0x10000000 /* Opened in a transactio swapped */
n */ #define DB_AM_TXN 0x20000000 /* Opened in a transactio
#define DB_AM_VERIFYING 0x20000000 /* DB handle is in the ve n */
rifier */ #define DB_AM_VERIFYING 0x40000000 /* DB handle is in the ve
rifier */
u_int32_t orig_flags; /* Flags at open, for refresh */ u_int32_t orig_flags; /* Flags at open, for refresh */
u_int32_t flags; u_int32_t flags;
}; };
/* /*
* Macros for bulk get. These are only intended for the C API. * Macros for bulk operations. These are only intended for the C API.
* For C++, use DbMultiple*Iterator. * For C++, use DbMultiple*Iterator or DbMultiple*Builder.
*
* Bulk operations store multiple entries into a single DBT structure. The
* following macros assist with creating and reading these Multiple DBTs.
*
* The basic layout for single data items is:
*
* ------------------------------------------------------------------------
-
* | data1 | ... | dataN | ..... |-1 | dNLen | dNOff | ... | d1Len | d1Off
|
* ------------------------------------------------------------------------
-
*
* For the DB_MULTIPLE_KEY* macros, the items are in key/data pairs, so dat
a1
* would be a key, and data2 its corresponding value (N is always even).
*
* For the DB_MULTIPLE_RECNO* macros, the record number is stored along wit
h
* the len/off pair in the "header" section, and the list is zero terminate
d
* (since -1 is a valid record number):
*
* ------------------------------------------------------------------------
--
* | d1 |..| dN |..| 0 | dNLen | dNOff | recnoN |..| d1Len | d1Off | recno1
|
* ------------------------------------------------------------------------
--
*/ */
#define DB_MULTIPLE_INIT(pointer, dbt) \ #define DB_MULTIPLE_INIT(pointer, dbt) \
(pointer = (u_int8_t *)(dbt)->data + \ (pointer = (u_int8_t *)(dbt)->data + \
(dbt)->ulen - sizeof(u_int32_t)) (dbt)->ulen - sizeof(u_int32_t))
#define DB_MULTIPLE_NEXT(pointer, dbt, retdata, retdlen) \ #define DB_MULTIPLE_NEXT(pointer, dbt, retdata, retdlen) \
do { \ do { \
if (*((u_int32_t *)(pointer)) == (u_int32_t)-1) { \ u_int32_t *__p = (u_int32_t *)(pointer); \
if (*__p == (u_int32_t)-1) { \
retdata = NULL; \ retdata = NULL; \
pointer = NULL; \ pointer = NULL; \
break; \ break; \
} \ } \
retdata = (u_int8_t *) \ retdata = (u_int8_t *)(dbt)->data + *__p--; \
(dbt)->data + *(u_int32_t *)(pointer); \ retdlen = *__p--; \
(pointer) = (u_int32_t *)(pointer) - 1; \ pointer = __p; \
retdlen = *(u_int32_t *)(pointer); \ if (retdlen == 0 && retdata == (u_int8_t *)(dbt)->data) \
(pointer) = (u_int32_t *)(pointer) - 1; \
if (retdlen == 0 && \
retdata == (u_int8_t *)(dbt)->data) \
retdata = NULL; \ retdata = NULL; \
} while (0) } while (0)
#define DB_MULTIPLE_KEY_NEXT(pointer, dbt, retkey, retklen, retdata, retdlen) \ #define DB_MULTIPLE_KEY_NEXT(pointer, dbt, retkey, retklen, retdata, retdlen) \
do { \ do { \
if (*((u_int32_t *)(pointer)) == (u_int32_t)-1) { \ u_int32_t *__p = (u_int32_t *)(pointer); \
if (*__p == (u_int32_t)-1) { \
retdata = NULL; \ retdata = NULL; \
retkey = NULL; \ retkey = NULL; \
pointer = NULL; \ pointer = NULL; \
break; \ break; \
} \ } \
retkey = (u_int8_t *) \ retkey = (u_int8_t *)(dbt)->data + *__p--; \
(dbt)->data + *(u_int32_t *)(pointer); \ retklen = *__p--; \
(pointer) = (u_int32_t *)(pointer) - 1; \ retdata = (u_int8_t *)(dbt)->data + *__p--; \
retklen = *(u_int32_t *)(pointer); \ retdlen = *__p--; \
(pointer) = (u_int32_t *)(pointer) - 1; \ pointer = __p; \
retdata = (u_int8_t *) \
(dbt)->data + *(u_int32_t *)(pointer); \
(pointer) = (u_int32_t *)(pointer) - 1; \
retdlen = *(u_int32_t *)(pointer); \
(pointer) = (u_int32_t *)(pointer) - 1; \
} while (0) } while (0)
#define DB_MULTIPLE_RECNO_NEXT(pointer, dbt, recno, retdata, retdlen ) \ #define DB_MULTIPLE_RECNO_NEXT(pointer, dbt, recno, retdata, retdlen ) \
do { \ do { \
if (*((u_int32_t *)(pointer)) == (u_int32_t)0) { \ u_int32_t *__p = (u_int32_t *)(pointer); \
if (*__p == (u_int32_t)0) { \
recno = 0; \ recno = 0; \
retdata = NULL; \ retdata = NULL; \
pointer = NULL; \ pointer = NULL; \
break; \ break; \
} \ } \
recno = *(u_int32_t *)(pointer); \ recno = *__p--; \
(pointer) = (u_int32_t *)(pointer) - 1; \ retdata = (u_int8_t *)(dbt)->data + *__p--; \
retdata = (u_int8_t *) \ retdlen = *__p--; \
(dbt)->data + *(u_int32_t *)(pointer); \ pointer = __p; \
(pointer) = (u_int32_t *)(pointer) - 1; \ } while (0)
retdlen = *(u_int32_t *)(pointer); \
(pointer) = (u_int32_t *)(pointer) - 1; \ #define DB_MULTIPLE_WRITE_INIT(pointer, dbt) \
do { \
(dbt)->flags |= DB_DBT_BULK; \
pointer = (u_int8_t *)(dbt)->data + \
(dbt)->ulen - sizeof(u_int32_t); \
*(u_int32_t *)(pointer) = (u_int32_t)-1; \
} while (0)
#define DB_MULTIPLE_RESERVE_NEXT(pointer, dbt, writedata, writedlen) \
do { \
u_int32_t *__p = (u_int32_t *)(pointer); \
u_int32_t __off = ((pointer) == (u_int8_t *)(dbt)->data +\
(dbt)->ulen - sizeof(u_int32_t)) ? 0 : __p[1] + __p[2];
\
if ((u_int8_t *)(dbt)->data + __off + (writedlen) > \
(u_int8_t *)(__p - 2)) \
writedata = NULL; \
else { \
writedata = (u_int8_t *)(dbt)->data + __off; \
__p[0] = __off; \
__p[-1] = (u_int32_t)(writedlen); \
__p[-2] = (u_int32_t)-1; \
pointer = __p - 2; \
} \
} while (0)
#define DB_MULTIPLE_WRITE_NEXT(pointer, dbt, writedata, writedlen) \
do { \
void *__destd; \
DB_MULTIPLE_RESERVE_NEXT((pointer), (dbt), \
__destd, (writedlen)); \
if (__destd == NULL) \
pointer = NULL; \
else \
memcpy(__destd, (writedata), (writedlen)); \
} while (0)
#define DB_MULTIPLE_KEY_RESERVE_NEXT(pointer, dbt, writekey, writeklen, wri
tedata, writedlen) \
do { \
u_int32_t *__p = (u_int32_t *)(pointer); \
u_int32_t __off = ((pointer) == (u_int8_t *)(dbt)->data +\
(dbt)->ulen - sizeof(u_int32_t)) ? 0 : __p[1] + __p[2];
\
if ((u_int8_t *)(dbt)->data + __off + (writeklen) + \
(writedlen) > (u_int8_t *)(__p - 4)) { \
writekey = NULL; \
writedata = NULL; \
} else { \
writekey = (u_int8_t *)(dbt)->data + __off; \
__p[0] = __off; \
__p[-1] = (u_int32_t)(writeklen); \
__p -= 2; \
__off += (u_int32_t)(writeklen); \
writedata = (u_int8_t *)(dbt)->data + __off; \
__p[0] = __off; \
__p[-1] = (u_int32_t)(writedlen); \
__p[-2] = (u_int32_t)-1; \
pointer = __p - 2; \
} \
} while (0)
#define DB_MULTIPLE_KEY_WRITE_NEXT(pointer, dbt, writekey, writeklen, write
data, writedlen) \
do { \
void *__destk, *__destd; \
DB_MULTIPLE_KEY_RESERVE_NEXT((pointer), (dbt), \
__destk, (writeklen), __destd, (writedlen)); \
if (__destk == NULL) \
pointer = NULL; \
else { \
memcpy(__destk, (writekey), (writeklen)); \
if (__destd != NULL) \
memcpy(__destd, (writedata), (writedlen));\
} \
} while (0)
#define DB_MULTIPLE_RECNO_WRITE_INIT(pointer, dbt) \
do { \
(dbt)->flags |= DB_DBT_BULK; \
pointer = (u_int8_t *)(dbt)->data + \
(dbt)->ulen - sizeof(u_int32_t); \
*(u_int32_t *)(pointer) = 0; \
} while (0)
#define DB_MULTIPLE_RECNO_RESERVE_NEXT(pointer, dbt, recno, writedata, writ
edlen) \
do { \
u_int32_t *__p = (u_int32_t *)(pointer); \
u_int32_t __off = ((pointer) == (u_int8_t *)(dbt)->data +\
(dbt)->ulen - sizeof(u_int32_t)) ? 0 : __p[1] + __p[2];
\
if (((u_int8_t *)(dbt)->data + __off) + (writedlen) > \
(u_int8_t *)(__p - 3)) \
writedata = NULL; \
else { \
writedata = (u_int8_t *)(dbt)->data + __off; \
__p[0] = (u_int32_t)(recno); \
__p[-1] = __off; \
__p[-2] = (u_int32_t)(writedlen); \
__p[-3] = 0; \
pointer = __p - 3; \
} \
} while (0)
#define DB_MULTIPLE_RECNO_WRITE_NEXT(pointer, dbt, recno, writedata, writed
len)\
do { \
void *__destd; \
DB_MULTIPLE_RECNO_RESERVE_NEXT((pointer), (dbt), \
(recno), __destd, (writedlen)); \
if (__destd == NULL) \
pointer = NULL; \
else if ((writedlen) != 0) \
memcpy(__destd, (writedata), (writedlen)); \
} while (0) } while (0)
/******************************************************* /*******************************************************
* Access method cursors. * Access method cursors.
*******************************************************/ *******************************************************/
struct __dbc { struct __dbc {
DB *dbp; /* Backing database */ DB *dbp; /* Backing database */
DB_ENV *dbenv; /* Backing environment */ DB_ENV *dbenv; /* Backing environment */
ENV *env; /* Backing environment */ ENV *env; /* Backing environment */
skipping to change at line 1623 skipping to change at line 1856
* !!! * !!!
* Explicit representations of structures from queue.h. * Explicit representations of structures from queue.h.
* TAILQ_ENTRY(__dbc) links; * TAILQ_ENTRY(__dbc) links;
*/ */
struct { struct {
DBC *tqe_next; DBC *tqe_next;
DBC **tqe_prev; DBC **tqe_prev;
} links; } links;
/* /*
* Cursor queue of the owning transaction.
*
* !!!
* Explicit representations of structures from queue.h.
* TAILQ_ENTRY(__dbc) txn_cursors;
*/
struct {
DBC *tqe_next; /* next element */
DBC **tqe_prev; /* address of previous next element */
} txn_cursors;
/*
* The DBT *'s below are used by the cursor routines to return * The DBT *'s below are used by the cursor routines to return
* data to the user when DBT flags indicate that DB should manage * data to the user when DBT flags indicate that DB should manage
* the returned memory. They point at a DBT containing the buffer * the returned memory. They point at a DBT containing the buffer
* and length that will be used, and "belonging" to the handle that * and length that will be used, and "belonging" to the handle that
* should "own" this memory. This may be a "my_*" field of this * should "own" this memory. This may be a "my_*" field of this
* cursor--the default--or it may be the corresponding field of * cursor--the default--or it may be the corresponding field of
* another cursor, a DB handle, a join cursor, etc. In general, it * another cursor, a DB handle, a join cursor, etc. In general, it
* will be whatever handle the user originally used for the current * will be whatever handle the user originally used for the current
* DB interface call. * DB interface call.
*/ */
skipping to change at line 1655 skipping to change at line 1900
DB_LOCK mylock; /* CDB lock held on this cursor. */ DB_LOCK mylock; /* CDB lock held on this cursor. */
u_int cl_id; /* Remote client id. */ u_int cl_id; /* Remote client id. */
DBTYPE dbtype; /* Cursor type. */ DBTYPE dbtype; /* Cursor type. */
DBC_INTERNAL *internal; /* Access method private. */ DBC_INTERNAL *internal; /* Access method private. */
/* DBC PUBLIC HANDLE LIST BEGIN */ /* DBC PUBLIC HANDLE LIST BEGIN */
int (*close) __P((DBC *)); int (*close) __P((DBC *));
int (*cmp) __P((DBC *, DBC *, int *, u_int32_t));
int (*count) __P((DBC *, db_recno_t *, u_int32_t)); int (*count) __P((DBC *, db_recno_t *, u_int32_t));
int (*del) __P((DBC *, u_int32_t)); int (*del) __P((DBC *, u_int32_t));
int (*dup) __P((DBC *, DBC **, u_int32_t)); int (*dup) __P((DBC *, DBC **, u_int32_t));
int (*get) __P((DBC *, DBT *, DBT *, u_int32_t)); int (*get) __P((DBC *, DBT *, DBT *, u_int32_t));
int (*get_priority) __P((DBC *, DB_CACHE_PRIORITY *)); int (*get_priority) __P((DBC *, DB_CACHE_PRIORITY *));
int (*pget) __P((DBC *, DBT *, DBT *, DBT *, u_int32_t)); int (*pget) __P((DBC *, DBT *, DBT *, DBT *, u_int32_t));
int (*put) __P((DBC *, DBT *, DBT *, u_int32_t)); int (*put) __P((DBC *, DBT *, DBT *, u_int32_t));
int (*set_priority) __P((DBC *, DB_CACHE_PRIORITY)); int (*set_priority) __P((DBC *, DB_CACHE_PRIORITY));
/* DBC PUBLIC HANDLE LIST END */ /* DBC PUBLIC HANDLE LIST END */
skipping to change at line 1677 skipping to change at line 1923
int (*c_count) __P((DBC *, db_recno_t *, u_int32_t)); int (*c_count) __P((DBC *, db_recno_t *, u_int32_t));
int (*c_del) __P((DBC *, u_int32_t)); int (*c_del) __P((DBC *, u_int32_t));
int (*c_dup) __P((DBC *, DBC **, u_int32_t)); int (*c_dup) __P((DBC *, DBC **, u_int32_t));
int (*c_get) __P((DBC *, DBT *, DBT *, u_int32_t)); int (*c_get) __P((DBC *, DBT *, DBT *, u_int32_t));
int (*c_pget) __P((DBC *, DBT *, DBT *, DBT *, u_int32_t)); int (*c_pget) __P((DBC *, DBT *, DBT *, DBT *, u_int32_t));
int (*c_put) __P((DBC *, DBT *, DBT *, u_int32_t)); int (*c_put) __P((DBC *, DBT *, DBT *, u_int32_t));
/* DBC PRIVATE HANDLE LIST BEGIN */ /* DBC PRIVATE HANDLE LIST BEGIN */
int (*am_bulk) __P((DBC *, DBT *, u_int32_t)); int (*am_bulk) __P((DBC *, DBT *, u_int32_t));
int (*am_close) __P((DBC *, db_pgno_t, int *)); int (*am_close) __P((DBC *, db_pgno_t, int *));
int (*am_del) __P((DBC *)); int (*am_del) __P((DBC *, u_int32_t));
int (*am_destroy) __P((DBC *)); int (*am_destroy) __P((DBC *));
int (*am_get) __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *)); int (*am_get) __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *));
int (*am_put) __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *)); int (*am_put) __P((DBC *, DBT *, DBT *, u_int32_t, db_pgno_t *));
int (*am_writelock) __P((DBC *)); int (*am_writelock) __P((DBC *));
/* DBC PRIVATE HANDLE LIST END */ /* DBC PRIVATE HANDLE LIST END */
/* /*
* DBC_DONTLOCK and DBC_RECOVER are used during recovery and transaction * DBC_DONTLOCK and DBC_RECOVER are used during recovery and transaction
* abort. If a transaction is being aborted or recovered then DBC_RECOVER * abort. If a transaction is being aborted or recovered then DBC_RECOVER
* will be set and locking and logging will be disabled on this cursor. If * will be set and locking and logging will be disabled on this cursor. If
* we are performing a compensating transaction (e.g. free page processing) * we are performing a compensating transaction (e.g. free page processing)
* then DB_DONTLOCK will be set to inhibit locking, but logging will still * then DB_DONTLOCK will be set to inhibit locking, but logging will still
* be required. DB_DONTLOCK is also used if the whole database is locked. * be required. DB_DONTLOCK is also used if the whole database is locked.
*/ */
#define DBC_ACTIVE 0x0001 /* Cursor in use. */ #define DBC_ACTIVE 0x00001 /* Cursor in use. */
#define DBC_DONTLOCK 0x0002 /* Don't lock on this cursor #define DBC_BULK 0x00002 /* Bulk update cursor. */
. */ #define DBC_DONTLOCK 0x00004 /* Don't lock on this cursor
#define DBC_DUPLICATE 0x0004 /* Create a duplicate cursor . */
. */ #define DBC_DOWNREV 0x00008 /* Down rev replication mast
#define DBC_MULTIPLE 0x0008 /* Return Multiple data. */ er. */
#define DBC_MULTIPLE_KEY 0x0010 /* Return Multiple keys and #define DBC_DUPLICATE 0x00010 /* Create a duplicate cursor
data. */ . */
#define DBC_OPD 0x0020 /* Cursor references off-pag #define DBC_FAMILY 0x00020 /* Part of a locker family.
e dups. */ */
#define DBC_OWN_LID 0x0040 /* Free lock id on destroy. #define DBC_FROM_DB_GET 0x00040 /* Called from the DB->get()
*/ method. */
#define DBC_READ_COMMITTED 0x0080 /* Cursor has degree 2 isola #define DBC_MULTIPLE 0x00080 /* Return Multiple data. */
tion. */ #define DBC_MULTIPLE_KEY 0x00100 /* Return Multiple keys and
#define DBC_READ_UNCOMMITTED 0x0100 /* Cursor has degree 1 isola data. */
tion. */ #define DBC_OPD 0x00200 /* Cursor references off-pag
#define DBC_RECOVER 0x0200 /* Recovery cursor; don't lo e dups. */
g/lock. */ #define DBC_OWN_LID 0x00400 /* Free lock id on destroy.
#define DBC_RMW 0x0400 /* Acquire write flag in rea */
d op. */ #define DBC_PARTITIONED 0x00800 /* Cursor for a partitioned
#define DBC_TRANSIENT 0x0800 /* Cursor is transient. */ db. */
#define DBC_WRITECURSOR 0x1000 /* Cursor may be used to wri #define DBC_READ_COMMITTED 0x01000 /* Cursor has degree 2 isola
te (CDB). */ tion. */
#define DBC_WRITER 0x2000 /* Cursor immediately writin #define DBC_READ_UNCOMMITTED 0x02000 /* Cursor has degree 1 isola
g (CDB). */ tion. */
#define DBC_RECOVER 0x04000 /* Recovery cursor; don't lo
g/lock. */
#define DBC_RMW 0x08000 /* Acquire write flag in rea
d op. */
#define DBC_TRANSIENT 0x10000 /* Cursor is transient. */
#define DBC_WAS_READ_COMMITTED 0x20000 /* Cursor holds a read commi
ted lock. */
#define DBC_WRITECURSOR 0x40000 /* Cursor may be used to wri
te (CDB). */
#define DBC_WRITER 0x80000 /* Cursor immediately writin
g (CDB). */
u_int32_t flags; u_int32_t flags;
}; };
/* Key range statistics structure */ /* Key range statistics structure */
struct __key_range { struct __key_range {
double less; double less;
double equal; double equal;
double greater; double greater;
}; };
skipping to change at line 1735 skipping to change at line 1987
u_int32_t bt_minkey; /* Minkey value. */ u_int32_t bt_minkey; /* Minkey value. */
u_int32_t bt_re_len; /* Fixed-length record length. */ u_int32_t bt_re_len; /* Fixed-length record length. */
u_int32_t bt_re_pad; /* Fixed-length record pad. */ u_int32_t bt_re_pad; /* Fixed-length record pad. */
u_int32_t bt_levels; /* Tree levels. */ u_int32_t bt_levels; /* Tree levels. */
u_int32_t bt_int_pg; /* Internal pages. */ u_int32_t bt_int_pg; /* Internal pages. */
u_int32_t bt_leaf_pg; /* Leaf pages. */ u_int32_t bt_leaf_pg; /* Leaf pages. */
u_int32_t bt_dup_pg; /* Duplicate pages. */ u_int32_t bt_dup_pg; /* Duplicate pages. */
u_int32_t bt_over_pg; /* Overflow pages. */ u_int32_t bt_over_pg; /* Overflow pages. */
u_int32_t bt_empty_pg; /* Empty pages. */ u_int32_t bt_empty_pg; /* Empty pages. */
u_int32_t bt_free; /* Pages on the free list. */ u_int32_t bt_free; /* Pages on the free list. */
u_int32_t bt_int_pgfree; /* Bytes free in internal pages. */ uintmax_t bt_int_pgfree; /* Bytes free in internal pages. */
u_int32_t bt_leaf_pgfree; /* Bytes free in leaf pages. */ uintmax_t bt_leaf_pgfree; /* Bytes free in leaf pages. */
u_int32_t bt_dup_pgfree; /* Bytes free in duplicate pages. */ uintmax_t bt_dup_pgfree; /* Bytes free in duplicate pages. */
u_int32_t bt_over_pgfree; /* Bytes free in overflow pages. */ uintmax_t bt_over_pgfree; /* Bytes free in overflow pages. */
}; };
struct __db_compact { struct __db_compact {
/* Input Parameters. */ /* Input Parameters. */
u_int32_t compact_fillpercent; /* Desired fillfactor: 1-100 */ u_int32_t compact_fillpercent; /* Desired fillfactor: 1-100 */
db_timeout_t compact_timeout; /* Lock timeout. */ db_timeout_t compact_timeout; /* Lock timeout. */
u_int32_t compact_pages; /* Max pages to process. */ u_int32_t compact_pages; /* Max pages to process. */
/* Output Stats. */ /* Output Stats. */
u_int32_t compact_empty_buckets; /* Empty hash buckets found. */
u_int32_t compact_pages_free; /* Number of pages freed. */ u_int32_t compact_pages_free; /* Number of pages freed. */
u_int32_t compact_pages_examine; /* Number of pages examine. */ u_int32_t compact_pages_examine; /* Number of pages examine. */
u_int32_t compact_levels; /* Number of levels removed. */ u_int32_t compact_levels; /* Number of levels removed. */
u_int32_t compact_deadlock; /* Number of deadlocks. */ u_int32_t compact_deadlock; /* Number of deadlocks. */
db_pgno_t compact_pages_truncated; /* Pages truncated to OS. * / db_pgno_t compact_pages_truncated; /* Pages truncated to OS. * /
/* Internal. */ /* Internal. */
db_pgno_t compact_truncate; /* Page number for truncatio n */ db_pgno_t compact_truncate; /* Page number for truncatio n */
}; };
/* Hash statistics structure. */ /* Hash statistics structure. */
skipping to change at line 1768 skipping to change at line 2021
u_int32_t hash_magic; /* Magic number. */ u_int32_t hash_magic; /* Magic number. */
u_int32_t hash_version; /* Version number. */ u_int32_t hash_version; /* Version number. */
u_int32_t hash_metaflags; /* Metadata flags. */ u_int32_t hash_metaflags; /* Metadata flags. */
u_int32_t hash_nkeys; /* Number of unique keys. */ u_int32_t hash_nkeys; /* Number of unique keys. */
u_int32_t hash_ndata; /* Number of data items. */ u_int32_t hash_ndata; /* Number of data items. */
u_int32_t hash_pagecnt; /* Page count. */ u_int32_t hash_pagecnt; /* Page count. */
u_int32_t hash_pagesize; /* Page size. */ u_int32_t hash_pagesize; /* Page size. */
u_int32_t hash_ffactor; /* Fill factor specified at create. */ u_int32_t hash_ffactor; /* Fill factor specified at create. */
u_int32_t hash_buckets; /* Number of hash buckets. */ u_int32_t hash_buckets; /* Number of hash buckets. */
u_int32_t hash_free; /* Pages on the free list. */ u_int32_t hash_free; /* Pages on the free list. */
u_int32_t hash_bfree; /* Bytes free on bucket pages. */ uintmax_t hash_bfree; /* Bytes free on bucket pages. */
u_int32_t hash_bigpages; /* Number of big key/data pages. */ u_int32_t hash_bigpages; /* Number of big key/data pages. */
u_int32_t hash_big_bfree; /* Bytes free on big item pages. */ uintmax_t hash_big_bfree; /* Bytes free on big item pages. */
u_int32_t hash_overflows; /* Number of overflow pages. */ u_int32_t hash_overflows; /* Number of overflow pages. */
u_int32_t hash_ovfl_free; /* Bytes free on ovfl pages. */ uintmax_t hash_ovfl_free; /* Bytes free on ovfl pages. */
u_int32_t hash_dup; /* Number of dup pages. */ u_int32_t hash_dup; /* Number of dup pages. */
u_int32_t hash_dup_free; /* Bytes free on duplicate pages. */ uintmax_t hash_dup_free; /* Bytes free on duplicate pages. */
}; };
/* Queue statistics structure. */ /* Queue statistics structure. */
struct __db_qam_stat { struct __db_qam_stat {
u_int32_t qs_magic; /* Magic number. */ u_int32_t qs_magic; /* Magic number. */
u_int32_t qs_version; /* Version number. */ u_int32_t qs_version; /* Version number. */
u_int32_t qs_metaflags; /* Metadata flags. */ u_int32_t qs_metaflags; /* Metadata flags. */
u_int32_t qs_nkeys; /* Number of unique keys. */ u_int32_t qs_nkeys; /* Number of unique keys. */
u_int32_t qs_ndata; /* Number of data items. */ u_int32_t qs_ndata; /* Number of data items. */
u_int32_t qs_pagesize; /* Page size. */ u_int32_t qs_pagesize; /* Page size. */
skipping to change at line 1846 skipping to change at line 2099
void *(*db_malloc) __P((size_t)); void *(*db_malloc) __P((size_t));
void *(*db_realloc) __P((void *, size_t)); void *(*db_realloc) __P((void *, size_t));
int (*is_alive) __P((DB_ENV *, pid_t, db_threadid_t, u_int32_t)); int (*is_alive) __P((DB_ENV *, pid_t, db_threadid_t, u_int32_t));
void (*thread_id) __P((DB_ENV *, pid_t *, db_threadid_t *)); void (*thread_id) __P((DB_ENV *, pid_t *, db_threadid_t *));
char *(*thread_id_string) __P((DB_ENV *, pid_t, db_threadid_t, char *)); char *(*thread_id_string) __P((DB_ENV *, pid_t, db_threadid_t, char *));
/* Application specified paths */ /* Application specified paths */
char *db_log_dir; /* Database log file directory */ char *db_log_dir; /* Database log file directory */
char *db_tmp_dir; /* Database tmp file directory */ char *db_tmp_dir; /* Database tmp file directory */
char *db_create_dir; /* Create directory for data files * /
char **db_data_dir; /* Database data file directories */ char **db_data_dir; /* Database data file directories */
int data_cnt; /* Database data file slots */ int data_cnt; /* Database data file slots */
int data_next; /* Next database data file slot */ int data_next; /* Next database data file slot */
char *intermediate_dir_mode; /* Intermediate directory perms */ char *intermediate_dir_mode; /* Intermediate directory perms */
long shm_key; /* shmget key */ long shm_key; /* shmget key */
char *passwd; /* Cryptography support */ char *passwd; /* Cryptography support */
size_t passwd_len; size_t passwd_len;
skipping to change at line 1899 skipping to change at line 2153
/* Memory pool configuration */ /* Memory pool configuration */
u_int32_t mp_gbytes; /* Cache size: GB */ u_int32_t mp_gbytes; /* Cache size: GB */
u_int32_t mp_bytes; /* Cache size: bytes */ u_int32_t mp_bytes; /* Cache size: bytes */
u_int32_t mp_max_gbytes; /* Maximum cache size: GB */ u_int32_t mp_max_gbytes; /* Maximum cache size: GB */
u_int32_t mp_max_bytes; /* Maximum cache size: bytes */ u_int32_t mp_max_bytes; /* Maximum cache size: bytes */
size_t mp_mmapsize; /* Maximum file size for mmap */ size_t mp_mmapsize; /* Maximum file size for mmap */
int mp_maxopenfd; /* Maximum open file descriptors */ int mp_maxopenfd; /* Maximum open file descriptors */
int mp_maxwrite; /* Maximum buffers to write */ int mp_maxwrite; /* Maximum buffers to write */
u_int mp_ncache; /* Initial number of cache regions * / u_int mp_ncache; /* Initial number of cache regions * /
u_int32_t mp_pagesize; /* Average page size */
u_int32_t mp_tablesize; /* Approximate hash table size */
/* Sleep after writing max buffers * / /* Sleep after writing max buffers * /
db_timeout_t mp_maxwrite_sleep; db_timeout_t mp_maxwrite_sleep;
/* Transaction configuration */ /* Transaction configuration */
u_int32_t tx_max; /* Maximum number of transactions */ u_int32_t tx_max; /* Maximum number of transactions */
time_t tx_timestamp; /* Recover to specific timestamp */ time_t tx_timestamp; /* Recover to specific timestamp */
db_timeout_t tx_timeout; /* Timeout for transactions */ db_timeout_t tx_timeout; /* Timeout for transactions */
/* Thread tracking configuration */ /* Thread tracking configuration */
u_int32_t thr_max; /* Thread count */ u_int32_t thr_max; /* Thread count */
skipping to change at line 1920 skipping to change at line 2176
/* /*
* The following fields are not strictly user-owned, but they outliv e * The following fields are not strictly user-owned, but they outliv e
* the ENV structure, and so are stored here. * the ENV structure, and so are stored here.
*/ */
DB_FH *registry; /* DB_REGISTER file handle */ DB_FH *registry; /* DB_REGISTER file handle */
u_int32_t registry_off; /* u_int32_t registry_off; /*
* Offset of our slot. We can't use * Offset of our slot. We can't use
* off_t because its size depends on * off_t because its size depends on
* build settings. * build settings.
*/ */
db_timeout_t envreg_timeout; /* DB_REGISTER wait timeout */
#define DB_ENV_AUTO_COMMIT 0x00000001 /* DB_AUTO_COMMIT */ #define DB_ENV_AUTO_COMMIT 0x00000001 /* DB_AUTO_COMMIT */
#define DB_ENV_CDB_ALLDB 0x00000002 /* CDB environment wide l ocking */ #define DB_ENV_CDB_ALLDB 0x00000002 /* CDB environment wide l ocking */
#define DB_ENV_DIRECT_DB 0x00000004 /* DB_DIRECT_DB set */ #define DB_ENV_FAILCHK 0x00000004 /* Failchk is running */
#define DB_ENV_DSYNC_DB 0x00000008 /* DB_DSYNC_DB set */ #define DB_ENV_DIRECT_DB 0x00000008 /* DB_DIRECT_DB set */
#define DB_ENV_MULTIVERSION 0x00000010 /* DB_MULTIVERSION set */ #define DB_ENV_DSYNC_DB 0x00000010 /* DB_DSYNC_DB set */
#define DB_ENV_NOLOCKING 0x00000020 /* DB_NOLOCKING set */ #define DB_ENV_MULTIVERSION 0x00000020 /* DB_MULTIVERSION set */
#define DB_ENV_NOMMAP 0x00000040 /* DB_NOMMAP set */ #define DB_ENV_NOLOCKING 0x00000040 /* DB_NOLOCKING set */
#define DB_ENV_NOPANIC 0x00000080 /* Okay if panic set */ #define DB_ENV_NOMMAP 0x00000080 /* DB_NOMMAP set */
#define DB_ENV_OVERWRITE 0x00000100 /* DB_OVERWRITE set */ #define DB_ENV_NOPANIC 0x00000100 /* Okay if panic set */
#define DB_ENV_REGION_INIT 0x00000200 /* DB_REGION_INIT set */ #define DB_ENV_OVERWRITE 0x00000200 /* DB_OVERWRITE set */
#define DB_ENV_RPCCLIENT 0x00000400 /* DB_RPCCLIENT set */ #define DB_ENV_REGION_INIT 0x00000400 /* DB_REGION_INIT set */
#define DB_ENV_RPCCLIENT_GIVEN 0x00000800 /* User-supplied RPC clie #define DB_ENV_RPCCLIENT 0x00000800 /* DB_RPCCLIENT set */
nt struct */ #define DB_ENV_RPCCLIENT_GIVEN 0x00001000 /* User-supplied RPC clie
#define DB_ENV_TIME_NOTGRANTED 0x00001000 /* DB_TIME_NOTGRANTED set nt struct */
*/ #define DB_ENV_TIME_NOTGRANTED 0x00002000 /* DB_TIME_NOTGRANTED set
#define DB_ENV_TXN_NOSYNC 0x00002000 /* DB_TXN_NOSYNC set */ */
#define DB_ENV_TXN_NOWAIT 0x00004000 /* DB_TXN_NOWAIT set */ #define DB_ENV_TXN_NOSYNC 0x00004000 /* DB_TXN_NOSYNC set */
#define DB_ENV_TXN_SNAPSHOT 0x00008000 /* DB_TXN_SNAPSHOT set */ #define DB_ENV_TXN_NOWAIT 0x00008000 /* DB_TXN_NOWAIT set */
#define DB_ENV_TXN_WRITE_NOSYNC 0x00010000 /* DB_TXN_WRITE_NOSYNC se #define DB_ENV_TXN_SNAPSHOT 0x00010000 /* DB_TXN_SNAPSHOT set */
t */ #define DB_ENV_TXN_WRITE_NOSYNC 0x00020000 /* DB_TXN_WRITE_NOSYNC se
#define DB_ENV_YIELDCPU 0x00020000 /* DB_YIELDCPU set */ t */
#define DB_ENV_YIELDCPU 0x00040000 /* DB_YIELDCPU set */
u_int32_t flags; u_int32_t flags;
/* DB_ENV PUBLIC HANDLE LIST BEGIN */ /* DB_ENV PUBLIC HANDLE LIST BEGIN */
int (*add_data_dir) __P((DB_ENV *, const char *));
int (*cdsgroup_begin) __P((DB_ENV *, DB_TXN **)); int (*cdsgroup_begin) __P((DB_ENV *, DB_TXN **));
int (*close) __P((DB_ENV *, u_int32_t)); int (*close) __P((DB_ENV *, u_int32_t));
int (*dbremove) __P((DB_ENV *, int (*dbremove) __P((DB_ENV *,
DB_TXN *, const char *, const char *, u_int32_t)); DB_TXN *, const char *, const char *, u_int32_t));
int (*dbrename) __P((DB_ENV *, int (*dbrename) __P((DB_ENV *,
DB_TXN *, const char *, const char *, const char *, u_int32_ t)); DB_TXN *, const char *, const char *, const char *, u_int32_ t));
void (*err) __P((const DB_ENV *, int, const char *, ...)); void (*err) __P((const DB_ENV *, int, const char *, ...));
void (*errx) __P((const DB_ENV *, const char *, ...)); void (*errx) __P((const DB_ENV *, const char *, ...));
int (*failchk) __P((DB_ENV *, u_int32_t)); int (*failchk) __P((DB_ENV *, u_int32_t));
int (*fileid_reset) __P((DB_ENV *, const char *, u_int32_t)); int (*fileid_reset) __P((DB_ENV *, const char *, u_int32_t));
int (*get_alloc) __P((DB_ENV *, void *(**)(size_t),
void *(**)(void *, size_t), void (**)(void *)));
int (*get_app_dispatch)
__P((DB_ENV *, int (**)(DB_ENV *, DBT *, DB_LSN *, db_recops
)));
int (*get_cache_max) __P((DB_ENV *, u_int32_t *, u_int32_t *)); int (*get_cache_max) __P((DB_ENV *, u_int32_t *, u_int32_t *));
int (*get_cachesize) __P((DB_ENV *, u_int32_t *, u_int32_t *, int * )); int (*get_cachesize) __P((DB_ENV *, u_int32_t *, u_int32_t *, int * ));
int (*get_create_dir) __P((DB_ENV *, const char **));
int (*get_data_dirs) __P((DB_ENV *, const char ***)); int (*get_data_dirs) __P((DB_ENV *, const char ***));
int (*get_encrypt_flags) __P((DB_ENV *, u_int32_t *)); int (*get_encrypt_flags) __P((DB_ENV *, u_int32_t *));
void (*get_errcall) __P((DB_ENV *, void (*get_errcall) __P((DB_ENV *,
void (**)(const DB_ENV *, const char *, const char *))); void (**)(const DB_ENV *, const char *, const char *)));
void (*get_errfile) __P((DB_ENV *, FILE **)); void (*get_errfile) __P((DB_ENV *, FILE **));
void (*get_errpfx) __P((DB_ENV *, const char **)); void (*get_errpfx) __P((DB_ENV *, const char **));
int (*get_flags) __P((DB_ENV *, u_int32_t *)); int (*get_flags) __P((DB_ENV *, u_int32_t *));
int (*get_feedback) __P((DB_ENV *, void (**)(DB_ENV *, int, int)));
int (*get_home) __P((DB_ENV *, const char **)); int (*get_home) __P((DB_ENV *, const char **));
int (*get_intermediate_dir_mode) __P((DB_ENV *, const char **)); int (*get_intermediate_dir_mode) __P((DB_ENV *, const char **));
int (*get_isalive) __P((DB_ENV *,
int (**)(DB_ENV *, pid_t, db_threadid_t, u_int32_t)));
int (*get_lg_bsize) __P((DB_ENV *, u_int32_t *)); int (*get_lg_bsize) __P((DB_ENV *, u_int32_t *));
int (*get_lg_dir) __P((DB_ENV *, const char **)); int (*get_lg_dir) __P((DB_ENV *, const char **));
int (*get_lg_filemode) __P((DB_ENV *, int *)); int (*get_lg_filemode) __P((DB_ENV *, int *));
int (*get_lg_max) __P((DB_ENV *, u_int32_t *)); int (*get_lg_max) __P((DB_ENV *, u_int32_t *));
int (*get_lg_regionmax) __P((DB_ENV *, u_int32_t *)); int (*get_lg_regionmax) __P((DB_ENV *, u_int32_t *));
int (*get_lk_conflicts) __P((DB_ENV *, const u_int8_t **, int *)); int (*get_lk_conflicts) __P((DB_ENV *, const u_int8_t **, int *));
int (*get_lk_detect) __P((DB_ENV *, u_int32_t *)); int (*get_lk_detect) __P((DB_ENV *, u_int32_t *));
int (*get_lk_max_lockers) __P((DB_ENV *, u_int32_t *)); int (*get_lk_max_lockers) __P((DB_ENV *, u_int32_t *));
int (*get_lk_max_locks) __P((DB_ENV *, u_int32_t *)); int (*get_lk_max_locks) __P((DB_ENV *, u_int32_t *));
int (*get_lk_max_objects) __P((DB_ENV *, u_int32_t *)); int (*get_lk_max_objects) __P((DB_ENV *, u_int32_t *));
int (*get_lk_partitions) __P((DB_ENV *, u_int32_t *)); int (*get_lk_partitions) __P((DB_ENV *, u_int32_t *));
int (*get_lk_priority) __P((DB_ENV *, u_int32_t, u_int32_t *));
int (*get_mp_max_openfd) __P((DB_ENV *, int *)); int (*get_mp_max_openfd) __P((DB_ENV *, int *));
int (*get_mp_max_write) __P((DB_ENV *, int *, db_timeout_t *)); int (*get_mp_max_write) __P((DB_ENV *, int *, db_timeout_t *));
int (*get_mp_mmapsize) __P((DB_ENV *, size_t *)); int (*get_mp_mmapsize) __P((DB_ENV *, size_t *));
int (*get_mp_pagesize) __P((DB_ENV *, u_int32_t *));
int (*get_mp_tablesize) __P((DB_ENV *, u_int32_t *));
void (*get_msgcall)
__P((DB_ENV *, void (**)(const DB_ENV *, const char *)));
void (*get_msgfile) __P((DB_ENV *, FILE **)); void (*get_msgfile) __P((DB_ENV *, FILE **));
int (*get_open_flags) __P((DB_ENV *, u_int32_t *)); int (*get_open_flags) __P((DB_ENV *, u_int32_t *));
int (*get_shm_key) __P((DB_ENV *, long *)); int (*get_shm_key) __P((DB_ENV *, long *));
int (*get_thread_count) __P((DB_ENV *, u_int32_t *)); int (*get_thread_count) __P((DB_ENV *, u_int32_t *));
int (*get_thread_id_fn)
__P((DB_ENV *, void (**)(DB_ENV *, pid_t *, db_threadid_t *)
));
int (*get_thread_id_string_fn) __P((DB_ENV *,
char *(**)(DB_ENV *, pid_t, db_threadid_t, char *)));
int (*get_timeout) __P((DB_ENV *, db_timeout_t *, u_int32_t)); int (*get_timeout) __P((DB_ENV *, db_timeout_t *, u_int32_t));
int (*get_tmp_dir) __P((DB_ENV *, const char **)); int (*get_tmp_dir) __P((DB_ENV *, const char **));
int (*get_tx_max) __P((DB_ENV *, u_int32_t *)); int (*get_tx_max) __P((DB_ENV *, u_int32_t *));
int (*get_tx_timestamp) __P((DB_ENV *, time_t *)); int (*get_tx_timestamp) __P((DB_ENV *, time_t *));
int (*get_verbose) __P((DB_ENV *, u_int32_t, int *)); int (*get_verbose) __P((DB_ENV *, u_int32_t, int *));
int (*is_bigendian) __P((void)); int (*is_bigendian) __P((void));
int (*lock_detect) __P((DB_ENV *, u_int32_t, u_int32_t, int *)); int (*lock_detect) __P((DB_ENV *, u_int32_t, u_int32_t, int *));
int (*lock_get) __P((DB_ENV *, int (*lock_get) __P((DB_ENV *,
u_int32_t, u_int32_t, const DBT *, db_lockmode_t, DB_LOCK *) ); u_int32_t, u_int32_t, DBT *, db_lockmode_t, DB_LOCK *));
int (*lock_id) __P((DB_ENV *, u_int32_t *)); int (*lock_id) __P((DB_ENV *, u_int32_t *));
int (*lock_id_free) __P((DB_ENV *, u_int32_t)); int (*lock_id_free) __P((DB_ENV *, u_int32_t));
int (*lock_put) __P((DB_ENV *, DB_LOCK *)); int (*lock_put) __P((DB_ENV *, DB_LOCK *));
int (*lock_stat) __P((DB_ENV *, DB_LOCK_STAT **, u_int32_t)); int (*lock_stat) __P((DB_ENV *, DB_LOCK_STAT **, u_int32_t));
int (*lock_stat_print) __P((DB_ENV *, u_int32_t)); int (*lock_stat_print) __P((DB_ENV *, u_int32_t));
int (*lock_vec) __P((DB_ENV *, int (*lock_vec) __P((DB_ENV *,
u_int32_t, u_int32_t, DB_LOCKREQ *, int, DB_LOCKREQ **)); u_int32_t, u_int32_t, DB_LOCKREQ *, int, DB_LOCKREQ **));
int (*log_archive) __P((DB_ENV *, char **[], u_int32_t)); int (*log_archive) __P((DB_ENV *, char **[], u_int32_t));
int (*log_cursor) __P((DB_ENV *, DB_LOGC **, u_int32_t)); int (*log_cursor) __P((DB_ENV *, DB_LOGC **, u_int32_t));
int (*log_file) __P((DB_ENV *, const DB_LSN *, char *, size_t)); int (*log_file) __P((DB_ENV *, const DB_LSN *, char *, size_t));
int (*log_flush) __P((DB_ENV *, const DB_LSN *)); int (*log_flush) __P((DB_ENV *, const DB_LSN *));
int (*log_get_config) __P((DB_ENV *, u_int32_t, int *)); int (*log_get_config) __P((DB_ENV *, u_int32_t, int *));
int (*log_printf) __P((DB_ENV *, DB_TXN *, const char *, ...)); int (*log_printf) __P((DB_ENV *, DB_TXN *, const char *, ...));
int (*log_put) __P((DB_ENV *, DB_LSN *, const DBT *, u_int32_t)); int (*log_put) __P((DB_ENV *, DB_LSN *, const DBT *, u_int32_t));
int (*log_put_record) __P((DB_ENV *, DB *, DB_TXN *, DB_LSN *,
u_int32_t, u_int32_t, u_int32_t, u_int32_t,
DB_LOG_RECSPEC *, ...));
int (*log_read_record) __P((DB_ENV *, DB **,
void *, void *, DB_LOG_RECSPEC *, u_int32_t, void **));
int (*log_set_config) __P((DB_ENV *, u_int32_t, int)); int (*log_set_config) __P((DB_ENV *, u_int32_t, int));
int (*log_stat) __P((DB_ENV *, DB_LOG_STAT **, u_int32_t)); int (*log_stat) __P((DB_ENV *, DB_LOG_STAT **, u_int32_t));
int (*log_stat_print) __P((DB_ENV *, u_int32_t)); int (*log_stat_print) __P((DB_ENV *, u_int32_t));
int (*log_verify) __P((DB_ENV *, const DB_LOG_VERIFY_CONFIG *));
int (*lsn_reset) __P((DB_ENV *, const char *, u_int32_t)); int (*lsn_reset) __P((DB_ENV *, const char *, u_int32_t));
int (*memp_fcreate) __P((DB_ENV *, DB_MPOOLFILE **, u_int32_t)); int (*memp_fcreate) __P((DB_ENV *, DB_MPOOLFILE **, u_int32_t));
int (*memp_register) __P((DB_ENV *, int, int (*)(DB_ENV *, db_pgno_ t, int (*memp_register) __P((DB_ENV *, int, int (*)(DB_ENV *, db_pgno_ t,
void *, DBT *), int (*)(DB_ENV *, db_pgno_t, void *, DBT *)) ); void *, DBT *), int (*)(DB_ENV *, db_pgno_t, void *, DBT *)) );
int (*memp_stat) __P((DB_ENV *, int (*memp_stat) __P((DB_ENV *,
DB_MPOOL_STAT **, DB_MPOOL_FSTAT ***, u_int32_t)); DB_MPOOL_STAT **, DB_MPOOL_FSTAT ***, u_int32_t));
int (*memp_stat_print) __P((DB_ENV *, u_int32_t)); int (*memp_stat_print) __P((DB_ENV *, u_int32_t));
int (*memp_sync) __P((DB_ENV *, DB_LSN *)); int (*memp_sync) __P((DB_ENV *, DB_LSN *));
int (*memp_trickle) __P((DB_ENV *, int, int *)); int (*memp_trickle) __P((DB_ENV *, int, int *));
int (*mutex_alloc) __P((DB_ENV *, u_int32_t, db_mutex_t *)); int (*mutex_alloc) __P((DB_ENV *, u_int32_t, db_mutex_t *));
skipping to change at line 2073 skipping to change at line 2355
__P((DB_ENV *, u_int *, DB_REPMGR_SITE **)); __P((DB_ENV *, u_int *, DB_REPMGR_SITE **));
int (*repmgr_start) __P((DB_ENV *, int, u_int32_t)); int (*repmgr_start) __P((DB_ENV *, int, u_int32_t));
int (*repmgr_stat) __P((DB_ENV *, DB_REPMGR_STAT **, u_int32_t)); int (*repmgr_stat) __P((DB_ENV *, DB_REPMGR_STAT **, u_int32_t));
int (*repmgr_stat_print) __P((DB_ENV *, u_int32_t)); int (*repmgr_stat_print) __P((DB_ENV *, u_int32_t));
int (*set_alloc) __P((DB_ENV *, void *(*)(size_t), int (*set_alloc) __P((DB_ENV *, void *(*)(size_t),
void *(*)(void *, size_t), void (*)(void *))); void *(*)(void *, size_t), void (*)(void *)));
int (*set_app_dispatch) int (*set_app_dispatch)
__P((DB_ENV *, int (*)(DB_ENV *, DBT *, DB_LSN *, db_recops) )); __P((DB_ENV *, int (*)(DB_ENV *, DBT *, DB_LSN *, db_recops) ));
int (*set_cache_max) __P((DB_ENV *, u_int32_t, u_int32_t)); int (*set_cache_max) __P((DB_ENV *, u_int32_t, u_int32_t));
int (*set_cachesize) __P((DB_ENV *, u_int32_t, u_int32_t, int)); int (*set_cachesize) __P((DB_ENV *, u_int32_t, u_int32_t, int));
int (*set_create_dir) __P((DB_ENV *, const char *));
int (*set_data_dir) __P((DB_ENV *, const char *)); int (*set_data_dir) __P((DB_ENV *, const char *));
int (*set_encrypt) __P((DB_ENV *, const char *, u_int32_t)); int (*set_encrypt) __P((DB_ENV *, const char *, u_int32_t));
void (*set_errcall) __P((DB_ENV *, void (*set_errcall) __P((DB_ENV *,
void (*)(const DB_ENV *, const char *, const char *))); void (*)(const DB_ENV *, const char *, const char *)));
void (*set_errfile) __P((DB_ENV *, FILE *)); void (*set_errfile) __P((DB_ENV *, FILE *));
void (*set_errpfx) __P((DB_ENV *, const char *)); void (*set_errpfx) __P((DB_ENV *, const char *));
int (*set_event_notify) int (*set_event_notify)
__P((DB_ENV *, void (*)(DB_ENV *, u_int32_t, void *))); __P((DB_ENV *, void (*)(DB_ENV *, u_int32_t, void *)));
int (*set_feedback) __P((DB_ENV *, void (*)(DB_ENV *, int, int))); int (*set_feedback) __P((DB_ENV *, void (*)(DB_ENV *, int, int)));
int (*set_flags) __P((DB_ENV *, u_int32_t, int)); int (*set_flags) __P((DB_ENV *, u_int32_t, int));
skipping to change at line 2097 skipping to change at line 2380
int (*set_lg_dir) __P((DB_ENV *, const char *)); int (*set_lg_dir) __P((DB_ENV *, const char *));
int (*set_lg_filemode) __P((DB_ENV *, int)); int (*set_lg_filemode) __P((DB_ENV *, int));
int (*set_lg_max) __P((DB_ENV *, u_int32_t)); int (*set_lg_max) __P((DB_ENV *, u_int32_t));
int (*set_lg_regionmax) __P((DB_ENV *, u_int32_t)); int (*set_lg_regionmax) __P((DB_ENV *, u_int32_t));
int (*set_lk_conflicts) __P((DB_ENV *, u_int8_t *, int)); int (*set_lk_conflicts) __P((DB_ENV *, u_int8_t *, int));
int (*set_lk_detect) __P((DB_ENV *, u_int32_t)); int (*set_lk_detect) __P((DB_ENV *, u_int32_t));
int (*set_lk_max_lockers) __P((DB_ENV *, u_int32_t)); int (*set_lk_max_lockers) __P((DB_ENV *, u_int32_t));
int (*set_lk_max_locks) __P((DB_ENV *, u_int32_t)); int (*set_lk_max_locks) __P((DB_ENV *, u_int32_t));
int (*set_lk_max_objects) __P((DB_ENV *, u_int32_t)); int (*set_lk_max_objects) __P((DB_ENV *, u_int32_t));
int (*set_lk_partitions) __P((DB_ENV *, u_int32_t)); int (*set_lk_partitions) __P((DB_ENV *, u_int32_t));
int (*set_lk_priority) __P((DB_ENV *, u_int32_t, u_int32_t));
int (*set_mp_max_openfd) __P((DB_ENV *, int)); int (*set_mp_max_openfd) __P((DB_ENV *, int));
int (*set_mp_max_write) __P((DB_ENV *, int, db_timeout_t)); int (*set_mp_max_write) __P((DB_ENV *, int, db_timeout_t));
int (*set_mp_mmapsize) __P((DB_ENV *, size_t)); int (*set_mp_mmapsize) __P((DB_ENV *, size_t));
int (*set_mp_pagesize) __P((DB_ENV *, u_int32_t));
int (*set_mp_tablesize) __P((DB_ENV *, u_int32_t));
void (*set_msgcall) void (*set_msgcall)
__P((DB_ENV *, void (*)(const DB_ENV *, const char *))); __P((DB_ENV *, void (*)(const DB_ENV *, const char *)));
void (*set_msgfile) __P((DB_ENV *, FILE *)); void (*set_msgfile) __P((DB_ENV *, FILE *));
int (*set_paniccall) __P((DB_ENV *, void (*)(DB_ENV *, int))); int (*set_paniccall) __P((DB_ENV *, void (*)(DB_ENV *, int)));
int (*set_rpc_server) int (*set_rpc_server)
__P((DB_ENV *, void *, const char *, long, long, u_int32_t)) ; __P((DB_ENV *, void *, const char *, long, long, u_int32_t)) ;
int (*set_shm_key) __P((DB_ENV *, long)); int (*set_shm_key) __P((DB_ENV *, long));
int (*set_thread_count) __P((DB_ENV *, u_int32_t)); int (*set_thread_count) __P((DB_ENV *, u_int32_t));
int (*set_thread_id) int (*set_thread_id)
__P((DB_ENV *, void (*)(DB_ENV *, pid_t *, db_threadid_t *)) ); __P((DB_ENV *, void (*)(DB_ENV *, pid_t *, db_threadid_t *)) );
int (*set_thread_id_string) __P((DB_ENV *, int (*set_thread_id_string) __P((DB_ENV *,
char *(*)(DB_ENV *, pid_t, db_threadid_t, char *))); char *(*)(DB_ENV *, pid_t, db_threadid_t, char *)));
int (*set_timeout) __P((DB_ENV *, db_timeout_t, u_int32_t)); int (*set_timeout) __P((DB_ENV *, db_timeout_t, u_int32_t));
int (*set_tmp_dir) __P((DB_ENV *, const char *)); int (*set_tmp_dir) __P((DB_ENV *, const char *));
int (*set_tx_max) __P((DB_ENV *, u_int32_t)); int (*set_tx_max) __P((DB_ENV *, u_int32_t));
int (*set_tx_timestamp) __P((DB_ENV *, time_t *)); int (*set_tx_timestamp) __P((DB_ENV *, time_t *));
int (*set_verbose) __P((DB_ENV *, u_int32_t, int)); int (*set_verbose) __P((DB_ENV *, u_int32_t, int));
int (*txn_applied) __P((DB_ENV *,
DB_TXN_TOKEN *, db_timeout_t, u_int32_t));
int (*stat_print) __P((DB_ENV *, u_int32_t)); int (*stat_print) __P((DB_ENV *, u_int32_t));
int (*txn_begin) __P((DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t)); int (*txn_begin) __P((DB_ENV *, DB_TXN *, DB_TXN **, u_int32_t));
int (*txn_checkpoint) __P((DB_ENV *, u_int32_t, u_int32_t, u_int32_ t)); int (*txn_checkpoint) __P((DB_ENV *, u_int32_t, u_int32_t, u_int32_ t));
int (*txn_recover) int (*txn_recover) __P((DB_ENV *,
__P((DB_ENV *, DB_PREPLIST *, long, long *, u_int32_t)); DB_PREPLIST *, u_int32_t, u_int32_t *, u_int32_t));
int (*txn_stat) __P((DB_ENV *, DB_TXN_STAT **, u_int32_t)); int (*txn_stat) __P((DB_ENV *, DB_TXN_STAT **, u_int32_t));
int (*txn_stat_print) __P((DB_ENV *, u_int32_t)); int (*txn_stat_print) __P((DB_ENV *, u_int32_t));
/* DB_ENV PUBLIC HANDLE LIST END */ /* DB_ENV PUBLIC HANDLE LIST END */
/* DB_ENV PRIVATE HANDLE LIST BEGIN */ /* DB_ENV PRIVATE HANDLE LIST BEGIN */
int (*prdbt) __P((DBT *, int (*prdbt) __P((DBT *,
int, const char *, void *, int (*)(void *, const void *), in t)); int, const char *, void *, int (*)(void *, const void *), in t));
/* DB_ENV PRIVATE HANDLE LIST END */ /* DB_ENV PRIVATE HANDLE LIST END */
}; };
/* /*
* Dispatch structure for recovery and print routines. Since internal and * Dispatch structure for recovery, log verification and print routines. Si
* external routines take different arguments (ENV versus DB_ENV), we need nce
* something more elaborate than a single pointer and size. * internal and external routines take different arguments (ENV versus DB_E
NV),
* we need something more elaborate than a single pointer and size.
*/ */
struct __db_distab { struct __db_distab {
int (**int_dispatch) __P((ENV *, DBT *, DB_LSN *, db_recops, void *)); int (**int_dispatch) __P((ENV *, DBT *, DB_LSN *, db_recops, void *));
size_t int_size; size_t int_size;
int (**ext_dispatch) __P((DB_ENV *, DBT *, DB_LSN *, db_recops)); int (**ext_dispatch) __P((DB_ENV *, DBT *, DB_LSN *, db_recops));
size_t ext_size; size_t ext_size;
}; };
#ifndef DB_DBM_HSEARCH /*
#define DB_DBM_HSEARCH 0 /* No historic interfaces by * Log verification configuration structure.
default. */ */
#endif struct __db_logvrfy_config {
int continue_after_fail, verbose;
u_int32_t cachesize;
const char *temp_envhome;
const char *dbfile, *dbname;
DB_LSN start_lsn, end_lsn;
time_t start_time, end_time;
};
#if DB_DBM_HSEARCH != 0 #if DB_DBM_HSEARCH != 0
/******************************************************* /*******************************************************
* Dbm/Ndbm historic interfaces. * Dbm/Ndbm historic interfaces.
*******************************************************/ *******************************************************/
typedef struct __db DBM; typedef struct __db DBM;
#define DBM_INSERT 0 /* Flags to dbm_store(). */ #define DBM_INSERT 0 /* Flags to dbm_store(). */
#define DBM_REPLACE 1 #define DBM_REPLACE 1
/* /*
skipping to change at line 2178 skipping to change at line 2475
typedef struct { typedef struct {
char *dptr; char *dptr;
int dsize; int dsize;
} datum; } datum;
#endif #endif
/* /*
* Translate NDBM calls into DB calls so that DB doesn't step on the * Translate NDBM calls into DB calls so that DB doesn't step on the
* application's name space. * application's name space.
*/ */
#define dbm_clearerr(a) __db_ndbm_clearerr_rpmdb(a) #define dbm_clearerr(a) __db_ndbm_clearerr(a)
#define dbm_close(a) __db_ndbm_close_rpmdb(a) #define dbm_close(a) __db_ndbm_close(a)
#define dbm_delete(a, b) __db_ndbm_delete_rpmdb(a, b) #define dbm_delete(a, b) __db_ndbm_delete(a, b)
#define dbm_dirfno(a) __db_ndbm_dirfno_rpmdb(a) #define dbm_dirfno(a) __db_ndbm_dirfno(a)
#define dbm_error(a) __db_ndbm_error_rpmdb(a) #define dbm_error(a) __db_ndbm_error(a)
#define dbm_fetch(a, b) __db_ndbm_fetch_rpmdb(a, b) #define dbm_fetch(a, b) __db_ndbm_fetch(a, b)
#define dbm_firstkey(a) __db_ndbm_firstkey_rpmdb(a) #define dbm_firstkey(a) __db_ndbm_firstkey(a)
#define dbm_nextkey(a) __db_ndbm_nextkey_rpmdb(a) #define dbm_nextkey(a) __db_ndbm_nextkey(a)
#define dbm_open(a, b, c) __db_ndbm_open_rpmdb(a, b, c) #define dbm_open(a, b, c) __db_ndbm_open(a, b, c)
#define dbm_pagfno(a) __db_ndbm_pagfno_rpmdb(a) #define dbm_pagfno(a) __db_ndbm_pagfno(a)
#define dbm_rdonly(a) __db_ndbm_rdonly_rpmdb(a) #define dbm_rdonly(a) __db_ndbm_rdonly(a)
#define dbm_store(a, b, c, d) \ #define dbm_store(a, b, c, d) \
__db_ndbm_store_rpmdb(a, b, c, d) __db_ndbm_store(a, b, c, d)
/* /*
* Translate DBM calls into DB calls so that DB doesn't step on the * Translate DBM calls into DB calls so that DB doesn't step on the
* application's name space. * application's name space.
* *
* The global variables dbrdonly, dirf and pagf were not retained when 4BSD * The global variables dbrdonly, dirf and pagf were not retained when 4BSD
* replaced the dbm interface with ndbm, and are not supported here. * replaced the dbm interface with ndbm, and are not supported here.
*/ */
#define dbminit(a) __db_dbm_init_rpmdb(a) #define dbminit(a) __db_dbm_init(a)
#define dbmclose __db_dbm_close_rpmdb #define dbmclose __db_dbm_close
#if !defined(__cplusplus) #if !defined(__cplusplus)
#define delete(a) __db_dbm_delete_rpmdb(a) #define delete(a) __db_dbm_delete(a)
#endif #endif
#define fetch(a) __db_dbm_fetch_rpmdb(a) #define fetch(a) __db_dbm_fetch(a)
#define firstkey __db_dbm_firstkey_rpmdb #define firstkey __db_dbm_firstkey
#define nextkey(a) __db_dbm_nextkey_rpmdb(a) #define nextkey(a) __db_dbm_nextkey(a)
#define store(a, b) __db_dbm_store_rpmdb(a, b) #define store(a, b) __db_dbm_store(a, b)
/******************************************************* /*******************************************************
* Hsearch historic interface. * Hsearch historic interface.
*******************************************************/ *******************************************************/
typedef enum { typedef enum {
FIND, ENTER FIND, ENTER
} ACTION; } ACTION;
typedef struct entry { typedef struct entry {
char *key; char *key;
char *data; char *data;
} ENTRY; } ENTRY;
#define hcreate(a) __db_hcreate_rpmdb(a) #define hcreate(a) __db_hcreate(a)
#define hdestroy __db_hdestroy_rpmdb #define hdestroy __db_hdestroy
#define hsearch(a, b) __db_hsearch_rpmdb(a, b) #define hsearch(a, b) __db_hsearch(a, b)
#endif /* DB_DBM_HSEARCH */ #endif /* DB_DBM_HSEARCH */
#if defined(__cplusplus) #if defined(__cplusplus)
} }
#endif #endif
#endif /* !_DB_H_ */ #endif /* !_DB_H_ */
/* DO NOT EDIT: automatically built by dist/s_apiflags. */ /* DO NOT EDIT: automatically built by dist/s_apiflags. */
#define DB_AGGRESSIVE 0x00000001 #define DB_AGGRESSIVE 0x00000001
#define DB_ARCH_ABS 0x00000001 #define DB_ARCH_ABS 0x00000001
#define DB_ARCH_DATA 0x00000002 #define DB_ARCH_DATA 0x00000002
#define DB_ARCH_LOG 0x00000004 #define DB_ARCH_LOG 0x00000004
#define DB_ARCH_REMOVE 0x00000008 #define DB_ARCH_REMOVE 0x00000008
#define DB_AUTO_COMMIT 0x00000100 #define DB_AUTO_COMMIT 0x00000100
#define DB_CDB_ALLDB 0x00000004 #define DB_CDB_ALLDB 0x00000040
#define DB_CHKSUM 0x00000004 #define DB_CHKSUM 0x00000008
#define DB_CKP_INTERNAL 0x00000002 #define DB_CKP_INTERNAL 0x00000002
#define DB_CREATE 0x00000001 #define DB_CREATE 0x00000001
#define DB_CURSOR_BULK 0x00000001
#define DB_CURSOR_TRANSIENT 0x00000004
#define DB_CXX_NO_EXCEPTIONS 0x00000002 #define DB_CXX_NO_EXCEPTIONS 0x00000002
#define DB_DIRECT 0x00000002 #define DB_DIRECT 0x00000010
#define DB_DIRECT_DB 0x00000040 #define DB_DIRECT_DB 0x00000080
#define DB_DSYNC_DB 0x00000080 #define DB_DSYNC_DB 0x00000200
#define DB_DUP 0x00000008 #define DB_DUP 0x00000010
#define DB_DUPSORT 0x00000002 #define DB_DUPSORT 0x00000004
#define DB_DURABLE_UNKNOWN 0x00000020 #define DB_DURABLE_UNKNOWN 0x00000020
#define DB_ENCRYPT 0x00000001 #define DB_ENCRYPT 0x00000001
#define DB_ENCRYPT_AES 0x00000001 #define DB_ENCRYPT_AES 0x00000001
#define DB_EXCL 0x00000400 #define DB_EXCL 0x00000040
#define DB_EXTENT 0x00000004 #define DB_EXTENT 0x00000040
#define DB_FAILCHK 0x00000020
#define DB_FAST_STAT 0x00000001 #define DB_FAST_STAT 0x00000001
#define DB_FCNTL_LOCKING 0x00001000 #define DB_FCNTL_LOCKING 0x00000800
#define DB_FLUSH 0x00000001 #define DB_FLUSH 0x00000001
#define DB_FORCE 0x00000001 #define DB_FORCE 0x00000001
#define DB_FORCESYNC 0x00000001
#define DB_FOREIGN_ABORT 0x00000001 #define DB_FOREIGN_ABORT 0x00000001
#define DB_FOREIGN_CASCADE 0x00000002 #define DB_FOREIGN_CASCADE 0x00000002
#define DB_FOREIGN_NULLIFY 0x00000004 #define DB_FOREIGN_NULLIFY 0x00000004
#define DB_FREELIST_ONLY 0x00000001 #define DB_FREELIST_ONLY 0x00000001
#define DB_FREE_SPACE 0x00000002 #define DB_FREE_SPACE 0x00000002
#define DB_IGNORE_LEASE 0x00001000 #define DB_IGNORE_LEASE 0x00001000
#define DB_IMMUTABLE_KEY 0x00000002 #define DB_IMMUTABLE_KEY 0x00000002
#define DB_INIT_CDB 0x00000020 #define DB_INIT_CDB 0x00000040
#define DB_INIT_LOCK 0x00000040 #define DB_INIT_LOCK 0x00000080
#define DB_INIT_LOG 0x00000080 #define DB_INIT_LOG 0x00000100
#define DB_INIT_MPOOL 0x00000100 #define DB_INIT_MPOOL 0x00000200
#define DB_INIT_REP 0x00000200 #define DB_INIT_REP 0x00000400
#define DB_INIT_TXN 0x00000400 #define DB_INIT_TXN 0x00000800
#define DB_INORDER 0x00000010 #define DB_INORDER 0x00000020
#define DB_JOIN_NOSORT 0x00000001 #define DB_JOIN_NOSORT 0x00000001
#define DB_LOCKDOWN 0x00000800 #define DB_LOCKDOWN 0x00001000
#define DB_LOCK_NOWAIT 0x00000001 #define DB_LOCK_NOWAIT 0x00000001
#define DB_LOCK_RECORD 0x00000002 #define DB_LOCK_RECORD 0x00000002
#define DB_LOCK_SET_TIMEOUT 0x00000004 #define DB_LOCK_SET_TIMEOUT 0x00000004
#define DB_LOCK_SWITCH 0x00000008 #define DB_LOCK_SWITCH 0x00000008
#define DB_LOCK_UPGRADE 0x00000010 #define DB_LOCK_UPGRADE 0x00000010
#define DB_LOG_AUTO_REMOVE 0x00000004 #define DB_LOG_AUTO_REMOVE 0x00000001
#define DB_LOG_CHKPNT 0x00000002 #define DB_LOG_CHKPNT 0x00000002
#define DB_LOG_COMMIT 0x00000004 #define DB_LOG_COMMIT 0x00000004
#define DB_LOG_DIRECT 0x00000001 #define DB_LOG_DIRECT 0x00000002
#define DB_LOG_DSYNC 0x00000002 #define DB_LOG_DSYNC 0x00000004
#define DB_LOG_IN_MEMORY 0x00000008 #define DB_LOG_IN_MEMORY 0x00000008
#define DB_LOG_NOCOPY 0x00000008 #define DB_LOG_NOCOPY 0x00000008
#define DB_LOG_NOT_DURABLE 0x00000010 #define DB_LOG_NOT_DURABLE 0x00000010
#define DB_LOG_VERIFY_CAF 0x00000001
#define DB_LOG_VERIFY_DBFILE 0x00000002
#define DB_LOG_VERIFY_ERR 0x00000004
#define DB_LOG_VERIFY_FORWARD 0x00000008
#define DB_LOG_VERIFY_INTERR 0x00000010
#define DB_LOG_VERIFY_PARTIAL 0x00000020
#define DB_LOG_VERIFY_VERBOSE 0x00000040
#define DB_LOG_VERIFY_WARNING 0x00000080
#define DB_LOG_WRNOSYNC 0x00000020 #define DB_LOG_WRNOSYNC 0x00000020
#define DB_LOG_ZERO 0x00000010 #define DB_LOG_ZERO 0x00000010
#define DB_MPOOL_CREATE 0x00000001 #define DB_MPOOL_CREATE 0x00000001
#define DB_MPOOL_DIRTY 0x00000002 #define DB_MPOOL_DIRTY 0x00000002
#define DB_MPOOL_DISCARD 0x00000001 #define DB_MPOOL_DISCARD 0x00000001
#define DB_MPOOL_EDIT 0x00000004 #define DB_MPOOL_EDIT 0x00000004
#define DB_MPOOL_FREE 0x00000008 #define DB_MPOOL_FREE 0x00000008
#define DB_MPOOL_LAST 0x00000010 #define DB_MPOOL_LAST 0x00000010
#define DB_MPOOL_NEW 0x00000020 #define DB_MPOOL_NEW 0x00000020
#define DB_MPOOL_NOFILE 0x00000001 #define DB_MPOOL_NOFILE 0x00000001
#define DB_MPOOL_NOLOCK 0x00000002 #define DB_MPOOL_NOLOCK 0x00000002
#define DB_MPOOL_TRY 0x00000040
#define DB_MPOOL_UNLINK 0x00000002 #define DB_MPOOL_UNLINK 0x00000002
#define DB_MULTIPLE 0x00002000 #define DB_MULTIPLE 0x00000800
#define DB_MULTIPLE_KEY 0x00000100 #define DB_MULTIPLE_KEY 0x00004000
#define DB_MULTIVERSION 0x00000008 #define DB_MULTIVERSION 0x00000004
#define DB_MUTEX_ALLOCATED 0x00000001 #define DB_MUTEX_ALLOCATED 0x00000001
#define DB_MUTEX_LOCKED 0x00000002 #define DB_MUTEX_LOCKED 0x00000002
#define DB_MUTEX_LOGICAL_LOCK 0x00000004 #define DB_MUTEX_LOGICAL_LOCK 0x00000004
#define DB_MUTEX_PROCESS_ONLY 0x00000008 #define DB_MUTEX_PROCESS_ONLY 0x00000008
#define DB_MUTEX_SELF_BLOCK 0x00000010 #define DB_MUTEX_SELF_BLOCK 0x00000010
#define DB_NOLOCKING 0x00000200 #define DB_MUTEX_SHARED 0x00000020
#define DB_NOMMAP 0x00000010 #define DB_NOERROR 0x00001000
#define DB_NOLOCKING 0x00000400
#define DB_NOMMAP 0x00000008
#define DB_NOORDERCHK 0x00000002 #define DB_NOORDERCHK 0x00000002
#define DB_NOPANIC 0x00000400 #define DB_NOPANIC 0x00000800
#define DB_NO_AUTO_COMMIT 0x00002000 #define DB_NO_AUTO_COMMIT 0x00002000
#define DB_ODDFILESIZE 0x00000040 #define DB_ODDFILESIZE 0x00000080
#define DB_ORDERCHKONLY 0x00000004 #define DB_ORDERCHKONLY 0x00000004
#define DB_OVERWRITE 0x00001000 #define DB_OVERWRITE 0x00001000
#define DB_PANIC_ENVIRONMENT 0x00002000 #define DB_PANIC_ENVIRONMENT 0x00002000
#define DB_PRINTABLE 0x00000008 #define DB_PRINTABLE 0x00000008
#define DB_PRIVATE 0x00001000 #define DB_PRIVATE 0x00002000
#define DB_PR_PAGE 0x00000010 #define DB_PR_PAGE 0x00000010
#define DB_PR_RECOVERYTEST 0x00000020 #define DB_PR_RECOVERYTEST 0x00000020
#define DB_RDONLY 0x00000080 #define DB_RDONLY 0x00000400
#define DB_RDWRMASTER 0x00004000 #define DB_RDWRMASTER 0x00004000
#define DB_READ_COMMITTED 0x00000400 #define DB_READ_COMMITTED 0x00000400
#define DB_READ_UNCOMMITTED 0x00000200 #define DB_READ_UNCOMMITTED 0x00000200
#define DB_RECNUM 0x00000020 #define DB_RECNUM 0x00000040
#define DB_RECOVER 0x00000010 #define DB_RECOVER 0x00000002
#define DB_RECOVER_FATAL 0x00002000 #define DB_RECOVER_FATAL 0x00004000
#define DB_REGION_INIT 0x00004000 #define DB_REGION_INIT 0x00004000
#define DB_REGISTER 0x00004000 #define DB_REGISTER 0x00008000
#define DB_RENUMBER 0x00000040 #define DB_RENUMBER 0x00000080
#define DB_REPMGR_CONF_2SITE_STRICT 0x00000001 #define DB_REPMGR_CONF_2SITE_STRICT 0x00000001
#define DB_REPMGR_CONF_ELECTIONS 0x00000002
#define DB_REPMGR_PEER 0x00000001 #define DB_REPMGR_PEER 0x00000001
#define DB_REP_ANYWHERE 0x00000001 #define DB_REP_ANYWHERE 0x00000001
#define DB_REP_CLIENT 0x00000001 #define DB_REP_CLIENT 0x00000001
#define DB_REP_CONF_BULK 0x00000002 #define DB_REP_CONF_AUTOINIT 0x00000004
#define DB_REP_CONF_DELAYCLIENT 0x00000004 #define DB_REP_CONF_BULK 0x00000008
#define DB_REP_CONF_LEASE 0x00000008 #define DB_REP_CONF_DELAYCLIENT 0x00000010
#define DB_REP_CONF_NOAUTOINIT 0x00000010 #define DB_REP_CONF_INMEM 0x00000020
#define DB_REP_CONF_NOWAIT 0x00000020 #define DB_REP_CONF_LEASE 0x00000040
#define DB_REP_CONF_NOWAIT 0x00000080
#define DB_REP_ELECTION 0x00000004 #define DB_REP_ELECTION 0x00000004
#define DB_REP_MASTER 0x00000002 #define DB_REP_MASTER 0x00000002
#define DB_REP_NOBUFFER 0x00000002 #define DB_REP_NOBUFFER 0x00000002
#define DB_REP_PERMANENT 0x00000004 #define DB_REP_PERMANENT 0x00000004
#define DB_REP_REREQUEST 0x00000008 #define DB_REP_REREQUEST 0x00000008
#define DB_REVSPLITOFF 0x00000080 #define DB_REVSPLITOFF 0x00000100
#define DB_RMW 0x00000800 #define DB_RMW 0x00002000
#define DB_RPCCLIENT 0x00000001 #define DB_RPCCLIENT 0x00000001
#define DB_SALVAGE 0x00000040 #define DB_SALVAGE 0x00000040
#define DB_SA_SKIPFIRSTKEY 0x00010000 #define DB_SA_SKIPFIRSTKEY 0x00000080
#define DB_SA_UNKNOWNKEY 0x00000100
#define DB_SEQ_DEC 0x00000001 #define DB_SEQ_DEC 0x00000001
#define DB_SEQ_INC 0x00000002 #define DB_SEQ_INC 0x00000002
#define DB_SEQ_RANGE_SET 0x00000004 #define DB_SEQ_RANGE_SET 0x00000004
#define DB_SEQ_WRAP 0x00000008 #define DB_SEQ_WRAP 0x00000008
#define DB_SEQ_WRAPPED 0x00000010 #define DB_SEQ_WRAPPED 0x00000010
#define DB_SET_LOCK_TIMEOUT 0x00000002 #define DB_SET_LOCK_TIMEOUT 0x00000001
#define DB_SET_TXN_NOW 0x00000004 #define DB_SET_REG_TIMEOUT 0x00000004
#define DB_SET_TXN_TIMEOUT 0x00000001 #define DB_SET_TXN_NOW 0x00000008
#define DB_SNAPSHOT 0x00000100 #define DB_SET_TXN_TIMEOUT 0x00000002
#define DB_STAT_ALL 0x00000002 #define DB_SHALLOW_DUP 0x00000100
#define DB_SNAPSHOT 0x00000200
#define DB_STAT_ALL 0x00000004
#define DB_STAT_CLEAR 0x00000001 #define DB_STAT_CLEAR 0x00000001
#define DB_STAT_LOCK_CONF 0x00000004 #define DB_STAT_LOCK_CONF 0x00000008
#define DB_STAT_LOCK_LOCKERS 0x00000008 #define DB_STAT_LOCK_LOCKERS 0x00000010
#define DB_STAT_LOCK_OBJECTS 0x00000010 #define DB_STAT_LOCK_OBJECTS 0x00000020
#define DB_STAT_LOCK_PARAMS 0x00000020 #define DB_STAT_LOCK_PARAMS 0x00000040
#define DB_STAT_MEMP_HASH 0x00000004 #define DB_STAT_MEMP_HASH 0x00000008
#define DB_STAT_MEMP_NOERROR 0x00000008 #define DB_STAT_MEMP_NOERROR 0x00000010
#define DB_STAT_SUBSYSTEM 0x00000004 #define DB_STAT_SUBSYSTEM 0x00000002
#define DB_ST_DUPOK 0x00000100 #define DB_ST_DUPOK 0x00000200
#define DB_ST_DUPSET 0x00000200 #define DB_ST_DUPSET 0x00000400
#define DB_ST_DUPSORT 0x00000400 #define DB_ST_DUPSORT 0x00000800
#define DB_ST_IS_RECNO 0x00000800 #define DB_ST_IS_RECNO 0x00001000
#define DB_ST_OVFL_LEAF 0x00001000 #define DB_ST_OVFL_LEAF 0x00002000
#define DB_ST_RECNUM 0x00002000 #define DB_ST_RECNUM 0x00004000
#define DB_ST_RELEN 0x00004000 #define DB_ST_RELEN 0x00008000
#define DB_ST_TOPLEVEL 0x00008000 #define DB_ST_TOPLEVEL 0x00010000
#define DB_SYSTEM_MEM 0x00008000 #define DB_SYSTEM_MEM 0x00010000
#define DB_THREAD 0x00000004 #define DB_THREAD 0x00000010
#define DB_TIME_NOTGRANTED 0x00008000 #define DB_TIME_NOTGRANTED 0x00008000
#define DB_TRUNCATE 0x00008000 #define DB_TRUNCATE 0x00008000
#define DB_TXN_FAMILY 0x00000008
#define DB_TXN_NOSYNC 0x00000001 #define DB_TXN_NOSYNC 0x00000001
#define DB_TXN_NOT_DURABLE 0x00000200 #define DB_TXN_NOT_DURABLE 0x00000002
#define DB_TXN_NOWAIT 0x00000002 #define DB_TXN_NOWAIT 0x00000010
#define DB_TXN_SNAPSHOT 0x00000800 #define DB_TXN_SNAPSHOT 0x00000002
#define DB_TXN_SYNC 0x00000004 #define DB_TXN_SYNC 0x00000004
#define DB_TXN_WAIT 0x00000008 #define DB_TXN_WAIT 0x00000040
#define DB_TXN_WRITE_NOSYNC 0x00000020 #define DB_TXN_WRITE_NOSYNC 0x00000020
#define DB_UNREF 0x00000080 #define DB_UNREF 0x00020000
#define DB_UPGRADE 0x00000001 #define DB_UPGRADE 0x00000001
#define DB_USE_ENVIRON 0x00000002 #define DB_USE_ENVIRON 0x00000004
#define DB_USE_ENVIRON_ROOT 0x00000008 #define DB_USE_ENVIRON_ROOT 0x00000008
#define DB_VERB_DEADLOCK 0x00000001 #define DB_VERB_DEADLOCK 0x00000001
#define DB_VERB_FILEOPS 0x00000002 #define DB_VERB_FILEOPS 0x00000002
#define DB_VERB_FILEOPS_ALL 0x00000004 #define DB_VERB_FILEOPS_ALL 0x00000004
#define DB_VERB_RECOVERY 0x00000008 #define DB_VERB_RECOVERY 0x00000008
#define DB_VERB_REGISTER 0x00000010 #define DB_VERB_REGISTER 0x00000010
#define DB_VERB_REPLICATION 0x00000020 #define DB_VERB_REPLICATION 0x00000020
#define DB_VERB_REPMGR_CONNFAIL 0x00000040 #define DB_VERB_REPMGR_CONNFAIL 0x00000040
#define DB_VERB_REPMGR_MISC 0x00000080 #define DB_VERB_REPMGR_MISC 0x00000080
#define DB_VERB_REP_ELECT 0x00000100 #define DB_VERB_REP_ELECT 0x00000100
#define DB_VERB_REP_LEASE 0x00000200 #define DB_VERB_REP_LEASE 0x00000200
#define DB_VERB_REP_MISC 0x00000400 #define DB_VERB_REP_MISC 0x00000400
#define DB_VERB_REP_MSGS 0x00000800 #define DB_VERB_REP_MSGS 0x00000800
#define DB_VERB_REP_SYNC 0x00001000 #define DB_VERB_REP_SYNC 0x00001000
#define DB_VERB_WAITSFOR 0x00002000 #define DB_VERB_REP_SYSTEM 0x00002000
#define DB_VERB_REP_TEST 0x00004000
#define DB_VERB_WAITSFOR 0x00008000
#define DB_VERIFY 0x00000002 #define DB_VERIFY 0x00000002
#define DB_VERIFY_PARTITION 0x00040000
#define DB_WRITECURSOR 0x00000008
#define DB_WRITELOCK 0x00000010
#define DB_WRITEOPEN 0x00010000 #define DB_WRITEOPEN 0x00010000
#define DB_XA_CREATE 0x00000800
#define DB_YIELDCPU 0x00010000 #define DB_YIELDCPU 0x00010000
/* DO NOT EDIT: automatically built by dist/s_include. */ /* DO NOT EDIT: automatically built by dist/s_include. */
#ifndef _DB_EXT_DEF_IN_
#define _DB_EXT_DEF_IN_
/*@-declundef -noparams -fcnuse@*/
#define db_create db_create_rpmdb
#define db_strerror db_strerror_rpmdb
#define db_env_set_func_close db_env_set_func_close_rpmdb
#define db_env_set_func_dirfree db_env_set_func_dirfree_rpmdb
#define db_env_set_func_dirlist db_env_set_func_dirlist_rpmdb
#define db_env_set_func_exists db_env_set_func_exists_rpmdb
#define db_env_set_func_free db_env_set_func_free_rpmdb
#define db_env_set_func_fsync db_env_set_func_fsync_rpmdb
#define db_env_set_func_ftruncate db_env_set_func_ftruncate_rpmdb
#define db_env_set_func_ioinfo db_env_set_func_ioinfo_rpmdb
#define db_env_set_func_malloc db_env_set_func_malloc_rpmdb
#define db_env_set_func_file_map db_env_set_func_file_map_rpmdb
#define db_env_set_func_region_map db_env_set_func_region_map_rpmdb
#define db_env_set_func_pread db_env_set_func_pread_rpmdb
#define db_env_set_func_pwrite db_env_set_func_pwrite_rpmdb
#define db_env_set_func_open db_env_set_func_open_rpmdb
#define db_env_set_func_read db_env_set_func_read_rpmdb
#define db_env_set_func_realloc db_env_set_func_realloc_rpmdb
#define db_env_set_func_rename db_env_set_func_rename_rpmdb
#define db_env_set_func_seek db_env_set_func_seek_rpmdb
#define db_env_set_func_unlink db_env_set_func_unlink_rpmdb
#define db_env_set_func_write db_env_set_func_write_rpmdb
#define db_env_set_func_yield db_env_set_func_yield_rpmdb
#define db_env_create db_env_create_rpmdb
#define db_version db_version_rpmdb
#define log_compare log_compare_rpmdb
#define db_sequence_create db_sequence_create_rpmdb
#if DB_DBM_HSEARCH != 0
#define __db_ndbm_clearerr __db_ndbm_clearerr_rpmdb
#define __db_ndbm_close __db_ndbm_close_rpmdb
#define __db_ndbm_delete __db_ndbm_delete_rpmdb
#define __db_ndbm_dirfno __db_ndbm_dirfno_rpmdb
#define __db_ndbm_error __db_ndbm_error_rpmdb
#define __db_ndbm_fetch __db_ndbm_fetch_rpmdb
#define __db_ndbm_firstkey __db_ndbm_firstkey_rpmdb
#define __db_ndbm_nextkey __db_ndbm_nextkey_rpmdb
#define __db_ndbm_open __db_ndbm_open_rpmdb
#define __db_ndbm_pagfno __db_ndbm_pagfno_rpmdb
#define __db_ndbm_rdonly __db_ndbm_rdonly_rpmdb
#define __db_ndbm_store __db_ndbm_store_rpmdb
#define __db_dbm_close __db_dbm_close_rpmdb
#define __db_dbm_delete __db_dbm_delete_rpmdb
#define __db_dbm_fetch __db_dbm_fetch_rpmdb
#define __db_dbm_firstkey __db_dbm_firstkey_rpmdb
#define __db_dbm_init __db_dbm_init_rpmdb
#define __db_dbm_nextkey __db_dbm_nextkey_rpmdb
#define __db_dbm_store __db_dbm_store_rpmdb
#endif
#if DB_DBM_HSEARCH != 0
#define __db_hcreate __db_hcreate_rpmdb
#define __db_hsearch __db_hsearch_rpmdb
#define __db_hdestroy __db_hdestroy_rpmdb
#endif
#define db_xa_switch db_xa_switch_rpmdb
#endif /* !_DB_EXT_DEF_IN_ */
/* DO NOT EDIT: automatically built by dist/s_include. */
#ifndef _DB_EXT_PROT_IN_ #ifndef _DB_EXT_PROT_IN_
#define _DB_EXT_PROT_IN_ #define _DB_EXT_PROT_IN_
#if defined(__cplusplus) #if defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
int db_create __P((DB **, DB_ENV *, u_int32_t)); int db_create __P((DB **, DB_ENV *, u_int32_t));
char *db_strerror __P((int)); char *db_strerror __P((int));
int db_env_set_func_close __P((int (*)(int))); int db_env_set_func_close __P((int (*)(int)));
skipping to change at line 2504 skipping to change at line 2764
int db_env_set_func_open __P((int (*)(const char *, int, ...))); int db_env_set_func_open __P((int (*)(const char *, int, ...)));
int db_env_set_func_read __P((ssize_t (*)(int, void *, size_t))); int db_env_set_func_read __P((ssize_t (*)(int, void *, size_t)));
int db_env_set_func_realloc __P((void *(*)(void *, size_t))); int db_env_set_func_realloc __P((void *(*)(void *, size_t)));
int db_env_set_func_rename __P((int (*)(const char *, const char *))); int db_env_set_func_rename __P((int (*)(const char *, const char *)));
int db_env_set_func_seek __P((int (*)(int, off_t, int))); int db_env_set_func_seek __P((int (*)(int, off_t, int)));
int db_env_set_func_unlink __P((int (*)(const char *))); int db_env_set_func_unlink __P((int (*)(const char *)));
int db_env_set_func_write __P((ssize_t (*)(int, const void *, size_t))); int db_env_set_func_write __P((ssize_t (*)(int, const void *, size_t)));
int db_env_set_func_yield __P((int (*)(u_long, u_long))); int db_env_set_func_yield __P((int (*)(u_long, u_long)));
int db_env_create __P((DB_ENV **, u_int32_t)); int db_env_create __P((DB_ENV **, u_int32_t));
char *db_version __P((int *, int *, int *)); char *db_version __P((int *, int *, int *));
char *db_full_version __P((int *, int *, int *, int *, int *));
int log_compare __P((const DB_LSN *, const DB_LSN *)); int log_compare __P((const DB_LSN *, const DB_LSN *));
int db_sequence_create __P((DB_SEQUENCE **, DB *, u_int32_t)); int db_sequence_create __P((DB_SEQUENCE **, DB *, u_int32_t));
#if DB_DBM_HSEARCH != 0 #ifdef HAVE_DBM
int __db_ndbm_clearerr __P((DBM *)); int __db_ndbm_clearerr __P((DBM *));
void __db_ndbm_close __P((DBM *)); void __db_ndbm_close __P((DBM *));
int __db_ndbm_delete __P((DBM *, datum)); int __db_ndbm_delete __P((DBM *, datum));
int __db_ndbm_dirfno __P((DBM *)); int __db_ndbm_dirfno __P((DBM *));
int __db_ndbm_error __P((DBM *)); int __db_ndbm_error __P((DBM *));
datum __db_ndbm_fetch __P((DBM *, datum)); datum __db_ndbm_fetch __P((DBM *, datum));
datum __db_ndbm_firstkey __P((DBM *)); datum __db_ndbm_firstkey __P((DBM *));
datum __db_ndbm_nextkey __P((DBM *)); datum __db_ndbm_nextkey __P((DBM *));
DBM *__db_ndbm_open __P((const char *, int, int)); DBM *__db_ndbm_open __P((const char *, int, int));
int __db_ndbm_pagfno __P((DBM *)); int __db_ndbm_pagfno __P((DBM *));
 End of changes. 164 change blocks. 
614 lines changed or deleted 908 lines changed or added


 mire.h   mire.h 
#ifndef H_MIRE #ifndef H_MIRE
#define H_MIRE #define H_MIRE
/** \ingroup rpmtrans /** \ingroup rpmtrans
* \file rpmio/mire.h * \file rpmio/mire.h
* RPM pattern matching. * RPM pattern matching.
*/ */
#include <rpmiotypes.h>
/*@-noparams@*/ /*@-noparams@*/
#include <fnmatch.h> #include <fnmatch.h>
/*@=noparams@*/ /*@=noparams@*/
#if defined(__LCLINT__) #if defined(__LCLINT__)
/*@-declundef -exportheader -redecl @*/ /* LCL: missing annotation */ /*@-declundef -exportheader -redecl @*/ /* LCL: missing annotation */
extern int fnmatch (const char *__pattern, const char *__name, int __flags) extern int fnmatch (const char *__pattern, const char *__name, int __flags)
/*@*/; /*@*/;
/*@=declundef =exportheader =redecl @*/ /*@=declundef =exportheader =redecl @*/
#endif #endif
 End of changes. 1 change blocks. 
0 lines changed or deleted 2 lines changed or added


 pkgio.h   pkgio.h 
#ifndef _H_PKGIO #ifndef _H_PKGIO
#define _H_PKGIO #define _H_PKGIO
/** \ingroup lead /** \ingroup lead
* \file rpmdb/pkgio.h * \file rpmdb/pkgio.h
* Methods to handle package elements. * Methods to handle package elements.
*/ */
#include <rpmio.h> /* XXX FD_t typedef */
#include <rpmpgp.h> /* XXX pgpDig typedef */ #include <rpmpgp.h> /* XXX pgpDig typedef */
#include <rpmtag.h> /* XXX Header typedef */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
* Check header consistency, performing headerGetEntry() the hard way. * Check header consistency, performing headerGetEntry() the hard way.
* *
* Sanity checks on the header are performed while looking for a * Sanity checks on the header are performed while looking for a
* header-only digest or signature to verify the blob. If found, * header-only digest or signature to verify the blob. If found,
 End of changes. 2 change blocks. 
0 lines changed or deleted 2 lines changed or added


 rpm46compat.h   rpm46compat.h 
/* /*
* Copyright © 2009 Per Øyvind Karlsen <peroyvind@mandriva.org> * Copyright © 2009 Per Øyvind Karlsen <peroyvind@mandriva.org>
* *
* $Id: rpm46compat.h,v 1.1.2.4 2009/08/06 00:44:05 pkarlsen Exp $ * $Id: rpm46compat.h,v 2.1 2009/08/06 00:52:28 pkarlsen Exp $
*/ */
#ifndef H_RPM46COMPAT #ifndef H_RPM46COMPAT
#define H_RPM46COMPAT 1 #define H_RPM46COMPAT 1
#include <rpm/rpm4compat.h> #include <rpm/rpm4compat.h>
#include <rpmbuild.h> #include <rpmbuild.h>
typedef rpmuint64_t rpm_loff_t; typedef rpmuint64_t rpm_loff_t;
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 rpm4compat.h   rpm4compat.h 
/* /*
* Copyright © 2008 Per Øyvind Karlsen <peroyvind@mandriva.org> * Copyright © 2008 Per Øyvind Karlsen <peroyvind@mandriva.org>
* *
* $Id: rpm4compat.h,v 2.23.2.5 2009/08/06 04:56:05 pkarlsen Exp $ * $Id: rpm4compat.h,v 2.30 2010/01/27 17:14:04 bero Exp $
*/ */
#ifndef H_RPM4COMPAT #ifndef H_RPM4COMPAT
#define H_RPM4COMPAT 1 #define H_RPM4COMPAT 1
#define RPM_NULL_TYPE 0 #define RPM_NULL_TYPE 0
#define RPM_CHAR_TYPE 1 #define RPM_CHAR_TYPE 1
#define RPM_INT8_TYPE RPM_UINT8_TYPE #define RPM_INT8_TYPE RPM_UINT8_TYPE
#define RPM_INT16_TYPE RPM_UINT16_TYPE #define RPM_INT16_TYPE RPM_UINT16_TYPE
#define RPM_INT32_TYPE RPM_UINT32_TYPE #define RPM_INT32_TYPE RPM_UINT32_TYPE
skipping to change at line 357 skipping to change at line 357
static inline off_t fdSize(FD_t fd){ static inline off_t fdSize(FD_t fd){
struct stat sb; struct stat sb;
Fstat(fd, &sb); Fstat(fd, &sb);
return sb.st_size; return sb.st_size;
} }
static inline unsigned int rpmdbGetIteratorOffset(rpmdbMatchIterator mi) { static inline unsigned int rpmdbGetIteratorOffset(rpmdbMatchIterator mi) {
return rpmmiInstance(mi); return rpmmiInstance(mi);
} }
static inline unsigned int rpmdbGetIteratorFileNum(rpmdbMatchIterator mi) {
return rpmmiFilenum(mi);
}
static inline int rpmdbGetIteratorCount(rpmdbMatchIterator mi) { static inline int rpmdbGetIteratorCount(rpmdbMatchIterator mi) {
return rpmmiCount(mi); return rpmmiCount(mi);
} }
static inline int rpmdbAppendIterator(rpmdbMatchIterator mi, static inline int rpmdbAppendIterator(rpmdbMatchIterator mi,
const int * hdrNums, int nHdrNums) { const uint32_t * hdrNums, int nHdrNums) {
return rpmmiGrow(mi, hdrNums, nHdrNums); return rpmmiGrow(mi, hdrNums, nHdrNums);
} }
static inline int rpmdbPruneIterator(rpmdbMatchIterator mi, static inline int rpmdbPruneIterator(rpmdbMatchIterator mi,
int * hdrNums, int nHdrNums, int sorted) { uint32_t * hdrNums, int nHdrNums, int sorted) {
return rpmmiPrune(mi, hdrNums, nHdrNums, sorted); return rpmmiPrune(mi, hdrNums, nHdrNums, sorted);
} }
static inline int rpmdbSetIteratorRE(rpmdbMatchIterator mi, rpmTag tag, static inline int rpmdbSetIteratorRE(rpmdbMatchIterator mi, rpmTag tag,
rpmMireMode mode, const char * pattern) { rpmMireMode mode, const char * pattern) {
return rpmmiAddPattern(mi, tag, mode, pattern); return rpmmiAddPattern(mi, tag, mode, pattern);
} }
static inline int rpmdbSetIteratorRewrite(rpmdbMatchIterator mi, int rewrit e) { static inline int rpmdbSetIteratorRewrite(rpmdbMatchIterator mi, int rewrit e) {
return rpmmiSetRewrite(mi, rewrite); return rpmmiSetRewrite(mi, rewrite);
} }
static inline int rpmdbSetIteratorModified(rpmdbMatchIterator mi, int modif ied) { static inline int rpmdbSetIteratorModified(rpmdbMatchIterator mi, int modif ied) {
return rpmmiSetModified(mi, modified); return rpmmiSetModified(mi, modified);
} }
static inline int rpmdbSetHdrChk(rpmdbMatchIterator mi, rpmts ts, static inline int rpmdbSetHdrChk(rpmdbMatchIterator mi, rpmts ts,
rpmRC (*hdrchk) (rpmts ts, const void * uh, size_t uc, char ** msg)) { rpmRC (*hdrchk) (rpmts ts, const void * uh, size_t uc, char ** msg)) {
return rpmmiSetHdrChk(mi, ts); return 0;
} }
static inline rpmdbMatchIterator rpmdbInitIterator(rpmdb db, rpmTag tag, static inline rpmdbMatchIterator rpmdbInitIterator(rpmdb db, rpmTag tag,
const void * keyp, size_t keylen) { const void * keyp, size_t keylen) {
return rpmmiInit(db, tag, keyp, keylen); return rpmmiInit(db, tag, keyp, keylen);
} }
static inline Header rpmdbNextIterator(rpmdbMatchIterator mi) { static inline Header rpmdbNextIterator(rpmdbMatchIterator mi) {
return rpmmiNext(mi); return rpmmiNext(mi);
} }
 End of changes. 5 change blocks. 
8 lines changed or deleted 4 lines changed or added


 rpmbuild.h   rpmbuild.h 
skipping to change at line 413 skipping to change at line 413
* @retval pkg package control structure * @retval pkg package control structure
* @return RPMRC_OK on success * @return RPMRC_OK on success
*/ */
rpmRC lookupPackage(Spec spec, /*@null@*/ const char * name, int flag, rpmRC lookupPackage(Spec spec, /*@null@*/ const char * name, int flag,
/*@out@*/ Package * pkg) /*@out@*/ Package * pkg)
/*@globals rpmGlobalMacroContext, h_errno, internalState @*/ /*@globals rpmGlobalMacroContext, h_errno, internalState @*/
/*@modifies spec->packages, *pkg, rpmGlobalMacroContext, /*@modifies spec->packages, *pkg, rpmGlobalMacroContext,
internalState @*/; internalState @*/;
/** \ingroup rpmbuild /** \ingroup rpmbuild
* Create and initialize package control structure.
* @param spec spec file control structure
* @return package control structure
*/
/*@only@*/
Package newPackage(Spec spec)
/*@modifies spec->packages, spec->packages->next @*/;
/** \ingroup rpmbuild
* Destroy all packages associated with spec file. * Destroy all packages associated with spec file.
* @param packages package control structure chain * @param packages package control structure chain
* @return NULL * @return NULL
*/ */
/*@null@*/ /*@null@*/
Package freePackages(/*@only@*/ /*@null@*/ Package packages) Package freePackages(/*@only@*/ /*@null@*/ Package packages)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies packages, fileSystem @*/; /*@modifies packages, fileSystem @*/;
/** \ingroup rpmbuild /** \ingroup rpmbuild
* Destroy package control structure. * Destroy a package control structure.
* @todo Rename to pkgFree.
* @param pkg package control structure * @param pkg package control structure
* @return NULL * @return NULL on last dereference
*/ */
/*@null@*/ /*@null@*/
Package freePackage(/*@only@*/ /*@null@*/ Package pkg) Package freePackage(/*@killref@*/ /*@null@*/ Package pkg)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies pkg, fileSystem @*/; /*@modifies pkg, fileSystem @*/;
#define freePackage(_pkg) \
((Package)rpmioFreePoolItem((rpmioItem)(_pkg), __FUNCTION__, __FILE__,
__LINE__))
/** \ingroup rpmbuild
* Create and initialize package control structure.
* @param spec spec file control structure
* @return package control structure
*/
/*@only@*/
Package newPackage(Spec spec)
/*@modifies spec->packages, spec->packages->next @*/;
/** \ingroup rpmbuild /** \ingroup rpmbuild
* Add dependency to header, filtering duplicates. * Add dependency to header, filtering duplicates.
* @param spec spec file control structure * @param spec spec file control structure
* @param h header * @param h header
* @param tagN tag, identifies type of dependency * @param tagN tag, identifies type of dependency
* @param N (e.g. Requires: foo < 0:1.2-3, "foo") * @param N (e.g. Requires: foo < 0:1.2-3, "foo")
* @param EVR (e.g. Requires: foo < 0:1.2-3, "0:1.2-3") * @param EVR (e.g. Requires: foo < 0:1.2-3, "0:1.2-3")
* @param Flags (e.g. Requires: foo < 0:1.2-3, both "Require s:" and "<") * @param Flags (e.g. Requires: foo < 0:1.2-3, both "Require s:" and "<")
* @param index (0 always) * @param index (0 always)
skipping to change at line 499 skipping to change at line 502
/** \ingroup rpmbuild /** \ingroup rpmbuild
* Post-build processing for binary package(s). * Post-build processing for binary package(s).
* @param spec spec file control structure * @param spec spec file control structure
* @param installSpecialDoc * @param installSpecialDoc
* @param test don't execute scripts or package if testing * @param test don't execute scripts or package if testing
* @return RPMRC_OK on success * @return RPMRC_OK on success
*/ */
rpmRC processBinaryFiles(Spec spec, int installSpecialDoc, int test) rpmRC processBinaryFiles(Spec spec, int installSpecialDoc, int test)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies spec->macros, *spec->packages, /*@modifies spec->macros, *spec->packages,
spec->packages->cpioList, spec->packages->fileList, spec->packages->fi, spec->packages->fileList,
spec->packages->specialDoc, spec->packages->header, spec->packages->specialDoc, spec->packages->header,
rpmGlobalMacroContext, fileSystem, internalState @*/; rpmGlobalMacroContext, fileSystem, internalState @*/;
/** \ingroup rpmbuild /** \ingroup rpmbuild
* Create and initialize header for source package. * Create and initialize header for source package.
* @param spec spec file control structure * @param spec spec file control structure
* @retval *sfp srpm file list (may be NULL) * @retval *sfp srpm file list (may be NULL)
* @return 0 always * @return 0 always
*/ */
int initSourceHeader(Spec spec, /*@null@*/ rpmiob *sfp) int initSourceHeader(Spec spec, /*@null@*/ rpmiob *sfp)
skipping to change at line 564 skipping to change at line 567
* @param what bit(s) to enable stages of build * @param what bit(s) to enable stages of build
* @param test don't execute scripts or package if testing * @param test don't execute scripts or package if testing
* @return RPMRC_OK on success * @return RPMRC_OK on success
*/ */
rpmRC buildSpec(rpmts ts, Spec spec, int what, int test) rpmRC buildSpec(rpmts ts, Spec spec, int what, int test)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies spec->sourceHeader, spec->sourceCpioList, spec->cookie, /*@modifies spec->sourceHeader, spec->sourceCpioList, spec->cookie,
spec->sourceRpmName, spec->sourcePkgId, spec->sourceHdrInit, spec->sourceRpmName, spec->sourcePkgId, spec->sourceHdrInit,
spec->macros, spec->BASpecs, spec->macros, spec->BASpecs,
spec->BANames, *spec->packages, spec->BANames, *spec->packages,
spec->packages->cpioList, spec->packages->fileList, spec->packages->fi, spec->packages->fileList,
spec->packages->specialDoc, spec->packages->header, spec->packages->specialDoc, spec->packages->header,
rpmGlobalMacroContext, fileSystem, internalState @*/; rpmGlobalMacroContext, fileSystem, internalState @*/;
/** \ingroup rpmbuild /** \ingroup rpmbuild
* Generate binary package(s). * Generate binary package(s).
* @param spec spec file control structure * @param spec spec file control structure
* @return rpmRC on success * @return rpmRC on success
*/ */
rpmRC packageBinaries(Spec spec) rpmRC packageBinaries(Spec spec)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies spec->packages->header, spec->packages->cpioList, /*@modifies spec->packages->header, spec->packages->fi,
spec->sourceRpmName, spec->cookie, spec->sourcePkgId, spec->sourceRpmName, spec->cookie, spec->sourcePkgId,
rpmGlobalMacroContext, fileSystem, internalState @*/; rpmGlobalMacroContext, fileSystem, internalState @*/;
/** \ingroup rpmbuild /** \ingroup rpmbuild
* Generate source package. * Generate source package.
* @param spec spec file control structure * @param spec spec file control structure
* @return RPMRC_OK on success * @return RPMRC_OK on success
*/ */
rpmRC packageSources(Spec spec) rpmRC packageSources(Spec spec)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
 End of changes. 8 change blocks. 
15 lines changed or deleted 19 lines changed or added


 rpmcli.h   rpmcli.h 
skipping to change at line 103 skipping to change at line 103
* Common/global popt tokens used for command line option tables. * Common/global popt tokens used for command line option tables.
*/ */
#define RPMCLI_POPT_NODEPS -1026 #define RPMCLI_POPT_NODEPS -1026
#define RPMCLI_POPT_NOFDIGESTS -1027 #define RPMCLI_POPT_NOFDIGESTS -1027
#define RPMCLI_POPT_NOSCRIPTS -1028 #define RPMCLI_POPT_NOSCRIPTS -1028
#define RPMCLI_POPT_NOSIGNATURE -1029 #define RPMCLI_POPT_NOSIGNATURE -1029
#define RPMCLI_POPT_NODIGEST -1030 #define RPMCLI_POPT_NODIGEST -1030
#define RPMCLI_POPT_NOHDRCHK -1031 #define RPMCLI_POPT_NOHDRCHK -1031
#define RPMCLI_POPT_NOCONTEXTS -1032 #define RPMCLI_POPT_NOCONTEXTS -1032
#define RPMCLI_POPT_TARGETPLATFORM -1033 #define RPMCLI_POPT_TARGETPLATFORM -1033
#define RPMCLI_POPT_NOHMACS -1034
/* ==================================================================== */ /* ==================================================================== */
/** \name RPMQV */ /** \name RPMQV */
/*@{*/ /*@{*/
/** \ingroup rpmcli /** \ingroup rpmcli
* Query/Verify argument qualifiers. * Query/Verify argument qualifiers.
* @todo Reassign to tag values. * @todo Reassign to tag values.
*/ */
typedef enum rpmQVSources_e { typedef enum rpmQVSources_e {
skipping to change at line 149 skipping to change at line 150
typedef enum rpmVerifyAttrs_e { typedef enum rpmVerifyAttrs_e {
RPMVERIFY_NONE = 0, /*!< */ RPMVERIFY_NONE = 0, /*!< */
RPMVERIFY_FDIGEST = (1 << 0), /*!< from %verify(digest) */ RPMVERIFY_FDIGEST = (1 << 0), /*!< from %verify(digest) */
RPMVERIFY_FILESIZE = (1 << 1), /*!< from %verify(size) */ RPMVERIFY_FILESIZE = (1 << 1), /*!< from %verify(size) */
RPMVERIFY_LINKTO = (1 << 2), /*!< from %verify(link) */ RPMVERIFY_LINKTO = (1 << 2), /*!< from %verify(link) */
RPMVERIFY_USER = (1 << 3), /*!< from %verify(user) */ RPMVERIFY_USER = (1 << 3), /*!< from %verify(user) */
RPMVERIFY_GROUP = (1 << 4), /*!< from %verify(group) */ RPMVERIFY_GROUP = (1 << 4), /*!< from %verify(group) */
RPMVERIFY_MTIME = (1 << 5), /*!< from %verify(mtime) */ RPMVERIFY_MTIME = (1 << 5), /*!< from %verify(mtime) */
RPMVERIFY_MODE = (1 << 6), /*!< from %verify(mode) */ RPMVERIFY_MODE = (1 << 6), /*!< from %verify(mode) */
RPMVERIFY_RDEV = (1 << 7), /*!< from %verify(rdev) */ RPMVERIFY_RDEV = (1 << 7), /*!< from %verify(rdev) */
/* bits 8-14 unused, reserved for rpmVerifyAttrs */ RPMVERIFY_CAPS = (1 << 8), /*!< from %verify(caps) (unimplement
ed) */
/* bits 9-13 unused, reserved for rpmVerifyAttrs */
RPMVERIFY_HMAC = (1 << 14),
RPMVERIFY_CONTEXTS = (1 << 15), /*!< verify: from --nocontexts */ RPMVERIFY_CONTEXTS = (1 << 15), /*!< verify: from --nocontexts */
/* bits 16-22 used in rpmVerifyFlags */ /* bits 16-22 used in rpmVerifyFlags */
/* bits 23-27 used in rpmQueryFlags */ /* bits 23-27 used in rpmQueryFlags */
RPMVERIFY_READLINKFAIL= (1 << 28), /*!< readlink failed */ RPMVERIFY_READLINKFAIL= (1 << 28), /*!< readlink failed */
RPMVERIFY_READFAIL = (1 << 29), /*!< file read failed */ RPMVERIFY_READFAIL = (1 << 29), /*!< file read failed */
RPMVERIFY_LSTATFAIL = (1 << 30), /*!< lstat failed */ RPMVERIFY_LSTATFAIL = (1 << 30), /*!< lstat failed */
RPMVERIFY_LGETFILECONFAIL = (1 << 31) /*!< lgetfilecon failed */ RPMVERIFY_LGETFILECONFAIL = (1 << 31) /*!< lgetfilecon failed */
} rpmVerifyAttrs; } rpmVerifyAttrs;
#define RPMVERIFY_MD5 RPMVERIFY_FDIGEST
#define RPMVERIFY_ALL ~(RPMVERIFY_NONE) #define RPMVERIFY_ALL ~(RPMVERIFY_NONE)
#define RPMVERIFY_FAILURES \ #define RPMVERIFY_FAILURES \
(RPMVERIFY_LSTATFAIL|RPMVERIFY_READFAIL|RPMVERIFY_READLINKFAIL|RPMVERIFY_ LGETFILECONFAIL) (RPMVERIFY_LSTATFAIL|RPMVERIFY_READFAIL|RPMVERIFY_READLINKFAIL|RPMVERIFY_ LGETFILECONFAIL)
/** \ingroup rpmcli /** \ingroup rpmcli
* Bit(s) to control rpmQuery() operation, stored in qva_flags. * Bit(s) to control rpmQuery() operation, stored in qva_flags.
* @todo Merge rpmQueryFlags, rpmVerifyFlags, and rpmVerifyAttrs?. * @todo Merge rpmQueryFlags, rpmVerifyFlags, and rpmVerifyAttrs?.
*/ */
typedef enum rpmQueryFlags_e { typedef enum rpmQueryFlags_e {
/*@-enummemuse@*/ /*@-enummemuse@*/
QUERY_FOR_DEFAULT = 0, /*!< */ QUERY_FOR_DEFAULT = 0, /*!< */
QUERY_FDIGEST = (1 << 0), /*!< from --nofdigest */ QUERY_FDIGEST = (1 << 0), /*!< from --nofdigest */
QUERY_SIZE = (1 << 1), /*!< from --nosize */ QUERY_SIZE = (1 << 1), /*!< from --nosize */
QUERY_LINKTO = (1 << 2), /*!< from --nolink */ QUERY_LINKTO = (1 << 2), /*!< from --nolink */
QUERY_USER = (1 << 3), /*!< from --nouser) */ QUERY_USER = (1 << 3), /*!< from --nouser) */
QUERY_GROUP = (1 << 4), /*!< from --nogroup) */ QUERY_GROUP = (1 << 4), /*!< from --nogroup) */
QUERY_MTIME = (1 << 5), /*!< from --nomtime) */ QUERY_MTIME = (1 << 5), /*!< from --nomtime) */
QUERY_MODE = (1 << 6), /*!< from --nomode) */ QUERY_MODE = (1 << 6), /*!< from --nomode) */
QUERY_RDEV = (1 << 7), /*!< from --nodev */ QUERY_RDEV = (1 << 7), /*!< from --nodev */
/* bits 8-14 unused, reserved for rpmVerifyAttrs */ QUERY_CAPS = (1 << 8), /*!< (unimplemented) */
/* bits 9-13 unused, reserved for rpmVerifyAttrs */
QUERY_HMAC = (1 << 14),
QUERY_CONTEXTS = (1 << 15), /*!< verify: from --nocontexts */ QUERY_CONTEXTS = (1 << 15), /*!< verify: from --nocontexts */
QUERY_FILES = (1 << 16), /*!< verify: from --nofiles */ QUERY_FILES = (1 << 16), /*!< verify: from --nofiles */
QUERY_DEPS = (1 << 17), /*!< verify: from --nodeps */ QUERY_DEPS = (1 << 17), /*!< verify: from --nodeps */
QUERY_SCRIPT = (1 << 18), /*!< verify: from --noscripts */ QUERY_SCRIPT = (1 << 18), /*!< verify: from --noscripts */
QUERY_DIGEST = (1 << 19), /*!< verify: from --nodigest */ QUERY_DIGEST = (1 << 19), /*!< verify: from --nodigest */
QUERY_SIGNATURE = (1 << 20), /*!< verify: from --nosignature */ QUERY_SIGNATURE = (1 << 20), /*!< verify: from --nosignature */
QUERY_PATCHES = (1 << 21), /*!< verify: from --nopatches */ QUERY_PATCHES = (1 << 21), /*!< verify: from --nopatches */
QUERY_HDRCHK = (1 << 22), /*!< verify: from --nohdrchk */ QUERY_HDRCHK = (1 << 22), /*!< verify: from --nohdrchk */
/*@=enummemuse@*/ /*@=enummemuse@*/
QUERY_FOR_LIST = (1 << 23), /*!< query: from --list */ QUERY_FOR_LIST = (1 << 23), /*!< query: from --list */
skipping to change at line 221 skipping to change at line 225
VERIFY_DEFAULT = 0, /*!< */ VERIFY_DEFAULT = 0, /*!< */
/*@=enummemuse@*/ /*@=enummemuse@*/
VERIFY_FDIGEST = (1 << 0), /*!< from --nofdigest */ VERIFY_FDIGEST = (1 << 0), /*!< from --nofdigest */
VERIFY_SIZE = (1 << 1), /*!< from --nosize */ VERIFY_SIZE = (1 << 1), /*!< from --nosize */
VERIFY_LINKTO = (1 << 2), /*!< from --nolinkto */ VERIFY_LINKTO = (1 << 2), /*!< from --nolinkto */
VERIFY_USER = (1 << 3), /*!< from --nouser */ VERIFY_USER = (1 << 3), /*!< from --nouser */
VERIFY_GROUP = (1 << 4), /*!< from --nogroup */ VERIFY_GROUP = (1 << 4), /*!< from --nogroup */
VERIFY_MTIME = (1 << 5), /*!< from --nomtime */ VERIFY_MTIME = (1 << 5), /*!< from --nomtime */
VERIFY_MODE = (1 << 6), /*!< from --nomode */ VERIFY_MODE = (1 << 6), /*!< from --nomode */
VERIFY_RDEV = (1 << 7), /*!< from --nodev */ VERIFY_RDEV = (1 << 7), /*!< from --nodev */
/* bits 8-14 unused, reserved for rpmVerifyAttrs */ VERIFY_CAPS = (1 << 8), /*!< (unimplemented) */
/* bits 9-13 unused, reserved for rpmVerifyAttrs */
VERIFY_HMAC = (1 << 14),
VERIFY_CONTEXTS = (1 << 15), /*!< verify: from --nocontexts */ VERIFY_CONTEXTS = (1 << 15), /*!< verify: from --nocontexts */
VERIFY_FILES = (1 << 16), /*!< verify: from --nofiles */ VERIFY_FILES = (1 << 16), /*!< verify: from --nofiles */
VERIFY_DEPS = (1 << 17), /*!< verify: from --nodeps * / VERIFY_DEPS = (1 << 17), /*!< verify: from --nodeps * /
VERIFY_SCRIPT = (1 << 18), /*!< verify: from --noscripts */ VERIFY_SCRIPT = (1 << 18), /*!< verify: from --noscripts */
VERIFY_DIGEST = (1 << 19), /*!< verify: from --nodigest */ VERIFY_DIGEST = (1 << 19), /*!< verify: from --nodigest */
VERIFY_SIGNATURE = (1 << 20), /*!< verify: from --nosignature */ VERIFY_SIGNATURE = (1 << 20), /*!< verify: from --nosignature */
VERIFY_PATCHES = (1 << 21), /*!< verify: from --nopatches */ VERIFY_PATCHES = (1 << 21), /*!< verify: from --nopatches */
VERIFY_HDRCHK = (1 << 22), /*!< verify: from --nohdrchk */ VERIFY_HDRCHK = (1 << 22), /*!< verify: from --nohdrchk */
/*@-enummemuse@*/ /*@-enummemuse@*/
VERIFY_FOR_LIST = (1 << 23), /*!< query: from --list */ VERIFY_FOR_LIST = (1 << 23), /*!< query: from --list */
VERIFY_FOR_STATE = (1 << 24), /*!< query: from --state */ VERIFY_FOR_STATE = (1 << 24), /*!< query: from --state */
VERIFY_FOR_DOCS = (1 << 25), /*!< query: from --docfiles */ VERIFY_FOR_DOCS = (1 << 25), /*!< query: from --docfiles */
VERIFY_FOR_CONFIG = (1 << 26), /*!< query: from --configfiles */ VERIFY_FOR_CONFIG = (1 << 26), /*!< query: from --configfiles */
VERIFY_FOR_DUMPFILES= (1 << 27) /*!< query: from --dump */ VERIFY_FOR_DUMPFILES= (1 << 27) /*!< query: from --dump */
/*@=enummemuse@*/ /*@=enummemuse@*/
/* bits 28-31 used in rpmVerifyAttrs */ /* bits 28-31 used in rpmVerifyAttrs */
} rpmVerifyFlags; } rpmVerifyFlags;
#define VERIFY_ATTRS \ #define VERIFY_ATTRS \
( VERIFY_FDIGEST | VERIFY_SIZE | VERIFY_LINKTO | VERIFY_USER | VERIFY_GRO UP | \ ( VERIFY_FDIGEST | VERIFY_SIZE | VERIFY_LINKTO | VERIFY_USER | VERIFY_GRO UP | \
VERIFY_MTIME | VERIFY_MODE | VERIFY_RDEV | VERIFY_CONTEXTS ) VERIFY_MTIME | VERIFY_MODE | VERIFY_RDEV | VERIFY_HMAC | VERIFY_CONTEXT S )
#define VERIFY_ALL \ #define VERIFY_ALL \
( VERIFY_ATTRS | VERIFY_FILES | VERIFY_DEPS | VERIFY_SCRIPT | VERIFY_DIGE ST |\ ( VERIFY_ATTRS | VERIFY_FILES | VERIFY_DEPS | VERIFY_SCRIPT | VERIFY_DIGE ST |\
VERIFY_SIGNATURE | VERIFY_HDRCHK ) VERIFY_SIGNATURE | VERIFY_HDRCHK )
/** \ingroup rpmcli /** \ingroup rpmcli
*/ */
typedef struct rpmQVKArguments_s * QVA_t; typedef struct rpmQVKArguments_s * QVA_t;
/** \ingroup rpmcli /** \ingroup rpmcli
* Function to display iterator matches. * Function to display iterator matches.
skipping to change at line 695 skipping to change at line 701
rpmuint32_t *rbtidExcludes; /*!< from --rollback */ rpmuint32_t *rbtidExcludes; /*!< from --rollback */
int numrbtidExcludes; /*!< from --rollback */ int numrbtidExcludes; /*!< from --rollback */
int noDeps; int noDeps;
int incldocs; int incldocs;
int no_rollback_links; int no_rollback_links;
/*@owned@*/ /*@relnull@*/ /*@owned@*/ /*@relnull@*/
rpmRelocation relocations; rpmRelocation relocations;
int nrelocations; int nrelocations;
/* database mode arguments */ /* database mode arguments */
int init; /*!< from --initdb */
int rebuild; /*!< from --rebuilddb */ int rebuild; /*!< from --rebuilddb */
int verify; /*!< from --verifydb */
/* rollback vectors */ /* rollback vectors */
int (*rbCheck) (rpmts ts); int (*rbCheck) (rpmts ts);
int (*rbOrder) (rpmts ts); int (*rbOrder) (rpmts ts);
int (*rbRun) (rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet); int (*rbRun) (rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet);
}; };
#endif #endif
/** \ingroup rpmcli /** \ingroup rpmcli
*/ */
skipping to change at line 735 skipping to change at line 739
/** \ingroup rpmcli /** \ingroup rpmcli
* Describe build command line request. * Describe build command line request.
*/ */
struct rpmBuildArguments_s { struct rpmBuildArguments_s {
rpmQueryFlags qva_flags; /*!< Bit(s) to control verification. */ rpmQueryFlags qva_flags; /*!< Bit(s) to control verification. */
int buildAmount; /*!< Bit(s) to control operation. */ int buildAmount; /*!< Bit(s) to control operation. */
/*@observer@*/ /*@observer@*/
const char * passPhrase; /*!< Pass phrase. */ const char * passPhrase; /*!< Pass phrase. */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
const char * cookie; /*!< NULL for binary, ??? for source, rpm's */ const char * cookie; /*!< NULL for binary, ??? for source, rpm's */
const char * specFile; /*!< from --rebuild/--recompile build */
int noBuild; /*!< from --nobuild */ int noBuild; /*!< from --nobuild */
int noDeps; /*!< from --nodeps */ int noDeps; /*!< from --nodeps */
int noLang; /*!< from --nolang */ int noLang; /*!< from --nolang */
int shortCircuit; /*!< from --short-circuit */ int shortCircuit; /*!< from --short-circuit */
int sign; /*!< from --sign */ int sign; /*!< from --sign */
int nopassword; int nopassword;
int useCatalog; /*!< from --usecatalog */
char buildMode; /*!< Build mode (one of "btBC") */ char buildMode; /*!< Build mode (one of "btBC") */
char buildChar; /*!< Build stage (one of "abcilps ") */ char buildChar; /*!< Build stage (one of "abcilps ") */
/*@observer@*/ /*@null@*/ /*@observer@*/ /*@null@*/
const char * rootdir; const char * rootdir;
}; };
/** \ingroup rpmcli /** \ingroup rpmcli
*/ */
typedef struct rpmBuildArguments_s * BTA_t; typedef struct rpmBuildArguments_s * BTA_t;
 End of changes. 10 change blocks. 
8 lines changed or deleted 13 lines changed or added


 rpmdb.h   rpmdb.h 
#ifndef H_RPMDB #ifndef H_RPMDB
#define H_RPMDB #define H_RPMDB
/*@-bounds@*/ /*@-bounds@*/
/** \ingroup rpmdb dbi db1 db3 /** \ingroup rpmdb dbi db1 db3
* \file rpmdb/rpmdb.h * \file rpmdb/rpmdb.h
* Access RPM indices using Berkeley DB interface(s). * Access RPM indices using Berkeley DB interface(s).
*/ */
#include <assert.h> #include <assert.h>
#include <rpmtypes.h>
#include <mire.h> #include <mire.h>
#include <rpmtypes.h>
#include <rpmtag.h> /* XXX Header typedef */
#if defined(_RPMDB_INTERNAL) #if defined(_RPMDB_INTERNAL)
#if defined(WITH_DB) #if defined(WITH_DB)
#include "db.h" #include "db.h"
#else #else
#include "db_emu.h" #include "db_emu.h"
#endif #endif
#endif #endif
#if defined(_RPMDB_INTERNAL) #if defined(_RPMDB_INTERNAL)
#define DBT_INIT /*@-fullinitblock@*/ {0} /*@-fullinitblock@*/ /* - Wno-missing-field-initializers */ #define DBT_INIT /*@-fullinitblock@*/ {0} /*@-fullinitblock@*/ /* - Wno-missing-field-initializers */
#endif #endif
/*@-exportlocal@*/ /*@-exportlocal@*/
/*@unchecked@*/ /*@unchecked@*/
extern int _rpmdb_debug; extern int _rpmdb_debug;
/*@unchecked@*/
extern int _rpmmi_debug;
/*@=exportlocal@*/ /*@=exportlocal@*/
#ifdef NOTYET #ifdef NOTYET
/** \ingroup rpmdb /** \ingroup rpmdb
* Database of headers and tag value indices. * Database of headers and tag value indices.
*/ */
typedef /*@abstract@*/ /*@refcounted@*/ struct rpmdb_s * rpmdb; typedef /*@abstract@*/ /*@refcounted@*/ struct rpmdb_s * rpmdb;
/** \ingroup rpmdb /** \ingroup rpmdb
* Database iterator. * Database iterator.
*/ */
typedef /*@abstract@*/ struct rpmmi_s * rpmmi; typedef /*@abstract@*/ /*@refcounted@*/ struct rpmmi_s * rpmmi;
#endif #endif
/** /**
*/ */
typedef /*@abstract@*/ struct _dbiIndexItem * dbiIndexItem; typedef /*@abstract@*/ struct _dbiIndexItem * dbiIndexItem;
/** \ingroup rpmdb /** \ingroup rpmdb
* A single element (i.e. inverted list from tag values) of a database. * A single element (i.e. inverted list from tag values) of a database.
*/ */
typedef /*@abstract@*/ struct _dbiIndexSet * dbiIndexSet; typedef /*@abstract@*/ struct _dbiIndexSet * dbiIndexSet;
/** /**
*/ */
typedef /*@abstract@*/ struct _dbiIndex * dbiIndex; typedef /*@abstract@*/ struct _dbiIndex * dbiIndex;
#if defined(_RPMDB_INTERNAL) #if defined(_RPMDB_INTERNAL)
#include <rpmio.h> #include <rpmio.h>
#include <rpmbf.h>
#include <rpmsw.h> #include <rpmsw.h>
#if !defined(SWIG) /* XXX inline dbiFoo() need */ #if !defined(SWIG) /* XXX inline dbiFoo() need */
/** \ingroup dbi /** \ingroup dbi
* A single item from an index database (i.e. the "data returned"). * A single item from an index database (i.e. the "data returned").
*/ */
struct _dbiIndexItem { struct _dbiIndexItem {
rpmuint32_t hdrNum; /*!< header instance in db * uint32_t hdrNum; /*!< header instance in db */
/ uint32_t tagNum; /*!< tag index in header */
rpmuint32_t tagNum; /*!< tag index in header */
rpmuint32_t fpNum; /*!< finger print index */
}; };
/** \ingroup dbi /** \ingroup dbi
* Items retrieved from the index database. * Items retrieved from the index database.
*/ */
struct _dbiIndexSet { struct _dbiIndexSet {
/*@owned@*/ struct _dbiIndexItem * recs; /*!< array of records */ /*@owned@*/
int count; /*!< number of records */ struct _dbiIndexItem * recs; /*!< array of records */
unsigned int count; /*!< number of records */
}; };
/** \ingroup dbi /** \ingroup dbi
* Private methods for accessing an index database. * Private methods for accessing an index database.
*/ */
struct _dbiVec { struct _dbiVec {
int dbv_major; /*!< Berkeley db version major */ const char * dbv_version; /*!< DB version string */
int dbv_minor; /*!< Berkeley db version minor */ int dbv_major; /*!< DB version major */
int dbv_patch; /*!< Berkeley db version patch */ int dbv_minor; /*!< DB version minor */
int dbv_patch; /*!< DB version patch */
/** \ingroup dbi /** \ingroup dbi
* Return handle for an index database. * Return handle for an index database.
* @param rpmdb rpm database * @param rpmdb rpm database
* @param tag rpm tag * @param tag rpm tag
* @return 0 on success * @return 0 on success
*/ */
int (*open) (rpmdb rpmdb, rpmTag tag, /*@out@*/ dbiIndex * dbip) int (*open) (rpmdb rpmdb, rpmTag tag, /*@out@*/ dbiIndex * dbip)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies *dbip, fileSystem @*/; /*@modifies *dbip, fileSystem @*/;
skipping to change at line 130 skipping to change at line 137
* @param flags DB_CREATE or 0 * @param flags DB_CREATE or 0
* @return 0 on success * @return 0 on success
*/ */
int (*associate) (dbiIndex dbi, dbiIndex dbisecondary, int (*associate) (dbiIndex dbi, dbiIndex dbisecondary,
int (*callback) (DB *, const DBT *, const DBT *, DBT *), int (*callback) (DB *, const DBT *, const DBT *, DBT *),
unsigned int flags) unsigned int flags)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies dbi, fileSystem @*/; /*@modifies dbi, fileSystem @*/;
/** \ingroup dbi /** \ingroup dbi
* Associate foreign 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
*/
int (*associate_foreign) (dbiIndex dbi, dbiIndex dbisecondary,
int (*callback) (DB *, const DBT *, DBT *, const DBT *, int
*),
unsigned int flags)
/*@globals fileSystem @*/
/*@modifies dbi, fileSystem @*/;
/** \ingroup dbi
* Return join cursor for list of cursors. * Return join cursor for list of cursors.
* @param dbi index database handle * @param dbi index database handle
* @param curslist NULL terminated list of database cursors * @param curslist NULL terminated list of database cursors
* @retval dbcp address of join database cursor * @retval dbcp address of join database cursor
* @param flags DB_JOIN_NOSORT or 0 * @param flags DB_JOIN_NOSORT or 0
* @return 0 on success * @return 0 on success
*/ */
int (*join) (dbiIndex dbi, DBC ** curslist, /*@out@*/ DBC ** dbcp, int (*join) (dbiIndex dbi, DBC ** curslist, /*@out@*/ DBC ** dbcp,
unsigned int flags) unsigned int flags)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies dbi, *dbcp, fileSystem @*/; /*@modifies dbi, *dbcp, fileSystem @*/;
/** \ingroup dbi /** \ingroup dbi
* Return whether key exists in a database.
* @param dbi index database handle
* @param key retrieve key value/length/flags
* @param flags usually 0
* @return 0 if key exists, DB_NOTFOUND if not, else error
*/
int (*exists) (dbiIndex dbi, DBT * key, unsigned int flags)
/*@globals fileSystem @*/
/*@modifies dbi, fileSystem @*/;
/** \ingroup dbi
* Return next sequence number.
* @param dbi index database handle (with attached sequence)
* @retval *seqnop IN: delta (0 does seqno++) OUT: returned 64bit seqno
* @param flags usually 0
* @return 0 on success
*/
int (*seqno) (dbiIndex dbi, /*@null@*/ int64_t * seqnop, unsigned int f
lags)
/*@globals fileSystem @*/
/*@modifies dbi, *seqnop, fileSystem @*/;
/** \ingroup dbi
* Open database cursor. * Open database cursor.
* @param dbi index database handle * @param dbi index database handle
* @param txnid database transaction handle * @param txnid database transaction handle
* @retval dbcp address of new database cursor * @retval dbcp address of new database cursor
* @param dbiflags DB_WRITECURSOR or 0 * @param dbiflags DB_WRITECURSOR or 0
* @return 0 on success * @return 0 on success
*/ */
int (*copen) (dbiIndex dbi, /*@null@*/ DB_TXN * txnid, int (*copen) (dbiIndex dbi, /*@null@*/ DB_TXN * txnid,
/*@out@*/ DBC ** dbcp, unsigned int dbiflags) /*@out@*/ DBC ** dbcp, unsigned int dbiflags)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
skipping to change at line 274 skipping to change at line 317
*/ */
int (*stat) (dbiIndex dbi, unsigned int flags) int (*stat) (dbiIndex dbi, unsigned int flags)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies dbi, fileSystem @*/; /*@modifies dbi, fileSystem @*/;
}; };
/** \ingroup dbi /** \ingroup dbi
* Describes an index database (implemented on Berkeley db3 functionality). * Describes an index database (implemented on Berkeley db3 functionality).
*/ */
struct _dbiIndex { struct _dbiIndex {
struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */
/*@relnull@*/ /*@relnull@*/
const char * dbi_root; /*!< chroot(2) component of path */ const char * dbi_root; /*!< chroot(2) component of path */
/*@null@*/ /*@null@*/
const char * dbi_home; /*!< directory component of path */ const char * dbi_home; /*!< directory component of path */
/*@relnull@*/ /*@relnull@*/
const char * dbi_file; /*!< file component of path */ const char * dbi_file; /*!< file component of path */
/*@relnull@*/ /*@relnull@*/
const char * dbi_subfile; const char * dbi_subfile;
/*@null@*/ /*@null@*/
const char * dbi_tmpdir; /*!< temporary directory */ const char * dbi_tmpdir; /*!< temporary directory */
int dbi_ecflags; /*!< db_env_create flags */ int dbi_ecflags; /*!< db_env_create flags */
int dbi_cflags; /*!< db_create flags */ int dbi_cflags; /*!< db_create flags */
int dbi_oeflags; /*!< common (db,dbenv)->open flags * / int dbi_oeflags; /*!< common (db,dbenv)->open flags * /
int dbi_eflags; /*!< dbenv->open flags */ int dbi_eflags; /*!< dbenv->open flags */
int dbi_oflags; /*!< db->open flags */ int dbi_oflags; /*!< db->open flags */
int dbi_tflags; /*!< dbenv->txn_begin flags */ int dbi_tflags; /*!< dbenv->txn_begin flags */
int dbi_type; /*!< db index type */ int dbi_type; /*!< db index type */
unsigned dbi_mode; /*!< mode to use on open */ unsigned dbi_mode; /*!< mode to use on open */
int dbi_perms; /*!< file permission to use on open */ int dbi_perms; /*!< file permission used when creat ing */
long dbi_shmkey; /*!< shared memory base key */ long dbi_shmkey; /*!< shared memory base key */
int dbi_api; /*!< Berkeley API type */ int dbi_api; /*!< Berkeley API type */
int dbi_verify_on_close;
int dbi_use_dbenv; /*!< use db environment? */ 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_fsync; /*!< no-op fsync for db */
int dbi_no_dbsync; /*!< don't call dbiSync */ int dbi_no_dbsync; /*!< don't call dbiSync */
int dbi_lockdbfd; /*!< do fcntl lock on db fd */ int dbi_lockdbfd; /*!< do fcntl lock on db fd */
int dbi_temporary; /*!< non-persistent index/table */ int dbi_temporary; /*!< non-persistent index/table */
int dbi_noload; /*!< standalone index/table */
int dbi_debug; int dbi_debug;
int dbi_byteswapped;
rpmbf dbi_bf;
/*@null@*/ /*@null@*/
char * dbi_host; char * dbi_host;
unsigned long dbi_cl_timeout; unsigned long dbi_cl_timeout;
unsigned long dbi_sv_timeout; unsigned long dbi_sv_timeout;
/* dbenv parameters */ /* dbenv parameters */
int dbi_lorder; int dbi_lorder;
/*@unused@*/ /*@unused@*/
/* XXX db-4.3.14 adds dbenv as 1st arg. */ /* XXX db-4.3.14 adds dbenv as 1st arg. */
void (*db_errcall) (void * dbenv, const char *db_errpfx, char *buffer) void (*db_errcall) (void * dbenv, const char *db_errpfx, char *buffer)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies fileSystem @*/; /*@modifies fileSystem @*/;
/*@unused@*/ /*@shared@*/ /*@unused@*/ /*@shared@*/
FILE * dbi_errfile; FILE * dbi_errfile;
const char * dbi_errpfx; const char * dbi_errpfx;
int dbi_verbose;
int dbi_region_init; int dbi_region_init;
unsigned int dbi_thread_count; unsigned int dbi_thread_count;
/* locking sub-system parameters */ /* locking sub-system parameters */
unsigned int dbi_lk_max_lockers;
unsigned int dbi_lk_max_locks;
unsigned int dbi_lk_max_objects;
unsigned int dbi_lk_detect;
/*@unused@*/
int dbi_lk_nmodes;
/*@unused@*/
unsigned char * dbi_lk_conflicts;
/* logging sub-system parameters */ /* logging sub-system parameters */
unsigned int dbi_lg_bsize;
/*@unused@*/
const char * dbi_lg_dir;
/*@unused@*/
unsigned int dbi_lg_filemode;
unsigned int dbi_lg_max;
unsigned int dbi_lg_regionmax;
/* mpool sub-system parameters */ /* mpool sub-system parameters */
int dbi_mmapsize; /*!< (10Mb) */
int dbi_cachesize; /*!< (128Kb) */
/* mutex sub-system parameters */ /* mutex sub-system parameters */
unsigned int dbi_mutex_align;
unsigned int dbi_mutex_increment;
unsigned int dbi_mutex_max;
unsigned int dbi_mutex_tas_spins;
/* replication sub-system parameters */ /* replication sub-system parameters */
/* sequences sub-system parameters */ /* sequences sub-system parameters */
const char * dbi_seq_id;
unsigned int dbi_seq_cachesize; unsigned int dbi_seq_cachesize;
unsigned int dbi_seq_flags; unsigned int dbi_seq_flags;
#if 0 /* needs signed 64 bit type */ int64_t dbi_seq_initial;
int64_t dbi_seq_min; int64_t dbi_seq_min;
int64_t dbi_seq_max; int64_t dbi_seq_max;
#endif
/* transaction sub-system parameters */ /* transaction sub-system parameters */
unsigned int dbi_tx_max;
#if 0 #if 0
int (*dbi_tx_recover) (DB_ENV *dbenv, DBT *log_rec, int (*dbi_tx_recover) (DB_ENV *dbenv, DBT *log_rec,
DB_LSN *lsnp, int redo, void *info) DB_LSN *lsnp, int redo, void *info)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies fileSystem @*/; /*@modifies fileSystem @*/;
#endif #endif
/* dbinfo parameters */ /* dbinfo parameters */
int dbi_pagesize; /*!< (fs blksize) */ int dbi_pagesize; /*!< (fs blksize) */
/*@unused@*/ /*@null@*/ /*@unused@*/ /*@null@*/
void * (*dbi_malloc) (size_t nbytes) void * (*dbi_malloc) (size_t nbytes)
skipping to change at line 400 skipping to change at line 422
/*@*/; /*@*/;
/* recno access parameters */ /* recno access parameters */
int dbi_re_flags; int dbi_re_flags;
int dbi_re_delim; int dbi_re_delim;
unsigned int dbi_re_len; unsigned int dbi_re_len;
int dbi_re_pad; int dbi_re_pad;
const char * dbi_re_source; const char * dbi_re_source;
/* queue access parameters */ /* queue access parameters */
unsigned int dbi_q_extentsize; unsigned int dbi_q_extentsize;
/*@null@*/
const char * dbi_primary; /*!< Primary table for secondary index. */
/*@null@*/
const char * dbi_foreign;
/*@refcounted@*/ /*@refcounted@*/
rpmdb dbi_rpmdb; /*!< the parent rpm database */ rpmdb dbi_rpmdb; /*!< the parent rpm database */
rpmTag dbi_rpmtag; /*!< rpm tag used for index */ rpmTag dbi_rpmtag; /*!< rpm tag used for index */
size_t dbi_jlen; /*!< size of join key */ size_t dbi_jlen; /*!< size of join key */
/*@only@*//*@relnull@*/ /*@only@*/ /*@relnull@*/
DB * dbi_db; /*!< Berkeley DB * handle */ DB_SEQUENCE * dbi_seq; /*!< Berkeley DB_SEQUENCE handle */
/*@only@*//*@null@*/ /*@only@*/ /*@relnull@*/
DB_TXN * dbi_txnid; /*!< Bekerley DB_TXN * transaction i DB * dbi_db; /*!< Berkeley DB handle */
d */ /*@only@*/ /*@null@*/
/*@only@*//*@null@*/ DB_TXN * dbi_txnid; /*!< Berkeley DB_TXN handle */
/*@only@*/ /*@null@*/
void * dbi_stats; /*!< Berkeley DB statistics */ void * dbi_stats; /*!< Berkeley DB statistics */
/*@observer@*/ /*@observer@*/
const struct _dbiVec * dbi_vec; /*!< private methods */ const struct _dbiVec * dbi_vec; /*!< private methods */
}; };
#endif /* !defined(SWIG) */ #endif /* !defined(SWIG) */
/** \ingroup rpmdb /** \ingroup rpmdb
* Describes the collection of index databases used by rpm. * Describes the collection of index databases used by rpm.
*/ */
struct rpmdb_s { struct rpmdb_s {
struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */ struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */
/*@owned@*/ /*@relnull@*/ /*@owned@*/ /*@relnull@*/
const char * db_root; /*!< rpmdb path prefix */ const char * db_root; /*!< rpmdb path prefix */
/*@owned@*/ /*@owned@*/
const char * db_home; /*!< rpmdb directory path */ const char * db_home; /*!< rpmdb directory path */
int db_flags; int db_flags;
int db_mode; /*!< rpmdb pen mode */ int db_mode; /*!< rpmdb open mode */
int db_perms; /*!< rpmdb open permissions */ int db_perms; /*!< rpmdb open permissions */
int db_api; /*!< Berkeley API type */ int db_api; /*!< Berkeley API type */
/*@owned@*/ /*@owned@*/
const char * db_errpfx; /*!< Berkeley DB error msg prefix. */ const char * db_errpfx; /*!< Berkeley DB error msg prefix. */
int db_remove_env; /*!< Discard dbenv on close? */ int db_remove_env; /*!< Discard dbenv on close? */
int db_filter_dups; /*!< Skip duplicate headers with --r uint32_t db_maxkey; /*!< Max. primary key. */
ebuilddb? */
int db_verifying;
int db_chrootDone; /*!< If chroot(2) done, ignore db_ro ot. */ int db_chrootDone; /*!< If chroot(2) done, ignore db_ro ot. */
void (*db_errcall) (const char * db_errpfx, char * buffer) void (*db_errcall) (const char * db_errpfx, char * buffer)
/*@*/; /*@*/;
/*@shared@*/ /*@shared@*/
FILE * db_errfile; /*!< Berkeley DB stderr clone. */ FILE * db_errfile; /*!< Berkeley DB stderr clone. */
/*@only@*/ /*@only@*/
void * (*db_malloc) (size_t nbytes) void * (*db_malloc) (size_t nbytes)
/*@*/; /*@*/;
/*@only@*/ /*@only@*/
void * (*db_realloc) (/*@only@*//*@null@*/ void * ptr, size_t nbytes) void * (*db_realloc) (/*@only@*//*@null@*/ void * ptr, size_t nbytes)
/*@*/; /*@*/;
void (*db_free) (/*@only@*/ void * ptr) void (*db_free) (/*@only@*/ void * ptr)
/*@modifies *ptr @*/; /*@modifies *ptr @*/;
int (*db_export) (rpmdb db, Header h, int adding); int (*db_export) (rpmdb db, Header h, int adding);
/*@only@*/ /*@null@*/ /*@refcounted@*/
unsigned char * db_bits; /*!< Header instance bit mask. */ Header db_h; /*!< Currently active header */
int db_nbits; /*!< No. of bits in mask. */
rpmdb db_next; /*!< Chain of rpmdbOpen'ed rpmdb's. */ rpmdb db_next; /*!< Chain of rpmdbOpen'ed rpmdb's. */
int db_opens; /*!< No. of opens for this rpmdb. */ int db_opens; /*!< No. of opens for this rpmdb. */
/*@only@*/ /*@null@*/
void * db_dbenv; /*!< Berkeley DB_ENV handle. */ void * db_dbenv; /*!< Berkeley DB_ENV handle. */
void * db_txn; /*!< Berkeley DB_TXN handle */
DB_LOGC * db_logc; /*!< Berkeley DB_LOGC handle */
DB_MPOOLFILE *db_mpf; /*!< Berkeley DB_MPOOLFILE handle */
tagStore_t db_tags; /*!< Tag name/value mappings. */ tagStore_t db_tags; /*!< Tag name/value mappings. */
size_t db_ndbi; /*!< No. of tag indices. */ size_t db_ndbi; /*!< No. of tag indices. */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
dbiIndex * _dbi; /*!< Tag indices. */ dbiIndex * _dbi; /*!< Tag indices. */
struct rpmop_s db_getops; /*!< dbiGet statistics. */ struct rpmop_s db_getops; /*!< dbiGet statistics. */
struct rpmop_s db_putops; /*!< dbiPut statistics. */ struct rpmop_s db_putops; /*!< dbiPut statistics. */
struct rpmop_s db_delops; /*!< dbiDel statistics. */ struct rpmop_s db_delops; /*!< dbiDel statistics. */
#if defined(__LCLINT__) #if defined(__LCLINT__)
/*@refs@*/ /*@refs@*/
int nrefs; /*!< (unused) keep splint happy */ int nrefs; /*!< (unused) keep splint happy */
#endif #endif
}; };
#endif /* defined(_RPMDB_INTERNAL) */ #endif /* defined(_RPMDB_INTERNAL) */
/* for RPM's internal use only */
/** \ingroup rpmdb
*/
enum rpmdbFlags {
RPMDB_FLAG_JUSTCHECK = (1 << 0),
RPMDB_FLAG_MINIMAL = (1 << 1),
/*@-enummemuse@*/
RPMDB_FLAG_CHROOT = (1 << 2)
/*@=enummemuse@*/
};
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#if defined(_RPMDB_INTERNAL) #if defined(_RPMDB_INTERNAL)
/*@-exportlocal@*/ /*@-exportlocal@*/
#if defined(WITH_DB) || defined(WITH_SQLITE) #if defined(WITH_DB) || defined(WITH_SQLITE)
/** \ingroup db3 /** \ingroup db3
* Return new configured index database handle instance. * Return new configured index database handle instance.
* @param rpmdb rpm database * @param rpmdb rpm database
skipping to change at line 513 skipping to change at line 533
dbiIndex db3New(rpmdb rpmdb, rpmTag tag) dbiIndex db3New(rpmdb rpmdb, rpmTag tag)
/*@globals rpmGlobalMacroContext, h_errno, internalState @*/ /*@globals rpmGlobalMacroContext, h_errno, internalState @*/
/*@modifies rpmGlobalMacroContext, internalState @*/; /*@modifies rpmGlobalMacroContext, internalState @*/;
/** \ingroup db3 /** \ingroup db3
* Destroy index database handle instance. * Destroy index database handle instance.
* @param dbi index database handle * @param dbi index database handle
* @return NULL always * @return NULL always
*/ */
/*@null@*/ /*@null@*/
dbiIndex db3Free( /*@only@*/ /*@null@*/ dbiIndex dbi) dbiIndex db3Free(/*@only@*/ /*@null@*/ dbiIndex dbi)
/*@*/; /*@globals fileSystem, internalState @*/
/*@modifies dbi, fileSystem, internalState @*/;
#define db3Free(_dbi) \
((dbiIndex)rpmioFreePoolItem((rpmioItem)(_dbi), __FUNCTION__, __FILE__,
__LINE__))
/** \ingroup db3 /** \ingroup db3
* Format db3 open flags for debugging print. * Format db3 open flags for debugging print.
* @param dbflags db open flags * @param dbflags db open flags
* @param print_dbenv_flags format db env flags instead? * @param print_dbenv_flags format db env flags instead?
* @return formatted flags (static buffer) * @return formatted flags (static buffer)
*/ */
/*@-redecl@*/ /*@-redecl@*/
/*@exposed@*/ /*@exposed@*/
extern const char * prDbiOpenFlags(int dbflags, int print_dbenv_flags) extern const char * prDbiOpenFlags(int dbflags, int print_dbenv_flags)
skipping to change at line 641 skipping to change at line 664
* @return 0 on success * @return 0 on success
*/ */
/*@unused@*/ static inline /*@unused@*/ static inline
int dbiGet(dbiIndex dbi, /*@null@*/ DBC * dbcursor, DBT * key, DBT * data, int dbiGet(dbiIndex dbi, /*@null@*/ DBC * dbcursor, DBT * key, DBT * data,
unsigned int flags) unsigned int flags)
/*@globals fileSystem, internalState @*/ /*@globals fileSystem, internalState @*/
/*@modifies dbi, *dbcursor, *key, *data, fileSystem, internalState @ */ /*@modifies dbi, *dbcursor, *key, *data, fileSystem, internalState @ */
{ {
rpmop sw = (rpmop)dbiStatsAccumulator(dbi, 14); /* RPMTS_OP_DBGET */ rpmop sw = (rpmop)dbiStatsAccumulator(dbi, 14); /* RPMTS_OP_DBGET */
int rc; int rc;
assert((flags == DB_NEXT) || (key->data != NULL && key->size > 0));
(void) rpmswEnter(sw, 0); (void) rpmswEnter(sw, 0);
rc = (dbi->dbi_vec->cget) (dbi, dbcursor, key, data, flags); rc = (dbi->dbi_vec->cget) (dbi, dbcursor, key, data, flags);
(void) rpmswExit(sw, data->size); (void) rpmswExit(sw, data->size);
return rc; return rc;
} }
/** \ingroup dbi /** \ingroup dbi
* Retrieve (key,data) pair using dbcursor->c_pget. * Retrieve (key,data) pair using dbcursor->c_pget.
* @param dbi index database handle * @param dbi index database handle
* @param dbcursor database cursor (NULL will use db->get) * @param dbcursor database cursor (NULL will use db->get)
skipping to change at line 666 skipping to change at line 688
* @return 0 on success * @return 0 on success
*/ */
/*@unused@*/ static inline /*@unused@*/ static inline
int dbiPget(dbiIndex dbi, /*@null@*/ DBC * dbcursor, int dbiPget(dbiIndex dbi, /*@null@*/ DBC * dbcursor,
DBT * key, DBT * pkey, DBT * data, unsigned int flags) DBT * key, DBT * pkey, DBT * data, unsigned int flags)
/*@globals fileSystem, internalState @*/ /*@globals fileSystem, internalState @*/
/*@modifies dbi, *dbcursor, *key, *pkey, *data, fileSystem, internal State @*/ /*@modifies dbi, *dbcursor, *key, *pkey, *data, fileSystem, internal State @*/
{ {
rpmop sw = (rpmop)dbiStatsAccumulator(dbi, 14); /* RPMTS_OP_DBGET */ rpmop sw = (rpmop)dbiStatsAccumulator(dbi, 14); /* RPMTS_OP_DBGET */
int rc; int rc;
assert((flags == DB_NEXT) || (key->data != NULL && key->size > 0));
(void) rpmswEnter(sw, 0); (void) rpmswEnter(sw, 0);
rc = (dbi->dbi_vec->cpget) (dbi, dbcursor, key, pkey, data, flags); rc = (dbi->dbi_vec->cpget) (dbi, dbcursor, key, pkey, data, flags);
(void) rpmswExit(sw, data->size); (void) rpmswExit(sw, data->size);
return rc; return rc;
} }
/** \ingroup dbi /** \ingroup dbi
* Store (key,data) pair in index database. * Store (key,data) pair in index database.
* @param dbi index database handle * @param dbi index database handle
* @param dbcursor database cursor (NULL will use db->put) * @param dbcursor database cursor (NULL will use db->put)
skipping to change at line 715 skipping to change at line 736
/*@unused@*/ static inline /*@unused@*/ static inline
int dbiCount(dbiIndex dbi, DBC * dbcursor, /*@out@*/ unsigned int * countp, int dbiCount(dbiIndex dbi, DBC * dbcursor, /*@out@*/ unsigned int * countp,
unsigned int flags) unsigned int flags)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies *dbcursor, fileSystem @*/ /*@modifies *dbcursor, fileSystem @*/
{ {
return (*dbi->dbi_vec->ccount) (dbi, dbcursor, countp, flags); return (*dbi->dbi_vec->ccount) (dbi, dbcursor, countp, flags);
} }
/** \ingroup dbi /** \ingroup dbi
* Verify (and close) index database. * Close index database.
* @param dbi index database handle * @param dbi index database handle
* @param flags (unused) * @param flags (unused)
* @return 0 on success * @return 0 on success
*/ */
/*@unused@*/ static inline /*@unused@*/ static inline
int dbiVerify(/*@only@*/ dbiIndex dbi, unsigned int flags) int dbiClose(/*@only@*/ dbiIndex dbi, unsigned int flags)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies dbi, fileSystem @*/ /*@modifies dbi, fileSystem @*/
{ {
dbi->dbi_verify_on_close = 1;
return (*dbi->dbi_vec->close) (dbi, flags); return (*dbi->dbi_vec->close) (dbi, flags);
} }
/** \ingroup dbi /** \ingroup dbi
* Close index database. * Flush pending operations to disk.
* @param dbi index database handle * @param dbi index database handle
* @param flags (unused) * @param flags (unused)
* @return 0 on success * @return 0 on success
*/ */
/*@unused@*/ static inline /*@unused@*/ static inline
int dbiClose(/*@only@*/ dbiIndex dbi, unsigned int flags) int dbiSync (dbiIndex dbi, unsigned int flags)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies dbi, fileSystem @*/ /*@modifies fileSystem @*/
{ {
return (*dbi->dbi_vec->close) (dbi, flags); return (*dbi->dbi_vec->sync) (dbi, flags);
} }
/** \ingroup dbi /** \ingroup dbi
* Flush pending operations to disk. * Return whether key exists in a database.
* @param dbi index database handle * @param dbi index database handle
* @param flags (unused) * @param key retrieve key value/length/flags
* @param flags usually 0
* @return 0 if key exists, DB_NOTFOUND if not, else error
*/
/*@unused@*/ static inline
int dbiExists(dbiIndex dbi, /*@out@*/ DBT * key, unsigned int flags)
/*@globals fileSystem @*/
/*@modifies dbi, fileSystem @*/
{
return (*dbi->dbi_vec->exists) (dbi, key, flags);
}
/** \ingroup dbi
* Return next sequence number.
* @param dbi index database handle (with attached sequence)
* @retval *seqnop IN: delta (0 does seqno++) OUT: returned 64bit seqno
* @param flags usually 0
* @return 0 on success * @return 0 on success
*/ */
/*@unused@*/ static inline /*@unused@*/ static inline
int dbiSync (dbiIndex dbi, unsigned int flags) int dbiSeqno(dbiIndex dbi, /*@null@*/ int64_t * seqnop, unsigned int flags)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies fileSystem @*/ /*@modifies dbi, *seqnop, fileSystem @*/
{ {
return (*dbi->dbi_vec->sync) (dbi, flags); return (*dbi->dbi_vec->seqno) (dbi, seqnop, flags);
} }
/** \ingroup dbi /** \ingroup dbi
* Associate secondary database with primary. * Associate secondary database with primary.
* @param dbi index database handle * @param dbi index database handle
* @param dbisecondary secondary index database handle * @param dbisecondary secondary index database handle
* @param callback create secondary key from primary (NULL if DB_RDONLY ) * @param callback create secondary key from primary (NULL if DB_RDONLY )
* @param flags DB_CREATE or 0 * @param flags DB_CREATE or 0
* @return 0 on success * @return 0 on success
*/ */
skipping to change at line 801 skipping to change at line 837
/** \ingroup dbi /** \ingroup dbi
* Is database byte swapped? * Is database byte swapped?
* @param dbi index database handle * @param dbi index database handle
* @return 0 same order, 1 swapped order * @return 0 same order, 1 swapped order
*/ */
/*@unused@*/ static inline /*@unused@*/ static inline
int dbiByteSwapped(dbiIndex dbi) int dbiByteSwapped(dbiIndex dbi)
/*@modifies dbi @*/ /*@modifies dbi @*/
{ {
if (dbi->dbi_byteswapped == -1) return (*dbi->dbi_vec->byteswapped) (dbi);
dbi->dbi_byteswapped = (*dbi->dbi_vec->byteswapped) (dbi);
return dbi->dbi_byteswapped;
} }
/** \ingroup dbi /** \ingroup dbi
* Return dbi statistics. * Return dbi statistics.
* @param dbi index database handle * @param dbi index database handle
* @param flags DB_FAST_STAT or 0 * @param flags DB_FAST_STAT or 0
* @return 0 on success * @return 0 on success
*/ */
/*@unused@*/ static inline /*@unused@*/ static inline
int dbiStat(dbiIndex dbi, unsigned int flags) int dbiStat(dbiIndex dbi, unsigned int flags)
/*@modifies dbi @*/ /*@modifies dbi @*/
{ {
return (*dbi->dbi_vec->stat) (dbi, flags); return (*dbi->dbi_vec->stat) (dbi, flags);
} }
/** \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 /*@observer@*/ /*@null@*/ /*@unused@*/ static inline /*@null@*/
DB_TXN * dbiTxnid(dbiIndex dbi) DB_TXN * dbiTxnid(dbiIndex dbi)
/*@*/ /*@*/
{ {
return dbi->dbi_txnid; rpmdb rpmdb = (dbi ? dbi->dbi_rpmdb : NULL);
DB_TXN * _txn = (rpmdb ? rpmdb->db_txn : NULL);
return _txn;
}
#if defined(_RPMDB_INTERNAL)
#include <rpmlio.h> /* XXX add to psm.c/fsm.c */
#if !defined(__LCLINT__)
/*@unused@*/ static inline
int rpmlkId(rpmdb rpmdb, uint32_t *_idp)
{
DB_ENV * dbenv = rpmdb->db_dbenv;
int rc = (rpmdb->_dbi[0]->dbi_eflags & 0x080)
? dbenv->lock_id(dbenv, _idp) : ENOTSUP;
if (_rpmdb_debug)
fprintf(stderr, "<-- %s(%p,%p) id 0x%x rc %d\n", "dbenv->lock_id", dbenv, _
idp, *_idp, rc);
return rc;
}
/*@unused@*/ static inline
int rpmlkIdFree(rpmdb rpmdb, uint32_t _id)
{
DB_ENV * dbenv = rpmdb->db_dbenv;
int rc = (rpmdb->_dbi[0]->dbi_eflags & 0x080)
? dbenv->lock_id_free(dbenv, _id) : ENOTSUP;
if (_rpmdb_debug)
fprintf(stderr, "<-- %s(%p,%u) rc %d\n", "dbenv->lock_id_free", dbenv, (uns
igned)_id, rc);
return rc;
}
/*@unused@*/ static inline
int rpmlkGet(rpmdb rpmdb, DBT * _object, uint32_t _lockmode, void * _lock)
{
DB_ENV * dbenv = rpmdb->db_dbenv;
uint32_t _locker = 0x12344321;
uint32_t _flags = 0;
int rc = (rpmdb->_dbi[0]->dbi_eflags & 0x080)
? dbenv->lock_get(dbenv, _locker, _flags, _object, _lockmode, _lock)
: ENOTSUP;
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);
return rc;
}
/*@unused@*/ static inline
int rpmlkPut(rpmdb rpmdb, void * _lock)
{
DB_ENV * dbenv = rpmdb->db_dbenv;
int rc = (rpmdb->_dbi[0]->dbi_eflags & 0x080)
? dbenv->lock_put(dbenv, _lock)
: ENOTSUP;
if (_rpmdb_debug)
fprintf(stderr, "<-- %s(%p,%p) rc %d\n", "dbenv->lock_put", dbenv, _lock, r
c);
return rc;
}
/*@unused@*/ static inline
int rpmlgcOpen(rpmdb rpmdb)
{
DB_ENV * dbenv = rpmdb->db_dbenv;
DB_LOGC * _logc = NULL;
uint32_t _flags = 0;
int rc = (rpmdb->_dbi[0]->dbi_eflags & 0x100)
? dbenv->log_cursor(dbenv, &_logc, _flags) : ENOTSUP;
rpmdb->db_logc = (!rc ? _logc : NULL);
if (_rpmdb_debug)
fprintf(stderr, "<-- %s(%p,%p,0x%x) logc %p rc %d\n", "dbenv->log_cursor",
dbenv, &_logc, _flags, _logc, rc);
return rc;
}
/*@unused@*/ static inline
int rpmlgcGet(rpmdb rpmdb, DB_LSN * _lsn, DBT * data, uint32_t flags)
{
DB_LOGC * _logc = rpmdb->db_logc;
int rc = (_logc ? _logc->get(_logc, _lsn, data, flags) : ENOTSUP);
if (_rpmdb_debug)
fprintf(stderr, "<-- %s(%p,%p,%p,0x%x) rc %d\n", "logc->get", _logc, _lsn,
data, flags, rc);
return rc;
}
/*@unused@*/ static inline
int rpmlgcClose(rpmdb rpmdb)
{
DB_LOGC * _logc = rpmdb->db_logc;
uint32_t _flags = 0;
int rc = (_logc ? _logc->close(_logc, _flags) : ENOTSUP);
rpmdb->db_logc = NULL;
if (_rpmdb_debug)
fprintf(stderr, "<-- %s(%p) rc %d\n", "logc->close", _logc, rc);
return rc;
}
/*@unused@*/ static inline
int rpmlgcFile(rpmdb rpmdb, const DB_LSN * _lsn, char * name, size_t len)
{
DB_ENV * dbenv = rpmdb->db_dbenv;
int rc = dbenv->log_file(dbenv, _lsn, name, len);
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);
return rc;
}
/*@unused@*/ static inline
int rpmlgcFlush(rpmdb rpmdb, const DB_LSN * _lsn)
{
DB_ENV * dbenv = rpmdb->db_dbenv;
int rc = dbenv->log_flush(dbenv, _lsn);
if (_rpmdb_debug)
fprintf(stderr, "<-- %s(%p,%p) rc %d\n", "dbenv->log_flush", dbenv, _lsn, r
c);
return rc;
}
/*@unused@*/ static inline
int rpmlgcPrintf(rpmdb rpmdb, const char * fmt, void *_A1, void *_A2, void
*_A3, void *_A4, void *_A5)
{
DB_ENV * dbenv = rpmdb->db_dbenv;
DB_TXN * _txnid = rpmdb->db_txn;
int rc = dbenv->log_printf(dbenv, _txnid, fmt, _A1, _A2, _A3, _A4, _A5)
;
if (_rpmdb_debug)
fprintf(stderr, "<-- %s(%p,%p,\"%s\", ...) rc %d\n", "dbenv->log_printf", d
benv, _txnid, fmt, rc);
return rc;
}
/*@unused@*/ static inline
int rpmlgcPut(rpmdb rpmdb, DB_LSN * _lsn, const DBT * data, uint32_t flags)
{
DB_ENV * dbenv = rpmdb->db_dbenv;
int rc = dbenv->log_put(dbenv, _lsn, data, flags);
if (_rpmdb_debug)
fprintf(stderr, "<-- %s(%p,%p,%p,0x%x) rc %d\n", "dbenv->log_put", dbenv, _
lsn, data, flags, rc);
return rc;
}
/*@unused@*/ static inline
int rpmmpfSyncAll(rpmdb rpmdb)
{
DB_ENV * dbenv = rpmdb->db_dbenv;
DB_LSN * _lsn = NULL;
int rc = (rpmdb->_dbi[0]->dbi_eflags & 0x100)
? dbenv->memp_sync(dbenv, _lsn) : ENOTSUP;
if (_rpmdb_debug)
fprintf(stderr, "<-- %s(%p,%p) rc %d\n", "dbenv->memp_sync", dbenv, _lsn, r
c);
return rc;
}
/*@unused@*/ static inline
int rpmmpfTrickle(rpmdb rpmdb)
{
DB_ENV * dbenv = rpmdb->db_dbenv;
int _percent = 20;
int _nwrote = 0;
int rc = (rpmdb->_dbi[0]->dbi_eflags & 0x100)
? dbenv->memp_trickle(dbenv, _percent, &_nwrote) : ENOTSUP;
if (_rpmdb_debug)
fprintf(stderr, "<-- %s(%p,%d) nwrote %d rc %d\n", "dbenv->memp_trickle", d
benv, _percent, _nwrote, rc);
return rc;
}
/*@unused@*/ static inline
int rpmmpfClose(rpmdb rpmdb)
{
DB_MPOOLFILE * mpf = rpmdb->db_mpf;
uint32_t _flags = 0;
int rc = (mpf ? mpf->close(mpf, _flags) : ENOTSUP);
rpmdb->db_mpf = NULL;
if (_rpmdb_debug)
fprintf(stderr, "<-- %s(%p) rc %d\n", "mpf->close", mpf, rc);
return rc;
}
/*@unused@*/ static inline
int rpmmpfGet(rpmdb rpmdb, uint32_t * _pgnop, uint32_t _flags, void ** _pag
ep)
{
DB_MPOOLFILE * mpf = rpmdb->db_mpf;
DB_TXN * _txnid = rpmdb->db_txn;
int rc = mpf->get(mpf, _pgnop, _txnid, _flags, _pagep);
if (_rpmdb_debug)
fprintf(stderr, "<-- %s(%p,%p,%p,0x%x,%p) rc %d\n", "mpf->get", mpf, _pgnop
, _txnid, _flags, _pagep, rc);
return rc;
}
/*@unused@*/ static inline
int rpmmpfOpen(rpmdb rpmdb, /*@null@*/ const char * fn, uint32_t flags)
{
DB_ENV * dbenv = rpmdb->db_dbenv;
DB_MPOOLFILE * mpf = NULL;
int _perms = rpmdb->_dbi[0]->dbi_perms;
size_t _pagesize = BUFSIZ;
uint32_t _fcreate_flags = 0;
int rc = (rpmdb->_dbi[0]->dbi_eflags & 0x100)
? dbenv->memp_fcreate(dbenv, &mpf, _fcreate_flags) : ENOTSUP;
if (_rpmdb_debug)
fprintf(stderr, "<-- %s(%p,&mpf,0x%x) mpf %p rc %d\n", "dbenv->memp_fcreate
", dbenv, _fcreate_flags, mpf, rc);
if (rc) goto exit;
rc = mpf->open(mpf, fn, flags, _perms, _pagesize);
rpmdb->db_mpf = (!rc ? mpf : NULL); /* FIXME: mpf memlea
k */
if (_rpmdb_debug)
fprintf(stderr, "<-- %s(%p,%s,0x%x) rc %d\n", "mpf->open", mpf, fn, flags,
rc);
exit:
return rc;
}
/*@unused@*/ static inline
int rpmmpfPut(rpmdb rpmdb, void * _page, uint32_t flags)
{
DB_MPOOLFILE * mpf = rpmdb->db_mpf;
uint32_t _priority = DB_PRIORITY_DEFAULT;
int rc = mpf->put(mpf, _page, _priority, flags);
if (_rpmdb_debug)
fprintf(stderr, "<-- %s(%p,%p,0x%x,0x%x) rc %d\n", "mpf->put", mpf, _page,
_priority, flags, rc);
return rc;
}
/*@unused@*/ static inline
int rpmmpfSync(rpmdb rpmdb)
{
DB_MPOOLFILE * mpf = rpmdb->db_mpf;
int rc = (mpf ? mpf->sync(mpf) : ENOTSUP);
if (_rpmdb_debug)
fprintf(stderr, "<-- %s(%p) rc %d\n", "mpf->close", mpf, rc);
return rc;
} }
#endif /* __LCLINT__ */
#endif /* _RPMDB_INTERNAL */
/*@=globuse =mustmod @*/ /*@=globuse =mustmod @*/
#endif /* !defined(SWIG) */ #endif /* !defined(SWIG) */
/*@=exportlocal@*/ /*@=exportlocal@*/
/** \ingroup dbi /** \ingroup dbi
* Destroy set of index database items. * Destroy set of index database items.
* @param set set of index database items * @param set set of index database items
* @return NULL always * @return NULL always
*/ */
skipping to change at line 858 skipping to change at line 1119
*/ */
unsigned int dbiIndexSetCount(dbiIndexSet set) unsigned int dbiIndexSetCount(dbiIndexSet set)
/*@*/; /*@*/;
/** \ingroup dbi /** \ingroup dbi
* Return record offset of header from element in index database set. * Return record offset of header from element in index database set.
* @param set set of index database items * @param set set of index database items
* @param recno index of item in set * @param recno index of item in set
* @return record offset of header * @return record offset of header
*/ */
unsigned int dbiIndexRecordOffset(dbiIndexSet set, int recno) uint32_t dbiIndexRecordOffset(dbiIndexSet set, unsigned int recno)
/*@*/; /*@*/;
/** \ingroup dbi /** \ingroup dbi
* Return file index from element in index database set. * Return file index from element in index database set.
* @param set set of index database items * @param set set of index database items
* @param recno index of item in set * @param recno index of item in set
* @return file index * @return file index
*/ */
unsigned int dbiIndexRecordFileNumber(dbiIndexSet set, int recno) uint32_t dbiIndexRecordFileNumber(dbiIndexSet set, unsigned int recno)
/*@*/; /*@*/;
#endif /* defined(_RPMDB_INTERNAL) */ #endif /* defined(_RPMDB_INTERNAL) */
/** \ingroup rpmdb /** \ingroup rpmdb
* Unreference a database instance. * Unreference a database instance.
* @param db rpm database * @param db rpm database
* @param msg * @param msg
* @return NULL always * @return NULL always
*/ */
/*@unused@*/ /*@null@*/ /*@unused@*/ /*@null@*/
skipping to change at line 900 skipping to change at line 1161
rpmdb rpmdbLink (rpmdb db, const char * msg) rpmdb rpmdbLink (rpmdb db, const char * msg)
/*@modifies db @*/; /*@modifies db @*/;
#define rpmdbLink(_db, _msg) \ #define rpmdbLink(_db, _msg) \
((void *)rpmioLinkPoolItem((rpmioItem)(_db), _msg, __FILE__, __LINE_ _)) ((void *)rpmioLinkPoolItem((rpmioItem)(_db), _msg, __FILE__, __LINE_ _))
/** @todo document rpmdbNew /** @todo document rpmdbNew
*/ */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
rpmdb rpmdbNew(/*@kept@*/ /*@null@*/ const char * root, rpmdb rpmdbNew(/*@kept@*/ /*@null@*/ const char * root,
/*@kept@*/ /*@null@*/ const char * home, /*@kept@*/ /*@null@*/ const char * home,
int mode, int perms, int flags) int mode, mode_t perms, int flags)
/*@globals fileSystem, internalState @*/ /*@globals fileSystem, internalState @*/
/*@modifies fileSystem, internalState @*/; /*@modifies fileSystem, internalState @*/;
/** @todo document rpmdbOpenDatabase
*/
int rpmdbOpenDatabase(/*@null@*/ const char * prefix,
/*@null@*/ const char * dbpath,
int _dbapi, /*@null@*/ /*@out@*/ rpmdb *dbp,
int mode, int perms, int flags)
/*@globals rpmGlobalMacroContext, h_errno,
fileSystem, internalState @*/
/*@modifies *dbp, rpmGlobalMacroContext,
fileSystem, internalState @*/;
/** \ingroup rpmdb /** \ingroup rpmdb
* Open rpm database. * Open rpm database.
* @param prefix path to top of install tree * @param prefix path to top of install tree
* @retval dbp address of rpm database * @retval dbp address of rpm database
* @param mode open(2) flags: O_RDWR or O_RDONLY (O_CREAT also) * @param mode open(2) flags: O_RDWR or O_RDONLY (O_CREAT also)
* @param perms database permissions * @param perms database permissions
* @return 0 on success * @return 0 on success
*/ */
int rpmdbOpen (/*@null@*/ const char * prefix, /*@null@*/ /*@out@*/ rpmdb * int rpmdbOpen(/*@null@*/ const char * prefix, /*@null@*/ /*@out@*/ rpmdb *
dbp, dbp,
int mode, int perms) int mode, mode_t perms)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies *dbp, rpmGlobalMacroContext, fileSystem, internalState @ */; /*@modifies *dbp, rpmGlobalMacroContext, fileSystem, internalState @ */;
/** \ingroup rpmdb
* Initialize database.
* @param prefix path to top of install tree
* @param perms database permissions
* @return 0 on success
*/
int rpmdbInit(/*@null@*/ const char * prefix, int perms)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState
@*/
/*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/;
/** \ingroup rpmdb
* Verify all database components.
* @param db rpm database
* @return 0 on success
*/
int rpmdbVerifyAllDBI(rpmdb db)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState
@*/
/*@modifies db, rpmGlobalMacroContext, fileSystem, internalState @*/
;
/** \ingroup rpmdb
* Open and verify all database components.
* @param prefix path to top of install tree
* @return 0 on success
*/
int rpmdbVerify(/*@null@*/ const char * prefix)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState
@*/
/*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/;
/** /**
* Block access to a single database index. * Block access to a single database index.
* @param db rpm database * @param db rpm database
* @param tag rpm tag (negative to block) * @param tag rpm tag (negative to block)
* @return 0 on success * @return 0 on success
*/ */
int rpmdbBlockDBI(/*@null@*/ rpmdb db, int tag) int rpmdbBlockDBI(/*@null@*/ rpmdb db, int tag)
/*@modifies db @*/; /*@modifies db @*/;
/** /**
skipping to change at line 985 skipping to change at line 1207
/** \ingroup rpmdb /** \ingroup rpmdb
* Close all database indices and free rpmdb. * Close all database indices and free rpmdb.
* @param db rpm database * @param db rpm database
* @return 0 on success * @return 0 on success
*/ */
int rpmdbClose (/*@killref@*/ /*@only@*/ /*@null@*/ rpmdb db) int rpmdbClose (/*@killref@*/ /*@only@*/ /*@null@*/ rpmdb db)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies db, fileSystem @*/; /*@modifies db, fileSystem @*/;
/** \ingroup rpmdb /** \ingroup rpmdb
* Sync all database indices.
* @param db rpm database
* @return 0 on success
*/
int rpmdbSync (/*@null@*/ rpmdb db)
/*@globals fileSystem @*/
/*@modifies fileSystem @*/;
/** \ingroup rpmdb
* Open all database indices. * Open all database indices.
* @param db rpm database * @param db rpm database
* @return 0 on success * @return 0 on success
*/ */
/*@-exportlocal@*/ /*@-exportlocal@*/
int rpmdbOpenAll (/*@null@*/ rpmdb db) int rpmdbOpenAll (/*@null@*/ rpmdb db)
/*@globals rpmGlobalMacroContext, h_errno, internalState @*/ /*@globals rpmGlobalMacroContext, h_errno, internalState @*/
/*@modifies db, rpmGlobalMacroContext, internalState @*/; /*@modifies db, rpmGlobalMacroContext, internalState @*/;
/*@=exportlocal@*/ /*@=exportlocal@*/
skipping to change at line 1020 skipping to change at line 1233
* @return number of instances * @return number of instances
*/ */
int rpmdbCount(/*@null@*/ rpmdb db, rpmTag tag, int rpmdbCount(/*@null@*/ rpmdb db, rpmTag tag,
const void * keyp, size_t keylen) const void * keyp, size_t keylen)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies db, rpmGlobalMacroContext, fileSystem, internalState @*/ ; /*@modifies db, rpmGlobalMacroContext, fileSystem, internalState @*/ ;
/** \ingroup rpmdb /** \ingroup rpmdb
* Return number of instances of package in Name index. * Return number of instances of package in Name index.
* @param db rpm database * @param db rpm database
* @param name rpm package name * @param N rpm package name
* @return number of instances * @return number of instances
*/ */
int rpmdbCountPackages(/*@null@*/ rpmdb db, const char * name) int rpmdbCountPackages(/*@null@*/ rpmdb db, const char * N)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies db, rpmGlobalMacroContext, fileSystem, internalState @*/ ; /*@modifies db, rpmGlobalMacroContext, fileSystem, internalState @*/ ;
/** \ingroup rpmdb /** \ingroup rpmdb
* Return header instance join key for current position of rpmdb iterator. * Return header instance for current position of rpmdb iterator.
* @param mi rpm database iterator * @param mi rpm database iterator
* @return current header join key * @return current header instance
*/ */
unsigned int rpmmiInstance(/*@null@*/ rpmmi mi) uint32_t rpmmiInstance(/*@null@*/ rpmmi mi)
/*@*/; /*@*/;
/** \ingroup rpmdb /** \ingroup rpmdb
* Return header tag index join key for current position of rpmdb iterator. * Return basename tag for current position of rpmdb iterator.
* @param mi rpm database iterator * @param mi rpm database iterator
* @return current basename tag
*/ */
unsigned int rpmmiFilenum(rpmmi mi) uint32_t rpmmiBNTag(/*@null@*/ rpmmi mi)
/*@*/; /*@*/;
/** \ingroup rpmdb /** \ingroup rpmdb
* Return number of elements in rpm database iterator. * Return number of elements in rpm database iterator.
* @param mi rpm database iterator * @param mi rpm database iterator
* @return number of elements * @return number of elements
*/ */
int rpmmiCount(/*@null@*/ rpmmi mi) unsigned int rpmmiCount(/*@null@*/ rpmmi mi)
/*@*/; /*@*/;
/** \ingroup rpmdb /** \ingroup rpmdb
* Append items to set of package instances to iterate. * Append items to set of package instances to iterate.
* @param mi rpm database iterator * @param mi rpm database iterator
* @param hdrNums array of package instances * @param hdrNums array of package instances
* @param nHdrNums number of elements in array * @param nHdrNums number of elements in array
* @return 0 on success, 1 on failure (bad args) * @return 0 on success, 1 on failure (bad args)
*/ */
int rpmmiGrow(/*@null@*/ rpmmi mi, int rpmmiGrow(/*@null@*/ rpmmi mi,
/*@null@*/ const int * hdrNums, int nHdrNums) /*@null@*/ const uint32_t * hdrNums, int nHdrNums)
/*@modifies mi @*/;
/** \ingroup rpmdb
* Append packages containing common basename to iterator.
* @param mi rpm database iterator
* @param bn basename key
* @return 0 on success, 1 on failure (bad args)
*/
int rpmmiGrowBasename(rpmmi mi, const char * bn)
/*@modifies mi @*/;
/** \ingroup rpmdb
* Sort iterator instances.
* @param mi rpm database iterator
* @return 0 on success
*/
int rpmmiSort(/*@null@*/ rpmmi mi)
/*@modifies mi @*/; /*@modifies mi @*/;
/** \ingroup rpmdb /** \ingroup rpmdb
* Remove items from set of package instances to iterate. * Remove items from set of package instances to iterate.
* @note Sorted hdrNums are always passed in rpmlib. * @note Sorted hdrNums are always passed in rpmlib.
* @param mi rpm database iterator * @param mi rpm database iterator
* @param hdrNums array of package instances * @param hdrNums array of package instances
* @param nHdrNums number of elements in array * @param nHdrNums number of elements in array
* @param sorted is the array sorted? (array will be sorted on return ) * @param sorted is the array sorted? (array will be sorted on return )
* @return 0 on success, 1 on failure (bad args) * @return 0 on success, 1 on failure (bad args)
*/ */
int rpmmiPrune(/*@null@*/ rpmmi mi, int rpmmiPrune(/*@null@*/ rpmmi mi,
/*@null@*/ int * hdrNums, int nHdrNums, int sorted) /*@null@*/ uint32_t * hdrNums, int nHdrNums, int sorted)
/*@modifies mi, hdrNums @*/; /*@modifies mi, hdrNums @*/;
/** \ingroup rpmdb /** \ingroup rpmdb
* Add pattern to iterator selector. * Add pattern to iterator selector.
* @param mi rpm database iterator * @param mi rpm database iterator
* @param tag rpm tag * @param tag rpm tag
* @param mode type of pattern match * @param mode type of pattern match
* @param pattern pattern to match * @param pattern pattern to match
* @return 0 on success * @return 0 on success
*/ */
skipping to change at line 1107 skipping to change at line 1338
/** \ingroup rpmdb /** \ingroup rpmdb
* Modify iterator to mark header for lazy write on release. * Modify iterator to mark header for lazy write on release.
* @param mi rpm database iterator * @param mi rpm database iterator
* @param modified new value of modified * @param modified new value of modified
* @return previous value * @return previous value
*/ */
int rpmmiSetModified(/*@null@*/ rpmmi mi, int modified) int rpmmiSetModified(/*@null@*/ rpmmi mi, int modified)
/*@modifies mi @*/; /*@modifies mi @*/;
/** \ingroup rpmdb /** \ingroup rpmdb
* Modify iterator to verify retrieved header blobs.
* @param mi rpm database iterator
* @param ts transaction set
* @return 0 always
*/
int rpmmiSetHdrChk(/*@null@*/ rpmmi mi, /*@null@*/ rpmts ts)
/*@modifies mi @*/;
/** \ingroup rpmdb
* Return database iterator. * Return database iterator.
* @param db rpm database * @param db rpm database
* @param tag rpm tag * @param tag rpm tag
* @param keyp key data (NULL for sequential access) * @param keyp key data (NULL for sequential access)
* @param keylen key data length (0 will use strlen(keyp)) * @param keylen key data length (0 will use strlen(keyp))
* @return NULL on failure * @return NULL on failure
*/ */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
rpmmi rpmmiInit(/*@null@*/ rpmdb db, rpmTag tag, rpmmi rpmmiInit(/*@null@*/ rpmdb db, rpmTag tag,
/*@null@*/ const void * keyp, size_t keylen) /*@null@*/ const void * keyp, size_t keylen)
skipping to change at line 1233 skipping to change at line 1455
rpmGlobalMacroContext, fileSystem, internalState @*/; rpmGlobalMacroContext, fileSystem, internalState @*/;
/** \ingroup rpmdb /** \ingroup rpmdb
* Remove package header from rpm database and indices. * Remove package header from rpm database and indices.
* @param db rpm database * @param db rpm database
* @param rid (unused) remove transaction id (rid = 0 or -1 to ski p) * @param rid (unused) remove transaction id (rid = 0 or -1 to ski p)
* @param hdrNum package instance number in database * @param hdrNum package instance number in database
* @param ts (unused) transaction set (or NULL) * @param ts (unused) transaction set (or NULL)
* @return 0 on success * @return 0 on success
*/ */
int rpmdbRemove(/*@null@*/ rpmdb db, /*@unused@*/ int rid, unsigned int hdr Num, int rpmdbRemove(/*@null@*/ rpmdb db, /*@unused@*/ int rid, uint32_t hdrNum,
/*@null@*/ rpmts ts) /*@null@*/ rpmts ts)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies db, ts, /*@modifies db, ts,
rpmGlobalMacroContext, fileSystem, internalState @*/; rpmGlobalMacroContext, fileSystem, internalState @*/;
/** \ingroup rpmdb
* Rebuild database indices from package headers.
* @param prefix path to top of install tree
* @param ts transaction set (or NULL)
* @return 0 on success
*/
int rpmdbRebuild(/*@null@*/ const char * prefix, /*@null@*/ rpmts ts)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState
@*/
/*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/
;
/** /**
* Mergesort, same arguments as qsort(2). * Mergesort, same arguments as qsort(2).
*/ */
/*@unused@*/ /*@unused@*/
int rpm_mergesort(void *base, size_t nmemb, size_t size, int rpm_mergesort(void *base, size_t nmemb, size_t size,
int (*cmp) (const void *, const void *)) int (*cmp) (const void *, const void *))
/*@globals errno @*/ /*@globals errno @*/
/*@modifies base, errno @*/; /*@modifies base, errno @*/;
#ifdef __cplusplus #ifdef __cplusplus
 End of changes. 75 change blocks. 
178 lines changed or deleted 405 lines changed or added


 rpmds.h   rpmds.h 
#ifndef H_RPMDS #ifndef H_RPMDS
#define H_RPMDS #define H_RPMDS
/** \ingroup rpmds /** \ingroup rpmds
* \file lib/rpmds.h * \file lib/rpmds.h
* Structure(s) used for dependency tag sets. * Structure(s) used for dependency tag sets.
*/ */
#include "rpmevr.h" #include <rpmevr.h>
#define _RPMNS_INTERNAL #define _RPMNS_INTERNAL
#include "rpmns.h" #include <rpmns.h>
#include "rpmps.h" #include <rpmps.h>
/** \ingroup rpmds /** \ingroup rpmds
*/ */
/*@-exportlocal@*/ /*@-exportlocal@*/
/*@unchecked@*/ /*@unchecked@*/
extern int _rpmds_debug; extern int _rpmds_debug;
/*@=exportlocal@*/ /*@=exportlocal@*/
/** \ingroup rpmds /** \ingroup rpmds
*/ */
skipping to change at line 34 skipping to change at line 34
extern const char *_sysinfo_path; extern const char *_sysinfo_path;
/** \ingroup rpmds /** \ingroup rpmds
*/ */
/*@-exportlocal@*/ /*@-exportlocal@*/
/*@unchecked@*/ /*@unchecked@*/
extern int _rpmds_nopromote; extern int _rpmds_nopromote;
/*@=exportlocal@*/ /*@=exportlocal@*/
#if defined(_RPMDS_INTERNAL) #if defined(_RPMDS_INTERNAL)
#include "mire.h" #include <mire.h>
/** \ingroup rpmds /** \ingroup rpmds
* A dependency set. * A dependency set.
*/ */
struct rpmds_s { struct rpmds_s {
struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */ struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */
/*@observer@*/ /*@observer@*/
const char * Type; /*!< Tag name. */ const char * Type; /*!< Tag name. */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
const char * DNEVR; /*!< Formatted dependency string. */ const char * DNEVR; /*!< Formatted dependency string. */
 End of changes. 3 change blocks. 
4 lines changed or deleted 4 lines changed or added


 rpmevr.h   rpmevr.h 
skipping to change at line 132 skipping to change at line 132
#define isInstallPreReq(_x) ((_x) & _INSTALL_ONLY_MASK) #define isInstallPreReq(_x) ((_x) & _INSTALL_ONLY_MASK)
#define isErasePreReq(_x) ((_x) & _ERASE_ONLY_MASK) #define isErasePreReq(_x) ((_x) & _ERASE_ONLY_MASK)
#endif /* _RPMEVR_INTERNAL */ #endif /* _RPMEVR_INTERNAL */
/** \ingroup rpmds /** \ingroup rpmds
* Create a new EVR container. * Create a new EVR container.
* @param Flags EVR inequality flags * @param Flags EVR inequality flags
* @param initialize Should empty defaults be initialized? * @param initialize Should empty defaults be initialized?
* @return initialized EVR container * @return initialized EVR container
*/ */
EVR_t rpmEVRnew(rpmuint32_t Flags, int initialize) EVR_t rpmEVRnew(uint32_t Flags, int initialize)
/*@*/; /*@*/;
/** \ingroup rpmtd /** \ingroup rpmtd
* Destroy an EVR container. * Destroy an EVR container.
* @param EVR container * @param EVR container
* @return NULL always * @return NULL always
*/ */
/*@null@*/ /*@null@*/
EVR_t rpmEVRfree(/*@only@*/ EVR_t evr) EVR_t rpmEVRfree(/*@only@*/ EVR_t evr)
/*@modifies evr @*/; /*@modifies evr @*/;
skipping to change at line 198 skipping to change at line 198
/** /**
* Return comparison operator sense flags. * Return comparison operator sense flags.
* @param op operator string (NULL or "" uses RPMSENSE_EQUAL) * @param op operator string (NULL or "" uses RPMSENSE_EQUAL)
* @param *end pointer to 1st character after operator (or NULL) * @param *end pointer to 1st character after operator (or NULL)
* @return sense flags * @return sense flags
*/ */
rpmsenseFlags rpmEVRflags(/*@null@*/const char *op, /*@null@*/const char ** end) rpmsenseFlags rpmEVRflags(/*@null@*/const char *op, /*@null@*/const char ** end)
/*@modifies *end @*/; /*@modifies *end @*/;
#if defined(_RPMEVR_INTERNAL)
/** /**
* Compare headers to determine which header is "newer". * Compare headers to determine which header is "newer".
* @deprecated Use rpmdsCompare instead. * @deprecated Use rpmdsCompare instead.
* @todo Eliminate in rpm-5.1. * @todo Eliminate in rpm-5.1.
* @param A 1st header * @param A 1st header
* @param B 2nd header * @param B 2nd header
* @return result of comparison * @return result of comparison
*/ */
int rpmVersionCompare(Header A, Header B) int rpmVersionCompare(Header A, Header B)
/*@globals internalState @*/ /*@globals internalState @*/
/*@modifies internalState @*/; /*@modifies internalState @*/;
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* H_RPMEVR */ #endif /* H_RPMEVR */
 End of changes. 3 change blocks. 
1 lines changed or deleted 3 lines changed or added


 rpmfi.h   rpmfi.h 
skipping to change at line 169 skipping to change at line 169
/*@only@*/ /*@relnull@*/ /*@only@*/ /*@relnull@*/
const rpmuint32_t * vflags; /*!< File verify flag(s) (from heade r) */ const rpmuint32_t * vflags; /*!< File verify flag(s) (from heade r) */
rpmuint32_t dc; /*!< No. of directories. */ rpmuint32_t dc; /*!< No. of directories. */
rpmuint32_t fc; /*!< No. of files. */ rpmuint32_t fc; /*!< No. of files. */
/*=============================*/ /*=============================*/
/*@dependent@*/ /*@relnull@*/ /*@dependent@*/ /*@relnull@*/
void * te; void * te;
/*@only@*/
void * _fnbf; /*!< File paths Bloom filter. */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
miRE exclude; /*!< Iterator exclude patterns. */ miRE exclude; /*!< Iterator exclude patterns. */
int nexclude; /*!< No. of exclude patterns. */ int nexclude; /*!< No. of exclude patterns. */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
miRE include; /*!< Iterator include patterns. */ miRE include; /*!< Iterator include patterns. */
int ninclude; /*!< No. of include patterns. */ int ninclude; /*!< No. of include patterns. */
/*-----------------------------*/ /*-----------------------------*/
uid_t uid; /*!< File uid (default). */ uid_t uid; /*!< File uid (default). */
gid_t gid; /*!< File gid (default). */ gid_t gid; /*!< File gid (default). */
skipping to change at line 562 skipping to change at line 564
/** /**
* Return current file group from file info set. * Return current file group from file info set.
* @param fi file info set * @param fi file info set
* @return current file group, NULL on invalid * @return current file group, NULL on invalid
*/ */
/*@observer@*/ /*@null@*/ /*@observer@*/ /*@null@*/
extern const char * rpmfiFGroup(/*@null@*/ rpmfi fi) extern const char * rpmfiFGroup(/*@null@*/ rpmfi fi)
/*@*/; /*@*/;
/** \ingroup rpmfi /** \ingroup rpmfi
* Return file path Bloom filter.
* @param fi file info set
* @return file path Bloom filter (NULL if not set)
*/
void * rpmfiBloomFN(/*@null@*/ const rpmfi fi)
/*@*/;
/** \ingroup rpmfi
* Return file info exclude patterns. * Return file info exclude patterns.
* @param fi file info set * @param fi file info set
* @return file info exclude patterns (NULL if not set) * @return file info exclude patterns (NULL if not set)
*/ */
/*@null@*/ /*@null@*/
void * rpmfiExclude(/*@null@*/ const rpmfi fi) void * rpmfiExclude(/*@null@*/ const rpmfi fi)
/*@*/; /*@*/;
/** \ingroup rpmfi /** \ingroup rpmfi
* Return no. of file info exclude patterns. * Return no. of file info exclude patterns.
skipping to change at line 595 skipping to change at line 605
/*@*/; /*@*/;
/** \ingroup rpmfi /** \ingroup rpmfi
* Return no. of file info include patterns. * Return no. of file info include patterns.
* @param fi file info set * @param fi file info set
* @return file info include patterns (0 if not set) * @return file info include patterns (0 if not set)
*/ */
int rpmfiNInclude(/*@null@*/ const rpmfi fi) int rpmfiNInclude(/*@null@*/ const rpmfi fi)
/*@*/; /*@*/;
#if defined(_RPMFI_INTERNAL)
#include "fprint.h"
/**
* Return fingerprint from file info set.
* @param fi file info set
* @param ix
* @return fingerprint, NULL on invalid
*/
/*@null@*/
struct fingerPrint_s * rpmfiFpsIndex(rpmfi fi, int ix)
/*@*/;
void rpmfiFpLookup(rpmfi fi, fingerPrintCache fpc)
/*@modifies fi, fpc @*/;
#endif
/**
* Return FN Bloom filter from file info set.
* @param fi file info set
* @return FN Bloom filter, NULL on invalid
*/
/*@null@*/
void * rpmfiFNBF(rpmfi fi)
/*@*/;
/** /**
* Return next file iterator index. * Return next file iterator index.
* @param fi file info set * @param fi file info set
* @return file iterator index, -1 on termination * @return file iterator index, -1 on termination
*/ */
int rpmfiNext(/*@null@*/ rpmfi fi) int rpmfiNext(/*@null@*/ rpmfi fi)
/*@modifies fi @*/; /*@modifies fi @*/;
/** /**
* Initialize file iterator index. * Initialize file iterator index.
skipping to change at line 692 skipping to change at line 727
int rpmfiStat(rpmfi fi, const char * path, /*@out@*/ struct stat * st) int rpmfiStat(rpmfi fi, const char * path, /*@out@*/ struct stat * st)
/*@modifies fi, *st @*/; /*@modifies fi, *st @*/;
/** /**
* Return directory stream onto file info set. * Return directory stream onto file info set.
* @param fi file info set * @param fi file info set
* @param name directory path * @param name directory path
* @return NULL on error * @return NULL on error
*/ */
/*@null@*/ /*@null@*/
DIR * rpmfiOpendir(rpmfi fi, const char * name) void * rpmfiOpendir(rpmfi fi, const char * name)
/*@globals fileSystem, internalState @*/ /*@globals fileSystem, internalState @*/
/*@modifies fi, fileSystem, internalState @*/; /*@modifies fi, fileSystem, internalState @*/;
/** /**
* Retrieve file classes from header. * Retrieve file classes from header.
* *
* This function is used to retrieve file classes from the header. * This function is used to retrieve file classes from the header.
* *
* @param h header * @param h header
* @retval *fclassp array of file classes * @retval *fclassp array of file classes
* @retval *fcp number of files * @retval *fcp number of files
*/ */
void rpmfiBuildFClasses(Header h, void rpmfiBuildFClasses(Header h,
/*@out@*/ const char *** fclassp, /*@out@*/ rpmuint32_t * fc p) /*@out@*/ const char *** fclassp, /*@out@*/ rpmuint32_t * fc p)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies h, *fclassp, *fcp, rpmGlobalMacroContext, /*@modifies h, *fclassp, *fcp, rpmGlobalMacroContext,
fileSystem, internalState @*/; fileSystem, internalState @*/;
#ifdef DYING
/** /**
* Retrieve file security contexts from header. * Retrieve file security contexts from header.
* *
* This function is used to retrieve file contexts from the header. * This function is used to retrieve file contexts from the header.
* *
* @param h header * @param h header
* @retval *fcontextp array of file contexts * @retval *fcontextp array of file contexts
* @retval *fcp number of files * @retval *fcp number of files
*/ */
void rpmfiBuildFContexts(Header h, void rpmfiBuildFContexts(Header h,
skipping to change at line 755 skipping to change at line 791
* *
* @param h header * @param h header
* @retval *fcontextp array of file contexts * @retval *fcontextp array of file contexts
* @retval *fcp number of files * @retval *fcp number of files
*/ */
void rpmfiBuildREContexts(Header h, void rpmfiBuildREContexts(Header h,
/*@out@*/ const char *** fcontextp, /*@out@*/ rpmuint32_t * fcp) /*@out@*/ const char *** fcontextp, /*@out@*/ rpmuint32_t * fcp)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies h, *fcontextp, *fcp, rpmGlobalMacroContext, /*@modifies h, *fcontextp, *fcp, rpmGlobalMacroContext,
fileSystem, internalState @*/; fileSystem, internalState @*/;
#endif
/** /**
* Retrieve per-file dependencies from header. * Retrieve per-file dependencies from header.
* *
* This function is used to retrieve per-file dependencies from the header. * This function is used to retrieve per-file dependencies from the header.
* *
* @param h header * @param h header
* @param tagN RPMTAG_PROVIDENAME | RPMTAG_REQUIRENAME * @param tagN RPMTAG_PROVIDENAME | RPMTAG_REQUIRENAME
* @retval *fdepsp array of file dependencies * @retval *fdepsp array of file dependencies
* @retval *fcp number of files * @retval *fcp number of files
 End of changes. 6 change blocks. 
1 lines changed or deleted 38 lines changed or added


 rpmio.h   rpmio.h 
#ifndef H_RPMIO #ifndef H_RPMIO
#define H_RPMIO #define H_RPMIO
/** \ingroup rpmio /** \ingroup rpmio
* \file rpmio/rpmio.h * \file rpmio/rpmio.h
* *
*/ */
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <dirent.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <rpmiotypes.h> #include <rpmiotypes.h>
#include <rpmzlog.h> #include <rpmzlog.h>
/** \ingroup rpmio /** \ingroup rpmio
* Hide libio API lossage. * Hide libio API lossage.
* The libio interface changed after glibc-2.1.3 to pass the seek offset * The libio interface changed after glibc-2.1.3 to pass the seek offset
skipping to change at line 39 skipping to change at line 38
typedef _IO_off64_t _libio_off_t; typedef _IO_off64_t _libio_off_t;
typedef _libio_off_t * _libio_pos_t; typedef _libio_off_t * _libio_pos_t;
#else #else
typedef off_t _libio_off_t; typedef off_t _libio_off_t;
typedef off_t _libio_pos_t; typedef off_t _libio_pos_t;
#endif #endif
/*@}*/ /*@}*/
/** \ingroup rpmio /** \ingroup rpmio
*/ */
/*@unchecked@*/
extern int _rpmio_debug;
/** \ingroup rpmio
*/
typedef /*@abstract@*/ /*@refcounted@*/ struct _FD_s * FD_t; typedef /*@abstract@*/ /*@refcounted@*/ struct _FD_s * FD_t;
/** \ingroup rpmio /** \ingroup rpmio
*/ */
typedef /*@observer@*/ struct FDIO_s * FDIO_t; typedef /*@observer@*/ struct FDIO_s * FDIO_t;
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
skipping to change at line 152 skipping to change at line 156
/*@modifies fd, fileSystem @*/ /*@modifies fd, fileSystem @*/
/*@requires maxRead(buf) >= nmemb @*/; /*@requires maxRead(buf) >= nmemb @*/;
/*@=incondefs@*/ /*@=incondefs@*/
/** /**
* fseek(3) clone. * fseek(3) clone.
*/ */
int Fseek(FD_t fd, _libio_off_t offset, int whence) int Fseek(FD_t fd, _libio_off_t offset, int whence)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies fileSystem @*/; /*@modifies fileSystem @*/;
long Ftell(FD_t fd)
/*@*/;
void Rewind(FD_t fd)
/*@*/;
int Fgetpos(FD_t fd, fpos_t *pos)
/*@*/;
int Fsetpos(FD_t fd, fpos_t *pos)
/*@*/;
/** /**
* fclose(3) clone. * fclose(3) clone.
*/ */
int Fclose( /*@killref@*/ FD_t fd) int Fclose( /*@killref@*/ FD_t fd)
/*@globals fileSystem, internalState @*/ /*@globals fileSystem, internalState @*/
/*@modifies fd, fileSystem, internalState @*/; /*@modifies fd, fileSystem, internalState @*/;
/** /**
*/ */
skipping to change at line 292 skipping to change at line 304
/*@modifies *st, errno, fileSystem, internalState @*/; /*@modifies *st, errno, fileSystem, internalState @*/;
/** /**
* fstat(2) clone. * fstat(2) clone.
*/ */
int Fstat(FD_t fd, /*@out@*/ struct stat * st) int Fstat(FD_t fd, /*@out@*/ struct stat * st)
/*@globals errno, fileSystem, internalState @*/ /*@globals errno, fileSystem, internalState @*/
/*@modifies *st, errno, fileSystem, internalState @*/; /*@modifies *st, errno, fileSystem, internalState @*/;
/** /**
* posix_fallocate(3)/fallocate(2) clone.
*/
int Fallocate(FD_t fd, off_t offset, off_t length)
/*@globals fileSystem, internalState @*/
/*@modifies fileSystem, internalState @*/;
/**
* chown(2) clone. * chown(2) clone.
* @todo Implement remotely. * @todo Implement remotely.
*/ */
int Chown(const char * path, uid_t owner, gid_t group) int Chown(const char * path, uid_t owner, gid_t group)
/*@globals errno, fileSystem, internalState @*/ /*@globals errno, fileSystem, internalState @*/
/*@modifies errno, fileSystem, internalState @*/; /*@modifies errno, fileSystem, internalState @*/;
/** /**
* fchown(2) clone. * fchown(2) clone.
* @todo Implement remotely. * @todo Implement remotely.
skipping to change at line 324 skipping to change at line 343
/** /**
* chmod(2) clone. * chmod(2) clone.
* @todo Implement remotely. * @todo Implement remotely.
*/ */
int Chmod(const char * path, mode_t mode) int Chmod(const char * path, mode_t mode)
/*@globals errno, fileSystem, internalState @*/ /*@globals errno, fileSystem, internalState @*/
/*@modifies errno, fileSystem, internalState @*/; /*@modifies errno, fileSystem, internalState @*/;
/** /**
* lchmod(2) clone.
* @todo Implement remotely.
*/
int Lchmod(const char * path, mode_t mode)
/*@globals errno, fileSystem, internalState @*/
/*@modifies errno, fileSystem, internalState @*/;
/**
* fchmod(2) clone. * fchmod(2) clone.
* @todo Implement remotely. * @todo Implement remotely.
*/ */
int Fchmod(FD_t fd, mode_t mode) int Fchmod(FD_t fd, mode_t mode)
/*@globals errno, fileSystem, internalState @*/ /*@globals errno, fileSystem, internalState @*/
/*@modifies errno, fileSystem, internalState @*/; /*@modifies errno, fileSystem, internalState @*/;
/** /**
* chflags(2) clone.
* @todo Implement remotely.
*/
int Chflags(const char * path, unsigned int flags)
/*@globals errno, fileSystem, internalState @*/
/*@modifies errno, fileSystem, internalState @*/;
/**
* lchflags(2) clone.
* @todo Implement remotely.
*/
int Lchflags(const char * path, unsigned int flags)
/*@globals errno, fileSystem, internalState @*/
/*@modifies errno, fileSystem, internalState @*/;
/**
* fchflags(2) clone.
* @todo Implement remotely.
*/
int Fchflags(FD_t fd, unsigned int flags)
/*@globals errno, fileSystem, internalState @*/
/*@modifies errno, fileSystem, internalState @*/;
/**
* mkfifo(3) clone. * mkfifo(3) clone.
* @todo Implement remotely. * @todo Implement remotely.
*/ */
int Mkfifo(const char * path, mode_t mode) int Mkfifo(const char * path, mode_t mode)
/*@globals errno, fileSystem, internalState @*/ /*@globals errno, fileSystem, internalState @*/
/*@modifies errno, fileSystem, internalState @*/; /*@modifies errno, fileSystem, internalState @*/;
/** /**
* mknod(3) clone. * mknod(3) clone.
* @todo Implement remotely. * @todo Implement remotely.
skipping to change at line 365 skipping to change at line 416
/** /**
* utimes(2) clone. * utimes(2) clone.
* @todo Implement remotely. * @todo Implement remotely.
*/ */
int Utimes(const char * path, const struct timeval * times) int Utimes(const char * path, const struct timeval * times)
/*@globals errno, fileSystem, internalState @*/ /*@globals errno, fileSystem, internalState @*/
/*@modifies errno, fileSystem, internalState @*/; /*@modifies errno, fileSystem, internalState @*/;
/** /**
* lutimes(2) clone.
* @todo Implement remotely.
*/
int Lutimes(const char * path, const struct timeval * times)
/*@globals errno, fileSystem, internalState @*/
/*@modifies errno, fileSystem, internalState @*/;
/**
* symlink(3) clone. * symlink(3) clone.
* @todo Implement remotely. * @todo Implement remotely.
*/ */
int Symlink(const char * oldpath, const char * newpath) int Symlink(const char * oldpath, const char * newpath)
/*@globals errno, fileSystem, internalState @*/ /*@globals errno, fileSystem, internalState @*/
/*@modifies errno, fileSystem, internalState @*/; /*@modifies errno, fileSystem, internalState @*/;
/** /**
* readlink(2) clone. * readlink(2) clone.
* @todo Implement remotely. * @todo Implement remotely.
skipping to change at line 444 skipping to change at line 503
/*@modifies *_pglob, fileSystem @*/; /*@modifies *_pglob, fileSystem @*/;
/** /**
* globfree(3) clone. * globfree(3) clone.
*/ */
void Globfree( /*@only@*/ void * _pglob) void Globfree( /*@only@*/ void * _pglob)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies *_pglob, fileSystem @*/; /*@modifies *_pglob, fileSystem @*/;
/** /**
* opendir(3) clone.
*/
/*@null@*/
DIR * Opendir(const char * path)
/*@globals errno, h_errno, fileSystem, internalState @*/
/*@modifies errno, fileSystem, internalState @*/;
/**
* readdir(3) clone.
*/
/*@dependent@*/ /*@null@*/
struct dirent * Readdir(DIR * dir)
/*@globals errno, fileSystem @*/
/*@modifies *dir, errno, fileSystem @*/;
/**
* closedir(3) clone.
*/
int Closedir(/*@only@*/ DIR * dir)
/*@globals errno, fileSystem @*/
/*@modifies *dir, errno, fileSystem @*/;
/**
* realpath(3) clone. * realpath(3) clone.
*/ */
/*@-globuse@*/ /*@-globuse@*/
/*@null@*/ /*@null@*/
char * Realpath(const char * path, /*@out@*/ /*@null@*/ char * resolved_pat h) char * Realpath(const char * path, /*@out@*/ /*@null@*/ char * resolved_pat h)
/*@globals errno, fileSystem, internalState @*/ /*@globals errno, fileSystem, internalState @*/
/*@modifies resolved_path, errno, fileSystem, internalState @*/; /*@modifies resolved_path, errno, fileSystem, internalState @*/;
/*@=globuse@*/ /*@=globuse@*/
/** /**
skipping to change at line 741 skipping to change at line 777
* @param size item size * @param size item size
* @param limit no. of items permitted (-1 for unlimited) * @param limit no. of items permitted (-1 for unlimited)
* @param flags debugging flags * @param flags debugging flags
* @param (*dbg)() generate string for Unlink/Link/Free debugging * @param (*dbg)() generate string for Unlink/Link/Free debugging
* @param (*init)() create item contents * @param (*init)() create item contents
* @param (*fini)() destroy item contents * @param (*fini)() destroy item contents
* @return memory pool * @return memory pool
*/ */
rpmioPool rpmioNewPool(/*@observer@*/ const char * name, rpmioPool rpmioNewPool(/*@observer@*/ const char * name,
size_t size, int limit, int flags, size_t size, int limit, int flags,
/*@null@*/ const char * (*dbg) (void *item), /*@null@*/ char * (*dbg) (void *item),
/*@null@*/ void (*init) (void *item), /*@null@*/ void (*init) (void *item),
/*@null@*/ void (*fini) (void *item)) /*@null@*/ void (*fini) (void *item))
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies fileSystem @*/; /*@modifies fileSystem @*/;
/** /**
* Decrement a pool item refcount. * Decrement a pool item refcount.
* @param item pool item * @param item pool item
* @param msg debugging msg (NULL disables debugging) * @param msg debugging msg (NULL disables debugging)
* @param fn usually __FILE__ * @param fn usually __FILE__
 End of changes. 9 change blocks. 
25 lines changed or deleted 61 lines changed or added


 rpmiotypes.h   rpmiotypes.h 
skipping to change at line 58 skipping to change at line 58
/** \ingroup rpmio /** \ingroup rpmio
*/ */
typedef /*@abstract@*/ /*@refcounted@*/ struct rpmiob_s * rpmiob; typedef /*@abstract@*/ /*@refcounted@*/ struct rpmiob_s * rpmiob;
/** \ingroup rpmio /** \ingroup rpmio
*/ */
/*@unchecked@*/ /*@unchecked@*/
extern size_t _rpmiob_chunk; extern size_t _rpmiob_chunk;
/** \ingroup rpmio
*/
typedef struct rpmioP_s {
char * str;
char * next;
const char ** av;
int ac;
} * rpmioP;
/** \ingroup rpmpgp /** \ingroup rpmpgp
*/ */
typedef /*@abstract@*/ struct DIGEST_CTX_s * DIGEST_CTX; typedef /*@abstract@*/ struct DIGEST_CTX_s * DIGEST_CTX;
/** \ingroup rpmpgp /** \ingroup rpmpgp
*/ */
typedef /*@abstract@*/ struct pgpPkt_s * pgpPkt; typedef /*@abstract@*/ struct pgpPkt_s * pgpPkt;
/** \ingroup rpmpgp /** \ingroup rpmpgp
*/ */
skipping to change at line 203 skipping to change at line 212
PGPHASHALGO_CRC32 = 106, /*!< (private) CRC-32 */ PGPHASHALGO_CRC32 = 106, /*!< (private) CRC-32 */
PGPHASHALGO_ADLER32 = 107, /*!< (private) ADLER-32 */ PGPHASHALGO_ADLER32 = 107, /*!< (private) ADLER-32 */
PGPHASHALGO_CRC64 = 108, /*!< (private) CRC-64 */ PGPHASHALGO_CRC64 = 108, /*!< (private) CRC-64 */
PGPHASHALGO_JLU32 = 109, /*!< (private) Jenkins lookup3.c */ PGPHASHALGO_JLU32 = 109, /*!< (private) Jenkins lookup3.c */
PGPHASHALGO_RIPEMD256 = 111, /*!< (private) RIPEMD-256 */ PGPHASHALGO_RIPEMD256 = 111, /*!< (private) RIPEMD-256 */
PGPHASHALGO_RIPEMD320 = 112, /*!< (private) RIPEMD-320 */ PGPHASHALGO_RIPEMD320 = 112, /*!< (private) RIPEMD-320 */
PGPHASHALGO_SALSA10 = 113, /*!< (private) SALSA-10 */ PGPHASHALGO_SALSA10 = 113, /*!< (private) SALSA-10 */
PGPHASHALGO_SALSA20 = 114, /*!< (private) SALSA-20 */ PGPHASHALGO_SALSA20 = 114, /*!< (private) SALSA-20 */
PGPHASHALGO_MD6_224 = 128+0,/*!< (private) MD6-224 */
PGPHASHALGO_MD6_256 = 128+1,/*!< (private) MD6-256 */
PGPHASHALGO_MD6_384 = 128+2,/*!< (private) MD6-384 */
PGPHASHALGO_MD6_512 = 128+3,/*!< (private) MD6-512 */
PGPHASHALGO_CUBEHASH_224 = 136+0,/*!< (private) CUBEHASH-224 */
PGPHASHALGO_CUBEHASH_256 = 136+1,/*!< (private) CUBEHASH-256 */
PGPHASHALGO_CUBEHASH_384 = 136+2,/*!< (private) CUBEHASH-384 */
PGPHASHALGO_CUBEHASH_512 = 136+3,/*!< (private) CUBEHASH-512 */
PGPHASHALGO_KECCAK_224 = 144+0,/*!< (private) KECCAK-224 */
PGPHASHALGO_KECCAK_256 = 144+1,/*!< (private) KECCAK-256 */
PGPHASHALGO_KECCAK_384 = 144+2,/*!< (private) KECCAK-384 */
PGPHASHALGO_KECCAK_512 = 144+3,/*!< (private) KECCAK-384 */
PGPHASHALGO_ECHO_224 = 148+0,/*!< (private) ECHO-224 */
PGPHASHALGO_ECHO_256 = 148+1,/*!< (private) ECHO-256 */
PGPHASHALGO_ECHO_384 = 148+2,/*!< (private) ECHO-384 */
PGPHASHALGO_ECHO_512 = 148+3,/*!< (private) ECHO-384 */
PGPHASHALGO_EDONR_224 = 152+0,/*!< (private) EDON-R-224 */
PGPHASHALGO_EDONR_256 = 152+1,/*!< (private) EDON-R-256 */
PGPHASHALGO_EDONR_384 = 152+2,/*!< (private) EDON-R-384 */
PGPHASHALGO_EDONR_512 = 152+3,/*!< (private) EDON-R-512 */
PGPHASHALGO_FUGUE_224 = 156+0,/*!< (private) FUGUE-224 */
PGPHASHALGO_FUGUE_256 = 156+1,/*!< (private) FUGUE-256 */
PGPHASHALGO_FUGUE_384 = 156+2,/*!< (private) FUGUE-384 */
PGPHASHALGO_FUGUE_512 = 156+3,/*!< (private) FUGUE-512 */
PGPHASHALGO_SKEIN_224 = 160+0,/*!< (private) SKEIN-224 */
PGPHASHALGO_SKEIN_256 = 160+1,/*!< (private) SKEIN-256 */
PGPHASHALGO_SKEIN_384 = 160+2,/*!< (private) SKEIN-384 */
PGPHASHALGO_SKEIN_512 = 160+3,/*!< (private) SKEIN-512 */
PGPHASHALGO_SKEIN_1024 = 160+4,/*!< (private) SKEIN-1024 */
PGPHASHALGO_BMW_224 = 168+0,/*!< (private) BMW-224 */
PGPHASHALGO_BMW_256 = 168+1,/*!< (private) BMW-256 */
PGPHASHALGO_BMW_384 = 168+2,/*!< (private) BMW-384 */
PGPHASHALGO_BMW_512 = 168+3,/*!< (private) BMW-512 */
PGPHASHALGO_SHABAL_224 = 176+0,/*!< (private) SHABAL-224 */
PGPHASHALGO_SHABAL_256 = 176+1,/*!< (private) SHABAL-256 */
PGPHASHALGO_SHABAL_384 = 176+2,/*!< (private) SHABAL-384 */
PGPHASHALGO_SHABAL_512 = 176+3,/*!< (private) SHABAL-512 */
PGPHASHALGO_SHAVITE3_224 = 180+0,/*!< (private) SHAVITE3-224 */
PGPHASHALGO_SHAVITE3_256 = 180+1,/*!< (private) SHAVITE3-256 */
PGPHASHALGO_SHAVITE3_384 = 180+2,/*!< (private) SHAVITE3-384 */
PGPHASHALGO_SHAVITE3_512 = 180+3,/*!< (private) SHAVITE3-512 */
PGPHASHALGO_BLAKE_224 = 184+0,/*!< (private) BLAKE-224 */
PGPHASHALGO_BLAKE_256 = 184+1,/*!< (private) BLAKE-256 */
PGPHASHALGO_BLAKE_384 = 184+2,/*!< (private) BLAKE-384 */
PGPHASHALGO_BLAKE_512 = 184+3,/*!< (private) BLAKE-512 */
PGPHASHALGO_TIB3_224 = 192+0,/*!< (private) TIB3-224 */
PGPHASHALGO_TIB3_256 = 192+1,/*!< (private) TIB3-256 */
PGPHASHALGO_TIB3_384 = 192+2,/*!< (private) TIB3-384 */
PGPHASHALGO_TIB3_512 = 192+3,/*!< (private) TIB3-512 */
PGPHASHALGO_SIMD_224 = 200+0,/*!< (private) SIMD-224 */
PGPHASHALGO_SIMD_256 = 200+1,/*!< (private) SIMD-256 */
PGPHASHALGO_SIMD_384 = 200+2,/*!< (private) SIMD-384 */
PGPHASHALGO_SIMD_512 = 200+3,/*!< (private) SIMD-512 */
PGPHASHALGO_ARIRANG_224 = 208+0,/*!< (private) ARIRANG-224 */
PGPHASHALGO_ARIRANG_256 = 208+1,/*!< (private) ARIRANG-256 */
PGPHASHALGO_ARIRANG_384 = 208+2,/*!< (private) ARIRANG-384 */
PGPHASHALGO_ARIRANG_512 = 208+3,/*!< (private) ARIRANG-512 */
PGPHASHALGO_LANE_224 = 212+0,/*!< (private) LANE-224 */
PGPHASHALGO_LANE_256 = 212+1,/*!< (private) LANE-256 */
PGPHASHALGO_LANE_384 = 212+2,/*!< (private) LANE-384 */
PGPHASHALGO_LANE_512 = 212+3,/*!< (private) LANE-512 */
PGPHASHALGO_LUFFA_224 = 216+0,/*!< (private) LUFFA-224 */
PGPHASHALGO_LUFFA_256 = 216+1,/*!< (private) LUFFA-256 */
PGPHASHALGO_LUFFA_384 = 216+2,/*!< (private) LUFFA-384 */
PGPHASHALGO_LUFFA_512 = 216+3,/*!< (private) LUFFA-512 */
PGPHASHALGO_CHI_224 = 224+0,/*!< (private) CHI-224 */
PGPHASHALGO_CHI_256 = 224+1,/*!< (private) CHI-256 */
PGPHASHALGO_CHI_384 = 224+2,/*!< (private) CHI-384 */
PGPHASHALGO_CHI_512 = 224+3,/*!< (private) CHI-512 */
PGPHASHALGO_JH_224 = 232+0,/*!< (private) JH-224 */
PGPHASHALGO_JH_256 = 232+1,/*!< (private) JH-256 */
PGPHASHALGO_JH_384 = 232+2,/*!< (private) JH-384 */
PGPHASHALGO_JH_512 = 232+3,/*!< (private) JH-512 */
PGPHASHALGO_GROESTL_224 = 240+0,/*!< (private) GROESTL-224 */
PGPHASHALGO_GROESTL_256 = 240+1,/*!< (private) GROESTL-256 */
PGPHASHALGO_GROESTL_384 = 240+2,/*!< (private) GROESTL-384 */
PGPHASHALGO_GROESTL_512 = 240+3,/*!< (private) GROESTL-512 */
PGPHASHALGO_HAMSI_224 = 248+0,/*!< (private) HAMSI-224 */
PGPHASHALGO_HAMSI_256 = 248+1,/*!< (private) HAMSI-256 */
PGPHASHALGO_HAMSI_384 = 248+2,/*!< (private) HAMSI-384 */
PGPHASHALGO_HAMSI_512 = 248+3,/*!< (private) HAMSI-512 */
} pgpHashAlgo; } pgpHashAlgo;
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Bit(s) to control digest operation. * Bit(s) to control digest operation.
*/ */
typedef enum rpmDigestFlags_e { typedef enum rpmDigestFlags_e {
RPMDIGEST_NONE = 0 RPMDIGEST_NONE = 0,
} rpmDigestFlags; } rpmDigestFlags;
#if defined(_RPMIOB_INTERNAL) #if defined(_RPMIOB_INTERNAL)
/** \ingroup rpmio /** \ingroup rpmio
*/ */
struct rpmiob_s{ struct rpmiob_s{
struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */ struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */
rpmuint8_t * b; /*!< data octects. */ rpmuint8_t * b; /*!< data octects. */
size_t blen; /*!< no. of octets used. */ size_t blen; /*!< no. of octets used. */
size_t allocated; /*!< no. of octets allocated. */ size_t allocated; /*!< no. of octets allocated. */
skipping to change at line 240 skipping to change at line 350
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Return digest algorithm identifier. * Return digest algorithm identifier.
* @param ctx digest context * @param ctx digest context
* @return digest hash algorithm identifier * @return digest hash algorithm identifier
*/ */
pgpHashAlgo rpmDigestAlgo(DIGEST_CTX ctx) pgpHashAlgo rpmDigestAlgo(DIGEST_CTX ctx)
/*@*/; /*@*/;
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Return digest flags.
* @param ctx digest context
* @return digest flags
*/
rpmDigestFlags rpmDigestF(DIGEST_CTX ctx)
/*@*/;
/** \ingroup rpmpgp
* Return digest name. * Return digest name.
* @param ctx digest context * @param ctx digest context
* @return digest name * @return digest name
*/ */
/*@observer@*/ /*@observer@*/
const char * rpmDigestName(DIGEST_CTX ctx) const char * rpmDigestName(DIGEST_CTX ctx)
/*@*/; /*@*/;
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Return digest ASN1 oid string. * Return digest ASN1 oid string.
skipping to change at line 290 skipping to change at line 408
* @param ctx digest context * @param ctx digest context
* @param data next data buffer * @param data next data buffer
* @param len no. bytes of data * @param len no. bytes of data
* @return 0 on success * @return 0 on success
*/ */
int rpmDigestUpdate(/*@null@*/ DIGEST_CTX ctx, const void * data, size_t le n) int rpmDigestUpdate(/*@null@*/ DIGEST_CTX ctx, const void * data, size_t le n)
/*@modifies ctx @*/; /*@modifies ctx @*/;
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Return digest and destroy context. * Return digest and destroy context.
* Final wrapup - pad to 64-byte boundary with the bit pattern
* 1 0* (64-bit count of bits processed, MSB-first)
* *
* @param ctx digest context * @param ctx digest context
* @retval *datap digest * @retval *datap digest
* @retval *lenp no. bytes of digest * @retval *lenp no. bytes of digest
* @param asAscii return digest as ascii string? * @param asAscii return digest as ascii string?
* @return 0 on success * @return 0 on success
*/ */
int rpmDigestFinal(/*@only@*/ /*@null@*/ DIGEST_CTX ctx, int rpmDigestFinal(/*@only@*/ /*@null@*/ DIGEST_CTX ctx,
/*@null@*/ /*@out@*/ void * datap, /*@null@*/ /*@out@*/ void * datap,
/*@null@*/ /*@out@*/ size_t * lenp, int asAscii) /*@null@*/ /*@out@*/ size_t * lenp, int asAscii)
/*@modifies *datap, *lenp @*/; /*@modifies *datap, *lenp @*/;
/** \ingroup rpmpgp
*
* Compute key material and add to digest context.
* @param ctx digest context
* @param key HMAC key (NULL does digest instead)
* @param keylen HMAC key length(bytes) (0 uses strlen(key))
* @return 0 on success
*/
int rpmHmacInit(DIGEST_CTX ctx, const void * key, size_t keylen)
/*@*/;
/** \ingroup rpmio /** \ingroup rpmio
*/ */
typedef void * (*rpmCallbackFunction) typedef void * (*rpmCallbackFunction)
(/*@null@*/ const void * h, (/*@null@*/ const void * h,
const rpmCallbackType what, const rpmCallbackType what,
const rpmuint64_t amount, const rpmuint64_t amount,
const rpmuint64_t total, const rpmuint64_t total,
/*@null@*/ fnpyKey key, /*@null@*/ fnpyKey key,
/*@null@*/ rpmCallbackData data) /*@null@*/ rpmCallbackData data)
/*@globals internalState@*/ /*@globals internalState@*/
skipping to change at line 471 skipping to change at line 598
* @param s string * @param s string
* @param nl append NL? * @param nl append NL?
* @return I/O buffer * @return I/O buffer
*/ */
rpmiob rpmiobAppend(/*@returned@*/ rpmiob iob, const char * s, size_t nl) rpmiob rpmiobAppend(/*@returned@*/ rpmiob iob, const char * s, size_t nl)
/*@modifies iob @*/; /*@modifies iob @*/;
/** /**
* Return I/O buffer. * Return I/O buffer.
* @param iob I/O buffer * @param iob I/O buffer
* @return I/O buffer (as string) * @return I/O buffer (as octets)
*/ */
rpmuint8_t * rpmiobBuf(rpmiob iob) rpmuint8_t * rpmiobBuf(rpmiob iob)
/*@*/; /*@*/;
/** /**
* Return I/O buffer (as string). * Return I/O buffer (as string).
* @param iob I/O buffer * @param iob I/O buffer
* @return I/O buffer (as string) * @return I/O buffer (as string)
*/ */
char * rpmiobStr(rpmiob iob) char * rpmiobStr(rpmiob iob)
skipping to change at line 504 skipping to change at line 631
* Read an entire file into a buffer. * Read an entire file into a buffer.
* @param fn file name to read * @param fn file name to read
* @retval *iobp I/O buffer * @retval *iobp I/O buffer
* @return 0 on success * @return 0 on success
*/ */
int rpmiobSlurp(const char * fn, rpmiob * iobp) int rpmiobSlurp(const char * fn, rpmiob * iobp)
/*@globals h_errno, fileSystem, internalState @*/ /*@globals h_errno, fileSystem, internalState @*/
/*@modifies *iobp, fileSystem, internalState @*/; /*@modifies *iobp, fileSystem, internalState @*/;
#endif #endif
/**
* Destroy a rpmioP object.
* @param P parser state
* @return NULL
*/
/*@null@*/
rpmioP rpmioPFree(/*@only@*/ /*@null@*/ rpmioP P)
/*@modifies P @*/;
/**
* Parse next command out of a string incrementally.
* @param *Pptr parser state
* @param str string to parse
* @return RPMRC_OK on success
*/
rpmRC rpmioParse(rpmioP *Pptr, const char * str)
/*@modifies *Pptr @*/;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* _H_RPMIOTYPES_ */ #endif /* _H_RPMIOTYPES_ */
 End of changes. 8 change blocks. 
4 lines changed or deleted 149 lines changed or added


 rpmlog.h   rpmlog.h 
#ifndef H_RPMLOG #ifndef H_RPMLOG
#define H_RPMLOG 1 #define H_RPMLOG 1
/** \ingroup rpmio /** \ingroup rpmio
* \file rpmio/rpmlog.h * \file rpmio/rpmlog.h
* Yet Another syslog(3) API clone. * Yet Another syslog(3) API clone.
*/ */
#include <stdio.h>
#include <stdarg.h> #include <stdarg.h>
/** /**
* RPM Log levels. * RPM Log levels.
* priorities/facilities are encoded into a single 32-bit quantity, where t he * priorities/facilities are encoded into a single 32-bit quantity, where t he
* bottom 3 bits are the priority (0-7) and the top 28 bits are the facilit y * bottom 3 bits are the priority (0-7) and the top 28 bits are the facilit y
* (0-big number). Both the priorities and the facilities map roughly * (0-big number). Both the priorities and the facilities map roughly
* one-to-one to strings in the syslogd(8) source code. This mapping is * one-to-one to strings in the syslogd(8) source code. This mapping is
* included in this file. * included in this file.
* *
 End of changes. 1 change blocks. 
0 lines changed or deleted 1 lines changed or added


 rpmmacro.h   rpmmacro.h 
skipping to change at line 179 skipping to change at line 179
* @param level macro recursion level (0 is entry API) * @param level macro recursion level (0 is entry API)
*/ */
void rpmLoadMacros(/*@null@*/ MacroContext mc, int level) void rpmLoadMacros(/*@null@*/ MacroContext mc, int level)
/*@globals rpmGlobalMacroContext, internalState @*/ /*@globals rpmGlobalMacroContext, internalState @*/
/*@modifies rpmGlobalMacroContext, internalState @*/; /*@modifies rpmGlobalMacroContext, internalState @*/;
/** /**
* Load macro context from a macro file. * Load macro context from a macro file.
* @param mc (unused) * @param mc (unused)
* @param fn macro file name * @param fn macro file name
* @param nesting max load recursion depth, 0 disables.
*/ */
int rpmLoadMacroFile(/*@null@*/ MacroContext mc, const char * fn) int rpmLoadMacroFile(/*@null@*/ MacroContext mc, const char * fn, int nesti ng)
/*@globals rpmGlobalMacroContext, /*@globals rpmGlobalMacroContext,
h_errno, fileSystem, internalState @*/ h_errno, fileSystem, internalState @*/
/*@modifies mc, rpmGlobalMacroContext, fileSystem, internalState @*/ ; /*@modifies mc, rpmGlobalMacroContext, fileSystem, internalState @*/ ;
/** /**
* Initialize macro context from set of macrofile(s). * Initialize macro context from set of macrofile(s).
* @param mc macro context * @param mc macro context
* @param macrofiles colon separated list of macro files (NULL does nothi ng) * @param macrofiles colon separated list of macro files (NULL does nothi ng)
*/ */
void rpmInitMacros(/*@null@*/ MacroContext mc, const char * macrofiles) void rpmInitMacros(/*@null@*/ MacroContext mc, const char * macrofiles)
skipping to change at line 252 skipping to change at line 253
char * rpmMCExpand(/*@null@*/ MacroContext mc, /*@null@*/ const char * arg, ...) char * rpmMCExpand(/*@null@*/ MacroContext mc, /*@null@*/ const char * arg, ...)
#if defined(__GNUC__) && __GNUC__ >= 4 #if defined(__GNUC__) && __GNUC__ >= 4
/* issue a warning if the list is not NULL-terminated */ /* issue a warning if the list is not NULL-terminated */
__attribute__((sentinel)) __attribute__((sentinel))
#endif #endif
/*@globals rpmGlobalMacroContext, h_errno, internalState @*/ /*@globals rpmGlobalMacroContext, h_errno, internalState @*/
/*@modifies rpmGlobalMacroContext, internalState @*/; /*@modifies rpmGlobalMacroContext, internalState @*/;
/** /**
* Canonicalize file path. * Canonicalize file path.
* @note Path canonicalization always removes the pesky trailing '/'.
* @param path path to canonicalize (in-place) * @param path path to canonicalize (in-place)
* @return pointer to path * @return pointer to path
*/ */
/*@null@*/ /*@null@*/
char * rpmCleanPath(/*@returned@*/ /*@null@*/ char * path) char * rpmCleanPath(/*@returned@*/ /*@null@*/ char * path)
/*@modifies *path @*/; /*@modifies *path @*/;
/** /**
* Return (malloc'ed) expanded, canonicalized, file path. * Return (malloc'ed) expanded, canonicalized, file path.
* @note A final "/" argument will force append a pesky trailing '/'.
* @param path macro(s) to expand (NULL terminates list) * @param path macro(s) to expand (NULL terminates list)
* @return canonicalized path (malloc'ed) * @return canonicalized path (malloc'ed)
*/ */
/*@-redecl@*/ /* LCL: shrug */ /*@-redecl@*/ /* LCL: shrug */
const char * rpmGetPath(/*@null@*/ const char * path, ...) char * rpmGetPath(/*@null@*/ const char * path, ...)
#if defined(__GNUC__) && __GNUC__ >= 4 #if defined(__GNUC__) && __GNUC__ >= 4
/* issue a warning if the list is not NULL-terminated */ /* issue a warning if the list is not NULL-terminated */
__attribute__((sentinel)) __attribute__((sentinel))
#endif #endif
/*@globals rpmGlobalMacroContext, h_errno, internalState @*/ /*@globals rpmGlobalMacroContext, h_errno, internalState @*/
/*@modifies rpmGlobalMacroContext, internalState @*/; /*@modifies rpmGlobalMacroContext, internalState @*/;
/*@=redecl@*/ /*@=redecl@*/
/** /**
* Merge 3 args into path, any or all of which may be a url. * Merge 3 args into path, any or all of which may be a url.
 End of changes. 5 change blocks. 
2 lines changed or deleted 5 lines changed or added


 rpmpgp.h   rpmpgp.h 
skipping to change at line 27 skipping to change at line 27
#if defined(_RPMPGP_INTERNAL) #if defined(_RPMPGP_INTERNAL)
#include <rpmsw.h> #include <rpmsw.h>
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Values parsed from OpenPGP signature/pubkey packet(s). * Values parsed from OpenPGP signature/pubkey packet(s).
*/ */
struct pgpDigParams_s { struct pgpDigParams_s {
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
const char * userid; const char * userid;
/*@only@*/ /*@null@*/ /*@dependent@*/ /*@null@*/
const rpmuint8_t * hash; const rpmuint8_t * hash;
const char * params[4];
rpmuint8_t tag; rpmuint8_t tag;
rpmuint8_t version; /*!< version number. */ rpmuint8_t version; /*!< version number. */
rpmuint8_t time[4]; /*!< time that the key was created. */ rpmuint8_t time[4]; /*!< time created. */
rpmuint8_t pubkey_algo; /*!< public key algorithm. */ rpmuint8_t pubkey_algo; /*!< public key algorithm. */
rpmuint8_t hash_algo; rpmuint8_t hash_algo;
rpmuint8_t sigtype; rpmuint8_t sigtype;
size_t hashlen; size_t hashlen;
rpmuint8_t signhash16[2]; rpmuint8_t signhash16[2];
rpmuint8_t signid[8]; rpmuint8_t signid[8];
rpmuint8_t expire[4]; /*!< signature expired after seconds). */
rpmuint8_t keyexpire[4]; /*!< key expired after seconds). */
rpmuint8_t saved; rpmuint8_t saved;
#define PGPDIG_SAVED_TIME (1 << 0) #define PGPDIG_SAVED_TIME (1 << 0)
#define PGPDIG_SAVED_ID (1 << 1) #define PGPDIG_SAVED_ID (1 << 1)
}; };
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Container for values parsed from an OpenPGP signature and public key. * Container for values parsed from an OpenPGP signature and public key.
*/ */
struct pgpDig_s { struct pgpDig_s {
skipping to change at line 96 skipping to change at line 98
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
void * md5; /*!< (rsa) V3 signature hash. */ void * md5; /*!< (rsa) V3 signature hash. */
size_t md5len; /*!< (rsa) V3 signature hash length. */ size_t md5len; /*!< (rsa) V3 signature hash length. */
/*@owned@*/ /*@relnull@*/ /*@owned@*/ /*@relnull@*/
void * impl; /*!< Implementation data */ void * impl; /*!< Implementation data */
#if defined(__LCLINT__) #if defined(__LCLINT__)
/*@refs@*/ /*@refs@*/
int nrefs; /*!< (unused) keep splint happy */ int nrefs; /*!< (unused) keep splint happy */
#endif #endif
}; };
#endif #endif /* _RPMPGP_INTERNAL */
/** /**
*/ */
typedef const struct pgpValTbl_s { typedef const struct pgpValTbl_s {
int val; int val;
/*@observer@*/ /*@observer@*/
const char * str; const char * str;
} * pgpValTbl; } * pgpValTbl;
/** \ingroup rpmpgp /** \ingroup rpmpgp
skipping to change at line 204 skipping to change at line 206
PGPSIGTYPE_STANDALONE = 0x02, /*!< Standalone */ PGPSIGTYPE_STANDALONE = 0x02, /*!< Standalone */
PGPSIGTYPE_GENERIC_CERT = 0x10, PGPSIGTYPE_GENERIC_CERT = 0x10,
/*!< Generic certification of a User ID & Public Key */ /*!< Generic certification of a User ID & Public Key */
PGPSIGTYPE_PERSONA_CERT = 0x11, PGPSIGTYPE_PERSONA_CERT = 0x11,
/*!< Persona certification of a User ID & Public Key */ /*!< Persona certification of a User ID & Public Key */
PGPSIGTYPE_CASUAL_CERT = 0x12, PGPSIGTYPE_CASUAL_CERT = 0x12,
/*!< Casual certification of a User ID & Public Key */ /*!< Casual certification of a User ID & Public Key */
PGPSIGTYPE_POSITIVE_CERT = 0x13, PGPSIGTYPE_POSITIVE_CERT = 0x13,
/*!< Positive certification of a User ID & Public Key */ /*!< Positive certification of a User ID & Public Key */
PGPSIGTYPE_SUBKEY_BINDING = 0x18, /*!< Subkey Binding */ PGPSIGTYPE_SUBKEY_BINDING = 0x18, /*!< Subkey Binding */
PGPSIGTYPE_KEY_BINDING = 0x19, /*!< Primary key Binding */
PGPSIGTYPE_SIGNED_KEY = 0x1F, /*!< Signature directly on a key */ PGPSIGTYPE_SIGNED_KEY = 0x1F, /*!< Signature directly on a key */
PGPSIGTYPE_KEY_REVOKE = 0x20, /*!< Key revocation */ PGPSIGTYPE_KEY_REVOKE = 0x20, /*!< Key revocation */
PGPSIGTYPE_SUBKEY_REVOKE = 0x28, /*!< Subkey revocation */ PGPSIGTYPE_SUBKEY_REVOKE = 0x28, /*!< Subkey revocation */
PGPSIGTYPE_CERT_REVOKE = 0x30, /*!< Certification revocation */ PGPSIGTYPE_CERT_REVOKE = 0x30, /*!< Certification revocation */
PGPSIGTYPE_TIMESTAMP = 0x40, /*!< Timestamp */ PGPSIGTYPE_TIMESTAMP = 0x40, /*!< Timestamp */
PGPSIGTYPE_CONFIRM = 0x50 /*!< Third-Party confirmation */ PGPSIGTYPE_CONFIRM = 0x50 /*!< Third-Party confirmation */
} pgpSigType; } pgpSigType;
/*@=typeuse@*/ /*@=typeuse@*/
/** \ingroup rpmpgp /** \ingroup rpmpgp
*/ */
/*@observer@*/ /*@unchecked@*/ /*@unused@*/ /*@observer@*/ /*@unchecked@*/ /*@unused@*/
extern struct pgpValTbl_s pgpSigTypeTbl[]; extern struct pgpValTbl_s pgpSigTypeTbl[];
/** \ingroup rpmpgp /** \ingroup rpmpgp
skipping to change at line 251 skipping to change at line 254
/*@-typeuse@*/ /*@-typeuse@*/
typedef enum pgpPubkeyAlgo_e { typedef enum pgpPubkeyAlgo_e {
PGPPUBKEYALGO_RSA = 1, /*!< RSA */ PGPPUBKEYALGO_RSA = 1, /*!< RSA */
PGPPUBKEYALGO_RSA_ENCRYPT = 2, /*!< RSA(Encrypt-Only) */ PGPPUBKEYALGO_RSA_ENCRYPT = 2, /*!< RSA(Encrypt-Only) */
PGPPUBKEYALGO_RSA_SIGN = 3, /*!< RSA(Sign-Only) */ PGPPUBKEYALGO_RSA_SIGN = 3, /*!< RSA(Sign-Only) */
PGPPUBKEYALGO_ELGAMAL_ENCRYPT = 16, /*!< Elgamal(Encrypt-Only) * / PGPPUBKEYALGO_ELGAMAL_ENCRYPT = 16, /*!< Elgamal(Encrypt-Only) * /
PGPPUBKEYALGO_DSA = 17, /*!< DSA */ PGPPUBKEYALGO_DSA = 17, /*!< DSA */
PGPPUBKEYALGO_EC = 18, /*!< Elliptic Curve */ PGPPUBKEYALGO_EC = 18, /*!< Elliptic Curve */
PGPPUBKEYALGO_ECDSA = 19, /*!< ECDSA */ PGPPUBKEYALGO_ECDSA = 19, /*!< ECDSA */
PGPPUBKEYALGO_ELGAMAL = 20, /*!< Elgamal */ PGPPUBKEYALGO_ELGAMAL = 20, /*!< Elgamal */
PGPPUBKEYALGO_DH = 21 /*!< Diffie-Hellman (X9.42) */ PGPPUBKEYALGO_DH = 21, /*!< Diffie-Hellman (X9.42) */
PGPPUBKEYALGO_ECDH = 22 /*!< ECC Diffie-Hellman */
} pgpPubkeyAlgo; } pgpPubkeyAlgo;
/*@=typeuse@*/ /*@=typeuse@*/
/** \ingroup rpmpgp /** \ingroup rpmpgp
*/ */
/*@observer@*/ /*@unchecked@*/ /*@unused@*/ /*@observer@*/ /*@unchecked@*/ /*@unused@*/
extern struct pgpValTbl_s pgpPubkeyTbl[]; extern struct pgpValTbl_s pgpPubkeyTbl[];
/** \ingroup rpmpgp /** \ingroup rpmpgp
* 9.2. Symmetric Key Algorithms * 9.2. Symmetric Key Algorithms
skipping to change at line 298 skipping to change at line 302
PGPSYMKEYALGO_IDEA = 1, /*!< IDEA */ PGPSYMKEYALGO_IDEA = 1, /*!< IDEA */
PGPSYMKEYALGO_TRIPLE_DES = 2, /*!< 3DES */ PGPSYMKEYALGO_TRIPLE_DES = 2, /*!< 3DES */
PGPSYMKEYALGO_CAST5 = 3, /*!< CAST5 */ PGPSYMKEYALGO_CAST5 = 3, /*!< CAST5 */
PGPSYMKEYALGO_BLOWFISH = 4, /*!< BLOWFISH */ PGPSYMKEYALGO_BLOWFISH = 4, /*!< BLOWFISH */
PGPSYMKEYALGO_SAFER = 5, /*!< SAFER */ PGPSYMKEYALGO_SAFER = 5, /*!< SAFER */
PGPSYMKEYALGO_DES_SK = 6, /*!< DES/SK */ PGPSYMKEYALGO_DES_SK = 6, /*!< DES/SK */
PGPSYMKEYALGO_AES_128 = 7, /*!< AES(128-bit key) */ PGPSYMKEYALGO_AES_128 = 7, /*!< AES(128-bit key) */
PGPSYMKEYALGO_AES_192 = 8, /*!< AES(192-bit key) */ PGPSYMKEYALGO_AES_192 = 8, /*!< AES(192-bit key) */
PGPSYMKEYALGO_AES_256 = 9, /*!< AES(256-bit key) */ PGPSYMKEYALGO_AES_256 = 9, /*!< AES(256-bit key) */
PGPSYMKEYALGO_TWOFISH = 10, /*!< TWOFISH(256-bit key) */ PGPSYMKEYALGO_TWOFISH = 10, /*!< TWOFISH(256-bit key) */
PGPSYMKEYALGO_CAMELLIA_128 = 11, /*!< CAMELLIA(128-bit key) */
PGPSYMKEYALGO_CAMELLIA_192 = 12, /*!< CAMELLIA(192-bit key) */
PGPSYMKEYALGO_CAMELLIA_256 = 13, /*!< CAMELLIA(256-bit key) */
PGPSYMKEYALGO_NOENCRYPT = 110 /*!< no encryption */ PGPSYMKEYALGO_NOENCRYPT = 110 /*!< no encryption */
} pgpSymkeyAlgo; } pgpSymkeyAlgo;
/*@=typeuse@*/ /*@=typeuse@*/
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Symmetric key (string, value) pairs. * Symmetric key (string, value) pairs.
*/ */
/*@observer@*/ /*@unchecked@*/ /*@unused@*/ /*@observer@*/ /*@unchecked@*/ /*@unused@*/
extern struct pgpValTbl_s pgpSymkeyTbl[]; extern struct pgpValTbl_s pgpSymkeyTbl[];
skipping to change at line 968 skipping to change at line 975
* The packet length in the header specifies the length of the user id. * The packet length in the header specifies the length of the user id.
* If it is text, it is encoded in UTF-8. * If it is text, it is encoded in UTF-8.
* *
*/ */
typedef struct pgpPktUid_s { typedef struct pgpPktUid_s {
rpmuint8_t userid[1]; rpmuint8_t userid[1];
} pgpPktUid; } pgpPktUid;
/** \ingroup rpmpgp /** \ingroup rpmpgp
*/ */
union pgpPktPre_u {
pgpPktPubkey pubkey; /*!< 5.1. Public-Key Encrypted Session Key *
/
pgpPktSig sig; /*!< 5.2. Signature */
pgpPktSymkey symkey; /*!< 5.3. Symmetric-Key Encrypted Session-Ke
y */
pgpPktOnepass onepass; /*!< 5.4. One-Pass Signature */
pgpPktKey key; /*!< 5.5. Key Material */
pgpPktCdata cdata; /*!< 5.6. Compressed Data */
pgpPktEdata edata; /*!< 5.7. Symmetrically Encrypted Data */
/*!< 5.8. Marker (obsolete) */
pgpPktLdata ldata; /*!< 5.9. Literal Data */
pgpPktTrust tdata; /*!< 5.10. Trust */
pgpPktUid uid; /*!< 5.11. User ID */
};
/** \ingroup rpmpgp
*/
/*@-typeuse@*/ /*@-typeuse@*/
typedef enum pgpArmor_e { typedef enum pgpArmor_e {
PGPARMOR_ERR_CRC_CHECK = -7, PGPARMOR_ERR_CRC_CHECK = -7,
PGPARMOR_ERR_BODY_DECODE = -6, PGPARMOR_ERR_BODY_DECODE = -6,
PGPARMOR_ERR_CRC_DECODE = -5, PGPARMOR_ERR_CRC_DECODE = -5,
PGPARMOR_ERR_NO_END_PGP = -4, PGPARMOR_ERR_NO_END_PGP = -4,
PGPARMOR_ERR_UNKNOWN_PREAMBLE_TAG = -3, PGPARMOR_ERR_UNKNOWN_PREAMBLE_TAG = -3,
PGPARMOR_ERR_UNKNOWN_ARMOR_TYPE = -2, PGPARMOR_ERR_UNKNOWN_ARMOR_TYPE = -2,
PGPARMOR_ERR_NO_BEGIN_PGP = -1, PGPARMOR_ERR_NO_BEGIN_PGP = -1,
#define PGPARMOR_ERROR PGPARMOR_ERR_NO_BEGIN_PGP #define PGPARMOR_ERROR PGPARMOR_ERR_NO_BEGIN_PGP
skipping to change at line 1029 skipping to change at line 1020
PGPARMORKEY_CHARSET = 5 /*!< Charset: */ PGPARMORKEY_CHARSET = 5 /*!< Charset: */
} pgpArmorKey; } pgpArmorKey;
/*@=typeuse@*/ /*@=typeuse@*/
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Armor key (string, value) pairs. * Armor key (string, value) pairs.
*/ */
/*@observer@*/ /*@unchecked@*/ /*@unused@*/ /*@observer@*/ /*@unchecked@*/ /*@unused@*/
extern struct pgpValTbl_s pgpArmorKeyTbl[]; extern struct pgpValTbl_s pgpArmorKeyTbl[];
#if defined(_RPMPGP_INTERNAL)
/** \ingroup rpmpgp
*/
union pgpPktPre_u {
pgpPktPubkey pubkey; /*!< 5.1. Public-Key Encrypted Session Key *
/
pgpPktSig sig; /*!< 5.2. Signature */
pgpPktSymkey symkey; /*!< 5.3. Symmetric-Key Encrypted Session-Ke
y */
pgpPktOnepass onepass; /*!< 5.4. One-Pass Signature */
pgpPktKey key; /*!< 5.5. Key Material */
pgpPktCdata cdata; /*!< 5.6. Compressed Data */
pgpPktEdata edata; /*!< 5.7. Symmetrically Encrypted Data */
/*!< 5.8. Marker (obsolete) */
pgpPktLdata ldata; /*!< 5.9. Literal Data */
pgpPktTrust tdata; /*!< 5.10. Trust */
pgpPktUid uid; /*!< 5.11. User ID */
};
struct pgpPkt_s {
pgpTag tag;
unsigned int pktlen;
union {
const rpmuint8_t * h;
const pgpPktKeyV3 j;
const pgpPktKeyV4 k;
const pgpPktSigV3 r;
const pgpPktSigV4 s;
const pgpPktUid * u;
} u;
unsigned int hlen;
};
#endif /* _RPMPGP_INTERNAL */
/*@-fcnuse@*/ /*@-fcnuse@*/
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Return (native-endian) integer from big-endian representation. * Return (native-endian) integer from big-endian representation.
* @param s pointer to big-endian integer * @param s pointer to big-endian integer
* @param nbytes no. of bytes * @param nbytes no. of bytes
* @return native-endian integer * @return native-endian integer
skipping to change at line 1212 skipping to change at line 1235
/*@modifies fileSystem @*/; /*@modifies fileSystem @*/;
/*@=exportlocal@*/ /*@=exportlocal@*/
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Print/parse an OpenPGP subtype packet. * Print/parse an OpenPGP subtype packet.
* @param h packet * @param h packet
* @param hlen packet length (no. of bytes) * @param hlen packet length (no. of bytes)
* @param sigtype signature type * @param sigtype signature type
* @return 0 on success * @return 0 on success
*/ */
#if defined(_RPMPGP_INTERNAL)
/*@-exportlocal@*/ /*@-exportlocal@*/
int pgpPrtSubType(const rpmuint8_t * h, size_t hlen, pgpSigType sigtype) int pgpPrtSubType(const rpmuint8_t * h, size_t hlen, pgpSigType sigtype)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies fileSystem @*/; /*@modifies fileSystem @*/;
/*@=exportlocal@*/ /*@=exportlocal@*/
#endif
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Print/parse an OpenPGP signature packet. * Print/parse an OpenPGP signature packet.
* @param pp packet tag/ptr/len * @param pp packet tag/ptr/len
* @return 0 on success * @return 0 on success
*/ */
#if defined(_RPMPGP_INTERNAL)
/*@-exportlocal@*/ /*@-exportlocal@*/
int pgpPrtSig(const pgpPkt pp) int pgpPrtSig(const pgpPkt pp)
/*@globals fileSystem, internalState @*/ /*@globals fileSystem, internalState @*/
/*@modifies fileSystem, internalState @*/; /*@modifies fileSystem, internalState @*/;
int pgpPrtSigParams(pgpDig dig, const pgpPkt pp, pgpPubkeyAlgo pubkey_algo,
pgpSigType sigtype, const rpmuint8_t * p)
/*@globals fileSystem @*/
/*@modifies fileSystem @*/;
const rpmuint8_t * pgpPrtPubkeyParams(pgpDig dig, const pgpPkt pp,
pgpPubkeyAlgo pubkey_algo, /*@returned@*/ const rpmuint8_t
* p)
/*@globals fileSystem, internalState @*/
/*@modifies fileSystem, internalState @*/;
/*@=exportlocal@*/ /*@=exportlocal@*/
#endif
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Print/parse an OpenPGP key packet. * Print/parse an OpenPGP key packet.
* @param pp packet tag/ptr/len * @param pp packet tag/ptr/len
* @return 0 on success * @return 0 on success
*/ */
#if defined(_RPMPGP_INTERNAL)
int pgpPrtKey(const pgpPkt pp) int pgpPrtKey(const pgpPkt pp)
/*@globals fileSystem, internalState @*/ /*@globals fileSystem, internalState @*/
/*@modifies fileSystem, internalState @*/; /*@modifies fileSystem, internalState @*/;
#endif
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Print/parse an OpenPGP userid packet. * Print/parse an OpenPGP userid packet.
* @param pp packet tag/ptr/len * @param pp packet tag/ptr/len
* @return 0 on success * @return 0 on success
*/ */
#if defined(_RPMPGP_INTERNAL)
/*@-exportlocal@*/ /*@-exportlocal@*/
int pgpPrtUserID(const pgpPkt pp) int pgpPrtUserID(const pgpPkt pp)
/*@globals fileSystem, internalState @*/ /*@globals fileSystem, internalState @*/
/*@modifies fileSystem, internalState @*/; /*@modifies fileSystem, internalState @*/;
/*@=exportlocal@*/ /*@=exportlocal@*/
#endif
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Print/parse an OpenPGP comment packet. * Print/parse an OpenPGP comment packet.
* @param pp packet tag/ptr/len * @param pp packet tag/ptr/len
* @return 0 on success * @return 0 on success
*/ */
#if defined(_RPMPGP_INTERNAL)
/*@-exportlocal@*/ /*@-exportlocal@*/
int pgpPrtComment(const pgpPkt pp) int pgpPrtComment(const pgpPkt pp)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies fileSystem @*/; /*@modifies fileSystem @*/;
/*@=exportlocal@*/ /*@=exportlocal@*/
#endif
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Calculate OpenPGP public key fingerprint. * Calculate OpenPGP public key fingerprint.
* @todo V3 non-RSA public keys not implemented. * @todo V3 non-RSA public keys not implemented.
* @param pkt OpenPGP packet (i.e. PGPTAG_PUBLIC_KEY) * @param pkt OpenPGP packet (i.e. PGPTAG_PUBLIC_KEY)
* @param pktlen OpenPGP packet length (no. of bytes) * @param pktlen OpenPGP packet length (no. of bytes)
* @retval keyid publick key fingerprint * @retval keyid publick key fingerprint
* @return 0 on sucess, else -1 * @return 0 on sucess, else -1
*/ */
/*@-exportlocal@*/ /*@-exportlocal@*/
skipping to change at line 1292 skipping to change at line 1336
/*@out@*/ rpmuint8_t * keyid) /*@out@*/ rpmuint8_t * keyid)
/*@modifies *keyid @*/; /*@modifies *keyid @*/;
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Return lenth of a OpenPGP packet. * Return lenth of a OpenPGP packet.
* @param pkt OpenPGP packet (i.e. PGPTAG_PUBLIC_KEY) * @param pkt OpenPGP packet (i.e. PGPTAG_PUBLIC_KEY)
* @param pleft OpenPGP packet length (no. of bytes) * @param pleft OpenPGP packet length (no. of bytes)
* @retval pp packet tag/ptr/len * @retval pp packet tag/ptr/len
* @return packet length, <0 on error. * @return packet length, <0 on error.
*/ */
#if defined(_RPMPGP_INTERNAL)
int pgpPktLen(const rpmuint8_t * pkt, size_t pleft, /*@out@*/ pgpPkt pp) int pgpPktLen(const rpmuint8_t * pkt, size_t pleft, /*@out@*/ pgpPkt pp)
/*@modifies pp @*/; /*@modifies pp @*/;
#endif
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Print/parse next OpenPGP packet. * Print/parse next OpenPGP packet.
* @param pkt OpenPGP packet * @param pkt OpenPGP packet
* @param pleft no. bytes remaining * @param pleft no. bytes remaining
* @return -1 on error, otherwise this packet length * @return -1 on error, otherwise this packet length
*/ */
/*@-exportlocal@*/ /*@-exportlocal@*/
int pgpPrtPkt(const rpmuint8_t * pkt, size_t pleft) int pgpPrtPkt(const rpmuint8_t * pkt, size_t pleft)
/*@globals fileSystem, internalState @*/ /*@globals fileSystem, internalState @*/
/*@modifies fileSystem, internalState @*/; /*@modifies fileSystem, internalState @*/;
/*@=exportlocal@*/ /*@=exportlocal@*/
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Return array of packet pointers.
* @param pkts OpenPGP packet(s)
* @param pktlen OpenPGP packet(s) length (no. of bytes)
* @retval *pppkts array of packet pointers
* @retval *pnpkts no. of packets
* @return 0 on success, <0 on error
*/
int pgpGrabPkts(const rpmuint8_t * pkts, size_t pktlen,
/*@out@*/ rpmuint8_t *** pppkts, /*@out@*/ int * pnpkts)
/*@modifies *pppkts, *pnpkts @*/;
/** \ingroup rpmpgp
* Print/parse a OpenPGP packet(s). * Print/parse a OpenPGP packet(s).
* @param pkts OpenPGP packet(s) * @param pkts OpenPGP packet(s)
* @param pktlen OpenPGP packet(s) length (no. of bytes) * @param pktlen OpenPGP packet(s) length (no. of bytes)
* @retval dig parsed output of signature/pubkey packet parameters * @retval dig parsed output of signature/pubkey packet parameters
* @param printing should packets be printed? * @param printing should packets be printed?
* @return -1 on error, 0 on success * @return -1 on error, 0 on success
*/ */
int pgpPrtPkts(const rpmuint8_t * pkts, size_t pktlen, pgpDig dig, int prin ting) int pgpPrtPkts(const rpmuint8_t * pkts, size_t pktlen, pgpDig dig, int prin ting)
/*@globals fileSystem, internalState @*/ /*@globals fileSystem, internalState @*/
/*@modifies dig, fileSystem, internalState @*/; /*@modifies dig, fileSystem, internalState @*/;
skipping to change at line 1359 skipping to change at line 1417
/** /**
* Disabler bits(s) for signature/digest checking. * Disabler bits(s) for signature/digest checking.
*/ */
/*@unchecked@*/ /*@unchecked@*/
extern pgpVSFlags pgpDigVSFlags; extern pgpVSFlags pgpDigVSFlags;
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Unreference a signature parameters instance. * Unreference a signature parameters instance.
* @param dig signature parameters * @param dig signature parameters
* @param msg
* @return NULL on last dereference * @return NULL on last dereference
*/ */
/*@unused@*/ /*@null@*/ /*@unused@*/ /*@null@*/
pgpDig pgpDigUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ pgpDig dig, pgpDig pgpDigUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ pgpDig dig)
/*@null@*/ const char * msg)
/*@modifies dig @*/; /*@modifies dig @*/;
#define pgpDigUnlink(_dig, _msg) \ #define pgpDigUnlink(_dig) \
((pgpDig)rpmioUnlinkPoolItem((rpmioItem)(_dig), _msg, __FILE__, __LINE_ ((pgpDig)rpmioUnlinkPoolItem((rpmioItem)(_dig), __FUNCTION__, __FILE__,
_)) __LINE__))
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Reference a signature parameters instance. * Reference a signature parameters instance.
* @param dig signature parameters * @param dig signature parameters
* @param msg
* @return new signature parameters reference * @return new signature parameters reference
*/ */
/*@unused@*/ /*@newref@*/ /*@null@*/ /*@unused@*/ /*@newref@*/ /*@null@*/
pgpDig pgpDigLink (/*@null@*/ pgpDig dig, /*@null@*/ const char * msg) pgpDig pgpDigLink (/*@null@*/ pgpDig dig)
/*@modifies dig @*/; /*@modifies dig @*/;
#define pgpDigLink(_dig, _msg) \ #define pgpDigLink(_dig) \
((pgpDig)rpmioLinkPoolItem((rpmioItem)(_dig), _msg, __FILE__, __LINE__) ((pgpDig)rpmioLinkPoolItem((rpmioItem)(_dig), __FUNCTION__, __FILE__, _
) _LINE__))
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Destroy a container for parsed OpenPGP packates. * Destroy a container for parsed OpenPGP packates.
* @param dig signature parameters container * @param dig signature parameters container
* @return NULL on last dereference * @return NULL on last dereference
*/ */
/*@unused@*/ /*@null@*/ /*@unused@*/ /*@null@*/
pgpDig pgpDigFree(/*@killref@*/ /*@only@*/ /*@null@*/ pgpDig dig) pgpDig pgpDigFree(/*@killref@*/ /*@only@*/ /*@null@*/ pgpDig dig)
/*@modifies dig @*/; /*@modifies dig @*/;
#define pgpDigFree(_dig, _msg) \ #define pgpDigFree(_dig) \
((pgpDig)rpmioFreePoolItem((rpmioItem)(_dig), _msg, __FILE__, __LINE__) ((pgpDig)rpmioFreePoolItem((rpmioItem)(_dig), __FUNCTION__, __FILE__, _
) _LINE__))
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Create a container for parsed OpenPGP packates. * Create a container for parsed OpenPGP packates.
* @return container * @return container
*/ */
/*@relnull@*/ /*@relnull@*/
pgpDig pgpDigNew(/*@unused@*/ pgpVSFlags vsflags) pgpDig pgpDigNew(/*@unused@*/ pgpVSFlags vsflags)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies fileSystem @*/; /*@modifies fileSystem @*/;
 End of changes. 32 change blocks. 
38 lines changed or deleted 94 lines changed or added


 rpmps.h   rpmps.h 
skipping to change at line 146 skipping to change at line 146
* @param msg * @param msg
* @return new transaction set reference * @return new transaction set reference
*/ */
/*@unused@*/ /*@newref@*/ /*@unused@*/ /*@newref@*/
rpmps rpmpsLink (rpmps ps, const char * msg) rpmps rpmpsLink (rpmps ps, const char * msg)
/*@modifies ps @*/; /*@modifies ps @*/;
#define rpmpsLink(_ps, _msg) \ #define rpmpsLink(_ps, _msg) \
((rpmps)rpmioLinkPoolItem((rpmioItem)(_ps), _msg, __FILE__, __LINE__ )) ((rpmps)rpmioLinkPoolItem((rpmioItem)(_ps), _msg, __FILE__, __LINE__ ))
/** /**
* Destroy a problem set.
* @param ps problem set
* @return NULL on last dereference
*/
/*@null@*/
rpmps rpmpsFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmps ps)
/*@modifies ps @*/;
#define rpmpsFree(_ps) \
((rpmps)rpmioFreePoolItem((rpmioItem)(_ps), __FUNCTION__, __FILE__,
__LINE__))
/**
* Return number of problems in set. * Return number of problems in set.
* @param ps problem set * @param ps problem set
* @return number of problems * @return number of problems
*/ */
int rpmpsNumProblems(/*@null@*/ rpmps ps) int rpmpsNumProblems(/*@null@*/ rpmps ps)
/*@*/; /*@*/;
/** /**
* Initialize problem set iterator. * Initialize problem set iterator.
* @param ps problem set * @param ps problem set
skipping to change at line 194 skipping to change at line 205
/*@*/; /*@*/;
/** /**
* Create a problem set. * Create a problem set.
* @return new problem set * @return new problem set
*/ */
rpmps rpmpsCreate(void) rpmps rpmpsCreate(void)
/*@*/; /*@*/;
/** /**
* Destroy a problem set.
* @param ps problem set
* @return NULL on last dereference
*/
/*@null@*/
rpmps rpmpsFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmps ps)
/*@modifies ps @*/;
/**
* Print problems to file handle. * Print problems to file handle.
* @param fp file handle (NULL uses stderr) * @param fp file handle (NULL uses stderr)
* @param ps problem set * @param ps problem set
*/ */
void rpmpsPrint(/*@null@*/ FILE *fp, /*@null@*/ rpmps ps) void rpmpsPrint(/*@null@*/ FILE *fp, /*@null@*/ rpmps ps)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies *fp, ps, fileSystem @*/; /*@modifies *fp, ps, fileSystem @*/;
/** /**
* Append a problem to current set of problems. * Append a problem to current set of problems.
 End of changes. 2 change blocks. 
9 lines changed or deleted 12 lines changed or added


 rpmspec.h   rpmspec.h 
#ifndef _H_RPMSPEC_ #ifndef _H_RPMSPEC_
#define _H_RPMSPEC_ #define _H_RPMSPEC_
/** \ingroup rpmbuild /** \ingroup rpmbuild
* \file build/rpmspec.h * \file build/rpmspec.h
* The Spec and Package data structures used during build. * The Spec and Package data structures used during build.
*/ */
#include <rpmevr.h> #include <rpmevr.h>
#include <rpmfi.h> /* XXX rpmfi typedef */
#include <rpmcli.h> /* XXX QVA_t typedef */
/** \ingroup rpmbuild /** \ingroup rpmbuild
*/ */
typedef struct Package_s * Package; typedef /*@abstract@*/ /*@refcounted@*/ struct Package_s * Package;
/** \ingroup rpmbuild /** \ingroup rpmbuild
*/ */
typedef struct Source * SpecSource; typedef struct Source * SpecSource;
/** \ingroup rpmbuild /** \ingroup rpmbuild
*/ */
struct TriggerFileEntry { struct TriggerFileEntry {
int index; int index;
/*@only@*/ /*@only@*/
skipping to change at line 107 skipping to change at line 109
/*@only@*/ /*@only@*/
char **sl_lines; char **sl_lines;
int sl_nalloc; int sl_nalloc;
int sl_nlines; int sl_nlines;
} * speclines; } * speclines;
/** \ingroup rpmbuild /** \ingroup rpmbuild
* The structure used to store values parsed from a spec file. * The structure used to store values parsed from a spec file.
*/ */
struct Spec_s { struct Spec_s {
struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */
/*@only@*/ /*@only@*/
const char * specFile; /*!< Name of the spec file. */ const char * specFile; /*!< Name of the spec file. */
/*@only@*/ /*@only@*/
const char * buildSubdir; const char * buildSubdir;
/*@only@*/ /*@only@*/
const char * rootURL; const char * rootURL;
/*@owned@*/ /*@null@*/ /*@owned@*/ /*@null@*/
speclines sl; speclines sl;
/*@owned@*/ /*@null@*/ /*@owned@*/ /*@null@*/
skipping to change at line 165 skipping to change at line 168
int numSources; int numSources;
int noSource; int noSource;
/*@only@*/ /*@only@*/
const char * sourceRpmName; const char * sourceRpmName;
/*@only@*/ /*@only@*/
unsigned char * sourcePkgId; unsigned char * sourcePkgId;
/*@refcounted@*/ /*@refcounted@*/
Header sourceHeader; Header sourceHeader;
/*@refcounted@*/ /*@refcounted@*/
rpmfi sourceCpioList; rpmfi fi;
int sourceHdrInit; int sourceHdrInit;
/*@dependent@*/ /*@null@*/ /*@dependent@*/ /*@null@*/
MacroContext macros; MacroContext macros;
rpmRC (*_parseRCPOT) (Spec spec, Package pkg, const char *field, rpmTag tagN, rpmRC (*_parseRCPOT) (Spec spec, Package pkg, const char *field, rpmTag tagN,
rpmuint32_t index, rpmsenseFlags tagflags); rpmuint32_t index, rpmsenseFlags tagflags);
rpmuint32_t sstates[RPMSCRIPT_MAX]; /*!< scriptlet state
s. */
rpmuint32_t smetrics[RPMSCRIPT_MAX]; /*!< scriptlet time metrics.
*/
/*@only@*/ /*@only@*/
rpmiob prep; /*!< %prep scriptlet. */ rpmiob prep; /*!< %prep scriptlet. */
/*@only@*/ /*@only@*/
rpmiob build; /*!< %build scriptlet. */ rpmiob build; /*!< %build scriptlet. */
/*@only@*/ /*@only@*/
rpmiob install; /*!< %install scriptlet. */ rpmiob install; /*!< %install scriptlet. */
/*@only@*/ /*@only@*/
rpmiob check; /*!< %check scriptlet. */ rpmiob check; /*!< %check scriptlet. */
/*@only@*/ /*@only@*/
rpmiob clean; /*!< %clean scriptlet. */ rpmiob clean; /*!< %clean scriptlet. */
size_t nfoo; size_t nfoo;
/*@only@*/ /*@relnull@*/ /*@only@*/ /*@relnull@*/
tagStore_t foo; tagStore_t foo;
/*@owned@*/
Package packages; /*!< Package list. */ Package packages; /*!< Package list. */
#if defined(__LCLINT__)
/*@refs@*/
int nrefs; /*!< (unused) keep splint happy */
#endif
}; };
/** \ingroup rpmbuild /** \ingroup rpmbuild
* The structure used to store values for a package. * The structure used to store values for a package.
*/ */
struct Package_s { struct Package_s {
struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */
/*@refcounted@*/ /*@refcounted@*/
Header header; Header header;
/*@refcounted@*/ /*@refcounted@*/
rpmds ds; /*!< Requires: N = EVR */ rpmds ds; /*!< Requires: N = EVR */
/*@refcounted@*/ /*@refcounted@*/
rpmfi cpioList; rpmfi fi;
int autoReq; int autoReq;
int autoProv; int autoProv;
int noarch; int noarch;
/*@only@*/ /*@only@*/
const char * preInFile; /*!< %pre scriptlet. */ const char * preInFile; /*!< %pre scriptlet. */
/*@only@*/ /*@only@*/
const char * postInFile; /*!< %post scriptlet. */ const char * postInFile; /*!< %post scriptlet. */
/*@only@*/ /*@only@*/
skipping to change at line 236 skipping to change at line 246
rpmiob specialDoc; rpmiob specialDoc;
/*@only@*/ /*@only@*/
struct TriggerFileEntry * triggerFiles; struct TriggerFileEntry * triggerFiles;
/*@only@*/ /*@only@*/
const char * fileFile; const char * fileFile;
/*@only@*/ /*@only@*/
rpmiob fileList; /* If NULL, package will not be written */ rpmiob fileList; /* If NULL, package will not be written */
/*@dependent@*/
Package next; Package next;
#if defined(__LCLINT__)
/*@refs@*/
int nrefs; /*!< (unused) keep splint happy */
#endif
}; };
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** \ingroup rpmbuild /** \ingroup rpmbuild
* Destroy a spec file control structure.
* @todo Rename to specFree.
* @param spec spec file control structure
* @return NULL on last dereference
*/
/*@null@*/
Spec freeSpec(/*@killref@*/ /*@null@*/ Spec spec)
/*@globals fileSystem, internalState @*/
/*@modifies spec, fileSystem, internalState @*/;
#define freeSpec(_spec) \
((Spec)rpmioFreePoolItem((rpmioItem)(_spec), __FUNCTION__, __FILE__, __
LINE__))
/** \ingroup rpmbuild
* Create and initialize Spec structure. * Create and initialize Spec structure.
* @return spec spec file control structure * @return spec spec file control structure
*/ */
/*@only@*/ /*@only@*/
Spec newSpec(void) Spec newSpec(void)
/*@globals rpmGlobalMacroContext, h_errno, internalState @*/ /*@globals rpmGlobalMacroContext, h_errno, internalState @*/
/*@modifies rpmGlobalMacroContext, internalState @*/; /*@modifies rpmGlobalMacroContext, internalState @*/;
/** \ingroup rpmbuild /** \ingroup rpmbuild
* Destroy Spec structure.
* @param spec spec file control structure
* @return NULL always
*/
/*@null@*/
Spec freeSpec(/*@only@*/ /*@null@*/ Spec spec)
/*@globals fileSystem, internalState @*/
/*@modifies spec, fileSystem, internalState @*/;
/** \ingroup rpmbuild
* Function to query spec file(s). * Function to query spec file(s).
* @param ts transaction set * @param ts transaction set
* @param qva parsed query/verify options * @param qva parsed query/verify options
* @param arg query argument * @param arg query argument
* @return 0 on success, else no. of failures * @return 0 on success, else no. of failures
*/ */
int rpmspecQuery(rpmts ts, QVA_t qva, const char * arg) int rpmspecQuery(rpmts ts, QVA_t qva, const char * arg)
/*@globals rpmCLIMacroContext, /*@globals rpmCLIMacroContext,
rpmGlobalMacroContext, h_errno, fileSystem, internalState @* / rpmGlobalMacroContext, h_errno, fileSystem, internalState @* /
/*@modifies ts, qva, rpmCLIMacroContext, rpmGlobalMacroContext, /*@modifies ts, qva, rpmCLIMacroContext, rpmGlobalMacroContext,
 End of changes. 13 change blocks. 
15 lines changed or deleted 34 lines changed or added


 rpmsw.h   rpmsw.h 
skipping to change at line 147 skipping to change at line 147
* @param from operation statistics * @param from operation statistics
* @return cumulative usecs for operation * @return cumulative usecs for operation
*/ */
rpmtime_t rpmswSub(rpmop to, rpmop from) rpmtime_t rpmswSub(rpmop to, rpmop from)
/*@modifies to @*/; /*@modifies to @*/;
/** \ingroup rpmio /** \ingroup rpmio
* Print operation statistics. * Print operation statistics.
* @param name operation name * @param name operation name
* @param op operation statistics * @param op operation statistics
* @param fp file handle (NULL uses stderr)
*/ */
void rpmswPrint(const char * name, /*@null@*/ rpmop op) void rpmswPrint(const char * name, /*@null@*/ rpmop op, /*@null@*/ FILE * f p)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies fileSystem @*/; /*@modifies fp, fileSystem @*/;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* H_RPMSW */ #endif /* H_RPMSW */
 End of changes. 3 change blocks. 
2 lines changed or deleted 3 lines changed or added


 rpmtag.h   rpmtag.h 
skipping to change at line 140 skipping to change at line 140
/** \ingroup header /** \ingroup header
*/ */
typedef /*@abstract@*/ const struct headerSprintfExtension_s * headerSprint fExtension; typedef /*@abstract@*/ const struct headerSprintfExtension_s * headerSprint fExtension;
/** /**
* Pseudo-tags used by the rpmdb and rpmgi iterator API's. * Pseudo-tags used by the rpmdb and rpmgi iterator API's.
*/ */
#define RPMDBI_PACKAGES 0 /* Installed package headers . */ #define RPMDBI_PACKAGES 0 /* Installed package headers . */
#define RPMDBI_DEPENDS 1 /* Dependency resolution cac he. */ #define RPMDBI_DEPENDS 1 /* Dependency resolution cac he. */
#define RPMDBI_LABEL 2 /* Fingerprint search marker . */ /* (obsolete) RPMDBI_LABEL was 2 */
#define RPMDBI_ADDED 3 /* Added package headers. */ #define RPMDBI_ADDED 3 /* Added package headers. */
#define RPMDBI_REMOVED 4 /* Removed package headers. */ #define RPMDBI_REMOVED 4 /* Removed package headers. */
#define RPMDBI_AVAILABLE 5 /* Available package headers . */ #define RPMDBI_AVAILABLE 5 /* Available package headers . */
#define RPMDBI_HDLIST 6 /* (rpmgi) Header list. */ #define RPMDBI_HDLIST 6 /* (rpmgi) Header list. */
#define RPMDBI_ARGLIST 7 /* (rpmgi) Argument list. */ #define RPMDBI_ARGLIST 7 /* (rpmgi) Argument list. */
#define RPMDBI_FTSWALK 8 /* (rpmgi) File tree walk. */ #define RPMDBI_FTSWALK 8 /* (rpmgi) File tree walk. */
#define RPMDBI_SEQNO 9 /* Sequence numbers. */
#define RPMDBI_BTREE 10 /* (development) Generic DB_
BTREE. */
#define RPMDBI_HASH 11 /* (development) Generic DB_
HASH. */
#define RPMDBI_QUEUE 12 /* (development) Generic DB_
QUEUE. */
#define RPMDBI_RECNO 13 /* (development) Generic DB_
RECNO. */
#define RPMDBI_REPACKAGES 14 /* Re-packaged package paths
. */
#define RPMDBI_REPOSITORY 15 /* Repository URI's. */
/** \ingroup header /** \ingroup header
* Tags identify data in package headers. * Tags identify data in package headers.
* @note tags should not have value 0! * @note tags should not have value 0!
*/ */
enum rpmTag_e { enum rpmTag_e {
RPMTAG_HEADERIMAGE = HEADER_IMAGE, /*!< internal Curren t image. */ RPMTAG_HEADERIMAGE = HEADER_IMAGE, /*!< internal Curren t image. */
RPMTAG_HEADERSIGNATURES = HEADER_SIGNATURES, /*!< internal Signat ures. */ RPMTAG_HEADERSIGNATURES = HEADER_SIGNATURES, /*!< internal Signat ures. */
RPMTAG_HEADERIMMUTABLE = HEADER_IMMUTABLE, /*!< x Original imag e. */ RPMTAG_HEADERIMMUTABLE = HEADER_IMMUTABLE, /*!< x Original imag e. */
skipping to change at line 427 skipping to change at line 434
RPMTAG_HEADERSTARTOFF = 1211, /* l */ RPMTAG_HEADERSTARTOFF = 1211, /* l */
RPMTAG_HEADERENDOFF = 1212, /* l */ RPMTAG_HEADERENDOFF = 1212, /* l */
RPMTAG_PACKAGETIME = 1213, /* l */ RPMTAG_PACKAGETIME = 1213, /* l */
RPMTAG_PACKAGESIZE = 1214, /* l */ RPMTAG_PACKAGESIZE = 1214, /* l */
RPMTAG_PACKAGEDIGEST = 1215, /* s */ RPMTAG_PACKAGEDIGEST = 1215, /* s */
RPMTAG_PACKAGESTAT = 1216, /* x */ RPMTAG_PACKAGESTAT = 1216, /* x */
RPMTAG_PACKAGEBASEURL = 1217, /* s */ RPMTAG_PACKAGEBASEURL = 1217, /* s */
RPMTAG_DISTEPOCH = 1218, /* s */ RPMTAG_DISTEPOCH = 1218, /* s */
#define RPMTAG_D RPMTAG_DISTEPOCH /* s */ #define RPMTAG_D RPMTAG_DISTEPOCH /* s */
RPMTAG_FILEDIGESTALGO = 5011, /* i file checksum algorithm */ RPMTAG_CONFLICTYAMLENTRY = 1219, /* s[] */
RPMTAG_OBSOLETEYAMLENTRY = 1220, /* s[] */
RPMTAG_PROVIDEYAMLENTRY = 1221, /* s[] */
RPMTAG_REQUIREYAMLENTRY = 1222, /* s[] */
RPMTAG_FILEDIGESTALGO = 5011, /* i file checksum algorithm */
RPMTAG_BUGURL = 5012, /* s */
/*@-enummemuse@*/ /*@-enummemuse@*/
RPMTAG_FIRSTFREE_TAG, /*!< internal */ RPMTAG_FIRSTFREE_TAG, /*!< internal */
/*@=enummemuse@*/ /*@=enummemuse@*/
RPMTAG_PACKAGETRANSFLAGS = 0x4efaafd9, /* s[] arbitrary */ RPMTAG_PACKAGETRANSFLAGS = 0x4efaafd9, /* s[] arbitrary */
RPMTAG_PACKAGEDEPFLAGS = 0x748a8314, /* s[] arbitrary */ RPMTAG_PACKAGEDEPFLAGS = 0x748a8314, /* s[] arbitrary */
RPMTAG_BUILDPREPPROG = 0x4ba37c9e, /* s[] arbitrary */ RPMTAG_BUILDPREPPROG = 0x4ba37c9e, /* s[] arbitrary */
RPMTAG_BUILDPREP = 0x799c0b4d, /* s[] arbitrary */ RPMTAG_BUILDPREP = 0x799c0b4d, /* s[] arbitrary */
skipping to change at line 1009 skipping to change at line 1022
/** \ingroup header /** \ingroup header
* Store header origin (e.g path or URL). * Store header origin (e.g path or URL).
* @param h header * @param h header
* @param origin new header origin * @param origin new header origin
* @return 0 always * @return 0 always
*/ */
int headerSetOrigin(/*@null@*/ Header h, const char * origin) int headerSetOrigin(/*@null@*/ Header h, const char * origin)
/*@modifies h @*/; /*@modifies h @*/;
/** \ingroup header /** \ingroup header
* Return header parent identifier (e.g parent's NVRA).
* @param h header
* @return header parent
*/
/*@observer@*/ /*@null@*/
const char * headerGetParent(/*@null@*/ Header h)
/*@*/;
/** \ingroup header
* Store header parent (e.g parent's NVRA).
* @param h header
* @param parent new header parent
* @return 0 always
*/
int headerSetParent(/*@null@*/ Header h, const char * parent)
/*@modifies h @*/;
/** \ingroup header
* Return header base URL (e.g path or URL). * Return header base URL (e.g path or URL).
* @param h header * @param h header
* @return header origin * @return header origin
*/ */
/*@observer@*/ /*@null@*/ /*@observer@*/ /*@null@*/
const char * headerGetBaseURL(/*@null@*/ Header h) const char * headerGetBaseURL(/*@null@*/ Header h)
/*@*/; /*@*/;
/** \ingroup header /** \ingroup header
* Store header base URL (e.g path or URL). * Store header base URL (e.g path or URL).
skipping to change at line 1085 skipping to change at line 1116
*/ */
/*@null@*/ /*@null@*/
void * headerSetRpmdb(/*@null@*/ Header h, /*@null@*/ void * rpmdb) void * headerSetRpmdb(/*@null@*/ Header h, /*@null@*/ void * rpmdb)
/*@modifies h @*/; /*@modifies h @*/;
/** \ingroup header /** \ingroup header
* Return header instance (if from rpmdb). * Return header instance (if from rpmdb).
* @param h header * @param h header
* @return header instance * @return header instance
*/ */
rpmuint32_t headerGetInstance(/*@null@*/ Header h) uint32_t headerGetInstance(/*@null@*/ Header h)
/*@*/; /*@*/;
/** \ingroup header /** \ingroup header
* Store header instance (e.g path or URL). * Store header instance (e.g path or URL).
* @param h header * @param h header
* @param instance new header instance * @param instance new header instance
* @return 0 always * @return 0 always
*/ */
rpmuint32_t headerSetInstance(/*@null@*/ Header h, rpmuint32_t instance) uint32_t headerSetInstance(/*@null@*/ Header h, uint32_t instance)
/*@modifies h @*/; /*@modifies h @*/;
/** \ingroup header /** \ingroup header
* Return header starting byte offset. * Return header starting byte offset.
* @param h header * @param h header
* @return header starting byte offset * @return header starting byte offset
*/ */
rpmuint32_t headerGetStartOff(/*@null@*/ Header h) rpmuint32_t headerGetStartOff(/*@null@*/ Header h)
/*@*/; /*@*/;
 End of changes. 6 change blocks. 
4 lines changed or deleted 40 lines changed or added


 rpmte.h   rpmte.h 
#ifndef H_RPMTE #ifndef H_RPMTE
#define H_RPMTE #define H_RPMTE
/** \ingroup rpmts rpmte /** \ingroup rpmts rpmte
* \file lib/rpmte.h * \file lib/rpmte.h
* Structures used for an "rpmte" transaction element. * Structures used for an "rpmte" transaction element.
*/ */
#include <rpmfi.h> #include <rpmfi.h>
#include <rpmal.h> /* XXX alKey */
/** /**
*/ */
/*@-exportlocal@*/ /*@-exportlocal@*/
/*@unchecked@*/ /*@unchecked@*/
extern int _rpmte_debug; extern int _rpmte_debug;
/*@=exportlocal@*/ /*@=exportlocal@*/
/** \ingroup rpmte /** \ingroup rpmte
* Transaction element ordering chain linkage. * Transaction element ordering chain linkage.
skipping to change at line 37 skipping to change at line 38
/** \ingroup rpmte /** \ingroup rpmte
* Transaction element type. * Transaction element type.
*/ */
typedef enum rpmElementType_e { typedef enum rpmElementType_e {
TR_ADDED = (1 << 0), /*!< Package will be installed. */ TR_ADDED = (1 << 0), /*!< Package will be installed. */
TR_REMOVED = (1 << 1) /*!< Package will be removed. */ TR_REMOVED = (1 << 1) /*!< Package will be removed. */
} rpmElementType; } rpmElementType;
#if defined(_RPMTE_INTERNAL) #if defined(_RPMTE_INTERNAL)
#include <argv.h> #include <argv.h>
#include <rpmtxn.h>
#include <rpmal.h> #include <rpmal.h>
typedef struct relation_s * relation;
#if defined(_RPMTS_ORDER_INTERNAL)
struct relation_s {
rpmte rel_suc; // pkg requiring this package
rpmsenseFlags rel_flags; // accumulated flags of the requirements
struct relation_s * rel_next;
};
#endif
/** \ingroup rpmte /** \ingroup rpmte
* Dependncy ordering information. * Dependncy ordering information.
*/ */
/*@-fielduse@*/ /* LCL: confused by union? */ /*@-fielduse@*/ /* LCL: confused by union? */
struct tsortInfo_s { struct tsortInfo_s {
union {
int count;
/*@exposed@*/ /*@dependent@*/ /*@null@*/
rpmte suc;
} tsi_u;
#define tsi_count tsi_u.count
#define tsi_suc tsi_u.suc
/*@owned@*/ /*@null@*/ /*@owned@*/ /*@null@*/
tsortInfo tsi_next; tsortInfo tsi_next;
/*@exposed@*/ /*@dependent@*/ /*@null@*/ /*@exposed@*/ /*@dependent@*/ /*@null@*/
rpmte tsi_chain; rpmte tsi_chain;
int tsi_tagn; int tsi_tagn;
int tsi_reqx;
int tsi_queued; int tsi_queued;
int tsi_count;
int tsi_qcnt; int tsi_qcnt;
int tsi_reqx;
relation tsi_relations;
relation tsi_forward_relations;
rpmte tsi_suc;
int tsi_SccIdx;
int tsi_SccLowlink;
}; };
/*@=fielduse@*/ /*@=fielduse@*/
/** \ingroup rpmte /** \ingroup rpmte
* Info used to link transaction element upgrade/rollback side effects. * Info used to link transaction element upgrade/rollback side effects.
*/ */
struct rpmChainLink_s { struct rpmChainLink_s {
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
ARGV_t Pkgid; /*!< link element pkgid's. */ ARGV_t Pkgid; /*!< link element pkgid's. */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
skipping to change at line 131 skipping to change at line 143
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
const char * os; /*!< Operating system hint. */ const char * os; /*!< Operating system hint. */
int isSource; /*!< (TR_ADDED) source rpm? */ int isSource; /*!< (TR_ADDED) source rpm? */
rpmte parent; /*!< Parent transaction element. */ rpmte parent; /*!< Parent transaction element. */
int degree; /*!< No. of immediate children. */ int degree; /*!< No. of immediate children. */
int npreds; /*!< No. of predecessors. */ int npreds; /*!< No. of predecessors. */
int tree; /*!< Tree index. */ int tree; /*!< Tree index. */
int depth; /*!< Depth in dependency tree. */ int depth; /*!< Depth in dependency tree. */
int breadth; /*!< Breadth in dependency tree. */ int breadth; /*!< Breadth in dependency tree. */
unsigned int db_instance; /*!< Database Instance after add */ uint32_t db_instance; /*!< Database Instance after add */
/*@owned@*/ /*@owned@*/
tsortInfo tsi; /*!< Dependency ordering chains. */ tsortInfo tsi; /*!< Dependency ordering chains. */
/*@null@*/ /*@null@*/
rpmPRCO PRCO; /*!< Current dependencies. */ rpmPRCO PRCO; /*!< Current dependencies. */
/*@null@*/
rpmtxn txn; /*!< Package transaction pointer. */
/*@refcounted@*/ /*@null@*/ /*@refcounted@*/ /*@null@*/
rpmfi fi; /*!< File information. */ rpmfi fi; /*!< File information. */
#ifdef REFERENCE
rpmpol pol; /*!< Policies */
#endif
rpmuint32_t depFlags; /*!< Package depFlags mask. */ rpmuint32_t depFlags; /*!< Package depFlags mask. */
rpmuint32_t transFlags; /*!< Package transFlags mask. */ rpmuint32_t transFlags; /*!< Package transFlags mask. */
rpmuint32_t color; /*!< Color bit(s) from package dependencies. */ rpmuint32_t color; /*!< Color bit(s) from package dependencies. */
rpmuint32_t pkgFileSize; /*!< No. of bytes in package file (approx). */ rpmuint32_t pkgFileSize; /*!< No. of bytes in package file (approx). */
/*@exposed@*/ /*@dependent@*/ /*@null@*/ /*@exposed@*/ /*@dependent@*/ /*@null@*/
fnpyKey key; /*!< (TR_ADDED) Retrieval key. */ fnpyKey key; /*!< (TR_ADDED) Retrieval key. */
/*@owned@*/ /*@null@*/ /*@owned@*/ /*@null@*/
rpmRelocation relocs; /*!< (TR_ADDED) Payload file relocations. */ rpmRelocation relocs; /*!< (TR_ADDED) Payload file relocations. */
skipping to change at line 175 skipping to change at line 192
int installed; /*!< Was the header installed? */ int installed; /*!< Was the header installed? */
int downgrade; /*!< Adjust package count on downgrades. */ int downgrade; /*!< Adjust package count on downgrades. */
struct { struct {
/*@exposed@*/ /*@dependent@*/ /*@null@*/ /*@exposed@*/ /*@dependent@*/ /*@null@*/
alKey addedKey; alKey addedKey;
struct { struct {
/*@exposed@*/ /*@dependent@*/ /*@null@*/ /*@exposed@*/ /*@dependent@*/ /*@null@*/
alKey dependsOnKey; alKey dependsOnKey;
int dboffset; uint32_t dboffset;
} removed; } removed;
} u; } u;
#if defined(__LCLINT__) #if defined(__LCLINT__)
/*@refs@*/ /*@refs@*/
int nrefs; /*!< (unused) keep splint happy */ int nrefs; /*!< (unused) keep splint happy */
#endif #endif
}; };
/** \ingroup rpmte /** \ingroup rpmte
* Iterator across transaction elements, forward on install, backward on er ase. * Iterator across transaction elements, forward on install, backward on er ase.
skipping to change at line 200 skipping to change at line 217
rpmts ts; /*!< transaction set. */ rpmts ts; /*!< transaction set. */
int reverse; /*!< reversed traversal? */ int reverse; /*!< reversed traversal? */
int ocsave; /*!< last returned iterator index. */ int ocsave; /*!< last returned iterator index. */
int oc; /*!< iterator index. */ int oc; /*!< iterator index. */
#if defined(__LCLINT__) #if defined(__LCLINT__)
/*@refs@*/ /*@refs@*/
int nrefs; /*!< (unused) keep splint happy */ int nrefs; /*!< (unused) keep splint happy */
#endif #endif
}; };
int rpmteClose(rpmte te, rpmts ts, int reset_fi)
/*@modifies te, ts @*/;
Header rpmteDBHeader(rpmts ts, uint32_t rec)
/*@modifies ts @*/;
Header rpmteFDHeader(rpmts ts, rpmte te)
/*@modifies ts, te @*/;
int rpmteOpen(rpmte te, rpmts ts, int reload_fi)
/*@modifies te, ts @*/;
/** \ingroup rpmte
* Return failed status of transaction element.
* @param te transaction element
* @return 1 if transaction element (or its parents) failed
*/
int rpmteFailed(rpmte te)
/*@*/;
int rpmteHaveTransScript(rpmte te, rpmTag tag)
/*@*/;
#endif /* _RPMTE_INTERNAL */ #endif /* _RPMTE_INTERNAL */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#if defined(_RPMTE_INTERNAL)
/** \ingroup rpmte /** \ingroup rpmte
* Destroy a transaction element. * Destroy a transaction element.
* @param te transaction element * @param te transaction element
* @return NULL on last dereference * @return NULL on last dereference
*/ */
/*@unused@*/ /*@null@*/ /*@unused@*/ /*@null@*/
rpmte rpmteFree(/*@only@*/ /*@null@*/ rpmte te) rpmte rpmteFree(/*@only@*/ /*@null@*/ rpmte te)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies te, fileSystem @*/; /*@modifies te, fileSystem @*/;
#define rpmteFree(_te) \ #define rpmteFree(_te) \
skipping to change at line 234 skipping to change at line 270
* @param key (TR_ADDED) package retrieval key (e.g. file name) * @param key (TR_ADDED) package retrieval key (e.g. file name)
* @param relocs (TR_ADDED) package file relocations * @param relocs (TR_ADDED) package file relocations
* @param dboffset (TR_REMOVED) rpmdb instance * @param dboffset (TR_REMOVED) rpmdb instance
* @param pkgKey associated added package (if any) * @param pkgKey associated added package (if any)
* @return new transaction element * @return new transaction element
*/ */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
rpmte rpmteNew(const rpmts ts, Header h, rpmElementType type, rpmte rpmteNew(const rpmts ts, Header h, rpmElementType type,
/*@exposed@*/ /*@dependent@*/ /*@null@*/ fnpyKey key, /*@exposed@*/ /*@dependent@*/ /*@null@*/ fnpyKey key,
/*@null@*/ rpmRelocation relocs, /*@null@*/ rpmRelocation relocs,
int dboffset, uint32_t dboffset,
/*@exposed@*/ /*@dependent@*/ /*@null@*/ alKey pkgKey) /*@exposed@*/ /*@dependent@*/ /*@null@*/ alKey pkgKey)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies ts, h, rpmGlobalMacroContext, fileSystem, internalState @*/; /*@modifies ts, h, rpmGlobalMacroContext, fileSystem, internalState @*/;
#endif /* _RPMTE_INTERNAL */
/** \ingroup rpmte /** \ingroup rpmte
* Retrieve header from transaction element. * Retrieve header from transaction element.
* @param te transaction element * @param te transaction element
* @return header * @return header
*/ */
extern Header rpmteHeader(rpmte te) extern Header rpmteHeader(rpmte te)
/*@modifies te @*/; /*@modifies te @*/;
/** \ingroup rpmte /** \ingroup rpmte
skipping to change at line 360 skipping to change at line 395
* @return previous color bits * @return previous color bits
*/ */
rpmuint32_t rpmteSetColor(rpmte te, rpmuint32_t color) rpmuint32_t rpmteSetColor(rpmte te, rpmuint32_t color)
/*@modifies te @*/; /*@modifies te @*/;
/** \ingroup rpmte /** \ingroup rpmte
* Retrieve last instance installed to the database. * Retrieve last instance installed to the database.
* @param te transaction element * @param te transaction element
* @return last install instance. * @return last install instance.
*/ */
unsigned int rpmteDBInstance(rpmte te) uint32_t rpmteDBInstance(rpmte te)
/*@*/; /*@*/;
/** \ingroup rpmte /** \ingroup rpmte
* Set last instance installed to the database. * Set last instance installed to the database.
* @param te transaction element * @param te transaction element
* @param instance Database instance of last install element. * @param instance Database instance of last install element.
* @return last install instance. * @return last install instance.
*/ */
void rpmteSetDBInstance(rpmte te, unsigned int instance) void rpmteSetDBInstance(rpmte te, unsigned int instance)
/*@modifies te @*/; /*@modifies te @*/;
skipping to change at line 650 skipping to change at line 685
/*@*/; /*@*/;
/** \ingroup rpmte /** \ingroup rpmte
* Retrieve file info tag set from transaction element. * Retrieve file info tag set from transaction element.
* @param te transaction element * @param te transaction element
* @param tag file info tag (RPMTAG_BASENAMES) * @param tag file info tag (RPMTAG_BASENAMES)
* @return file info tag set * @return file info tag set
*/ */
rpmfi rpmteFI(rpmte te, rpmTag tag) rpmfi rpmteFI(rpmte te, rpmTag tag)
/*@*/; /*@*/;
/*@null@*/
rpmfi rpmteSetFI(rpmte te, rpmfi fi)
/*@modifies te, fi @*/;
/** \ingroup rpmte /** \ingroup rpmte
* Calculate transaction element dependency colors/refs from file info. * Calculate transaction element dependency colors/refs from file info.
* @param te transaction element * @param te transaction element
* @param tag dependency tag (RPMTAG_PROVIDENAME, RPMTAG_REQUIRENA ME) * @param tag dependency tag (RPMTAG_PROVIDENAME, RPMTAG_REQUIRENA ME)
*/ */
/*@-exportlocal@*/ /*@-exportlocal@*/
void rpmteColorDS(rpmte te, rpmTag tag) void rpmteColorDS(rpmte te, rpmTag tag)
/*@modifies te @*/; /*@modifies te @*/;
/*@=exportlocal@*/ /*@=exportlocal@*/
skipping to change at line 786 skipping to change at line 824
if (str == NULL) if (str == NULL)
fprintf(stderr, "error: %s\n", errstr); fprintf(stderr, "error: %s\n", errstr);
else { else {
fprintf(stderr, "%s", str); fprintf(stderr, "%s", str);
str = _free(str); str = _free(str);
} }
} }
#endif #endif
#endif #endif
#ifdef REFERENCE
/** \ingroup rpmte
* Transaction element file states.
*/
typedef struct rpmfs_s * rpmfs;
/**
*/
struct sharedFileInfo_s {
int pkgFileNum;
int otherPkg;
int otherFileNum;
};
typedef char rpm_fstate_t;
struct rpmfs_s {
unsigned int fc;
rpm_fstate_t * states;
rpmFileAction * actions; /*!< File disposition(s). */
sharedFileInfo replaced; /*!< (TR_ADDED) to be replaced files in the
rpmdb */
int numReplaced;
int allocatedReplaced;
};
int rpmteMarkFailed(rpmte te, rpmts ts);
rpmps rpmteProblems(rpmte te);
rpmfs rpmteGetFileStates(rpmte te);
rpmfs rpmfsNew(unsigned int fc, rpmElementType type);
rpmfs rpmfsFree(rpmfs fs);
rpm_count_t rpmfsFC(rpmfs fs);
void rpmfsAddReplaced(rpmfs fs, int pkgFileNum, int otherPkg, int otherFile
Num);
sharedFileInfo rpmfsGetReplaced(rpmfs fs);
sharedFileInfo rpmfsNextReplaced(rpmfs fs , sharedFileInfo replaced);
void rpmfsSetState(rpmfs fs, unsigned int ix, rpmfileState state);
rpmfileState rpmfsGetState(rpmfs fs, unsigned int ix);
/*@null@*/
rpm_fstate_t * rpmfsGetStates(rpmfs fs);
void rpmfsSetAction(rpmfs fs, unsigned int ix, rpmFileAction action);
#endif /* REFERENCE */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* H_RPMTE */ #endif /* H_RPMTE */
 End of changes. 18 change blocks. 
14 lines changed or deleted 98 lines changed or added


 rpmts.h   rpmts.h 
#ifndef H_RPMTS #ifndef H_RPMTS
#define H_RPMTS #define H_RPMTS
/** \ingroup rpmts /** \ingroup rpmts
* \file lib/rpmts.h * \file lib/rpmts.h
* Structures and prototypes used for an "rpmts" transaction set. * Structures and prototypes used for an "rpmts" transaction set.
*/ */
#include "rpmps.h" #include "rpmps.h"
#include "rpmsw.h" #include "rpmsw.h"
#include "rpmsx.h"
#include <rpmpgp.h> /* XXX pgpVSFlags */ #include <rpmpgp.h> /* XXX pgpVSFlags */
/*@-exportlocal@*/ /*@-exportlocal@*/
/*@unchecked@*/ /*@unchecked@*/
extern int _rpmts_debug; extern int _rpmts_debug;
/*@unchecked@*/ /*@unchecked@*/
extern int _rpmts_macros; extern int _rpmts_macros;
/*@unchecked@*/ /*@unchecked@*/
extern int _rpmts_stats; extern int _rpmts_stats;
/*@unchecked@*/ /*@unchecked@*/
skipping to change at line 74 skipping to change at line 73
RPMTRANS_FLAG_REPACKAGE = (1 << 10), /*!< from --repackage */ RPMTRANS_FLAG_REPACKAGE = (1 << 10), /*!< from --repackage */
RPMTRANS_FLAG_PKGCOMMIT = (1 << 11), RPMTRANS_FLAG_PKGCOMMIT = (1 << 11),
/*@-enummemuse@*/ /*@-enummemuse@*/
RPMTRANS_FLAG_PKGUNDO = (1 << 12), RPMTRANS_FLAG_PKGUNDO = (1 << 12),
/*@=enummemuse@*/ /*@=enummemuse@*/
RPMTRANS_FLAG_COMMIT = (1 << 13), RPMTRANS_FLAG_COMMIT = (1 << 13),
/*@-enummemuse@*/ /*@-enummemuse@*/
RPMTRANS_FLAG_UNDO = (1 << 14), RPMTRANS_FLAG_UNDO = (1 << 14),
/*@=enummemuse@*/ /*@=enummemuse@*/
RPMTRANS_FLAG_APPLYONLY = (1 << 25), RPMTRANS_FLAG_APPLYONLY = (1 << 15),
RPMTRANS_FLAG_NOTRIGGERPREIN= (1 << 16), /*!< from --notriggerprein * / RPMTRANS_FLAG_NOTRIGGERPREIN= (1 << 16), /*!< from --notriggerprein * /
RPMTRANS_FLAG_NOPRE = (1 << 17), /*!< from --nopre */ RPMTRANS_FLAG_NOPRE = (1 << 17), /*!< from --nopre */
RPMTRANS_FLAG_NOPOST = (1 << 18), /*!< from --nopost */ RPMTRANS_FLAG_NOPOST = (1 << 18), /*!< from --nopost */
RPMTRANS_FLAG_NOTRIGGERIN = (1 << 19), /*!< from --notriggerin */ RPMTRANS_FLAG_NOTRIGGERIN = (1 << 19), /*!< from --notriggerin */
RPMTRANS_FLAG_NOTRIGGERUN = (1 << 20), /*!< from --notriggerun */ RPMTRANS_FLAG_NOTRIGGERUN = (1 << 20), /*!< from --notriggerun */
RPMTRANS_FLAG_NOPREUN = (1 << 21), /*!< from --nopreun */ RPMTRANS_FLAG_NOPREUN = (1 << 21), /*!< from --nopreun */
RPMTRANS_FLAG_NOPOSTUN = (1 << 22), /*!< from --nopostun */ RPMTRANS_FLAG_NOPOSTUN = (1 << 22), /*!< from --nopostun */
RPMTRANS_FLAG_NOTRIGGERPOSTUN = (1 << 23), /*!< from --notriggerpostun */ RPMTRANS_FLAG_NOTRIGGERPOSTUN = (1 << 23), /*!< from --notriggerpostun */
/*@-enummemuse@*/ /*@-enummemuse@*/
RPMTRANS_FLAG_NOPAYLOAD = (1 << 24), RPMTRANS_FLAG_NOPAYLOAD = (1 << 24),
/*@=enummemuse@*/ /*@=enummemuse@*/
RPMTRANS_FLAG_NORPMDB = (1 << 25), /*!< from --norpmdb */ RPMTRANS_FLAG_NORPMDB = (1 << 25), /*!< from --norpmdb */
/* 26 unused */ RPMTRANS_FLAG_NOPOLICY = (1 << 26), /*!< from --nopolicy */
RPMTRANS_FLAG_NOFDIGESTS = (1 << 27), /*!< from --nofdigests */ RPMTRANS_FLAG_NOFDIGESTS = (1 << 27), /*!< from --nofdigests */
RPMTRANS_FLAG_NOPRETRANS = (1 << 28), /*!< from --nopretrans */ RPMTRANS_FLAG_NOPRETRANS = (1 << 28), /*!< from --nopretrans */
RPMTRANS_FLAG_NOPOSTTRANS = (1 << 29), /*!< from --noposttrans */ RPMTRANS_FLAG_NOPOSTTRANS = (1 << 29), /*!< from --noposttrans */
RPMTRANS_FLAG_NOCONFIGS = (1 << 30), /*!< from --noconfigs */ RPMTRANS_FLAG_NOCONFIGS = (1 << 30), /*!< from --noconfigs */
/* 31 unused */ /* 31 unused */
} rpmtransFlags; } rpmtransFlags;
#define _noTransScripts \ #define _noTransScripts \
( RPMTRANS_FLAG_NOPRETRANS | \ ( RPMTRANS_FLAG_NOPRETRANS | \
RPMTRANS_FLAG_NOPRE | \ RPMTRANS_FLAG_NOPRE | \
skipping to change at line 159 skipping to change at line 158
/** \ingroup rpmts /** \ingroup rpmts
*/ */
typedef enum tsStage_e { typedef enum tsStage_e {
TSM_UNKNOWN = 0, TSM_UNKNOWN = 0,
TSM_INSTALL = 7, TSM_INSTALL = 7,
TSM_ERASE = 8, TSM_ERASE = 8,
} tsmStage; } tsmStage;
#if defined(_RPMTS_INTERNAL) #if defined(_RPMTS_INTERNAL)
#include <rpmbf.h>
#include "rpmhash.h" /* XXX hashTable */ #include "rpmhash.h" /* XXX hashTable */
#include "rpmkeyring.h" #include "rpmkeyring.h"
#include <rpmtxn.h>
#include "rpmal.h" /* XXX availablePackage/relocateFileList ,*/ #include "rpmal.h" /* XXX availablePackage/relocateFileList ,*/
/*@unchecked@*/ /*@unchecked@*/
/*@-exportlocal@*/ /*@-exportlocal@*/
extern int _cacheDependsRC; extern int _cacheDependsRC;
/*@=exportlocal@*/ /*@=exportlocal@*/
/** \ingroup rpmts /** \ingroup rpmts
*/ */
typedef /*@abstract@*/ struct diskspaceInfo_s * rpmDiskSpaceInfo; typedef /*@abstract@*/ struct diskspaceInfo_s * rpmDiskSpaceInfo;
skipping to change at line 190 skipping to change at line 191
signed long long f_bavail; /*!< No. of blocks available to non-root. */ signed long long f_bavail; /*!< No. of blocks available to non-root. */
unsigned long long f_files; /*!< No. of inodes. */ unsigned long long f_files; /*!< No. of inodes. */
unsigned long long f_ffree; /*!< No. of free inodes. */ unsigned long long f_ffree; /*!< No. of free inodes. */
signed long long f_favail; /*!< No. of inodes available to non-root. */ signed long long f_favail; /*!< No. of inodes available to non-root. */
unsigned long f_fsid; /*!< File system id. */ unsigned long f_fsid; /*!< File system id. */
unsigned long f_flag; /*!< Mount flags. */ unsigned long f_flag; /*!< Mount flags. */
unsigned long f_namemax; /*!< Maximum filename length. */ unsigned long f_namemax; /*!< Maximum filename length. */
signed long long bneeded; /*!< No. of blocks needed. */ signed long long bneeded; /*!< No. of blocks needed. */
signed long long ineeded; /*!< No. of inodes needed. */ signed long long ineeded; /*!< No. of inodes needed. */
signed long long obneeded; /*!< Bookkeeping to avoid duplicate reports.
*/
signed long long oineeded; /*!< Bookkeeping to avoid duplicate reports.
*/
dev_t dev; /*!< File system device number. */ dev_t dev; /*!< File system device number. */
}; };
/** \ingroup rpmts /** \ingroup rpmts
* Adjust for root only reserved space. On linux e2fs, this is 5%. * Adjust for root only reserved space. On linux e2fs, this is 5%.
*/ */
#define adj_fs_blocks(_nb) (((_nb) * 21) / 20) #define adj_fs_blocks(_nb) (((_nb) * 21) / 20)
#define BLOCK_ROUND(size, block) (((size) + (block) - 1) / (block)) #define BLOCK_ROUND(size, block) (((size) + (block) - 1) / (block))
skipping to change at line 246 skipping to change at line 249
/*@dependent@*/ /*@null@*/ /*@dependent@*/ /*@null@*/
const char ** filesystems; /*!< Mounted filesystem names. */ const char ** filesystems; /*!< Mounted filesystem names. */
/*@only@*/ /*@relnull@*/ /*@only@*/ /*@relnull@*/
rpmDiskSpaceInfo dsi; /*!< Per filesystem disk/inode usage. */ rpmDiskSpaceInfo dsi; /*!< Per filesystem disk/inode usage. */
/*@refcounted@*/ /*@null@*/ /*@refcounted@*/ /*@null@*/
rpmdb rdb; /*!< Install database handle. */ rpmdb rdb; /*!< Install database handle. */
int dbmode; /*!< Install database open mode. */ int dbmode; /*!< Install database open mode. */
/*@only@*/ /*@only@*/
hashTable ht; /*!< Fingerprint hash table. */ hashTable ht; /*!< Fingerprint hash table. */
/*@null@*/
rpmtxn txn; /*!< Transaction set transaction poi
nter. */
/*@refcounted@*/ /*@null@*/
rpmbf rbf; /*!< Removed packages Bloom filter. */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
int * removedPackages; /*!< Set of packages being removed. */ uint32_t * removedPackages; /*!< Set of packages being removed. */
int numRemovedPackages; /*!< No. removed package instances. */ int numRemovedPackages; /*!< No. removed package instances. */
int allocedRemovedPackages; /*!< Size of removed packages array. */ int allocedRemovedPackages; /*!< Size of removed packages array. */
/*@only@*/ /*@only@*/
rpmal addedPackages; /*!< Set of packages being installed. */ rpmal addedPackages; /*!< Set of packages being installed. */
int numAddedPackages; /*!< No. added package instances. */ int numAddedPackages; /*!< No. added package instances. */
int numAddedFiles; /*!< No. of files in added packages. */
/*@only@*/ /*@only@*/
rpmal erasedPackages; /*!< Set of packages being erased. */ rpmal erasedPackages; /*!< Set of packages being erased. */
int numErasedPackages; /*!< No. erased package instances. */ int numErasedPackages; /*!< No. erased package instances. */
int numErasedFiles; /*!< No. of files in erased packages . */
#ifndef DYING #ifndef DYING
/*@only@*/ /*@only@*/
rpmal availablePackages; /*!< Universe of available packages. */ rpmal availablePackages; /*!< Universe of available packages. */
int numAvailablePackages; /*!< No. available package instances. */ int numAvailablePackages; /*!< No. available package instances. */
#endif #endif
/*@refcounted@*/ /*@null@*/
rpmsx sx; /*!< Security context patterns. */
/*@null@*/ /*@null@*/
rpmte relocateElement; /*!< Element to use when relocating packages . */ rpmte relocateElement; /*!< Element to use when relocating packages . */
/*@owned@*/ /*@relnull@*/ /*@owned@*/ /*@relnull@*/
rpmte * order; /*!< Packages sorted by dependencies. */ rpmte * order; /*!< Packages sorted by dependencies. */
int orderCount; /*!< No. of transaction elements. */ int orderCount; /*!< No. of transaction elements. */
int orderAlloced; /*!< No. of allocated transaction elements. */ int orderAlloced; /*!< No. of allocated transaction elements. */
int unorderedSuccessors; /*!< Index of 1st element of successors. */ int unorderedSuccessors; /*!< Index of 1st element of successors. */
int ntrees; /*!< No. of dependency trees. */ int ntrees; /*!< No. of dependency trees. */
int maxDepth; /*!< Maximum depth of dependency tree(s). */ int maxDepth; /*!< Maximum depth of dependency tree(s). */
skipping to change at line 305 skipping to change at line 311
rpmuint32_t color; /*!< Transaction color bits. */ rpmuint32_t color; /*!< Transaction color bits. */
rpmuint32_t prefcolor; /*!< Preferred file color. */ rpmuint32_t prefcolor; /*!< Preferred file color. */
/*@observer@*/ /*@dependent@*/ /*@null@*/ /*@observer@*/ /*@dependent@*/ /*@null@*/
const char * fn; /*!< Current package fn. */ const char * fn; /*!< Current package fn. */
/*@refcounted@*/ /*@relnull@*/ /*@refcounted@*/ /*@relnull@*/
rpmKeyring keyring; /*!< Keyring in use. */ rpmKeyring keyring; /*!< Keyring in use. */
/*@relnull@*/ /*@relnull@*/
rpmuint8_t * pkpkt; /*!< Current pubkey packet. */ void * hkp; /*!< Pubkey validation container. */
size_t pkpktlen; /*!< Current pubkey packet length. */
rpmuint8_t pksignid[8]; /*!< Current pubkey fingerprint. */
struct rpmop_s ops[RPMTS_OP_MAX]; struct rpmop_s ops[RPMTS_OP_MAX];
/*@refcounted@*/ /*@relnull@*/ /*@refcounted@*/ /*@relnull@*/
pgpDig dig; /*!< Current signature/pubkey parame ters. */ pgpDig dig; /*!< Current signature/pubkey parame ters. */
/*@null@*/ /*@null@*/
Spec spec; /*!< Spec file control structure. */ Spec spec; /*!< Spec file control structure. */
rpmuint32_t arbgoal; /*!< Autorollback goal */ rpmuint32_t arbgoal; /*!< Autorollback goal */
skipping to change at line 340 skipping to change at line 344
/** \ingroup rpmts /** \ingroup rpmts
* Perform dependency resolution on the transaction set. * Perform dependency resolution on the transaction set.
* *
* Any problems found by rpmtsCheck() can be examined by retrieving the * Any problems found by rpmtsCheck() can be examined by retrieving the
* problem set with rpmtsProblems(), success here only means that * problem set with rpmtsProblems(), success here only means that
* the resolution was successfully attempted for all packages in the set. * the resolution was successfully attempted for all packages in the set.
* *
* @param ts transaction set * @param ts transaction set
* @return 0 = deps ok, 1 = dep problems, 2 = error * @return 0 = deps ok, 1 = dep problems, 2 = error
*/ */
int rpmtsCheck(rpmts ts) extern int (*rpmtsCheck) (rpmts ts)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState
@*/
/*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/
;
int _rpmtsCheck(rpmts ts)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/ ; /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/ ;
/** \ingroup rpmts /** \ingroup rpmts
* Determine package order in a transaction set according to dependencies. * Determine package order in a transaction set according to dependencies.
* *
* Order packages, returning error if circular dependencies cannot be * Order packages, returning error if circular dependencies cannot be
* eliminated by removing Requires's from the loop(s). Only dependencies fr om * eliminated by removing Requires's from the loop(s). Only dependencies fr om
* added or removed packages are used to determine ordering using a * added or removed packages are used to determine ordering using a
* topological sort (Knuth vol. 1, p. 262). Use rpmtsCheck() to verify * topological sort (Knuth vol. 1, p. 262). Use rpmtsCheck() to verify
* that all dependencies can be resolved. * that all dependencies can be resolved.
* *
* The final order ends up as installed packages followed by removed packag es, * The final order ends up as installed packages followed by removed packag es,
* with packages removed for upgrades immediately following the new package * with packages removed for upgrades immediately following the new package
* to be installed. * to be installed.
* *
* @param ts transaction set * @param ts transaction set
* @return no. of (added) packages that could not be ordered * @return no. of (added) packages that could not be ordered
*/ */
int rpmtsOrder(rpmts ts) extern int (*rpmtsOrder) (rpmts ts)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState
@*/
/*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/
;
int _rpmtsOrder(rpmts ts)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState
@*/
/*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/
;
int _orgrpmtsOrder(rpmts ts)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/ ; /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/ ;
/** \ingroup rpmts /** \ingroup rpmts
* Process all package elements in a transaction set. Before calling * Process all package elements in a transaction set. Before calling
* rpmtsRun be sure to have: * rpmtsRun be sure to have:
* *
* - setup the rpm root dir via rpmtsSetRootDir(). * - setup the rpm root dir via rpmtsSetRootDir().
* - setup the rpm notify callback via rpmtsSetNotifyCallback(). * - setup the rpm notify callback via rpmtsSetNotifyCallback().
* - setup the rpm transaction flags via rpmtsSetFlags(). * - setup the rpm transaction flags via rpmtsSetFlags().
* *
* Additionally, though not required you may want to: * Additionally, though not required you may want to:
* *
* - setup the rpm verify signature flags via rpmtsSetVSFlags(). * - setup the rpm verify signature flags via rpmtsSetVSFlags().
* *
* @param ts transaction set * @param ts transaction set
* @param okProbs previously known problems (or NULL) * @param okProbs previously known problems (or NULL)
* @param ignoreSet bits to filter problem types * @param ignoreSet bits to filter problem types
* @return 0 on success, -1 on error, >0 with newProbs set * @return 0 on success, -1 on error, >0 with newProbs set
*/ */
int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet) extern int (*rpmtsRun) (rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreS
et)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState
@*/
/*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/
;
int _rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/ ; /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/ ;
/** \ingroup rpmts /** \ingroup rpmts
* Rollback a failed transaction. * Rollback a failed transaction.
* @param rbts failed transaction set * @param rbts failed transaction set
* @param ignoreSet problems to ignore * @param ignoreSet problems to ignore
* @param running partial transaction? * @param running partial transaction?
* @param rbte failed transaction element * @param rbte failed transaction element
* @return RPMRC_OK, or RPMRC_FAIL * @return RPMRC_OK, or RPMRC_FAIL
skipping to change at line 444 skipping to change at line 460
* @param ts transaction set * @param ts transaction set
* @param dbmode O_RDONLY or O_RDWR * @param dbmode O_RDONLY or O_RDWR
* @return 0 on success * @return 0 on success
*/ */
int rpmtsOpenDB(rpmts ts, int dbmode) int rpmtsOpenDB(rpmts ts, int dbmode)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/ ; /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/ ;
/** \ingroup rpmts /** \ingroup rpmts
* Initialize the database used by the transaction. * Initialize the database used by the transaction.
* @deprecated An explicit rpmdbInit() is almost never needed. * @deprecated An explicit rpmdbInit() is never needed.
* @param ts transaction set * @param ts transaction set
* @param dbmode O_RDONLY or O_RDWR * @param dbmode O_RDONLY or O_RDWR
* @return 0 on success * @return 0 on success
*/ */
int rpmtsInitDB(rpmts ts, int dbmode) static inline /*@unused@*/
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState int rpmtsInitDB(/*@unused@*/ rpmts ts, /*@unused@*/ int dbmode)
@*/ /*@*/
/*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/ {
; return -1;
}
/** \ingroup rpmts /** \ingroup rpmts
* Rebuild the database used by the transaction. * Rebuild the database used by the transaction.
* @param ts transaction set * @param ts transaction set
* @return 0 on success * @return 0 on success
*/ */
int rpmtsRebuildDB(rpmts ts) int rpmtsRebuildDB(rpmts ts)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/ ; /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/ ;
/** \ingroup rpmts /** \ingroup rpmts
* Verify the database used by the transaction. * Verify the database used by the transaction.
* @deprecated Use included standalone db_verify(1) utility instead.
* @param ts transaction set * @param ts transaction set
* @return 0 on success * @return 0 on success
*/ */
int rpmtsVerifyDB(rpmts ts) static inline /*@unused@*/
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState int rpmtsVerifyDB(/*@unused@*/ rpmts ts)
@*/ /*@*/
/*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/ {
; return -1;
}
/** \ingroup rpmts /** \ingroup rpmts
* Return transaction database iterator. * Return transaction database iterator.
* @param ts transaction set * @param ts transaction set
* @param rpmtag rpm tag * @param rpmtag rpm tag
* @param keyp key data (NULL for sequential access) * @param keyp key data (NULL for sequential access)
* @param keylen key data length (0 will use strlen(keyp)) * @param keylen key data length (0 will use strlen(keyp))
* @return NULL on failure * @return NULL on failure
*/ */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
skipping to change at line 1088 skipping to change at line 1111
/*@null@*/ rpmRelocation relocs) /*@null@*/ rpmRelocation relocs)
/*@globals rpmcliPackagesTotal, rpmGlobalMacroContext, h_errno, /*@globals rpmcliPackagesTotal, rpmGlobalMacroContext, h_errno,
fileSystem, internalState @*/ fileSystem, internalState @*/
/*@modifies ts, h, rpmcliPackagesTotal, rpmGlobalMacroContext, /*@modifies ts, h, rpmcliPackagesTotal, rpmGlobalMacroContext,
fileSystem, internalState @*/; fileSystem, internalState @*/;
/** \ingroup rpmts /** \ingroup rpmts
* Add package to be erased to transaction set. * Add package to be erased to transaction set.
* @param ts transaction set * @param ts transaction set
* @param h header * @param h header
* @param dboffset rpm database instance * @param hdrNum rpm database instance
* @return 0 on success * @return 0 on success
*/ */
int rpmtsAddEraseElement(rpmts ts, Header h, int dboffset) int rpmtsAddEraseElement(rpmts ts, Header h, uint32_t hdrNum)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies ts, h, rpmGlobalMacroContext, fileSystem, internalState @*/; /*@modifies ts, h, rpmGlobalMacroContext, fileSystem, internalState @*/;
#if !defined(SWIG) #if !defined(SWIG)
#if defined(_RPMTS_PRINT) #if defined(_RPMTS_PRINT)
/** \ingroup rpmts /** \ingroup rpmts
* Print current transaction set contents. * Print current transaction set contents.
* @param ts transaction set * @param ts transaction set
* @param fp file handle (NULL uses stderr) * @param fp file handle (NULL uses stderr)
* @return 0 always * @return 0 always
 End of changes. 22 change blocks. 
26 lines changed or deleted 57 lines changed or added


 rpmtypes.h   rpmtypes.h 
skipping to change at line 18 skipping to change at line 18
/** \ingroup rpmts /** \ingroup rpmts
* The RPM Transaction Set. * The RPM Transaction Set.
* Transaction sets are inherently unordered! RPM may reorder transaction * Transaction sets are inherently unordered! RPM may reorder transaction
* sets to reduce errors. In general, installs/upgrades are done before * sets to reduce errors. In general, installs/upgrades are done before
* strict removals, and prerequisite ordering is done on installs/upgrades. * strict removals, and prerequisite ordering is done on installs/upgrades.
*/ */
typedef /*@abstract@*/ /*@refcounted@*/ struct rpmts_s * rpmts; typedef /*@abstract@*/ /*@refcounted@*/ struct rpmts_s * rpmts;
/** \ingroup rpmbuild /** \ingroup rpmbuild
*/ */
typedef struct Spec_s * Spec; typedef /*@abstract@*/ /*@refcounted@*/ struct Spec_s * Spec;
/** \ingroup rpmds /** \ingroup rpmds
* Dependency tag sets from a header, so that a header can be discarded ear ly. * Dependency tag sets from a header, so that a header can be discarded ear ly.
*/ */
typedef /*@abstract@*/ /*@refcounted@*/ struct rpmds_s * rpmds; typedef /*@abstract@*/ /*@refcounted@*/ struct rpmds_s * rpmds;
/** \ingroup rpmds /** \ingroup rpmds
* Container for commonly extracted dependency set(s). * Container for commonly extracted dependency set(s).
*/ */
typedef struct rpmPRCO_s * rpmPRCO; typedef struct rpmPRCO_s * rpmPRCO;
skipping to change at line 54 skipping to change at line 54
/** \ingroup rpmgi /** \ingroup rpmgi
* Generalized iterator. * Generalized iterator.
*/ */
typedef /*@abstract@*/ /*@refcounted@*/ struct rpmgi_s * rpmgi; typedef /*@abstract@*/ /*@refcounted@*/ struct rpmgi_s * rpmgi;
/** /**
*/ */
typedef struct rpmRelocation_s * rpmRelocation; typedef struct rpmRelocation_s * rpmRelocation;
/**
* Scriptlet identifiers.
*/
typedef enum rpmScriptID_e {
RPMSCRIPT_PRETRANS = 0, /*!< %pretrans scriptlet */
RPMSCRIPT_TRIGGERPREIN = 1, /*!< %triggerprein scriptlet */
RPMSCRIPT_PREIN = 2, /*!< %pre scriptlet */
RPMSCRIPT_POSTIN = 3, /*!< %post scriptlet */
RPMSCRIPT_TRIGGERIN = 4, /*!< %triggerin scriptlet */
RPMSCRIPT_TRIGGERUN = 5, /*!< %triggerun scriptlet */
RPMSCRIPT_PREUN = 6, /*!< %preun scriptlet */
RPMSCRIPT_POSTUN = 7, /*!< %postun scriptlet */
RPMSCRIPT_TRIGGERPOSTUN = 8, /*!< %triggerpostun scriptlet */
RPMSCRIPT_POSTTRANS = 9, /*!< %posttrans scriptlet */
/* 10-15 unused */
RPMSCRIPT_VERIFY = 16, /*!< %verify scriptlet */
RPMSCRIPT_SANITYCHECK = 17, /*!< %sanitycheck scriptlet */
/* 18-23 unused */
RPMSCRIPT_PREP = 24, /*!< %prep build scriptlet */
RPMSCRIPT_BUILD = 25, /*!< %build build scriptlet */
RPMSCRIPT_INSTALL = 26, /*!< %install build scriptlet */
RPMSCRIPT_CHECK = 27, /*!< %check build scriptlet */
/* 28-31 unused */
RPMSCRIPT_MAX = 32
} rpmScriptID;
/**
* Scriptlet states (when installed).
*/
typedef enum rpmScriptState_e {
RPMSCRIPT_STATE_UNKNOWN = 0,
/* 0-15 reserved for waitpid return. */
RPMSCRIPT_STATE_EXEC = (1 << 16), /*!< scriptlet was exec'd */
RPMSCRIPT_STATE_REAPED = (1 << 17), /*!< scriptlet was reaped */
/* 18-23 unused */
RPMSCRIPT_STATE_SELINUX = (1 << 24), /*!< scriptlet exec by SELinux
*/
RPMSCRIPT_STATE_EMBEDDED = (1 << 25), /*!< scriptlet exec by lua et a
l */
/* 26-31 unused */
} rpmScriptState;
#endif /* _H_RPMTYPES_ */ #endif /* _H_RPMTYPES_ */
 End of changes. 2 change blocks. 
1 lines changed or deleted 43 lines changed or added


 rpmversion.h   rpmversion.h 
skipping to change at line 81 skipping to change at line 81
/* link-time information */ /* link-time information */
extern uint32_t rpmlibVersion(void) extern uint32_t rpmlibVersion(void)
/*@*/; /*@*/;
extern uint32_t rpmlibTimestamp(void) extern uint32_t rpmlibTimestamp(void)
/*@*/; /*@*/;
extern uint32_t rpmlibVendor(void) extern uint32_t rpmlibVendor(void)
/*@*/; /*@*/;
/* compile-time information */ /* compile-time information */
#define RPMLIB_VERSION RPMLIB_VERSION_ENCODE(5,2,r,1,0,_) #define RPMLIB_VERSION RPMLIB_VERSION_ENCODE(5,3,r,1,0,_)
#define RPMLIB_TIMESTAMP RPMLIB_TIMESTAMP_ENCODE(2009,0,0,0,0) #define RPMLIB_TIMESTAMP RPMLIB_TIMESTAMP_ENCODE(2009,0,0,0,0)
#define RPMLIB_VENDOR RPMLIB_VENDOR_ENCODE('R','P','M','5') #define RPMLIB_VENDOR RPMLIB_VENDOR_ENCODE('R','P','M','5')
/* RPM release version encoding */ /* RPM release version encoding */
#define RPMLIB_VERSION_ENCODE(major,minor,type,micro,revision,snap) \ #define RPMLIB_VERSION_ENCODE(major,minor,type,micro,revision,snap) \
( RPMLIB_BITFIELD_SET(31,27,(major)) \ ( RPMLIB_BITFIELD_SET(31,27,(major)) \
| RPMLIB_BITFIELD_SET(26,21,(minor)) \ | RPMLIB_BITFIELD_SET(26,21,(minor)) \
| RPMLIB_BITFIELD_SET(20,18,RPMLIB_VERSION_ENCODE_T(type)) \ | RPMLIB_BITFIELD_SET(20,18,RPMLIB_VERSION_ENCODE_T(type)) \
| RPMLIB_BITFIELD_SET(17,10,(micro)) \ | RPMLIB_BITFIELD_SET(17,10,(micro)) \
| RPMLIB_BITFIELD_SET(9,1,(revision)) \ | RPMLIB_BITFIELD_SET(9,1,(revision)) \
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/