fs.h   fs.h 
skipping to change at line 31 skipping to change at line 31
* Return (cached) file system mount points. * Return (cached) file system mount points.
* @retval listptr addess of file system names (or NULL) * @retval listptr addess of file system names (or NULL)
* @retval num address of number of file systems (or NULL) * @retval num address of number of file systems (or NULL)
* @return 0 on success, 1 on error * @return 0 on success, 1 on error
*/ */
/*@-incondefs@*/ /*@-incondefs@*/
int rpmGetFilesystemList( /*@null@*/ /*@out@*/ const char *** listptr, int rpmGetFilesystemList( /*@null@*/ /*@out@*/ const char *** listptr,
/*@null@*/ /*@out@*/ uint32_t * num) /*@null@*/ /*@out@*/ uint32_t * num)
/*@globals fileSystem, internalState @*/ /*@globals fileSystem, internalState @*/
/*@modifies *listptr, *num, fileSystem, internalState @*/ /*@modifies *listptr, *num, fileSystem, internalState @*/
/*@requires maxSet(listptr) >= 0 /\ maxSet(num) >= 0 @*/ /*@requires maxSet(listptr) >= 0 /\ maxSet(num) >= 0 @*/;
/*@ensures maxRead(num) == 0 @*/;
/*@=incondefs@*/ /*@=incondefs@*/
/** /**
* Determine per-file system usage for a list of files. * Determine per-file system usage for a list of files.
* @param fileList array of absolute file names * @param fileList array of absolute file names
* @param fssizes array of file sizes * @param fssizes array of file sizes
* @param numFiles number of files in list * @param numFiles number of files in list
* @retval usagesPtr address of per-file system usage array (or N ULL) * @retval usagesPtr address of per-file system usage array (or N ULL)
* @param flags (unused) * @param flags (unused)
* @return 0 on success, 1 on error * @return 0 on success, 1 on error
*/ */
/*@-incondefs@*/ /*@-incondefs@*/
int rpmGetFilesystemUsage(const char ** fileList, uint32_t * fssizes, int rpmGetFilesystemUsage(const char ** fileList, uint32_t * fssizes,
int numFiles, /*@null@*/ /*@out@*/ uint64_t ** usagesPtr, int numFiles, /*@null@*/ /*@out@*/ uint64_t ** usagesPtr,
int flags) int flags)
/*@globals rpmGlobalMacroContext, h_errno, /*@globals rpmGlobalMacroContext, h_errno,
fileSystem, internalState @*/ fileSystem, internalState @*/
/*@modifies *usagesPtr, rpmGlobalMacroContext, /*@modifies *usagesPtr, rpmGlobalMacroContext,
fileSystem, internalState @*/ fileSystem, internalState @*/
/*@requires maxSet(fileList) >= 0 /\ maxSet(fssizes) == 0 /*@requires maxSet(fileList) >= 0 /\ maxSet(fssizes) == 0
/\ maxSet(usagesPtr) >= 0 @*/ /\ maxSet(usagesPtr) >= 0 @*/;
/*@ensures maxRead(usagesPtr) == 0 @*/;
/*@=incondefs@*/ /*@=incondefs@*/
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* H_FS */ #endif /* H_FS */
 End of changes. 2 change blocks. 
4 lines changed or deleted 2 lines changed or added


 rpmcb.h   rpmcb.h 
#ifndef H_RPMCB #ifndef H_RPMCB
#define H_RPMCB #define H_RPMCB
/** \ingroup rpmio /** \ingroup rpmio
* \file rpmio/rpmcb.h * \file rpmio/rpmcb.h
*/ */
#include <rpmiotypes.h>
#include <rpmlog.h> #include <rpmlog.h>
/** /**
* @todo These convenience macros belong somewhere else. * @todo These convenience macros belong somewhere else.
*/ */
#define rpmSetVerbosity(_lvl) \ #define rpmSetVerbosity(_lvl) \
((void)rpmlogSetMask( RPMLOG_UPTO( RPMLOG_PRI(_lvl)))) ((void)rpmlogSetMask( RPMLOG_UPTO( RPMLOG_PRI(_lvl))))
#define rpmIncreaseVerbosity() \ #define rpmIncreaseVerbosity() \
((void)rpmlogSetMask(((((unsigned)(rpmlogSetMask(0) & 0xff)) << 1) | 1) )) ((void)rpmlogSetMask(((((unsigned)(rpmlogSetMask(0) & 0xff)) << 1) | 1) ))
#define rpmDecreaseVerbosity() \ #define rpmDecreaseVerbosity() \
((void)rpmlogSetMask((((int)(rpmlogSetMask(0) & 0xff)) >> 1))) ((void)rpmlogSetMask((((int)(rpmlogSetMask(0) & 0xff)) >> 1)))
#define rpmIsNormal() \ #define rpmIsNormal() \
(rpmlogSetMask(0) >= RPMLOG_MASK( RPMLOG_NOTICE )) (rpmlogSetMask(0) >= RPMLOG_MASK( RPMLOG_NOTICE ))
#define rpmIsVerbose() \ #define rpmIsVerbose() \
(rpmlogSetMask(0) >= RPMLOG_MASK( RPMLOG_INFO )) (rpmlogSetMask(0) >= RPMLOG_MASK( RPMLOG_INFO ))
#define rpmIsDebug() \ #define rpmIsDebug() \
(rpmlogSetMask(0) >= RPMLOG_MASK( RPMLOG_DEBUG )) (rpmlogSetMask(0) >= RPMLOG_MASK( RPMLOG_DEBUG ))
/*@-redef@*/ /* LCL: ??? */
typedef /*@abstract@*/ const void * fnpyKey;
/*@=redef@*/
/**
* Bit(s) to identify progress callbacks.
*/
typedef enum rpmCallbackType_e {
RPMCALLBACK_UNKNOWN = 0,
RPMCALLBACK_INST_PROGRESS = (1 << 0),
RPMCALLBACK_INST_START = (1 << 1),
RPMCALLBACK_INST_OPEN_FILE = (1 << 2),
RPMCALLBACK_INST_CLOSE_FILE = (1 << 3),
RPMCALLBACK_TRANS_PROGRESS = (1 << 4),
RPMCALLBACK_TRANS_START = (1 << 5),
RPMCALLBACK_TRANS_STOP = (1 << 6),
RPMCALLBACK_UNINST_PROGRESS = (1 << 7),
RPMCALLBACK_UNINST_START = (1 << 8),
RPMCALLBACK_UNINST_STOP = (1 << 9),
RPMCALLBACK_REPACKAGE_PROGRESS = (1 << 10),
RPMCALLBACK_REPACKAGE_START = (1 << 11),
RPMCALLBACK_REPACKAGE_STOP = (1 << 12),
RPMCALLBACK_UNPACK_ERROR = (1 << 13),
RPMCALLBACK_CPIO_ERROR = (1 << 14),
RPMCALLBACK_SCRIPT_ERROR = (1 << 15)
} rpmCallbackType;
/**
*/
typedef void * rpmCallbackData;
#ifdef __cplusplus
extern "C" {
#endif
/**
*/
typedef void * (*rpmCallbackFunction)
(/*@null@*/ const void * h,
const rpmCallbackType what,
const uint64_t amount,
const uint64_t total,
/*@null@*/ fnpyKey key,
/*@null@*/ rpmCallbackData data)
/*@globals internalState@*/
/*@modifies internalState@*/;
/**
*/
/*@unused@*/
void urlSetCallback(rpmCallbackFunction notify, rpmCallbackData notifyData,
int notifyCount);
#ifdef __cplusplus
}
#endif
#endif /* H_RPMCB */ #endif /* H_RPMCB */
 End of changes. 2 change blocks. 
57 lines changed or deleted 1 lines changed or added


 rpmdav.h   rpmdav.h 
#ifndef RPMDAV_H #ifndef RPMDAV_H
#define RPMDAV_H #define RPMDAV_H
/** \ingroup rpmio /** \ingroup rpmio
* \file rpmio/rpmdav.h * \file rpmio/rpmdav.h
*/ */
#include <argv.h> #include <argv.h>
/**
*/
/*@unchecked@*/
extern int rpmioHttpReadTimeoutSecs;
/*@unchecked@*/
extern int rpmioHttpConnectTimeoutSecs;
/*@unchecked@*/ /*@null@*/
extern const char * rpmioHttpAccept;
/*@unchecked@*/ /*@null@*/
extern const char * rpmioHttpUserAgent;
#if defined(_RPMDAV_INTERNAL) #if defined(_RPMDAV_INTERNAL)
struct __dirstream { struct __dirstream {
int fd; /* File descriptor. */ int fd; /* File descriptor. */
char * data; /* Directory block. */ char * data; /* Directory block. */
size_t allocation; /* Space allocated for the block. */ size_t allocation; /* Space allocated for the block. */
size_t size; /* Total valid data in the block. */ size_t size; /* Total valid data in the block. */
size_t offset; /* Current offset into the block. */ size_t offset; /* Current offset into the block. */
off_t filepos; /* Position of next entry to read. */ off_t filepos; /* Position of next entry to read. */
#if defined(HAVE_PTHREAD_H) #if defined(WITH_PTHREADS)
pthread_mutex_t lock; /* Mutex lock for this structure. */ pthread_mutex_t lock; /* Mutex lock for this structure. */
#endif #endif
}; };
#endif #endif
#if !defined(DT_DIR) || defined(__APPLE__) #if !defined(DT_DIR) || defined(__APPLE__)
# define DT_UNKNOWN 0 # define DT_UNKNOWN 0
# define DT_FIFO 1 # define DT_FIFO 1
# define DT_CHR 2 # define DT_CHR 2
# define DT_DIR 4 # define DT_DIR 4
# define DT_BLK 6 # define DT_BLK 6
# define DT_REG 8 # define DT_REG 8
# define DT_LNK 10 # define DT_LNK 10
# define DT_SOCK 12 # define DT_SOCK 12
# define DT_WHT 14 # define DT_WHT 14
typedef struct __dirstream * AVDIR; typedef struct __dirstream * AVDIR;
typedef struct __dirstream * DAVDIR; typedef struct __dirstream * DAVDIR;
#else #else
# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__) # if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__OpenBSD__)
typedef struct __dirstream * AVDIR; typedef struct __dirstream * AVDIR;
typedef struct __dirstream * DAVDIR; typedef struct __dirstream * DAVDIR;
#else /* __FreeBSD__ */ #else /* __FreeBSD__ */
typedef DIR * AVDIR; typedef DIR * AVDIR;
typedef DIR * DAVDIR; typedef DIR * DAVDIR;
#endif /* __FreeBSD__ */ #endif /* __FreeBSD__ */
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
skipping to change at line 72 skipping to change at line 83
*/ */
struct avContext_s { struct avContext_s {
/*@relnull@*/ /*@dependent@*/ /*@relnull@*/ /*@dependent@*/
void ** resrock; void ** resrock;
const char *uri; const char *uri;
/*@refcounted@*/ /*@refcounted@*/
urlinfo u; urlinfo u;
int ac; int ac;
int nalloced; int nalloced;
ARGV_t av; ARGV_t av;
/*@null@*/ /*@shared@*/ /*@relnull@*/ /*@shared@*/
struct stat *st; struct stat *st;
uint16_t * modes; /* XXX sizeof(mode_t) != sizeof(rpmmode_t) */ uint16_t * modes; /* XXX sizeof(mode_t) != sizeof(rpmmode_t) */
size_t * sizes; size_t * sizes;
time_t * mtimes; time_t * mtimes;
}; };
/** /**
*/ */
/*@null@*/ /*@null@*/
void * avContextDestroy(/*@only@*/ /*@null@*/ avContext ctx) void * avContextDestroy(/*@only@*/ /*@null@*/ avContext ctx)
skipping to change at line 134 skipping to change at line 145
* @return argv DIR * @return argv DIR
*/ */
/*@null@*/ /*@null@*/
DIR * avOpendir(const char * path, DIR * avOpendir(const char * path,
/*@null@*/ const char ** av, /*@null@*/ uint16_t * modes) /*@null@*/ const char ** av, /*@null@*/ uint16_t * modes)
/*@globals fileSystem, internalState @*/ /*@globals fileSystem, internalState @*/
/*@modifies fileSystem, internalState @*/; /*@modifies fileSystem, internalState @*/;
#endif #endif
/** /**
* Close active neon transfer(s) (if any).
* @param _u URL container
* @return 0 on sucess
*/
int davDisconnect(void * _u)
/*@globals internalState @*/
/*@modifies _u, internalState @*/;
/**
* Free persistent neon session state.
* @param u URL container
* @return 0 on success
*/ */
int davFree(urlinfo u) int davFree(urlinfo u)
/*@globals internalState @*/ /*@globals internalState @*/
/*@modifies u, internalState @*/; /*@modifies u, internalState @*/;
/** /**
* Free global neon+openSSL state memory.
*/ */
void davDestroy(void) void davDestroy(void)
/*@globals internalState @*/ /*@globals internalState @*/
/*@modifies internalState @*/; /*@modifies internalState @*/;
/** /**
* Send a http request. * Send a http request.
* @param ctrl connection stream * @param ctrl connection stream
* @param httpCmd http command * @param httpCmd http command
* @param httpArg http command argument (NULL if none) * @param httpArg http command argument (NULL if none)
skipping to change at line 191 skipping to change at line 215
/*@modifies *uret, internalState @*/; /*@modifies *uret, internalState @*/;
/*@null@*/ /*@null@*/
FD_t httpOpen(const char * url, /*@unused@*/ int flags, FD_t httpOpen(const char * url, /*@unused@*/ int flags,
/*@unused@*/ mode_t mode, /*@out@*/ urlinfo * uret) /*@unused@*/ mode_t mode, /*@out@*/ urlinfo * uret)
/*@globals internalState @*/ /*@globals internalState @*/
/*@modifies *uret, internalState @*/; /*@modifies *uret, internalState @*/;
/** /**
*/ */
/*@-incondefs@*/
ssize_t davRead(void * cookie, /*@out@*/ char * buf, size_t count) ssize_t davRead(void * cookie, /*@out@*/ char * buf, size_t count)
/*@globals fileSystem, internalState @*/ /*@globals errno, fileSystem, internalState @*/
/*@modifies buf, fileSystem, internalState @*/ /*@modifies buf, errno, fileSystem, internalState @*/;
/*@requires maxSet(buf) >= (count - 1) @*/
/*@ensures maxRead(buf) == result @*/;
/*@=incondefs@*/
/** /**
*/ */
ssize_t davWrite(void * cookie, const char * buf, size_t count) ssize_t davWrite(void * cookie, const char * buf, size_t count)
/*@globals fileSystem, internalState @*/ /*@globals fileSystem, internalState @*/
/*@modifies fileSystem, internalState @*/; /*@modifies fileSystem, internalState @*/;
/** /**
*/ */
int davSeek(void * cookie, _libio_pos_t pos, int whence) int davSeek(void * cookie, _libio_pos_t pos, int whence)
 End of changes. 8 change blocks. 
9 lines changed or deleted 29 lines changed or added


 rpmdb.h   rpmdb.h 
