mire.h   mire.h 
skipping to change at line 146 skipping to change at line 147
/** /**
* Allocate a miRE container from the pool. * Allocate a miRE container from the pool.
* @param pool mire pool * @param pool mire pool
* @return miRE container * @return miRE container
*/ */
miRE mireGetPool(/*@null@*/ rpmioPool pool) miRE mireGetPool(/*@null@*/ rpmioPool pool)
/*@globals _mirePool, fileSystem @*/ /*@globals _mirePool, fileSystem @*/
/*@modifies pool, _mirePool, fileSystem @*/; /*@modifies pool, _mirePool, fileSystem @*/;
/*@-exportlocal@*/ /**
/*@null@*/ * Unreference a pattern container instance.
miRE XmireUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ miRE mire, * @param mire pattern container
/*@null@*/ const char * msg, const char * fn, unsigned ln) * @return new pattern container reference
*/
/*@unused@*/ /*@null@*/
miRE mireUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ miRE mire)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies mire, fileSystem @*/; /*@modifies mire, fileSystem @*/;
/*@=exportlocal@*/ #define mireUnlink(_mire) \
#define mireUnlink(_mire, _msg) XmireUnlink(_mire, _msg, __FILE__, _ (miRE)rpmioUnlinkPoolItem((rpmioItem)_mire, __FUNCTION__, __FILE__, __L
_LINE__) INE__)
/** /**
* Reference a pattern container instance. * Reference a pattern container instance.
* @param mire pattern container * @param mire pattern container
* @param msg
* @return new pattern container reference * @return new pattern container reference
*/ */
/*@unused@*/ /*@newref@*/ /*@null@*/ /*@unused@*/ /*@newref@*/ /*@null@*/
miRE mireLink (/*@null@*/ miRE mire, /*@null@*/ const char * msg) miRE mireLink (/*@null@*/ miRE mire)
/*@modifies mire @*/; /*@modifies mire @*/;
#define mireLink(_mire) \
/** @todo Remove debugging entry from the ABI. */ (miRE)rpmioLinkPoolItem((rpmioItem)_mire, __FUNCTION__, __FILE__, __LIN
/*@newref@*/ /*@null@*/ E__)
miRE XmireLink (/*@null@*/ miRE mire, /*@null@*/ const char * msg,
const char * fn, unsigned ln)
/*@globals fileSystem @*/
/*@modifies mire, fileSystem @*/;
#define mireLink(_mire, _msg) XmireLink(_mire, _msg, __FILE__, __L
INE__)
/** /**
* Free pattern container. * Free pattern container.
* @param mire pattern container * @param mire pattern container
* @return NULL always * @return NULL on last derefernce
*/ */
/*@null@*/ /*@null@*/
miRE mireFree(/*@killref@*/ /*@only@*/ /*@null@*/ miRE mire) miRE mireFree(/*@killref@*/ /*@only@*/ /*@null@*/ miRE mire)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies mire, fileSystem @*/; /*@modifies mire, fileSystem @*/;
#define mireFree(_mire) \
(miRE)rpmioFreePoolItem((rpmioItem)_mire, __FUNCTION__, __FILE__, __LIN
E__)
/** /**
* Destroy compiled patterns. * Destroy compiled patterns.
* @param mire pattern array * @param mire pattern array
* @param nre no of patterns in array * @param nre no of patterns in array
* @return NULL always * @return NULL always
*/ */
/*@null@*/ /*@null@*/
void * mireFreeAll(/*@only@*/ /*@null@*/ miRE mire, int nmire) void * mireFreeAll(/*@only@*/ /*@null@*/ miRE mire, int nmire)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
 End of changes. 7 change blocks. 
19 lines changed or deleted 18 lines changed or added


 pkgio.h   pkgio.h 
skipping to change at line 34 skipping to change at line 34
* @param uc no. of bytes in blob (or 0 to disable) * @param uc no. of bytes in blob (or 0 to disable)
* @retval *msg verification error message (or NULL) * @retval *msg verification error message (or NULL)
* @return RPMRC_OK on success * @return RPMRC_OK on success
*/ */
rpmRC headerCheck(pgpDig dig, const void * uh, size_t uc, rpmRC headerCheck(pgpDig dig, const void * uh, size_t uc,
/*@out@*/ /*@null@*/ const char ** msg) /*@out@*/ /*@null@*/ const char ** msg)
/*@globals fileSystem, internalState @*/ /*@globals fileSystem, internalState @*/
/*@modifies dig, *msg, fileSystem, internalState @*/; /*@modifies dig, *msg, fileSystem, internalState @*/;
/** /**
* Return package header from file handle, verifying digests/signatures.
* @todo The rpmts either needs to become void *, or changed to -lrpmdb sco
pe.
* @param ts transaction set
* @param fd file handle
* @param fn file name
* @retval hdrp address of header (or NULL)
* @return RPMRC_OK on success
*/
rpmRC rpmReadPackageFile(rpmts ts, FD_t fd,
const char * fn, /*@null@*/ /*@out@*/ Header * hdrp)
/*@globals fileSystem, internalState @*/
/*@modifies ts, fd, *hdrp, fileSystem, internalState @*/;
/**
* Return size of item in bytes. * Return size of item in bytes.
* @param fn item name * @param fn item name
* @param ptr item buffer * @param ptr item buffer
* @return size of item in bytes. * @return size of item in bytes.
*/ */
size_t rpmpkgSizeof(const char * fn, /*@null@*/ const void * ptr) size_t rpmpkgSizeof(const char * fn, /*@null@*/ const void * ptr)
/*@*/; /*@*/;
/** /**
* Write item onto file descriptor. * Write item onto file descriptor.
 End of changes. 1 change blocks. 
0 lines changed or deleted 15 lines changed or added


 rpm4compat.h   rpm4compat.h 
/* /*
* Copyright © 2008 Per Øyvind Karlsen <peroyvind@mandriva.org> * Copyright © 2008 Per Øyvind Karlsen <peroyvind@mandriva.org>
* *
* $Id: rpm4compat.h,v 2.10.2.1 2008/07/18 13:05:34 bero Exp $ * $Id: rpm4compat.h,v 2.23.2.1 2009/05/14 10:53:07 pkarlsen Exp $
*/ */
#ifndef H_RPM4COMPAT #ifndef H_RPM4COMPAT
#define H_RPM4COMPAT 1 #define H_RPM4COMPAT 1
#define RPM_NULL_TYPE 0 #define RPM_NULL_TYPE 0
#define RPM_CHAR_TYPE RPM_UINT8_TYPE #define RPM_CHAR_TYPE RPM_UINT8_TYPE
#define RPM_INT8_TYPE RPM_UINT8_TYPE #define RPM_INT8_TYPE RPM_UINT8_TYPE
#define RPM_INT16_TYPE RPM_UINT16_TYPE #define RPM_INT16_TYPE RPM_UINT16_TYPE
#define RPM_INT32_TYPE RPM_UINT32_TYPE #define RPM_INT32_TYPE RPM_UINT32_TYPE
skipping to change at line 39 skipping to change at line 39
#define RPMBUILD_ISSOURCE RPMFILE_SOURCE #define RPMBUILD_ISSOURCE RPMFILE_SOURCE
#define RPMBUILD_ISPATCH RPMFILE_PATCH #define RPMBUILD_ISPATCH RPMFILE_PATCH
#define RPMBUILD_ISICON RPMFILE_ICON #define RPMBUILD_ISICON RPMFILE_ICON
#define RPMBUILD_ISNO RPMFILE_MISSINGOK #define RPMBUILD_ISNO RPMFILE_MISSINGOK
#define buildRestrictions sourceHeader #define buildRestrictions sourceHeader
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h> #include <unistd.h>
#include <stdint.h>
#include <stdio.h> #include <stdio.h>
#define WITH_DB
#define _RPMPS_INTERNAL
#define _RPMEVR_INTERNAL
#define _RPMTAG_INTERNAL #define _RPMTAG_INTERNAL
#define _RPMEVR_INTERNAL
#define _RPMPS_INTERNAL
#include <rpm/rpmio.h> #include <rpm/rpmio.h>
#include <rpm/rpmlib.h> #include <rpm/rpmcb.h>
#include <rpm/rpmiotypes.h>
#include <rpm/rpmmacro.h>
#include <rpm/rpmpgp.h>
#include <rpm/rpmtypes.h>
#include <rpm/rpmtag.h>
#include <rpm/rpmevr.h> #include <rpm/rpmevr.h>
#include <rpm/pkgio.h> #include <rpm/pkgio.h>
#include <rpm/rpmcb.h>
#include <rpm/rpmds.h> #include <rpm/rpmds.h>
#include <rpm/rpmts.h> #include <rpm/rpmts.h>
#include <rpm/rpmmacro.h>
#include <rpm/rpmpgp.h>
#include <rpm/rpmurl.h>
#include <rpm/rpmcli.h> #include <rpm/rpmcli.h>
#include <rpm/rpmps.h>
enum hMagic { enum hMagic {
HEADER_MAGIC_NO = 0, HEADER_MAGIC_NO = 0,
HEADER_MAGIC_YES = 1 HEADER_MAGIC_YES = 1
}; };
typedef uint32_t * hTAG_t; typedef rpmuint32_t * hTAG_t;
typedef uint32_t * hTYP_t; typedef rpmuint32_t * hTYP_t;
typedef const void * hPTR_t; typedef const void * hPTR_t;
typedef uint32_t * hCNT_t; typedef rpmuint32_t * hCNT_t;
typedef uint32_t int_32; typedef rpmuint32_t int_32;
typedef uint32_t uint_32; typedef rpmuint32_t uint_32;
typedef uint16_t uint_16; typedef rpmuint16_t uint_16;
typedef uint16_t int_16; typedef rpmuint16_t int_16;
typedef uint8_t int_8; typedef rpmuint8_t int_8;
typedef uint8_t byte; typedef rpmuint8_t byte;
typedef union hRET_s { typedef union hRET_s {
const void * ptr; const void * ptr;
const char ** argv; const char ** argv;
const char * str; const char * str;
uint32_t * ui32p; rpmuint32_t * ui32p;
uint16_t * ui16p; rpmuint16_t * ui16p;
uint32_t * i32p; rpmuint32_t * i32p;
uint16_t * i16p; rpmuint16_t * i16p;
uint8_t * i8p; rpmuint8_t * i8p;
} * hRET_t; } * hRET_t;
typedef enum pgpVSFlags_e rpmVSFlags_e; typedef enum pgpVSFlags_e rpmVSFlags_e;
enum rpm_machtable_e {
RPM_MACHTABLE_INSTARCH = 0, /*!< Install platform architecture.
*/
RPM_MACHTABLE_INSTOS = 1, /*!< Install platform operating sys
tem. */
RPM_MACHTABLE_BUILDARCH = 2, /*!< Build platform architecture. *
/
RPM_MACHTABLE_BUILDOS = 3 /*!< Build platform operating syste
m. */
};
#define RPM_MACHTABLE_COUNT 4 /*!< No. of arch/os tables. */
typedef enum urltype_e {
URL_IS_UNKNOWN = 0, /*!< unknown (aka a file) */
URL_IS_DASH = 1, /*!< stdin/stdout */
URL_IS_PATH = 2, /*!< file://... */
URL_IS_FTP = 3, /*!< ftp://... */
URL_IS_HTTP = 4, /*!< http://... */
URL_IS_HTTPS = 5, /*!< https://... */
URL_IS_HKP = 6 /*!< hkp://... */
} urltype;
urltype urlPath(const char * url, /*@out@*/ const char ** pathp);
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
static inline int headerGetEntry(Header h, int_32 tag, hTYP_t type, void ** p, hCNT_t c) { static inline int headerGetEntry(Header h, int_32 tag, hTYP_t type, void ** p, hCNT_t c) {
HE_t he = (HE_s*)memset(alloca(sizeof(*he)), 0, sizeof(*he)); HE_t he = (HE_t)memset(alloca(sizeof(*he)), 0, sizeof(*he));
int rc; int rc;
/* Always ensure to initialize */ /* Always ensure to initialize */
*(void **)p = NULL; *(void **)p = NULL;
he->tag = (rpmTag)tag; he->tag = (rpmTag)tag;
rc = headerGet(h, he, 0); rc = headerGet(h, he, 0);
if (rc) { if (rc) {
if (type) *type = he->t; if (type) *type = he->t;
if (p) *(void **) p = he->p.ptr; if (p) *(void **) p = he->p.ptr;
if (c) *c = he->c; if (c) *c = he->c;
} }
return rc; return rc;
} }
static inline int headerGetRawEntry(Header h, int_32 tag, hTYP_t type, void * p, hCNT_t c) { static inline int headerGetRawEntry(Header h, int_32 tag, hTYP_t type, void * p, hCNT_t c) {
HE_t he = (HE_s*)memset(alloca(sizeof(*he)), 0, sizeof(*he)); HE_t he = (HE_t)memset(alloca(sizeof(*he)), 0, sizeof(*he));
int rc; int rc;
he->tag = (rpmTag)tag; he->tag = (rpmTag)tag;
he->t = *(rpmTagType*)type; he->t = *(rpmTagType*)type;
he->p.str = (const char*)p; he->p.str = (const char*)p;
he->c = *(rpmTagCount*)c; he->c = *(rpmTagCount*)c;
rc = headerGet(h, he, tag); rc = headerGet(h, he, tag);
if (rc) { if (rc) {
if (type) *type = he->t; if (type) *type = he->t;
if (p) *(void **) p = he->p.ptr; if (p) *(void **) p = he->p.ptr;
if (c) *c = he->c; if (c) *c = he->c;
} }
return rc; return rc;
} }
static inline void rpmfiBuildFNames(Header h, rpmTag tagN, const char *** f np, rpmTagCount * fcp) { static inline void rpmfiBuildFNames(Header h, rpmTag tagN, const char *** f np, rpmTagCount * fcp) {
HE_t he = (HE_s*)memset(alloca(sizeof(*he)), 0, sizeof(*he)); HE_t he = (HE_t)memset(alloca(sizeof(*he)), 0, sizeof(*he));
rpmTag dirNameTag = (rpmTag)0; rpmTag dirNameTag = (rpmTag)0;
rpmTag dirIndexesTag = (rpmTag)0; rpmTag dirIndexesTag = (rpmTag)0;
rpmTagData baseNames; rpmTagData baseNames;
rpmTagData dirNames; rpmTagData dirNames;
rpmTagData dirIndexes; rpmTagData dirIndexes;
rpmTagData fileNames; rpmTagData fileNames;
rpmTagCount count; rpmTagCount count;
size_t size; size_t size;
char * t; char * t;
skipping to change at line 203 skipping to change at line 227
dirIndexes.ptr = _free(dirIndexes.ptr); dirIndexes.ptr = _free(dirIndexes.ptr);
if (fnp) if (fnp)
*fnp = fileNames.argv; *fnp = fileNames.argv;
else else
fileNames.ptr = _free(fileNames.ptr); fileNames.ptr = _free(fileNames.ptr);
if (fcp) *fcp = count; if (fcp) *fcp = count;
} }
static inline int headerAddEntry(Header h, int_32 tag, int_32 type, const v oid * p, int_32 c) { static inline int headerAddEntry(Header h, int_32 tag, int_32 type, const v oid * p, int_32 c) {
HE_t he = (HE_s*)memset(alloca(sizeof(*he)), 0, sizeof(*he)); HE_t he = (HE_t)memset(alloca(sizeof(*he)), 0, sizeof(*he));
he->tag = (rpmTag)tag; he->tag = (rpmTag)tag;
he->t = (rpmTagType)type; he->t = (rpmTagType)type;
he->p.str = (const char*)p; he->p.str = (const char*)p;
he->c = (rpmTagCount)c; he->c = (rpmTagCount)c;
return headerPut(h, he, 0); return headerPut(h, he, 0);
} }
static inline int headerAddOrAppendEntry(Header h, int_32 tag, int_32 type,
const void * p, int_32 c) {
HE_t he = (HE_t)memset(alloca(sizeof(*he)), 0, sizeof(*he));
he->tag = (rpmTag)tag;
he->t = (rpmTagType)type;
he->p.str = (const char*)p;
he->c = (rpmTagCount)c;
he->append = 1;
return headerPut(h, he, 0);
}
static inline int headerAppendEntry(Header h, int_32 tag, int_32 type, cons
t void * p, int_32 c) {
return headerAddOrAppendEntry(h, tag, type, p, c);
}
static inline int headerRemoveEntry(Header h, int_32 tag) { static inline int headerRemoveEntry(Header h, int_32 tag) {
HE_t he = (HE_s*)memset(alloca(sizeof(*he)), 0, sizeof(*he)); HE_t he = (HE_t)memset(alloca(sizeof(*he)), 0, sizeof(*he));
he->tag = (rpmTag)tag; he->tag = (rpmTag)tag;
return headerDel(h, he, 0); return headerDel(h, he, 0);
} }
static inline int headerModifyEntry(Header h, int_32 tag, int_32 type, cons t void * p, int_32 c) { static inline int headerModifyEntry(Header h, int_32 tag, int_32 type, cons t void * p, int_32 c) {
HE_t he = (HE_s*)memset(alloca(sizeof(*he)), 0, sizeof(*he)); HE_t he = (HE_t)memset(alloca(sizeof(*he)), 0, sizeof(*he));
he->tag = (rpmTag)tag; he->tag = (rpmTag)tag;
he->t = (rpmTagType)type; he->t = (rpmTagType)type;
he->p.str = (const char*)p; he->p.str = (const char*)p;
he->c = (rpmTagCount)c; he->c = (rpmTagCount)c;
return headerMod(h, he, 0); return headerMod(h, he, 0);
} }
static inline int headerNextIterator(HeaderIterator hi, hTAG_t tag, hTYP_t type, hPTR_t * p, hCNT_t c) { static inline int headerNextIterator(HeaderIterator hi, hTAG_t tag, hTYP_t type, hPTR_t * p, hCNT_t c) {
HE_t he = (HE_s*)memset(alloca(sizeof(*he)), 0, sizeof(*he)); HE_t he = (HE_t)memset(alloca(sizeof(*he)), 0, sizeof(*he));
int rc = headerNext(hi, he, 0);
he->tag = *(rpmTag*)tag; if (rc) {
(void) type; if (tag) *tag = he->tag;
(void) p; if (type) *type = he->t;
(void) c; if (p) *(void **) p = he->p.ptr;
return headerNext(hi, he, 0); if (c) *c = he->c;
}
return rc;
} }
static inline HeaderIterator headerFreeIterator(HeaderIterator hi) { static inline HeaderIterator headerFreeIterator(HeaderIterator hi) {
return headerFini(hi); return headerFini(hi);
} }
static inline HeaderIterator headerInitIterator(Header h){ static inline HeaderIterator headerInitIterator(Header h){
return headerInit(h); return headerInit(h);
} }
static inline void * headerFreeData(const void * data, rpmTagType type) { static inline void * headerFreeData(const void * data, __attribute__((unuse d)) rpmTagType type) {
if (data) if (data)
free((void *)data); free((void *)data);
return NULL; return NULL;
} }
static inline int headerWrite(void * _fd, Header h, enum hMagic magicp) { static inline int headerWrite(void * _fd, Header h, __attribute__((unused)) enum hMagic magicp) {
const char item[] = "Header"; const char item[] = "Header";
const char * msg = NULL; const char * msg = NULL;
(void) magicp;
rpmRC rc = rpmpkgWrite(item, (FD_t)_fd, h, &msg); rpmRC rc = rpmpkgWrite(item, (FD_t)_fd, h, &msg);
if (rc != RPMRC_OK) { if (rc != RPMRC_OK) {
rpmlog(RPMLOG_ERR, "%s: %s: %s\n", "headerWrite", item, msg) ; rpmlog(RPMLOG_ERR, "%s: %s: %s\n", "headerWrite", item, msg) ;
rc = RPMRC_FAIL; rc = RPMRC_FAIL;
} }
msg = (const char*)_free(msg); msg = (const char*)_free(msg);
return rc; return rc;
} }
static inline Header headerRead(void * _fd, enum hMagic magicp) { static inline Header headerRead(void * _fd, __attribute__((unused)) enum hM agic magicp) {
const char item[] = "Header"; const char item[] = "Header";
Header h = NULL; Header h = NULL;
const char * msg = NULL; const char * msg = NULL;
(void) magicp;
rpmRC rc = rpmpkgRead(item, (FD_t)_fd, &h, &msg); rpmRC rc = rpmpkgRead(item, (FD_t)_fd, &h, &msg);
switch (rc) { switch (rc) {
default: default:
rpmlog(RPMLOG_ERR, "%s: %s: %s\n", "headerRead", ite m, msg); rpmlog(RPMLOG_ERR, "%s: %s: %s\n", "headerRead", ite m, msg);
case RPMRC_NOTFOUND: case RPMRC_NOTFOUND:
h = NULL; h = NULL;
case RPMRC_OK: case RPMRC_OK:
break; break;
} }
msg = (const char*)_free(msg); msg = (const char*)_free(msg);
return h; return h;
} }
static inline int rpmMachineScore(int type, const char * name) { static inline char * headerFormat(Header h, const char * fmt, errmsg_t * er
rmsg) {
return headerSprintf(h, fmt, NULL, NULL, errmsg);
}
static inline int rpmMachineScore(__attribute__((unused)) int type, const c
har * name) {
char * platform = rpmExpand(name, "-%{_target_vendor}-%{_target_os}% {?_gnu}", NULL); char * platform = rpmExpand(name, "-%{_target_vendor}-%{_target_os}% {?_gnu}", NULL);
int score = rpmPlatformScore(platform, NULL, 0); int score = rpmPlatformScore(platform, NULL, 0);
_free(platform); _free(platform);
return score; return score;
} }
static inline rpmRC rpmtsImportPubkey(const rpmts ts, const unsigned char * pkt, ssize_t pktlen) { static inline rpmRC rpmtsImportPubkey(const rpmts ts, const unsigned char * pkt, ssize_t pktlen) {
return rpmcliImportPubkey(ts, pkt, pktlen); return rpmcliImportPubkey(ts, pkt, pktlen);
} }
static inline rpmuint64_t rpmProblemGetLong(rpmProblem prob){
return rpmProblemGetDiskNeed(prob);
}
static inline off_t fdSize(FD_t fd){
struct stat sb;
Fstat(fd, &sb);
return sb.st_size;
}
#ifdef __cplusplus #ifdef __cplusplus
} }
static inline rpmds rpmdsSingle(rpmTag tagN, const char * N, const char * E VR, int_32 Flags){ static inline rpmds rpmdsSingle(rpmTag tagN, const char * N, const char * E VR, int_32 Flags){
return rpmdsSingle(tagN, N, EVR, (evrFlags)Flags); return rpmdsSingle(tagN, N, EVR, (evrFlags)Flags);
} }
#endif #endif
#endif /* rpm4compat.h */ #endif /* rpm4compat.h */
 End of changes. 28 change blocks. 
