rpmfi.h
Go to the documentation of this file.
#ifndef H_RPMFI
#define H_RPMFI
/*@-exportlocal@*/
/*@unchecked@*/
extern int _rpmfi_debug;
/*@=exportlocal@*/
typedef enum rpmFileTypes_e {
PIPE = 1,
CDEV = 2,
XDIR = 4,
BDEV = 6,
REG = 8,
LINK = 10,
SOCK = 12
} rpmFileTypes;
typedef enum rpmfileState_e {
RPMFILE_STATE_NORMAL = 0,
RPMFILE_STATE_REPLACED = 1,
RPMFILE_STATE_NOTINSTALLED = 2,
RPMFILE_STATE_NETSHARED = 3,
RPMFILE_STATE_WRONGCOLOR = 4
} rpmfileState;
#define RPMFILE_STATE_MISSING -1 /* XXX used for unavailable data */
typedef enum rpmfileAttrs_e {
/*@-enummemuse@*/
RPMFILE_NONE = 0,
/*@=enummemuse@*/
RPMFILE_CONFIG = (1 << 0),
RPMFILE_DOC = (1 << 1),
RPMFILE_ICON = (1 << 2),
RPMFILE_MISSINGOK = (1 << 3),
RPMFILE_NOREPLACE = (1 << 4),
RPMFILE_SPECFILE = (1 << 5),
RPMFILE_GHOST = (1 << 6),
RPMFILE_LICENSE = (1 << 7),
RPMFILE_README = (1 << 8),
RPMFILE_EXCLUDE = (1 << 9),
RPMFILE_UNPATCHED = (1 << 10),
RPMFILE_PUBKEY = (1 << 11),
RPMFILE_POLICY = (1 << 12),
RPMFILE_EXISTS = (1 << 13),
RPMFILE_SPARSE = (1 << 14),
RPMFILE_TYPED = (1 << 15),
RPMFILE_SOURCE = (1 << 16),
RPMFILE_PATCH = (1 << 17),
RPMFILE_OPTIONAL = (1 << 18),
RPMFILE_REMOVE = (1 << 19)
} rpmfileAttrs;
#define RPMFILE_SPOOK (RPMFILE_GHOST|RPMFILE_TYPED)
#define RPMFILE_ALL ~(RPMFILE_NONE)
typedef /*@abstract@*/ /*@refcounted@*/ struct rpmfi_s * rpmfi;
#if defined(_RPMFI_INTERNAL)
#include "mire.h"
struct rpmfi_s {
struct rpmioItem_s _item;
int i;
int j;
/*@observer@*/
const char * Type;
rpmTag tagN;
/*@refcounted@*/ /*@null@*/
Header h;
/*@only@*/ /*@relnull@*/
const char ** bnl;
/*@only@*/ /*@relnull@*/
const char ** dnl;
/*@only@*/ /*@relnull@*/
const char ** fdigests;
/*@only@*/ /*@null@*/
rpmuint32_t * fdigestalgos;
/*@only@*/ /*@relnull@*/
const char ** flinks;
/*@only@*/ /*@null@*/
const char ** flangs;
/*@only@*/ /*@relnull@*/
rpmuint32_t * dil;
/*@only@*/ /*@relnull@*/
const rpmuint32_t * fflags;
/*@only@*/ /*@relnull@*/
const rpmuint32_t * fsizes;
/*@only@*/ /*@relnull@*/
const rpmuint32_t * fmtimes;
/*@only@*/ /*@relnull@*/
rpmuint16_t * fmodes;
/*@only@*/ /*@relnull@*/
const rpmuint16_t * frdevs;
/*@only@*/ /*@relnull@*/
const rpmuint32_t * finodes;
/*@only@*/ /*@null@*/
const char ** fuser;
/*@only@*/ /*@null@*/
const char ** fgroup;
/*@only@*/ /*@null@*/
rpmuint8_t * fstates;
/*@only@*/ /*@null@*/
const rpmuint32_t * fcolors;
/*@only@*/ /*@null@*/
const char ** fcaps;
/*@only@*/ /*@null@*/
const char ** fcontexts;
/*@only@*/ /*@null@*/
const char ** cdict;
rpmuint32_t ncdict;
/*@only@*/ /*@null@*/
const rpmuint32_t * fcdictx;
/*@only@*/ /*@null@*/
const rpmuint32_t * ddict;
rpmuint32_t nddict;
/*@only@*/ /*@null@*/
const rpmuint32_t * fddictx;
/*@only@*/ /*@null@*/
const rpmuint32_t * fddictn;
/*@only@*/ /*@relnull@*/
const rpmuint32_t * vflags;
rpmuint32_t dc;
rpmuint32_t fc;
/*=============================*/
/*@dependent@*/ /*@relnull@*/
void * te;
/*@only@*/ /*@null@*/
miRE exclude;
int nexclude;
/*@only@*/ /*@null@*/
miRE include;
int ninclude;
/*-----------------------------*/
uid_t uid;
gid_t gid;
rpmuint32_t flags;
int action;
/*@owned@*/ /*@relnull@*/
int * actions;
/*@owned@*/
struct fingerPrint_s * fps;
/*@owned@*/
const char ** obnl;
/*@owned@*/
const char ** odnl;
/*@unused@*/
rpmuint32_t * odil;
/*@only@*/ /*@relnull@*/
unsigned char * digests;
rpmuint32_t digestalgo;
rpmuint32_t digestlen;
/*@only@*/ /*@relnull@*/
const char * pretrans;
/*@only@*/ /*@relnull@*/
const char * pretransprog;
/*@only@*/ /*@relnull@*/
const char * posttrans;
/*@only@*/ /*@relnull@*/
const char * posttransprog;
/*@only@*/ /*@relnull@*/
const char * verifyscript;
/*@only@*/ /*@relnull@*/
const char * verifyscriptprog;
/*@only@*/ /*@null@*/
char * fn;
size_t fnlen;
size_t astriplen;
size_t striplen;
unsigned long long archivePos;
unsigned long long archiveSize;
mode_t dperms;
mode_t fperms;
/*@only@*/ /*@null@*/
const char ** apath;
int mapflags;
/*@owned@*/ /*@null@*/
int * fmapflags;
/*@owned@*/
void * fsm;
rpmuint32_t color;
int isSource;
/*@owned@*/
rpmuint32_t * replacedSizes;
unsigned int record;
int magic;
#define RPMFIMAGIC 0x09697923
/*=============================*/
#if defined(__LCLINT__)
/*@refs@*/
int nrefs;
#endif
};
#endif /* _RPMFI_INTERNAL */
#ifdef __cplusplus
extern "C" {
#endif
#if !defined(_RPMFI_NOMETHODS)
/*@unused@*/ /*@null@*/
rpmfi rpmfiUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmfi fi,
/*@null@*/ const char * msg)
/*@modifies fi @*/;
#define rpmfiUnlink(_fi, _msg) \
((rpmfi) rpmioUnlinkPoolItem((rpmioItem)(_fi), _msg, __FILE__, __LINE__))
/*@unused@*/ /*@null@*/
rpmfi rpmfiLink (/*@null@*/ rpmfi fi, /*@null@*/ const char * msg)
/*@modifies fi @*/;
#define rpmfiLink(_fi, _msg) \
((rpmfi) rpmioLinkPoolItem((rpmioItem)(_fi), _msg, __FILE__, __LINE__))
int rpmfiFC(/*@null@*/ rpmfi fi)
/*@*/;
/*@unused@*/
int rpmfiFX(/*@null@*/ rpmfi fi)
/*@*/;
/*@unused@*/
int rpmfiSetFX(/*@null@*/ rpmfi fi, int fx)
/*@modifies fi @*/;
int rpmfiDC(/*@null@*/ rpmfi fi)
/*@*/;
int rpmfiDX(/*@null@*/ rpmfi fi)
/*@*/;
int rpmfiSetDX(/*@null@*/ rpmfi fi, int dx)
/*@modifies fi @*/;
int rpmfiIsSource(/*@null@*/ rpmfi fi)
/*@*/;
/*@observer@*/ /*@null@*/
extern const char * rpmfiBN(/*@null@*/ rpmfi fi)
/*@*/;
/*@observer@*/ /*@null@*/
extern const char * rpmfiDN(/*@null@*/ rpmfi fi)
/*@*/;
/*@observer@*/
extern const char * rpmfiFN(/*@null@*/ rpmfi fi)
/*@modifies fi @*/;
extern size_t rpmfiFNMaxLen(/*@null@*/ rpmfi fi)
/*@*/;
rpmuint32_t rpmfiFFlags(/*@null@*/ rpmfi fi)
/*@*/;
rpmuint32_t rpmfiSetFFlags(/*@null@*/ rpmfi fi, rpmuint32_t FFlags)
/*@modifies fi @*/;
rpmuint32_t rpmfiVFlags(/*@null@*/ rpmfi fi)
/*@*/;
rpmuint32_t rpmfiSetVFlags(/*@null@*/ rpmfi fi, rpmuint32_t VFlags)
/*@modifies fi @*/;
rpmuint16_t rpmfiFMode(/*@null@*/ rpmfi fi)
/*@*/;
rpmfileState rpmfiFState(/*@null@*/ rpmfi fi)
/*@*/;
rpmfileState rpmfiSetFState(/*@null@*/ rpmfi fi, rpmfileState fstate)
/*@modifies fi @*/;
/*@observer@*/ /*@null@*/
extern const unsigned char * rpmfiDigest(/*@null@*/ rpmfi fi,
/*@out@*/ /*@null@*/ int * algop,
/*@out@*/ /*@null@*/ size_t * lenp)
/*@modifies *algop, *lenp @*/;
/*@observer@*/ /*@null@*/
extern const char * rpmfiFLink(/*@null@*/ rpmfi fi)
/*@*/;
rpmuint32_t rpmfiFSize(/*@null@*/ rpmfi fi)
/*@*/;
rpmuint16_t rpmfiFRdev(/*@null@*/ rpmfi fi)
/*@*/;
rpmuint32_t rpmfiFInode(/*@null@*/ rpmfi fi)
/*@*/;
rpmuint32_t rpmfiColor(/*@null@*/ rpmfi fi)
/*@*/;
rpmuint32_t rpmfiFColor(/*@null@*/ rpmfi fi)
/*@*/;
/*@-exportlocal@*/
/*@observer@*/ /*@null@*/
extern const char * rpmfiFClass(/*@null@*/ rpmfi fi)
/*@*/;
/*@=exportlocal@*/
/*@-exportlocal@*/
/*@observer@*/ /*@null@*/
extern const char * rpmfiFContext(/*@null@*/ rpmfi fi)
/*@*/;
/*@=exportlocal@*/
rpmuint32_t rpmfiFDepends(/*@null@*/ rpmfi fi,
/*@out@*/ /*@null@*/ const rpmuint32_t ** fddictp)
/*@modifies *fddictp @*/;
rpmuint32_t rpmfiFNlink(/*@null@*/ rpmfi fi)
/*@*/;
rpmuint32_t rpmfiFMtime(/*@null@*/ rpmfi fi)
/*@*/;
/*@observer@*/ /*@null@*/
extern const char * rpmfiFUser(/*@null@*/ rpmfi fi)
/*@*/;
/*@observer@*/ /*@null@*/
extern const char * rpmfiFGroup(/*@null@*/ rpmfi fi)
/*@*/;
/*@null@*/
void * rpmfiExclude(/*@null@*/ const rpmfi fi)
/*@*/;
int rpmfiNExclude(/*@null@*/ const rpmfi fi)
/*@*/;
/*@null@*/
void * rpmfiInclude(/*@null@*/ const rpmfi fi)
/*@*/;
int rpmfiNInclude(/*@null@*/ const rpmfi fi)
/*@*/;
int rpmfiNext(/*@null@*/ rpmfi fi)
/*@modifies fi @*/;
/*@null@*/
rpmfi rpmfiInit(/*@null@*/ rpmfi fi, int fx)
/*@modifies fi @*/;
/*@unused@*/
int rpmfiNextD(/*@null@*/ rpmfi fi)
/*@modifies fi @*/;
/*@unused@*/ /*@null@*/
rpmfi rpmfiInitD(/*@null@*/ rpmfi fi, int dx)
/*@modifies fi @*/;
int rpmfiSetHeader(rpmfi fi, /*@null@*/ Header h)
/*@modifies fi, h @*/;
/*@null@*/
rpmfi rpmfiFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmfi fi)
/*@globals fileSystem @*/
/*@modifies fi, fileSystem @*/;
#define rpmfiFree(_fi) \
((rpmfi) rpmioFreePoolItem((rpmioItem)(_fi), __FUNCTION__, __FILE__, __LINE__))
/*@null@*/
rpmfi rpmfiNew(/*@null@*/ const void * _ts, Header h, rpmTag tagN, int flags)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies _ts, h, rpmGlobalMacroContext, fileSystem, internalState @*/;
int rpmfiFStat(rpmfi fi, /*@out@*/ struct stat * st)
/*@modifies *st @*/;
int rpmfiStat(rpmfi fi, const char * path, /*@out@*/ struct stat * st)
/*@modifies fi, *st @*/;
/*@null@*/
DIR * rpmfiOpendir(rpmfi fi, const char * name)
/*@globals fileSystem, internalState @*/
/*@modifies fi, fileSystem, internalState @*/;
void rpmfiBuildFClasses(Header h,
/*@out@*/ const char *** fclassp, /*@out@*/ rpmuint32_t * fcp)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies h, *fclassp, *fcp, rpmGlobalMacroContext,
fileSystem, internalState @*/;
void rpmfiBuildFContexts(Header h,
/*@out@*/ const char *** fcontextp, /*@out@*/ rpmuint32_t * fcp)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies h, *fcontextp, *fcp, rpmGlobalMacroContext,
fileSystem, internalState @*/;
void rpmfiBuildFSContexts(Header h,
/*@out@*/ const char *** fcontextp, /*@out@*/ rpmuint32_t * fcp)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies h, *fcontextp, *fcp, rpmGlobalMacroContext,
fileSystem, internalState @*/;
void rpmfiBuildREContexts(Header h,
/*@out@*/ const char *** fcontextp, /*@out@*/ rpmuint32_t * fcp)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies h, *fcontextp, *fcp, rpmGlobalMacroContext,
fileSystem, internalState @*/;
void rpmfiBuildFDeps(Header h, rpmTag tagN,
/*@out@*/ const char *** fdepsp, /*@out@*/ rpmuint32_t * fcp)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies h, *fdepsp, *fcp,
rpmGlobalMacroContext, fileSystem, internalState @*/;
int rpmfiCompare(const rpmfi afi, const rpmfi bfi)
/*@*/;
int rpmfiDecideFate(const rpmfi ofi, rpmfi nfi, int skipMissing)
/*@globals h_errno, fileSystem, internalState @*/
/*@modifies nfi, fileSystem, internalState @*/;
/*@-redef@*/
/*@observer@*/
const char * rpmfiTypeString(rpmfi fi)
/*@*/;
/*@=redef@*/
/*@null@*/
rpmRelocation rpmfiFreeRelocations(/*@only@*/ rpmRelocation relocs)
/*@modifies relocs@*/;
/*@only@*/ /*@null@*/
rpmRelocation rpmfiDupeRelocations(rpmRelocation relocs, int * nrelocsp)
/*@modifies *nrelocsp @*/;
int rpmfiAddRelocation(rpmRelocation * relp, int * nrelp,
const char * oldPath, const char * newPath)
/*@modifies *relp, *nrelp @*/;
#endif /* _RPMFI_NOMETHODS */
#ifdef __cplusplus
}
#endif
#endif /* H_RPMDS */