skipping to change at line 52 skipping to change at line 52
/** \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 <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").
* Note: In rpm-3.0.4 and earlier, this structure was passed by value, * Note: In rpm-3.0.4 and earlier, this structure was passed by value,
* and was identical to the "data saved" structure below. * and was identical to the "data saved" structure below.
*/ */
struct _dbiIndexItem { struct _dbiIndexItem {
uint32_t hdrNum; /*!< header instance in db */ uint32_t hdrNum; /*!< header instance in db */
uint32_t tagNum; /*!< tag index in header */ uint32_t tagNum; /*!< tag index in header */
uint32_t fpNum; /*!< finger print index */ uint32_t fpNum; /*!< finger print index */
skipping to change at line 84 skipping to change at line 86
* 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 */ int dbv_major; /*!< Berkeley db version major */
int dbv_minor; /*!< Berkeley db version minor */ int dbv_minor; /*!< Berkeley db version minor */
int dbv_patch; /*!< Berkeley db version patch */ int dbv_patch; /*!< Berkeley 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 rpmtag rpm tag * @param tag rpm tag
* @return 0 on success * @return 0 on success
*/ */
int (*open) (rpmdb rpmdb, rpmTag rpmtag, /*@out@*/ dbiIndex * dbip) int (*open) (rpmdb rpmdb, rpmTag tag, /*@out@*/ dbiIndex * dbip)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies *dbip, fileSystem @*/; /*@modifies *dbip, fileSystem @*/;
/** \ingroup dbi /** \ingroup dbi
* Close index database, and destroy database handle. * Close index database, and destroy database handle.
* @param dbi index database handle * @param dbi index database handle
* @param flags (unused) * @param flags (unused)
* @return 0 on success * @return 0 on success
*/ */
int (*close) (/*@only@*/ dbiIndex dbi, unsigned int flags) int (*close) (/*@only@*/ dbiIndex dbi, unsigned int flags)
skipping to change at line 418 skipping to change at line 420
/*@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. */
/*@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 pen 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. */
skipping to change at line 465 skipping to change at line 468
void * db_dbenv; /*!< Berkeley DB_ENV handle. */ void * db_dbenv; /*!< Berkeley DB_ENV 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__)
/*@refs@*/ /*@refs@*/
int nrefs; /*!< Reference count. */ int nrefs; /*!< (unused) keep splint happy */
#endif
}; };
#endif /* defined(_RPMDB_INTERNAL) */ #endif /* defined(_RPMDB_INTERNAL) */
/* for RPM's internal use only */ /* for RPM's internal use only */
/** \ingroup rpmdb /** \ingroup rpmdb
*/ */
enum rpmdbFlags { enum rpmdbFlags {
RPMDB_FLAG_JUSTCHECK = (1 << 0), RPMDB_FLAG_JUSTCHECK = (1 << 0),
RPMDB_FLAG_MINIMAL = (1 << 1), RPMDB_FLAG_MINIMAL = (1 << 1),
skipping to change at line 492 skipping to change at line 497
#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
* @param rpmtag rpm tag * @param tag rpm tag
* @return index database handle * @return index database handle
*/ */
/*@unused@*/ /*@only@*/ /*@null@*/ /*@unused@*/ /*@only@*/ /*@null@*/
dbiIndex db3New(rpmdb rpmdb, rpmTag rpmtag) 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)
skipping to change at line 525 skipping to change at line 530
/*@-redecl@*/ /*@-redecl@*/
/*@exposed@*/ /*@exposed@*/
extern const char * prDbiOpenFlags(int dbflags, int print_dbenv_flags) extern const char * prDbiOpenFlags(int dbflags, int print_dbenv_flags)
/*@*/; /*@*/;
/*@=redecl@*/ /*@=redecl@*/
#endif #endif
/** \ingroup dbi /** \ingroup dbi
* Return handle for an index database. * Return handle for an index database.
* @param db rpm database * @param db rpm database
* @param rpmtag rpm tag * @param tag rpm tag
* @param flags (unused) * @param flags (unused)
* @return index database handle * @return index database handle
*/ */
/*@only@*/ /*@null@*/ dbiIndex dbiOpen(/*@null@*/ rpmdb db, rpmTag rpmtag, /*@only@*/ /*@null@*/ dbiIndex dbiOpen(/*@null@*/ rpmdb db, rpmTag tag,
unsigned int flags) unsigned int flags)
/*@globals rpmGlobalMacroContext, errno, h_errno @*/ /*@globals rpmGlobalMacroContext, errno, h_errno, internalState @*/
/*@modifies db, rpmGlobalMacroContext, errno @*/; /*@modifies db, rpmGlobalMacroContext, errno, internalState @*/;
/** /**
* Return dbiStats accumulator structure. * Return dbiStats accumulator structure.
* @param dbi index database handle * @param dbi index database handle
* @param opx per-rpmdb accumulator index (aka rpmtsOpX) * @param opx per-rpmdb accumulator index (aka rpmtsOpX)
* @return per-rpmdb accumulator pointer * @return per-rpmdb accumulator pointer
*/ */
void * dbiStatsAccumulator(dbiIndex dbi, int opx) void * dbiStatsAccumulator(dbiIndex dbi, int opx)
/*@*/; /*@*/;
skipping to change at line 873 skipping to change at line 878
/** \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@*/
rpmdb rpmdbUnlink (/*@killref@*/ /*@only@*/ rpmdb db, const char * msg) rpmdb rpmdbUnlink (/*@killref@*/ /*@only@*/ rpmdb db, const char * msg)
/*@modifies db @*/; /*@modifies db @*/;
#define rpmdbUnlink(_db, _msg) \
/** @todo Remove debugging entry from the ABI. */ ((rpmdb)rpmioUnlinkPoolItem((rpmioItem)(_db), _msg, __FILE__, __LINE
/*@-exportlocal@*/ __))
/*@null@*/
rpmdb XrpmdbUnlink (/*@killref@*/ /*@only@*/ rpmdb db, const char * msg,
const char * fn, unsigned ln)
/*@modifies db @*/;
/*@=exportlocal@*/
#define rpmdbUnlink(_db, _msg) XrpmdbUnlink(_db, _msg, __FILE__, __
LINE__)
/** \ingroup rpmdb /** \ingroup rpmdb
* Reference a database instance. * Reference a database instance.
* @param db rpm database * @param db rpm database
* @param msg * @param msg
* @return new rpm database reference * @return new rpm database reference
*/ */
/*@unused@*/ /*@unused@*/ /*@newref@*/
rpmdb rpmdbLink (rpmdb db, const char * msg) rpmdb rpmdbLink (rpmdb db, const char * msg)
/*@modifies db @*/; /*@modifies db @*/;
#define rpmdbLink(_db, _msg) \
/** @todo Remove debugging entry from the ABI. */ ((void *)rpmioLinkPoolItem((rpmioItem)(_db), _msg, __FILE__, __LINE_
/*@-exportlocal@*/ _))
rpmdb XrpmdbLink (rpmdb db, const char * msg,
const char * fn, unsigned ln)
/*@modifies db @*/;
/*@=exportlocal@*/
#define rpmdbLink(_db, _msg) XrpmdbLink(_db, _msg, __FILE__, __LI
NE__)
/** @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, int perms, int flags)
/*@globals fileSystem, internalState @*/
/*@modifies fileSystem, internalState @*/;
/** @todo document rpmdbOpenDatabase /** @todo document rpmdbOpenDatabase
*/ */
int rpmdbOpenDatabase(/*@null@*/ const char * prefix, int rpmdbOpenDatabase(/*@null@*/ const char * prefix,
/*@null@*/ const char * dbpath, /*@null@*/ const char * dbpath,
int _dbapi, /*@null@*/ /*@out@*/ rpmdb *dbp, int _dbapi, /*@null@*/ /*@out@*/ rpmdb *dbp,
int mode, int perms, int flags) int mode, int perms, int flags)
/*@globals rpmGlobalMacroContext, h_errno, /*@globals rpmGlobalMacroContext, h_errno,
fileSystem, internalState @*/ fileSystem, internalState @*/
/*@modifies *dbp, rpmGlobalMacroContext, /*@modifies *dbp, rpmGlobalMacroContext,
skipping to change at line 963 skipping to change at line 957
* @param prefix path to top of install tree * @param prefix path to top of install tree
* @return 0 on success * @return 0 on success
*/ */
int rpmdbVerify(/*@null@*/ const char * prefix) int rpmdbVerify(/*@null@*/ const char * prefix)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies rpmGlobalMacroContext, 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 rpmtag 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 rpmtag) int rpmdbBlockDBI(/*@null@*/ rpmdb db, int tag)
/*@modifies db @*/; /*@modifies db @*/;
/** /**
* Close a single database index. * Close a single database index.
* @param db rpm database * @param db rpm database
* @param rpmtag rpm tag * @param tag rpm tag
* @return 0 on success * @return 0 on success
*/ */
int rpmdbCloseDBI(/*@null@*/ rpmdb db, int rpmtag) int rpmdbCloseDBI(/*@null@*/ rpmdb db, int tag)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies db, fileSystem @*/; /*@modifies db, fileSystem @*/;
/** \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 @*/
skipping to change at line 1004 skipping to change at line 998
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies fileSystem @*/; /*@modifies fileSystem @*/;
/** \ingroup rpmdb /** \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 @*/ /*@globals rpmGlobalMacroContext, h_errno, internalState @*/
/*@modifies db, rpmGlobalMacroContext @*/; /*@modifies db, rpmGlobalMacroContext, internalState @*/;
/*@=exportlocal@*/ /*@=exportlocal@*/
/** \ingroup rpmdb /** \ingroup rpmdb
* Return number of instances of key in a tag index. * Return number of instances of key in a tag index.
* @param db rpm database * @param db rpm database
* @param tag rpm tag * @param tag rpm tag
* @param keyp key data * @param keyp key data
* @param keylen key data length (0 will use strlen(keyp)) * @param keylen key data length (0 will use strlen(keyp))
* @return number of instances * @return number of instances
*/ */
skipping to change at line 1088 skipping to change at line 1082
/** \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
*/ */
int rpmdbSetIteratorRE(/*@null@*/ rpmdbMatchIterator mi, rpmTag tag, int rpmdbSetIteratorRE(/*@null@*/ rpmdbMatchIterator mi, rpmTag tag,
rpmMireMode mode, /*@null@*/ const char * pattern) rpmMireMode mode, /*@null@*/ const char * pattern)
/*@globals rpmGlobalMacroContext, h_errno @*/ /*@globals rpmGlobalMacroContext, h_errno, internalState @*/
/*@modifies mi, mode, rpmGlobalMacroContext @*/; /*@modifies mi, mode, rpmGlobalMacroContext, internalState @*/;
/** \ingroup rpmdb /** \ingroup rpmdb
* Prepare iterator for lazy writes. * Prepare iterator for lazy writes.
* @note Must be called before rpmdbNextIterator() with CDB model database. * @note Must be called before rpmdbNextIterator() with CDB model database.
* @param mi rpm database iterator * @param mi rpm database iterator
* @param rewrite new value of rewrite * @param rewrite new value of rewrite
* @return previous value * @return previous value
*/ */
int rpmdbSetIteratorRewrite(/*@null@*/ rpmdbMatchIterator mi, int rewrite) int rpmdbSetIteratorRewrite(/*@null@*/ rpmdbMatchIterator mi, int rewrite)
/*@modifies mi @*/; /*@modifies mi @*/;
skipping to change at line 1122 skipping to change at line 1116
* @param mi rpm database iterator * @param mi rpm database iterator
* @param ts transaction set * @param ts transaction set
* @return 0 always * @return 0 always
*/ */
int rpmdbSetHdrChk(/*@null@*/ rpmdbMatchIterator mi, /*@null@*/ rpmts ts) int rpmdbSetHdrChk(/*@null@*/ rpmdbMatchIterator mi, /*@null@*/ rpmts ts)
/*@modifies mi @*/; /*@modifies mi @*/;
/** \ingroup rpmdb /** \ingroup rpmdb
* Return database iterator. * Return database iterator.
* @param db rpm database * @param db rpm database
* @param rpmtag 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@*/
rpmdbMatchIterator rpmdbInitIterator(/*@null@*/ rpmdb db, rpmTag rpmtag, rpmdbMatchIterator rpmdbInitIterator(/*@null@*/ rpmdb db, rpmTag tag,
/*@null@*/ const void * keyp, size_t keylen) /*@null@*/ 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 next package header from iteration. * Return next package header from iteration.
* @param mi rpm database iterator * @param mi rpm database iterator
* @return NULL on end of iteration. * @return NULL on end of iteration.
*/ */
/*@null@*/ /*@null@*/
skipping to change at line 1186 skipping to change at line 1180
* Return array of keys matching a pattern. * Return array of keys matching a pattern.
* @param db rpm database * @param db rpm database
* @param tag rpm tag * @param tag rpm tag
* @param mode type of pattern match * @param mode type of pattern match
* @param pat pattern to match * @param pat pattern to match
* @retval *argvp array of keys that match * @retval *argvp array of keys that match
* @return 0 on success * @return 0 on success
*/ */
int rpmdbMireApply(rpmdb db, rpmTag tag, rpmMireMode mode, const char * pat , int rpmdbMireApply(rpmdb db, rpmTag tag, rpmMireMode mode, const char * pat ,
const char *** argvp) const char *** argvp)
/*@modifies db, *argvp */; /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState
@*/
/*@modifies db, *argvp,
rpmGlobalMacroContext, fileSystem, internalState @*/;
/** \ingroup rpmdb /** \ingroup rpmdb
* Add package header to rpm database and indices. * Add package header to rpm database and indices.
* @param db rpm database * @param db rpm database
* @param iid install transaction id (iid = 0 or -1 to skip) * @param iid install transaction id (iid = 0 or -1 to skip)
* @param h header * @param h header
* @param ts (unused) transaction set (or NULL) * @param ts (unused) transaction set (or NULL)
* @return 0 on success * @return 0 on success
*/ */
int rpmdbAdd(/*@null@*/ rpmdb db, int iid, Header h, /*@null@*/ rpmts ts) int rpmdbAdd(/*@null@*/ rpmdb db, int iid, Header h, /*@null@*/ rpmts ts)
 End of changes. 25 change blocks. 
41 lines changed or deleted 38 lines changed or added


 rpmds.h   rpmds.h 
skipping to change at line 23 skipping to change at line 23
/** \ingroup rpmds /** \ingroup rpmds
*/ */
/*@-exportlocal@*/ /*@-exportlocal@*/
/*@unchecked@*/ /*@unchecked@*/
extern int _rpmds_debug; extern int _rpmds_debug;
/*@=exportlocal@*/ /*@=exportlocal@*/
/** \ingroup rpmds /** \ingroup rpmds
*/ */
/*@unchecked@*/ /*@observer@*/ /*@owned@*/ /*@relnull@*/ /*@unchecked@*/ /*@observer@*/ /*@owned@*/ /*@null@*/
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"
/** \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. */
/*@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. */
/*@refcounted@*/ /*@null@*/ /*@refcounted@*/ /*@null@*/
Header h; /*!< Header for dependency set (or NULL) */ Header h; /*!< Header for dependency set (or NULL) */
/*@only@*/ /*@relnull@*/ /*@only@*/ /*@relnull@*/
const char ** N; /*!< Name. */ const char ** N; /*!< Name. */
/*@only@*/ /*@relnull@*/ /*@only@*/ /*@relnull@*/
const char ** EVR; /*!< Epoch-Version-Release. */ const char ** EVR; /*!< Epoch-Version-Release. */
skipping to change at line 61 skipping to change at line 64
uint32_t * Color; /*!< Bit(s) calculated from file color(s). * / uint32_t * Color; /*!< Bit(s) calculated from file color(s). * /
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
uint32_t * Refs; /*!< No. of file refs. */ uint32_t * Refs; /*!< No. of file refs. */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
int32_t * Result; /*!< Dependency check result. */ int32_t * Result; /*!< Dependency check result. */
/*@null@*/ /*@null@*/
int (*EVRparse) (const char *evrstr, EVR_t evr); /* EVR parsing. */ int (*EVRparse) (const char *evrstr, EVR_t evr); /* EVR parsing. */
int (*EVRcmp) (const char *a, const char *b); /* EVR comparison. */ int (*EVRcmp) (const char *a, const char *b); /* EVR comparison. */
struct rpmns_s ns; /*!< Name (split). */ struct rpmns_s ns; /*!< Name (split). */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
miRE exclude; /*!< Iterator exclude patterns. */
int nexclude; /*!< No. of exclude patterns. */
/*@only@*/ /*@null@*/
miRE include; /*!< Iterator include patterns. */
int ninclude; /*!< No. of include patterns. */
/*@only@*/ /*@null@*/
const char * A; /*!< Arch (from containing package). */ const char * A; /*!< Arch (from containing package). */
uint32_t BT; /*!< Package build time tie breaker. */ uint32_t BT; /*!< Package build time tie breaker. */
rpmTag tagN; /*!< Header tag. */ rpmTag tagN; /*!< Header tag. */
uint32_t Count; /*!< No. of elements */ uint32_t Count; /*!< No. of elements */
int i; /*!< Element index. */ int i; /*!< Element index. */
unsigned l; /*!< Low element (bsearch). */ unsigned l; /*!< Low element (bsearch). */
unsigned u; /*!< High element (bsearch). */ unsigned u; /*!< High element (bsearch). */
int nopromote; /*!< Don't promote Epoch: in rpmdsCompare()? */ int nopromote; /*!< Don't promote Epoch: in rpmdsCompare()? */
#if defined(__LCLINT__)
/*@refs@*/ /*@refs@*/
int nrefs; /*!< Reference count. */ int nrefs; /*!< (unused) keep splint happy */
#endif
}; };
#endif /* _RPMDS_INTERNAL */ #endif /* _RPMDS_INTERNAL */
#if defined(_RPMPRCO_INTERNAL) #if defined(_RPMPRCO_INTERNAL)
/** \ingroup rpmds /** \ingroup rpmds
* Container for provides/requires/conflicts/obsoletes dependency set(s). * Container for provides/requires/conflicts/obsoletes dependency set(s).
*/ */
struct rpmPRCO_s { struct rpmPRCO_s {
struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */
/*@dependent@*/ /*@relnull@*/ /*@dependent@*/ /*@relnull@*/
rpmds * Pdsp; /*!< Provides: collector. */ rpmds * Pdsp; /*!< Provides: collector. */
/*@dependent@*/ /*@relnull@*/ /*@dependent@*/ /*@relnull@*/
rpmds * Rdsp; /*!< Requires: collector. */ rpmds * Rdsp; /*!< Requires: collector. */
/*@dependent@*/ /*@relnull@*/ /*@dependent@*/ /*@relnull@*/
rpmds * Cdsp; /*!< Conflicts: collector. */ rpmds * Cdsp; /*!< Conflicts: collector. */
/*@dependent@*/ /*@relnull@*/ /*@dependent@*/ /*@relnull@*/
rpmds * Odsp; /*!< Obsoletes: collector. */ rpmds * Odsp; /*!< Obsoletes: collector. */
/*@dependent@*/ /*@relnull@*/ /*@dependent@*/ /*@relnull@*/
rpmds * Tdsp; /*!< Triggers collector. */ rpmds * Tdsp; /*!< Triggers collector. */
skipping to change at line 109 skipping to change at line 121
/*@refcounted@*/ /*@null@*/ /*@refcounted@*/ /*@null@*/
rpmds C; /*!< Conflicts: */ rpmds C; /*!< Conflicts: */
/*@refcounted@*/ /*@null@*/ /*@refcounted@*/ /*@null@*/
rpmds O; /*!< Obsoletes: */ rpmds O; /*!< Obsoletes: */
/*@refcounted@*/ /*@null@*/ /*@refcounted@*/ /*@null@*/
rpmds T; /*!< Triggers */ rpmds T; /*!< Triggers */
/*@refcounted@*/ /*@null@*/ /*@refcounted@*/ /*@null@*/
rpmds D; /*!< Dirnames */ rpmds D; /*!< Dirnames */
/*@refcounted@*/ /*@null@*/ /*@refcounted@*/ /*@null@*/
rpmds L; /*!< Linktos */ rpmds L; /*!< Linktos */
#if defined(__LCLINT__)
/*@refs@*/
int nrefs; /*!< (unused) keep splint happy */
#endif
}; };
#endif /* _RPMPRCO_INTERNAL */ #endif /* _RPMPRCO_INTERNAL */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** \name RPMDS */ /** \name RPMDS */
/*@{*/ /*@{*/
/** \ingroup rpmds /** \ingroup rpmds
* Unreference a dependency set instance. * Unreference a dependency set instance.
* @param ds dependency set * @param ds dependency set
* @param msg * @param msg
* @return NULL always * @return NULL on last dereference
*/ */
/*@unused@*/ /*@null@*/ /*@unused@*/ /*@null@*/
rpmds rpmdsUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmds ds, rpmds rpmdsUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmds ds,
/*@null@*/ const char * msg) /*@null@*/ const char * msg)
/*@modifies ds @*/; /*@modifies ds @*/;
#define rpmdsUnlink(_ds, _msg) \
/** @todo Remove debugging entry from the ABI. */ ((rpmds)rpmioUnlinkPoolItem((rpmioItem)(_ds), _msg, __FILE__, __LINE__)
/*@-exportlocal@*/ )
/*@null@*/
rpmds XrpmdsUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmds ds,
/*@null@*/ const char * msg, const char * fn, unsigned ln)
/*@modifies ds @*/;
/*@=exportlocal@*/
#define rpmdsUnlink(_ds, _msg) XrpmdsUnlink(_ds, _msg, __FILE__, __
LINE__)
/** \ingroup rpmds /** \ingroup rpmds
* Reference a dependency set instance. * Reference a dependency set instance.
* @param ds dependency set * @param ds dependency set
* @param msg * @param msg
* @return new dependency set reference * @return new dependency set reference
*/ */
/*@unused@*/ /*@newref@*/ /*@null@*/ /*@unused@*/ /*@newref@*/ /*@null@*/
rpmds rpmdsLink (/*@null@*/ rpmds ds, /*@null@*/ const char * msg) rpmds rpmdsLink (/*@null@*/ rpmds ds, /*@null@*/ const char * msg)
/*@modifies ds @*/; /*@modifies ds @*/;
#define rpmdsLink(_ds, _msg) \
/** @todo Remove debugging entry from the ABI. */ ((rpmds)rpmioLinkPoolItem((rpmioItem)(_ds), _msg, __FILE__, __LINE__))
/*@newref@*/ /*@null@*/
rpmds XrpmdsLink (/*@null@*/ rpmds ds, /*@null@*/ const char * msg,
const char * fn, unsigned ln)
/*@modifies ds @*/;
#define rpmdsLink(_ds, _msg) XrpmdsLink(_ds, _msg, __FILE__, __LI
NE__)
/** \ingroup rpmds /** \ingroup rpmds
* Destroy a dependency set. * Destroy a dependency set.
* @param ds dependency set * @param ds dependency set
* @return NULL always * @return NULL on last dereference
*/ */
/*@null@*/ /*@null@*/
rpmds rpmdsFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmds ds) rpmds rpmdsFree(/*@killref@*/ /*@null@*/ rpmds ds)
/*@modifies ds @*/; /*@modifies ds @*/;
#define rpmdsFree(_ds) \
((rpmds)rpmioFreePoolItem((rpmioItem)(_ds), __FUNCTION__, __FILE__, __L
INE__))
/** \ingroup rpmds /** \ingroup rpmds
* Create and load a dependency set. * Create and load a dependency set.
* @param h header * @param h header
* @param tagN type of dependency * @param tagN type of dependency
* @param flags scareMem(0x1), nofilter(0x2) * @param flags scareMem(0x1), nofilter(0x2)
* @return new dependency set * @return new dependency set
*/ */
/*@null@*/ /*@null@*/
rpmds rpmdsNew(Header h, rpmTag tagN, int flags) rpmds rpmdsNew(Header h, rpmTag tagN, int flags)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
skipping to change at line 204 skipping to change at line 211
/** \ingroup rpmds /** \ingroup rpmds
* Create, load and initialize a dependency for this header. * Create, load and initialize a dependency for this header.
* @param h header * @param h header
* @param tagN type of dependency * @param tagN type of dependency
* @param Flags comparison flags * @param Flags comparison flags
* @return new dependency set * @return new dependency set
*/ */
/*@null@*/ /*@null@*/
rpmds rpmdsThis(Header h, rpmTag tagN, evrFlags Flags) rpmds rpmdsThis(Header h, rpmTag tagN, evrFlags Flags)
/*@*/; /*@globals internalState @*/
/*@modifies internalState @*/;
/** \ingroup rpmds /** \ingroup rpmds
* Create, load and initialize a dependency set of size 1. * Create, load and initialize a dependency set of size 1.
* @param tagN type of dependency * @param tagN type of dependency
* @param N name * @param N name
* @param EVR epoch:version-release * @param EVR epoch:version-release
* @param Flags comparison/context flags * @param Flags comparison/context flags
* @return new dependency set * @return new dependency set
*/ */
/*@null@*/ /*@null@*/
skipping to change at line 386 skipping to change at line 394
/** \ingroup rpmds /** \ingroup rpmds
* Set current dependency color. * Set current dependency color.
* @param ds dependency set * @param ds dependency set
* @param color new dependency color * @param color new dependency color
* @return previous dependency color * @return previous dependency color
*/ */
uint32_t rpmdsSetColor(/*@null@*/ const rpmds ds, uint32_t color) uint32_t rpmdsSetColor(/*@null@*/ const rpmds ds, uint32_t color)
/*@modifies ds @*/; /*@modifies ds @*/;
/** \ingroup rpmds /** \ingroup rpmds
* Return dependency exclude patterns.
* @param ds dependency set
* @return dependency exclude patterns (NULL if not set)
*/
/*@null@*/
void * rpmdsExclude(/*@null@*/ const rpmds ds)
/*@*/;
/** \ingroup rpmds
* Return no. of dependency exclude patterns.
* @param ds dependency set
* @return dependency exclude patterns (0 if not set)
*/
int rpmdsNExclude(/*@null@*/ const rpmds ds)
/*@*/;
/** \ingroup rpmds
* Return dependency include patterns.
* @param ds dependency set
* @return dependency include patterns (NULL if not set)
*/
/*@null@*/
void * rpmdsInclude(/*@null@*/ const rpmds ds)
/*@*/;
/** \ingroup rpmds
* Return no. of dependency include patterns.
* @param ds dependency set
* @return dependency include patterns (0 if not set)
*/
int rpmdsNInclude(/*@null@*/ const rpmds ds)
/*@*/;
/** \ingroup rpmds
* Return current dependency file refs. * Return current dependency file refs.
* @param ds dependency set * @param ds dependency set
* @return current dependency file refs (0 if not set) * @return current dependency file refs (0 if not set)
*/ */
uint32_t rpmdsRefs(/*@null@*/ const rpmds ds) uint32_t rpmdsRefs(/*@null@*/ const rpmds ds)
/*@*/; /*@*/;
/** \ingroup rpmds /** \ingroup rpmds
* Set current dependency file refs. * Set current dependency file refs.
* @param ds dependency set * @param ds dependency set
skipping to change at line 687 skipping to change at line 729
/*@modifies h, rpmGlobalMacroContext, fileSystem, internalState @*/; /*@modifies h, rpmGlobalMacroContext, fileSystem, internalState @*/;
/** \ingroup rpmds /** \ingroup rpmds
* Compare package name-version-release from header with a single dependenc y. * Compare package name-version-release from header with a single dependenc y.
* @param h header * @param h header
* @param req dependency set * @param req dependency set
* @param nopromote Don't promote Epoch: in comparison? * @param nopromote Don't promote Epoch: in comparison?
* @return 1 if dependency overlaps, 0 otherwise * @return 1 if dependency overlaps, 0 otherwise
*/ */
int rpmdsNVRMatchesDep(const Header h, const rpmds req, int nopromote) int rpmdsNVRMatchesDep(const Header h, const rpmds req, int nopromote)
/*@*/; /*@globals internalState @*/
/*@modifies internalState @*/;
/** \ingroup rpmds /** \ingroup rpmds
* Negate return code for negated comparisons. * Negate return code for negated comparisons.
* @param ds dependency set * @param ds dependency set
* @param rc postive return code * @param rc postive return code
* @return return code * @return return code
*/ */
int rpmdsNegateRC(const rpmds ds, int rc) int rpmdsNegateRC(const rpmds ds, int rc)
/*@*/; /*@*/;
#if !defined(SWIG)
/** \ingroup rpmds /** \ingroup rpmds
* Return current dependency type name. * Return current dependency type name.
* @param ds dependency set * @param ds dependency set
* @return current dependency type name * @return current dependency type name
*/ */
/*@unused@*/ static inline /*@observer@*/ /*@observer@*/
const char * rpmdsTagName(/*@null@*/ const rpmds ds) const char * rpmdsType(/*@null@*/ const rpmds ds)
/*@*/ /*@*/;
{
rpmTag tagN = rpmdsTagN(ds);
switch (tagN) {
case RPMTAG_PROVIDENAME: return "Provides"; /*@notreached@*/ bre
ak;
case RPMTAG_REQUIRENAME: return "Requires"; /*@notreached@*/ bre
ak;
case RPMTAG_CONFLICTNAME: return "Conflicts"; /*@notreached@*/ bre
ak;
case RPMTAG_OBSOLETENAME: return "Obsoletes"; /*@notreached@*/ bre
ak;
case RPMTAG_TRIGGERNAME: return "Triggers"; /*@notreached@*/ bre
ak;
case RPMTAG_DIRNAMES: return "Dirnames"; /*@notreached@*/ bre
ak;
default: break;
}
return tagName(tagN);
}
#if !defined(SWIG)
/** \ingroup rpmds /** \ingroup rpmds
* Print current dependency set contents. * Print current dependency set contents.
* @param ds dependency set * @param ds dependency set
* @param fp file handle (NULL uses stderr) * @param fp file handle (NULL uses stderr)
* @return 0 always * @return 0 always
*/ */
/*@unused@*/ static inline /*@unused@*/ static inline
int rpmdsPrint(/*@null@*/ rpmds ds, /*@null@*/ FILE * fp) int rpmdsPrint(/*@null@*/ rpmds ds, /*@null@*/ FILE * fp)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies ds, *fp, fileSystem @*/ /*@modifies ds, *fp, fileSystem @*/
{ {
if (fp == NULL) if (fp == NULL)
fp = stderr; fp = stderr;
ds = rpmdsInit(ds); ds = rpmdsInit(ds);
while (rpmdsNext(ds) >= 0) while (rpmdsNext(ds) >= 0)
fprintf(fp, "%6d\t%s: %s\n", rpmdsIx(ds), rpmdsTagName(ds), rpmdsDN EVR(ds)+2); fprintf(fp, "%6d\t%s: %s\n", rpmdsIx(ds), rpmdsType(ds), rpmdsDNEVR (ds)+2);
return 0; return 0;
} }
/** \ingroup rpmds /** \ingroup rpmds
* Print current dependency set results. * Print current dependency set results.
* @param ds dependency set * @param ds dependency set
* @param fp file handle (NULL uses stderr) * @param fp file handle (NULL uses stderr)
* @return 0 always * @return 0 always
*/ */
/*@unused@*/ static inline /*@unused@*/ static inline
int rpmdsPrintResults(/*@null@*/ rpmds ds, /*@null@*/ FILE * fp) int rpmdsPrintResults(/*@null@*/ rpmds ds, /*@null@*/ FILE * fp)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies ds, *fp, fileSystem @*/ /*@modifies ds, *fp, fileSystem @*/
{ {
if (fp == NULL) if (fp == NULL)
fp = stderr; fp = stderr;
ds = rpmdsInit(ds); ds = rpmdsInit(ds);
while (rpmdsNext(ds) >= 0) { while (rpmdsNext(ds) >= 0) {
int rc = rpmdsResult(ds); int32_t rc = rpmdsResult(ds);
if (rc > 0) if (rc > 0)
continue; continue;
fprintf(fp, "%6d\t%s: %s\n", rpmdsIx(ds), rpmdsTagName(ds), rpmdsDN EVR(ds)+2); fprintf(fp, "%6d\t%s: %s\n", rpmdsIx(ds), rpmdsType(ds), rpmdsDNEVR (ds)+2);
} }
return 0; return 0;
} }
/** \ingroup rpmds /** \ingroup rpmds
* Check Provides: against Requires: and print closure results. * Check Provides: against Requires: and print closure results.
* @param P Provides: dependency set * @param P Provides: dependency set
* @param R Requires: dependency set * @param R Requires: dependency set
* @param fp file handle (NULL uses stderr) * @param fp file handle (NULL uses stderr)
* @return 0 always * @return 0 always
 End of changes. 23 change blocks. 
52 lines changed or deleted 75 lines changed or added


 rpmevr.h   rpmevr.h 
skipping to change at line 83 skipping to change at line 83
#define RPMSENSE_SENSEMASK 0x0e /* Mask to get senses, ie s erial, */ #define RPMSENSE_SENSEMASK 0x0e /* Mask to get senses, ie s erial, */
/* less, greater, equal. */ /* less, greater, equal. */
#define RPMSENSE_NOTEQUAL (RPMSENSE_EQUAL ^ RPMSENSE_SENSEMASK ) #define RPMSENSE_NOTEQUAL (RPMSENSE_EQUAL ^ RPMSENSE_SENSEMASK )
#if defined(_RPMEVR_INTERNAL) #if defined(_RPMEVR_INTERNAL)
/** \ingroup rpmds /** \ingroup rpmds
* An EVR parsing container. * An EVR parsing container.
*/ */
struct EVR_s { struct EVR_s {
/*@owned@*/
const char * str; /*!< EVR storage */ const char * str; /*!< EVR storage */
/*@observer@*/ /*@null@*/ #ifndef DYING
const char * E; /*!< Epoch */ unsigned long Elong; /*!< E converted to integer. */
unsigned long Elong; #endif
/*@observer@*/ /*@null@*/
const char * V; /*!< Version */
/*@observer@*/ /*@null@*/
const char * R; /*!< Release */
evrFlags Flags; /*!< EVR comparison flags. */ evrFlags Flags; /*!< EVR comparison flags. */
const char * F[5]; /*!< Parsed fields (\1=E, \2=V, \3=R, \4=D).
*/
#define RPMEVR_E 1
#define RPMEVR_V 2
#define RPMEVR_R 3
#define RPMEVR_D 4
}; };
#define RPMSENSE_TRIGGER \ #define RPMSENSE_TRIGGER \
(RPMSENSE_TRIGGERPREIN | RPMSENSE_TRIGGERIN | RPMSENSE_TRIGGERUN | R PMSENSE_TRIGGERPOSTUN) (RPMSENSE_TRIGGERPREIN | RPMSENSE_TRIGGERIN | RPMSENSE_TRIGGERUN | R PMSENSE_TRIGGERPOSTUN)
#define _ALL_REQUIRES_MASK (\ #define _ALL_REQUIRES_MASK (\
RPMSENSE_INTERP | \ RPMSENSE_INTERP | \
RPMSENSE_SCRIPT_PRE | \ RPMSENSE_SCRIPT_PRE | \
RPMSENSE_SCRIPT_POST | \ RPMSENSE_SCRIPT_POST | \
RPMSENSE_SCRIPT_PREUN | \ RPMSENSE_SCRIPT_PREUN | \
skipping to change at line 125 skipping to change at line 127
#define _INSTALL_ONLY_MASK \ #define _INSTALL_ONLY_MASK \
_notpre(RPMSENSE_SCRIPT_PRE|RPMSENSE_SCRIPT_POST|RPMSENSE_RPMLIB|RPMSEN SE_KEYRING) _notpre(RPMSENSE_SCRIPT_PRE|RPMSENSE_SCRIPT_POST|RPMSENSE_RPMLIB|RPMSEN SE_KEYRING)
#define _ERASE_ONLY_MASK \ #define _ERASE_ONLY_MASK \
_notpre(RPMSENSE_SCRIPT_PREUN|RPMSENSE_SCRIPT_POSTUN) _notpre(RPMSENSE_SCRIPT_PREUN|RPMSENSE_SCRIPT_POSTUN)
#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.
* @param Flags EVR inequality flags
* @param initialize Should empty defaults be initialized?
* @return initialized EVR container
*/
EVR_t rpmEVRnew(uint32_t Flags, int initialize)
/*@*/;
/** \ingroup rpmtd
* Destroy an EVR container.
* @param EVR container
* @return NULL always
*/
/*@null@*/
EVR_t rpmEVRfree(/*@only@*/ EVR_t evr)
/*@modifies evr @*/;
/** \ingroup rpmds
* Segmented string compare. * Segmented string compare.
* @param a 1st string * @param a 1st string
* @param b 2nd string * @param b 2nd string
* @return +1 if a is "newer", 0 if equal, -1 if b is "newer" * @return +1 if a is "newer", 0 if equal, -1 if b is "newer"
*/ */
int rpmEVRcmp(const char *a, const char *b) int rpmEVRcmp(const char *a, const char *b)
/*@*/; /*@*/;
/** \ingroup rpmds /** \ingroup rpmds
* Split EVR string into epoch, version, and release components. * Split EVR string into epoch, version, and release components.
* @param evrstr [epoch:]version[-release] string * @param evrstr [epoch:]version[-release] string
* @retval *evr parse results * @retval *evr parse results
* @return 0 always * @return 0 always
*/ */
int rpmEVRparse(const char * evrstr, EVR_t evr) int rpmEVRparse(const char * evrstr, EVR_t evr)
/*@modifies evrstr, evr @*/; /*@modifies evrstr, evr @*/;
/** \ingroup rpmds /** \ingroup rpmds
* Compare EVR containers. * Compare EVR containers for equality.
* @param a 1st EVR container * @param a 1st EVR container
* @param b 2nd EVR container * @param b 2nd EVR container
* @return +1 if a is "newer", 0 if equal, -1 if b is "newer" * @return +1 if a is "newer", 0 if equal, -1 if b is "newer"
*/ */
int rpmEVRcompare(const EVR_t a, const EVR_t b) int rpmEVRcompare(const EVR_t a, const EVR_t b)
/*@*/; /*@*/;
/** \ingroup rpmds /** \ingroup rpmds
* Compare EVR containers for overlap.
* @param a 1st EVR container
* @param b 2nd EVR container
* @return 1 if EVR inequalities overlap, 0 otherwise
*/
int rpmEVRoverlap(EVR_t a, EVR_t b)
/*@*/;
/** \ingroup rpmds
* Segmented string compare vector. * Segmented string compare vector.
* @param a 1st string * @param a 1st string
* @param b 2nd string * @param b 2nd string
* @return +1 if a is "newer", 0 if equal, -1 if b is "newer" * @return +1 if a is "newer", 0 if equal, -1 if b is "newer"
*/ */
extern int (*rpmvercmp)(const char *a, const char *b) extern int (*rpmvercmp)(const char *a, const char *b)
/*@*/; /*@*/;
/** /**
* 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 @*/;
/**
* Compare headers to determine which header is "newer".
* @deprecated Use rpmdsCompare instead.
* @todo Eliminate in rpm-5.1.
* @param A 1st header
* @param B 2nd header
* @return result of comparison
*/
int rpmVersionCompare(Header A, Header B)
/*@globals internalState @*/
/*@modifies internalState @*/;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* H_RPMEVR */ #endif /* H_RPMEVR */
 End of changes. 7 change blocks. 
8 lines changed or deleted 50 lines changed or added


 rpmfi.h   rpmfi.h 
skipping to change at line 68 skipping to change at line 68
RPMFILE_README = (1 << 8), /*!< from %%readme */ RPMFILE_README = (1 << 8), /*!< from %%readme */
RPMFILE_EXCLUDE = (1 << 9), /*!< from %%exclude, internal */ RPMFILE_EXCLUDE = (1 << 9), /*!< from %%exclude, internal */
RPMFILE_UNPATCHED = (1 << 10), /*!< (deprecated) placeholder (SuSE) */ RPMFILE_UNPATCHED = (1 << 10), /*!< (deprecated) placeholder (SuSE) */
RPMFILE_PUBKEY = (1 << 11), /*!< from %%pubkey */ RPMFILE_PUBKEY = (1 << 11), /*!< from %%pubkey */
RPMFILE_POLICY = (1 << 12), /*!< from %%policy */ RPMFILE_POLICY = (1 << 12), /*!< from %%policy */
RPMFILE_EXISTS = (1 << 13), /*!< did lstat(fn, st) succeed? */ RPMFILE_EXISTS = (1 << 13), /*!< did lstat(fn, st) succeed? */
RPMFILE_SPARSE = (1 << 14), /*!< was ((512*st->st_blocks) < st-> st_size) ? */ RPMFILE_SPARSE = (1 << 14), /*!< was ((512*st->st_blocks) < st-> st_size) ? */
RPMFILE_TYPED = (1 << 15), /*!< (unimplemented) from %%spook */ RPMFILE_TYPED = (1 << 15), /*!< (unimplemented) from %%spook */
RPMFILE_SOURCE = (1 << 16), /*!< from SourceN: (srpm only). */ RPMFILE_SOURCE = (1 << 16), /*!< from SourceN: (srpm only). */
RPMFILE_PATCH = (1 << 17), /*!< from PatchN: (srpm only). */ RPMFILE_PATCH = (1 << 17), /*!< from PatchN: (srpm only). */
RPMFILE_OPTIONAL = (1 << 18) /*!< from %%optional. */ RPMFILE_OPTIONAL = (1 << 18), /*!< from %%optional. */
RPMFILE_REMOVE = (1 << 19) /*!< remove file (after %post). */
} rpmfileAttrs; } rpmfileAttrs;
#define RPMFILE_SPOOK (RPMFILE_GHOST|RPMFILE_TYPED) #define RPMFILE_SPOOK (RPMFILE_GHOST|RPMFILE_TYPED)
#define RPMFILE_ALL ~(RPMFILE_NONE) #define RPMFILE_ALL ~(RPMFILE_NONE)
/**
* File disposition(s) during package install/erase transaction.
*/
typedef enum fileAction_e {
FA_UNKNOWN = 0, /*!< initial action for file ... */
FA_CREATE, /*!< ... copy in from payload. */
FA_COPYIN, /*!< ... copy in from payload. */
FA_COPYOUT, /*!< ... copy out to payload. */
FA_BACKUP, /*!< ... renamed with ".rpmorig" extension. */
FA_SAVE, /*!< ... renamed with ".rpmsave" extension. */
FA_SKIP, /*!< ... already replaced, don't remove. */
FA_ALTNAME, /*!< ... create with ".rpmnew" extension. */
FA_ERASE, /*!< ... to be removed. */
FA_SKIPNSTATE, /*!< ... untouched, state "not installed". */
FA_SKIPNETSHARED, /*!< ... untouched, state "netshared". */
FA_SKIPCOLOR /*!< ... untouched, state "wrong color". */
} fileAction;
/** \ingroup rpmfi /** \ingroup rpmfi
* File info tag sets from a header, so that a header can be discarded earl y. * File info tag sets from a header, so that a header can be discarded earl y.
*/ */
typedef /*@abstract@*/ /*@refcounted@*/ struct rpmfi_s * rpmfi; typedef /*@abstract@*/ /*@refcounted@*/ struct rpmfi_s * rpmfi;
#if defined(_RPMFI_INTERNAL) #if defined(_RPMFI_INTERNAL)
#define XFA_SKIPPING(_a) \ #include "mire.h"
((_a) == FA_SKIP || (_a) == FA_SKIPNSTATE || (_a) == FA_SKIPNETSHARED |
| (_a) == FA_SKIPCOLOR)
/** \ingroup rpmfi /** \ingroup rpmfi
* A package filename set. * A package filename set.
*/ */
struct rpmfi_s { struct rpmfi_s {
struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */
int i; /*!< Current file index. */ int i; /*!< Current file index. */
int j; /*!< Current directory index. */ int j; /*!< Current directory index. */
/*@observer@*/ /*@observer@*/
const char * Type; /*!< Tag name. */ const char * Type; /*!< Tag name. */
rpmTag tagN; /*!< Header tag. */ rpmTag tagN; /*!< Header tag. */
/*@refcounted@*/ /*@null@*/ /*@refcounted@*/ /*@null@*/
Header h; /*!< Header for file info set (or NULL) */ Header h; /*!< Header for file info set (or NULL) */
/*@only@*/ /*?null?*/ /*@only@*/ /*@relnull@*/
const char ** bnl; /*!< Base name(s) (from header) */ const char ** bnl; /*!< Base name(s) (from header) */
/*@only@*/ /*?null?*/ /*@only@*/ /*@relnull@*/
const char ** dnl; /*!< Directory name(s) (from header) */ const char ** dnl; /*!< Directory name(s) (from header) */
/*@only@*/ /*@relnull@*/ /*@only@*/ /*@relnull@*/
const char ** fdigests; /*!< File digest(s) (from header) */ const char ** fdigests; /*!< File digest(s) (from header) */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
uint32_t * fdigestalgos; /*!< File digest algorithm(s) (from header) */ uint32_t * fdigestalgos; /*!< File digest algorithm(s) (from header) */
/*@only@*/ /*@relnull@*/ /*@only@*/ /*@relnull@*/
const char ** flinks; /*!< File link(s) (from header) */ const char ** flinks; /*!< File link(s) (from header) */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
const char ** flangs; /*!< File lang(s) (from header) */ const char ** flangs; /*!< File lang(s) (from header) */
/*@only@*/ /*@relnull@*/ /*@only@*/ /*@relnull@*/
uint32_t * dil; /*!< Directory indice(s) (from header) */ uint32_t * dil; /*!< Directory indice(s) (from header) */
/*@only@*/ /*?null?*/ /*@only@*/ /*@relnull@*/
const uint32_t * fflags; /*!< File flag(s) (from header) */ const uint32_t * fflags; /*!< File flag(s) (from header) */
/*@only@*/ /*?null?*/ /*@only@*/ /*@relnull@*/
const uint32_t * fsizes; /*!< File size(s) (from header) */ const uint32_t * fsizes; /*!< File size(s) (from header) */
/*@only@*/ /*?null?*/ /*@only@*/ /*@relnull@*/
const uint32_t * fmtimes; /*!< File modification time(s) (from header) */ const uint32_t * fmtimes; /*!< File modification time(s) (from header) */
/*@only@*/ /*?null?*/ /*@only@*/ /*@relnull@*/
uint16_t * fmodes; /*!< File mode(s) (from header) */ uint16_t * fmodes; /*!< File mode(s) (from header) */
/*@only@*/ /*?null?*/ /*@only@*/ /*@relnull@*/
const uint16_t * frdevs; /*!< File rdev(s) (from header) */ const uint16_t * frdevs; /*!< File rdev(s) (from header) */
/*@only@*/ /*?null?*/ /*@only@*/ /*@relnull@*/
const uint32_t * finodes; /*!< File inodes(s) (from header) */ const uint32_t * finodes; /*!< File inodes(s) (from header) */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
const char ** fuser; /*!< File owner(s) (from header) */ const char ** fuser; /*!< File owner(s) (from header) */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
const char ** fgroup; /*!< File group(s) (from header) */ const char ** fgroup; /*!< File group(s) (from header) */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
uint8_t * fstates; /*!< File state(s) (from header) */ uint8_t * fstates; /*!< File state(s) (from header) */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
const uint32_t * fcolors; /*!< File color bits (header) */ const uint32_t * fcolors; /*!< File color bits (header) */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
const char ** fcaps; /*! File capabilities. */
/*@only@*/ /*@null@*/
const char ** fcontexts; /*! FIle security contexts. */ const char ** fcontexts; /*! FIle security contexts. */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
const char ** cdict; /*!< File class dictionary (header) */ const char ** cdict; /*!< File class dictionary (header) */
uint32_t ncdict; /*!< No. of class entries. */ uint32_t ncdict; /*!< No. of class entries. */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
const uint32_t * fcdictx; /*!< File class dictionary index (header) */ const uint32_t * fcdictx; /*!< File class dictionary index (header) */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
const uint32_t * ddict; /*!< File depends dictionary (header) */ const uint32_t * ddict; /*!< File depends dictionary (header) */
uint32_t nddict; /*!< No. of depends entries. */ uint32_t nddict; /*!< No. of depends entries. */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
const uint32_t * fddictx; /*!< File depends dictionary start (header) */ const uint32_t * fddictx; /*!< File depends dictionary start (header) */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
const uint32_t * fddictn; /*!< File depends dictionary count (header) */ const uint32_t * fddictn; /*!< File depends dictionary count (header) */
/*@only@*/ /*?null?*/ /*@only@*/ /*@relnull@*/
const uint32_t * vflags; /*!< File verify flag(s) (from header) */ const uint32_t * vflags; /*!< File verify flag(s) (from header) */
uint32_t dc; /*!< No. of directories. */ uint32_t dc; /*!< No. of directories. */
uint32_t fc; /*!< No. of files. */ uint32_t fc; /*!< No. of files. */
/*=============================*/ /*=============================*/
/*@dependent@*/ /*@relnull@*/ /*@dependent@*/ /*@relnull@*/
void * te; void * te;
/*@only@*/ /*@null@*/
miRE exclude; /*!< Iterator exclude patterns. */
int nexclude; /*!< No. of exclude patterns. */
/*@only@*/ /*@null@*/
miRE include; /*!< Iterator 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). */
uint32_t flags; /*!< File flags (default). */ uint32_t flags; /*!< File flags (default). */
fileAction action; /*!< File disposition (default). */ int action; /*!< File disposition (default). */
/*@owned@*/ /*@relnull@*/ /*@owned@*/ /*@relnull@*/
fileAction * actions; /*!< File disposition(s). */ int * actions; /*!< File disposition(s). */
/*@owned@*/ /*@owned@*/
struct fingerPrint_s * fps; /*!< File fingerprint(s). */ struct fingerPrint_s * fps; /*!< File fingerprint(s). */
/*@owned@*/ /*@owned@*/
const char ** obnl; /*!< Original basename(s) (from head er) */ const char ** obnl; /*!< Original basename(s) (from head er) */
/*@owned@*/ /*@owned@*/
const char ** odnl; /*!< Original dirname(s) (from heade r) */ const char ** odnl; /*!< Original dirname(s) (from heade r) */
/*@unused@*/ /*@unused@*/
uint32_t * odil; /*!< Original dirindex(s) (from header) */ uint32_t * odil; /*!< Original dirindex(s) (from header) */
/*@only@*/ /*@relnull@*/ /*@only@*/ /*@relnull@*/
skipping to change at line 218 skipping to change at line 211
/*@only@*/ /*@relnull@*/ /*@only@*/ /*@relnull@*/
const char * posttrans; const char * posttrans;
/*@only@*/ /*@relnull@*/ /*@only@*/ /*@relnull@*/
const char * posttransprog; const char * posttransprog;
/*@only@*/ /*@relnull@*/ /*@only@*/ /*@relnull@*/
const char * verifyscript; const char * verifyscript;
/*@only@*/ /*@relnull@*/ /*@only@*/ /*@relnull@*/
const char * verifyscriptprog; const char * verifyscriptprog;
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
char * fn; /*!< File name buffer. */ char * fn; /*!< File name buffer, fnlen + 1 bytes. */
size_t fnlen; /*!< File name buffer length. */ size_t fnlen; /*!< Maximum file name length (without '\0')
. */
size_t astriplen; size_t astriplen;
size_t striplen; size_t striplen;
unsigned long long archivePos; unsigned long long archivePos;
unsigned long long archiveSize; unsigned long long archiveSize;
mode_t dperms; /*!< Directory perms (0755) if not mapped. * / mode_t dperms; /*!< Directory perms (0755) if not mapped. * /
mode_t fperms; /*!< File perms (0644) if not mapped. */ mode_t fperms; /*!< File perms (0644) if not mapped. */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
const char ** apath; const char ** apath;
int mapflags; int mapflags;
skipping to change at line 245 skipping to change at line 238
int isSource; /*!< Is this a SRPM? */ int isSource; /*!< Is this a SRPM? */
/*@owned@*/ /*@owned@*/
uint32_t * replacedSizes; /*!< (TR_ADDED) */ uint32_t * replacedSizes; /*!< (TR_ADDED) */
unsigned int record; /*!< (TR_REMOVED) */ unsigned int record; /*!< (TR_REMOVED) */
int magic; int magic;
#define RPMFIMAGIC 0x09697923 #define RPMFIMAGIC 0x09697923
/*=============================*/ /*=============================*/
#if defined(__LCLINT__)
/*@refs@*/ int nrefs; /*!< Reference count. */ /*@refs@*/
int nrefs; /*!< (unused) keep splint happy */
#endif
}; };
#endif /* _RPMFI_INTERNAL */ #endif /* _RPMFI_INTERNAL */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#if !defined(_RPMFI_NOMETHODS) #if !defined(_RPMFI_NOMETHODS)
/** \name RPMFI */ /** \name RPMFI */
/*@{*/ /*@{*/
/** /**
* Unreference a file info set instance. * Unreference a file info set instance.
* @param fi file info set * @param fi file info set
* @param msg * @param msg
* @return NULL always * @return NULL on last dereference
*/ */
/*@unused@*/ /*@null@*/ /*@unused@*/ /*@null@*/
rpmfi rpmfiUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmfi fi, rpmfi rpmfiUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmfi fi,
/*@null@*/ const char * msg) /*@null@*/ const char * msg)
/*@modifies fi @*/; /*@modifies fi @*/;
#define rpmfiUnlink(_fi, _msg) \
/** @todo Remove debugging entry from the ABI. ((rpmfi) rpmioUnlinkPoolItem((rpmioItem)(_fi), _msg, __FILE__, __LINE__
* @param fi file info set ))
* @param msg
* @param fn
* @param ln
* @return NULL always
*/
/*@-exportlocal@*/
/*@null@*/
rpmfi XrpmfiUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmfi fi,
/*@null@*/ const char * msg, const char * fn, unsigned ln)
/*@modifies fi @*/;
/*@=exportlocal@*/
#define rpmfiUnlink(_fi, _msg) XrpmfiUnlink(_fi, _msg, __FILE__, __L
INE__)
/** /**
* Reference a file info set instance. * Reference a file info set instance.
* @param fi file info set * @param fi file info set
* @param msg * @param msg
* @return new file info set reference * @return new file info set reference
*/ */
/*@unused@*/ /*@null@*/ /*@unused@*/ /*@null@*/
rpmfi rpmfiLink (/*@null@*/ rpmfi fi, /*@null@*/ const char * msg) rpmfi rpmfiLink (/*@null@*/ rpmfi fi, /*@null@*/ const char * msg)
/*@modifies fi @*/; /*@modifies fi @*/;
#define rpmfiLink(_fi, _msg) \
/** @todo Remove debugging entry from the ABI. ((rpmfi) rpmioLinkPoolItem((rpmioItem)(_fi), _msg, __FILE__, __LINE__))
* @param fi file info set
* @param msg
* @param fn
* @param ln
* @return NULL always
*/
/*@null@*/
rpmfi XrpmfiLink (/*@null@*/ rpmfi fi, /*@null@*/ const char * msg,
const char * fn, unsigned ln)
/*@modifies fi @*/;
#define rpmfiLink(_fi, _msg) XrpmfiLink(_fi, _msg, __FILE__, __LI
NE__)
/** /**
* Return file count from file info set. * Return file count from file info set.
* @param fi file info set * @param fi file info set
* @return current file count * @return current file count
*/ */
int rpmfiFC(/*@null@*/ rpmfi fi) int rpmfiFC(/*@null@*/ rpmfi fi)
/*@*/; /*@*/;
/** /**
skipping to change at line 582 skipping to change at line 553
/** /**
* 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
* Return file info exclude patterns.
* @param fi file info set
* @return file info exclude patterns (NULL if not set)
*/
/*@null@*/
void * rpmfiExclude(/*@null@*/ const rpmfi fi)
/*@*/;
/** \ingroup rpmfi
* Return no. of file info exclude patterns.
* @param fi file info set
* @return file info exclude patterns (0 if not set)
*/
int rpmfiNExclude(/*@null@*/ const rpmfi fi)
/*@*/;
/** \ingroup rpmfi
* Return file info include patterns.
* @param fi file info set
* @return file info include patterns (NULL if not set)
*/
/*@null@*/
void * rpmfiInclude(/*@null@*/ const rpmfi fi)
/*@*/;
/** \ingroup rpmfi
* Return no. of file info include patterns.
* @param fi file info set
* @return file info include patterns (0 if not set)
*/
int rpmfiNInclude(/*@null@*/ const 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 626 skipping to change at line 631
rpmfi rpmfiInitD(/*@null@*/ rpmfi fi, int dx) rpmfi rpmfiInitD(/*@null@*/ rpmfi fi, int dx)
/*@modifies fi @*/; /*@modifies fi @*/;
/** /**
* Link a header to a file info set. * Link a header to a file info set.
* @param fi file info set * @param fi file info set
* @param h header * @param h header
* @return 0 always * @return 0 always
*/ */
int rpmfiSetHeader(rpmfi fi, /*@null@*/ Header h) int rpmfiSetHeader(rpmfi fi, /*@null@*/ Header h)
/*@modifies fi @*/; /*@modifies fi, h @*/;
/** /**
* Destroy a file info set. * Destroy a file info set.
* @param fi file info set * @param fi file info set
* @return NULL always * @return NULL on last dereference
*/ */
/*@null@*/ /*@null@*/
rpmfi rpmfiFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmfi fi) rpmfi rpmfiFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmfi fi)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies fi, fileSystem @*/; /*@modifies fi, fileSystem @*/;
#define rpmfiFree(_fi) \
((rpmfi) rpmioFreePoolItem((rpmioItem)(_fi), __FUNCTION__, __FILE__, __
LINE__))
/** /**
* Create and load a file info set. * Create and load a file info set.
* @param _ts transaction set (NULL skips path relocation) * @param _ts transaction set (NULL skips path relocation)
* @param h header * @param h header
* @param tagN RPMTAG_BASENAMES * @param tagN RPMTAG_BASENAMES
* @param flags scareMem(0x1), nofilter(0x2) * @param flags scareMem(0x1), nofilter(0x2)
* @return new file info set * @return new file info set
*/ */
/*@null@*/ /*@null@*/
skipping to change at line 658 skipping to change at line 665
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies _ts, h, rpmGlobalMacroContext, fileSystem, internalState @*/; /*@modifies _ts, h, rpmGlobalMacroContext, fileSystem, internalState @*/;
/** /**
* Return current stat(2) data from file info set. * Return current stat(2) data from file info set.
* @param fi file info set * @param fi file info set
* @retval *st stat(2) data * @retval *st stat(2) data
* @return -1 on error, 0 on success * @return -1 on error, 0 on success
*/ */
int rpmfiFStat(rpmfi fi, /*@out@*/ struct stat * st) int rpmfiFStat(rpmfi fi, /*@out@*/ struct stat * st)
/*@*/; /*@modifies *st @*/;
/** /**
* Return lstat(2) data of path from file info set. * Return lstat(2) data of path from file info set.
* @param fi file info set * @param fi file info set
* @param path file path * @param path file path
* @retval *st stat(2) data * @retval *st stat(2) data
* @return -1 on error, 0 on success * @return -1 on error, 0 on success
*/ */
int rpmfiStat(rpmfi fi, const char * path, /*@out@*/ struct stat * st) int rpmfiStat(rpmfi fi, const char * path, /*@out@*/ struct stat * st)
/*@modifies fi @*/; /*@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@*/
DIR * rpmfiOpendir(rpmfi fi, const char * name) DIR * rpmfiOpendir(rpmfi fi, const char * name)
/*@modifies fi @*/; /*@globals 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
*/ */
skipping to change at line 771 skipping to change at line 780
int rpmfiCompare(const rpmfi afi, const rpmfi bfi) int rpmfiCompare(const rpmfi afi, const rpmfi bfi)
/*@*/; /*@*/;
/** /**
* Return file disposition. * Return file disposition.
* @param ofi old file info * @param ofi old file info
* @param nfi new file info * @param nfi new file info
* @param skipMissing OK to skip missing files? * @param skipMissing OK to skip missing files?
* @return file dispostion * @return file dispostion
*/ */
fileAction rpmfiDecideFate(const rpmfi ofi, rpmfi nfi, int skipMissing) int rpmfiDecideFate(const rpmfi ofi, rpmfi nfi, int skipMissing)
/*@globals h_errno, fileSystem, internalState @*/ /*@globals h_errno, fileSystem, internalState @*/
/*@modifies nfi, fileSystem, internalState @*/; /*@modifies nfi, fileSystem, internalState @*/;
/** /**
* Return formatted string representation of package disposition. * Return formatted string representation of package disposition.
* @param fi file info set * @param fi file info set
* @return formatted string * @return formatted string
*/ */
/*@-redef@*/ /*@-redef@*/
/*@observer@*/ /*@observer@*/
const char * rpmfiTypeString(rpmfi fi) const char * rpmfiTypeString(rpmfi fi)
/*@*/; /*@*/;
/*@=redef@*/ /*@=redef@*/
/**
* Free relocation array.
* @param relocs relocation array
* @return NULL always
*/
/*@null@*/
rpmRelocation rpmfiFreeRelocations(/*@only@*/ rpmRelocation relocs)
/*@modifies relocs@*/;
/**
* Duplicate a relocation array.
* @param relocs relocation array
* @retval *nrelocsp no. of elements
* @return duplicate relocation array
*/
/*@only@*/ /*@null@*/
rpmRelocation rpmfiDupeRelocations(rpmRelocation relocs, int * nrelocsp)
/*@modifies *nrelocsp @*/;
/**
* Add relocation element to array.
* @retval *relocations relocation array
* @retval *nrelocations no. of elements
* @param oldPath old path
* @param newPath new path
* @return 0 on success
*/
int rpmfiAddRelocation(rpmRelocation * relp, int * nrelp,
const char * oldPath, const char * newPath)
/*@modifies *relp, *nrelp @*/;
/*@}*/ /*@}*/
#endif /* _RPMFI_NOMETHODS */ #endif /* _RPMFI_NOMETHODS */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* H_RPMDS */ #endif /* H_RPMDS */
 End of changes. 32 change blocks. 