42 lines changed or deleted 106 lines changed or added


 rpmbuild.h   rpmbuild.h 
#ifndef _H_RPMBUILD_ #ifndef _H_RPMBUILD_
#define _H_RPMBUILD_ #define _H_RPMBUILD_
/** \ingroup rpmbuild /** \ingroup rpmbuild
* \file build/rpmbuild.h * \file build/rpmbuild.h
* This is the *only* module users of librpmbuild should need to include. * This is the *only* module users of librpmbuild should need to include.
*/ */
#include <rpmcli.h> #include <rpmiotypes.h>
#include <rpmmacro.h>
#include <rpmtypes.h>
#include <rpmtag.h>
/* and it shouldn't need these :-( */ #include <rpmfi.h>
#include "misc.h"
#include <rpmcli.h>
/* but this will be needed */
#include "rpmspec.h" #include "rpmspec.h"
/** \ingroup rpmbuild /** \ingroup rpmbuild
* Bit(s) to control buildSpec() operation. * Bit(s) to control buildSpec() operation.
*/ */
/*@-typeuse@*/ /*@-typeuse@*/
typedef enum rpmBuildFlags_e { typedef enum rpmBuildFlags_e {
/*@-enummemuse@*/ /*@-enummemuse@*/
RPMBUILD_NONE = 0, RPMBUILD_NONE = 0,
/*@=enummemuse@*/ /*@=enummemuse@*/
skipping to change at line 180 skipping to change at line 183
*/ */
/*@observer@*/ /*@observer@*/
extern const char * buildHost(void) extern const char * buildHost(void)
/*@*/; /*@*/;
/** \ingroup rpmbuild /** \ingroup rpmbuild
* Return build time stamp. * Return build time stamp.
* @return build time stamp * @return build time stamp
*/ */
/*@observer@*/ /*@observer@*/
extern uint32_t * getBuildTime(void) extern rpmuint32_t * getBuildTime(void)
/*@*/; /*@*/;
/** \ingroup rpmbuild /** \ingroup rpmbuild
* Read next line from spec file. * Read next line from spec file.
* @param spec spec file control structure * @param spec spec file control structure
* @param strip truncate comments? * @param strip truncate comments?
* @return 0 on success, 1 on EOF, <0 on error * @return 0 on success, 1 on EOF, <0 on error
*/ */
int readLine(Spec spec, int strip) int readLine(Spec spec, rpmStripFlags strip)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies spec->fileStack, spec->readStack, spec->line, spec->line Num, /*@modifies spec->fileStack, spec->readStack, spec->line, spec->line Num,
spec->lbufPtr, spec->lbufPtr,
spec->nextline, spec->nextpeekc, spec->lbuf, spec->sl, spec->nextline, spec->nextpeekc, spec->lbuf, spec->sl,
rpmGlobalMacroContext, fileSystem, internalState @*/; rpmGlobalMacroContext, fileSystem, internalState @*/;
/** \ingroup rpmbuild /** \ingroup rpmbuild
* Stop reading from spec file, freeing resources. * Stop reading from spec file, freeing resources.
* @param spec spec file control structure * @param spec spec file control structure
*/ */
skipping to change at line 225 skipping to change at line 228
*/ */
rpmParseState isPart(Spec spec) rpmParseState isPart(Spec spec)
/*@modifies spec->foo, spec->nfoo @*/; /*@modifies spec->foo, spec->nfoo @*/;
/** \ingroup rpmbuild /** \ingroup rpmbuild
* Parse a number. * Parse a number.
* @param line from spec file * @param line from spec file
* @retval res pointer to int * @retval res pointer to int
* @return 0 on success, 1 on failure * @return 0 on success, 1 on failure
*/ */
int parseNum(/*@null@*/ const char * line, /*@null@*/ /*@out@*/uint32_t * r es) int parseNum(/*@null@*/ const char * line, /*@null@*/ /*@out@*/rpmuint32_t * res)
/*@modifies *res @*/; /*@modifies *res @*/;
/** \ingroup rpmbuild /** \ingroup rpmbuild
* Add changelog entry to header. * Add changelog entry to header.
* @todo addChangelogEntry should be static. * @todo addChangelogEntry should be static.
* @param h header * @param h header
* @param time time of change * @param time time of change
* @param name person who made the change * @param name person who made the change
* @param text description of change * @param text description of change
*/ */
skipping to change at line 339 skipping to change at line 342
* Parse dependency relations from spec file and/or autogenerated output bu ffer. * Parse dependency relations from spec file and/or autogenerated output bu ffer.
* @param spec spec file control structure * @param spec spec file control structure
* @param pkg package control structure * @param pkg package control structure
* @param field text to parse (e.g. "foo < 0:1.2-3, bar = 5: 6.7") * @param field text to parse (e.g. "foo < 0:1.2-3, bar = 5: 6.7")
* @param tagN tag, identifies type of dependency * @param tagN tag, identifies type of dependency
* @param index (0 always) * @param index (0 always)
* @param tagflags dependency flags already known from context * @param tagflags dependency flags already known from context
* @return RPMRC_OK on success * @return RPMRC_OK on success
*/ */
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) rpmuint32_t index, rpmsenseFlags tagflags)
/*@globals internalState @*/ /*@globals internalState @*/
/*@modifies internalState @*/; /*@modifies internalState @*/;
/** \ingroup rpmbuild /** \ingroup rpmbuild
* Parse %%pre et al scriptlets from a spec file. * Parse %%pre et al scriptlets from a spec file.
* @param spec spec file control structure * @param spec spec file control structure
* @param parsePart current rpmParseState * @param parsePart current rpmParseState
* @return >= 0 next rpmParseState, < 0 on error * @return >= 0 next rpmParseState, < 0 on error
*/ */
int parseScript(Spec spec, int parsePart) int parseScript(Spec spec, int parsePart)
skipping to change at line 451 skipping to change at line 454
* @param h header * @param h header
* @param tagN tag, identifies type of dependency * @param tagN tag, identifies type of dependency
* @param N (e.g. Requires: foo < 0:1.2-3, "foo") * @param N (e.g. Requires: foo < 0:1.2-3, "foo")
* @param EVR (e.g. Requires: foo < 0:1.2-3, "0:1.2-3") * @param EVR (e.g. Requires: foo < 0:1.2-3, "0:1.2-3")
* @param Flags (e.g. Requires: foo < 0:1.2-3, both "Require s:" and "<") * @param Flags (e.g. Requires: foo < 0:1.2-3, both "Require s:" and "<")
* @param index (0 always) * @param index (0 always)
* @return 0 always * @return 0 always
*/ */
int addReqProv(/*@unused@*/Spec spec, Header h, rpmTag tagN, int addReqProv(/*@unused@*/Spec spec, Header h, rpmTag tagN,
const char * N, const char * EVR, rpmsenseFlags Flags, const char * N, const char * EVR, rpmsenseFlags Flags,
uint32_t index) rpmuint32_t index)
/*@globals internalState @*/ /*@globals internalState @*/
/*@modifies h, internalState @*/; /*@modifies h, internalState @*/;
/** /**
* Append files (if any) to scriptlet tags. * Append files (if any) to scriptlet tags.
* @param spec spec file control structure * @param spec spec file control structure
* @param pkg package control structure * @param pkg package control structure
* @return RPMRC_OK on success * @return RPMRC_OK on success
*/ */
rpmRC processScriptFiles(Spec spec, Package pkg) rpmRC processScriptFiles(Spec spec, Package pkg)
 End of changes. 8 change blocks. 
9 lines changed or deleted 12 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() \
 End of changes. 1 change blocks. 
1 lines changed or deleted 0 lines changed or added


 rpmcli.h   rpmcli.h 
#ifndef H_RPMCLI #ifndef H_RPMCLI
#define H_RPMCLI #define H_RPMCLI
/** \ingroup rpmcli rpmbuild /** \ingroup rpmcli rpmbuild
* \file lib/rpmcli.h * \file lib/rpmcli.h
*/ */
#include "popt.h" #include <popt.h>
#include "argv.h" #include <rpmmacro.h>
#include "rpmcb.h" #include <rpmtypes.h>
#include "rpmmacro.h" #include <rpmtag.h>
#include "rpmurl.h" #include <rpmps.h>
#include "rpmlib.h" #include <rpmrc.h>
#include "rpmps.h" #include <rpmfi.h> /* XXX rpmfileAttrs */
#include "rpmte.h" #include <rpmts.h> /* XXX rpmdepFlags */
#include "rpmts.h"
/**
* Table of query format extensions.
* @note Chains *headerCompoundFormats -> *headerDefaultFormats.
*/
/*@-redecl@*/
/*@unchecked@*/
extern headerSprintfExtension rpmHeaderFormats;
/*@=redecl@*/
/** \ingroup rpmcli /** \ingroup rpmcli
* Should version 3 packages be produced? * Should version 3 packages be produced?
*/ */
/*@-redecl@*/ /*@-redecl@*/
/*@unchecked@*/ /*@unchecked@*/
extern int _noDirTokens; extern int _noDirTokens;
/*@=redecl@*/ /*@=redecl@*/
#ifdef __cplusplus #ifdef __cplusplus
skipping to change at line 314 skipping to change at line 322
/** \ingroup rpmcli /** \ingroup rpmcli
* Common query/verify source interface, called once for each CLI arg. * Common query/verify source interface, called once for each CLI arg.
* *
* This routine uses: * This routine uses:
* - qva->qva_mi rpm database iterator * - qva->qva_mi rpm database iterator
* - qva->qva_showPackage query/verify display routine * - qva->qva_showPackage query/verify display routine
* *
* @param qva parsed query/verify options * @param qva parsed query/verify options
* @param ts transaction set * @param ts transaction set
* @param arg name of source to query/verify * @param arg name of source to query/verify
* @return showPackage() result, 1 if rpmdbInitIterator() is NU LL * @return showPackage() result, 1 if rpmmiInit() is NULL
*/ */
int rpmQueryVerify(QVA_t qva, rpmts ts, const char * arg) int rpmQueryVerify(QVA_t qva, rpmts ts, const char * arg)
/*@globals rpmGlobalMacroContext, h_errno, /*@globals rpmGlobalMacroContext, h_errno,
fileSystem, internalState @*/ fileSystem, internalState @*/
/*@modifies qva, ts, rpmGlobalMacroContext, /*@modifies qva, ts, rpmGlobalMacroContext,
fileSystem, internalState @*/; fileSystem, internalState @*/;
/** \ingroup rpmcli /** \ingroup rpmcli
* Display results of package query. * Display results of package query.
* @todo Devise a meaningful return code. * @todo Devise a meaningful return code.
skipping to change at line 341 skipping to change at line 349
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies ts, h, rpmGlobalMacroContext, fileSystem, internalState @*/; /*@modifies ts, h, rpmGlobalMacroContext, fileSystem, internalState @*/;
/** \ingroup rpmcli /** \ingroup rpmcli
* Iterate over query/verify arg list. * Iterate over query/verify arg list.
* @param ts transaction set * @param ts transaction set
* @param qva parsed query/verify options * @param qva parsed query/verify options
* @param argv query argument(s) (or NULL) * @param argv query argument(s) (or NULL)
* @return 0 on success, else no. of failures * @return 0 on success, else no. of failures
*/ */
int rpmcliArgIter(rpmts ts, QVA_t qva, /*@null@*/ ARGV_t argv) int rpmcliArgIter(rpmts ts, QVA_t qva, /*@null@*/ const char ** argv)
/*@globals rpmGlobalMacroContext, h_errno, /*@globals rpmGlobalMacroContext, h_errno,
fileSystem, internalState @*/ fileSystem, internalState @*/
/*@modifies ts, qva, rpmGlobalMacroContext, /*@modifies ts, qva, rpmGlobalMacroContext,
fileSystem, internalState @*/; fileSystem, internalState @*/;
/** \ingroup rpmcli /** \ingroup rpmcli
* Display package information. * Display package information.
* @todo hack: RPMQV_ALL can pass char ** arglist = NULL, not char * arg. U nion? * @todo hack: RPMQV_ALL can pass char ** arglist = NULL, not char * arg. U nion?
* @param ts transaction set * @param ts transaction set
* @param qva parsed query/verify options * @param qva parsed query/verify options
skipping to change at line 430 skipping to change at line 438
/*@-redecl@*/ /*@-redecl@*/
/*@unchecked@*/ /*@unchecked@*/
extern int rpmcliPackagesTotal; extern int rpmcliPackagesTotal;
/*@=redecl@*/ /*@=redecl@*/
/*@unchecked@*/ /*@unchecked@*/
extern int rpmcliHashesCurrent; extern int rpmcliHashesCurrent;
/*@unchecked@*/ /*@unchecked@*/
extern int rpmcliHashesTotal; extern int rpmcliHashesTotal;
/*@unchecked@*/ /*@unchecked@*/
extern uint64_t rpmcliProgressCurrent; extern rpmuint64_t rpmcliProgressCurrent;
/*@unchecked@*/ /*@unchecked@*/
extern uint64_t rpmcliProgressTotal; extern rpmuint64_t rpmcliProgressTotal;
/** \ingroup rpmcli /** \ingroup rpmcli
* The rpm CLI generic transaction callback handler. * The rpm CLI generic transaction callback handler.
* @todo Remove headerSprintf() from the progress callback. * @todo Remove headerSprintf() from the progress callback.
* @warning This function's args have changed, so the function cannot be * @warning This function's args have changed, so the function cannot be
* used portably * used portably
* @deprecated Transaction callback arguments need to change, so don't rely on * @deprecated Transaction callback arguments need to change, so don't rely on
* this routine in the rpmcli API. * this routine in the rpmcli API.
* *
* @param arg per-callback private data (e.g. an rpm header) * @param arg per-callback private data (e.g. an rpm header)
* @param what callback identifier * @param what callback identifier
* @param amount per-callback progress info * @param amount per-callback progress info
* @param total per-callback progress info * @param total per-callback progress info
* @param key opaque header key (e.g. file name or PyObject) * @param key opaque header key (e.g. file name or PyObject)
* @param data private data (e.g. rpmInstallInterfaceFlags) * @param data private data (e.g. rpmInstallInterfaceFlags)
* @return per-callback data (e.g. an opened FD_t) * @return per-callback data (e.g. an opened FD_t)
*/ */
/*@null@*/ /*@null@*/
void * rpmShowProgress(/*@null@*/ const void * arg, void * rpmShowProgress(/*@null@*/ const void * arg,
const rpmCallbackType what, const rpmCallbackType what,
const uint64_t amount, const rpmuint64_t amount,
const uint64_t total, const rpmuint64_t total,
/*@null@*/ fnpyKey key, /*@null@*/ fnpyKey key,
/*@null@*/ void * data) /*@null@*/ void * data)
/*@globals rpmcliHashesCurrent, /*@globals rpmcliHashesCurrent,
rpmcliProgressCurrent, rpmcliProgressTotal, rpmcliProgressCurrent, rpmcliProgressTotal,
h_errno, fileSystem, internalState @*/ h_errno, rpmGlobalMacroContext, fileSystem, internalState @*
/*@modifies rpmcliHashesCurrent, /
/*@modifies arg, rpmcliHashesCurrent,
rpmcliProgressCurrent, rpmcliProgressTotal, rpmcliProgressCurrent, rpmcliProgressTotal,
fileSystem, internalState @*/; rpmGlobalMacroContext, fileSystem, internalState @*/;
/** \ingroup rpmcli /** \ingroup rpmcli
* Install source rpm package. * Install source rpm package.
* @param ts transaction set * @param ts transaction set
* @param arg source rpm file name * @param arg source rpm file name
* @retval *specFilePtr (installed) spec file name * @retval *specFilePtr (installed) spec file name
* @retval *cookie * @retval *cookie
* @return 0 on success * @return 0 on success
*/ */
int rpmInstallSource(rpmts ts, const char * arg, int rpmInstallSource(rpmts ts, const char * arg,
skipping to change at line 555 skipping to change at line 563
* @param ts transaction set * @param ts transaction set
* @param ia control args/bits * @param ia control args/bits
* @param argv array of package names (NULL terminated) * @param argv array of package names (NULL terminated)
* @return 0 on success * @return 0 on success
*/ */
int rpmErase(rpmts ts, QVA_t ia, /*@null@*/ const char ** argv) int rpmErase(rpmts ts, QVA_t ia, /*@null@*/ const char ** argv)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies ts, ia, rpmGlobalMacroContext, /*@modifies ts, ia, rpmGlobalMacroContext,
fileSystem, internalState @*/; fileSystem, internalState @*/;
/**
* A rollback transaction id element.
*/
/*@-fielduse@*/
typedef /*@abstract@*/ struct IDT_s * IDT;
#if !defined(SWIG)
struct IDT_s {
int done; /*!< package processed? */
unsigned int instance; /*!< installed package transaction id. */
/*@owned@*/ /*@null@*/
const char * key; /*! removed package file name. */
Header h; /*!< removed package header. */
union {
uint32_t u32; /*!< install/remove transaction id */
} val;
};
#endif
/*@=fielduse@*/
/**
* A rollback transaction id index.
*/
typedef /*@abstract@*/ struct IDTindex_s * IDTX;
#if !defined(SWIG)
struct IDTindex_s {
int delta; /*!< no. elements to realloc as a chunk. */
int size; /*!< size of id index element. */
int alloced; /*!< current number of elements allocated. *
/
int nidt; /*!< current number of elements initialized.
*/
/*@only@*/ /*@null@*/
IDT idt; /*!< id index elements. */
};
#endif
/**
* Destroy id index.
* @param idtx id index
* @return NULL always
*/
/*@null@*/
IDTX IDTXfree(/*@only@*/ /*@null@*/ IDTX idtx)
/*@modifies idtx @*/;
/**
* Create id index.
* @return new id index
*/
/*@only@*/
IDTX IDTXnew(void)
/*@*/;
/**
* Insure that index has room for "need" elements.
* @param idtx id index
* @param need additional no. of elements needed
* @return id index (with room for "need" elements)
*/
/*@only@*/ /*@null@*/
IDTX IDTXgrow(/*@only@*/ /*@null@*/ IDTX idtx, int need)
/*@modifies idtx @*/;
/**
* Sort tag (instance,value) pairs.
* @param idtx id index
* @return id index
*/
/*@only@*/ /*@null@*/
IDTX IDTXsort(/*@only@*/ /*@null@*/ IDTX idtx)
/*@modifies idtx @*/;
/**
* Load tag (instance,value) pairs from rpm databse, and return sorted id i
ndex.
* @param ts transaction set
* @param tag rpm tag
* @param rbtid rollback goal
* @return id index
*/
/*@only@*/ /*@null@*/
IDTX IDTXload(rpmts ts, rpmTag tag, uint32_t rbtid)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState
@*/
/*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*
/;
/**
* Load tag (instance,value) pairs from packages, and return sorted id inde
x.
* @param ts transaction set
* @param globstr glob expression
* @param tag rpm tag
* @param rbtid rollback goal
* @return id index
*/
/*@only@*/ /*@null@*/
IDTX IDTXglob(rpmts ts, const char * globstr, rpmTag tag, uint32_t rbtid)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState
@*/
/*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/
;
/** \ingroup rpmcli
* Rollback transactions, erasing new, reinstalling old, package(s).
* @param ts transaction set
* @param ia mode flags and parameters
* @param argv array of arguments (NULL terminated)
* @return 0 on success
*/
int rpmRollback(rpmts ts, QVA_t ia, /*@null@*/ const char ** argv)
/*@globals rpmcliPackagesTotal, rpmGlobalMacroContext, h_errno,
fileSystem, internalState @*/
/*@modifies ts, ia, rpmcliPackagesTotal, rpmGlobalMacroContext,
fileSystem, internalState @*/;
/** \ingroup rpmcli /** \ingroup rpmcli
*/ */
/*@unchecked@*/ /*@unchecked@*/
extern struct poptOption rpmInstallPoptTable[]; extern struct poptOption rpmInstallPoptTable[];
/*@}*/ /*@}*/
/* ==================================================================== */ /* ==================================================================== */
/** \name RPMDB */ /** \name RPMDB */
/*@{*/ /*@{*/
skipping to change at line 744 skipping to change at line 644
/** \ingroup rpmcli /** \ingroup rpmcli
* Command line option information. * Command line option information.
*/ */
#if !defined(SWIG) #if !defined(SWIG)
struct rpmQVKArguments_s { struct rpmQVKArguments_s {
rpmQVSources qva_source; /*!< Identify CLI arg type. */ rpmQVSources qva_source; /*!< Identify CLI arg type. */
int qva_sourceCount;/*!< Exclusive option check (>1 is error). * / int qva_sourceCount;/*!< Exclusive option check (>1 is error). * /
rpmQueryFlags qva_flags; /*!< Bit(s) to control operation. */ rpmQueryFlags qva_flags; /*!< Bit(s) to control operation. */
rpmfileAttrs qva_fflags; /*!< Bit(s) to filter on attribute. */ rpmfileAttrs qva_fflags; /*!< Bit(s) to filter on attribute. */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
rpmdbMatchIterator qva_mi; /*!< Match iterator on selected headers. */ rpmmi qva_mi; /*!< Match iterator on selected headers. */
/*@refccounted@*/ /*@relnull@*/ /*@refccounted@*/ /*@relnull@*/
rpmgi qva_gi; /*!< Generalized iterator on args. */ rpmgi qva_gi; /*!< Generalized iterator on args. */
rpmRC qva_rc; /*!< Current return code. */ rpmRC qva_rc; /*!< Current return code. */
/*@null@*/ /*@null@*/
QVF_t qva_showPackage; /*!< Function to display iterator matches. * / QVF_t qva_showPackage; /*!< Function to display iterator matches. * /
int qva_showOK; /*!< No. of successes. */ int qva_showOK; /*!< No. of successes. */
int qva_showFAIL; /*!< No. of failures. */ int qva_showFAIL; /*!< No. of failures. */
/*@null@*/ /*@null@*/
QSpecF_t qva_specQuery; /*!< Function to query spec file. */ QSpecF_t qva_specQuery; /*!< Function to query spec file. */
skipping to change at line 782 skipping to change at line 682
- 'K' from --checksig, -K - 'K' from --checksig, -K
- 'R' from --resign - 'R' from --resign
*/ */
char qva_char; /*!< (unused) always ' ' */ char qva_char; /*!< (unused) always ' ' */
/* install/erase mode arguments */ /* install/erase mode arguments */
rpmdepFlags depFlags; rpmdepFlags depFlags;
rpmtransFlags transFlags; rpmtransFlags transFlags;
rpmprobFilterFlags probFilter; rpmprobFilterFlags probFilter;
rpmInstallInterfaceFlags installInterfaceFlags; rpmInstallInterfaceFlags installInterfaceFlags;
uint32_t arbtid; /*!< from --arbgoal */ rpmuint32_t arbtid; /*!< from --arbgoal */
uint32_t rbtid; /*!< from --rollback */ rpmuint32_t rbtid; /*!< from --rollback */
uint32_t *rbtidExcludes; /*!< from --rollback */ rpmuint32_t *rbtidExcludes; /*!< from --rollback */
int numrbtidExcludes; /*!< from --rollback */ int numrbtidExcludes; /*!< from --rollback */
int noDeps; int noDeps;
int incldocs; int incldocs;
int no_rollback_links; int no_rollback_links;
/*@owned@*/ /*@relnull@*/ /*@owned@*/ /*@relnull@*/
rpmRelocation relocations; rpmRelocation relocations;
int nrelocations; int nrelocations;
/* database mode arguments */ /* database mode arguments */
int init; /*!< from --initdb */ int init; /*!< from --initdb */
 End of changes. 11 change blocks. 
138 lines changed or deleted 31 lines changed or added


 rpmconstant.h   rpmconstant.h 
/* Nanar <nanardon@zarb.org> /* Nanar <nanardon@zarb.org>
* $Id: rpmconstant.h,v 1.5 2007/11/26 05:16:52 jbj Exp $ * $Id: rpmconstant.h,v 1.7 2008/07/31 00:21:42 jbj Exp $
*/ */
#ifndef H_RPMCONSTANT #ifndef H_RPMCONSTANT
#define H_RPMCONSTANT #define H_RPMCONSTANT
#define PREFIXED_YES 0 #define PREFIXED_YES 0
#define PREFIXED_NO 1 #define PREFIXED_NO 1
#define WITH_PREFIX (1 << 0) #define WITH_PREFIX (1 << 0)
#define WITHOUT_PREFIX (1 << 1) #define WITHOUT_PREFIX (1 << 1)
#define ALLCASE_PREFIX (WITH_PREFIX | WITHOUT_PREFIX) #define ALLCASE_PREFIX (WITH_PREFIX | WITHOUT_PREFIX)
/** /**
* \ingroup rpmconstant * \ingroup rpmconstant
* \file rpmconstant.h * \file rpmconstant.h
* *
*/ */
#include <rpmio.h> #include <rpmio.h>
#include <rpmcb.h> /* XXX fnpyKey */ #include <rpmiotypes.h> /* XXX fnpyKey */
#include <rpmpgp.h>
#include <rpmtypes.h>
#include <rpmtag.h>
#include <rpmdb.h> #include <rpmdb.h>
#include <rpmts.h> #include <rpmts.h>
#include <rpmte.h> #include <rpmte.h>
#include <rpmps.h> #include <rpmps.h>
#include <rpmds.h> #include <rpmds.h>
#include <rpmfi.h> #include <rpmfi.h>
#include <rpmpgp.h>
//#include <misc.h> //#include <misc.h>
#include <rpmbuild.h> #include <rpmbuild.h>
#include <rpmlib.h>
/** /**
* A constant pair name/value * A constant pair name/value
*/ */
typedef /*@abstract@*/ struct rpmconstant_s *rpmconstant; typedef /*@abstract@*/ struct rpmconstant_s *rpmconstant;
/** /**
* A constant list set * A constant list set
*/ */
typedef /*@abstract@*/ struct rpmconstantlist_s * rpmconstantlist; typedef /*@abstract@*/ struct rpmconstantlist_s * rpmconstantlist;
 End of changes. 5 change blocks. 
4 lines changed or deleted 7 lines changed or added


 rpmds.h   rpmds.h 
skipping to change at line 54 skipping to change at line 54
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. */
/*@only@*/ /*@relnull@*/ /*@only@*/ /*@relnull@*/
evrFlags * Flags; /*!< Bit(s) identifying context/comparison. */ evrFlags * Flags; /*!< Bit(s) identifying context/comparison. */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
uint32_t * Color; /*!< Bit(s) calculated from file color(s). * / rpmuint32_t * Color; /*!< Bit(s) calculated from file color(s). * /
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
uint32_t * Refs; /*!< No. of file refs. */ rpmuint32_t * Refs; /*!< No. of file refs. */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
int32_t * Result; /*!< Dependency check result. */ rpmint32_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. */ miRE exclude; /*!< Iterator exclude patterns. */
int nexclude; /*!< No. of exclude patterns. */ int nexclude; /*!< No. of exclude patterns. */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
miRE include; /*!< Iterator include patterns. */ miRE include; /*!< Iterator include patterns. */
int ninclude; /*!< No. of include patterns. */ int ninclude; /*!< No. of include patterns. */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
const char * A; /*!< Arch (from containing package). */ const char * A; /*!< Arch (from containing package). */
uint32_t BT; /*!< Package build time tie breaker. */ rpmuint32_t BT; /*!< Package build time tie breaker. */
rpmTag tagN; /*!< Header tag. */ rpmTag tagN; /*!< Header tag. */
uint32_t Count; /*!< No. of elements */ rpmuint32_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__) #if defined(__LCLINT__)
/*@refs@*/ /*@refs@*/
int nrefs; /*!< (unused) keep splint happy */ int nrefs; /*!< (unused) keep splint happy */
#endif #endif
}; };
#endif /* _RPMDS_INTERNAL */ #endif /* _RPMDS_INTERNAL */
skipping to change at line 167 skipping to change at line 168
((rpmds)rpmioLinkPoolItem((rpmioItem)(_ds), _msg, __FILE__, __LINE__)) ((rpmds)rpmioLinkPoolItem((rpmioItem)(_ds), _msg, __FILE__, __LINE__))
/** \ingroup rpmds /** \ingroup rpmds
* Destroy a dependency set. * Destroy a dependency set.
* @param ds dependency set * @param ds dependency set
* @return NULL on last dereference * @return NULL on last dereference
*/ */
/*@null@*/ /*@null@*/
rpmds rpmdsFree(/*@killref@*/ /*@null@*/ rpmds ds) rpmds rpmdsFree(/*@killref@*/ /*@null@*/ rpmds ds)
/*@modifies ds @*/; /*@modifies ds @*/;
#define rpmdsFree(_ds) \ #define rpmdsFree(_ds) \
((rpmds)rpmioFreePoolItem((rpmioItem)(_ds), __FUNCTION__, __FILE__, __L INE__)) ((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@*/
skipping to change at line 381 skipping to change at line 382
/*@null@*/ /*@null@*/
void * rpmdsSetEVRcmp(/*@null@*/ rpmds ds, void * rpmdsSetEVRcmp(/*@null@*/ rpmds ds,
/*@null@*/ int (*EVRcmp)(const char *a, const char *b)) /*@null@*/ int (*EVRcmp)(const char *a, const char *b))
/*@modifies ds @*/; /*@modifies ds @*/;
/** \ingroup rpmds /** \ingroup rpmds
* Return current dependency color. * Return current dependency color.
* @param ds dependency set * @param ds dependency set
* @return current dependency color (0 if not set) * @return current dependency color (0 if not set)
*/ */
uint32_t rpmdsColor(/*@null@*/ const rpmds ds) rpmuint32_t rpmdsColor(/*@null@*/ const rpmds ds)
/*@*/; /*@*/;
/** \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) rpmuint32_t rpmdsSetColor(/*@null@*/ const rpmds ds, rpmuint32_t color)
/*@modifies ds @*/; /*@modifies ds @*/;
/** \ingroup rpmds /** \ingroup rpmds
* Return dependency exclude patterns. * Return dependency exclude patterns.
* @param ds dependency set * @param ds dependency set
* @return dependency exclude patterns (NULL if not set) * @return dependency exclude patterns (NULL if not set)
*/ */
/*@null@*/ /*@null@*/
void * rpmdsExclude(/*@null@*/ const rpmds ds) void * rpmdsExclude(/*@null@*/ const rpmds ds)
/*@*/; /*@*/;
skipping to change at line 432 skipping to change at line 433
* @return dependency include patterns (0 if not set) * @return dependency include patterns (0 if not set)
*/ */
int rpmdsNInclude(/*@null@*/ const rpmds ds) int rpmdsNInclude(/*@null@*/ const rpmds ds)
/*@*/; /*@*/;
/** \ingroup rpmds /** \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) rpmuint32_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
* @param refs new dependency refs * @param refs new dependency refs
* @return previous dependency refs * @return previous dependency refs
*/ */
uint32_t rpmdsSetRefs(/*@null@*/ const rpmds ds, uint32_t refs) rpmuint32_t rpmdsSetRefs(/*@null@*/ const rpmds ds, rpmuint32_t refs)
/*@modifies ds @*/; /*@modifies ds @*/;
/** \ingroup rpmds /** \ingroup rpmds
* Return current dependency comparison result. * Return current dependency comparison result.
* @param ds dependency set * @param ds dependency set
* @return current dependency result (0 if not set) * @return current dependency result (0 if not set)
*/ */
int32_t rpmdsResult(/*@null@*/ const rpmds ds) rpmint32_t rpmdsResult(/*@null@*/ const rpmds ds)
/*@*/; /*@*/;
/** \ingroup rpmds /** \ingroup rpmds
* Set current dependency comparison result. * Set current dependency comparison result.
* @param ds dependency set * @param ds dependency set
* @param result new dependency result * @param result new dependency result
* @return previous dependency result * @return previous dependency result
*/ */
int32_t rpmdsSetResult(/*@null@*/ const rpmds ds, int32_t result) rpmint32_t rpmdsSetResult(/*@null@*/ const rpmds ds, rpmint32_t result)
/*@modifies ds @*/; /*@modifies ds @*/;
/** \ingroup rpmds /** \ingroup rpmds
* Notify of results of dependency match. * Notify of results of dependency match.
* @param ds dependency set * @param ds dependency set
* @param where where dependency was resolved (or NULL) * @param where where dependency was resolved (or NULL)
* @param rc 0 == YES, otherwise NO * @param rc 0 == YES, otherwise NO
*/ */
/*@-globuse@*/ /* FIX: rpmMessage annotation is a lie */ /*@-globuse@*/ /* FIX: rpmMessage annotation is a lie */
void rpmdsNotify(/*@null@*/ rpmds ds, /*@null@*/ const char * where, int rc ) void rpmdsNotify(/*@null@*/ rpmds ds, /*@null@*/ const char * where, int rc )
skipping to change at line 785 skipping to change at line 786
*/ */
/*@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) {
int32_t rc = rpmdsResult(ds); rpmint32_t rc = rpmdsResult(ds);
if (rc > 0) if (rc > 0)
continue; continue;
fprintf(fp, "%6d\t%s: %s\n", rpmdsIx(ds), rpmdsType(ds), rpmdsDNEVR (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
 End of changes. 13 change blocks. 
13 lines changed or deleted 13 lines changed or added


 rpmevr.h   rpmevr.h 
skipping to change at line 132 skipping to change at line 132
#define isInstallPreReq(_x) ((_x) & _INSTALL_ONLY_MASK) #define isInstallPreReq(_x) ((_x) & _INSTALL_ONLY_MASK)
#define isErasePreReq(_x) ((_x) & _ERASE_ONLY_MASK) #define isErasePreReq(_x) ((_x) & _ERASE_ONLY_MASK)
#endif /* _RPMEVR_INTERNAL */ #endif /* _RPMEVR_INTERNAL */
/** \ingroup rpmds /** \ingroup rpmds
* Create a new EVR container. * Create a new EVR container.
* @param Flags EVR inequality flags * @param Flags EVR inequality flags
* @param initialize Should empty defaults be initialized? * @param initialize Should empty defaults be initialized?
* @return initialized EVR container * @return initialized EVR container
*/ */
EVR_t rpmEVRnew(uint32_t Flags, int initialize) EVR_t rpmEVRnew(rpmuint32_t Flags, int initialize)
/*@*/; /*@*/;
/** \ingroup rpmtd /** \ingroup rpmtd
* Destroy an EVR container. * Destroy an EVR container.
* @param EVR container * @param EVR container
* @return NULL always * @return NULL always
*/ */
/*@null@*/ /*@null@*/
EVR_t rpmEVRfree(/*@only@*/ EVR_t evr) EVR_t rpmEVRfree(/*@only@*/ EVR_t evr)
/*@modifies evr @*/; /*@modifies evr @*/;
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 rpmio.h   rpmio.h 
skipping to change at line 17 skipping to change at line 17
*/ */
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <dirent.h> #include <dirent.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <rpmiotypes.h> #include <rpmiotypes.h>
#include <yarn.h>
#include <rpmzlog.h> #include <rpmzlog.h>
/** \ingroup rpmio /** \ingroup rpmio
* Hide libio API lossage. * Hide libio API lossage.
* The libio interface changed after glibc-2.1.3 to pass the seek offset * The libio interface changed after glibc-2.1.3 to pass the seek offset
* 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__) && \
skipping to change at line 108 skipping to change at line 107
/*@}*/ /*@}*/
/** \ingroup rpmio /** \ingroup rpmio
*/ */
struct FDIO_s { struct FDIO_s {
fdio_read_function_t read; fdio_read_function_t read;
fdio_write_function_t write; fdio_write_function_t write;
fdio_seek_function_t seek; fdio_seek_function_t seek;
fdio_close_function_t close; fdio_close_function_t close;
/*@null@*/
fdio_fopen_function_t _fopen; fdio_fopen_function_t _fopen;
/*@null@*/
fdio_fdopen_function_t _fdopen; fdio_fdopen_function_t _fdopen;
/*@null@*/ /*@null@*/
fdio_flush_function_t _flush; fdio_flush_function_t _flush;
}; };
/** \ingroup rpmio /** \ingroup rpmio
* \name RPMIO Interface. * \name RPMIO Interface.
*/ */
/*@{*/ /*@{*/
skipping to change at line 299 skipping to change at line 300
/** /**
* chown(2) clone. * chown(2) clone.
* @todo Implement remotely. * @todo Implement remotely.
*/ */
int Chown(const char * path, uid_t owner, gid_t group) int Chown(const char * path, uid_t owner, gid_t group)
/*@globals errno, fileSystem, internalState @*/ /*@globals errno, fileSystem, internalState @*/
/*@modifies errno, fileSystem, internalState @*/; /*@modifies errno, fileSystem, internalState @*/;
/** /**
* fchown(2) clone.
* @todo Implement remotely.
*/
int Fchown(FD_t fd, uid_t owner, gid_t group)
/*@globals errno, fileSystem, internalState @*/
/*@modifies errno, fileSystem, internalState @*/;
/**
* lchown(2) clone. * lchown(2) clone.
* @todo Implement remotely. * @todo Implement remotely.
*/ */
int Lchown(const char * path, uid_t owner, gid_t group) int Lchown(const char * path, uid_t owner, gid_t group)
/*@globals errno, fileSystem, internalState @*/ /*@globals errno, fileSystem, internalState @*/
/*@modifies errno, fileSystem, internalState @*/; /*@modifies errno, fileSystem, internalState @*/;
/** /**
* chmod(2) clone. * chmod(2) clone.
* @todo Implement remotely. * @todo Implement remotely.
*/ */
int Chmod(const char * path, mode_t mode) int Chmod(const char * path, mode_t mode)
/*@globals errno, fileSystem, internalState @*/ /*@globals errno, fileSystem, internalState @*/
/*@modifies errno, fileSystem, internalState @*/; /*@modifies errno, fileSystem, internalState @*/;
/** /**
* fchmod(2) clone.
* @todo Implement remotely.
*/
int Fchmod(FD_t fd, mode_t mode)
/*@globals errno, fileSystem, internalState @*/
/*@modifies errno, fileSystem, internalState @*/;
/**
* mkfifo(3) clone. * mkfifo(3) clone.
* @todo Implement remotely. * @todo Implement remotely.
*/ */
int Mkfifo(const char * path, mode_t mode) int Mkfifo(const char * path, mode_t mode)
/*@globals errno, fileSystem, internalState @*/ /*@globals errno, fileSystem, internalState @*/
/*@modifies errno, fileSystem, internalState @*/; /*@modifies errno, fileSystem, internalState @*/;
/** /**
* mknod(3) clone. * mknod(3) clone.
* @todo Implement remotely. * @todo Implement remotely.
skipping to change at line 362 skipping to change at line 379
/*@globals errno, fileSystem, internalState @*/ /*@globals errno, fileSystem, internalState @*/
/*@modifies errno, fileSystem, internalState @*/; /*@modifies errno, fileSystem, internalState @*/;
/** /**
* readlink(2) clone. * readlink(2) clone.
* @todo Implement remotely. * @todo Implement remotely.
*/ */
/*@-incondefs@*/ /*@-incondefs@*/
int Readlink(const char * path, /*@out@*/ char * buf, size_t bufsiz) int Readlink(const char * path, /*@out@*/ char * buf, size_t bufsiz)
/*@globals errno, h_errno, fileSystem, internalState @*/ /*@globals errno, h_errno, fileSystem, internalState @*/
/*@modifies *buf, errno, fileSystem, internalState @*/ /*@modifies *buf, errno, fileSystem, internalState @*/;
/*@requires maxSet(buf) >= (bufsiz - 1) @*/
/*@ensures maxRead(buf) <= bufsiz @*/;
/*@=incondefs@*/ /*@=incondefs@*/
/** /**
* access(2) clone. * access(2) clone.
* @todo Implement remotely. * @todo Implement remotely.
*/ */
int Access(const char * path, int amode) int Access(const char * path, int amode)
/*@globals errno, fileSystem @*/ /*@globals errno, fileSystem @*/
/*@modifies errno, fileSystem @*/; /*@modifies errno, fileSystem @*/;
skipping to change at line 454 skipping to change at line 469
/** /**
* closedir(3) clone. * closedir(3) clone.
*/ */
int Closedir(/*@only@*/ DIR * dir) int Closedir(/*@only@*/ DIR * dir)
/*@globals errno, fileSystem @*/ /*@globals errno, fileSystem @*/
/*@modifies *dir, errno, fileSystem @*/; /*@modifies *dir, errno, fileSystem @*/;
/** /**
* realpath(3) clone. * realpath(3) clone.
*/ */
/*@-globuse@*/
/*@null@*/
char * Realpath(const char * path, /*@out@*/ /*@null@*/ char * resolved_pat h) char * Realpath(const char * path, /*@out@*/ /*@null@*/ char * resolved_pat h)
/*@globals errno, fileSystem, internalState @*/ /*@globals errno, fileSystem, internalState @*/
/*@modifies *resolved_path, errno, fileSystem, internalState @*/; /*@modifies resolved_path, errno, fileSystem, internalState @*/;
/*@=globuse@*/
/** /**
* lseek(2) clone. * lseek(2) clone.
* @todo Implement SEEK_HOLE/SEEK_DATA. * @todo Implement SEEK_HOLE/SEEK_DATA.
*/ */
off_t Lseek(int fdno, off_t offset, int whence) off_t Lseek(int fdno, off_t offset, int whence)
/*@globals errno, fileSystem @*/ /*@globals errno, fileSystem @*/
/*@modifies errno, fileSystem @*/; /*@modifies errno, fileSystem @*/;
/*@}*/ /*@}*/
/** \ingroup rpmio /** \ingroup rpmio
* \name RPMIO Utilities. * \name RPMIO Utilities.
*/ */
/*@{*/ /*@{*/
/** /**
*/ */
off_t fdSize(FD_t fd)
/*@globals fileSystem @*/
/*@modifies fd, fileSystem@*/;
/**
*/
/*@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@*/
/** /**
*/ */
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 @*/;
skipping to change at line 696 skipping to change at line 708
*/ */
/*@observer@*/ /*@unchecked@*/ extern FDIO_t lzdio; /*@observer@*/ /*@unchecked@*/ extern FDIO_t lzdio;
/** /**
*/ */
/*@observer@*/ /*@unchecked@*/ extern FDIO_t xzdio; /*@observer@*/ /*@unchecked@*/ extern FDIO_t xzdio;
/*@=exportlocal@*/ /*@=exportlocal@*/
/*@}*/ /*@}*/
#include <rpmzlog.h>
/*@unchecked@*/ /*@only@*/ /*@null@*/ /*@unchecked@*/ /*@only@*/ /*@null@*/
extern rpmioPool _fdPool; extern rpmioPool _fdPool;
/** /**
* Free all memory allocated by rpmio usage. * Free all memory allocated by rpmio usage.
*/ */
void rpmioClean(void) void rpmioClean(void)
/*@globals _fdPool, fileSystem, internalState @*/ /*@globals _fdPool, fileSystem, internalState @*/
/*@modifies _fdPool, fileSystem, internalState @*/; /*@modifies _fdPool, fileSystem, internalState @*/;
 End of changes. 10 change blocks. 
13 lines changed or deleted 23 lines changed or added


 rpmiotypes.h   rpmiotypes.h 
skipping to change at line 19 skipping to change at line 19
* RPM return codes. * RPM return codes.
*/ */
typedef enum rpmRC_e { typedef enum rpmRC_e {
RPMRC_OK = 0, /*!< Generic success code */ RPMRC_OK = 0, /*!< Generic success code */
RPMRC_NOTFOUND = 1, /*!< Generic not found code. */ RPMRC_NOTFOUND = 1, /*!< Generic not found code. */
RPMRC_FAIL = 2, /*!< Generic failure code. */ RPMRC_FAIL = 2, /*!< Generic failure code. */
RPMRC_NOTTRUSTED = 3, /*!< Signature is OK, but key is not trusted . */ RPMRC_NOTTRUSTED = 3, /*!< Signature is OK, but key is not trusted . */
RPMRC_NOKEY = 4 /*!< Public key is unavailable. */ RPMRC_NOKEY = 4 /*!< Public key is unavailable. */
} rpmRC; } rpmRC;
/** \ingroup rpmio
* Private int typedefs to avoid C99 portability issues.
*/
typedef /*@unsignedintegraltype@*/ unsigned char rpmu
int8_t;
typedef /*@unsignedintegraltype@*/ unsigned short rpmuint16_t;
typedef /*@unsignedintegraltype@*/ unsigned int rpmuint32_t;
typedef /*@unsignedintegraltype@*/ unsigned long long rpmuint64_t;
/** \ingroup rpmio
*/
typedef /*@signedintegraltype@*/ int rpmint32_t;
/** /**
*/ */
typedef /*@refcounted@*/ struct rpmioItem_s * rpmioItem; typedef /*@refcounted@*/ struct rpmioItem_s * rpmioItem;
struct rpmioItem_s { struct rpmioItem_s {
/*@null@*/ /*@null@*/
void *use; /*!< use count -- return to pool when zero * / void *use; /*!< use count -- return to pool when zero * /
/*@kept@*/ /*@null@*/ /*@kept@*/ /*@null@*/
void *pool; /*!< pool (or NULL if malloc'd) */ void *pool; /*!< pool (or NULL if malloc'd) */
#if defined(__LCLINT__) #if defined(__LCLINT__)
/*@refs@*/ /*@refs@*/
skipping to change at line 63 skipping to change at line 75
/** \ingroup rpmpgp /** \ingroup rpmpgp
*/ */
typedef /*@abstract@*/ /*@refcounted@*/ struct pgpDig_s * pgpDig; typedef /*@abstract@*/ /*@refcounted@*/ struct pgpDig_s * pgpDig;
/** \ingroup rpmpgp /** \ingroup rpmpgp
*/ */
typedef /*@abstract@*/ struct pgpDigParams_s * pgpDigParams; typedef /*@abstract@*/ struct pgpDigParams_s * pgpDigParams;
/** \ingroup rpmpgp /** \ingroup rpmpgp
*/
typedef rpmuint8_t pgpKeyID_t[8];
/** \ingroup rpmpgp
*/
typedef rpmuint8_t pgpTime_t[4];
/** \ingroup rpmpgp
* Bit(s) to control digest and signature verification. * Bit(s) to control digest and signature verification.
*/ */
typedef enum pgpVSFlags_e { typedef enum pgpVSFlags_e {
RPMVSF_DEFAULT = 0, RPMVSF_DEFAULT = 0,
RPMVSF_NOHDRCHK = (1 << 0), RPMVSF_NOHDRCHK = (1 << 0),
RPMVSF_NEEDPAYLOAD = (1 << 1), RPMVSF_NEEDPAYLOAD = (1 << 1),
/* bit(s) 2-7 unused */ /* bit(s) 2-7 unused */
RPMVSF_NOSHA1HEADER = (1 << 8), RPMVSF_NOSHA1HEADER = (1 << 8),
RPMVSF_NOMD5HEADER = (1 << 9), /* unimplemented */ RPMVSF_NOMD5HEADER = (1 << 9), /* unimplemented */
RPMVSF_NODSAHEADER = (1 << 10), RPMVSF_NODSAHEADER = (1 << 10),
skipping to change at line 137 skipping to change at line 157
RPMCALLBACK_REPACKAGE_STOP = (1 << 12), RPMCALLBACK_REPACKAGE_STOP = (1 << 12),
RPMCALLBACK_UNPACK_ERROR = (1 << 13), RPMCALLBACK_UNPACK_ERROR = (1 << 13),
RPMCALLBACK_CPIO_ERROR = (1 << 14), RPMCALLBACK_CPIO_ERROR = (1 << 14),
RPMCALLBACK_SCRIPT_ERROR = (1 << 15) RPMCALLBACK_SCRIPT_ERROR = (1 << 15)
} rpmCallbackType; } rpmCallbackType;
/** /**
*/ */
typedef void * rpmCallbackData; typedef void * rpmCallbackData;
/** \ingroup rpmpgp
* 9.4. Hash Algorithms
*
\verbatim
ID Algorithm Text Name
-- --------- ---- ----
1 - MD5 "MD5"
2 - SHA-1 "SHA1"
3 - RIPE-MD/160 "RIPEMD160"
4 - Reserved for double-width SHA (experimental)
5 - MD2 "MD2"
6 - Reserved for TIGER/192 "TIGER192"
7 - Reserved for HAVAL (5 pass, 160-bit) "HAVAL-5-160"
100 to 110 - Private/Experimental algorithm.
\endverbatim
*
* Implementations MUST implement SHA-1. Implementations SHOULD
* implement MD5.
* @todo Add SHA256.
*/
typedef enum pgpHashAlgo_e {
PGPHASHALGO_ERROR = -1,
PGPHASHALGO_NONE = 0,
PGPHASHALGO_MD5 = 1, /*!< MD5 */
PGPHASHALGO_SHA1 = 2, /*!< SHA-1 */
PGPHASHALGO_RIPEMD160 = 3, /*!< RIPEMD-160 */
PGPHASHALGO_MD2 = 5, /*!< MD2 */
PGPHASHALGO_TIGER192 = 6, /*!< TIGER-192 */
PGPHASHALGO_HAVAL_5_160 = 7, /*!< HAVAL-5-160 */
PGPHASHALGO_SHA256 = 8, /*!< SHA-256 */
PGPHASHALGO_SHA384 = 9, /*!< SHA-384 */
PGPHASHALGO_SHA512 = 10, /*!< SHA-512 */
PGPHASHALGO_SHA224 = 11, /*!< SHA-224 */
PGPHASHALGO_MD4 = 104, /*!< (private) MD4 */
PGPHASHALGO_RIPEMD128 = 105, /*!< (private) RIPEMD-128 */
PGPHASHALGO_CRC32 = 106, /*!< (private) CRC-32 */
PGPHASHALGO_ADLER32 = 107, /*!< (private) ADLER-32 */
PGPHASHALGO_CRC64 = 108, /*!< (private) CRC-64 */
PGPHASHALGO_JLU32 = 109, /*!< (private) Jenkins lookup3.c */
PGPHASHALGO_RIPEMD256 = 111, /*!< (private) RIPEMD-256 */
PGPHASHALGO_RIPEMD320 = 112, /*!< (private) RIPEMD-320 */
PGPHASHALGO_SALSA10 = 113, /*!< (private) SALSA-10 */
PGPHASHALGO_SALSA20 = 114, /*!< (private) SALSA-20 */
} pgpHashAlgo;
/** \ingroup rpmpgp
* Bit(s) to control digest operation.
*/
typedef enum rpmDigestFlags_e {
RPMDIGEST_NONE = 0
} rpmDigestFlags;
#if defined(_RPMIOB_INTERNAL) #if defined(_RPMIOB_INTERNAL)
/** \ingroup rpmio /** \ingroup rpmio
*/ */
struct rpmiob_s{ struct rpmiob_s{
struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */ struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */
uint8_t * b; /*!< data octects. */ rpmuint8_t * b; /*!< data octects. */
size_t blen; /*!< no. of octets used. */ size_t blen; /*!< no. of octets used. */
size_t allocated; /*!< no. of octets allocated. */ size_t allocated; /*!< no. of octets allocated. */
#if defined(__LCLINT__) #if defined(__LCLINT__)
/*@refs@*/ /*@refs@*/
int nrefs; /*!< (unused) keep splint happy */ int nrefs; /*!< (unused) keep splint happy */
#endif #endif
}; };
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** \ingroup rpmpgp
* Return digest algorithm identifier.
* @param ctx digest context
* @return digest hash algorithm identifier
*/
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.
* @param octx existing digest context
* @return duplicated digest context
*/
/*@only@*/
DIGEST_CTX rpmDigestDup(DIGEST_CTX octx)
/*@*/;
/** \ingroup rpmpgp
* Initialize digest.
* Set bit count to 0 and buffer to mysterious initialization constants.
* @param hashalgo type of digest
* @param flags bit(s) to control digest operation
* @return digest context
*/
/*@only@*/ /*@null@*/
DIGEST_CTX rpmDigestInit(pgpHashAlgo hashalgo, rpmDigestFlags flags)
/*@*/;
/** \ingroup rpmpgp
* Update context with next plain text buffer.
* @param ctx digest context
* @param data next data buffer
* @param len no. bytes of data
* @return 0 on success
*/
int rpmDigestUpdate(/*@null@*/ DIGEST_CTX ctx, const void * data, size_t le
n)
/*@modifies ctx @*/;
/** \ingroup rpmpgp
* Return digest and destroy context.
* Final wrapup - pad to 64-byte boundary with the bit pattern
* 1 0* (64-bit count of bits processed, MSB-first)
*
* @param ctx digest context
* @retval *datap digest
* @retval *lenp no. bytes of digest
* @param asAscii return digest as ascii string?
* @return 0 on success
*/
int rpmDigestFinal(/*@only@*/ /*@null@*/ DIGEST_CTX ctx,
/*@null@*/ /*@out@*/ void * datap,
/*@null@*/ /*@out@*/ size_t * lenp, int asAscii)
/*@modifies *datap, *lenp @*/;
/** \ingroup rpmio /** \ingroup rpmio
*/ */
typedef void * (*rpmCallbackFunction) typedef void * (*rpmCallbackFunction)
(/*@null@*/ const void * h, (/*@null@*/ const void * h,
const rpmCallbackType what, const rpmCallbackType what,
const uint64_t amount, const rpmuint64_t amount,
const uint64_t total, const rpmuint64_t total,
/*@null@*/ fnpyKey key, /*@null@*/ fnpyKey key,
/*@null@*/ rpmCallbackData data) /*@null@*/ rpmCallbackData data)
/*@globals internalState@*/ /*@globals internalState@*/
/*@modifies internalState@*/; /*@modifies internalState@*/;
#if !defined(SWIG) #if !defined(SWIG)
/** \ingroup rpmio /** \ingroup rpmio
* Wrapper to free(3), hides const compilation noise, permit NULL, return N ULL. * Wrapper to free(3), hides const compilation noise, permit NULL, return N ULL.
* @param p memory to free * @param p memory to free
* @return NULL always * @return NULL always
skipping to change at line 325 skipping to change at line 473
* @return I/O buffer * @return I/O buffer
*/ */
rpmiob rpmiobAppend(/*@returned@*/ rpmiob iob, const char * s, size_t nl) rpmiob rpmiobAppend(/*@returned@*/ rpmiob iob, const char * s, size_t nl)
/*@modifies iob @*/; /*@modifies iob @*/;
/** /**
* Return I/O buffer. * Return I/O buffer.
* @param iob I/O buffer * @param iob I/O buffer
* @return I/O buffer (as string) * @return I/O buffer (as string)
*/ */
uint8_t * rpmiobBuf(rpmiob iob) rpmuint8_t * rpmiobBuf(rpmiob iob)
/*@*/; /*@*/;
/** /**
* Return I/O buffer (as string). * Return I/O buffer (as string).
* @param iob I/O buffer * @param iob I/O buffer
* @return I/O buffer (as string) * @return I/O buffer (as string)
*/ */
char * rpmiobStr(rpmiob iob) char * rpmiobStr(rpmiob iob)
/*@*/; /*@*/;
 End of changes. 7 change blocks. 
4 lines changed or deleted 154 lines changed or added


 rpmlog.h   rpmlog.h 
skipping to change at line 279 skipping to change at line 279
* Set the log mask level. * Set the log mask level.
* @param mask log mask (0 is no operation) * @param mask log mask (0 is no operation)
* @return previous log mask * @return previous log mask
*/ */
int rpmlogSetMask (int mask) int rpmlogSetMask (int mask)
/*@globals internalState@*/ /*@globals internalState@*/
/*@modifies internalState @*/; /*@modifies internalState @*/;
/** /**
* Generate a log message using FMT string and option arguments. * Generate a log message using FMT string and option arguments.
* Note: inline'd to avoid debugging insturmentation overhead.
*/ */
/*@mayexit@*/ /*@printflike@*/ void rpmlog (int code, const char *fmt, ...) /*@mayexit@*/ /*@printflike@*/
void _rpmlog (int code, const char *fmt, ...)
#if defined(__GNUC__) && __GNUC__ >= 2 #if defined(__GNUC__) && __GNUC__ >= 2
/* issue a warning if the format string doesn't match arguments */ /* issue a warning if the format string doesn't match arguments */
__attribute__((format (printf, 2, 3))) __attribute__((format (printf, 2, 3)))
#endif #endif
/*@*/; /*@*/;
/**
* Same as _rpmlog with stdarg argument list.
*/
void vrpmlog (unsigned code, const char * fmt, va_list ap)
/*@*/;
/*@mayexit@*/ /*@printflike@*/
static inline
void rpmlog (int code, const char *fmt, ...)
/*@*/
{
unsigned pri = RPMLOG_PRI(code);
unsigned mask = RPMLOG_MASK(pri);
if (mask & rpmlogSetMask(0)) {
va_list ap;
va_start(ap, fmt);
vrpmlog(code, fmt, ap);
va_end(ap);
}
}
/*@-exportlocal@*/ /*@-exportlocal@*/
/** /**
* Return text of last rpmError() message. * Return text of last rpmError() message.
* @return text of last message * @return text of last message
*/ */
/*@-redecl@*/ /*@-redecl@*/
/*@observer@*/ /*@null@*/ const char * rpmlogMessage(void) /*@observer@*/ /*@null@*/ const char * rpmlogMessage(void)
/*@*/; /*@*/;
/*@=redecl@*/ /*@=redecl@*/
 End of changes. 3 change blocks. 
1 lines changed or deleted 25 lines changed or added


 rpmmacro.h   rpmmacro.h 
skipping to change at line 237 skipping to change at line 237
*/ */
char * rpmExpand(/*@null@*/ const char * arg, ...) char * rpmExpand(/*@null@*/ const char * arg, ...)
#if defined(__GNUC__) && __GNUC__ >= 4 #if defined(__GNUC__) && __GNUC__ >= 4
/* issue a warning if the list is not NULL-terminated */ /* issue a warning if the list is not NULL-terminated */
__attribute__((sentinel)) __attribute__((sentinel))
#endif #endif
/*@globals rpmGlobalMacroContext, h_errno, internalState @*/ /*@globals rpmGlobalMacroContext, h_errno, internalState @*/
/*@modifies rpmGlobalMacroContext, internalState @*/; /*@modifies rpmGlobalMacroContext, internalState @*/;
/** /**
* Return (malloc'ed) concatenated macro expansion(s) in a context.
* @param mc macro context
* @param arg macro(s) to expand (NULL terminates list)
* @return macro expansion (malloc'ed)
*/
char * rpmMCExpand(/*@null@*/ MacroContext mc, /*@null@*/ const char * arg,
...)
#if defined(__GNUC__) && __GNUC__ >= 4
/* issue a warning if the list is not NULL-terminated */
__attribute__((sentinel))
#endif
/*@globals rpmGlobalMacroContext, h_errno, internalState @*/
/*@modifies rpmGlobalMacroContext, internalState @*/;
/**
* Canonicalize file path. * Canonicalize file path.
* @param path path to canonicalize (in-place) * @param path path to canonicalize (in-place)
* @return pointer to path * @return pointer to path
*/ */
/*@null@*/ /*@null@*/
char * rpmCleanPath(/*@returned@*/ /*@null@*/ char * path) char * rpmCleanPath(/*@returned@*/ /*@null@*/ char * path)
/*@modifies *path @*/; /*@modifies *path @*/;
/** /**
* Return (malloc'ed) expanded, canonicalized, file path. * Return (malloc'ed) expanded, canonicalized, file path.
 End of changes. 1 change blocks. 
0 lines changed or deleted 15 lines changed or added


 rpmpgp.h   rpmpgp.h 
skipping to change at line 28 skipping to change at line 28
#if defined(_RPMPGP_INTERNAL) #if defined(_RPMPGP_INTERNAL)
#include <rpmsw.h> #include <rpmsw.h>
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Values parsed from OpenPGP signature/pubkey packet(s). * Values parsed from OpenPGP signature/pubkey packet(s).
*/ */
struct pgpDigParams_s { struct pgpDigParams_s {
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
const char * userid; const char * userid;
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
const uint8_t * hash; const rpmuint8_t * hash;
const char * params[4]; const char * params[4];
uint8_t tag; rpmuint8_t tag;
uint8_t version; /*!< version number. */ rpmuint8_t version; /*!< version number. */
uint8_t time[4]; /*!< time that the key was created. */ rpmuint8_t time[4]; /*!< time that the key was created.
uint8_t pubkey_algo; /*!< public key algorithm. */ */
rpmuint8_t pubkey_algo; /*!< public key algorithm. */
uint8_t hash_algo; rpmuint8_t hash_algo;
uint8_t sigtype; rpmuint8_t sigtype;
size_t hashlen; size_t hashlen;
uint8_t signhash16[2]; rpmuint8_t signhash16[2];
uint8_t signid[8]; rpmuint8_t signid[8];
uint8_t saved; rpmuint8_t saved;
#define PGPDIG_SAVED_TIME (1 << 0) #define PGPDIG_SAVED_TIME (1 << 0)
#define PGPDIG_SAVED_ID (1 << 1) #define PGPDIG_SAVED_ID (1 << 1)
}; };
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Container for values parsed from an OpenPGP signature and public key. * Container for values parsed from an OpenPGP signature and public key.
*/ */
struct pgpDig_s { struct pgpDig_s {
struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */ 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. */ rpmuint32_t sigtag; /*!< Package signature tag. */
uint32_t sigtype; /*!< Package signature data type. */ rpmuint32_t sigtype; /*!< Package signature data type. */
/*@relnull@*/ /*@relnull@*/
const void * sig; /*!< Package signature. */ const void * sig; /*!< Package signature. */
uint32_t siglen; /*!< Package signature length. */ rpmuint32_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. */
uint8_t ** ppkts; rpmuint8_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. */
skipping to change at line 179 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). rpmuint8_t version; /*!< version number (generate 3, acc
*/ ept 2). */
uint8_t keyid[8]; /*!< key ID of the public key for session. */ rpmuint8_t keyid[8]; /*!< key ID of the public key for session. *
uint8_t algo; /*!< public key algorithm used. */ /
rpmuint8_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 339 skipping to change at line 339
} pgpCompressAlgo; } pgpCompressAlgo;
/*@=typeuse@*/ /*@=typeuse@*/
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Compression (string, value) pairs. * Compression (string, value) pairs.
*/ */
/*@observer@*/ /*@unchecked@*/ /*@unused@*/ /*@observer@*/ /*@unchecked@*/ /*@unused@*/
extern struct pgpValTbl_s pgpCompressionTbl[]; extern struct pgpValTbl_s pgpCompressionTbl[];
/** \ingroup rpmpgp /** \ingroup rpmpgp
* 9.4. Hash Algorithms
*
\verbatim
ID Algorithm Text Name
-- --------- ---- ----
1 - MD5 "MD5"
2 - SHA-1 "SHA1"
3 - RIPE-MD/160 "RIPEMD160"
4 - Reserved for double-width SHA (experimental)
5 - MD2 "MD2"
6 - Reserved for TIGER/192 "TIGER192"
7 - Reserved for HAVAL (5 pass, 160-bit) "HAVAL-5-160"
100 to 110 - Private/Experimental algorithm.
\endverbatim
*
* Implementations MUST implement SHA-1. Implementations SHOULD
* implement MD5.
* @todo Add SHA256.
*/
typedef enum pgpHashAlgo_e {
PGPHASHALGO_ERROR = -1,
PGPHASHALGO_NONE = 0,
PGPHASHALGO_MD5 = 1, /*!< MD5 */
PGPHASHALGO_SHA1 = 2, /*!< SHA-1 */
PGPHASHALGO_RIPEMD160 = 3, /*!< RIPEMD-160 */
PGPHASHALGO_MD2 = 5, /*!< MD2 */
PGPHASHALGO_TIGER192 = 6, /*!< TIGER-192 */
PGPHASHALGO_HAVAL_5_160 = 7, /*!< HAVAL-5-160 */
PGPHASHALGO_SHA256 = 8, /*!< SHA-256 */
PGPHASHALGO_SHA384 = 9, /*!< SHA-384 */
PGPHASHALGO_SHA512 = 10, /*!< SHA-512 */
PGPHASHALGO_SHA224 = 11, /*!< SHA-224 */
PGPHASHALGO_MD4 = 104, /*!< (private) MD4 */
PGPHASHALGO_RIPEMD128 = 105, /*!< (private) RIPEMD-128 */
PGPHASHALGO_CRC32 = 106, /*!< (private) CRC-32 */
PGPHASHALGO_ADLER32 = 107, /*!< (private) ADLER-32 */
PGPHASHALGO_CRC64 = 108, /*!< (private) CRC-64 */
PGPHASHALGO_JLU32 = 109, /*!< (private) Jenkins lookup3.c */
PGPHASHALGO_RIPEMD256 = 111, /*!< (private) RIPEMD-256 */
PGPHASHALGO_RIPEMD320 = 112, /*!< (private) RIPEMD-320 */
PGPHASHALGO_SALSA10 = 113, /*!< (private) SALSA-10 */
PGPHASHALGO_SALSA20 = 114, /*!< (private) SALSA-20 */
} pgpHashAlgo;
/** \ingroup rpmpgp
* Hash (string, value) pairs. * Hash (string, value) pairs.
*/ */
/*@observer@*/ /*@unchecked@*/ /*@unused@*/ /*@observer@*/ /*@unchecked@*/ /*@unused@*/
extern struct pgpValTbl_s pgpHashTbl[]; extern struct pgpValTbl_s pgpHashTbl[];
/** \ingroup rpmpgp /** \ingroup rpmpgp
* 5.2.2. Version 3 Signature Packet Format * 5.2.2. Version 3 Signature Packet Format
* *
* The body of a version 3 Signature Packet contains: * The body of a version 3 Signature Packet contains:
* - One-octet version number (3). * - One-octet version number (3).
skipping to change at line 414 skipping to change at line 366
* - One or more multi-precision integers comprising the signature. * - One or more multi-precision integers comprising the signature.
* *
* Algorithm Specific Fields for RSA signatures: * Algorithm Specific Fields for RSA signatures:
* - multiprecision integer (MPI) of RSA signature value m**d. * - multiprecision integer (MPI) of RSA signature value m**d.
* *
* 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). */ rpmuint8_t version; /*!< version number (3). */
uint8_t hashlen; /*!< length of following hashed material. MUST be 5. rpmuint8_t hashlen; /*!< length of following hashed material. MU
*/ ST be 5. */
uint8_t sigtype; /*!< signature type. */ rpmuint8_t sigtype; /*!< signature type. */
uint8_t time[4]; /*!< 4 byte creation time. */ rpmuint8_t time[4]; /*!< 4 byte creation time. */
uint8_t signid[8]; /*!< key ID of signer. */ rpmuint8_t signid[8]; /*!< key ID of signer. */
uint8_t pubkey_algo; /*!< public key algorithm. */ rpmuint8_t pubkey_algo; /*!< public key algorithm. */
uint8_t hash_algo; /*!< hash algorithm. */ rpmuint8_t hash_algo; /*!< hash algorithm. */
uint8_t signhash16[2]; /*!< left 16 bits of signed hash value. */ rpmuint8_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.
* - One-octet public key algorithm. * - One-octet public key algorithm.
* - One-octet hash algorithm. * - One-octet hash algorithm.
skipping to change at line 446 skipping to change at line 398
* - 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). */ rpmuint8_t version; /*!< version number (4). */
uint8_t sigtype; /*!< signature type. */ rpmuint8_t sigtype; /*!< signature type. */
uint8_t pubkey_algo; /*!< public key algorithm. */ rpmuint8_t pubkey_algo; /*!< public key algorithm. */
uint8_t hash_algo; /*!< hash algorithm. */ rpmuint8_t hash_algo; /*!< hash algorithm. */
uint8_t hashlen[2]; /*!< length of following hashed material. */ rpmuint8_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.
* *
* Each subpacket consists of a subpacket header and a body. The header * Each subpacket consists of a subpacket header and a body. The header
skipping to change at line 635 skipping to change at line 587
* The body of this packet consists of: * The body of this packet consists of:
* - A one-octet version number. The only currently defined version * - A one-octet version number. The only currently defined version
* is 4. * is 4.
* - A one-octet number describing the symmetric algorithm used. * - A one-octet number describing the symmetric algorithm used.
* - A string-to-key (S2K) specifier, length as defined above. * - A string-to-key (S2K) specifier, length as defined above.
* - Optionally, the encrypted session key itself, which is decrypted * - Optionally, the encrypted session key itself, which is decrypted
* with the string-to-key object. * with the string-to-key object.
* *
*/ */
typedef struct pgpPktSymkey_s { typedef struct pgpPktSymkey_s {
uint8_t version; /*!< version number (4). */ rpmuint8_t version; /*!< version number (4). */
uint8_t symkey_algo; rpmuint8_t symkey_algo;
uint8_t s2k[1]; rpmuint8_t s2k[1];
} pgpPktSymkey; } pgpPktSymkey;
/** \ingroup rpmpgp /** \ingroup rpmpgp
* 5.4. One-Pass Signature Packets (Tag 4) * 5.4. One-Pass Signature Packets (Tag 4)
* *
* The One-Pass Signature packet precedes the signed data and contains * The One-Pass Signature packet precedes the signed data and contains
* enough information to allow the receiver to begin calculating any * enough information to allow the receiver to begin calculating any
* hashes needed to verify the signature. It allows the Signature * hashes needed to verify the signature. It allows the Signature
* Packet to be placed at the end of the message, so that the signer can * Packet to be placed at the end of the message, so that the signer can
* compute the entire signed message in one pass. * compute the entire signed message in one pass.
skipping to change at line 670 skipping to change at line 622
* 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). */ rpmuint8_t version; /*!< version number (3). */
uint8_t sigtype; /*!< signature type. */ rpmuint8_t sigtype; /*!< signature type. */
uint8_t hash_algo; /*!< hash algorithm. */ rpmuint8_t hash_algo; /*!< hash algorithm. */
uint8_t pubkey_algo; /*!< public key algorithm. */ rpmuint8_t pubkey_algo; /*!< public key algorithm. */
uint8_t signid[8]; /*!< key ID of signer. */ rpmuint8_t signid[8]; /*!< key ID of signer. */
uint8_t nested; rpmuint8_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
* key (sometimes called an OpenPGP certificate). * key (sometimes called an OpenPGP certificate).
* *
skipping to change at line 751 skipping to change at line 703
* 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). */ rpmuint8_t version; /*!< version number (3). */
uint8_t time[4]; /*!< time that the key was created. */ rpmuint8_t time[4]; /*!< time that the key was created.
uint8_t valid[2]; /*!< time in days that this key is valid. */ */
uint8_t pubkey_algo; /*!< public key algorithm. */ rpmuint8_t valid[2]; /*!< time in days that this key is valid. */
rpmuint8_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 789 skipping to change at line 741
* - 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). */ rpmuint8_t version; /*!< version number (4). */
uint8_t time[4]; /*!< time that the key was created. */ rpmuint8_t time[4]; /*!< time that the key was created.
uint8_t pubkey_algo; /*!< public key algorithm. */ */
rpmuint8_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 888 skipping to change at line 840
* *
* ZIP-compressed packets are compressed with raw RFC 1951 DEFLATE * ZIP-compressed packets are compressed with raw RFC 1951 DEFLATE
* blocks. Note that PGP V2.6 uses 13 bits of compression. If an * blocks. Note that PGP V2.6 uses 13 bits of compression. If an
* implementation uses more bits of compression, PGP V2.6 cannot * implementation uses more bits of compression, PGP V2.6 cannot
* decompress it. * decompress it.
* *
* ZLIB-compressed packets are compressed with RFC 1950 ZLIB-style * ZLIB-compressed packets are compressed with RFC 1950 ZLIB-style
* blocks. * blocks.
*/ */
typedef struct pgpPktCdata_s { typedef struct pgpPktCdata_s {
uint8_t compressalgo; rpmuint8_t compressalgo;
uint8_t data[1]; rpmuint8_t data[1];
} pgpPktCdata; } pgpPktCdata;
/** \ingroup rpmpgp /** \ingroup rpmpgp
* 5.7. Symmetrically Encrypted Data Packet (Tag 9) * 5.7. Symmetrically Encrypted Data Packet (Tag 9)
* *
* The Symmetrically Encrypted Data packet contains data encrypted with * The Symmetrically Encrypted Data packet contains data encrypted with
* a symmetric-key algorithm. When it has been decrypted, it will * a symmetric-key algorithm. When it has been decrypted, it will
* typically contain other packets (often literal data packets or * typically contain other packets (often literal data packets or
* compressed data packets). * compressed data packets).
* *
skipping to change at line 927 skipping to change at line 879
* respectively. After encrypting the first 10 octets, the CFB state is * respectively. After encrypting the first 10 octets, the CFB state is
* resynchronized if the cipher block size is 8 octets or less. The * resynchronized if the cipher block size is 8 octets or less. The
* last 8 octets of ciphertext are passed through the cipher and the * last 8 octets of ciphertext are passed through the cipher and the
* block boundary is reset. * block boundary is reset.
* *
* The repetition of 16 bits in the 80 bits of random data prefixed to * The repetition of 16 bits in the 80 bits of random data prefixed to
* the message allows the receiver to immediately check whether the * the message allows the receiver to immediately check whether the
* session key is incorrect. * session key is incorrect.
*/ */
typedef struct pgpPktEdata_s { typedef struct pgpPktEdata_s {
uint8_t data[1]; rpmuint8_t data[1];
} pgpPktEdata; } pgpPktEdata;
/** \ingroup rpmpgp /** \ingroup rpmpgp
* 5.8. Marker Packet (Obsolete Literal Packet) (Tag 10) * 5.8. Marker Packet (Obsolete Literal Packet) (Tag 10)
* *
* An experimental version of PGP used this packet as the Literal * An experimental version of PGP used this packet as the Literal
* packet, but no released version of PGP generated Literal packets with * packet, but no released version of PGP generated Literal packets with
* this tag. With PGP 5.x, this packet has been re-assigned and is * this tag. With PGP 5.x, this packet has been re-assigned and is
* reserved for use as the Marker packet. * reserved for use as the Marker packet.
* *
skipping to change at line 978 skipping to change at line 930
* - A four-octet number that indicates the modification date of the * - A four-octet number that indicates the modification date of the
* file, or the creation time of the packet, or a zero that * file, or the creation time of the packet, or a zero that
* indicates the present time. * indicates the present time.
* - The remainder of the packet is literal data. * - The remainder of the packet is literal data.
* *
* Text data is stored with <CR><LF> text endings (i.e. network-normal * Text data is stored with <CR><LF> text endings (i.e. network-normal
* line endings). These should be converted to native line endings by * line endings). These should be converted to native line endings by
* the receiving software. * the receiving software.
*/ */
typedef struct pgpPktLdata_s { typedef struct pgpPktLdata_s {
uint8_t format; rpmuint8_t format;
uint8_t filenamelen; rpmuint8_t filenamelen;
uint8_t filename[1]; rpmuint8_t filename[1];
} pgpPktLdata; } pgpPktLdata;
/** \ingroup rpmpgp /** \ingroup rpmpgp
* 5.10. Trust Packet (Tag 12) * 5.10. Trust Packet (Tag 12)
* *
* The Trust packet is used only within keyrings and is not normally * The Trust packet is used only within keyrings and is not normally
* exported. Trust packets contain data that record the user's * exported. Trust packets contain data that record the user's
* specifications of which key holders are trustworthy introducers, * specifications of which key holders are trustworthy introducers,
* along with other information that implementing software uses for * along with other information that implementing software uses for
* trust information. * trust information.
* *
* Trust packets SHOULD NOT be emitted to output streams that are * Trust packets SHOULD NOT be emitted to output streams that are
* transferred to other users, and they SHOULD be ignored on any input * transferred to other users, and they SHOULD be ignored on any input
* other than local keyring files. * other than local keyring files.
*/ */
typedef struct pgpPktTrust_s { typedef struct pgpPktTrust_s {
uint8_t flag; rpmuint8_t flag;
} pgpPktTrust; } pgpPktTrust;
/** \ingroup rpmpgp /** \ingroup rpmpgp
* 5.11. User ID Packet (Tag 13) * 5.11. User ID Packet (Tag 13)
* *
* A User ID packet consists of data that is intended to represent the * A User ID packet consists of data that is intended to represent the
* name and email address of the key holder. By convention, it includes * name and email address of the key holder. By convention, it includes
* an RFC 822 mail name, but there are no restrictions on its content. * an RFC 822 mail name, but there are no restrictions on its content.
* The packet length in the header specifies the length of the user id. * The packet length in the header specifies the length of the user id.
* If it is text, it is encoded in UTF-8. * If it is text, it is encoded in UTF-8.
* *
*/ */
typedef struct pgpPktUid_s { typedef struct pgpPktUid_s {
uint8_t userid[1]; rpmuint8_t userid[1];
} pgpPktUid; } pgpPktUid;
/** \ingroup rpmpgp /** \ingroup rpmpgp
*/ */
union pgpPktPre_u { union pgpPktPre_u {
pgpPktPubkey pubkey; /*!< 5.1. Public-Key Encrypted Session Key * / pgpPktPubkey pubkey; /*!< 5.1. Public-Key Encrypted Session Key * /
pgpPktSig sig; /*!< 5.2. Signature */ pgpPktSig sig; /*!< 5.2. Signature */
pgpPktSymkey symkey; /*!< 5.3. Symmetric-Key Encrypted Session-Ke y */ pgpPktSymkey symkey; /*!< 5.3. Symmetric-Key Encrypted Session-Ke y */
pgpPktOnepass onepass; /*!< 5.4. One-Pass Signature */ pgpPktOnepass onepass; /*!< 5.4. One-Pass Signature */
pgpPktKey key; /*!< 5.5. Key Material */ pgpPktKey key; /*!< 5.5. Key Material */
skipping to change at line 1077 skipping to change at line 1029
PGPARMORKEY_CHARSET = 5 /*!< Charset: */ PGPARMORKEY_CHARSET = 5 /*!< Charset: */
} pgpArmorKey; } pgpArmorKey;
/*@=typeuse@*/ /*@=typeuse@*/
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Armor key (string, value) pairs. * Armor key (string, value) pairs.
*/ */
/*@observer@*/ /*@unchecked@*/ /*@unused@*/ /*@observer@*/ /*@unchecked@*/ /*@unused@*/
extern struct pgpValTbl_s pgpArmorKeyTbl[]; extern struct pgpValTbl_s pgpArmorKeyTbl[];
/** \ingroup rpmpgp
* Bit(s) to control digest operation.
*/
typedef enum rpmDigestFlags_e {
RPMDIGEST_NONE = 0
} rpmDigestFlags;
/*@-fcnuse@*/ /*@-fcnuse@*/
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Return (native-endian) integer from big-endian representation. * Return (native-endian) integer from big-endian representation.
* @param s pointer to big-endian integer * @param s pointer to big-endian integer
* @param nbytes no. of bytes * @param nbytes no. of bytes
* @return native-endian integer * @return native-endian integer
*/ */
/*@unused@*/ static inline /*@unused@*/ static inline
unsigned int pgpGrab(const uint8_t * s, size_t nbytes) unsigned int pgpGrab(const rpmuint8_t * s, size_t nbytes)
/*@*/ /*@*/
{ {
unsigned int i = 0; unsigned int i = 0;
size_t nb = (nbytes <= sizeof(i) ? nbytes : sizeof(i)); size_t nb = (nbytes <= sizeof(i) ? nbytes : sizeof(i));
while (nb--) while (nb--)
i = (i << 8) | *s++; i = (i << 8) | *s++;
return i; return i;
} }
/** \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 rpmuint8_t * s, /*@out@*/ unsigned int * lenp)
/*@modifies *lenp @*/ /*@modifies *lenp @*/
{ {
if (*s < (uint8_t)192) { if (*s < (rpmuint8_t)192) {
*lenp = (unsigned int) *s++; *lenp = (unsigned int) *s++;
return 1; return 1;
} else if (*s < (uint8_t)255) { } else if (*s < (rpmuint8_t)255) {
*lenp = (unsigned int) ((((unsigned)s[0]) - 192) << 8) + (unsigned)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
* @return no. of bits * @return no. of bits
*/ */
/*@unused@*/ static inline /*@unused@*/ static inline
unsigned int pgpMpiBits(const uint8_t * p) unsigned int pgpMpiBits(const rpmuint8_t * p)
/*@requires maxRead(p) >= 1 @*/ /*@requires maxRead(p) >= 1 @*/
/*@*/ /*@*/
{ {
return (unsigned int) ((p[0] << 8) | p[1]); return (unsigned int) ((p[0] << 8) | p[1]);
} }
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Return no. of bytes in a multiprecision integer. * Return no. of bytes in a multiprecision integer.
* @param p pointer to multiprecision integer * @param p pointer to multiprecision integer
* @return no. of bytes * @return no. of bytes
*/ */
/*@unused@*/ static inline /*@unused@*/ static inline
unsigned int pgpMpiLen(const uint8_t * p) unsigned int pgpMpiLen(const rpmuint8_t * p)
/*@requires maxRead(p) >= 1 @*/ /*@requires maxRead(p) >= 1 @*/
/*@*/ /*@*/
{ {
return (2 + ((pgpMpiBits(p)+7)>>3)); return (2 + ((pgpMpiBits(p)+7)>>3));
} }
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Convert to hex. * Convert to hex.
* @param t target buffer (returned) * @param t target buffer (returned)
* @param s source bytes * @param s source bytes
* @param nbytes no. of bytes * @param nbytes no. of bytes
* @return target buffer * @return target buffer
*/ */
/*@unused@*/ static inline /*@unused@*/ static inline
char * pgpHexCvt(/*@returned@*/ char * t, const uint8_t * s, size_t nbytes) char * pgpHexCvt(/*@returned@*/ char * t, const rpmuint8_t * s, size_t nbyt es)
/*@modifies *t @*/ /*@modifies *t @*/
{ {
static char hex[] = "0123456789abcdef"; static char hex[] = "0123456789abcdef";
while (nbytes-- > 0) { while (nbytes-- > 0) {
unsigned int i; unsigned int i;
i = (unsigned int) *s++; i = (unsigned int) *s++;
*t++ = hex[ (i >> 4) & 0xf ]; *t++ = hex[ (i >> 4) & 0xf ];
*t++ = hex[ (i ) & 0xf ]; *t++ = hex[ (i ) & 0xf ];
} }
*t = '\0'; *t = '\0';
skipping to change at line 1184 skipping to change at line 1129
} }
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Return hex formatted representation of bytes. * Return hex formatted representation of bytes.
* @todo Remove static buffer. * @todo Remove static buffer.
* @param p bytes * @param p bytes
* @param plen no. of bytes * @param plen no. of bytes
* @return hex formatted string * @return hex formatted string
*/ */
/*@unused@*/ static inline /*@observer@*/ /*@unused@*/ static inline /*@observer@*/
char * pgpHexStr(const uint8_t * p, size_t plen) char * pgpHexStr(const rpmuint8_t * p, size_t plen)
/*@*/ /*@*/
{ {
static char prbuf[8*BUFSIZ]; /* XXX ick */ static char prbuf[8*BUFSIZ]; /* XXX ick */
char *t = prbuf; char *t = prbuf;
t = pgpHexCvt(t, p, plen); t = pgpHexCvt(t, p, plen);
return prbuf; return prbuf;
} }
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Return hex formatted representation of a multiprecision integer. * Return hex formatted representation of a multiprecision integer.
* @todo Remove static buffer. * @todo Remove static buffer.
* @param p bytes * @param p bytes
* @return hex formatted string * @return hex formatted string
*/ */
/*@unused@*/ static inline /*@observer@*/ /*@unused@*/ static inline /*@observer@*/
const char * pgpMpiStr(const uint8_t * p) const char * pgpMpiStr(const rpmuint8_t * p)
/*@requires maxRead(p) >= 3 @*/ /*@requires maxRead(p) >= 3 @*/
/*@*/ /*@*/
{ {
static char prbuf[8*BUFSIZ]; /* XXX ick */ static char prbuf[8*BUFSIZ]; /* XXX ick */
char *t = prbuf; char *t = prbuf;
sprintf(t, "[%4u]: ", pgpGrab(p, 2)); sprintf(t, "[%4u]: ", pgpGrab(p, 2));
t += strlen(t); t += strlen(t);
t = pgpHexCvt(t, p+2, pgpMpiLen(p)-2); t = pgpHexCvt(t, p+2, pgpMpiLen(p)-2);
return prbuf; return prbuf;
} }
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Return string representation of am OpenPGP value. * Return string representation of am OpenPGP value.
* @param vs table of (string,value) pairs * @param vs table of (string,value) pairs
* @param val byte value to lookup * @param val byte value to lookup
* @return string value of byte * @return string value of byte
*/ */
/*@unused@*/ static inline /*@observer@*/ /*@unused@*/ static inline /*@observer@*/
const char * pgpValStr(pgpValTbl vs, uint8_t val) const char * pgpValStr(pgpValTbl vs, rpmuint8_t val)
/*@*/ /*@*/
{ {
do { do {
if (vs->val == (int)val) if (vs->val == (int)val)
break; break;
} while ((++vs)->val != -1); } while ((++vs)->val != -1);
return vs->str; return vs->str;
} }
/** \ingroup rpmpgp /** \ingroup rpmpgp
skipping to change at line 1255 skipping to change at line 1200
return vs->val; return vs->val;
} }
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Print an OpenPGP value. * Print an OpenPGP value.
* @param pre output prefix * @param pre output prefix
* @param vs table of (string,value) pairs * @param vs table of (string,value) pairs
* @param val byte value to print * @param val byte value to print
*/ */
/*@-exportlocal@*/ /*@-exportlocal@*/
void pgpPrtVal(const char * pre, pgpValTbl vs, uint8_t val) void pgpPrtVal(const char * pre, pgpValTbl vs, rpmuint8_t val)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies fileSystem @*/; /*@modifies fileSystem @*/;
/*@=exportlocal@*/ /*@=exportlocal@*/
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Print/parse an OpenPGP subtype packet. * Print/parse an OpenPGP subtype packet.
* @param h packet * @param h packet
* @param hlen packet length (no. of bytes) * @param hlen packet length (no. of bytes)
* @param sigtype signature type * @param sigtype signature type
* @return 0 on success * @return 0 on success
*/ */
/*@-exportlocal@*/ /*@-exportlocal@*/
int pgpPrtSubType(const uint8_t * h, size_t hlen, pgpSigType sigtype) int pgpPrtSubType(const rpmuint8_t * h, size_t hlen, pgpSigType sigtype)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies fileSystem @*/; /*@modifies fileSystem @*/;
/*@=exportlocal@*/ /*@=exportlocal@*/
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Print/parse an OpenPGP signature packet. * Print/parse an OpenPGP signature packet.
* @param pp packet tag/ptr/len * @param pp packet tag/ptr/len
* @return 0 on success * @return 0 on success
*/ */
/*@-exportlocal@*/ /*@-exportlocal@*/
skipping to change at line 1324 skipping to change at line 1269
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Calculate OpenPGP public key fingerprint. * Calculate OpenPGP public key fingerprint.
* @todo V3 non-RSA public keys not implemented. * @todo V3 non-RSA public keys not implemented.
* @param pkt OpenPGP packet (i.e. PGPTAG_PUBLIC_KEY) * @param pkt OpenPGP packet (i.e. PGPTAG_PUBLIC_KEY)
* @param pktlen OpenPGP packet length (no. of bytes) * @param pktlen OpenPGP packet length (no. of bytes)
* @retval keyid publick key fingerprint * @retval keyid publick key fingerprint
* @return 0 on sucess, else -1 * @return 0 on sucess, else -1
*/ */
/*@-exportlocal@*/ /*@-exportlocal@*/
int pgpPubkeyFingerprint(const uint8_t * pkt, size_t pktlen, int pgpPubkeyFingerprint(const rpmuint8_t * pkt, size_t pktlen,
/*@out@*/ uint8_t * keyid) /*@out@*/ rpmuint8_t * keyid)
/*@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, int pgpExtractPubkeyFingerprint(const char * b64pkt,
/*@out@*/ uint8_t * keyid) /*@out@*/ rpmuint8_t * keyid)
/*@modifies *keyid @*/; /*@modifies *keyid @*/;
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Return lenth of a OpenPGP packet. * Return lenth of a OpenPGP packet.
* @param pkt OpenPGP packet (i.e. PGPTAG_PUBLIC_KEY) * @param pkt OpenPGP packet (i.e. PGPTAG_PUBLIC_KEY)
* @param pleft OpenPGP packet length (no. of bytes) * @param pleft OpenPGP packet length (no. of bytes)
* @retval pp packet tag/ptr/len * @retval pp packet tag/ptr/len
* @return packet length, <0 on error. * @return packet length, <0 on error.
*/ */
int pgpPktLen(const uint8_t * pkt, size_t pleft, /*@out@*/ pgpPkt pp) int pgpPktLen(const rpmuint8_t * pkt, size_t pleft, /*@out@*/ pgpPkt pp)
/*@modifies pp @*/; /*@modifies pp @*/;
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Print/parse next OpenPGP packet. * Print/parse next OpenPGP packet.
* @param pkt OpenPGP packet * @param pkt OpenPGP packet
* @param pleft no. bytes remaining * @param pleft no. bytes remaining
* @return -1 on error, otherwise this packet length * @return -1 on error, otherwise this packet length
*/ */
/*@-exportlocal@*/ /*@-exportlocal@*/
int pgpPrtPkt(const uint8_t * pkt, size_t pleft) int pgpPrtPkt(const rpmuint8_t * pkt, size_t pleft)
/*@globals fileSystem, internalState @*/ /*@globals fileSystem, internalState @*/
/*@modifies fileSystem, internalState @*/; /*@modifies fileSystem, internalState @*/;
/*@=exportlocal@*/ /*@=exportlocal@*/
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Print/parse a OpenPGP packet(s). * Print/parse a OpenPGP packet(s).
* @param pkts OpenPGP packet(s) * @param pkts OpenPGP packet(s)
* @param pktlen OpenPGP packet(s) length (no. of bytes) * @param pktlen OpenPGP packet(s) length (no. of bytes)
* @retval dig parsed output of signature/pubkey packet parameters * @retval dig parsed output of signature/pubkey packet parameters
* @param printing should packets be printed? * @param printing should packets be printed?
* @return -1 on error, 0 on success * @return -1 on error, 0 on success
*/ */
int pgpPrtPkts(const uint8_t * pkts, size_t pktlen, pgpDig dig, int printin g) int pgpPrtPkts(const rpmuint8_t * pkts, size_t pktlen, pgpDig dig, int prin ting)
/*@globals fileSystem, internalState @*/ /*@globals fileSystem, internalState @*/
/*@modifies dig, fileSystem, internalState @*/; /*@modifies dig, fileSystem, internalState @*/;
/** \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@*/ uint8_t ** pkt, /*@out@*/ size_t * pktlen) /*@out@*/ rpmuint8_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(uint8_t atype, const unsigned char * s, size_t ns) char * pgpArmorWrap(rpmuint8_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 1434 skipping to change at line 1379
/** \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) \ #define pgpDigLink(_dig, _msg) \
((pgpDig)rpmioLinkPoolItem((rpmioItem)(_dig), _msg, __FILE__, __LINE __)) ((pgpDig)rpmioLinkPoolItem((rpmioItem)(_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 on last dereference * @return NULL on last dereference
*/ */
/*@unused@*/ /*@null@*/ /*@unused@*/ /*@null@*/
pgpDig pgpDigFree(/*@killref@*/ /*@only@*/ /*@null@*/ pgpDig dig) pgpDig pgpDigFree(/*@killref@*/ /*@only@*/ /*@null@*/ pgpDig dig)
/*@modifies dig @*/; /*@modifies dig @*/;
#define pgpDigFree(_dig, _msg) \ #define pgpDigFree(_dig, _msg) \
skipping to change at line 1486 skipping to change at line 1431
*/ */
/*@exposed@*/ /*@exposed@*/
pgpDigParams pgpGetSignature(const pgpDig dig) pgpDigParams pgpGetSignature(const pgpDig dig)
/*@*/; /*@*/;
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Get signature tag. * Get signature tag.
* @param dig signature parameters container * @param dig signature parameters container
* @return signature tag * @return signature tag
*/ */
uint32_t pgpGetSigtag(const pgpDig dig) rpmuint32_t pgpGetSigtag(const pgpDig dig)
/*@*/; /*@*/;
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Get signature tag type. * Get signature tag type.
* @param dig signature parameters container * @param dig signature parameters container
* @return signature tag type * @return signature tag type
*/ */
uint32_t pgpGetSigtype(const pgpDig dig) rpmuint32_t pgpGetSigtype(const pgpDig dig)
/*@*/; /*@*/;
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Get signature tag data, i.e. from header. * Get signature tag data, i.e. from header.
* @param dig signature parameters container * @param dig signature parameters container
* @return signature tag data * @return signature tag data
*/ */
/*@observer@*/ /*@null@*/ /*@observer@*/ /*@null@*/
extern const void * pgpGetSig(const pgpDig dig) extern const void * pgpGetSig(const pgpDig dig)
/*@*/; /*@*/;
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Get signature tag data length, i.e. no. of bytes of data. * Get signature tag data length, i.e. no. of bytes of data.
* @param dig signature parameters container * @param dig signature parameters container
* @return signature tag data length * @return signature tag data length
*/ */
uint32_t pgpGetSiglen(const pgpDig dig) rpmuint32_t pgpGetSiglen(const pgpDig dig)
/*@*/; /*@*/;
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Set signature tag info, i.e. from header. * Set signature tag info, i.e. from header.
* @param dig signature parameters container * @param dig signature parameters container
* @param sigtag signature tag * @param sigtag signature tag
* @param sigtype signature tag type * @param sigtype signature tag type
* @param sig signature tag data * @param sig signature tag data
* @param siglen signature tag data length * @param siglen signature tag data length
* @return 0 always * @return 0 always
*/ */
int pgpSetSig(pgpDig dig, int pgpSetSig(pgpDig dig,
uint32_t sigtag, uint32_t sigtype, rpmuint32_t sigtag, rpmuint32_t sigtype,
/*@kept@*/ /*@null@*/ const void * sig, uint32_t siglen) /*@kept@*/ /*@null@*/ const void * sig, rpmuint32_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@*/ /*@null@*/
void * pgpStatsAccumulator(pgpDig dig, int opx) void * pgpStatsAccumulator(pgpDig dig, int opx)
skipping to change at line 1565 skipping to change at line 1510
int pgpFindPubkey(pgpDig dig) int pgpFindPubkey(pgpDig dig)
/*@modifies dig @*/; /*@modifies dig @*/;
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Is buffer at beginning of an OpenPGP packet? * Is buffer at beginning of an OpenPGP packet?
* @param p buffer * @param p buffer
* @retval *tagp OpenPGP tag * @retval *tagp OpenPGP tag
* @return 1 if an OpenPGP packet, 0 otherwise * @return 1 if an OpenPGP packet, 0 otherwise
*/ */
/*@unused@*/ static inline /*@unused@*/ static inline
int pgpIsPkt(const uint8_t * p, /*@null@*/ pgpTag * tagp) int pgpIsPkt(const rpmuint8_t * p, /*@null@*/ pgpTag * tagp)
/*@modifies *tagp @*/ /*@modifies *tagp @*/
{ {
unsigned int val = (unsigned int) *p++; unsigned int val = (unsigned int) *p++;
pgpTag tag; pgpTag tag;
int rc; int rc;
/* XXX can't deal with these. */ /* XXX can't deal with these. */
if (!(val & 0x80)) if (!(val & 0x80))
return 0; return 0;
skipping to change at line 1626 skipping to change at line 1571
#define CRC24_INIT 0xb704ce #define CRC24_INIT 0xb704ce
#define CRC24_POLY 0x1864cfb #define CRC24_POLY 0x1864cfb
/** \ingroup rpmpgp /** \ingroup rpmpgp
* Return CRC of a buffer. * Return CRC of a buffer.
* @param octets bytes * @param octets bytes
* @param len no. of bytes * @param len no. of bytes
* @return crc of buffer * @return crc of buffer
*/ */
/*@unused@*/ static inline /*@unused@*/ static inline
unsigned int pgpCRC(const uint8_t * octets, size_t len) unsigned int pgpCRC(const rpmuint8_t * octets, size_t len)
/*@*/ /*@*/
{ {
unsigned int crc = CRC24_INIT; unsigned int crc = CRC24_INIT;
int i; int i;
while (len--) { while (len--) {
crc ^= (*octets++) << 16; crc ^= (*octets++) << 16;
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
* 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.
* @param octx existing digest context
* @return duplicated digest context
*/
/*@only@*/
DIGEST_CTX rpmDigestDup(DIGEST_CTX octx)
/*@*/;
/** \ingroup rpmpgp
* Initialize digest.
* Set bit count to 0 and buffer to mysterious initialization constants.
* @param hashalgo type of digest
* @param flags bit(s) to control digest operation
* @return digest context
*/
/*@only@*/ /*@null@*/
DIGEST_CTX rpmDigestInit(pgpHashAlgo hashalgo, rpmDigestFlags flags)
/*@*/;
/** \ingroup rpmpgp
* Update context with next plain text buffer.
* @param ctx digest context
* @param data next data buffer
* @param len no. bytes of data
* @return 0 on success
*/
int rpmDigestUpdate(/*@null@*/ DIGEST_CTX ctx, const void * data, size_t le
n)
/*@modifies ctx @*/;
/** \ingroup rpmpgp
* Return digest and destroy context.
* Final wrapup - pad to 64-byte boundary with the bit pattern
* 1 0* (64-bit count of bits processed, MSB-first)
*
* @param ctx digest context
* @retval *datap digest
* @retval *lenp no. bytes of digest
* @param asAscii return digest as ascii string?
* @return 0 on success
*/
int rpmDigestFinal(/*@only@*/ /*@null@*/ DIGEST_CTX ctx,
/*@null@*/ /*@out@*/ void * datap,
/*@null@*/ /*@out@*/ size_t * lenp, int asAscii)
/*@modifies *datap, *lenp @*/;
/** /**
*/ */
typedef int (*pgpImplSet_t) (/*@only@*/ DIGEST_CTX ctx, pgpDig dig, pgpDigP arams sigp) typedef int (*pgpImplSet_t) (/*@only@*/ DIGEST_CTX ctx, pgpDig dig, pgpDigP arams sigp)
/*@modifies ctx, dig @*/; /*@modifies ctx, dig @*/;
/** /**
*/ */
typedef int (*pgpImplVerify_t) (pgpDig dig) typedef int (*pgpImplVerify_t) (pgpDig dig)
/*@*/; /*@*/;
/** /**
*/ */
typedef int (*pgpImplMpiItem_t) (const char * pre, pgpDig dig, int itemno, typedef int (*pgpImplMpiItem_t) (const char * pre, pgpDig dig, int itemno,
const uint8_t * p, /*@null@*/ const uint8_t * pend) const rpmuint8_t * p, /*@null@*/ const rpmuint8_t * pend)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies dig, fileSystem @*/; /*@modifies dig, fileSystem @*/;
/** /**
*/ */
typedef void (*pgpImplClean_t) (void * impl) typedef void (*pgpImplClean_t) (void * impl)
/*@modifies impl @*/; /*@modifies impl @*/;
/** /**
*/ */
skipping to change at line 1756 skipping to change at line 1627
typedef void * (*pgpImplInit_t) (void) typedef void * (*pgpImplInit_t) (void)
/*@*/; /*@*/;
/** /**
*/ */
typedef struct pgpImplVecs_s { typedef struct pgpImplVecs_s {
pgpImplSet_t _pgpSetRSA; pgpImplSet_t _pgpSetRSA;
pgpImplVerify_t _pgpVerifyRSA; pgpImplVerify_t _pgpVerifyRSA;
pgpImplSet_t _pgpSetDSA; pgpImplSet_t _pgpSetDSA;
pgpImplVerify_t _pgpVerifyDSA; pgpImplVerify_t _pgpVerifyDSA;
pgpImplSet_t _pgpSetECDSA;
pgpImplVerify_t _pgpVerifyECDSA;
pgpImplMpiItem_t _pgpMpiItem; pgpImplMpiItem_t _pgpMpiItem;
pgpImplClean_t _pgpClean; pgpImplClean_t _pgpClean;
pgpImplFree_t _pgpFree; pgpImplFree_t _pgpFree;
pgpImplInit_t _pgpInit; pgpImplInit_t _pgpInit;
} pgpImplVecs_t; } pgpImplVecs_t;
/** /**
*/ */
/*@unchecked@*/ /*@unchecked@*/
extern pgpImplVecs_t * pgpImplVecs; extern pgpImplVecs_t * pgpImplVecs;
skipping to change at line 1807 skipping to change at line 1680
/*@unused@*/ static inline /*@unused@*/ static inline
int pgpImplVerifyDSA(pgpDig dig) int pgpImplVerifyDSA(pgpDig dig)
/*@*/ /*@*/
{ {
return (*pgpImplVecs->_pgpVerifyDSA) (dig); return (*pgpImplVecs->_pgpVerifyDSA) (dig);
} }
/** /**
*/ */
/*@unused@*/ static inline /*@unused@*/ static inline
int pgpImplSetECDSA(/*@only@*/ DIGEST_CTX ctx, pgpDig dig, pgpDigParams sig
p)
/*@modifies ctx, dig @*/
{
return (*pgpImplVecs->_pgpSetECDSA) (ctx, dig, sigp);
}
/**
*/
/*@unused@*/ static inline
int pgpImplVerifyECDSA(pgpDig dig)
/*@*/
{
return (*pgpImplVecs->_pgpVerifyECDSA) (dig);
}
/**
*/
/*@unused@*/ static inline
int pgpImplMpiItem(const char * pre, pgpDig dig, int itemno, int pgpImplMpiItem(const char * pre, pgpDig dig, int itemno,
const uint8_t * p, /*@null@*/ const uint8_t * pend) const rpmuint8_t * p, /*@null@*/ const rpmuint8_t * pend)
/*@modifies dig @*/ /*@modifies dig @*/
{ {
return (*pgpImplVecs->_pgpMpiItem) (pre, dig, itemno, p, pend); return (*pgpImplVecs->_pgpMpiItem) (pre, dig, itemno, p, pend);
} }
/** /**
*/ */
/*@unused@*/ static inline /*@unused@*/ static inline
void pgpImplClean(void * impl) void pgpImplClean(void * impl)
/*@modifies impl @*/ /*@modifies impl @*/
 End of changes. 53 change blocks. 
216 lines changed or deleted 111 lines changed or added


 rpmps.h   rpmps.h 
skipping to change at line 166 skipping to change at line 166
* @return problem set iterator * @return problem set iterator
*/ */
rpmpsi rpmpsInitIterator(rpmps ps) rpmpsi rpmpsInitIterator(rpmps ps)
/*@modifies 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(/*@only@*/ rpmpsi psi)
/*@modifies 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 @*/; /*@modifies psi @*/;
skipping to change at line 229 skipping to change at line 229
* @param dn directory name * @param dn directory name
* @param bn file base name * @param bn file base name
* @param altNEVR related (e.g. through a dependency) package name * @param altNEVR related (e.g. through a dependency) package name
* @param ulong1 generic pointer/long attribute * @param ulong1 generic pointer/long attribute
*/ */
void rpmpsAppend(/*@null@*/ rpmps ps, rpmProblemType type, void rpmpsAppend(/*@null@*/ rpmps ps, rpmProblemType type,
/*@null@*/ const char * pkgNEVR, /*@null@*/ const char * pkgNEVR,
/*@exposed@*/ /*@null@*/ fnpyKey key, /*@exposed@*/ /*@null@*/ fnpyKey key,
/*@null@*/ const char * dn, /*@null@*/ const char * bn, /*@null@*/ const char * dn, /*@null@*/ const char * bn,
/*@null@*/ const char * altNEVR, /*@null@*/ const char * altNEVR,
uint64_t ulong1) rpmuint64_t ulong1)
/*@modifies ps @*/; /*@modifies ps @*/;
/** /**
* Filter a problem set. * Filter a problem set.
* *
* As the problem sets are generated in an order solely dependent * As the problem sets are generated in an order solely dependent
* on the ordering of the packages in the transaction, and that * on the ordering of the packages in the transaction, and that
* ordering can't be changed, the problem sets must be parallel to * ordering can't be changed, the problem sets must be parallel to
* one another. Additionally, the filter set must be a subset of the * one another. Additionally, the filter set must be a subset of the
* target set, given the operations available on transaction set. * target set, given the operations available on transaction set.
skipping to change at line 295 skipping to change at line 295
* @todo needs a better name * @todo needs a better name
*/ */
/*@null@*/ /*@exposed@*/ /*@null@*/ /*@exposed@*/
char * rpmProblemGetStr(rpmProblem prob) char * rpmProblemGetStr(rpmProblem prob)
/*@*/; /*@*/;
/** /**
* Return generic pointer/long attribute from a problem * Return generic pointer/long attribute from a problem
* @param prob rpm problem * @param prob rpm problem
* @return a generic pointer/long attribute * @return a generic pointer/long attribute
* @todo needs a better name
*/ */
uint64_t rpmProblemGetLong(rpmProblem prob) rpmuint64_t rpmProblemGetDiskNeed(rpmProblem prob)
/*@*/; /*@*/;
/** /**
* Return the problem type * Return the problem type
* *
* @param prob rpm problem * @param prob rpm problem
* @return rpmProblemType * @return rpmProblemType
*/ */
rpmProblemType rpmProblemGetType(rpmProblem prob) rpmProblemType rpmProblemGetType(rpmProblem prob)
/*@*/; /*@*/;
 End of changes. 4 change blocks. 
4 lines changed or deleted 3 lines changed or added


 rpmspec.h   rpmspec.h 
skipping to change at line 43 skipping to change at line 43
#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@*/ /*@relnull@*/ /*@dependent@*/ /*@relnull@*/
const char * source; /* Pointer into fullSource */ const char * source; /* Pointer into fullSource */
int flags; int flags;
uint32_t num; rpmuint32_t num;
/*@owned@*/ /*@owned@*/
struct Source * next; struct Source * next;
}; };
/** \ingroup rpmbuild /** \ingroup rpmbuild
*/ */
/*@-typeuse@*/ /*@-typeuse@*/
typedef struct ReadLevelEntry { typedef struct ReadLevelEntry {
int reading; int reading;
/*@dependent@*/ /*@dependent@*/
skipping to change at line 172 skipping to change at line 172
/*@refcounted@*/ /*@refcounted@*/
Header sourceHeader; Header sourceHeader;
/*@refcounted@*/ /*@refcounted@*/
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); rpmuint32_t index, rpmsenseFlags tagflags);
/*@only@*/ /*@only@*/
rpmiob prep; /*!< %prep scriptlet. */ rpmiob prep; /*!< %prep scriptlet. */
/*@only@*/ /*@only@*/
rpmiob build; /*!< %build scriptlet. */ rpmiob build; /*!< %build scriptlet. */
/*@only@*/ /*@only@*/
rpmiob install; /*!< %install scriptlet. */ rpmiob install; /*!< %install scriptlet. */
/*@only@*/ /*@only@*/
rpmiob check; /*!< %check scriptlet. */ rpmiob check; /*!< %check scriptlet. */
/*@only@*/ /*@only@*/
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 rpmtag.h   rpmtag.h 
skipping to change at line 54 skipping to change at line 54
/** \ingroup header /** \ingroup header
*/ */
typedef enum rpmTagType_e rpmTagType; /*!< tag data type. */ typedef enum rpmTagType_e rpmTagType; /*!< tag data type. */
/** \ingroup header /** \ingroup header
*/ */
typedef union rpmDataType_u rpmTagData; /*!< tag data. */ typedef union rpmDataType_u rpmTagData; /*!< tag data. */
/** \ingroup header /** \ingroup header
*/ */
typedef uint32_t rpmTagCount; /*!< tag data element count. */ typedef rpmuint32_t rpmTagCount; /*!< tag data element count. */
/** \ingroup header /** \ingroup header
*/ */
typedef struct _HE_s * HE_t; /*!< tag container. */ typedef struct _HE_s * HE_t; /*!< tag container. */
/** \ingroup header /** \ingroup header
*/ */
/*@-typeuse -fielduse@*/ /*@-typeuse -fielduse@*/
#if !defined(SWIG) #if !defined(SWIG)
union rpmDataType_u { union rpmDataType_u {
/*@null@*/ /*@null@*/
void * ptr; void * ptr;
uint8_t * ui8p; /*!< RPM_UINT8_TYPE | RPM_CHAR_TYPE */ rpmuint8_t * ui8p; /*!< RPM_UINT8_TYPE | RPM_CHAR_TYPE */
uint16_t * ui16p; /*!< RPM_UINT16_TYPE */ rpmuint16_t * ui16p; /*!< RPM_UINT16_TYPE */
uint32_t * ui32p; /*!< RPM_UINT32_TYPE */ rpmuint32_t * ui32p; /*!< RPM_UINT32_TYPE */
uint64_t * ui64p; /*!< RPM_UINT64_TYPE */ rpmuint64_t * ui64p; /*!< RPM_UINT64_TYPE */
/*@relnull@*/ /*@relnull@*/
const char * str; /*!< RPM_STRING_TYPE */ const char * str; /*!< RPM_STRING_TYPE */
unsigned char * blob; /*!< RPM_BIN_TYPE */ unsigned char * blob; /*!< RPM_BIN_TYPE */
const char ** argv; /*!< RPM_STRING_ARRAY_TYPE */ const char ** argv; /*!< RPM_STRING_ARRAY_TYPE */
HE_t he; HE_t he;
}; };
#endif #endif
/*@=typeuse =fielduse@*/ /*@=typeuse =fielduse@*/
/*@=typeuse =fielduse@*/ /*@=typeuse =fielduse@*/
skipping to change at line 467 skipping to change at line 467
RPMSIGTAG_PGP = 1002, /*!< internal PGP 2.6.3 signature. */ RPMSIGTAG_PGP = 1002, /*!< internal PGP 2.6.3 signature. */
RPMSIGTAG_LEMD5_2 = 1003, /*!< internal Broken MD5, take 2 @deprecated legacy. */ RPMSIGTAG_LEMD5_2 = 1003, /*!< internal Broken MD5, take 2 @deprecated legacy. */
RPMSIGTAG_MD5 = 1004, /*!< internal MD5 signature. */ RPMSIGTAG_MD5 = 1004, /*!< internal MD5 signature. */
RPMSIGTAG_GPG = 1005, /*!< internal GnuPG signature. */ RPMSIGTAG_GPG = 1005, /*!< internal GnuPG signature. */
RPMSIGTAG_PGP5 = 1006, /*!< internal PGP5 signature @deprecated leg acy. */ RPMSIGTAG_PGP5 = 1006, /*!< internal PGP5 signature @deprecated leg acy. */
RPMSIGTAG_PAYLOADSIZE = 1007,/*!< internal uncompressed payload size in bytes. */ RPMSIGTAG_PAYLOADSIZE = 1007,/*!< internal uncompressed payload size in bytes. */
RPMSIGTAG_BADSHA1_1 = RPMTAG_BADSHA1_1, /*!< internal Broken SHA1, take 1. */ RPMSIGTAG_BADSHA1_1 = RPMTAG_BADSHA1_1, /*!< internal Broken SHA1, take 1. */
RPMSIGTAG_BADSHA1_2 = RPMTAG_BADSHA1_2, /*!< internal Broken SHA1, take 2. */ RPMSIGTAG_BADSHA1_2 = RPMTAG_BADSHA1_2, /*!< internal Broken SHA1, take 2. */
RPMSIGTAG_SHA1 = RPMTAG_SHA1HEADER, /*!< internal sha1 header di gest. */ RPMSIGTAG_SHA1 = RPMTAG_SHA1HEADER, /*!< internal sha1 header di gest. */
RPMSIGTAG_DSA = RPMTAG_DSAHEADER, /*!< internal DSA header sig nature. */ RPMSIGTAG_DSA = RPMTAG_DSAHEADER, /*!< internal DSA header sig nature. */
RPMSIGTAG_RSA = RPMTAG_RSAHEADER /*!< internal RSA header sig RPMSIGTAG_RSA = RPMTAG_RSAHEADER, /*!< internal RSA header sig
nature. */ nature. */
RPMSIGTAG_PADDING = 0x3fffffff /*!< signature header paddin
g */
}; };
/** \ingroup header /** \ingroup header
*/ */
typedef enum rpmTag_e rpmTag; typedef enum rpmTag_e rpmTag;
/** \ingroup header /** \ingroup header
*/ */
typedef enum rpmSigTag_e rpmSigTag; typedef enum rpmSigTag_e rpmSigTag;
skipping to change at line 1083 skipping to change at line 1084
*/ */
/*@null@*/ /*@null@*/
void * headerSetRpmdb(/*@null@*/ Header h, /*@null@*/ void * rpmdb) void * headerSetRpmdb(/*@null@*/ Header h, /*@null@*/ void * rpmdb)
/*@modifies h @*/; /*@modifies h @*/;
/** \ingroup header /** \ingroup header
* Return header instance (if from rpmdb). * Return header instance (if from rpmdb).
* @param h header * @param h header
* @return header instance * @return header instance
*/ */
uint32_t headerGetInstance(/*@null@*/ Header h) rpmuint32_t headerGetInstance(/*@null@*/ Header h)
/*@*/; /*@*/;
/** \ingroup header /** \ingroup header
* Store header instance (e.g path or URL). * Store header instance (e.g path or URL).
* @param h header * @param h header
* @param instance new header instance * @param instance new header instance
* @return 0 always * @return 0 always
*/ */
uint32_t headerSetInstance(/*@null@*/ Header h, uint32_t instance) rpmuint32_t headerSetInstance(/*@null@*/ Header h, rpmuint32_t instance)
/*@modifies h @*/; /*@modifies h @*/;
/** \ingroup header /** \ingroup header
* Return header starting byte offset. * Return header starting byte offset.
* @param h header * @param h header
* @return header starting byte offset * @return header starting byte offset
*/ */
uint32_t headerGetStartOff(/*@null@*/ Header h) rpmuint32_t headerGetStartOff(/*@null@*/ Header h)
/*@*/; /*@*/;
/** \ingroup header /** \ingroup header
* Store header starting byte offset. * Store header starting byte offset.
* @param h header * @param h header
* @param startoff new header starting byte offset * @param startoff new header starting byte offset
* @return 0 always * @return 0 always
*/ */
uint32_t headerSetStartOff(/*@null@*/ Header h, uint32_t startoff) rpmuint32_t headerSetStartOff(/*@null@*/ Header h, rpmuint32_t startoff)
/*@modifies h @*/; /*@modifies h @*/;
/** \ingroup header /** \ingroup header
* Return header ending byte offset. * Return header ending byte offset.
* @param h header * @param h header
* @return header ending byte offset * @return header ending byte offset
*/ */
uint32_t headerGetEndOff(/*@null@*/ Header h) rpmuint32_t headerGetEndOff(/*@null@*/ Header h)
/*@*/; /*@*/;
/** \ingroup header /** \ingroup header
* Store header ending byte offset. * Store header ending byte offset.
* @param h header * @param h header
* @param startoff new header ending byte offset * @param startoff new header ending byte offset
* @return 0 always * @return 0 always
*/ */
uint32_t headerSetEndOff(/*@null@*/ Header h, uint32_t endoff) rpmuint32_t headerSetEndOff(/*@null@*/ Header h, rpmuint32_t endoff)
/*@modifies h @*/; /*@modifies h @*/;
/** \ingroup header /** \ingroup header
* Return header stats accumulator structure. * Return header stats accumulator structure.
* @param h header * @param h header
* @param opx per-header accumulator index (aka rpmtsOpX) * @param opx per-header accumulator index (aka rpmtsOpX)
* @return per-header accumulator pointer * @return per-header accumulator pointer
*/ */
/*@null@*/ /*@null@*/
void * headerGetStats(Header h, int opx) void * headerGetStats(Header h, int opx)
skipping to change at line 1181 skipping to change at line 1182
/*@null@*/ /*@out@*/ const char ** rp, /*@null@*/ /*@out@*/ const char ** rp,
/*@null@*/ /*@out@*/ const char ** ap) /*@null@*/ /*@out@*/ const char ** ap)
/*@globals internalState @*/ /*@globals internalState @*/
/*@modifies h, *np, *vp, *rp, *ap, 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) rpmuint32_t hGetColor(Header h)
/*@globals internalState @*/ /*@globals internalState @*/
/*@modifies h, 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)
 End of changes. 10 change blocks. 
14 lines changed or deleted 16 lines changed or added


 rpmte.h   rpmte.h 
#ifndef H_RPMTE #ifndef H_RPMTE
#define H_RPMTE #define H_RPMTE
/** \ingroup rpmts rpmte /** \ingroup rpmts rpmte
* \file lib/rpmte.h * \file lib/rpmte.h
* Structures used for an "rpmte" transaction element. * Structures used for an "rpmte" transaction element.
*/ */
#include <argv.h>
#include <rpmfi.h> #include <rpmfi.h>
/** /**
*/ */
/*@-exportlocal@*/ /*@-exportlocal@*/
/*@unchecked@*/ /*@unchecked@*/
extern int _rpmte_debug; extern int _rpmte_debug;
/*@=exportlocal@*/ /*@=exportlocal@*/
/** \ingroup rpmte /** \ingroup rpmte
skipping to change at line 37 skipping to change at line 36
/** \ingroup rpmte /** \ingroup rpmte
* Transaction element type. * Transaction element type.
*/ */
typedef enum rpmElementType_e { typedef enum rpmElementType_e {
TR_ADDED = (1 << 0), /*!< Package will be installed. */ TR_ADDED = (1 << 0), /*!< Package will be installed. */
TR_REMOVED = (1 << 1) /*!< Package will be removed. */ TR_REMOVED = (1 << 1) /*!< Package will be removed. */
} rpmElementType; } rpmElementType;
#if defined(_RPMTE_INTERNAL) #if defined(_RPMTE_INTERNAL)
#include <argv.h>
#include <rpmal.h>
/** \ingroup rpmte /** \ingroup rpmte
* Dependncy ordering information. * Dependncy ordering information.
*/ */
/*@-fielduse@*/ /* LCL: confused by union? */ /*@-fielduse@*/ /* LCL: confused by union? */
struct tsortInfo_s { struct tsortInfo_s {
union { union {
int count; int count;
/*@exposed@*/ /*@dependent@*/ /*@null@*/ /*@exposed@*/ /*@dependent@*/ /*@null@*/
rpmte suc; rpmte suc;
} tsi_u; } tsi_u;
skipping to change at line 80 skipping to change at line 82
}; };
/** \ingroup rpmte /** \ingroup rpmte
*/ */
typedef struct sharedFileInfo_s * sharedFileInfo; typedef struct sharedFileInfo_s * sharedFileInfo;
/** \ingroup rpmte /** \ingroup rpmte
* Replaced file cross reference. * Replaced file cross reference.
*/ */
struct sharedFileInfo_s { struct sharedFileInfo_s {
uint32_t pkgFileNum; rpmuint32_t pkgFileNum;
uint32_t otherFileNum; rpmuint32_t otherFileNum;
uint32_t otherPkg; rpmuint32_t otherPkg;
uint32_t isRemoved; rpmuint32_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. */ 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@*/
skipping to change at line 113 skipping to change at line 115
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
const char * sourcerpm; /*!< Source package. */ const char * sourcerpm; /*!< Source package. */
/*@only@*/ /*@only@*/
const char * name; /*!< Name: */ const char * name; /*!< Name: */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
char * epoch; char * epoch;
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
char * version; /*!< Version: */ char * version; /*!< Version: */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
char * release; /*!< Release: */ char * release; /*!< Release: */
#ifdef RPM_VENDOR_MANDRIVA
/*@only@*/ /*@null@*/
char * distepoch;
#endif
/*@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. */
int tree; /*!< Tree index. */ int tree; /*!< Tree index. */
skipping to change at line 135 skipping to change at line 141
unsigned int db_instance; /*!< Database Instance after add */ unsigned int db_instance; /*!< Database Instance after add */
/*@owned@*/ /*@owned@*/
tsortInfo tsi; /*!< Dependency ordering chains. */ tsortInfo tsi; /*!< Dependency ordering chains. */
/*@null@*/ /*@null@*/
rpmPRCO PRCO; /*!< Current dependencies. */ rpmPRCO PRCO; /*!< Current dependencies. */
/*@refcounted@*/ /*@null@*/ /*@refcounted@*/ /*@null@*/
rpmfi fi; /*!< File information. */ rpmfi fi; /*!< File information. */
uint32_t color; /*!< Color bit(s) from package dependencies. rpmuint32_t depFlags; /*!< Package depFlags mask. */
*/ rpmuint32_t transFlags; /*!< Package transFlags mask. */
uint32_t pkgFileSize; /*!< No. of bytes in package file (approx). rpmuint32_t color; /*!< Color bit(s) from package dependencies.
*/ */
rpmuint32_t pkgFileSize; /*!< No. of bytes in package file (approx).
*/
/*@exposed@*/ /*@dependent@*/ /*@null@*/ /*@exposed@*/ /*@dependent@*/ /*@null@*/
fnpyKey key; /*!< (TR_ADDED) Retrieval key. */ fnpyKey key; /*!< (TR_ADDED) Retrieval key. */
/*@owned@*/ /*@null@*/ /*@owned@*/ /*@null@*/
rpmRelocation relocs; /*!< (TR_ADDED) Payload file relocations. */ rpmRelocation relocs; /*!< (TR_ADDED) Payload file relocations. */
int nrelocs; /*!< (TR_ADDED) No. of relocations. */ int nrelocs; /*!< (TR_ADDED) No. of relocations. */
int autorelocatex; /*!< (TR_ADDED) Auto relocation entry index. */ int autorelocatex; /*!< (TR_ADDED) Auto relocation entry index. */
/*@refcounted@*/ /*@null@*/ /*@refcounted@*/ /*@null@*/
FD_t fd; /*!< (TR_ADDED) Payload file descriptor. */ FD_t fd; /*!< (TR_ADDED) Payload file descriptor. */
/*@owned@*/ /*@null@*/ /*@owned@*/ /*@null@*/
sharedFileInfo replaced; /*!< (TR_ADDED) Replaced file reference. */ sharedFileInfo replaced; /*!< (TR_ADDED) Replaced file reference. */
int nreplaced; /*!< (TR_ADDED) No. of replaced files. */ int nreplaced; /*!< (TR_ADDED) No. of replaced files. */
struct rpmChainLink_s blink;/*!< Backward link info to erased element. */ struct rpmChainLink_s blink;/*!< Backward link info to erased element. */
struct rpmChainLink_s flink;/*!< Forward link info to installed element . */ struct rpmChainLink_s flink;/*!< Forward link info to installed element . */
int linkFailed; /*!< Did the linked element upgrade succeed? */ int linkFailed; /*!< Did the linked element upgrade succeed? */
int done; /*!< Has the element been installed/erased? */ int done; /*!< Has the element been installed/erased? */
uint32_t originTid[2]; /*!< Transaction id of first install. */ rpmuint32_t originTid[2]; /*!< Transaction id of first install. */
uint32_t originTime[2]; /*!< Time that package was first installed. rpmuint32_t originTime[2]; /*!< Time that package was first installed.
*/ */
int installed; /*!< Was the header installed? */ int installed; /*!< Was the header installed? */
int downgrade; /*!< Adjust package count on downgrades. */ int downgrade; /*!< Adjust package count on downgrades. */
struct { struct {
/*@exposed@*/ /*@dependent@*/ /*@null@*/ /*@exposed@*/ /*@dependent@*/ /*@null@*/
alKey addedKey; alKey addedKey;
struct { struct {
/*@exposed@*/ /*@dependent@*/ /*@null@*/ /*@exposed@*/ /*@dependent@*/ /*@null@*/
alKey dependsOnKey; alKey dependsOnKey;
skipping to change at line 293 skipping to change at line 301
/** \ingroup rpmte /** \ingroup rpmte
* Retrieve release string of transaction element. * Retrieve release string of transaction element.
* @param te transaction element * @param te transaction element
* @return release string * @return release string
*/ */
/*@observer@*/ /*@null@*/ /*@observer@*/ /*@null@*/
extern const char * rpmteR(rpmte te) extern const char * rpmteR(rpmte te)
/*@*/; /*@*/;
#ifdef RPM_VENDOR_MANDRIVA
/** \ingroup rpmte
* Retrieve distepoch string of transaction element.
* @param te transaction element
* @return distepoch string
*/
/*@observer@*/ /*@null@*/
extern const char * rpmteD(rpmte te)
/*@*/;
#endif
/** \ingroup rpmte /** \ingroup rpmte
* Retrieve arch string of transaction element. * Retrieve arch string of transaction element.
* @param te transaction element * @param te transaction element
* @return arch string * @return arch string
*/ */
/*@observer@*/ /*@null@*/ /*@observer@*/ /*@null@*/
extern const char * rpmteA(rpmte te) extern const char * rpmteA(rpmte te)
/*@*/; /*@*/;
/** \ingroup rpmte /** \ingroup rpmte
skipping to change at line 324 skipping to change at line 343
* @return isSource attribute * @return isSource attribute
*/ */
extern int rpmteIsSource(rpmte te) extern int rpmteIsSource(rpmte te)
/*@*/; /*@*/;
/** \ingroup rpmte /** \ingroup rpmte
* Retrieve color bits of transaction element. * Retrieve color bits of transaction element.
* @param te transaction element * @param te transaction element
* @return color bits * @return color bits
*/ */
uint32_t rpmteColor(rpmte te) rpmuint32_t rpmteColor(rpmte te)
/*@*/; /*@*/;
/** \ingroup rpmte /** \ingroup rpmte
* Set color bits of transaction element. * Set color bits of transaction element.
* @param te transaction element * @param te transaction element
* @param color new color bits * @param color new color bits
* @return previous color bits * @return previous color bits
*/ */
uint32_t rpmteSetColor(rpmte te, uint32_t color) rpmuint32_t rpmteSetColor(rpmte te, rpmuint32_t color)
/*@modifies te @*/; /*@modifies te @*/;
/** \ingroup rpmte /** \ingroup rpmte
* Retrieve last instance installed to the database. * Retrieve last instance installed to the database.
* @param te transaction element * @param te transaction element
* @return last install instance. * @return last install instance.
*/ */
unsigned int rpmteDBInstance(rpmte te) unsigned int rpmteDBInstance(rpmte te)
/*@*/; /*@*/;
skipping to change at line 359 skipping to change at line 378
*/ */
void rpmteSetDBInstance(rpmte te, unsigned int instance) void rpmteSetDBInstance(rpmte te, unsigned int instance)
/*@modifies te @*/; /*@modifies te @*/;
/** \ingroup rpmte /** \ingroup rpmte
* Retrieve size in bytes of package file. * Retrieve size in bytes of package file.
* @todo Signature header is estimated at 256b. * @todo Signature header is estimated at 256b.
* @param te transaction element * @param te transaction element
* @return size in bytes of package file. * @return size in bytes of package file.
*/ */
uint32_t rpmtePkgFileSize(rpmte te) rpmuint32_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@*/ /*@observer@*/
uint32_t * rpmteOriginTid(rpmte te) rpmuint32_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@*/ /*@observer@*/
uint32_t * rpmteOriginTime(rpmte te) rpmuint32_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)
/*@*/; /*@*/;
 End of changes. 12 change blocks. 
17 lines changed or deleted 36 lines changed or added


 rpmts.h   rpmts.h 
skipping to change at line 160 skipping to change at line 160
*/ */
typedef enum tsStage_e { typedef enum tsStage_e {
TSM_UNKNOWN = 0, TSM_UNKNOWN = 0,
TSM_INSTALL = 7, TSM_INSTALL = 7,
TSM_ERASE = 8, TSM_ERASE = 8,
} tsmStage; } tsmStage;
#if defined(_RPMTS_INTERNAL) #if defined(_RPMTS_INTERNAL)
#include "rpmhash.h" /* XXX hashTable */ #include "rpmhash.h" /* XXX hashTable */
#include "rpmkeyring.h"
#include "rpmal.h" /* XXX availablePackage/relocateFileList ,*/ #include "rpmal.h" /* XXX availablePackage/relocateFileList ,*/
/*@unchecked@*/ /*@unchecked@*/
/*@-exportlocal@*/ /*@-exportlocal@*/
extern int _cacheDependsRC; extern int _cacheDependsRC;
/*@=exportlocal@*/ /*@=exportlocal@*/
/** \ingroup rpmts /** \ingroup rpmts
*/ */
typedef /*@abstract@*/ struct diskspaceInfo_s * rpmDiskSpaceInfo; typedef /*@abstract@*/ struct diskspaceInfo_s * rpmDiskSpaceInfo;
skipping to change at line 234 skipping to change at line 235
rpmCallbackData notifyData; /*!< Callback private data. */ rpmCallbackData notifyData; /*!< Callback private data. */
/*@null@*/ /*@null@*/
rpmPRCO PRCO; /*!< Current transaction dependencies. */ rpmPRCO PRCO; /*!< Current transaction dependencies. */
/*@refcounted@*/ /*@null@*/ /*@refcounted@*/ /*@null@*/
rpmps probs; /*!< Current problems in transaction. */ rpmps probs; /*!< Current problems in transaction. */
rpmprobFilterFlags ignoreSet; rpmprobFilterFlags ignoreSet;
/*!< Bits to filter current problems. */ /*!< Bits to filter current problems. */
uint32_t filesystemCount; /*!< No. of mounted filesystems. */ rpmuint32_t filesystemCount;/*!< No. of mounted filesystems. */
/*@dependent@*/ /*@null@*/ /*@dependent@*/ /*@null@*/
const char ** filesystems; /*!< Mounted filesystem names. */ const char ** filesystems; /*!< Mounted filesystem names. */
/*@only@*/ /*@relnull@*/ /*@only@*/ /*@relnull@*/
rpmDiskSpaceInfo dsi; /*!< Per filesystem disk/inode usage. */ rpmDiskSpaceInfo dsi; /*!< Per filesystem disk/inode usage. */
/*@refcounted@*/ /*@null@*/ /*@refcounted@*/ /*@null@*/
rpmdb rdb; /*!< Install database handle. */ rpmdb rdb; /*!< Install database handle. */
int dbmode; /*!< Install database open mode. */ int dbmode; /*!< Install database open mode. */
/*@only@*/ /*@only@*/
hashTable ht; /*!< Fingerprint hash table. */ hashTable ht; /*!< Fingerprint hash table. */
skipping to change at line 293 skipping to change at line 294
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. */ rpmuint32_t tid[2]; /*!< Transaction id. */
uint32_t color; /*!< Transaction color bits. */ rpmuint32_t color; /*!< Transaction color bits. */
uint32_t prefcolor; /*!< Preferred file color. */ rpmuint32_t prefcolor; /*!< Preferred file color. */
/*@observer@*/ /*@dependent@*/ /*@null@*/ /*@observer@*/ /*@dependent@*/ /*@null@*/
const char * fn; /*!< Current package fn. */ const char * fn; /*!< Current package fn. */
/*@refcounted@*/ /*@relnull@*/
rpmKeyring keyring; /*!< Keyring in use. */
/*@relnull@*/ /*@relnull@*/
uint8_t * pkpkt; /*!< Current pubkey packet. */ rpmuint8_t * pkpkt; /*!< Current pubkey packet. */
size_t pkpktlen; /*!< Current pubkey packet length. */ size_t pkpktlen; /*!< Current pubkey packet length. */
uint8_t pksignid[8]; /*!< Current pubkey fingerprint. */ rpmuint8_t pksignid[8]; /*!< Current pubkey fingerprint. */
struct rpmop_s ops[RPMTS_OP_MAX]; struct rpmop_s ops[RPMTS_OP_MAX];
/*@refcounted@*/ /*@relnull@*/ /*@refcounted@*/ /*@relnull@*/
pgpDig dig; /*!< Current signature/pubkey parame ters. */ pgpDig dig; /*!< Current signature/pubkey parame ters. */
/*@null@*/ /*@null@*/
Spec spec; /*!< Spec file control structure. */ Spec spec; /*!< Spec file control structure. */
uint32_t arbgoal; /*!< Autorollback goal */ rpmuint32_t arbgoal; /*!< Autorollback goal */
#if defined(__LCLINT__) #if defined(__LCLINT__)
/*@refs@*/ /*@refs@*/
int nrefs; /*!< (unused) keep splint happy */ int nrefs; /*!< (unused) keep splint happy */
#endif #endif
}; };
#endif /* _RPMTS_INTERNAL */ #endif /* _RPMTS_INTERNAL */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
skipping to change at line 477 skipping to change at line 480
/** \ingroup rpmts /** \ingroup rpmts
* Return transaction database iterator. * Return transaction database iterator.
* @param ts transaction set * @param ts transaction set
* @param rpmtag rpm tag * @param rpmtag rpm tag
* @param keyp key data (NULL for sequential access) * @param keyp key data (NULL for sequential access)
* @param keylen key data length (0 will use strlen(keyp)) * @param keylen key data length (0 will use strlen(keyp))
* @return NULL on failure * @return NULL on failure
*/ */
/*@only@*/ /*@null@*/ /*@only@*/ /*@null@*/
rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag, rpmmi rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
/*@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 ts, rpmGlobalMacroContext, fileSystem, internalState @*/ ; /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/ ;
/** \ingroup rpmts /** \ingroup rpmts
* Retrieve pubkey from rpm database. * Retrieve pubkey from rpm database.
* @param ts rpm transaction * @param ts rpm transaction
* @param _dig container (NULL uses rpmtsDig(ts) instead). * @param _dig container (NULL uses rpmtsDig(ts) instead).
* @return RPMRC_OK on success, RPMRC_NOKEY if not found * @return RPMRC_OK on success, RPMRC_NOKEY if not found
*/ */
skipping to change at line 580 skipping to change at line 583
* @param type transaction type * @param type transaction type
*/ */
void rpmtsSetType(rpmts ts, rpmTSType type) void rpmtsSetType(rpmts ts, rpmTSType type)
/*@modifies ts @*/; /*@modifies ts @*/;
/** \ingroup rpmts /** \ingroup rpmts
* Return the autorollback goal. * Return the autorollback goal.
* @param ts transaction set * @param ts transaction set
* @return autorollback goal * @return autorollback goal
*/ */
uint32_t rpmtsARBGoal(rpmts ts) rpmuint32_t rpmtsARBGoal(rpmts ts)
/*@*/; /*@*/;
/** \ingroup rpmts /** \ingroup rpmts
* Set autorollback goal. * Set autorollback goal.
* @param ts transaction set * @param ts transaction set
* @param goal autorollback goal * @param goal autorollback goal
*/ */
void rpmtsSetARBGoal(rpmts ts, uint32_t goal) void rpmtsSetARBGoal(rpmts ts, rpmuint32_t goal)
/*@modifies ts @*/; /*@modifies ts @*/;
/** \ingroup rpmts /** \ingroup rpmts
* Return current transaction set problems. * Return current transaction set problems.
* @param ts transaction set * @param ts transaction set
* @return current problem set (or NULL) * @return current problem set (or NULL)
*/ */
/*@null@*/ /*@null@*/
rpmps rpmtsProblems(rpmts ts) rpmps rpmtsProblems(rpmts ts)
/*@modifies ts @*/; /*@modifies ts @*/;
skipping to change at line 637 skipping to change at line 640
* @return NULL on last dereference * @return NULL on last dereference
*/ */
/*@null@*/ /*@null@*/
rpmts rpmtsFree(/*@killref@*/ /*@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) \ #define rpmtsFree(_ts) \
((rpmts) rpmioFreePoolItem((rpmioItem)(_ts), __FUNCTION__, __FILE__, __LINE__)) ((rpmts) rpmioFreePoolItem((rpmioItem)(_ts), __FUNCTION__, __FILE__, __LINE__))
/** \ingroup rpmts /** \ingroup rpmts
* Get transaction keyring.
* @param ts transaction set
* @param autoload Should keyring be loaded? (unimplmented)
* @return transaction keyring
*/
void * rpmtsGetKeyring(rpmts ts, int autoload)
/*@*/;
/** \ingroup rpmts
* Set transaction keyring.
* @param ts transaction set
* @param _keyring new transaction keyring
* @return 0 on success
*/
int rpmtsSetKeyring(rpmts ts, void * _keyring)
/*modifies ts, _keyring @*/;
/** \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
* Set verify signatures flag(s). * Set verify signatures flag(s).
* @param ts transaction set * @param ts transaction set
skipping to change at line 746 skipping to change at line 767
* @return previous chrootDone flag * @return previous chrootDone flag
*/ */
int rpmtsSetChrootDone(rpmts ts, int chrootDone) int rpmtsSetChrootDone(rpmts ts, int chrootDone)
/*@modifies ts @*/; /*@modifies ts @*/;
/** \ingroup rpmts /** \ingroup rpmts
* Get transaction id, i.e. transaction time stamp. * Get transaction id, i.e. transaction time stamp.
* @param ts transaction set * @param ts transaction set
* @return transaction id * @return transaction id
*/ */
uint32_t rpmtsGetTid(rpmts ts) rpmuint32_t rpmtsGetTid(rpmts ts)
/*@*/; /*@*/;
/** \ingroup rpmts /** \ingroup rpmts
* Set transaction id, i.e. transaction time stamp. * Set transaction id, i.e. transaction time stamp.
* @param ts transaction set * @param ts transaction set
* @param tid new transaction id * @param tid new transaction id
* @return previous transaction id * @return previous transaction id
*/ */
uint32_t rpmtsSetTid(rpmts ts, uint32_t tid) rpmuint32_t rpmtsSetTid(rpmts ts, rpmuint32_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 @*/ /*@globals fileSystem @*/
/*@modifies fileSystem @*/; /*@modifies fileSystem @*/;
skipping to change at line 817 skipping to change at line 838
/** \ingroup rpmts /** \ingroup rpmts
* Update disk space info for a file. * Update disk space info for a file.
* @param ts transaction set * @param ts transaction set
* @param dev mount point device * @param dev mount point device
* @param fileSize file size * @param fileSize file size
* @param prevSize previous file size (if upgrading) * @param prevSize previous file size (if upgrading)
* @param fixupSize size difference (if * @param fixupSize size difference (if
* @param _action file disposition * @param _action file disposition
*/ */
void rpmtsUpdateDSI(const rpmts ts, dev_t dev, void rpmtsUpdateDSI(const rpmts ts, dev_t dev,
uint32_t fileSize, uint32_t prevSize, uint32_t fixupSize, rpmuint32_t fileSize, rpmuint32_t prevSize, rpmuint32_t fixu pSize,
int _action) int _action)
/*@modifies ts @*/; /*@modifies ts @*/;
/** \ingroup rpmts /** \ingroup rpmts
* Check a transaction element for disk space problems. * Check a transaction element for disk space problems.
* @param ts transaction set * @param ts transaction set
* @param te current transaction element * @param te current transaction element
*/ */
void rpmtsCheckDSIProblems(const rpmts ts, const rpmte te) void rpmtsCheckDSIProblems(const rpmts ts, const rpmte te)
/*@modifies ts @*/; /*@modifies ts @*/;
skipping to change at line 842 skipping to change at line 863
* used portably * used portably
* @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, rpmuint64_t amount, rpmuint64_t total )
/*@modifies te @*/; /*@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)
/*@*/; /*@*/;
skipping to change at line 982 skipping to change at line 1003
* @return previous dbmode * @return previous dbmode
*/ */
int rpmtsSetDBMode(rpmts ts, int dbmode) int rpmtsSetDBMode(rpmts ts, int dbmode)
/*@modifies ts @*/; /*@modifies ts @*/;
/** \ingroup rpmts /** \ingroup rpmts
* Retrieve color bits of transaction set. * Retrieve color bits of transaction set.
* @param ts transaction set * @param ts transaction set
* @return color bits * @return color bits
*/ */
uint32_t rpmtsColor(rpmts ts) rpmuint32_t rpmtsColor(rpmts ts)
/*@*/; /*@*/;
/** \ingroup rpmts /** \ingroup rpmts
* Retrieve prefered file color * Retrieve prefered file color
* @param ts transaction set * @param ts transaction set
* @return color bits * @return color bits
*/ */
uint32_t rpmtsPrefColor(rpmts ts) rpmuint32_t rpmtsPrefColor(rpmts ts)
/*@*/; /*@*/;
/** \ingroup rpmts /** \ingroup rpmts
* Set color bits of transaction set. * Set color bits of transaction set.
* @param ts transaction set * @param ts transaction set
* @param color new color bits * @param color new color bits
* @return previous color bits * @return previous color bits
*/ */
uint32_t rpmtsSetColor(rpmts ts, uint32_t color) rpmuint32_t rpmtsSetColor(rpmts ts, rpmuint32_t color)
/*@modifies ts @*/; /*@modifies ts @*/;
/** \ingroup rpmts /** \ingroup rpmts
* Retrieve operation timestamp from a transaction set. * Retrieve operation timestamp from a transaction set.
* @param ts transaction set * @param ts transaction set
* @param opx operation timestamp index * @param opx operation timestamp index
* @return pointer to operation timestamp. * @return pointer to operation timestamp.
*/ */
/*@relnull@*/ /*@relnull@*/
rpmop rpmtsOp(rpmts ts, rpmtsOpX opx) rpmop rpmtsOp(rpmts ts, rpmtsOpX opx)
skipping to change at line 1087 skipping to change at line 1108
* Print current transaction set contents. * Print current transaction set contents.
* @param ts transaction set * @param ts transaction set
* @param fp file handle (NULL uses stderr) * @param fp file handle (NULL uses stderr)
* @return 0 always * @return 0 always
*/ */
/*@unused@*/ static inline /*@unused@*/ static inline
int rpmtsPrint(/*@null@*/ rpmts ts, /*@null@*/ FILE * fp) int rpmtsPrint(/*@null@*/ rpmts ts, /*@null@*/ FILE * fp)
/*@globals fileSystem @*/ /*@globals fileSystem @*/
/*@modifies ts, *fp, fileSystem @*/ /*@modifies ts, *fp, fileSystem @*/
{ {
uint32_t tid = rpmtsGetTid(ts); rpmuint32_t tid = rpmtsGetTid(ts);
time_t ttid = tid; time_t ttid = tid;
rpmtsi tsi; rpmtsi tsi;
rpmte te; rpmte te;
if (fp == NULL) if (fp == NULL)
fp = stderr; fp = stderr;
fprintf(fp, _("=== Transaction at %-24.24s (0x%08x):\n"), ctime(&ttid), tid); fprintf(fp, _("=== Transaction at %-24.24s (0x%08x):\n"), ctime(&ttid), tid);
tsi = rpmtsiInit(ts); tsi = rpmtsiInit(ts);
while ((te = rpmtsiNext(tsi, 0)) != NULL) while ((te = rpmtsiNext(tsi, 0)) != NULL)
 End of changes. 20 change blocks. 
18 lines changed or deleted 39 lines changed or added


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