74 lines changed or deleted 114 lines changed or added


 rpmgi.h   rpmgi.h 
skipping to change at line 43 skipping to change at line 43
/** /**
*/ */
/*@unchecked@*/ /*@unchecked@*/
extern rpmgiFlags giFlags; extern rpmgiFlags giFlags;
#if defined(_RPMGI_INTERNAL) #if defined(_RPMGI_INTERNAL)
/** \ingroup rpmgi /** \ingroup rpmgi
*/ */
struct rpmgi_s { struct rpmgi_s {
struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */
/*@refcounted@*/ /*@refcounted@*/
rpmts ts; /*!< Iterator transaction set. */ rpmts ts; /*!< Iterator transaction set. */
int (*tsOrder) (rpmts ts); /*!< Iterator transaction ordering. */ int (*tsOrder) (rpmts ts); /*!< Iterator transaction ordering. */
rpmTag tag; /*!< Iterator type. */ rpmTag tag; /*!< Iterator type. */
/*@kept@*/ /*@relnull@*/ /*@kept@*/ /*@relnull@*/
const void * keyp; /*!< Iterator key. */ const void * keyp; /*!< Iterator key. */
size_t keylen; /*!< Iterator key length. */ size_t keylen; /*!< Iterator key length. */
rpmgiFlags flags; /*!< Iterator control bits. */ rpmgiFlags flags; /*!< Iterator control bits. */
int active; /*!< Iterator is active? */ int active; /*!< Iterator is active? */
skipping to change at line 81 skipping to change at line 82
int ftsOpts; int ftsOpts;
/*@null@*/ /*@null@*/
FTS * ftsp; FTS * ftsp;
/*@relnull@*/ /*@relnull@*/
FTSENT * fts; FTSENT * fts;
/*@null@*/ /*@null@*/
rpmRC (*walkPathFilter) (rpmgi gi); rpmRC (*walkPathFilter) (rpmgi gi);
/*@null@*/ /*@null@*/
rpmRC (*stash) (rpmgi gi, Header h); rpmRC (*stash) (rpmgi gi, Header h);
#if defined(__LCLINT__)
/*@refs@*/ /*@refs@*/
int nrefs; /*!< Reference count. */ int nrefs; /*!< (unused) keep splint happy */
#endif
}; };
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** \name RPMGI */ /** \name RPMGI */
/*@{*/ /*@{*/
/** /**
* Unreference a generalized iterator instance. * Unreference a generalized iterator instance.
* @param gi generalized iterator * @param gi generalized iterator
* @param msg * @param msg
* @return NULL always * @return NULL on last dereference
*/ */
/*@unused@*/ /*@null@*/ /*@unused@*/ /*@null@*/
rpmgi rpmgiUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmgi gi, rpmgi rpmgiUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmgi gi,
/*@null@*/ const char * msg) /*@null@*/ const char * msg)
/*@modifies gi @*/; /*@modifies gi @*/;
#define rpmgiUnlink(_gi, _msg) \
/** @todo Remove debugging entry from the ABI. */ ((rpmgi)rpmioUnlinkPoolItem((rpmioItem)(_gi), _msg, __FILE__, __LINE__)
/*@-exportlocal@*/ )
/*@null@*/
rpmgi XrpmgiUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmgi gi,
/*@null@*/ const char * msg, const char * fn, unsigned ln)
/*@modifies gi @*/;
/*@=exportlocal@*/
#define rpmgiUnlink(_gi, _msg) XrpmgiUnlink(_gi, _msg, __FILE__, __
LINE__)
/** /**
* Reference a generalized iterator instance. * Reference a generalized iterator instance.
* @param gi generalized iterator * @param gi generalized iterator
* @param msg * @param msg
* @return new generalized iterator reference * @return new generalized iterator reference
*/ */
/*@unused@*/ /*@newref@*/ /*@null@*/ /*@unused@*/ /*@newref@*/ /*@null@*/
rpmgi rpmgiLink (/*@null@*/ rpmgi gi, /*@null@*/ const char * msg) rpmgi rpmgiLink (/*@null@*/ rpmgi gi, /*@null@*/ const char * msg)
/*@modifies gi @*/; /*@modifies gi @*/;
#define rpmgiLink(_gi, _msg) \
/** @todo Remove debugging entry from the ABI. */ ((rpmgi)rpmioLinkPoolItem((rpmioItem)(_gi), _msg, __FILE__, __LINE__))
/*@-exportlocal@*/
/*@newref@*/ /*@null@*/
rpmgi XrpmgiLink (/*@null@*/ rpmgi gi, /*@null@*/ const char * msg,
const char * fn, unsigned ln)
/*@modifies gi @*/;
/*@=exportlocal@*/
#define rpmgiLink(_gi, _msg) XrpmgiLink(_gi, _msg, __FILE__, __LI
NE__)
/** Destroy a generalized iterator. /** Destroy a generalized iterator.
* @param gi generalized iterator * @param gi generalized iterator
* @return NULL always * @return NULL on last dereference
*/ */
/*@null@*/ /*@null@*/
rpmgi rpmgiFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmgi gi) rpmgi rpmgiFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmgi gi)
/*@globals rpmGlobalMacroContext, h_errno, internalState @*/ /*@globals rpmGlobalMacroContext, h_errno, internalState @*/
/*@modifies gi, rpmGlobalMacroContext, h_errno, internalState @*/; /*@modifies gi, rpmGlobalMacroContext, h_errno, internalState @*/;
#define rpmgiFree(_gi) \
((rpmgi)rpmioFreePoolItem((rpmioItem)(_gi), __FUNCTION__, __FILE__, __L
INE__))
/** /**
* Return a generalized iterator. * Return a generalized iterator.
* @param ts transaction set * @param ts transaction set
* @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 new iterator * @return new iterator
*/ */
/*@null@*/ /*@null@*/
 End of changes. 8 change blocks. 
23 lines changed or deleted 14 lines changed or added


 rpmhash.h   rpmhash.h 
#ifndef H_RPMHASH #ifndef H_RPMHASH
#define H_RPMHASH #define H_RPMHASH
/** /**
* \file rpmio/rpmhash.h * \file rpmio/rpmhash.h
* Hash table implemenation. * Hash table implemenation.
*/ */
/** /**
*/ */
typedef /*@abstract@*/ struct hashTable_s * hashTable; typedef /*@abstract@*/ /*@refcounted@*/ struct hashTable_s * hashTable;
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
* Compare two hash table entries for equality. * Compare two hash table entries for equality.
* @param key1 entry 1 * @param key1 entry 1
* @param key2 entry 2 * @param key2 entry 2
* @return 0 if entries are equal * @return 0 if entries are equal
skipping to change at line 56 skipping to change at line 56
* Return hash value of a string. * Return hash value of a string.
* @param h hash initial value * @param h hash initial value
* @param data data on which to calculate hash value * @param data data on which to calculate hash value
* @param size size of data in bytes (0 will use strlen(data)) * @param size size of data in bytes (0 will use strlen(data))
* @return hash value * @return hash value
*/ */
uint32_t hashFunctionString(uint32_t h, const void * data, size_t size) uint32_t hashFunctionString(uint32_t h, const void * data, size_t size)
/*@*/; /*@*/;
/** /**
* Create hash table.
* If keySize > 0, the key is duplicated within the table (which costs
* memory, but may be useful anyway.
* @param numBuckets number of hash buckets
* @param keySize size of key (0 if unknown)
* @param freeData Should data be freed when table is destroyed?
* @param fn function to generate hash key (NULL for default)
* @param eq function to compare keys for equality (NULL for def
ault)
* @return pointer to initialized hash table
*/
hashTable htCreate(int numBuckets, size_t keySize, int freeData,
/*@null@*/ hashFunctionType fn, /*@null@*/ hashEqualityType
eq)
/*@*/;
/**
* Destroy hash table.
* @param ht pointer to hash table
* @return NULL always
*/
/*@null@*/
hashTable htFree( /*@only@*/ hashTable ht)
/*@modifies ht @*/;
/**
* Add item to hash table. * Add item to hash table.
* @param ht pointer to hash table * @param ht pointer to hash table
* @param key pointer to key * @param key pointer to key
* @param data pointer to data value * @param data pointer to data value
*/ */
void htAddEntry(hashTable ht, /*@owned@*/ const void * key, void htAddEntry(hashTable ht, /*@owned@*/ const void * key,
/*@owned@*/ const void * data) /*@owned@*/ const void * data)
/*@modifies ht */; /*@modifies ht */;
/** /**
skipping to change at line 114 skipping to change at line 90
/** /**
* Check for key in hash table. * Check for key in hash table.
* @param ht pointer to hash table * @param ht pointer to hash table
* @param key pointer to key value * @param key pointer to key value
* @return 1 if the key is present, 0 otherwise * @return 1 if the key is present, 0 otherwise
*/ */
/*@unused@*/ /*@unused@*/
int htHasEntry(hashTable ht, const void * key) int htHasEntry(hashTable ht, const void * key)
/*@*/; /*@*/;
/**
* Unreference a hash table instance.
* @param ht hash table
* @return NULL on last dereference
*/
/*@unused@*/ /*@null@*/
hashTable htUnlink (/*@killref@*/ /*@null@*/ hashTable ht)
/*@modifies ht @*/;
#define htUnlink(_ht) \
((hashTable)rpmioUnlinkPoolItem((rpmioItem)(_ht), __FUNCTION__, __FILE_
_, __LINE__))
/**
* Reference a hash table instance.
* @param ht hash table
* @return new hash table reference
*/
/*@unused@*/ /*@newref@*/ /*@null@*/
hashTable htLink (/*@null@*/ hashTable ht)
/*@modifies ht @*/;
#define htLink(_ht) \
((hashTable)rpmioLinkPoolItem((rpmioItem)(_ht), __FUNCTION__, __FILE__,
__LINE__))
/**
* Destroy hash table.
* @param ht pointer to hash table
* @return NULL on last dereference
*/
/*@null@*/
hashTable htFree( /*@only@*/ hashTable ht)
/*@modifies ht @*/;
#define htFree(_ht) \
((hashTable)rpmioFreePoolItem((rpmioItem)(_ht), __FUNCTION__, __FILE__,
__LINE__))
/**
* Create hash table.
* If keySize > 0, the key is duplicated within the table (which costs
* memory, but may be useful anyway.
* @param numBuckets number of hash buckets
* @param keySize size of key (0 if unknown)
* @param freeData Should data be freed when table is destroyed?
* @param fn function to generate hash key (NULL for default)
* @param eq function to compare keys for equality (NULL for def
ault)
* @return pointer to initialized hash table
*/
/*@newref@*/ /*@null@*/
hashTable htCreate(int numBuckets, size_t keySize, int freeData,
/*@null@*/ hashFunctionType fn, /*@null@*/ hashEqualityType
eq)
/*@globals fileSystem @*/
/*@modifies fileSystem @*/;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 3 change blocks. 
27 lines changed or deleted 56 lines changed or added


 rpmio.h   rpmio.h 
skipping to change at line 12 skipping to change at line 12
#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 <dirent.h>
/*@-noparams@*/
#include "glob.h"
/*@=noparams@*/
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <rpmiotypes.h>
#include <yarn.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
* argument as a pointer rather than as an off_t. The snarl below defines * argument as a pointer rather than as an off_t. The snarl below defines
* typedefs to isolate the lossage. * typedefs to isolate the lossage.
*/ */
/*@{*/ /*@{*/
#if !defined(__LCLINT__) && !defined(__UCLIBC__) && defined(__GLIBC__) && \ #if !defined(__LCLINT__) && !defined(__UCLIBC__) && defined(__GLIBC__) && \
(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2))
#define USE_COOKIE_SEEK_POINTER 1 #define USE_COOKIE_SEEK_POINTER 1
skipping to change at line 49 skipping to change at line 50
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
/**
* RPM return codes.
*/
typedef enum rpmRC_e {
RPMRC_OK = 0, /*!< Generic success code */
RPMRC_NOTFOUND = 1, /*!< Generic not found code. */
RPMRC_FAIL = 2, /*!< Generic failure code. */
RPMRC_NOTTRUSTED = 3, /*!< Signature is OK, but key is not trusted
. */
RPMRC_NOKEY = 4 /*!< Public key is unavailable. */
} rpmRC;
/** \ingroup rpmio /** \ingroup rpmio
* \name RPMIO Vectors. * \name RPMIO Vectors.
*/ */
/*@{*/ /*@{*/
/** /**
*/ */
typedef ssize_t (*fdio_read_function_t) (void *cookie, char *buf, size_t nb ytes) typedef ssize_t (*fdio_read_function_t) (void *cookie, char *buf, size_t nb ytes)
/*@globals errno, fileSystem @*/ /*@globals errno, fileSystem @*/
/*@modifies *cookie, errno, fileSystem @*/ /*@modifies *cookie, errno, fileSystem @*/
skipping to change at line 142 skipping to change at line 132
/*@observer@*/ const char * Fstrerror(/*@null@*/ FD_t fd) /*@observer@*/ const char * Fstrerror(/*@null@*/ FD_t fd)
/*@*/; /*@*/;
/** /**
* fread(3) clone. * fread(3) clone.
*/ */
/*@-incondefs@*/ /*@-incondefs@*/
size_t Fread(/*@out@*/ void * buf, size_t size, size_t nmemb, FD_t fd) size_t Fread(/*@out@*/ void * buf, size_t size, size_t nmemb, FD_t fd)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies fd, *buf, fileSystem @*/ /*@modifies fd, *buf, fileSystem @*/
/*@requires maxSet(buf) >= (nmemb - 1) @*/ /*@requires maxSet(buf) >= (nmemb - 1) @*/;
/*@ensures maxRead(buf) == result @*/;
/*@=incondefs@*/ /*@=incondefs@*/
/** /**
* fwrite(3) clone. * fwrite(3) clone.
*/ */
/*@-incondefs@*/ /*@-incondefs@*/
size_t Fwrite(const void * buf, size_t size, size_t nmemb, FD_t fd) size_t Fwrite(const void * buf, size_t size, size_t nmemb, FD_t fd)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies fd, fileSystem @*/ /*@modifies fd, fileSystem @*/
/*@requires maxRead(buf) >= nmemb @*/; /*@requires maxRead(buf) >= nmemb @*/;
skipping to change at line 428 skipping to change at line 417
* glob_error(3) clone. * glob_error(3) clone.
*/ */
int Glob_error(const char * epath, int eerrno) int Glob_error(const char * epath, int eerrno)
/*@*/; /*@*/;
/** /**
* glob(3) clone. * glob(3) clone.
*/ */
int Glob(const char * pattern, int flags, int Glob(const char * pattern, int flags,
int errfunc(const char * epath, int eerrno), int errfunc(const char * epath, int eerrno),
/*@out@*/ glob_t * pglob) /*@out@*/ void * _pglob)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies *pglob, fileSystem @*/; /*@modifies *_pglob, fileSystem @*/;
/** /**
* globfree(3) clone. * globfree(3) clone.
*/ */
void Globfree( /*@only@*/ glob_t * pglob) void Globfree( /*@only@*/ void * _pglob)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies *pglob, fileSystem @*/; /*@modifies *_pglob, fileSystem @*/;
/** /**
* opendir(3) clone. * opendir(3) clone.
*/ */
/*@null@*/ /*@null@*/
DIR * Opendir(const char * path) DIR * Opendir(const char * path)
/*@globals errno, h_errno, fileSystem, internalState @*/ /*@globals errno, h_errno, fileSystem, internalState @*/
/*@modifies errno, fileSystem, internalState @*/; /*@modifies errno, fileSystem, internalState @*/;
/** /**
skipping to change at line 499 skipping to change at line 488
/** /**
*/ */
/*@null@*/ FD_t fdDup(int fdno) /*@null@*/ FD_t fdDup(int fdno)
/*@globals fileSystem, internalState @*/ /*@globals fileSystem, internalState @*/
/*@modifies fileSystem, internalState @*/; /*@modifies fileSystem, internalState @*/;
/*@-exportlocal@*/ /*@-exportlocal@*/
/** /**
*/ */
/*@-incondefs@*/
ssize_t fdRead(void * cookie, /*@out@*/ char * buf, size_t count) ssize_t fdRead(void * cookie, /*@out@*/ char * buf, size_t count)
/*@globals errno, fileSystem, internalState @*/ /*@globals errno, fileSystem, internalState @*/
/*@modifies *cookie, *buf, errno, fileSystem, internalState @*/ /*@modifies *cookie, *buf, errno, fileSystem, internalState @*/;
/*@requires maxSet(buf) >= (count - 1) @*/
/*@ensures maxRead(buf) == result @*/ ;
#define fdRead(_fd, _buf, _count) fdio->read((_fd), (_buf), (_ count)) #define fdRead(_fd, _buf, _count) fdio->read((_fd), (_buf), (_ count))
/*@=incondefs@*/
/** /**
*/ */
ssize_t fdWrite(void * cookie, const char * buf, size_t count) ssize_t fdWrite(void * cookie, const char * buf, size_t count)
/*@globals errno, fileSystem, internalState @*/ /*@globals errno, fileSystem, internalState @*/
/*@modifies *cookie, errno, fileSystem, internalState @*/; /*@modifies *cookie, errno, fileSystem, internalState @*/;
#define fdWrite(_fd, _buf, _count) fdio->write((_fd), (_buf), ( _count)) #define fdWrite(_fd, _buf, _count) fdio->write((_fd), (_buf), ( _count))
/** /**
*/ */
skipping to change at line 532 skipping to change at line 517
/** /**
*/ */
/*@null@*/ FD_t fdOpen(const char *path, int flags, mode_t mode) /*@null@*/ FD_t fdOpen(const char *path, int flags, mode_t mode)
/*@globals errno, fileSystem, internalState @*/ /*@globals errno, fileSystem, internalState @*/
/*@modifies errno, fileSystem, internalState @*/; /*@modifies errno, fileSystem, internalState @*/;
#define fdOpen(_path, _flags, _mode) fdio->_open((_path), (_flags ), (_mode)) #define fdOpen(_path, _flags, _mode) fdio->_open((_path), (_flags ), (_mode))
/** /**
*/ */
/*@unused@*/ /*@unused@*/
/*@only@*/ /*@null@*/ /*@newref@*/ /*@null@*/
FD_t fdLink (/*@only@*/ void * cookie, const char * msg) FD_t fdLink (void * cookie, const char * msg)
/*@globals fileSystem @*/
/*@modifies *cookie, fileSystem @*/;
/*@unused@*/
/*@only@*/ /*@null@*/
FD_t XfdLink (/*@only@*/ void * cookie, const char * msg, const char * fn,
unsigned ln)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies *cookie, fileSystem @*/; /*@modifies *cookie, fileSystem @*/;
#define fdLink(_fd, _msg) XfdLink(_fd, _msg, __FILE__, __LINE_ #define fdLink(_fd, _msg) \
_) ((FD_t)rpmioLinkPoolItem((rpmioItem)(_fd), _msg, __FILE__, __LINE__)
)
/** /**
*/ */
/*@unused@*/ /*@unused@*/ /*@null@*/
/*@only@*/ /*@null@*/ FD_t fdFree(/*@killref@*/ FD_t fd, const char * msg)
FD_t fdFree(/*@only@*/ FD_t fd, const char * msg)
/*@globals fileSystem @*/
/*@modifies fd, fileSystem @*/;
/*@unused@*/
/*@only@*/ /*@null@*/
FD_t XfdFree(/*@only@*/ FD_t fd, const char * msg, const char * fn, unsigne
d ln)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies fd, fileSystem @*/; /*@modifies fd, fileSystem @*/;
#define fdFree(_fd, _msg) XfdFree(_fd, _msg, __FILE__, __LINE_ #define fdFree(_fd, _msg) \
_) ((FD_t)rpmioFreePoolItem((rpmioItem)(_fd), _msg, __FILE__, __LINE__)
)
/** /**
*/ */
/*@unused@*/ /*@unused@*/
/*@only@*/ /*@null@*/ /*@newref@*/ /*@null@*/
FD_t fdNew (const char * msg) FD_t fdNew (const char * msg)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies fileSystem @*/; /*@modifies fileSystem @*/;
/*@unused@*/ /*@newref@*/ /*@null@*/
/*@only@*/ /*@null@*/
FD_t XfdNew (const char * msg, const char * fn, unsigned ln) FD_t XfdNew (const char * msg, const char * fn, unsigned ln)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies fileSystem @*/; /*@modifies fileSystem @*/;
#define fdNew(_msg) XfdNew(_msg, __FILE__, __LINE__) #define fdNew(_msg) XfdNew(_msg, __FILE__, __LINE__)
/** /**
*/ */
int fdWritable(FD_t fd, int secs) int fdWritable(FD_t fd, int secs)
/*@globals errno, fileSystem @*/ /*@globals errno, fileSystem @*/
/*@modifies fd, errno, fileSystem @*/; /*@modifies fd, errno, fileSystem @*/;
skipping to change at line 652 skipping to change at line 627
FTPERR_FAILED_DATA_CONNECT = -89, /*!< Error setting remote server to passive mode */ FTPERR_FAILED_DATA_CONNECT = -89, /*!< Error setting remote server to passive mode */
FTPERR_FILE_NOT_FOUND = -90, /*!< File not found on server */ FTPERR_FILE_NOT_FOUND = -90, /*!< File not found on server */
FTPERR_NIC_ABORT_IN_PROGRESS= -91, /*!< Abort in progress */ FTPERR_NIC_ABORT_IN_PROGRESS= -91, /*!< Abort in progress */
FTPERR_UNKNOWN = -100 /*!< Unknown or unexpected error */ FTPERR_UNKNOWN = -100 /*!< Unknown or unexpected error */
} ftperrCode; } ftperrCode;
/*@=typeuse@*/ /*@=typeuse@*/
/** /**
*/ */
/*@-redecl@*/ /*@-redecl@*/
/*@observer@*/ const char * ftpStrerror(int errorNumber) /*@observer@*/
const char * ftpStrerror(int errorNumber)
/*@*/; /*@*/;
/*@=redecl@*/ /*@=redecl@*/
/** /**
*/ */
/*@unused@*/ /*@unused@*/
/*@dependent@*/ /*@null@*/ void * ufdGetUrlinfo(FD_t fd) /*@dependent@*/ /*@null@*/
/*@modifies fd @*/; void * ufdGetUrlinfo(FD_t fd)
/*@globals fileSystem @*/
/*@modifies fd, fileSystem @*/;
/** /**
*/ */
/*@-redecl@*/ /*@-redecl@*/
/*@unused@*/ /*@unused@*/
/*@observer@*/ const char * urlStrerror(const char * url) /*@observer@*/
const char * urlStrerror(const char * url)
/*@globals h_errno, internalState @*/ /*@globals h_errno, internalState @*/
/*@modifies internalState @*/; /*@modifies internalState @*/;
/*@=redecl@*/ /*@=redecl@*/
/** /**
*/ */
/*@-exportlocal@*/ /*@-exportlocal@*/
int ufdCopy(FD_t sfd, FD_t tfd) int ufdCopy(FD_t sfd, FD_t tfd)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies sfd, tfd, fileSystem @*/; /*@modifies sfd, tfd, fileSystem @*/;
skipping to change at line 710 skipping to change at line 689
/*@observer@*/ /*@unchecked@*/ extern FDIO_t gzdio; /*@observer@*/ /*@unchecked@*/ extern FDIO_t gzdio;
/** /**
*/ */
/*@observer@*/ /*@unchecked@*/ extern FDIO_t bzdio; /*@observer@*/ /*@unchecked@*/ extern FDIO_t bzdio;
/** /**
*/ */
/*@observer@*/ /*@unchecked@*/ extern FDIO_t lzdio; /*@observer@*/ /*@unchecked@*/ extern FDIO_t lzdio;
/**
*/
/*@observer@*/ /*@unchecked@*/ extern FDIO_t xzdio;
/*@=exportlocal@*/ /*@=exportlocal@*/
/*@}*/ /*@}*/
/*@unused@*/ static inline int xislower(int c) /*@*/ { #include <rpmzlog.h>
return (c >= (int)'a' && c <= (int)'z');
}
/*@unused@*/ static inline int xisupper(int c) /*@*/ {
return (c >= (int)'A' && c <= (int)'Z');
}
/*@unused@*/ static inline int xisalpha(int c) /*@*/ {
return (xislower(c) || xisupper(c));
}
/*@unused@*/ static inline int xisdigit(int c) /*@*/ {
return (c >= (int)'0' && c <= (int)'9');
}
/*@unused@*/ static inline int xisalnum(int c) /*@*/ {
return (xisalpha(c) || xisdigit(c));
}
/*@unused@*/ static inline int xisblank(int c) /*@*/ {
return (c == (int)' ' || c == (int)'\t');
}
/*@unused@*/ static inline int xisspace(int c) /*@*/ {
return (xisblank(c) || c == (int)'\n' || c == (int)'\r' || c == (int)'\
f' || c == (int)'\v');
}
/*@unused@*/ static inline int xiscntrl(int c) /*@*/ {
return (c < (int)' ');
}
/*@unused@*/ static inline int xisascii(int c) /*@*/ {
return ((c & 0x80) != 0x80);
}
/*@unused@*/ static inline int xisprint(int c) /*@*/ {
return (c >= (int)' ' && xisascii(c));
}
/*@unused@*/ static inline int xisgraph(int c) /*@*/ {
return (c > (int)' ' && xisascii(c));
}
/*@unused@*/ static inline int xispunct(int c) /*@*/ {
return (xisgraph(c) && !xisalnum(c));
}
/*@unused@*/ static inline int xtolower(int c) /*@*/ { /*@unchecked@*/ /*@only@*/ /*@null@*/
return ((xisupper(c)) ? (c | ('a' - 'A')) : c); extern rpmioPool _fdPool;
}
/*@unused@*/ static inline int xtoupper(int c) /*@*/ {
return ((xislower(c)) ? (c & ~('a' - 'A')) : c);
}
/** \ingroup rpmio /**
* Locale insensitive strcasecmp(3). * Free all memory allocated by rpmio usage.
*/ */
int xstrcasecmp(const char * s1, const char * s2) /*@*/; void rpmioClean(void)
/*@globals _fdPool, fileSystem, internalState @*/
/*@modifies _fdPool, fileSystem, internalState @*/;
/** \ingroup rpmio /**
* Locale insensitive strncasecmp(3). * Reclaim memory pool items.
* @param pool memory pool (NULL uses global rpmio pool)
* @return NULL always
*/ */
int xstrncasecmp(const char *s1, const char * s2, size_t n) /*@*/; /*@null@*/
rpmioPool rpmioFreePool(/*@only@*//*@null@*/ rpmioPool pool)
/*@globals fileSystem, internalState @*/
/*@modifies pool, fileSystem, internalState @*/;
/** \ingroup rpmio /**
* Force encoding of string. * Create a memory pool.
* @param name pool name
* @param size item size
* @param limit no. of items permitted (-1 for unlimited)
* @param flags debugging flags
* @param (*dbg)() generate string for Unlink/Link/Free debugging
* @param (*init)() create item contents
* @param (*fini)() destroy item contents
* @return memory pool
*/ */
/*@only@*/ /*@null@*/ rpmioPool rpmioNewPool(/*@observer@*/ const char * name,
const char * xstrtolocale(/*@only@*/ const char *str) size_t size, int limit, int flags,
/*@modifies *str @*/; /*@null@*/ const char * (*dbg) (void *item),
/*@null@*/ void (*init) (void *item),
/*@null@*/ void (*fini) (void *item))
/*@globals fileSystem @*/
/*@modifies fileSystem @*/;
#if !defined(SWIG)
/** /**
* Wrapper to free(3), hides const compilation noise, permit NULL, return N * Decrement a pool item refcount.
ULL. * @param item pool item
* @param p memory to free * @param msg debugging msg (NULL disables debugging)
* @return NULL always * @param fn usually __FILE__
* @param ln usually __LINE__
* @return pool item (NULL on last dereference)
*/ */
#if defined(WITH_DMALLOC) /*@null@*/
#define _free(p) ((p) != NULL ? free((void *)(p)) : (void)0, NULL) rpmioItem rpmioUnlinkPoolItem(/*@killref@*/ /*@null@*/ rpmioItem item,
#else const char * msg, const char * fn, unsigned ln)
/*@unused@*/ static inline /*@null@*/ /*@globals fileSystem @*/
void * _free(/*@only@*/ /*@null@*/ /*@out@*/ const void * p) /*@modifies item, fileSystem @*/;
/*@modifies p @*/
{
if (p != NULL) free((void *)p);
return NULL;
}
#endif
#endif
/** /**
* Free all memory allocated by rpmio usage. * Increment a pool item refcount.
* @param item pool item
* @param msg debugging msg (NULL disables debugging)
* @param fn usually __FILE__
* @param ln usually __LINE__
* @return pool item
*/ */
void rpmioClean(void) /*@newref@*/ /*@null@*/
/*@globals internalState, fileSystem @*/ rpmioItem rpmioLinkPoolItem(/*@returned@*/ /*@null@*/ rpmioItem item,
/*@modifies internalState, fileSystem @*/; const char * msg, const char * fn, unsigned ln)
/*@globals fileSystem @*/
/*@modifies item, fileSystem @*/;
/**
* Free a pool item.
* @param item pool item
* @param msg debugging msg (NULL disables debugging)
* @param fn usually __FILE__
* @param ln usually __LINE__
* @return pool item (NULL on last dereference)
*/
/*@null@*/
void * rpmioFreePoolItem(/*@killref@*/ /*@null@*/ rpmioItem item,
const char * msg, const char * fn, unsigned ln)
/*@globals fileSystem @*/
/*@modifies item, fileSystem @*/;
/**
* Get unused item from pool, or alloc a new item.
* @param pool memory pool (NULL will always alloc a new item)
* @param size item size
* @return new item
*/
rpmioItem rpmioGetPool(/*@kept@*/ /*@null@*/ rpmioPool pool, size_t size)
/*@globals fileSystem @*/
/*@modifies pool, fileSystem @*/;
/**
* Put unused item into pool (or free).
* @param _item unused item
* @return NULL always
*/
/*@null@*/
rpmioItem rpmioPutPool(rpmioItem item)
/*@globals fileSystem @*/
/*@modifies item, fileSystem @*/;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* H_RPMIO */ #endif /* H_RPMIO */
 End of changes. 34 change blocks. 
129 lines changed or deleted 123 lines changed or added


 rpmlib.h   rpmlib.h 
skipping to change at line 28 skipping to change at line 28
/*@-redecl@*/ /*@-redecl@*/
/*@-incondefs@*/ /*@-incondefs@*/
/*@checked@*/ /*@checked@*/
extern struct MacroContext_s * rpmGlobalMacroContext; extern struct MacroContext_s * rpmGlobalMacroContext;
/*@checked@*/ /*@checked@*/
extern struct MacroContext_s * rpmCLIMacroContext; extern struct MacroContext_s * rpmCLIMacroContext;
/*@=incondefs@*/ /*@=incondefs@*/
/*@unchecked@*/ /*@observer@*/
extern const char * RPMVERSION;
/*@unchecked@*/ /*@observer@*/
extern const char * rpmNAME;
/*@unchecked@*/ /*@observer@*/
extern const char * rpmEVR;
/*@unchecked@*/
extern int rpmFLAGS;
/*@=redecl@*/ /*@=redecl@*/
/*@unchecked@*/ /*@only@*/ /*@null@*/ /*@unchecked@*/ /*@only@*/ /*@null@*/
extern unsigned int * keyids; extern unsigned int * keyids;
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** \ingroup rpmts /** \ingroup rpmts
skipping to change at line 199 skipping to change at line 188
/*@}*/ /*@}*/
/* ==================================================================== */ /* ==================================================================== */
/** \name RPMTS */ /** \name RPMTS */
/*@{*/ /*@{*/
/** /**
* We pass these around as an array with a sentinel. * We pass these around as an array with a sentinel.
*/ */
typedef struct rpmRelocation_s * rpmRelocation; typedef struct rpmRelocation_s * rpmRelocation;
#if !defined(SWIG)
struct rpmRelocation_s {
/*@only@*/ /*@null@*/
const char * oldPath; /*!< NULL here evals to RPMTAG_DEFAULTPREFIX
, */
/*@only@*/ /*@null@*/
const char * newPath; /*!< NULL means to omit the file completely!
*/
};
#endif
/** /**
* 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 first 1st header * @param first 1st header
* @param second 2nd header * @param second 2nd header
* @return result of comparison * @return result of comparison
*/ */
int rpmVersionCompare(Header first, Header second) int rpmVersionCompare(Header first, Header second)
 End of changes. 2 change blocks. 
21 lines changed or deleted 0 lines changed or added


 rpmmacro.h   rpmmacro.h 
#ifndef _H_MACRO_ #ifndef _H_MACRO_
#define _H_MACRO_ #define _H_MACRO_
#include <mire.h>
/** \ingroup rpmio /** \ingroup rpmio
* \file rpmio/rpmmacro.h * \file rpmio/rpmmacro.h
*/ */
typedef /*@abstract@*/ struct MacroEntry_s * MacroEntry; typedef /*@abstract@*/ struct MacroEntry_s * MacroEntry;
typedef /*@abstract@*/ struct MacroContext_s * MacroContext; typedef /*@abstract@*/ struct MacroContext_s * MacroContext;
#if defined(_MACRO_INTERNAL) #if defined(_MACRO_INTERNAL)
/*! The structure used to store a macro. */ /*! The structure used to store a macro. */
struct MacroEntry_s { struct MacroEntry_s {
struct MacroEntry_s *prev; /*!< Macro entry stack. */ struct MacroEntry_s *prev; /*!< Macro entry stack. */
skipping to change at line 78 skipping to change at line 76
* @param mc macro context (NULL uses global context). * @param mc macro context (NULL uses global context).
* @param fp file stream (NULL uses stderr). * @param fp file stream (NULL uses stderr).
*/ */
void rpmDumpMacroTable(/*@null@*/ MacroContext mc, /*@null@*/ FILE * fp) void rpmDumpMacroTable(/*@null@*/ MacroContext mc, /*@null@*/ FILE * fp)
/*@globals rpmGlobalMacroContext, fileSystem @*/ /*@globals rpmGlobalMacroContext, fileSystem @*/
/*@modifies *fp, fileSystem @*/; /*@modifies *fp, fileSystem @*/;
/** /**
* Return macro entries as string array. * Return macro entries as string array.
* @param mc macro context (NULL uses global context) * @param mc macro context (NULL uses global context)
* @param mire pattern to match (NULL disables) * @param _mire pattern to match (NULL disables)
* @param used macro usage (<0 all, =0 unused, >=1 used count) * @param used macro usage (<0 all, =0 unused, >=1 used count)
* @retval *avp macro definitions * @retval *avp macro definitions
* @return no. of entries * @return no. of entries
*/ */
int int
rpmGetMacroEntries(/*@null@*/ MacroContext mc, /*@null@*/ miRE mire, rpmGetMacroEntries(/*@null@*/ MacroContext mc, /*@null@*/ void * _mire,
int used, /*@null@*/ const char *** avp) int used, /*@null@*/ const char *** avp)
/*@globals rpmGlobalMacroContext @*/ /*@globals rpmGlobalMacroContext @*/
/*@modifies mire, *avp @*/; /*@modifies _mire, *avp @*/;
/** /**
* Check whether configuration file is moderately secure to load. * Check whether configuration file is moderately secure to load.
* @param filename filename to check * @param filename filename to check
* @return 1 on success, 0 on failure * @return 1 on success, 0 on failure
*/ */
int rpmSecuritySaneFile(const char *filename) int rpmSecuritySaneFile(const char *filename)
/*@globals internalState @*/; /*@globals internalState @*/;
/** /**
skipping to change at line 211 skipping to change at line 209
void rpmFreeMacros(/*@null@*/ MacroContext mc) void rpmFreeMacros(/*@null@*/ MacroContext mc)
/*@globals rpmGlobalMacroContext @*/ /*@globals rpmGlobalMacroContext @*/
/*@modifies mc, rpmGlobalMacroContext @*/; /*@modifies mc, rpmGlobalMacroContext @*/;
typedef enum rpmCompressedMagic_e { typedef enum rpmCompressedMagic_e {
COMPRESSED_NOT = 0, /*!< not compressed */ COMPRESSED_NOT = 0, /*!< not compressed */
COMPRESSED_OTHER = 1, /*!< gzip can handle */ COMPRESSED_OTHER = 1, /*!< gzip can handle */
COMPRESSED_BZIP2 = 2, /*!< bzip2 can handle */ COMPRESSED_BZIP2 = 2, /*!< bzip2 can handle */
COMPRESSED_ZIP = 3, /*!< unzip can handle */ COMPRESSED_ZIP = 3, /*!< unzip can handle */
COMPRESSED_LZOP = 4, /*!< lzop can handle */ COMPRESSED_LZOP = 4, /*!< lzop can handle */
COMPRESSED_LZMA = 5 /*!< lzma can handle */ COMPRESSED_LZMA = 5, /*!< lzma can handle */
COMPRESSED_XZ = 6 /*!< xz can handle */
} rpmCompressedMagic; } rpmCompressedMagic;
/** /**
* Return type of compression used in file. * Return type of compression used in file.
* @param file name of file * @param file name of file
* @retval compressed address of compression type * @retval compressed address of compression type
* @return 0 on success, 1 on I/O error * @return 0 on success, 1 on I/O error
*/ */
int isCompressed(const char * file, /*@out@*/ rpmCompressedMagic * compress ed) int isCompressed(const char * file, /*@out@*/ rpmCompressedMagic * compress ed)
/*@globals h_errno, fileSystem, internalState @*/ /*@globals h_errno, fileSystem, internalState @*/
 End of changes. 5 change blocks. 
6 lines changed or deleted 5 lines changed or added


 rpmmg.h   rpmmg.h 
skipping to change at line 15 skipping to change at line 15
* \file rpmio/rpmmg.h * \file rpmio/rpmmg.h
*/ */
/** \ingroup rpmio /** \ingroup rpmio
*/ */
/*@unchecked@*/ /*@unchecked@*/
extern int _rpmmg_debug; extern int _rpmmg_debug;
/** \ingroup rpmio /** \ingroup rpmio
*/ */
typedef struct rpmmg_s * rpmmg; typedef /*@refcounted@*/ struct rpmmg_s * rpmmg;
#if defined(_RPMMG_INTERNAL) #if defined(_RPMMG_INTERNAL)
/** \ingroup rpmio /** \ingroup rpmio
*/ */
struct rpmmg_s { struct rpmmg_s {
struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */
const char * fn; const char * fn;
int flags; int flags;
/*@relnull@*/ /*@relnull@*/
void * ms; void * ms;
#if defined(__LCLINT__)
/*@refs@*/
int nrefs; /*!< (unused) keep splint happy */
#endif
}; };
#endif /* _RPMMG_INTERNAL */ #endif /* _RPMMG_INTERNAL */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
* Unreference a magic wrapper instance.
* @param mg magic wrapper
* @return NULL on last dereference
*/
/*@unused@*/ /*@null@*/
rpmmg rpmmgUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmmg mg)
/*@modifies mg @*/;
#define rpmmgUnlink(_ds) \
((rpmmg)rpmioUnlinkPoolItem((rpmioItem)(_mg), __FUNCTION__, __FILE__, _
_LINE__))
/**
* Reference a magic wrapper instance.
* @param mg magic wrapper
* @return new magic wrapper reference
*/
/*@unused@*/ /*@newref@*/ /*@null@*/
rpmmg rpmmgLink (/*@null@*/ rpmmg mg)
/*@modifies mg @*/;
#define rpmmgLink(_mg) \
((rpmmg)rpmioLinkPoolItem((rpmioItem)(_mg), __FUNCTION__, __FILE__, __L
INE__))
/**
* Destroy a magic wrapper. * Destroy a magic wrapper.
* @param mg magic wrapper * @param mg magic wrapper
* @return NULL always * @return NULL on last dereference
*/ */
rpmmg rpmmgFree(/*@only@*/ /*@null@*/rpmmg mg) /*@null@*/
rpmmg rpmmgFree(/*@killref@*/ /*@null@*/rpmmg mg)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies mg, fileSystem @*/; /*@modifies mg, fileSystem @*/;
#define rpmmgFree(_mg) \
((rpmmg)rpmioFreePoolItem((rpmioItem)(_mg), __FUNCTION__, __FILE__, __L
INE__))
/** /**
* Create and load a magic wrapper. * Create and load a magic wrapper.
* @param fn magic file * @param fn magic file
* @param flags magic flags * @param flags magic flags
* @return new magic wrapper * @return new magic wrapper
*/ */
/*@only@*/ /*@null@*/ /*@newref@*/ /*@null@*/
rpmmg rpmmgNew(const char * fn, int flags) rpmmg rpmmgNew(const char * fn, int flags)
/*@globals fileSystem, internalState @*/ /*@globals fileSystem, internalState @*/
/*@modifies fileSystem, internalState @*/; /*@modifies fileSystem, internalState @*/;
/** /**
* Return magic string for a file. * Return magic string for a file.
* @param mg magic wrapper * @param mg magic wrapper
* @param fn file path * @param fn file path
* @return file magic string * @return file magic string
*/ */
 End of changes. 8 change blocks. 
4 lines changed or deleted 37 lines changed or added


 rpmns.h   rpmns.h 
skipping to change at line 55 skipping to change at line 55
RPMNS_TYPE_DISKSPACE= (1 << 19), /*!< diskspace(/path) */ RPMNS_TYPE_DISKSPACE= (1 << 19), /*!< diskspace(/path) */
RPMNS_TYPE_DIGEST = (1 << 20), /*!< digest(/path) = hex */ RPMNS_TYPE_DIGEST = (1 << 20), /*!< digest(/path) = hex */
RPMNS_TYPE_GNUPG = (1 << 21), /*!< gnupg(/path/file.asc) */ RPMNS_TYPE_GNUPG = (1 << 21), /*!< gnupg(/path/file.asc) */
RPMNS_TYPE_MACRO = (1 << 22), /*!< macro(foo) */ RPMNS_TYPE_MACRO = (1 << 22), /*!< macro(foo) */
RPMNS_TYPE_ENVVAR = (1 << 23), /*!< envvar(foo) */ RPMNS_TYPE_ENVVAR = (1 << 23), /*!< envvar(foo) */
RPMNS_TYPE_RUNNING = (1 << 24), /*!< running(foo) */ RPMNS_TYPE_RUNNING = (1 << 24), /*!< running(foo) */
RPMNS_TYPE_SANITY = (1 << 25), /*!< sanitycheck(foo) */ RPMNS_TYPE_SANITY = (1 << 25), /*!< sanitycheck(foo) */
RPMNS_TYPE_VCHECK = (1 << 26), /*!< vcheck(foo) */ RPMNS_TYPE_VCHECK = (1 << 26), /*!< vcheck(foo) */
RPMNS_TYPE_SIGNATURE= (1 << 27), /*!< signature(/text:/sig) = /pub:id */ RPMNS_TYPE_SIGNATURE= (1 << 27), /*!< signature(/text:/sig) = /pub:id */
RPMNS_TYPE_VERIFY = (1 << 28), /*!< verify(N) = E:V-R */ RPMNS_TYPE_VERIFY = (1 << 28), /*!< verify(N) = E:V-R */
RPMNS_TYPE_CONFIG = (1 << 29), /*!< config(N) = E:V-R */
} nsType; } nsType;
#if defined(_RPMNS_INTERNAL) #if defined(_RPMNS_INTERNAL)
/** \ingroup rpmds /** \ingroup rpmds
* An NS parsing container. * An NS parsing container.
*/ */
struct rpmns_s { struct rpmns_s {
/*@owned@*/ /*@owned@*/
const char * str; /*!< string storage */ const char * str; /*!< string storage */
nsType Type; /*!< Type */ nsType Type; /*!< Type */
skipping to change at line 135 skipping to change at line 136
* @param pubfn binary/pem encoded pubkey file (NULL uses rp mdb keyring) * @param pubfn binary/pem encoded pubkey file (NULL uses rp mdb keyring)
* @param pubid pubkey fingerprint hex string (NULL disables check) * @param pubid pubkey fingerprint hex string (NULL disables check)
* @param flags (unused) * @param flags (unused)
* @return RPMRC_OK if verified, RPMRC_FAIL if not verified * @return RPMRC_OK if verified, RPMRC_FAIL if not verified
*/ */
rpmRC rpmnsProbeSignature(void * _ts, const char * fn, rpmRC rpmnsProbeSignature(void * _ts, const char * fn,
/*@null@*/ const char * sigfn, /*@null@*/ const char * sigfn,
/*@null@*/ const char * pubfn, /*@null@*/ const char * pubfn,
/*@null@*/ const char * pubid, /*@null@*/ const char * pubid,
int flags) int flags)
/*@globals fileSystem @*/ /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState
/*@modifies fileSystem @*/; @*/
/*@modifies _ts, rpmGlobalMacroContext, fileSystem, internalState @*
/;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* H_RPMNS */ #endif /* H_RPMNS */
 End of changes. 2 change blocks. 
2 lines changed or deleted 5 lines changed or added


 rpmpgp.h   rpmpgp.h 
skipping to change at line 15 skipping to change at line 15
* \file rpmio/rpmpgp.h * \file rpmio/rpmpgp.h
* *
* OpenPGP constants and structures from RFC-2440. * OpenPGP constants and structures from RFC-2440.
* *
* Text from RFC-2440 in comments is * Text from RFC-2440 in comments is
* Copyright (C) The Internet Society (1998). All Rights Reserved. * Copyright (C) The Internet Society (1998). All Rights Reserved.
*/ */
#include <string.h> #include <string.h>
#include <popt.h> #include <popt.h>
#include <rpmiotypes.h>
/** \ingroup rpmpgp #include <yarn.h>
*/
typedef /*@abstract@*/ struct DIGEST_CTX_s * DIGEST_CTX;
/** \ingroup rpmpgp
*/
typedef /*@abstract@*/ struct pgpPkt_s * pgpPkt;
/**
*/
typedef /*@abstract@*/ /*@refcounted@*/ struct pgpDig_s * pgpDig;
/**
*/
typedef /*@abstract@*/ struct pgpDigParams_s * pgpDigParams;
/** \ingroup rpmpgp
* Bit(s) to control digest and signature verification.
*/
typedef enum pgpVSFlags_e {
RPMVSF_DEFAULT = 0,
RPMVSF_NOHDRCHK = (1 << 0),
RPMVSF_NEEDPAYLOAD = (1 << 1),
/* bit(s) 2-7 unused */
RPMVSF_NOSHA1HEADER = (1 << 8),
RPMVSF_NOMD5HEADER = (1 << 9), /* unimplemented */
RPMVSF_NODSAHEADER = (1 << 10),
RPMVSF_NORSAHEADER = (1 << 11),
/* bit(s) 12-15 unused */
RPMVSF_NOSHA1 = (1 << 16), /* unimplemented */
RPMVSF_NOMD5 = (1 << 17),
RPMVSF_NODSA = (1 << 18),
RPMVSF_NORSA = (1 << 19)
/* bit(s) 20-31 unused */
} pgpVSFlags;
#define _RPMVSF_NODIGESTS \
( RPMVSF_NOSHA1HEADER | \
RPMVSF_NOMD5HEADER | \
RPMVSF_NOSHA1 | \
RPMVSF_NOMD5 )
#define _RPMVSF_NOSIGNATURES \
( RPMVSF_NODSAHEADER | \
RPMVSF_NORSAHEADER | \
RPMVSF_NODSA | \
RPMVSF_NORSA )
#define _RPMVSF_NOHEADER \
( RPMVSF_NOSHA1HEADER | \
RPMVSF_NOMD5HEADER | \
RPMVSF_NODSAHEADER | \
RPMVSF_NORSAHEADER )
#define _RPMVSF_NOPAYLOAD \
( RPMVSF_NOSHA1 | \
RPMVSF_NOMD5 | \
RPMVSF_NODSA | \
RPMVSF_NORSA )
#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;
skipping to change at line 96 skipping to change at line 38
const uint8_t * hash; const uint8_t * hash;
const char * params[4]; const char * params[4];
uint8_t tag; uint8_t tag;
uint8_t version; /*!< version number. */ uint8_t version; /*!< version number. */
uint8_t time[4]; /*!< time that the key was created. */ uint8_t time[4]; /*!< time that the key was created. */
uint8_t pubkey_algo; /*!< public key algorithm. */ uint8_t pubkey_algo; /*!< public key algorithm. */
uint8_t hash_algo; uint8_t hash_algo;
uint8_t sigtype; uint8_t sigtype;
uint8_t hashlen; size_t hashlen;
uint8_t signhash16[2]; uint8_t signhash16[2];
uint8_t signid[8]; uint8_t signid[8];
uint8_t saved; uint8_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 {
struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */
struct pgpDigParams_s signature; struct pgpDigParams_s signature;
struct pgpDigParams_s pubkey; struct pgpDigParams_s pubkey;
uint32_t sigtag; /*!< Package signature tag. */ uint32_t sigtag; /*!< Package signature tag. */
uint32_t sigtype; /*!< Package signature data type. */ uint32_t sigtype; /*!< Package signature data type. */
/*@relnull@*/ /*@relnull@*/
const void * sig; /*!< Package signature. */ const void * sig; /*!< Package signature. */
uint32_t siglen; /*!< Package signature length. */ uint32_t siglen; /*!< Package signature length. */
pgpVSFlags vsflags; /*!< Digest/signature operation disa blers. */ pgpVSFlags vsflags; /*!< Digest/signature operation disa blers. */
struct rpmop_s dops; /*!< Digest operation statistics. */ struct rpmop_s dops; /*!< Digest operation statistics. */
struct rpmop_s sops; /*!< Signature operation statistics. */ struct rpmop_s sops; /*!< Signature operation statistics. */
int (*findPubkey) (void * _ts, /*@null@*/ void * _dig) int (*findPubkey) (void * _ts, /*@null@*/ void * _dig)
/*@modifies *_ts, *_dig @*/;/*!< Find pubkey, i.e. rpmtsFindPubkey() . */ /*@modifies *_ts, *_dig @*/;/*!< Find pubkey, i.e. rpmtsFindPubkey() . */
/*@null@*/ /*@null@*/
void * _ts; /*!< Find pubkey argument, i.e. rpmt s. */ void * _ts; /*!< Find pubkey argument, i.e. rpmt s. */
/*@refs@*/
int nrefs; /*!< Reference count. */
uint8_t ** ppkts; uint8_t ** ppkts;
int npkts; int npkts;
size_t nbytes; /*!< No. bytes of plain text. */ size_t nbytes; /*!< No. bytes of plain text. */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
DIGEST_CTX sha1ctx; /*!< (dsa) sha1 hash context. */ DIGEST_CTX sha1ctx; /*!< (dsa) sha1 hash context. */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
DIGEST_CTX hdrsha1ctx; /*!< (dsa) header sha1 hash context. */ DIGEST_CTX hdrsha1ctx; /*!< (dsa) header sha1 hash context. */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
void * sha1; /*!< (dsa) V3 signature hash. */ void * sha1; /*!< (dsa) V3 signature hash. */
size_t sha1len; /*!< (dsa) V3 signature hash length. */ size_t sha1len; /*!< (dsa) V3 signature hash length. */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
DIGEST_CTX md5ctx; /*!< (rsa) md5 hash context. */ DIGEST_CTX md5ctx; /*!< (rsa) md5 hash context. */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
DIGEST_CTX hdrmd5ctx; /*!< (rsa) header md5 hash context. */ DIGEST_CTX hdrctx; /*!< (rsa) header hash context. */
/*@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__)
/*@refs@*/
int nrefs; /*!< (unused) keep splint happy */
#endif
}; };
#endif #endif
/** /**
*/ */
typedef const struct pgpValTbl_s { typedef const struct pgpValTbl_s {
int val; int val;
/*@observer@*/ const char * str; /*@observer@*/
const char * str;
} * pgpValTbl; } * pgpValTbl;
/** \ingroup rpmpgp /** \ingroup rpmpgp
* 4.3. Packet Tags * 4.3. Packet Tags
* *
* The packet tag denotes what type of packet the body holds. Note that * The packet tag denotes what type of packet the body holds. Note that
* old format headers can only have tags less than 16, whereas new * old format headers can only have tags less than 16, whereas new
* format headers can have tags as great as 63. * format headers can have tags as great as 63.
*/ */
typedef enum pgpTag_e { typedef enum pgpTag_e {
skipping to change at line 233 skipping to change at line 179
* dependent on the public key algorithm used. * dependent on the public key algorithm used.
* *
* Algorithm Specific Fields for RSA encryption * Algorithm Specific Fields for RSA encryption
* - multiprecision integer (MPI) of RSA encrypted value m**e mod n. * - multiprecision integer (MPI) of RSA encrypted value m**e mod n.
* *
* Algorithm Specific Fields for Elgamal encryption: * Algorithm Specific Fields for Elgamal encryption:
* - MPI of Elgamal (Diffie-Hellman) value g**k mod p. * - MPI of Elgamal (Diffie-Hellman) value g**k mod p.
* - MPI of Elgamal (Diffie-Hellman) value m * y**k mod p. * - MPI of Elgamal (Diffie-Hellman) value m * y**k mod p.
*/ */
typedef struct pgpPktPubkey_s { typedef struct pgpPktPubkey_s {
uint8_t version; /*!< version number (generate 3, accept 2). */ uint8_t version; /*!< version number (generate 3, accept 2).
uint8_t keyid[8]; /*!< key ID of the public key for session key. */ */
uint8_t algo; /*!< public key algorithm used. */ uint8_t keyid[8]; /*!< key ID of the public key for session. */
uint8_t algo; /*!< public key algorithm used. */
} pgpPktPubkey; } pgpPktPubkey;
/** \ingroup rpmpgp /** \ingroup rpmpgp
* 5.2.1. Signature Types * 5.2.1. Signature Types
* *
* There are a number of possible meanings for a signature, which are * There are a number of possible meanings for a signature, which are
* specified in a signature type octet in any given signature. * specified in a signature type octet in any given signature.
*/ */
/*@-typeuse@*/ /*@-typeuse@*/
typedef enum pgpSigType_e { typedef enum pgpSigType_e {
skipping to change at line 262 skipping to change at line 208
/*!< 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_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; } 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
* 9.1. Public Key Algorithms * 9.1. Public Key Algorithms
skipping to change at line 327 skipping to change at line 274
ID Algorithm ID Algorithm
-- --------- -- ---------
0 - Plaintext or unencrypted data 0 - Plaintext or unencrypted data
1 - IDEA [IDEA] 1 - IDEA [IDEA]
2 - Triple-DES (DES-EDE, as per spec - 2 - Triple-DES (DES-EDE, as per spec -
168 bit key derived from 192) 168 bit key derived from 192)
3 - CAST5 (128 bit key, as per RFC 2144) 3 - CAST5 (128 bit key, as per RFC 2144)
4 - Blowfish (128 bit key, 16 rounds) [BLOWFISH] 4 - Blowfish (128 bit key, 16 rounds) [BLOWFISH]
5 - SAFER-SK128 (13 rounds) [SAFER] 5 - SAFER-SK128 (13 rounds) [SAFER]
6 - Reserved for DES/SK 6 - Reserved for DES/SK
7 - Reserved for AES with 128-bit key 7 - AES with 128-bit key
8 - Reserved for AES with 192-bit key 8 - AES with 192-bit key
9 - Reserved for AES with 256-bit key 9 - AES with 256-bit key
10 - Twofish with 256-bit key
100 to 110 - Private/Experimental algorithm. 100 to 110 - Private/Experimental algorithm.
\endverbatim \endverbatim
* *
* Implementations MUST implement Triple-DES. Implementations SHOULD * Implementations MUST implement Triple-DES. Implementations SHOULD
* implement IDEA and CAST5. Implementations MAY implement any other * implement IDEA and CAST5. Implementations MAY implement any other
* algorithm. * algorithm.
*/ */
/*@-typeuse@*/ /*@-typeuse@*/
typedef enum pgpSymkeyAlgo_e { typedef enum pgpSymkeyAlgo_e {
PGPSYMKEYALGO_PLAINTEXT = 0, /*!< Plaintext */ PGPSYMKEYALGO_PLAINTEXT = 0, /*!< Plaintext */
skipping to change at line 402 skipping to change at line 350
* *
\verbatim \verbatim
ID Algorithm Text Name ID Algorithm Text Name
-- --------- ---- ---- -- --------- ---- ----
1 - MD5 "MD5" 1 - MD5 "MD5"
2 - SHA-1 "SHA1" 2 - SHA-1 "SHA1"
3 - RIPE-MD/160 "RIPEMD160" 3 - RIPE-MD/160 "RIPEMD160"
4 - Reserved for double-width SHA (experimental) 4 - Reserved for double-width SHA (experimental)
5 - MD2 "MD2" 5 - MD2 "MD2"
6 - Reserved for TIGER/192 "TIGER192" 6 - Reserved for TIGER/192 "TIGER192"
7 - Reserved for HAVAL (5 pass, 160-bit) 7 - Reserved for HAVAL (5 pass, 160-bit) "HAVAL-5-160"
"HAVAL-5-160"
100 to 110 - Private/Experimental algorithm. 100 to 110 - Private/Experimental algorithm.
\endverbatim \endverbatim
* *
* Implementations MUST implement SHA-1. Implementations SHOULD * Implementations MUST implement SHA-1. Implementations SHOULD
* implement MD5. * implement MD5.
* @todo Add SHA256. * @todo Add SHA256.
*/ */
typedef enum pgpHashAlgo_e { typedef enum pgpHashAlgo_e {
PGPHASHALGO_ERROR = -1, PGPHASHALGO_ERROR = -1,
PGPHASHALGO_NONE = 0, PGPHASHALGO_NONE = 0,
PGPHASHALGO_MD5 = 1, /*!< MD5 */ PGPHASHALGO_MD5 = 1, /*!< MD5 */
PGPHASHALGO_SHA1 = 2, /*!< SHA-1 */ PGPHASHALGO_SHA1 = 2, /*!< SHA-1 */
PGPHASHALGO_RIPEMD160 = 3, /*!< RIPEMD-160 */ PGPHASHALGO_RIPEMD160 = 3, /*!< RIPEMD-160 */
PGPHASHALGO_MD2 = 5, /*!< MD2 */ PGPHASHALGO_MD2 = 5, /*!< MD2 */
PGPHASHALGO_TIGER192 = 6, /*!< TIGER-192 */ PGPHASHALGO_TIGER192 = 6, /*!< TIGER-192 */
PGPHASHALGO_HAVAL_5_160 = 7, /*!< HAVAL-5-160 */ PGPHASHALGO_HAVAL_5_160 = 7, /*!< HAVAL-5-160 */
PGPHASHALGO_SHA256 = 8, /*!< SHA-256 */ PGPHASHALGO_SHA256 = 8, /*!< SHA-256 */
PGPHASHALGO_SHA384 = 9, /*!< SHA-384 */ PGPHASHALGO_SHA384 = 9, /*!< SHA-384 */
PGPHASHALGO_SHA512 = 10, /*!< SHA-512 */ PGPHASHALGO_SHA512 = 10, /*!< SHA-512 */
PGPHASHALGO_SHA224 = 11, /*!< SHA-224 */
PGPHASHALGO_MD4 = 104, /*!< (private) MD4 */ PGPHASHALGO_MD4 = 104, /*!< (private) MD4 */
PGPHASHALGO_RIPEMD128 = 105, /*!< (private) RIPEMD-128 */ PGPHASHALGO_RIPEMD128 = 105, /*!< (private) RIPEMD-128 */
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_SHA224 = 110, /*!< (private) SHA-224 */
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; } pgpHashAlgo;
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Hash (string, value) pairs. * Hash (string, value) pairs.
*/ */
skipping to change at line 471 skipping to change at line 419
* Algorithm Specific Fields for DSA signatures: * Algorithm Specific Fields for DSA signatures:
* - MPI of DSA value r. * - MPI of DSA value r.
* - MPI of DSA value s. * - MPI of DSA value s.
*/ */
typedef struct pgpPktSigV3_s { typedef struct pgpPktSigV3_s {
uint8_t version; /*!< version number (3). */ uint8_t version; /*!< version number (3). */
uint8_t hashlen; /*!< length of following hashed material. MUST be 5. */ uint8_t hashlen; /*!< length of following hashed material. MUST be 5. */
uint8_t sigtype; /*!< signature type. */ uint8_t sigtype; /*!< signature type. */
uint8_t time[4]; /*!< 4 byte creation time. */ uint8_t time[4]; /*!< 4 byte creation time. */
uint8_t signid[8]; /*!< key ID of signer. */ uint8_t signid[8]; /*!< key ID of signer. */
uint8_t pubkey_algo;/*!< public key algorithm. */ uint8_t pubkey_algo; /*!< public key algorithm. */
uint8_t hash_algo; /*!< hash algorithm. */ uint8_t hash_algo; /*!< hash algorithm. */
uint8_t signhash16[2]; /*!< left 16 bits of signed hash value. */ uint8_t signhash16[2]; /*!< left 16 bits of signed hash value. */
} * pgpPktSigV3; } * pgpPktSigV3;
/** \ingroup rpmpgp /** \ingroup rpmpgp
* 5.2.3. Version 4 Signature Packet Format * 5.2.3. Version 4 Signature Packet Format
* *
* The body of a version 4 Signature Packet contains: * The body of a version 4 Signature Packet contains:
* - One-octet version number (4). * - One-octet version number (4).
* - One-octet signature type. * - One-octet signature type.
skipping to change at line 498 skipping to change at line 446
* - Hashed subpacket data. (zero or more subpackets) * - Hashed subpacket data. (zero or more subpackets)
* - Two-octet scalar octet count for following unhashed subpacket * - Two-octet scalar octet count for following unhashed subpacket
* data. Note that this is the length in octets of all of the * data. Note that this is the length in octets of all of the
* unhashed subpackets; a pointer incremented by this number will * unhashed subpackets; a pointer incremented by this number will
* skip over the unhashed subpackets. * skip over the unhashed subpackets.
* - Unhashed subpacket data. (zero or more subpackets) * - Unhashed subpacket data. (zero or more subpackets)
* - Two-octet field holding left 16 bits of signed hash value. * - Two-octet field holding left 16 bits of signed hash value.
* - One or more multi-precision integers comprising the signature. * - One or more multi-precision integers comprising the signature.
*/ */
typedef struct pgpPktSigV4_s { typedef struct pgpPktSigV4_s {
uint8_t version; /*!< version number (4). */ uint8_t version; /*!< version number (4). */
uint8_t sigtype; /*!< signature type. */ uint8_t sigtype; /*!< signature type. */
uint8_t pubkey_algo;/*!< public key algorithm. */ uint8_t pubkey_algo; /*!< public key algorithm. */
uint8_t hash_algo; /*!< hash algorithm. */ uint8_t hash_algo; /*!< hash algorithm. */
uint8_t hashlen[2]; /*!< length of following hashed material. */ uint8_t hashlen[2]; /*!< length of following hashed material. */
} * pgpPktSigV4; } * pgpPktSigV4;
/** \ingroup rpmpgp /** \ingroup rpmpgp
* 5.2.3.1. Signature Subpacket Specification * 5.2.3.1. Signature Subpacket Specification
* *
* The subpacket fields consist of zero or more signature subpackets. * The subpacket fields consist of zero or more signature subpackets.
* Each set of subpackets is preceded by a two-octet scalar count of the * Each set of subpackets is preceded by a two-octet scalar count of the
* length of the set of subpackets. * length of the set of subpackets.
skipping to change at line 538 skipping to change at line 486
subpacketLen = ((1st_octet - 192) << 8) + (2nd_octet) + 192 subpacketLen = ((1st_octet - 192) << 8) + (2nd_octet) + 192
if the 1st octet = 255, then if the 1st octet = 255, then
lengthOfLength = 5 lengthOfLength = 5
subpacket length = [four-octet scalar starting at 2nd_octet] subpacket length = [four-octet scalar starting at 2nd_octet]
\endverbatim \endverbatim
* *
* The value of the subpacket type octet may be: * The value of the subpacket type octet may be:
* *
\verbatim \verbatim
0 = reserved
1 = reserved
2 = signature creation time 2 = signature creation time
3 = signature expiration time 3 = signature expiration time
4 = exportable certification 4 = exportable certification
5 = trust signature 5 = trust signature
6 = regular expression 6 = regular expression
7 = revocable 7 = revocable
8 = reserved
9 = key expiration time 9 = key expiration time
10 = placeholder for backward compatibility 10 = placeholder for backward compatibility
11 = preferred symmetric algorithms 11 = preferred symmetric algorithms
12 = revocation key 12 = revocation key
13 = reserved
14 = reserved
15 = reserved
16 = issuer key ID 16 = issuer key ID
17 = reserved
18 = reserved
19 = reserved
20 = notation data 20 = notation data
21 = preferred hash algorithms 21 = preferred hash algorithms
22 = preferred compression algorithms 22 = preferred compression algorithms
23 = key server preferences 23 = key server preferences
24 = preferred key server 24 = preferred key server
25 = primary user id 25 = primary user id
26 = policy URL 26 = policy URL
27 = key flags 27 = key flags
28 = signer's user id 28 = signer's user id
29 = reason for revocation 29 = reason for revocation
30 = features
31 = signature target
32 = embedded signature
100 to 110 = internal or user-defined 100 to 110 = internal or user-defined
\endverbatim \endverbatim
* *
* An implementation SHOULD ignore any subpacket of a type that it does * An implementation SHOULD ignore any subpacket of a type that it does
* not recognize. * not recognize.
* *
* Bit 7 of the subpacket type is the "critical" bit. If set, it * Bit 7 of the subpacket type is the "critical" bit. If set, it
* denotes that the subpacket is one that is critical for the evaluator * denotes that the subpacket is one that is critical for the evaluator
* of the signature to recognize. If a subpacket is encountered that is * of the signature to recognize. If a subpacket is encountered that is
* marked critical but is unknown to the evaluating software, the * marked critical but is unknown to the evaluating software, the
skipping to change at line 595 skipping to change at line 555
PGPSUBTYPE_NOTATION = 20, /*!< notation data */ PGPSUBTYPE_NOTATION = 20, /*!< notation data */
PGPSUBTYPE_PREFER_HASH = 21, /*!< preferred hash algorithms */ PGPSUBTYPE_PREFER_HASH = 21, /*!< preferred hash algorithms */
PGPSUBTYPE_PREFER_COMPRESS = 22, /*!< preferred compression algorithms */ PGPSUBTYPE_PREFER_COMPRESS = 22, /*!< preferred compression algorithms */
PGPSUBTYPE_KEYSERVER_PREFERS= 23, /*!< key server preferences */ PGPSUBTYPE_KEYSERVER_PREFERS= 23, /*!< key server preferences */
PGPSUBTYPE_PREFER_KEYSERVER = 24, /*!< preferred key server */ PGPSUBTYPE_PREFER_KEYSERVER = 24, /*!< preferred key server */
PGPSUBTYPE_PRIMARY_USERID = 25, /*!< primary user id */ PGPSUBTYPE_PRIMARY_USERID = 25, /*!< primary user id */
PGPSUBTYPE_POLICY_URL = 26, /*!< policy URL */ PGPSUBTYPE_POLICY_URL = 26, /*!< policy URL */
PGPSUBTYPE_KEY_FLAGS = 27, /*!< key flags */ PGPSUBTYPE_KEY_FLAGS = 27, /*!< key flags */
PGPSUBTYPE_SIGNER_USERID = 28, /*!< signer's user id */ PGPSUBTYPE_SIGNER_USERID = 28, /*!< signer's user id */
PGPSUBTYPE_REVOKE_REASON = 29, /*!< reason for revocation */ PGPSUBTYPE_REVOKE_REASON = 29, /*!< reason for revocation */
PGPSUBTYPE_FEATURES = 30, /*!< feature flags (gpg) */ PGPSUBTYPE_FEATURES = 30, /*!< feature flags */
PGPSUBTYPE_EMBEDDED_SIG = 32, /*!< embedded signature (gpg) */ PGPSUBTYPE_SIG_TARGET = 31, /*!< signature target */
PGPSUBTYPE_EMBEDDED_SIG = 32, /*!< embedded signature */
PGPSUBTYPE_INTERNAL_100 = 100, /*!< internal or user-defined */ PGPSUBTYPE_INTERNAL_100 = 100, /*!< internal or user-defined */
PGPSUBTYPE_INTERNAL_101 = 101, /*!< internal or user-defined */ PGPSUBTYPE_INTERNAL_101 = 101, /*!< internal or user-defined */
PGPSUBTYPE_INTERNAL_102 = 102, /*!< internal or user-defined */ PGPSUBTYPE_INTERNAL_102 = 102, /*!< internal or user-defined */
PGPSUBTYPE_INTERNAL_103 = 103, /*!< internal or user-defined */ PGPSUBTYPE_INTERNAL_103 = 103, /*!< internal or user-defined */
PGPSUBTYPE_INTERNAL_104 = 104, /*!< internal or user-defined */ PGPSUBTYPE_INTERNAL_104 = 104, /*!< internal or user-defined */
PGPSUBTYPE_INTERNAL_105 = 105, /*!< internal or user-defined */ PGPSUBTYPE_INTERNAL_105 = 105, /*!< internal or user-defined */
PGPSUBTYPE_INTERNAL_106 = 106, /*!< internal or user-defined */ PGPSUBTYPE_INTERNAL_106 = 106, /*!< internal or user-defined */
PGPSUBTYPE_INTERNAL_107 = 107, /*!< internal or user-defined */ PGPSUBTYPE_INTERNAL_107 = 107, /*!< internal or user-defined */
PGPSUBTYPE_INTERNAL_108 = 108, /*!< internal or user-defined */ PGPSUBTYPE_INTERNAL_108 = 108, /*!< internal or user-defined */
skipping to change at line 709 skipping to change at line 670
* another One-Pass Signature packet that describes another * another One-Pass Signature packet that describes another
* signature to be applied to the same message data. * signature to be applied to the same message data.
* *
* Note that if a message contains more than one one-pass signature, * Note that if a message contains more than one one-pass signature,
* then the signature packets bracket the message; that is, the first * then the signature packets bracket the message; that is, the first
* signature packet after the message corresponds to the last one-pass * signature packet after the message corresponds to the last one-pass
* packet and the final signature packet corresponds to the first one- * packet and the final signature packet corresponds to the first one-
* pass packet. * pass packet.
*/ */
typedef struct pgpPktOnepass_s { typedef struct pgpPktOnepass_s {
uint8_t version; /*!< version number (3). */ uint8_t version; /*!< version number (3). */
uint8_t sigtype; /*!< signature type. */ uint8_t sigtype; /*!< signature type. */
uint8_t hash_algo; /*!< hash algorithm. */ uint8_t hash_algo; /*!< hash algorithm. */
uint8_t pubkey_algo;/*!< public key algorithm. */ uint8_t pubkey_algo; /*!< public key algorithm. */
uint8_t signid[8]; /*!< key ID of signer. */ uint8_t signid[8]; /*!< key ID of signer. */
uint8_t nested; uint8_t nested;
} * pgpPktOnepass; } * pgpPktOnepass;
/** \ingroup rpmpgp /** \ingroup rpmpgp
* 5.5.1. Key Packet Variants * 5.5.1. Key Packet Variants
* *
* 5.5.1.1. Public Key Packet (Tag 6) * 5.5.1.1. Public Key Packet (Tag 6)
* *
* A Public Key packet starts a series of packets that forms an OpenPGP * A Public Key packet starts a series of packets that forms an OpenPGP
skipping to change at line 790 skipping to change at line 751
* V3 key that has the same key ID as any other key because the key ID * V3 key that has the same key ID as any other key because the key ID
* is simply the low 64 bits of the public modulus. Secondly, because * is simply the low 64 bits of the public modulus. Secondly, because
* the fingerprint of a V3 key hashes the key material, but not its * the fingerprint of a V3 key hashes the key material, but not its
* length, which increases the opportunity for fingerprint collisions. * length, which increases the opportunity for fingerprint collisions.
* Third, there are minor weaknesses in the MD5 hash algorithm that make * Third, there are minor weaknesses in the MD5 hash algorithm that make
* developers prefer other algorithms. See below for a fuller discussion * developers prefer other algorithms. See below for a fuller discussion
* of key IDs and fingerprints. * of key IDs and fingerprints.
* *
*/ */
typedef struct pgpPktKeyV3_s { typedef struct pgpPktKeyV3_s {
uint8_t version; /*!< version number (3). */ uint8_t version; /*!< version number (3). */
uint8_t time[4]; /*!< time that the key was created. */ uint8_t time[4]; /*!< time that the key was created. */
uint8_t valid[2]; /*!< time in days that this key is valid. */ uint8_t valid[2]; /*!< time in days that this key is valid. */
uint8_t pubkey_algo;/*!< public key algorithm. */ uint8_t pubkey_algo; /*!< public key algorithm. */
} * pgpPktKeyV3; } * pgpPktKeyV3;
/** \ingroup rpmpgp /** \ingroup rpmpgp
* The version 4 format is similar to the version 3 format except for * The version 4 format is similar to the version 3 format except for
* the absence of a validity period. This has been moved to the * the absence of a validity period. This has been moved to the
* signature packet. In addition, fingerprints of version 4 keys are * signature packet. In addition, fingerprints of version 4 keys are
* calculated differently from version 3 keys, as described in section * calculated differently from version 3 keys, as described in section
* "Enhanced Key Formats." * "Enhanced Key Formats."
* *
* A version 4 packet contains: * A version 4 packet contains:
skipping to change at line 828 skipping to change at line 789
* - MPI of DSA public key value y (= g**x where x is secret). * - MPI of DSA public key value y (= g**x where x is secret).
* *
* Algorithm Specific Fields for Elgamal public keys: * Algorithm Specific Fields for Elgamal public keys:
* - MPI of Elgamal prime p; * - MPI of Elgamal prime p;
* - MPI of Elgamal group generator g; * - MPI of Elgamal group generator g;
* - MPI of Elgamal public key value y (= g**x where x is * - MPI of Elgamal public key value y (= g**x where x is
* secret). * secret).
* *
*/ */
typedef struct pgpPktKeyV4_s { typedef struct pgpPktKeyV4_s {
uint8_t version; /*!< version number (4). */ uint8_t version; /*!< version number (4). */
uint8_t time[4]; /*!< time that the key was created. */ uint8_t time[4]; /*!< time that the key was created. */
uint8_t pubkey_algo;/*!< public key algorithm. */ uint8_t pubkey_algo; /*!< public key algorithm. */
} * pgpPktKeyV4; } * pgpPktKeyV4;
/** \ingroup rpmpgp /** \ingroup rpmpgp
* 5.5.3. Secret Key Packet Formats * 5.5.3. Secret Key Packet Formats
* *
* The Secret Key and Secret Subkey packets contain all the data of the * The Secret Key and Secret Subkey packets contain all the data of the
* Public Key and Public Subkey packets, with additional algorithm- * Public Key and Public Subkey packets, with additional algorithm-
* specific secret key data appended, in encrypted form. * specific secret key data appended, in encrypted form.
* *
* The packet contains: * The packet contains:
skipping to change at line 1155 skipping to change at line 1116
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Return length of an OpenPGP packet. * Return length of an OpenPGP packet.
* @param s pointer to packet * @param s pointer to packet
* @retval *lenp no. of bytes in packet * @retval *lenp no. of bytes in packet
* @return no. of bytes in length prefix * @return no. of bytes in length prefix
*/ */
/*@unused@*/ static inline /*@unused@*/ static inline
unsigned int pgpLen(const uint8_t * s, /*@out@*/ unsigned int * lenp) unsigned int pgpLen(const uint8_t * s, /*@out@*/ unsigned int * lenp)
/*@modifies *lenp @*/ /*@modifies *lenp @*/
{ {
if (*s < 192) { if (*s < (uint8_t)192) {
*lenp = (unsigned int) *s++; *lenp = (unsigned int) *s++;
return 1; return 1;
} else if (*s < 255) { } else if (*s < (uint8_t)255) {
*lenp = (unsigned int) ((((unsigned)s[0]) - 192) << 8) + s[1] + 192; *lenp = (unsigned int) ((((unsigned)s[0]) - 192) << 8) + (unsigned)s
[1] + 192;
return 2; return 2;
} else { } else {
*lenp = pgpGrab(s+1, 4); *lenp = pgpGrab(s+1, 4);
return 5; return 5;
} }
} }
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Return no. of bits in a multiprecision integer. * Return no. of bits in a multiprecision integer.
* @param p pointer to multiprecision integer * @param p pointer to multiprecision integer
skipping to change at line 1375 skipping to change at line 1336
/*@modifies *keyid @*/; /*@modifies *keyid @*/;
/*@=exportlocal@*/ /*@=exportlocal@*/
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Extract OpenPGP public key fingerprint from base64 encoded packet. * Extract OpenPGP public key fingerprint from base64 encoded packet.
* @todo V3 non-RSA public keys not implemented. * @todo V3 non-RSA public keys not implemented.
* @param b64pkt base64 encoded openpgp packet * @param b64pkt base64 encoded openpgp packet
* @retval keyid[8] public key fingerprint * @retval keyid[8] public key fingerprint
* @return 8 (no. of bytes) on success, < 0 on error * @return 8 (no. of bytes) on success, < 0 on error
*/ */
int pgpExtractPubkeyFingerprint(const char * b64pkt, /*@out@*/ uint8_t * ke int pgpExtractPubkeyFingerprint(const char * b64pkt,
yid) /*@out@*/ uint8_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.
*/ */
int pgpPktLen(const uint8_t * pkt, size_t pleft, /*@out@*/ pgpPkt pp) int pgpPktLen(const uint8_t * pkt, size_t pleft, /*@out@*/ pgpPkt pp)
skipping to change at line 1420 skipping to change at line 1382
/*@modifies dig, fileSystem, internalState @*/; /*@modifies dig, fileSystem, internalState @*/;
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Parse armored OpenPGP packets from a file. * Parse armored OpenPGP packets from a file.
* @param fn file name * @param fn file name
* @retval pkt dearmored OpenPGP packet(s) * @retval pkt dearmored OpenPGP packet(s)
* @retval pktlen dearmored OpenPGP packet(s) length in bytes * @retval pktlen dearmored OpenPGP packet(s) length in bytes
* @return type of armor found * @return type of armor found
*/ */
pgpArmor pgpReadPkts(const char * fn, pgpArmor pgpReadPkts(const char * fn,
/*@out@*/ const uint8_t ** pkt, /*@out@*/ size_t * pktlen) /*@out@*/ uint8_t ** pkt, /*@out@*/ size_t * pktlen)
/*@globals h_errno, fileSystem, internalState @*/ /*@globals h_errno, fileSystem, internalState @*/
/*@modifies *pkt, *pktlen, fileSystem, internalState @*/; /*@modifies *pkt, *pktlen, fileSystem, internalState @*/;
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Wrap a OpenPGP packets in ascii armor for transport. * Wrap a OpenPGP packets in ascii armor for transport.
* @param atype type of armor * @param atype type of armor
* @param s binary pkt data * @param s binary pkt data
* @param ns binary pkt data length * @param ns binary pkt data length
* @return formatted string * @return formatted string
*/ */
char * pgpArmorWrap(int atype, const unsigned char * s, size_t ns) char * pgpArmorWrap(uint8_t atype, const unsigned char * s, size_t ns)
/*@*/; /*@*/;
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Convert a hash algorithm "foo" to the internal PGPHASHALGO_FOO number. * Convert a hash algorithm "foo" to the internal PGPHASHALGO_FOO number.
* @param name name of hash algorithm * @param name name of hash algorithm
* @param name_len length of name or 0 for strlen(name) * @param name_len length of name or 0 for strlen(name)
* @return PGPHASHALGO_<name> or -1 in case of error * @return PGPHASHALGO_<name> or -1 in case of error
*/ */
pgpHashAlgo pgpHashAlgoStringToNumber(const char *name, size_t name_len) pgpHashAlgo pgpHashAlgoStringToNumber(const char *name, size_t name_len)
/*@*/; /*@*/;
skipping to change at line 1453 skipping to change at line 1415
/** /**
* 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 * @param msg
* @return NULL always * @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) /*@null@*/ const char * msg)
/*@modifies dig @*/; /*@modifies dig @*/;
#define pgpDigUnlink(_dig, _msg) \
/** @todo Remove debugging entry from the ABI. */ ((pgpDig)rpmioUnlinkPoolItem((rpmioItem)(_dig), _msg, __FILE__, __LINE_
/*@-exportlocal@*/ _))
/*@null@*/
pgpDig XpgpDigUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ pgpDig dig,
/*@null@*/ const char * msg, const char * fn, unsigned ln)
/*@modifies dig @*/;
/*@=exportlocal@*/
#define pgpDigUnlink(_dig, _msg) XpgpDigUnlink(_dig, _msg, __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 * @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, /*@null@*/ const char * msg)
/*@modifies dig @*/; /*@modifies dig @*/;
#define pgpDigLink(_dig, _msg) \
/** @todo Remove debugging entry from the ABI. */ ((pgpDig)rpmioLinkPoolItem((rpmioItem)(_dig), _msg, __FILE__, __LINE
/*@newref@*/ /*@null@*/ __))
pgpDig XpgpDigLink (/*@null@*/ pgpDig dig, /*@null@*/ const char * msg,
const char * fn, unsigned ln)
/*@modifies dig @*/;
#define pgpDigLink(_dig, _msg) XpgpDigLink(_dig, _msg, __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 always * @return NULL on last dereference
*/ */
/*@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) \
((pgpDig)rpmioFreePoolItem((rpmioItem)(_dig), _msg, __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 @*/
/*@modifies fileSystem @*/;
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Release (malloc'd) data from container. * Release (malloc'd) data from container.
* @param dig signature parameters container * @param dig signature parameters container
*/ */
void pgpDigClean(/*@null@*/ pgpDig dig) void pgpDigClean(/*@null@*/ pgpDig dig)
/*@modifies dig @*/; /*@modifies dig @*/;
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Return OpenPGP pubkey parameters. * Return OpenPGP pubkey parameters.
skipping to change at line 1581 skipping to change at line 1534
uint32_t sigtag, uint32_t sigtype, uint32_t sigtag, uint32_t sigtype,
/*@kept@*/ /*@null@*/ const void * sig, uint32_t siglen) /*@kept@*/ /*@null@*/ const void * sig, uint32_t siglen)
/*@modifies dig @*/; /*@modifies dig @*/;
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Return pgpDig container accumulator structure. * Return pgpDig container accumulator structure.
* @param dig signature parameters container * @param dig signature parameters container
* @param opx per-container accumulator index (aka rpmtsOpX) * @param opx per-container accumulator index (aka rpmtsOpX)
* @return per-container accumulator pointer * @return per-container accumulator pointer
*/ */
/*@null@*/
void * pgpStatsAccumulator(pgpDig dig, int opx) void * pgpStatsAccumulator(pgpDig dig, int opx)
/*@*/; /*@*/;
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Set find pubkey vector. * Set find pubkey vector.
* @param dig signature parameters container * @param dig signature parameters container
* @param findPubkey routine to find a pubkey. * @param findPubkey routine to find a pubkey.
* @param _ts argument to (*findPubkey) (ts, ...) * @param _ts argument to (*findPubkey) (ts, ...)
* @return 0 always * @return 0 always
*/ */
skipping to change at line 1690 skipping to change at line 1644
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
crc <<= 1; crc <<= 1;
if (crc & 0x1000000) if (crc & 0x1000000)
crc ^= CRC24_POLY; crc ^= CRC24_POLY;
} }
} }
return crc & 0xffffff; return crc & 0xffffff;
} }
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Return digest algorithm identifier.
* @param ctx digest context
* @return digest hash algorithm identifier
*/
/*@observer@*/
pgpHashAlgo rpmDigestAlgo(DIGEST_CTX ctx)
/*@*/;
/** \ingroup rpmpgp
* Return digest name.
* @param ctx digest context
* @return digest name
*/
/*@observer@*/
const char * rpmDigestName(DIGEST_CTX ctx)
/*@*/;
/** \ingroup rpmpgp
* Return digest ASN1 oid string.
* Values from PKCS#1 v2.1 (aka RFC-3447).
* @param ctx digest context
* @return digest ASN1 oid string
*/
/*@observer@*/ /*@null@*/
const char * rpmDigestASN1(DIGEST_CTX ctx)
/*@*/;
/** \ingroup rpmpgp
* Duplicate a digest context. * Duplicate a digest context.
* @param octx existing digest context * @param octx existing digest context
* @return duplicated digest context * @return duplicated digest context
*/ */
/*@only@*/ /*@only@*/
DIGEST_CTX rpmDigestDup(DIGEST_CTX octx) DIGEST_CTX rpmDigestDup(DIGEST_CTX octx)
/*@*/; /*@*/;
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Initialize digest. * Initialize digest.
 End of changes. 41 change blocks. 
120 lines changed or deleted 104 lines changed or added


 rpmps.h   rpmps.h 
skipping to change at line 85 skipping to change at line 85
rpmProblemType type; rpmProblemType type;
int ignoreProblem; int ignoreProblem;
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
char * str1; char * str1;
unsigned long long ulong1; unsigned long long ulong1;
}; };
/** /**
*/ */
struct rpmps_s { struct rpmps_s {
struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */
int numProblems; /*!< Current probs array size. */ int numProblems; /*!< Current probs array size. */
int numProblemsAlloced; /*!< Allocated probs array size. */ int numProblemsAlloced; /*!< Allocated probs array size. */
rpmProblem probs; /*!< Array of specific problems. */ rpmProblem probs; /*!< Array of specific problems. */
#if defined(__LCLINT__)
/*@refs@*/ /*@refs@*/
int nrefs; /*!< Reference count. */ int nrefs; /*!< (unused) keep splint happy */
#endif
}; };
/** /**
*/ */
struct rpmpsi_s { struct rpmpsi_s {
int ix; int ix;
rpmps ps; rpmps ps;
}; };
#endif #endif
skipping to change at line 123 skipping to change at line 126
/*@*/; /*@*/;
/*@=redecl@*/ /*@=redecl@*/
/*@=exportlocal@*/ /*@=exportlocal@*/
/** /**
* Unreference a problem set instance. * Unreference a problem set instance.
* @param ps problem set * @param ps problem set
* @param msg * @param msg
* @return problem set * @return problem set
*/ */
/*@unused@*/ /*@unused@*/ /*@null@*/
rpmps rpmpsUnlink (/*@killref@*/ /*@returned@*/ rpmps ps, rpmps rpmpsUnlink (/*@killref@*/ /*@returned@*/ rpmps ps,
const char * msg) const char * msg)
/*@modifies ps @*/; /*@modifies ps @*/;
#define rpmpsUnlink(_ps, _msg) \
/** @todo Remove debugging entry from the ABI. */ ((rpmps)rpmioUnlinkPoolItem((rpmioItem)(_ps), _msg, __FILE__, __LINE
/*@-exportlocal@*/ __))
/*@null@*/
rpmps XrpmpsUnlink (/*@killref@*/ /*@returned@*/ rpmps ps,
const char * msg, const char * fn, unsigned ln)
/*@modifies ps @*/;
#define rpmpsUnlink(_ps, _msg) XrpmpsUnlink(_ps, _msg, __FILE__, __
LINE__)
/*@=exportlocal@*/
/** /**
* Reference a problem set instance. * Reference a problem set instance.
* @param ps transaction set * @param ps transaction set
* @param msg * @param msg
* @return new transaction set reference * @return new transaction set reference
*/ */
/*@unused@*/ /*@unused@*/ /*@newref@*/
rpmps rpmpsLink (rpmps ps, const char * msg) rpmps rpmpsLink (rpmps ps, const char * msg)
/*@modifies ps @*/; /*@modifies ps @*/;
#define rpmpsLink(_ps, _msg) \
/** @todo Remove debugging entry from the ABI. */ ((rpmps)rpmioLinkPoolItem((rpmioItem)(_ps), _msg, __FILE__, __LINE__
rpmps XrpmpsLink (rpmps ps, ))
const char * msg, const char * fn, unsigned ln)
/*@modifies ps @*/;
#define rpmpsLink(_ps, _msg) XrpmpsLink(_ps, _msg, __FILE__, __LI
NE__)
/** /**
* 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
* @return problem set iterator * @return problem set iterator
*/ */
rpmpsi rpmpsInitIterator(rpmps ps) rpmpsi rpmpsInitIterator(rpmps ps)
/*@*/; /*@modifies ps @*/;
/** /**
* Destroy problem set iterator. * Destroy problem set iterator.
* @param psi problem set iterator * @param psi problem set iterator
* @return problem set iterator (NULL) * @return problem set iterator (NULL)
*/ */
rpmpsi rpmpsFreeIterator(rpmpsi psi) rpmpsi rpmpsFreeIterator(rpmpsi psi)
/*@*/; /*@modifies psi @*/;
/** /**
* Return next problem set iterator index * Return next problem set iterator index
* @param psi problem set iterator * @param psi problem set iterator
* @return iterator index, -1 on termination * @return iterator index, -1 on termination
*/ */
int rpmpsNextIterator(rpmpsi psi) int rpmpsNextIterator(rpmpsi psi)
/*@*/; /*@modifies psi @*/;
/** /**
* Return current problem from problem set * Return current problem from problem set
* @param psi problem set iterator * @param psi problem set iterator
* @return current rpmProblem * @return current rpmProblem
*/ */
/*@observer@*/
rpmProblem rpmpsProblem(rpmpsi psi) rpmProblem rpmpsProblem(rpmpsi psi)
/*@*/; /*@*/;
/** /**
* 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. * Destroy a problem set.
* @param ps problem set * @param ps problem set
* @return NULL always * @return NULL on last dereference
*/ */
/*@null@*/ /*@null@*/
rpmps rpmpsFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmps ps) rpmps rpmpsFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmps ps)
/*@modifies 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
*/ */
 End of changes. 12 change blocks. 
24 lines changed or deleted 17 lines changed or added


 rpmspec.h   rpmspec.h 
skipping to change at line 40 skipping to change at line 40
struct TriggerFileEntry * next; struct TriggerFileEntry * next;
}; };
#define RPMBUILD_DEFAULT_LANG "C" #define RPMBUILD_DEFAULT_LANG "C"
/** \ingroup rpmbuild /** \ingroup rpmbuild
*/ */
struct Source { struct Source {
/*@owned@*/ /*@owned@*/
const char * fullSource; const char * fullSource;
/*@dependent@*/ /*@dependent@*/ /*@relnull@*/
const char * source; /* Pointer into fullSource */ const char * source; /* Pointer into fullSource */
int flags; int flags;
uint32_t num; uint32_t num;
/*@owned@*/ /*@owned@*/
struct Source * next; struct Source * next;
}; };
/** \ingroup rpmbuild /** \ingroup rpmbuild
*/ */
/*@-typeuse@*/ /*@-typeuse@*/
skipping to change at line 63 skipping to change at line 63
/*@dependent@*/ /*@dependent@*/
struct ReadLevelEntry * next; struct ReadLevelEntry * next;
} RLE_t; } RLE_t;
/*@=typeuse@*/ /*@=typeuse@*/
/** \ingroup rpmbuild /** \ingroup rpmbuild
*/ */
typedef struct OpenFileInfo { typedef struct OpenFileInfo {
/*@only@*/ /*@only@*/
const char * fileName; const char * fileName;
/*@relnull@*/
FD_t fd; FD_t fd;
int lineNum; int lineNum;
char readBuf[BUFSIZ]; char readBuf[BUFSIZ];
/*@dependent@*/ /*@dependent@*/
char * readPtr; char * readPtr;
/*@owned@*/ /*@owned@*/
struct OpenFileInfo * next; struct OpenFileInfo * next;
} OFI_t; } OFI_t;
/** \ingroup rpmbuild /** \ingroup rpmbuild
skipping to change at line 174 skipping to change at line 175
rpmfi sourceCpioList; rpmfi sourceCpioList;
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,
uint32_t index, rpmsenseFlags tagflags); uint32_t index, rpmsenseFlags tagflags);
/*@only@*/ /*@only@*/
StringBuf prep; /*!< %prep scriptlet. */ rpmiob prep; /*!< %prep scriptlet. */
/*@only@*/ /*@only@*/
StringBuf build; /*!< %build scriptlet. */ rpmiob build; /*!< %build scriptlet. */
/*@only@*/ /*@only@*/
StringBuf install; /*!< %install scriptlet. */ rpmiob install; /*!< %install scriptlet. */
/*@only@*/ /*@only@*/
StringBuf check; /*!< %check scriptlet. */ rpmiob check; /*!< %check scriptlet. */
/*@only@*/ /*@only@*/
StringBuf clean; /*!< %clean scriptlet. */ rpmiob clean; /*!< %clean scriptlet. */
size_t nfoo; size_t nfoo;
/*@only@*/ /*@relnull@*/ /*@only@*/ /*@relnull@*/
tagStore_t foo; tagStore_t foo;
/*@owned@*/ /*@owned@*/
Package packages; /*!< Package list. */ Package packages; /*!< Package list. */
}; };
/** \ingroup rpmbuild /** \ingroup rpmbuild
skipping to change at line 225 skipping to change at line 226
/*@only@*/ /*@only@*/
const char * preTransFile; /*!< %pretrans scriptlet. */ const char * preTransFile; /*!< %pretrans scriptlet. */
/*@only@*/ /*@only@*/
const char * postTransFile; /*!< %posttrans scriptlet. */ const char * postTransFile; /*!< %posttrans scriptlet. */
/*@only@*/ /*@only@*/
const char * verifyFile; /*!< %verifyscript scriptlet. */ const char * verifyFile; /*!< %verifyscript scriptlet. */
/*@only@*/ /*@only@*/
const char * sanityCheckFile;/*!< %sanitycheck scriptlet. */ const char * sanityCheckFile;/*!< %sanitycheck scriptlet. */
/*@only@*/ /*@only@*/
StringBuf specialDoc; rpmiob specialDoc;
/*@only@*/ /*@only@*/
struct TriggerFileEntry * triggerFiles; struct TriggerFileEntry * triggerFiles;
/*@only@*/ /*@only@*/
const char * fileFile; const char * fileFile;
/*@only@*/ /*@only@*/
StringBuf fileList; /* If NULL, package will not be writ ten */ rpmiob fileList; /* If NULL, package will not be written */
/*@dependent@*/ /*@dependent@*/
Package next; Package next;
}; };
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** \ingroup rpmbuild /** \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@*/ Spec newSpec(void) /*@only@*/
/*@globals rpmGlobalMacroContext, h_errno @*/ Spec newSpec(void)
/*@modifies rpmGlobalMacroContext @*/; /*@globals rpmGlobalMacroContext, h_errno, internalState @*/
/*@modifies rpmGlobalMacroContext, internalState @*/;
/** \ingroup rpmbuild /** \ingroup rpmbuild
* Destroy Spec structure. * Destroy Spec structure.
* @param spec spec file control structure * @param spec spec file control structure
* @return NULL always * @return NULL always
*/ */
/*@null@*/ Spec freeSpec(/*@only@*/ /*@null@*/ Spec spec) /*@null@*/
Spec freeSpec(/*@only@*/ /*@null@*/ Spec spec)
/*@globals fileSystem, internalState @*/ /*@globals fileSystem, internalState @*/
/*@modifies spec, fileSystem, internalState @*/; /*@modifies spec, fileSystem, internalState @*/;
/** \ingroup rpmbuild /** \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
*/ */
skipping to change at line 287 skipping to change at line 290
/** \ingroup rpmbuild /** \ingroup rpmbuild
* stashSt. * stashSt.
* @param spec spec file control structure * @param spec spec file control structure
* @param h header * @param h header
* @param tag tag * @param tag tag
* @param lang locale * @param lang locale
* @return ptr to saved entry * @return ptr to saved entry
*/ */
spectag stashSt(Spec spec, Header h, rpmTag tag, const char * lang) spectag stashSt(Spec spec, Header h, rpmTag tag, const char * lang)
/*@modifies spec->st @*/; /*@globals internalState @*/
/*@modifies spec->st, internalState @*/;
/** \ingroup rpmbuild /** \ingroup rpmbuild
* addSource. * addSource.
* @param spec spec file control structure * @param spec spec file control structure
* @param pkg package control * @param pkg package control
* @param field field to parse * @param field field to parse
* @param tag tag * @param tag tag
* @return 0 on success * @return 0 on success
*/ */
int addSource(Spec spec, Package pkg, const char * field, rpmTag tag) int addSource(Spec spec, Package pkg, const char * field, rpmTag tag)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem @*/ /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies spec->sources, spec->numSources, /*@modifies spec->sources, spec->numSources,
spec->st, spec->macros, spec->st, spec->macros,
rpmGlobalMacroContext, fileSystem @*/; rpmGlobalMacroContext, fileSystem, internalState @*/;
/** \ingroup rpmbuild /** \ingroup rpmbuild
* parseNoSource. * parseNoSource.
* @param spec spec file control structure * @param spec spec file control structure
* @param field field to parse * @param field field to parse
* @param tag tag * @param tag tag
* @return 0 on success * @return 0 on success
*/ */
int parseNoSource(Spec spec, const char * field, rpmTag tag) int parseNoSource(Spec spec, const char * field, rpmTag tag)
/*@*/; /*@*/;
 End of changes. 14 change blocks. 
15 lines changed or deleted 19 lines changed or added


 rpmsq.h   rpmsq.h 
skipping to change at line 72 skipping to change at line 72
#endif #endif
/** /**
* Insert node into from queue. * Insert node into from queue.
* @param elem node to link * @param elem node to link
* @param prev previous node from queue * @param prev previous node from queue
* @return 0 on success * @return 0 on success
*/ */
/*@-exportlocal@*/ /*@-exportlocal@*/
int rpmsqInsert(/*@null@*/ void * elem, /*@null@*/ void * prev) int rpmsqInsert(/*@null@*/ void * elem, /*@null@*/ void * prev)
/*@globals systemState @*/ /*@globals rpmsqQueue, systemState @*/
/*@modifies elem, prev, systemState @*/; /*@modifies elem, prev, rpmsqQueue, systemState @*/;
/*@=exportlocal@*/ /*@=exportlocal@*/
/** /**
* Remove node from queue. * Remove node from queue.
* @param elem node to link * @param elem node to link
* @return 0 on success * @return 0 on success
*/ */
/*@-exportlocal@*/ /*@-exportlocal@*/
int rpmsqRemove(/*@null@*/ void * elem) int rpmsqRemove(/*@null@*/ void * elem)
/*@globals fileSystem, internalState @*/ /*@globals fileSystem, internalState @*/
 End of changes. 1 change blocks. 
2 lines changed or deleted 2 lines changed or added


 rpmssl.h   rpmssl.h 
skipping to change at line 38 skipping to change at line 38
/* DSA parameters. */ /* DSA parameters. */
DSA * dsa; DSA * dsa;
DSA_SIG * dsasig; DSA_SIG * dsasig;
/* RSA parameters. */ /* RSA parameters. */
RSA * rsa; RSA * rsa;
BIGNUM * rsahm; BIGNUM * rsahm;
BIGNUM * c; BIGNUM * c;
int type;
}; };
#endif #endif
/*@unchecked@*/ /*@unchecked@*/
extern pgpImplVecs_t rpmsslImplVecs; extern pgpImplVecs_t rpmsslImplVecs;
#endif /* H_RPMSSL */ #endif /* H_RPMSSL */
 End of changes. 1 change blocks. 
2 lines changed or deleted 0 lines changed or added


 rpmsw.h   rpmsw.h 
skipping to change at line 36 skipping to change at line 36
unsigned long int tocks[2]; unsigned long int tocks[2];
} u; } u;
}; };
/** \ingroup rpmio /** \ingroup rpmio
* Cumulative statistics for an operation. * Cumulative statistics for an operation.
*/ */
struct rpmop_s { struct rpmop_s {
struct rpmsw_s begin; /*!< Starting time stamp. */ struct rpmsw_s begin; /*!< Starting time stamp. */
int count; /*!< Number of operations. */ int count; /*!< Number of operations. */
size_t bytes; /*!< Number of bytes transferred. */ unsigned long long bytes; /*!< Number of bytes transferred. */
rpmtime_t usecs; /*!< Number of ticks. */ rpmtime_t usecs; /*!< Number of ticks. */
}; };
/*@unchecked@*/ /*@unchecked@*/
extern int _rpmsw_stats; extern int _rpmsw_stats;
/** \ingroup rpmio /** \ingroup rpmio
* Indices for timestamps. * Indices for timestamps.
*/ */
typedef enum rpmswOpX_e { typedef enum rpmswOpX_e {
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 rpmsx.h   rpmsx.h 
skipping to change at line 65 skipping to change at line 65
struct rpmsxs_s { struct rpmsxs_s {
/*@only@*/ /*@relnull@*/ /*@only@*/ /*@relnull@*/
const char * stem; const char * stem;
size_t len; size_t len;
}; };
/** /**
* File security context patterns container. * File security context patterns container.
*/ */
struct rpmsx_s { struct rpmsx_s {
struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */
/*@only@*/ /*@relnull@*/ /*@only@*/ /*@relnull@*/
rpmsxp sxp; /*!< File context patterns. */ rpmsxp sxp; /*!< File context patterns. */
int Count; /*!< No. of file context patterns. */ int Count; /*!< No. of file context patterns. */
int i; /*!< Current pattern index. */ int i; /*!< Current pattern index. */
/*@only@*/ /*@relnull@*/ /*@only@*/ /*@relnull@*/
rpmsxs sxs; /*!< File stems. */ rpmsxs sxs; /*!< File stems. */
int nsxs; /*!< No. of file stems. */ int nsxs; /*!< No. of file stems. */
int maxsxs; /*!< No. of allocated file stems. */ int maxsxs; /*!< No. of allocated file stems. */
int reverse; /*!< Reverse traversal? */ int reverse; /*!< Reverse traversal? */
#if defined(__LCLINT__)
/*@refs@*/ /*@refs@*/
int nrefs; /*!< Reference count. */ int nrefs; /*!< (unused) keep splint happy */
#endif
}; };
#endif /* defined(_RPMSX_INTERNAL) */ #endif /* defined(_RPMSX_INTERNAL) */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
* Unreference a security context patterns instance. * Unreference a security context patterns instance.
* @param sx security context patterns * @param sx security context patterns
* @param msg * @param msg
* @return NULL always * @return NULL on last dereference
*/ */
/*@unused@*/ /*@null@*/ /*@unused@*/ /*@null@*/
rpmsx rpmsxUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmsx sx, rpmsx rpmsxUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmsx sx,
/*@null@*/ const char * msg) /*@null@*/ const char * msg)
/*@modifies sx @*/; /*@modifies sx @*/;
#define rpmsxUnlink(_sx, _msg) \
/** @todo Remove debugging entry from the ABI. */ ((rpmsx)rpmioUnlinkPoolItem((rpmioItem)(_sx), _msg, __FILE__, __LINE__)
/*@-exportlocal@*/ )
/*@null@*/
rpmsx XrpmsxUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmsx sx,
/*@null@*/ const char * msg, const char * fn, unsigned ln)
/*@modifies sx @*/;
/*@=exportlocal@*/
#define rpmsxUnlink(_sx, _msg) XrpmsxUnlink(_sx, _msg, __FILE__, __
LINE__)
/** /**
* Reference a security context patterns instance. * Reference a security context patterns instance.
* @param sx security context patterns * @param sx security context patterns
* @param msg * @param msg
* @return new security context patterns reference * @return new security context patterns reference
*/ */
/*@-exportlocal@*/
/*@unused@*/ /*@newref@*/ /*@null@*/ /*@unused@*/ /*@newref@*/ /*@null@*/
rpmsx rpmsxLink (/*@null@*/ rpmsx sx, /*@null@*/ const char * msg) rpmsx rpmsxLink (/*@null@*/ rpmsx sx, /*@null@*/ const char * msg)
/*@modifies sx @*/; /*@modifies sx @*/;
#define rpmsxLink(_sx, _msg) \
/** @todo Remove debugging entry from the ABI. */ ((rpmsx)rpmioLinkPoolItem((rpmioItem)(_sx), _msg, __FILE__, __LINE__))
/*@newref@*/ /*@null@*/
rpmsx XrpmsxLink (/*@null@*/ rpmsx sx, /*@null@*/ const char * msg,
const char * fn, unsigned ln)
/*@modifies sx @*/;
/*@=exportlocal@*/
#define rpmsxLink(_sx, _msg) XrpmsxLink(_sx, _msg, __FILE__, __LI
NE__)
/** /**
* Destroy a security context patterns. * Destroy a security context patterns.
* @param sx security context patterns * @param sx security context patterns
* @return NULL always * @return NULL on last dereference
*/ */
/*@-exportlocal@*/
/*@null@*/ /*@null@*/
rpmsx rpmsxFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmsx sx) rpmsx rpmsxFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmsx sx)
/*@modifies sx@*/; /*@modifies sx@*/;
/*@=exportlocal@*/ #define rpmsxFree(_sx) \
((rpmsx)rpmioFreePoolItem((rpmioItem)(_sx), __FUNCTION__, __FILE__, __L
INE__))
/** /**
* Parse selinux file security context patterns. * Parse selinux file security context patterns.
* @param sx security context patterns * @param sx security context patterns
* @param fn file name to parse * @param fn file name to parse
* @return 0 on success * @return 0 on success
*/ */
/*@-exportlocal@*/ /*@-exportlocal@*/
int rpmsxParse(rpmsx sx, /*@null@*/ const char *fn) int rpmsxParse(rpmsx sx, /*@null@*/ const char *fn)
/*@globals rpmGlobalMacroContext, h_errno, /*@globals rpmGlobalMacroContext, h_errno,
 End of changes. 10 change blocks. 
25 lines changed or deleted 14 lines changed or added


 rpmtag.h   rpmtag.h 
#ifndef H_RPMTAG #ifndef H_RPMTAG
#define H_RPMTAG #define H_RPMTAG
/** \ingroup header /** \ingroup header
* \file rpmdb/rpmtag.h * \file rpmdb/rpmtag.h
*/ */
#include <rpmiotypes.h>
#include <rpmsw.h> #include <rpmsw.h>
#include <stringbuf.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** \ingroup header /** \ingroup header
*/ */
typedef const char * errmsg_t; typedef const char * errmsg_t;
/** \ingroup header /** \ingroup header
skipping to change at line 408 skipping to change at line 408
RPMTAG_REQUIREATTRSX = 1192, /* i[] (unimplemented) */ RPMTAG_REQUIREATTRSX = 1192, /* i[] (unimplemented) */
RPMTAG_BUILDPROVIDES = 1193, /* internal */ RPMTAG_BUILDPROVIDES = 1193, /* internal */
RPMTAG_BUILDOBSOLETES = 1194, /* internal */ RPMTAG_BUILDOBSOLETES = 1194, /* internal */
RPMTAG_DBINSTANCE = 1195, /* i */ RPMTAG_DBINSTANCE = 1195, /* i */
RPMTAG_NVRA = 1196, /* s */ RPMTAG_NVRA = 1196, /* s */
RPMTAG_FILEPATHS = 1197, /* s[] */ RPMTAG_FILEPATHS = 1197, /* s[] */
RPMTAG_ORIGPATHS = 1198, /* s[] */ RPMTAG_ORIGPATHS = 1198, /* s[] */
RPMTAG_RPMLIBVERSION = 1199, /* i */ RPMTAG_RPMLIBVERSION = 1199, /* i */
RPMTAG_RPMLIBTIMESTAMP = 1200, /* i */ RPMTAG_RPMLIBTIMESTAMP = 1200, /* i */
RPMTAG_RPMLIBVENDOR = 1201, /* i */ RPMTAG_RPMLIBVENDOR = 1201, /* i */
RPMTAG_CLASS = 1202, /* s */ RPMTAG_CLASS = 1202, /* s arbitrary */
RPMTAG_TRACK = 1203, /* s internal arbitrary */ RPMTAG_TRACK = 1203, /* s internal arbitrary */
RPMTAG_TRACKPROG = 1204, /* s internal arbitrary */ RPMTAG_TRACKPROG = 1204, /* s internal arbitrary */
RPMTAG_SANITYCHECK = 1205, /* s */ RPMTAG_SANITYCHECK = 1205, /* s */
RPMTAG_SANITYCHECKPROG = 1206, /* s */ RPMTAG_SANITYCHECKPROG = 1206, /* s */
RPMTAG_FILESTAT = 1207, /* s[] stat(2) from metadata extensi on*/ RPMTAG_FILESTAT = 1207, /* s[] stat(2) from metadata extensi on*/
RPMTAG_STAT = 1208, /* s[] stat(2) from disk ext ension */ RPMTAG_STAT = 1208, /* s[] stat(2) from disk ext ension */
RPMTAG_ORIGINTID = 1209, /* i[] */ RPMTAG_ORIGINTID = 1209, /* i[] */
RPMTAG_ORIGINTIME = 1210, /* i[] */ RPMTAG_ORIGINTIME = 1210, /* i[] */
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_FILEDIGESTALGO = 5011, /* i file checksum algorithm */
/*@-enummemuse@*/ /*@-enummemuse@*/
RPMTAG_FIRSTFREE_TAG /*!< internal */ RPMTAG_FIRSTFREE_TAG, /*!< internal */
/*@=enummemuse@*/ /*@=enummemuse@*/
RPMTAG_PACKAGETRANSFLAGS = 0x4efaafd9, /* s[] arbitrary */
RPMTAG_PACKAGEDEPFLAGS = 0x748a8314, /* s[] arbitrary */
RPMTAG_BUILDPREPPROG = 0x4ba37c9e, /* s[] arbitrary */
RPMTAG_BUILDPREP = 0x799c0b4d, /* s[] arbitrary */
RPMTAG_BUILDBUILDPROG = 0x6fb46014, /* s[] arbitrary */
RPMTAG_BUILDBUILD = 0x5bae1a5a, /* s[] arbitrary */
RPMTAG_BUILDINSTALLPROG = 0x70d4ab6f, /* s[] arbitrary */
RPMTAG_BUILDINSTALL = 0x567f5983, /* s[] arbitrary */
RPMTAG_BUILDCHECKPROG = 0x488a60ce, /* s[] arbitrary */
RPMTAG_BUILDCHECK = 0x7f3b97b5, /* s[] arbitrary */
RPMTAG_BUILDCLEANPROG = 0x42c93d41, /* s[] arbitrary */
RPMTAG_BUILDCLEAN = 0x566042bf, /* s[] arbitrary */
RPMTAG_LASTARBITRARY_TAG = 0x80000000 /*!< internal */
}; };
#define RPMTAG_EXTERNAL_TAG 1000000 #define RPMTAG_EXTERNAL_TAG 1000000
/** \ingroup signature /** \ingroup signature
* Tags found in signature header from package. * Tags found in signature header from package.
*/ */
enum rpmSigTag_e { enum rpmSigTag_e {
RPMSIGTAG_SIZE = 1000, /*!< internal Header+Payload size in bytes. */ RPMSIGTAG_SIZE = 1000, /*!< internal Header+Payload size in bytes. */
RPMSIGTAG_LEMD5_1 = 1001, /*!< internal Broken MD5, take 1 @deprecated legacy. */ RPMSIGTAG_LEMD5_1 = 1001, /*!< internal Broken MD5, take 1 @deprecated legacy. */
skipping to change at line 509 skipping to change at line 528
rpmTagType type; /*!< Tag type. */ rpmTagType type; /*!< Tag type. */
}; };
#endif #endif
/** /**
*/ */
struct tagStore_s { struct tagStore_s {
/*@only@*/ /*@only@*/
const char * str; /*!< Tag string (might be arbitrary). */ const char * str; /*!< Tag string (might be arbitrary). */
rpmTag tag; /*!< Tag number. */ rpmTag tag; /*!< Tag number. */
StringBuf val; /*!< Tag contents. */ rpmiob iob; /*!< Tag contents. */
}; };
#endif /* _RPMTAG_INTERNAL */ #endif /* _RPMTAG_INTERNAL */
/** /**
* Automatically generated table of tag name/value pairs. * Automatically generated table of tag name/value pairs.
*/ */
/*@-redecl@*/ /*@-redecl@*/
/*@observer@*/ /*@unchecked@*/ /*@observer@*/ /*@unchecked@*/
extern headerTagTableEntry rpmTagTable; extern headerTagTableEntry rpmTagTable;
/*@=redecl@*/ /*@=redecl@*/
skipping to change at line 722 skipping to change at line 741
* @param tags array of tag name/value/type triples (NULL uses defa ult) * @param tags array of tag name/value/type triples (NULL uses defa ult)
* @param exts formatting extensions chained table (NULL uses defau lt) * @param exts formatting extensions chained table (NULL uses defau lt)
* @retval errmsg error message (if any) * @retval errmsg error message (if any)
* @return formatted output string (malloc'ed) * @return formatted output string (malloc'ed)
*/ */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
char * headerSprintf(Header h, const char * fmt, char * headerSprintf(Header h, const char * fmt,
/*@null@*/ headerTagTableEntry tags, /*@null@*/ headerTagTableEntry tags,
/*@null@*/ headerSprintfExtension exts, /*@null@*/ headerSprintfExtension exts,
/*@null@*/ /*@out@*/ errmsg_t * errmsg) /*@null@*/ /*@out@*/ errmsg_t * errmsg)
/*@globals headerCompoundFormats @*/ /*@globals headerCompoundFormats, fileSystem, internalState @*/
/*@modifies h, *errmsg @*/ /*@modifies h, *errmsg, fileSystem, internalState @*/;
/*@requires maxSet(errmsg) >= 0 @*/;
/** \ingroup header /** \ingroup header
* Retrieve extension or tag value from a header. * Retrieve extension or tag value from a header.
* *
* @param h header * @param h header
* @param he tag container * @param he tag container
* @param flags tag retrieval flags * @param flags tag retrieval flags
* @return 1 on success, 0 on failure * @return 1 on success, 0 on failure
*/ */
int headerGet(Header h, HE_t he, unsigned int flags) int headerGet(Header h, HE_t he, unsigned int flags)
/*@modifies he @*/; /*@globals internalState @*/
/*@modifies he, internalState @*/;
#define HEADERGET_NOEXTENSION (1 << 0) /*!< Extension search disab ler. */ #define HEADERGET_NOEXTENSION (1 << 0) /*!< Extension search disab ler. */
#define HEADERGET_NOI18NSTRING (1 << 1) /*!< Return i18n strings as argv. */ #define HEADERGET_NOI18NSTRING (1 << 1) /*!< Return i18n strings as argv. */
/** \ingroup header /** \ingroup header
* Add or append tag container to header. * Add or append tag container to header.
* *
* @param h header * @param h header
* @param he tag container * @param he tag container
* @param flags (unused) * @param flags (unused)
* @return 1 on success, 0 on failure * @return 1 on success, 0 on failure
skipping to change at line 781 skipping to change at line 800
int headerMod(Header h, HE_t he, /*@unused@*/ unsigned int flags) int headerMod(Header h, HE_t he, /*@unused@*/ unsigned int flags)
/*@modifies h @*/; /*@modifies h @*/;
/** \ingroup header /** \ingroup header
* Destroy header tag container iterator. * Destroy header tag container iterator.
* @param hi header tag container iterator * @param hi header tag container iterator
* @return NULL always * @return NULL always
*/ */
/*@null@*/ /*@null@*/
HeaderIterator headerFini(/*@only@*/ HeaderIterator hi) HeaderIterator headerFini(/*@only@*/ HeaderIterator hi)
/*@modifies hi @*/; /*@globals fileSystem @*/
/*@modifies hi, fileSystem */;
/** \ingroup header /** \ingroup header
* Create header tag iterator. * Create header tag iterator.
* @param h header * @param h header
* @return header tag iterator * @return header tag iterator
*/ */
HeaderIterator headerInit(Header h) HeaderIterator headerInit(Header h)
/*@modifies h */; /*@globals fileSystem @*/
/*@modifies h, fileSystem */;
/** \ingroup header /** \ingroup header
* Return next tag from header. * Return next tag from header.
* @param hi header tag iterator * @param hi header tag iterator
* @param he tag container * @param he tag container
* @param flags (unused) * @param flags (unused)
* @return 1 on success, 0 on failure * @return 1 on success, 0 on failure
*/ */
int headerNext(HeaderIterator hi, HE_t he, /*@unused@*/ unsigned int flags) int headerNext(HeaderIterator hi, HE_t he, /*@unused@*/ unsigned int flags)
/*@modifies hi, he @*/; /*@globals internalState @*/
/*@modifies hi, he, internalState @*/;
/** \ingroup header /** \ingroup header
* Reference a header instance. * Reference a header instance.
* @param h header * @param h header
* @return referenced header instance * @return referenced header instance
*/ */
Header headerLink(Header h) Header headerLink(Header h)
/*@modifies h @*/; /*@modifies h @*/;
#define headerLink(_h) \
((Header)rpmioLinkPoolItem((rpmioItem)(_h), __FUNCTION__, __FILE__, __L
INE__))
/** \ingroup header /** \ingroup header
* Dereference a header instance. * Dereference a header instance.
* @param h header * @param h header
* @return NULL always * @return NULL on last dereference
*/ */
/*@null@*/
Header headerUnlink(/*@killref@*/ /*@null@*/ Header h) Header headerUnlink(/*@killref@*/ /*@null@*/ Header h)
/*@modifies h @*/; /*@modifies h @*/;
#define headerUnlink(_h) \
((Header)rpmioUnlinkPoolItem((rpmioItem)(_h), __FUNCTION__, __FILE__, _
_LINE__))
/** \ingroup header /** \ingroup header
* Dereference a header instance. * Dereference a header instance.
* @param h header * @param h header
* @return NULL always * @return NULL on last dereference
*/ */
/*@null@*/ /*@null@*/
Header headerFree(/*@killref@*/ /*@null@*/ Header h) Header headerFree(/*@killref@*/ /*@null@*/ Header h)
/*@modifies h @*/; /*@modifies h @*/;
#define headerFree(_h) \
((Header)rpmioFreePoolItem((rpmioItem)(_h), __FUNCTION__, __FILE__, __L
INE__))
/** \ingroup header /** \ingroup header
* Create new (empty) header instance. * Create new (empty) header instance.
* @return header * @return header
*/ */
Header headerNew(void) Header headerNew(void)
/*@*/; /*@globals fileSystem @*/
/*@modifies fileSystem @*/;
/** \ingroup header /** \ingroup header
* Return size of on-disk header representation in bytes. * Return size of on-disk header representation in bytes.
* @param h header * @param h header
* @return size of on-disk header * @return size of on-disk header
*/ */
size_t headerSizeof(/*@null@*/ Header h) size_t headerSizeof(/*@null@*/ Header h)
/*@modifies h @*/; /*@modifies h @*/;
/** \ingroup header /** \ingroup header
* headerUnload. * headerUnload.
* @param h header * @param h header
* @retval *lenp no. bytes in unloaded header blob * @retval *lenp no. bytes in unloaded header blob
* @return unloaded header blob (NULL on error) * @return unloaded header blob (NULL on error)
*/ */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
void * headerUnload(Header h, /*@out@*/ /*@null@*/ size_t * lenp) void * headerUnload(Header h, /*@out@*/ /*@null@*/ size_t * lenp)
/*@modifies h, *lenp @*/; /*@globals internalState @*/
/*@modifies h, *lenp, internalState @*/;
/** \ingroup header /** \ingroup header
* Convert header to on-disk representation, and then reload. * Convert header to on-disk representation, and then reload.
* This is used to insure that all header data is in a single * This is used to insure that all header data is in a single
* contiguous memory allocation. * contiguous memory allocation.
* @param h header (with pointers) * @param h header (with pointers)
* @param tag region tag * @param tag region tag
* @return on-disk header (with offsets) * @return on-disk header (with offsets)
*/ */
/*@null@*/ /*@null@*/
Header headerReload(/*@only@*/ Header h, int tag) Header headerReload(/*@only@*/ Header h, int tag)
/*@modifies h @*/; /*@globals fileSystem, internalState @*/
/*@modifies h, fileSystem, internalState @*/;
/** \ingroup header /** \ingroup header
* Duplicate a header. * Duplicate a header.
* @param h header * @param h header
* @return new header instance * @return new header instance
*/ */
/*@null@*/ /*@null@*/
Header headerCopy(Header h) Header headerCopy(Header h)
/*@modifies h @*/; /*@globals fileSystem, internalState @*/
/*@modifies h, fileSystem, internalState @*/;
/** \ingroup header /** \ingroup header
* Convert header to in-memory representation. * Convert header to in-memory representation.
* @param uh on-disk header blob (i.e. with offsets) * @param uh on-disk header blob (i.e. with offsets)
* @return header * @return header
*/ */
/*@null@*/ /*@null@*/
Header headerLoad(/*@kept@*/ void * uh) Header headerLoad(/*@kept@*/ void * uh)
/*@modifies uh @*/; /*@globals fileSystem, internalState @*/
/*@modifies uh, fileSystem, internalState @*/;
/** \ingroup header /** \ingroup header
* Make a copy and convert header to in-memory representation. * Make a copy and convert header to in-memory representation.
* @param uh on-disk header blob (i.e. with offsets) * @param uh on-disk header blob (i.e. with offsets)
* @return header * @return header
*/ */
/*@null@*/ /*@null@*/
Header headerCopyLoad(const void * uh) Header headerCopyLoad(const void * uh)
/*@*/; /*@globals fileSystem, internalState @*/
/*@modifies fileSystem, internalState @*/;
/** \ingroup header /** \ingroup header
* Check if tag is in header. * Check if tag is in header.
* @param h header * @param h header
* @param tag tag * @param tag tag
* @return 1 on success, 0 on failure * @return 1 on success, 0 on failure
*/ */
int headerIsEntry(/*@null@*/ Header h, rpmTag tag) int headerIsEntry(/*@null@*/ Header h, rpmTag tag)
/*@*/; /*@*/;
skipping to change at line 930 skipping to change at line 965
const char * lang) const char * lang)
/*@modifies h @*/; /*@modifies h @*/;
/** \ingroup header /** \ingroup header
* Duplicate tag values from one header into another. * Duplicate tag values from one header into another.
* @param headerFrom source header * @param headerFrom source header
* @param headerTo destination header * @param headerTo destination header
* @param tagstocopy array of tags that are copied * @param tagstocopy array of tags that are copied
*/ */
void headerCopyTags(Header headerFrom, Header headerTo, rpmTag * tagstocopy ) void headerCopyTags(Header headerFrom, Header headerTo, rpmTag * tagstocopy )
/*@modifies headerTo @*/; /*@globals internalState @*/
/*@modifies headerTo, internalState @*/;
/** \ingroup header /** \ingroup header
* Return header magic. * Return header magic.
* @param h header * @param h header
* @param *magicp magic array * @param *magicp magic array
* @param *nmagicp no. bytes of magic * @param *nmagicp no. bytes of magic
* @return 0 always * @return 0 always
*/ */
int headerGetMagic(/*@null@*/ Header h, unsigned char **magicp, size_t *nma gicp) int headerGetMagic(/*@null@*/ Header h, unsigned char **magicp, size_t *nma gicp)
/*@modifies *magicp, *nmagicp @*/; /*@modifies *magicp, *nmagicp @*/;
skipping to change at line 1024 skipping to change at line 1060
/** \ingroup header /** \ingroup header
* Store digest of origin *.rpm file. * Store digest of origin *.rpm file.
* @param h header * @param h header
* @param st new header digest * @param st new header digest
* @return 0 always * @return 0 always
*/ */
int headerSetDigest(/*@null@*/ Header h, const char * digest) int headerSetDigest(/*@null@*/ Header h, const char * digest)
/*@modifies h @*/; /*@modifies h @*/;
/** \ingroup header /** \ingroup header
* Return rpmdb pointer.
* @param h header
* @return rpmdb pointer
*/
/*@null@*/
void * headerGetRpmdb(/*@null@*/ Header h)
/*@*/;
/** \ingroup header
* Store rpmdb pointer.
* @param h header
* @param rpmdb new rpmdb pointer (or NULL to unset)
* @return NULL always
*/
/*@null@*/
void * headerSetRpmdb(/*@null@*/ Header h, /*@null@*/ void * rpmdb)
/*@modifies h @*/;
/** \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
*/ */
uint32_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
skipping to change at line 1118 skipping to change at line 1173
* @retval *rp release pointer (or NULL) * @retval *rp release pointer (or NULL)
* @retval *ap arch pointer (or NULL) * @retval *ap arch pointer (or NULL)
* @return 0 always * @return 0 always
*/ */
int headerNEVRA(Header h, int headerNEVRA(Header h,
/*@null@*/ /*@out@*/ const char ** np, /*@null@*/ /*@out@*/ const char ** np,
/*@null@*/ /*@out@*/ /*@unused@*/ const char ** ep, /*@null@*/ /*@out@*/ /*@unused@*/ const char ** ep,
/*@null@*/ /*@out@*/ const char ** vp, /*@null@*/ /*@out@*/ const char ** vp,
/*@null@*/ /*@out@*/ const char ** rp, /*@null@*/ /*@out@*/ const char ** rp,
/*@null@*/ /*@out@*/ const char ** ap) /*@null@*/ /*@out@*/ const char ** ap)
/*@modifies h, *np, *vp, *rp, *ap @*/; /*@globals internalState @*/
/*@modifies h, *np, *vp, *rp, *ap, internalState @*/;
/** /**
* Return header color. * Return header color.
* @param h header * @param h header
* @return header color * @return header color
*/ */
uint32_t hGetColor(Header h) uint32_t hGetColor(Header h)
/*@modifies h @*/; /*@globals internalState @*/
/*@modifies h, internalState @*/;
/** \ingroup header /** \ingroup header
* Translate and merge legacy signature tags into header. * Translate and merge legacy signature tags into header.
* @todo Remove headerSort() through headerInitIterator() modifies sig. * @todo Remove headerSort() through headerInitIterator() modifies sig.
* @param h header * @param h header
* @param sigh signature header * @param sigh signature header
*/ */
void headerMergeLegacySigs(Header h, const Header sigh) void headerMergeLegacySigs(Header h, const Header sigh)
/*@modifies h, sigh @*/; /*@globals fileSystem, internalState @*/
/*@modifies h, sigh, fileSystem, internalState @*/;
/** \ingroup header /** \ingroup header
* Regenerate signature header. * Regenerate signature header.
* @todo Remove headerSort() through headerInitIterator() modifies h. * @todo Remove headerSort() through headerInitIterator() modifies h.
* @param h header * @param h header
* @param noArchiveSize don't copy archive size tag (pre rpm-4.1) * @param noArchiveSize don't copy archive size tag (pre rpm-4.1)
* @return regenerated signature header * @return regenerated signature header
*/ */
Header headerRegenSigHeader(const Header h, int noArchiveSize) Header headerRegenSigHeader(const Header h, int noArchiveSize)
/*@modifies h @*/; /*@globals fileSystem, internalState @*/
/*@modifies h, fileSystem, internalState @*/;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* H_RPMTAG */ #endif /* H_RPMTAG */
 End of changes. 30 change blocks. 
24 lines changed or deleted 87 lines changed or added


 rpmte.h   rpmte.h 
skipping to change at line 26 skipping to change at line 26
/*@=exportlocal@*/ /*@=exportlocal@*/
/** \ingroup rpmte /** \ingroup rpmte
* Transaction element ordering chain linkage. * Transaction element ordering chain linkage.
*/ */
typedef /*@abstract@*/ struct tsortInfo_s * tsortInfo; typedef /*@abstract@*/ struct tsortInfo_s * tsortInfo;
/** \ingroup rpmte /** \ingroup rpmte
* Transaction element iterator. * Transaction element iterator.
*/ */
typedef /*@abstract@*/ struct rpmtsi_s * rpmtsi; typedef /*@abstract@*/ /*@refcounted@*/ struct rpmtsi_s *rpmtsi;
/** \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)
skipping to change at line 90 skipping to change at line 90
uint32_t pkgFileNum; uint32_t pkgFileNum;
uint32_t otherFileNum; uint32_t otherFileNum;
uint32_t otherPkg; uint32_t otherPkg;
uint32_t isRemoved; uint32_t isRemoved;
}; };
/** \ingroup rpmte /** \ingroup rpmte
* A single package instance to be installed/removed atomically. * A single package instance to be installed/removed atomically.
*/ */
struct rpmte_s { struct rpmte_s {
struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */
rpmElementType type; /*!< Package disposition (installed/removed) . */ rpmElementType type; /*!< Package disposition (installed/removed) . */
/*@refcounted@*/ /*@relnull@*/ /*@refcounted@*/ /*@relnull@*/
Header h; /*!< Package header. */ Header h; /*!< Package header. */
/*@only@*/ /*@only@*/
const char * NEVR; /*!< Package name-version-release. */ const char * NEVR; /*!< Package name-version-release. */
/*@only@*/ /*@only@*/
const char * NEVRA; /*!< Package name-version-release.ar ch. */ const char * NEVRA; /*!< Package name-version-release.ar ch. */
/*@only@*/ /*@relnull@*/ /*@only@*/ /*@relnull@*/
const char * pkgid; /*!< Package identifier (header+payl oad md5). */ const char * pkgid; /*!< Package identifier (header+payl oad md5). */
/*@only@*/ /*@relnull@*/ /*@only@*/ /*@relnull@*/
const char * hdrid; /*!< Package header identifier (head er sha1). */ const char * hdrid; /*!< Package header identifier (head er sha1). */
/*@owned@*/ /*@only@*/ /*@null@*/
const char * sourcerpm; /*!< Source package. */
/*@only@*/
const char * name; /*!< Name: */ const char * name; /*!< Name: */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
char * epoch; char * epoch;
/*@dependent@*/ /*@null@*/ /*@only@*/ /*@null@*/
char * version; /*!< Version: */ char * version; /*!< Version: */
/*@dependent@*/ /*@null@*/ /*@only@*/ /*@null@*/
char * release; /*!< Release: */ char * release; /*!< Release: */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
const char * arch; /*!< Architecture hint. */ const char * arch; /*!< Architecture hint. */
/*@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. */
skipping to change at line 167 skipping to change at line 170
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; int dboffset;
} removed; } removed;
} u; } u;
#if defined(__LCLINT__)
/*@refs@*/
int nrefs; /*!< (unused) keep splint happy */
#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.
*/ */
struct rpmtsi_s { struct rpmtsi_s {
struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */
/*@refcounted@*/ /*@refcounted@*/
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__)
/*@refs@*/
int nrefs; /*!< (unused) keep splint happy */
#endif
}; };
#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 always * @return NULL on last dereference
*/ */
/*@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) \
((rpmte) rpmioFreePoolItem((rpmioItem)(_te), __FUNCTION__, __FILE__, __
LINE__))
/** \ingroup rpmte /** \ingroup rpmte
* Create a transaction element. * Create a transaction element.
* @param ts transaction set * @param ts transaction set
* @param h header * @param h header
* @param type TR_ADDED/TR_REMOVED * @param type TR_ADDED/TR_REMOVED
* @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, int 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 352 skipping to change at line 367
* @return size in bytes of package file. * @return size in bytes of package file.
*/ */
uint32_t rpmtePkgFileSize(rpmte te) uint32_t rpmtePkgFileSize(rpmte te)
/*@*/; /*@*/;
/** \ingroup rpmte /** \ingroup rpmte
* Retrieve transaction start time that package was first installed. * Retrieve transaction start time that package was first installed.
* @param te transaction element * @param te transaction element
* @return origin time * @return origin time
*/ */
/*@observer@*/
uint32_t * rpmteOriginTid(rpmte te) uint32_t * rpmteOriginTid(rpmte te)
/*@*/; /*@*/;
/** \ingroup rpmte /** \ingroup rpmte
* Retrieve time that package was first installed. * Retrieve time that package was first installed.
* @param te transaction element * @param te transaction element
* @return origin time * @return origin time
*/ */
/*@observer@*/
uint32_t * rpmteOriginTime(rpmte te) uint32_t * rpmteOriginTime(rpmte te)
/*@*/; /*@*/;
/** \ingroup rpmte /** \ingroup rpmte
* Retrieve dependency tree depth of transaction element. * Retrieve dependency tree depth of transaction element.
* @param te transaction element * @param te transaction element
* @return depth * @return depth
*/ */
int rpmteDepth(rpmte te) int rpmteDepth(rpmte te)
/*@*/; /*@*/;
skipping to change at line 497 skipping to change at line 514
/*@modifies te @*/; /*@modifies te @*/;
/** \ingroup rpmte /** \ingroup rpmte
* Destroy dependency set info of transaction element. * Destroy dependency set info of transaction element.
* @param te transaction element * @param te transaction element
*/ */
/*@unused@*/ /*@unused@*/
void rpmteCleanDS(rpmte te) void rpmteCleanDS(rpmte te)
/*@modifies te @*/; /*@modifies te @*/;
#if defined(_RPMTE_INTERNAL)
/** \ingroup rpmte /** \ingroup rpmte
* Retrieve pkgKey of TR_ADDED transaction element. * Retrieve pkgKey of TR_ADDED transaction element.
* @param te transaction element * @param te transaction element
* @return pkgKey * @return pkgKey
*/ */
/*@exposed@*/ /*@dependent@*/ /*@null@*/ /*@exposed@*/ /*@dependent@*/ /*@null@*/
alKey rpmteAddedKey(rpmte te) alKey rpmteAddedKey(rpmte te)
/*@*/; /*@*/;
/** \ingroup rpmte /** \ingroup rpmte
* Set pkgKey of TR_ADDED transaction element. * Set pkgKey of TR_ADDED transaction element.
* @param te transaction element * @param te transaction element
* @param npkgKey new pkgKey * @param npkgKey new pkgKey
* @return previous pkgKey * @return previous pkgKey
*/ */
/*@exposed@*/ /*@dependent@*/ /*@null@*/ /*@exposed@*/ /*@dependent@*/ /*@null@*/
alKey rpmteSetAddedKey(rpmte te, alKey rpmteSetAddedKey(rpmte te,
/*@exposed@*/ /*@dependent@*/ /*@null@*/ alKey npkgKey) /*@exposed@*/ /*@dependent@*/ /*@null@*/ alKey npkgKey)
/*@modifies te @*/; /*@modifies te @*/;
#endif /* _RPMTE_INTERNAL */
/** \ingroup rpmte /** \ingroup rpmte
* Retrieve rpmdb instance of TR_REMOVED transaction element. * Retrieve rpmdb instance of TR_REMOVED transaction element.
* @param te transaction element * @param te transaction element
* @return rpmdb instance * @return rpmdb instance
*/ */
int rpmteDBOffset(rpmte te) int rpmteDBOffset(rpmte te)
/*@*/; /*@*/;
/** \ingroup rpmte /** \ingroup rpmte
skipping to change at line 568 skipping to change at line 587
* @param te transaction element * @param te transaction element
* @return hdrid string * @return hdrid string
*/ */
/*@-exportlocal@*/ /*@-exportlocal@*/
/*@observer@*/ /*@null@*/ /*@observer@*/ /*@null@*/
extern const char * rpmteHdrid(rpmte te) extern const char * rpmteHdrid(rpmte te)
/*@*/; /*@*/;
/*@=exportlocal@*/ /*@=exportlocal@*/
/** \ingroup rpmte /** \ingroup rpmte
* Retrieve sourcerpm string from transaction element.
* @param te transaction element
* @return sourcerpm string
*/
/*@-exportlocal@*/
/*@observer@*/ /*@null@*/
extern const char * rpmteSourcerpm(rpmte te)
/*@*/;
/*@=exportlocal@*/
/** \ingroup rpmte
* Retrieve file handle from transaction element. * Retrieve file handle from transaction element.
* @param te transaction element * @param te transaction element
* @return file handle * @return file handle
*/ */
FD_t rpmteFd(rpmte te) FD_t rpmteFd(rpmte te)
/*@*/; /*@*/;
/** \ingroup rpmte /** \ingroup rpmte
* Retrieve key from transaction element. * Retrieve key from transaction element.
* @param te transaction element * @param te transaction element
skipping to change at line 621 skipping to change at line 651
/** \ingroup rpmte /** \ingroup rpmte
* Chain p <-> q forward/backward transaction element links. * Chain p <-> q forward/backward transaction element links.
* @param p installed element (needs backward link) * @param p installed element (needs backward link)
* @param q erased element (needs forward link) * @param q erased element (needs forward link)
* @param oh erased element header * @param oh erased element header
* @param msg operation identifier for debugging (NULL uses "") * @param msg operation identifier for debugging (NULL uses "")
* @return 0 on success * @return 0 on success
*/ */
int rpmteChain(rpmte p, rpmte q, Header oh, /*@null@*/ const char * msg) int rpmteChain(rpmte p, rpmte q, Header oh, /*@null@*/ const char * msg)
/*@modifies p, q, oh @*/; /*@globals internalState @*/
/*@modifies p, q, oh, internalState @*/;
#define RPMTE_CHAIN_END "CHAIN END" /*!< End of chain marker. */ #define RPMTE_CHAIN_END "CHAIN END" /*!< End of chain marker. */
/** \ingroup rpmte /** \ingroup rpmte
* Return transaction element index. * Return transaction element index.
* @param tsi transaction element iterator * @param tsi transaction element iterator
* @return transaction element index * @return transaction element index
*/ */
int rpmtsiOc(rpmtsi tsi) int rpmtsiOc(rpmtsi tsi)
/*@*/; /*@*/;
/** \ingroup rpmte /** \ingroup rpmte
* Destroy transaction element iterator. * Destroy transaction element iterator.
* @param tsi transaction element iterator * @param tsi transaction element iterator
* @return NULL always * @return NULL on last dereference
*/ */
/*@unused@*/ /*@null@*/ /*@unused@*/ /*@null@*/
rpmtsi rpmtsiFree(/*@only@*//*@null@*/ rpmtsi tsi) rpmtsi rpmtsiFree(/*@killref@*//*@null@*/ rpmtsi tsi)
/*@globals fileSystem @*/
/*@modifies fileSystem @*/;
/** \ingroup rpmte
* Destroy transaction element iterator.
* @param tsi transaction element iterator
* @param fn
* @param ln
* @return NULL always
*/
/*@null@*/
rpmtsi XrpmtsiFree(/*@only@*//*@null@*/ rpmtsi tsi,
const char * fn, unsigned int ln)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies fileSystem @*/; /*@modifies fileSystem @*/;
#define rpmtsiFree(_tsi) XrpmtsiFree(_tsi, __FILE__, __LINE__ #define rpmtsiFree(_tsi) \
) ((rpmtsi)rpmioFreePoolItem((rpmioItem)(_tsi), __FUNCTION__, __FILE__
, __LINE__))
/** \ingroup rpmte /** \ingroup rpmte
* Create transaction element iterator. * Create transaction element iterator.
* @param ts transaction set * @param ts transaction set
* @return transaction element iterator * @return transaction element iterator
*/ */
/*@unused@*/ /*@only@*/ /*@unused@*/ /*@only@*/
rpmtsi rpmtsiInit(rpmts ts) rpmtsi rpmtsiInit(rpmts ts)
/*@modifies ts @*/; /*@modifies ts @*/;
skipping to change at line 689 skipping to change at line 708
/** \ingroup rpmte /** \ingroup rpmte
* Return next transaction element of type. * Return next transaction element of type.
* @param tsi transaction element iterator * @param tsi transaction element iterator
* @param type transaction element type selector (0 for any) * @param type transaction element type selector (0 for any)
* @return next transaction element of type, NULL on terminatio n * @return next transaction element of type, NULL on terminatio n
*/ */
/*@dependent@*/ /*@null@*/ /*@dependent@*/ /*@null@*/
rpmte rpmtsiNext(rpmtsi tsi, rpmElementType type) rpmte rpmtsiNext(rpmtsi tsi, rpmElementType type)
/*@modifies tsi @*/; /*@modifies tsi @*/;
#if defined(DYING)
#if !defined(SWIG) #if !defined(SWIG)
#if defined(_RPMTE_INTERNAL)
/** \ingroup rpmte /** \ingroup rpmte
*/ */
static inline void rpmtePrintID(rpmte p) static inline void rpmtePrintID(rpmte p)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies fileSystem @*/ /*@modifies fileSystem @*/
{ {
if (p != NULL) { if (p != NULL) {
if (p->blink.Pkgid) argvPrint("blink.Pkgid", p->blink.Pkgid, NULL); if (p->blink.Pkgid) argvPrint("blink.Pkgid", p->blink.Pkgid, NULL);
if (p->blink.Hdrid) argvPrint("blink.Hdrid", p->blink.Hdrid, NULL); if (p->blink.Hdrid) argvPrint("blink.Hdrid", p->blink.Hdrid, NULL);
if (p->blink.NEVRA) argvPrint("blink.NEVRA", p->blink.NEVRA, NULL); if (p->blink.NEVRA) argvPrint("blink.NEVRA", p->blink.NEVRA, NULL);
 End of changes. 24 change blocks. 
26 lines changed or deleted 46 lines changed or added


 rpmts.h   rpmts.h 
skipping to change at line 61 skipping to change at line 61
*/ */
typedef enum rpmtransFlags_e { typedef enum rpmtransFlags_e {
RPMTRANS_FLAG_NONE = 0, RPMTRANS_FLAG_NONE = 0,
RPMTRANS_FLAG_TEST = (1 << 0), /*!< from --test */ RPMTRANS_FLAG_TEST = (1 << 0), /*!< from --test */
RPMTRANS_FLAG_BUILD_PROBS = (1 << 1), /*!< don't process payload * / RPMTRANS_FLAG_BUILD_PROBS = (1 << 1), /*!< don't process payload * /
RPMTRANS_FLAG_NOSCRIPTS = (1 << 2), /*!< from --noscripts */ RPMTRANS_FLAG_NOSCRIPTS = (1 << 2), /*!< from --noscripts */
RPMTRANS_FLAG_JUSTDB = (1 << 3), /*!< from --justdb */ RPMTRANS_FLAG_JUSTDB = (1 << 3), /*!< from --justdb */
RPMTRANS_FLAG_NOTRIGGERS = (1 << 4), /*!< from --notriggers */ RPMTRANS_FLAG_NOTRIGGERS = (1 << 4), /*!< from --notriggers */
RPMTRANS_FLAG_NODOCS = (1 << 5), /*!< from --excludedocs */ RPMTRANS_FLAG_NODOCS = (1 << 5), /*!< from --excludedocs */
RPMTRANS_FLAG_ALLFILES = (1 << 6), /*!< from --allfiles */ RPMTRANS_FLAG_ALLFILES = (1 << 6), /*!< from --allfiles */
/*@-enummemuse@*/ /* 7 unused */
RPMTRANS_FLAG_KEEPOBSOLETE = (1 << 7), /*!< @todo Document. */
/*@=enummemuse@*/
RPMTRANS_FLAG_NOCONTEXTS = (1 << 8), /*!< from --nocontexts */ RPMTRANS_FLAG_NOCONTEXTS = (1 << 8), /*!< from --nocontexts */
RPMTRANS_FLAG_DIRSTASH = (1 << 9), /*!< from --dirstash */ RPMTRANS_FLAG_DIRSTASH = (1 << 9), /*!< from --dirstash */
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@*/
/* 15 unused */ RPMTRANS_FLAG_APPLYONLY = (1 << 25),
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_APPLYONLY = (1 << 25), RPMTRANS_FLAG_NORPMDB = (1 << 25), /*!< from --norpmdb */
/* 26 unused */
/* 26 unused */
RPMTRANS_FLAG_NOFDIGESTS = (1 << 27), /*!< from --nofdigests */ RPMTRANS_FLAG_NOFDIGESTS = (1 << 27), /*!< from --nofdigests */
/* 28-29 unused */ RPMTRANS_FLAG_NOPRETRANS = (1 << 28), /*!< from --nopretrans */
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_NOPRE | \ ( RPMTRANS_FLAG_NOPRETRANS | \
RPMTRANS_FLAG_NOPRE | \
RPMTRANS_FLAG_NOPOST | \ RPMTRANS_FLAG_NOPOST | \
RPMTRANS_FLAG_NOPREUN | \ RPMTRANS_FLAG_NOPREUN | \
RPMTRANS_FLAG_NOPOSTUN \ RPMTRANS_FLAG_NOPOSTUN | \
RPMTRANS_FLAG_NOPOSTTRANS \
) )
#define _noTransTriggers \ #define _noTransTriggers \
( RPMTRANS_FLAG_NOTRIGGERPREIN | \ ( RPMTRANS_FLAG_NOTRIGGERPREIN | \
RPMTRANS_FLAG_NOTRIGGERIN | \ RPMTRANS_FLAG_NOTRIGGERIN | \
RPMTRANS_FLAG_NOTRIGGERUN | \ RPMTRANS_FLAG_NOTRIGGERUN | \
RPMTRANS_FLAG_NOTRIGGERPOSTUN \ RPMTRANS_FLAG_NOTRIGGERPOSTUN \
) )
/** \ingroup rpmts /** \ingroup rpmts
skipping to change at line 203 skipping to change at line 203
* 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))
/** \ingroup rpmts /** \ingroup rpmts
* The set of packages to be installed/removed atomically. * The set of packages to be installed/removed atomically.
*/ */
struct rpmts_s { struct rpmts_s {
struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */
rpmdepFlags depFlags; /*!< Bit(s) to control rpmtsCheck(). */ rpmdepFlags depFlags; /*!< Bit(s) to control rpmtsCheck(). */
rpmtransFlags transFlags; /*!< Bit(s) to control rpmtsRun(). */ rpmtransFlags transFlags; /*!< Bit(s) to control rpmtsRun(). */
tsmStage goal; /*!< Transaction goal (i.e. mode) */ tsmStage goal; /*!< Transaction goal (i.e. mode) */
rpmTSType type; /*!< default, rollback, autorollback */ rpmTSType type; /*!< default, rollback, autorollback */
/*@refcounted@*/ /*@null@*/ /*@refcounted@*/ /*@null@*/
rpmdb sdb; /*!< Solve database handle. */ rpmdb sdb; /*!< Solve database handle. */
int sdbmode; /*!< Solve database open mode. */ int sdbmode; /*!< Solve database open mode. */
/*@null@*/ /*@null@*/
int (*solve) (rpmts ts, rpmds key, const void * data) int (*solve) (rpmts ts, rpmds key, const void * data)
skipping to change at line 278 skipping to change at line 279
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). */
/*@dependent@*/ /*@dependent@*/ /*@relnull@*/
rpmte teInstall; /*!< current rpmtsAddInstallElement element. */ rpmte teInstall; /*!< current rpmtsAddInstallElement element. */
/*@dependent@*/ /*@dependent@*/ /*@relnull@*/
rpmte teErase; /*!< current rpmtsAddEraseElement element. * / rpmte teErase; /*!< current rpmtsAddEraseElement element. * /
int selinuxEnabled; /*!< Is SE linux enabled? */ int selinuxEnabled; /*!< Is SE linux enabled? */
int chrootDone; /*!< Has chroot(2) been been done? */ int chrootDone; /*!< Has chroot(2) been been done? */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
const char * rootDir; /*!< Path to top of install tree. */ const char * rootDir; /*!< Path to top of install tree. */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
const char * currDir; /*!< Current working directory. */ const char * currDir; /*!< Current working directory. */
/*@null@*/ /*@null@*/
FD_t scriptFd; /*!< Scriptlet stdout/stderr. */ FD_t scriptFd; /*!< Scriptlet stdout/stderr. */
int delta; /*!< Delta for reallocation. */ int delta; /*!< Delta for reallocation. */
uint32_t tid[2]; /*!< Transaction id. */ uint32_t tid[2]; /*!< Transaction id. */
uint32_t color; /*!< Transaction color bits. */ uint32_t color; /*!< Transaction color bits. */
uint32_t prefcolor; /*!< Preferred file color. */ uint32_t prefcolor; /*!< Preferred file color. */
/*@observer@*/ /*@dependent@*/ /*@null@*/ /*@observer@*/ /*@dependent@*/ /*@null@*/
const char * fn; /*!< Current package fn. */ const char * fn; /*!< Current package fn. */
/*@only@*/ /*@relnull@*/ /*@relnull@*/
const unsigned char * pkpkt;/*!< Current pubkey packet. */ uint8_t * pkpkt; /*!< Current pubkey packet. */
size_t pkpktlen; /*!< Current pubkey packet length. */ size_t pkpktlen; /*!< Current pubkey packet length. */
unsigned char pksignid[8]; /*!< Current pubkey fingerprint. */ uint8_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. */
uint32_t arbgoal; /*!< Autorollback goal */ uint32_t arbgoal; /*!< Autorollback goal */
#if defined(__LCLINT__)
/*@refs@*/ /*@refs@*/
int nrefs; /*!< Reference count. */ int nrefs; /*!< (unused) keep splint happy */
#endif
}; };
#endif /* _RPMTS_INTERNAL */ #endif /* _RPMTS_INTERNAL */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** \ingroup rpmts /** \ingroup rpmts
* Perform dependency resolution on the transaction set. * Perform dependency resolution on the transaction set.
* *
skipping to change at line 396 skipping to change at line 399
*/ */
rpmRC rpmtsRollback(rpmts rbts, rpmprobFilterFlags ignoreSet, rpmRC rpmtsRollback(rpmts rbts, rpmprobFilterFlags ignoreSet,
int running, rpmte rbte) int running, rpmte rbte)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies rbts, rbte, rpmGlobalMacroContext, fileSystem, internalS tate @*/; /*@modifies rbts, rbte, rpmGlobalMacroContext, fileSystem, internalS tate @*/;
/** \ingroup rpmts /** \ingroup rpmts
* Unreference a transaction instance. * Unreference a transaction instance.
* @param ts transaction set * @param ts transaction set
* @param msg * @param msg
* @return NULL always * @return NULL on last dereference
*/ */
/*@unused@*/ /*@null@*/ /*@unused@*/ /*@null@*/
rpmts rpmtsUnlink (/*@killref@*/ /*@only@*/ rpmts ts, rpmts rpmtsUnlink (/*@killref@*/ /*@only@*/ rpmts ts,
const char * msg) const char * msg)
/*@modifies ts @*/; /*@modifies ts @*/;
#define rpmtsUnlink(_ts, _msg) \
/** @todo Remove debugging entry from the ABI. */ ((rpmts) rpmioUnlinkPoolItem((rpmioItem)(_ts), _msg, __FILE__, __LIN
/*@-exportlocal@*/ E__))
/*@null@*/
rpmts XrpmtsUnlink (/*@killref@*/ /*@only@*/ rpmts ts,
const char * msg, const char * fn, unsigned ln)
/*@modifies ts @*/;
/*@=exportlocal@*/
#define rpmtsUnlink(_ts, _msg) XrpmtsUnlink(_ts, _msg, __FILE__, __
LINE__)
/** \ingroup rpmts /** \ingroup rpmts
* Reference a transaction set instance. * Reference a transaction set instance.
* @param ts transaction set * @param ts transaction set
* @param msg * @param msg
* @return new transaction set reference * @return new transaction set reference
*/ */
/*@unused@*/ /*@unused@*/ /*@newref@*/
rpmts rpmtsLink (rpmts ts, const char * msg) rpmts rpmtsLink (rpmts ts, const char * msg)
/*@modifies ts @*/; /*@modifies ts @*/;
#define rpmtsLink(_ts, _msg) \
/** @todo Remove debugging entry from the ABI. */ ((rpmts) rpmioLinkPoolItem((rpmioItem)(_ts), _msg, __FILE__, __LINE_
rpmts XrpmtsLink (rpmts ts, _))
const char * msg, const char * fn, unsigned ln)
/*@modifies ts @*/;
#define rpmtsLink(_ts, _msg) XrpmtsLink(_ts, _msg, __FILE__, __LI
NE__)
/** \ingroup rpmts /** \ingroup rpmts
* Close the database used by the transaction. * Close the database used by the transaction.
* @param ts transaction set * @param ts transaction set
* @return 0 on success * @return 0 on success
*/ */
int rpmtsCloseDB(rpmts ts) int rpmtsCloseDB(rpmts ts)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies ts, fileSystem @*/; /*@modifies ts, fileSystem @*/;
skipping to change at line 613 skipping to change at line 605
*/ */
/*@null@*/ /*@null@*/
rpmps rpmtsProblems(rpmts ts) rpmps rpmtsProblems(rpmts ts)
/*@modifies ts @*/; /*@modifies ts @*/;
/** \ingroup rpmts /** \ingroup rpmts
* Free signature verification data. * Free signature verification data.
* @param ts transaction set * @param ts transaction set
*/ */
void rpmtsCleanDig(rpmts ts) void rpmtsCleanDig(rpmts ts)
/*@modifies ts @*/; /*@globals fileSystem @*/
/*@modifies ts, fileSystem @*/;
/** \ingroup rpmts /** \ingroup rpmts
* Free memory needed only for dependency checks and ordering. * Free memory needed only for dependency checks and ordering.
* @param ts transaction set * @param ts transaction set
*/ */
void rpmtsClean(rpmts ts) void rpmtsClean(rpmts ts)
/*@globals fileSystem, internalState @*/ /*@globals fileSystem, internalState @*/
/*@modifies ts, fileSystem , internalState@*/; /*@modifies ts, fileSystem , internalState@*/;
/** \ingroup rpmts /** \ingroup rpmts
* Re-create an empty transaction set. * Re-create an empty transaction set.
* @param ts transaction set * @param ts transaction set
*/ */
void rpmtsEmpty(rpmts ts) void rpmtsEmpty(rpmts ts)
/*@globals fileSystem, internalState @*/ /*@globals fileSystem, internalState @*/
/*@modifies ts, fileSystem, internalState @*/; /*@modifies ts, fileSystem, internalState @*/;
/** \ingroup rpmts /** \ingroup rpmts
* Destroy transaction set, closing the database as well. * Destroy transaction set, closing the database as well.
* @param ts transaction set * @param ts transaction set
* @return NULL always * @return NULL on last dereference
*/ */
/*@null@*/ /*@null@*/
rpmts rpmtsFree(/*@killref@*/ /*@only@*//*@null@*/ rpmts ts) rpmts rpmtsFree(/*@killref@*/ /*@null@*/ rpmts ts)
/*@globals fileSystem, internalState @*/ /*@globals fileSystem, internalState @*/
/*@modifies ts, fileSystem, internalState @*/; /*@modifies ts, fileSystem, internalState @*/;
#define rpmtsFree(_ts) \
((rpmts) rpmioFreePoolItem((rpmioItem)(_ts), __FUNCTION__, __FILE__,
__LINE__))
/** \ingroup rpmts /** \ingroup rpmts
* Get verify signatures flag(s). * Get verify signatures flag(s).
* @param ts transaction set * @param ts transaction set
* @return verify signatures flags * @return verify signatures flags
*/ */
rpmVSFlags rpmtsVSFlags(rpmts ts) rpmVSFlags rpmtsVSFlags(rpmts ts)
/*@*/; /*@*/;
/** \ingroup rpmts /** \ingroup rpmts
skipping to change at line 701 skipping to change at line 696
/*@*/; /*@*/;
/** \ingroup rpmts /** \ingroup rpmts
* Set transaction currDir, i.e. current directory before chroot(2). * Set transaction currDir, i.e. current directory before chroot(2).
* @param ts transaction set * @param ts transaction set
* @param currDir new transaction currDir (or NULL) * @param currDir new transaction currDir (or NULL)
*/ */
void rpmtsSetCurrDir(rpmts ts, /*@null@*/ const char * currDir) void rpmtsSetCurrDir(rpmts ts, /*@null@*/ const char * currDir)
/*@modifies ts @*/; /*@modifies ts @*/;
#if defined(_RPMTS_INTERNAL) /* XXX avoid FD_t in API. */
/** \ingroup rpmts /** \ingroup rpmts
* Get transaction script file handle, i.e. stdout/stderr on scriptlet exec ution * Get transaction script file handle, i.e. stdout/stderr on scriptlet exec ution
* @param ts transaction set * @param ts transaction set
* @return transaction script file handle * @return transaction script file handle
*/ */
/*@null@*/ /*@null@*/
FD_t rpmtsScriptFd(rpmts ts) FD_t rpmtsScriptFd(rpmts ts)
/*@*/; /*@*/;
/** \ingroup rpmts /** \ingroup rpmts
* Set transaction script file handle, i.e. stdout/stderr on scriptlet exec ution * Set transaction script file handle, i.e. stdout/stderr on scriptlet exec ution
* @param ts transaction set * @param ts transaction set
* @param scriptFd new script file handle (or NULL) * @param scriptFd new script file handle (or NULL)
*/ */
void rpmtsSetScriptFd(rpmts ts, /*@null@*/ FD_t scriptFd) void rpmtsSetScriptFd(rpmts ts, /*@null@*/ FD_t scriptFd)
/*@modifies ts, scriptFd @*/; /*@globals fileSystem @*/
/*@modifies ts, scriptFd, fileSystem @*/;
#endif
/** \ingroup rpmts /** \ingroup rpmts
* Get selinuxEnabled flag, i.e. is SE linux enabled? * Get selinuxEnabled flag, i.e. is SE linux enabled?
* @param ts transaction set * @param ts transaction set
* @return selinuxEnabled flag * @return selinuxEnabled flag
*/ */
int rpmtsSELinuxEnabled(rpmts ts) int rpmtsSELinuxEnabled(rpmts ts)
/*@*/; /*@*/;
/** \ingroup rpmts /** \ingroup rpmts
skipping to change at line 766 skipping to change at line 764
*/ */
uint32_t rpmtsSetTid(rpmts ts, uint32_t tid) uint32_t rpmtsSetTid(rpmts ts, uint32_t tid)
/*@modifies ts @*/; /*@modifies ts @*/;
/** \ingroup rpmts /** \ingroup rpmts
* Get OpenPGP packet parameters, i.e. signature/pubkey constants. * Get OpenPGP packet parameters, i.e. signature/pubkey constants.
* @param ts transaction set * @param ts transaction set
* @return signature/pubkey constants. * @return signature/pubkey constants.
*/ */
pgpDig rpmtsDig(rpmts ts) pgpDig rpmtsDig(rpmts ts)
/*@*/; /*@globals fileSystem @*/
/*@modifies fileSystem @*/;
/** \ingroup rpmts /** \ingroup rpmts
* Return OpenPGP pubkey constants. * Return OpenPGP pubkey constants.
* @param ts transaction set * @param ts transaction set
* @return pubkey constants. * @return pubkey constants.
*/ */
/*@-exportlocal@*/ /*@-exportlocal@*/
/*@exposed@*/ /*@null@*/ /*@exposed@*/ /*@null@*/
pgpDigParams rpmtsPubkey(const rpmts ts) pgpDigParams rpmtsPubkey(const rpmts ts)
/*@*/; /*@globals fileSystem @*/
/*@modifies fileSystem @*/;
/*@=exportlocal@*/ /*@=exportlocal@*/
/** \ingroup rpmts /** \ingroup rpmts
* Get transaction set database handle. * Get transaction set database handle.
* @param ts transaction set * @param ts transaction set
* @return transaction database handle * @return transaction database handle
*/ */
/*@null@*/ /*@null@*/
rpmdb rpmtsGetRdb(rpmts ts) rpmdb rpmtsGetRdb(rpmts ts)
/*@*/; /*@*/;
/** \ingroup rpmts /** \ingroup rpmts
* Get transaction set dependencies. * Get transaction set dependencies.
* @param ts transaction set * @param ts transaction set
* @return transaction set dependencies. * @return transaction set dependencies.
*/ */
/*@null@*/ /*@null@*/
rpmPRCO rpmtsPRCO(rpmts ts) rpmPRCO rpmtsPRCO(rpmts ts)
/*@*/; /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState
@*/
/*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/
;
/** \ingroup rpmts /** \ingroup rpmts
* Initialize disk space info for each and every mounted file systems. * Initialize disk space info for each and every mounted file systems.
* @param ts transaction set * @param ts transaction set
* @return 0 on success * @return 0 on success
*/ */
int rpmtsInitDSI(const rpmts ts) int rpmtsInitDSI(const rpmts ts)
/*@globals fileSystem, internalState @*/ /*@globals fileSystem, internalState @*/
/*@modifies ts, fileSystem, internalState @*/; /*@modifies ts, fileSystem, internalState @*/;
skipping to change at line 842 skipping to change at line 843
* @param ts transaction set * @param ts transaction set
* @param te current transaction element * @param te current transaction element
* @param what type of call back * @param what type of call back
* @param amount current value * @param amount current value
* @param total final value * @param total final value
* @return callback dependent pointer * @return callback dependent pointer
*/ */
/*@null@*/ /*@null@*/
void * rpmtsNotify(rpmts ts, rpmte te, void * rpmtsNotify(rpmts ts, rpmte te,
rpmCallbackType what, uint64_t amount, uint64_t total) rpmCallbackType what, uint64_t amount, uint64_t total)
/*@*/; /*@modifies te @*/;
/** \ingroup rpmts /** \ingroup rpmts
* Return number of (ordered) transaction set elements. * Return number of (ordered) transaction set elements.
* @param ts transaction set * @param ts transaction set
* @return no. of transaction set elements * @return no. of transaction set elements
*/ */
int rpmtsNElements(rpmts ts) int rpmtsNElements(rpmts ts)
/*@*/; /*@*/;
/** \ingroup rpmts /** \ingroup rpmts
skipping to change at line 1033 skipping to change at line 1034
/*@observer@*/ rpmCallbackFunction notify, /*@observer@*/ rpmCallbackFunction notify,
/*@observer@*/ rpmCallbackData notifyData) /*@observer@*/ rpmCallbackData notifyData)
/*@modifies ts @*/; /*@modifies ts @*/;
/** \ingroup rpmts /** \ingroup rpmts
* Create an empty transaction set. * Create an empty transaction set.
* @return new transaction set * @return new transaction set
*/ */
/*@newref@*/ /*@newref@*/
rpmts rpmtsCreate(void) rpmts rpmtsCreate(void)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState /*@globals rpmGlobalMacroContext, h_errno, internalState @*/
@*/ /*@modifies rpmGlobalMacroContext, internalState @*/;
/*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/;
/*@-redecl@*/ /*@-redecl@*/
/*@unchecked@*/ /*@unchecked@*/
extern int rpmcliPackagesTotal; extern int rpmcliPackagesTotal;
/*@=redecl@*/ /*@=redecl@*/
/** \ingroup rpmts /** \ingroup rpmts
* Add package to be installed to transaction set. * Add package to be installed to transaction set.
* *
* The transaction set is checked for duplicate package names. * The transaction set is checked for duplicate package names.
 End of changes. 30 change blocks. 
48 lines changed or deleted 51 lines changed or added


 rpmurl.h   rpmurl.h 
#ifndef H_RPMURL #ifndef H_RPMURL
#define H_RPMURL #define H_RPMURL
/** \ingroup rpmio /** \ingroup rpmio
* \file rpmio/rpmurl.h * \file rpmio/rpmurl.h
*/ */
#include <assert.h> #include <assert.h>
#include <rpmio.h> #include <rpmio.h>
#include <rpmsw.h>
/** /**
* Supported URL types. * Supported URL types.
*/ */
typedef enum urltype_e { typedef enum urltype_e {
URL_IS_UNKNOWN = 0, /*!< unknown (aka a file) */ URL_IS_UNKNOWN = 0, /*!< unknown (aka a file) */
URL_IS_DASH = 1, /*!< stdin/stdout */ URL_IS_DASH = 1, /*!< stdin/stdout */
URL_IS_PATH = 2, /*!< file://... */ URL_IS_PATH = 2, /*!< file://... */
URL_IS_FTP = 3, /*!< ftp://... */ URL_IS_FTP = 3, /*!< ftp://... */
URL_IS_HTTP = 4, /*!< http://... */ URL_IS_HTTP = 4, /*!< http://... */
URL_IS_HTTPS = 5, /*!< https://... */ URL_IS_HTTPS = 5, /*!< https://... */
URL_IS_HKP = 6 /*!< hkp://... */ URL_IS_HKP = 6 /*!< hkp://... */
} urltype; } urltype;
#define URLMAGIC 0xd00b1ed0U #define URLMAGIC 0xd00b1ed0U
#define URLSANE(u) assert(u && u->magic == URLMAGIC) #define URLSANE(u) assert(u && u->magic == URLMAGIC)
/**
*/
typedef /*@abstract@*/ /*@refcounted@*/ struct urlinfo_s * urlinfo; typedef /*@abstract@*/ /*@refcounted@*/ struct urlinfo_s * urlinfo;
/** /**
*/
extern int (*urlNotify) (const urlinfo u, unsigned status)
/*@*/;
/**
*/
/*@unchecked@*/ /*@null@*/ /*@shared@*/
extern void * urlNotifyArg;
/**
* URL control structure. * URL control structure.
*/ */
struct urlinfo_s { struct urlinfo_s {
/*@refs@*/ int nrefs; /*!< no. of references */ struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */
/*@owned@*/ /*@relnull@*/ /*@owned@*/ /*@relnull@*/
const char * url; /*!< copy of original url */ const char * url; /*!< copy of original url */
/*@owned@*/ /*@relnull@*/ /*@owned@*/ /*@relnull@*/
const char * scheme; /*!< URI scheme. */ const char * scheme; /*!< URI scheme. */
/*@owned@*/ /*@null@*/ /*@owned@*/ /*@null@*/
const char * user; /*!< URI user. */ const char * user; /*!< URI user. */
/*@owned@*/ /*@null@*/ /*@owned@*/ /*@null@*/
const char * password; /*!< URI password. */ const char * password; /*!< URI password. */
/*@owned@*/ /*@relnull@*/ /*@owned@*/ /*@relnull@*/
const char * host; /*!< URI host. */ const char * host; /*!< URI host. */
skipping to change at line 71 skipping to change at line 84
/*@relnull@*/ /*@relnull@*/
void * capabilities; /*!< neon: ne_server_capabilities ptr */ void * capabilities; /*!< neon: ne_server_capabilities ptr */
/*@relnull@*/ /*@relnull@*/
void * lockstore; /*!< neon: ne_lock_store ptr */ void * lockstore; /*!< neon: ne_lock_store ptr */
/*@relnull@*/ /*@relnull@*/
void * sess; /*!< neon: ne_session ptr */ void * sess; /*!< neon: ne_session ptr */
off_t current; /*!< neon: current body offset. */ off_t current; /*!< neon: current body offset. */
off_t total; /*!< neon: total body length. */ off_t total; /*!< neon: total body length. */
int connstatus; /*!< neon: connection status. */ int connstatus; /*!< neon: connection status. */
#ifdef REFERENCE
typedef enum { /*@null@*/
ne_conn_namelookup, /* lookup up hostname (info = hostname) */ const char * location; /*!< Location: tag. */
ne_conn_connecting, /* connecting to host (info = hostname) */ /*@null@*/
ne_conn_connected, /* connected to host (info = hostname) */ const char * etag; /*!< ETag: tag. */
ne_conn_secure /* connection now secure (info = crypto level) */ /*@null@*/
} ne_conn_status; int (*notify) (const urlinfo u, unsigned status);
#endif /*@null@*/ /*@shared@*/
void * arg;
struct fdNotify_s {
unsigned status;
/*@null@*/
const char * hostname;
/*@null@*/
const char * address;
int64_t progress;
int64_t total;
} info;
/*@null@*/
rpmop rop; /*!< Receive accumulator. */
/*@null@*/
rpmop sop; /*!< Send accumulator. */
/*@null@*/
rpmop top; /*!< Total accumulator. */
int bufAlloced; /*!< sizeof I/O buffer */ int bufAlloced; /*!< sizeof I/O buffer */
/*@owned@*/ /*@owned@*/
char * buf; /*!< I/O buffer */ char * buf; /*!< I/O buffer */
int openError; /*!< Type of open failure */ int openError; /*!< Type of open failure */
int httpVersion; int httpVersion;
int allow; int allow;
#define RPMURL_SERVER_HASRANGE ( 1 << 0) #define RPMURL_SERVER_HASRANGE ( 1 << 0)
#define RPMURL_SERVER_HASDAVCLASS1 ( 1 << 1) #define RPMURL_SERVER_HASDAVCLASS1 ( 1 << 1)
#define RPMURL_SERVER_HASDAVCLASS2 ( 1 << 2) #define RPMURL_SERVER_HASDAVCLASS2 ( 1 << 2)
#define RPMURL_SERVER_HASDAVEXEC ( 1 << 3) #define RPMURL_SERVER_HASDAVEXEC ( 1 << 3)
#define RPMURL_SERVER_OPTIONSDONE ( 1 << 8) #define RPMURL_SERVER_OPTIONSDONE ( 1 << 8)
#define RPMURL_SERVER_HASDAV (RPMURL_SERVER_HASDAVCLASS1|RPMURL_S ERVER_HASDAVCLASS2|RPMURL_SERVER_HASDAVEXEC) #define RPMURL_SERVER_HASDAV (RPMURL_SERVER_HASDAVCLASS1|RPMURL_S ERVER_HASDAVCLASS2|RPMURL_SERVER_HASDAVEXEC)
unsigned magic; unsigned magic;
#if defined(__LCLINT__)
/*@refs@*/
int nrefs; /*!< (unused) keep splint happy */
#endif
}; };
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/*@unchecked@*/ /*@unchecked@*/
extern int _url_count; /*!< No. of cached URL's. */ extern int _url_count; /*!< No. of cached URL's. */
/*@unchecked@*/ /*@unchecked@*/
skipping to change at line 122 skipping to change at line 155
/*@unchecked@*/ /*@unchecked@*/
extern int _url_debug; /*!< URL debugging? */ extern int _url_debug; /*!< URL debugging? */
#define RPMURL_DEBUG_IO 0x40000000 #define RPMURL_DEBUG_IO 0x40000000
#define RPMURL_DEBUG_REFS 0x20000000 #define RPMURL_DEBUG_REFS 0x20000000
/** /**
* Create a URL control structure instance. * Create a URL control structure instance.
* @param msg debugging identifier (unused) * @param msg debugging identifier (unused)
* @return new instance * @return new instance
*/ */
/*@unused@*/ urlinfo urlNew(const char * msg) /*@*/; /*@unused@*/ /*@null@*/
urlinfo urlNew(const char * msg)
/*@*/;
/** @todo Remove debugging entry from the ABI. */ /** @todo Remove debugging entry from the ABI. */
urlinfo XurlNew(const char * msg, const char * file, unsigned line) /*@null@*/
/*@*/; urlinfo XurlNew(const char * msg, const char * fn, unsigned ln)
/*@globals fileSystem @*/
/*@modifies fileSystem @*/;
#define urlNew(_msg) XurlNew(_msg, __FILE__, __LINE__) #define urlNew(_msg) XurlNew(_msg, __FILE__, __LINE__)
/** /**
* Reference a URL control structure instance. * Reference a URL control structure instance.
* @param u URL control structure * @param u URL control structure
* @param msg debugging identifier (unused) * @param msg debugging identifier (unused)
* @return referenced instance * @return referenced instance
*/ */
/*@unused@*/ urlinfo urlLink(urlinfo u, const char * msg) /*@unused@*/ /*@newref@*/
/*@modifies u @*/; urlinfo urlLink(/*@returned@*/ urlinfo u, const char * msg)
/** @todo Remove debugging entry from the ABI. */
urlinfo XurlLink(urlinfo u, const char * msg, const char * file, uns
igned line)
/*@modifies u @*/; /*@modifies u @*/;
#define urlLink(_u, _msg) XurlLink(_u, _msg, __FILE__, __LINE__) #define urlLink(_u, _msg) \
(urlinfo) rpmioLinkPoolItem((rpmioItem)(_u), _msg, __FILE__, __LINE_
_)
/** /**
* Dereference a URL control structure instance. * Dereference a URL control structure instance.
* @param u URL control structure * @param u URL control structure
* @param msg debugging identifier (unused) * @param msg debugging identifier (unused)
* @return dereferenced instance (NULL if freed) * @return dereferenced instance (NULL if freed)
*/ */
/*@unused@*/ urlinfo urlFree( /*@killref@*/ urlinfo u, const char * msg) /*@unused@*/ /*@null@*/
/*@globals fileSystem, internalState @*/ urlinfo urlFree( /*@killref@*/ urlinfo u, const char * msg)
/*@modifies u, fileSystem, internalState @*/;
/** @todo Remove debugging entry from the ABI. */
urlinfo XurlFree( /*@killref@*/ urlinfo u, const char * msg,
const char * file, unsigned line)
/*@globals fileSystem, internalState @*/ /*@globals fileSystem, internalState @*/
/*@modifies u, fileSystem, internalState @*/; /*@modifies u, fileSystem, internalState @*/;
#define urlFree(_u, _msg) XurlFree(_u, _msg, __FILE__, __LINE__) #define urlFree(_u, _msg) \
((urlinfo)rpmioFreePoolItem((rpmioItem)(_u), _msg, __FILE__, __LINE_
_))
/** /**
* Free cached URL control structures. * Free cached URL control structures.
*/ */
void urlFreeCache(void) void urlFreeCache(void)
/*@globals _url_cache, _url_count, fileSystem, internalState @*/ /*@globals _url_cache, _url_count, fileSystem, internalState @*/
/*@modifies _url_cache, _url_count, fileSystem, internalState @*/; /*@modifies _url_cache, _url_count, fileSystem, internalState @*/;
/** /**
* Return type of URL. * Return type of URL.
skipping to change at line 182 skipping to change at line 214
/*@*/; /*@*/;
/** /**
* Return path component of URL. * Return path component of URL.
* @param url url string * @param url url string
* @retval pathp pointer to path component of url * @retval pathp pointer to path component of url
* @return type of url * @return type of url
*/ */
/*@-incondefs@*/ /*@-incondefs@*/
urltype urlPath(const char * url, /*@out@*/ const char ** pathp) urltype urlPath(const char * url, /*@out@*/ const char ** pathp)
/*@ensures maxSet(*pathp) == 0 /\ maxRead(*pathp) == 0 @*/
/*@modifies *pathp @*/; /*@modifies *pathp @*/;
/*@=incondefs@*/ /*@=incondefs@*/
/** /**
* Parse URL string into a control structure. * Parse URL string into a control structure.
* @param url url string * @param url url string
* @retval uret address of new control instance pointer * @retval uret address of new control instance pointer
* @return 0 on success, -1 on error * @return 0 on success, -1 on error
*/ */
int urlSplit(const char * url, /*@out@*/ urlinfo * uret) int urlSplit(const char * url, /*@out@*/ urlinfo * uret)
 End of changes. 13 change blocks. 
28 lines changed or deleted 59 lines changed or added


 rpmversion.h   rpmversion.h 
#ifndef __RPMVERSION_H__ #ifndef __RPMVERSION_H__
#define __RPMVERSION_H__ #define __RPMVERSION_H__
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/*@unchecked@*/ /*@observer@*/
extern const char * RPMVERSION;
/*@unchecked@*/ /*@observer@*/
extern const char * rpmNAME;
/*@unchecked@*/ /*@observer@*/
extern const char * rpmEVR;
/*@unchecked@*/
extern int rpmFLAGS;
/* /*
VERSION <M,N,t,O,R,s> VERSION <M,N,t,O,R,s>
--------------------- ---------------------
3 2 1 0 3 2 1 0
10987654321098765432109876543210 10987654321098765432109876543210
| || || || || || | || || || || ||
| M || N ||t|| O || R |s | M || N ||t|| O || R |s
M: bits 31-27 (5 bit): [0... 32[ [0..31] major version (archite cture generation counter) M: bits 31-27 (5 bit): [0... 32[ [0..31] major version (archite cture generation counter)
skipping to change at line 69 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,1,r,6,0,_) #define RPMLIB_VERSION RPMLIB_VERSION_ENCODE(5,1,r,8,0,_)
#define RPMLIB_TIMESTAMP RPMLIB_TIMESTAMP_ENCODE(2008,10,18,0,0) #define RPMLIB_TIMESTAMP RPMLIB_TIMESTAMP_ENCODE(2009,4,13,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)) \
| RPMLIB_BITFIELD_SET(0,0,RPMLIB_VERSION_ENCODE_S(snap))) | RPMLIB_BITFIELD_SET(0,0,RPMLIB_VERSION_ENCODE_S(snap)))
 End of changes. 2 change blocks. 
2 lines changed or deleted 14 lines changed or added


 rpmwf.h   rpmwf.h 
skipping to change at line 20 skipping to change at line 20
/*@unchecked@*/ /*@unchecked@*/
extern int _rpmwf_debug; extern int _rpmwf_debug;
/** /**
*/ */
typedef /*@abstract@*/ /*@refcounted@*/ struct rpmwf_s * rpmwf; typedef /*@abstract@*/ /*@refcounted@*/ struct rpmwf_s * rpmwf;
#ifdef _RPMWF_INTERNAL #ifdef _RPMWF_INTERNAL
struct rpmwf_s { struct rpmwf_s {
struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */
/*@relnull@*/ /*@relnull@*/
const char * fn; const char * fn;
/*@relnull@*/ /*@relnull@*/
FD_t fd; FD_t fd;
/*@relnull@*/ /*@owned@*/ /*@relnull@*/ /*@owned@*/
void * b; void * b;
size_t nb; size_t nb;
/*@relnull@*/ /*@dependent@*/ /*@relnull@*/ /*@dependent@*/
char * l; char * l;
size_t nl; size_t nl;
skipping to change at line 41 skipping to change at line 42
char * s; char * s;
size_t ns; size_t ns;
/*@relnull@*/ /*@dependent@*/ /*@relnull@*/ /*@dependent@*/
char * h; char * h;
size_t nh; size_t nh;
/*@relnull@*/ /*@dependent@*/ /*@relnull@*/ /*@dependent@*/
char * p; char * p;
size_t np; size_t np;
/*@relnull@*/ /*@refcounted@*/ /*@relnull@*/ /*@refcounted@*/
rpmxar xar; rpmxar xar;
/*@refs@*/
int nrefs; /*!< Reference count. */
}; };
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
rpmRC rpmwfPushXAR(rpmwf wf, const char * fn) rpmRC rpmwfPushXAR(rpmwf wf, const char * fn)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies wf, fileSystem @*/; /*@modifies wf, fileSystem @*/;
rpmRC rpmwfPullXAR(rpmwf wf, const char * fn) rpmRC rpmwfPullXAR(rpmwf wf, const char * fn)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies wf, fileSystem @*/; /*@modifies wf, fileSystem @*/;
rpmRC rpmwfFini(rpmwf wf) rpmRC rpmwfFini(rpmwf wf)
/*@globals fileSystem @*/ /*@globals fileSystem, internalState @*/
/*@modifies wf, fileSystem @*/; /*@modifies wf, fileSystem, internalState @*/;
rpmRC rpmwfInit(rpmwf wf, const char * fn, const char * fmode) rpmRC rpmwfInit(rpmwf wf, const char * fn, const char * fmode)
/*@globals fileSystem @*/ /*@globals fileSystem, internalState @*/
/*@modifies wf, fileSystem @*/; /*@modifies wf, fileSystem, internalState @*/;
rpmRC rpmwfPushRPM(rpmwf wf, const char * fn) rpmRC rpmwfPushRPM(rpmwf wf, const char * fn)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies wf, fileSystem @*/; /*@modifies wf, fileSystem @*/;
/** /**
* Unreference a wrapper format instance. * Unreference a wrapper format instance.
* @param wf wrapper format * @param wf wrapper format
* @param msg * @param msg
* @return NULL always * @return NULL on last dereference
*/ */
/*@unused@*/ /*@null@*/ /*@unused@*/ /*@null@*/
rpmwf rpmwfUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmwf wf, rpmwf rpmwfUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmwf wf,
/*@null@*/ const char * msg) /*@null@*/ const char * msg)
/*@modifies wf @*/; /*@modifies wf @*/;
#define rpmwfUnlink(_wf, _msg) \
/** @todo Remove debugging entry from the ABI. */ ((rpmwf)rpmioUnlinkPoolItem((rpmioItem)(_wf), _msg, __FILE__, __LINE__)
/*@-exportlocal@*/ )
/*@null@*/
rpmwf XrpmwfUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmwf wf,
/*@null@*/ const char * msg, const char * fn, unsigned ln)
/*@modifies wf @*/;
/*@=exportlocal@*/
#define rpmwfUnlink(_wf, _msg) XrpmwfUnlink(_wf, _msg, __FILE__, __
LINE__)
/** /**
* Reference a wrapper format instance. * Reference a wrapper format instance.
* @param wf wrapper format * @param wf wrapper format
* @param msg * @param msg
* @return new wrapper format reference * @return new wrapper format reference
*/ */
/*@unused@*/ /*@newref@*/ /*@null@*/ /*@unused@*/ /*@newref@*/ /*@null@*/
rpmwf rpmwfLink (/*@null@*/ rpmwf wf, /*@null@*/ const char * msg) rpmwf rpmwfLink (/*@null@*/ rpmwf wf, /*@null@*/ const char * msg)
/*@modifies wf @*/; /*@modifies wf @*/;
#define rpmwfLink(_wf, _msg) \
/** @todo Remove debugging entry from the ABI. */ ((rpmwf)rpmioLinkPoolItem((rpmioItem)(_wf), _msg, __FILE__, __LINE__))
/*@newref@*/ /*@null@*/
rpmwf XrpmwfLink (/*@null@*/ rpmwf wf, /*@null@*/ const char * msg,
const char * fn, unsigned ln)
/*@modifies wf @*/;
#define rpmwfLink(_wf, _msg) XrpmwfLink(_wf, _msg, __FILE__, __LI
NE__)
/*@null@*/ /*@null@*/
rpmwf rpmwfFree(/*@only@*/ rpmwf wf) rpmwf rpmwfFree(/*@only@*/ rpmwf wf)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies wf, fileSystem @*/; /*@modifies wf, fileSystem @*/;
#define rpmwfFree(_wf) \
((rpmwf)rpmioFreePoolItem((rpmioItem)(_wf), __FUNCTION__, __FILE__, __L
INE__))
/*@relnull@*/ /*@relnull@*/
rpmwf rpmwfNew(const char * fn) rpmwf rpmwfNew(const char * fn)
/*@globals fileSystem @*/ /*@globals fileSystem, internalState @*/
/*@modifies fileSystem @*/; /*@modifies fileSystem, internalState @*/;
/*@relnull@*/
rpmwf rdRPM(const char * rpmfn) rpmwf rdRPM(const char * rpmfn)
/*@globals fileSystem @*/ /*@globals fileSystem, internalState @*/
/*@modifies fileSystem @*/; /*@modifies fileSystem, internalState @*/;
/*@relnull@*/
rpmwf rdXAR(const char * xarfn) rpmwf rdXAR(const char * xarfn)
/*@globals fileSystem @*/ /*@globals fileSystem, internalState @*/
/*@modifies fileSystem @*/; /*@modifies fileSystem, internalState @*/;
rpmRC wrXAR(const char * xarfn, rpmwf wf) rpmRC wrXAR(const char * xarfn, rpmwf wf)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies wf, fileSystem @*/; /*@modifies wf, fileSystem @*/;
rpmRC wrRPM(const char * rpmfn, rpmwf wf) rpmRC wrRPM(const char * rpmfn, rpmwf wf)
/*@globals fileSystem @*/ /*@globals fileSystem, internalState @*/
/*@modifies wf, fileSystem @*/; /*@modifies wf, fileSystem, internalState @*/;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* H_RPMWF */ #endif /* H_RPMWF */
 End of changes. 14 change blocks. 
33 lines changed or deleted 24 lines changed or added


 rpmxar.h   rpmxar.h 
skipping to change at line 15 skipping to change at line 15
* \file rpmio/rpmxar.h * \file rpmio/rpmxar.h
* Structure(s)and methods for a XAR archive wrapper format. * Structure(s)and methods for a XAR archive wrapper format.
*/ */
/*@unchecked@*/ /*@unchecked@*/
extern int _xar_debug; extern int _xar_debug;
typedef /*@abstract@*/ /*@refcounted@*/ struct rpmxar_s * rpmxar; typedef /*@abstract@*/ /*@refcounted@*/ struct rpmxar_s * rpmxar;
#ifdef _RPMXAR_INTERNAL #ifdef _RPMXAR_INTERNAL
#include "yarn.h"
struct rpmxar_s { struct rpmxar_s {
struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */
/*@relnull@*/ /*@relnull@*/
const void * x; /*!< xar_t */ const void * x; /*!< xar_t */
/*@relnull@*/ /*@relnull@*/
const void * f; /*!< xar_file_t */ const void * f; /*!< xar_file_t */
/*@relnull@*/ /*@relnull@*/
const void * i; /*!< xar_iter_t */ const void * i; /*!< xar_iter_t */
/*@null@*/ /*@null@*/
const char * member; /*!< Current archive member. */ const char * member; /*!< Current archive member. */
/*@null@*/ /*@null@*/
unsigned char * b; /*!< Data buffer. */ unsigned char * b; /*!< Data buffer. */
size_t bsize; /*!< No. bytes of data. */ size_t bsize; /*!< No. bytes of data. */
size_t bx; /*!< Data byte index. */ size_t bx; /*!< Data byte index. */
int first; int first;
#if defined(__LCLINT__)
/*@refs@*/ /*@refs@*/
int nrefs; /*!< Reference count. */ int nrefs; /*!< (unused) keep splint happy */
#endif
}; };
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
* Unreference a xar archive instance. * Unreference a xar archive instance.
* @param xar xar archive * @param xar xar archive
* @param msg * @param msg
* @return NULL always * @return NULL on last dereference
*/ */
/*@unused@*/ /*@null@*/ /*@unused@*/ /*@null@*/
rpmxar rpmxarUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmxar xar, rpmxar rpmxarUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmxar xar,
/*@null@*/ const char * msg) /*@null@*/ const char * msg)
/*@modifies xar @*/; /*@modifies xar @*/;
#define rpmxarUnlink(_xar, _msg) \
/** @todo Remove debugging entry from the ABI. */ ((rpmxar)rpmioUnlinkPoolItem((rpmioItem)(_xar), _msg, __FILE__, __LINE_
/*@-exportlocal@*/ _))
/*@null@*/
rpmxar XrpmxarUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmxar xar,
/*@null@*/ const char * msg, const char * fn, unsigned ln)
/*@modifies xar @*/;
/*@=exportlocal@*/
#define rpmxarUnlink(_xar, _msg) XrpmxarUnlink(_xar, _msg, __FILE__,
__LINE__)
/** /**
* Reference a xar archive instance. * Reference a xar archive instance.
* @param xar xar archive * @param xar xar archive
* @param msg * @param msg
* @return new xar archive reference * @return new xar archive reference
*/ */
/*@unused@*/ /*@newref@*/ /*@null@*/ /*@unused@*/ /*@newref@*/ /*@null@*/
rpmxar rpmxarLink (/*@null@*/ rpmxar xar, /*@null@*/ const char * msg) rpmxar rpmxarLink (/*@null@*/ rpmxar xar, /*@null@*/ const char * msg)
/*@modifies xar @*/; /*@modifies xar @*/;
#define rpmxarLink(_xar, _msg) \
((rpmxar)rpmioLinkPoolItem((rpmioItem)(_xar), _msg, __FILE__, __LINE__)
)
/** @todo Remove debugging entry from the ABI. */ /*@unused@*/ /*@null@*/
/*@newref@*/ /*@null@*/ rpmxar rpmxarFree(/*@killref@*/ /*@only@*/ rpmxar xar,
rpmxar XrpmxarLink (/*@null@*/ rpmxar xar, /*@null@*/ const char * msg, /*@null@*/ const char * msg)
const char * fn, unsigned ln)
/*@modifies xar @*/;
#define rpmxarLink(_xar, _msg) XrpmxarLink(_xar, _msg, __FILE__, __
LINE__)
/*@null@*/
rpmxar rpmxarFree(/*@killref@*/ /*@only@*/ rpmxar xar)
/*@modifies xar @*/; /*@modifies xar @*/;
#define rpmxarFree(_xar, _msg) \
((rpmxar)rpmioFreePoolItem((rpmioItem)(_xar), _msg, __FILE__, __LINE__)
)
/*@-globuse@*/ /*@-globuse@*/
/*@relnull@*/ /*@relnull@*/
rpmxar rpmxarNew(const char * fn, const char * fmode) rpmxar rpmxarNew(const char * fn, const char * fmode)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies fileSystem @*/; /*@modifies fileSystem @*/;
/*@=globuse@*/ /*@=globuse@*/
int rpmxarNext(rpmxar xar) int rpmxarNext(rpmxar xar)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
skipping to change at line 107 skipping to change at line 102
int rpmxarSwapBuf(rpmxar xar, /*@null@*/ unsigned char * b, size_t bsize, int rpmxarSwapBuf(rpmxar xar, /*@null@*/ unsigned char * b, size_t bsize,
/*@null@*/ unsigned char ** obp, /*@null@*/ size_t * obsizep ) /*@null@*/ unsigned char ** obp, /*@null@*/ size_t * obsizep )
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies xar, *obp, *obsizep, fileSystem @*/; /*@modifies xar, *obp, *obsizep, fileSystem @*/;
/*@-incondefs@*/ /*@-incondefs@*/
ssize_t xarRead(void * cookie, /*@out@*/ char * buf, size_t count) ssize_t xarRead(void * cookie, /*@out@*/ char * buf, size_t count)
/*@globals fileSystem, internalState @*/ /*@globals fileSystem, internalState @*/
/*@modifies buf, fileSystem, internalState @*/ /*@modifies buf, fileSystem, internalState @*/
/*@requires maxSet(buf) >= (count - 1) @*/ /*@requires maxSet(buf) >= (count - 1) @*/;
/*@ensures maxRead(buf) == result @*/;
/*@=incondefs@*/ /*@=incondefs@*/
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* H_RPMXAR */ #endif /* H_RPMXAR */
 End of changes. 10 change blocks. 
24 lines changed or deleted 19 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/