Loading...
Searching...
No Matches
rpmts.h
Go to the documentation of this file.
#ifndef H_RPMTS
#define H_RPMTS
#include <sys/types.h>
#include <rpm/rpmtypes.h>
#include <rpm/rpmte.h>
#include <rpm/rpmps.h>
#include <rpm/rpmsw.h>
#include <rpm/rpmfi.h>
#include <rpm/rpmcallback.h>
#ifdef __cplusplus
extern "C" {
#endif
extern int _rpmts_stats;
enum rpmtransFlags_e {
RPMTRANS_FLAG_NONE = 0,
RPMTRANS_FLAG_TEST = (1 << 0),
RPMTRANS_FLAG_BUILD_PROBS = (1 << 1),
RPMTRANS_FLAG_NOSCRIPTS = (1 << 2),
RPMTRANS_FLAG_JUSTDB = (1 << 3),
RPMTRANS_FLAG_NOTRIGGERS = (1 << 4),
RPMTRANS_FLAG_NODOCS = (1 << 5),
RPMTRANS_FLAG_ALLFILES = (1 << 6),
RPMTRANS_FLAG_NOPLUGINS = (1 << 7),
RPMTRANS_FLAG_NOCONTEXTS = (1 << 8),
RPMTRANS_FLAG_NOCAPS = (1 << 9),
RPMTRANS_FLAG_NODB = (1 << 10),
/* bits 11-13 unused */
RPMTRANS_FLAG_NOPREUNTRANS = (1 << 14),
RPMTRANS_FLAG_NOPOSTUNTRANS = (1 << 15),
RPMTRANS_FLAG_NOTRIGGERPREIN= (1 << 16),
RPMTRANS_FLAG_NOPRE = (1 << 17),
RPMTRANS_FLAG_NOPOST = (1 << 18),
RPMTRANS_FLAG_NOTRIGGERIN = (1 << 19),
RPMTRANS_FLAG_NOTRIGGERUN = (1 << 20),
RPMTRANS_FLAG_NOPREUN = (1 << 21),
RPMTRANS_FLAG_NOPOSTUN = (1 << 22),
RPMTRANS_FLAG_NOTRIGGERPOSTUN = (1 << 23),
RPMTRANS_FLAG_NOPRETRANS = (1 << 24),
RPMTRANS_FLAG_NOPOSTTRANS = (1 << 25),
RPMTRANS_FLAG_NOSYSUSERS = (1 << 26),
RPMTRANS_FLAG_NOMD5 = (1 << 27),
RPMTRANS_FLAG_NOFILEDIGEST = (1 << 27),
/* bit 28 unused */
RPMTRANS_FLAG_NOARTIFACTS = (1 << 29),
RPMTRANS_FLAG_NOCONFIGS = (1 << 30),
RPMTRANS_FLAG_DEPLOOPS = (1 << 31)
};
typedef rpmFlags rpmtransFlags;
#define _noTransScripts \
( RPMTRANS_FLAG_NOPRE | \
RPMTRANS_FLAG_NOPOST | \
RPMTRANS_FLAG_NOPREUN | \
RPMTRANS_FLAG_NOPOSTUN | \
RPMTRANS_FLAG_NOPRETRANS | \
RPMTRANS_FLAG_NOPOSTTRANS | \
RPMTRANS_FLAG_NOPREUNTRANS |\
RPMTRANS_FLAG_NOPOSTUNTRANS \
)
#define _noTransTriggers \
( RPMTRANS_FLAG_NOTRIGGERPREIN | \
RPMTRANS_FLAG_NOTRIGGERIN | \
RPMTRANS_FLAG_NOTRIGGERUN | \
RPMTRANS_FLAG_NOTRIGGERPOSTUN \
)
/* Avoid unnecessary breakage for stuff referring to these unused flags */
#define RPMTRANS_FLAG_NOPAYLOAD 0
#define RPMTRANS_FLAG_APPLYONLY 0
#define RPMTRANS_FLAG_KEEPOBSOLETE 0
#define RPMTRANS_FLAG_DIRSTASH 0
#define RPMTRANS_FLAG_REPACKAGE 0
#define RPMTRANS_FLAG_PKGCOMMIT 0
#define RPMTRANS_FLAG_PKGUNDO 0
#define RPMTRANS_FLAG_COMMIT 0
#define RPMTRANS_FLAG_UNDO 0
#define RPMTRANS_FLAG_REVERSE 0
#define RPMTRANS_FLAG_NOSUGGEST 0
#define RPMTRANS_FLAG_ADDINDEPS 0
enum rpmVSFlags_e {
RPMVSF_DEFAULT = 0,
RPMVSF_NOHDRCHK = (1 << 0),
RPMVSF_NEEDPAYLOAD = (1 << 1),
/* bit(s) 2-7 unused */
RPMVSF_NOSHA1HEADER = (1 << 8),
RPMVSF_NOSHA256HEADER = (1 << 9),
RPMVSF_NODSAHEADER = (1 << 10),
RPMVSF_NORSAHEADER = (1 << 11),
/* bit(s) 12-15 unused */
RPMVSF_NOPAYLOAD = (1 << 16),
RPMVSF_NOMD5 = (1 << 17),
RPMVSF_NODSA = (1 << 18),
RPMVSF_NORSA = (1 << 19)
/* bit(s) 16-31 unused */
};
typedef rpmFlags rpmVSFlags;
#define RPMVSF_MASK_NODIGESTS \
( RPMVSF_NOSHA1HEADER | \
RPMVSF_NOSHA256HEADER | \
RPMVSF_NOPAYLOAD | \
RPMVSF_NOMD5 )
#define _RPMVSF_NODIGESTS RPMVSF_MASK_NODIGESTS
#define RPMVSF_MASK_NOSIGNATURES \
( RPMVSF_NODSAHEADER | \
RPMVSF_NORSAHEADER | \
RPMVSF_NODSA | \
RPMVSF_NORSA )
#define _RPMVSF_NOSIGNATURES RPMVSF_MASK_NOSIGNATURES
#define RPMVSF_MASK_NOHEADER \
( RPMVSF_NOSHA1HEADER | \
RPMVSF_NOSHA256HEADER | \
RPMVSF_NODSAHEADER | \
RPMVSF_NORSAHEADER )
#define _RPMVSF_NOHEADER RPMVSF_MASK_NOHEADER
#define RPMVSF_MASK_NOPAYLOAD \
( RPMVSF_NOMD5 | \
RPMVSF_NOPAYLOAD | \
RPMVSF_NODSA | \
RPMVSF_NORSA )
#define _RPMVSF_NOPAYLOAD RPMVSF_MASK_NOPAYLOAD
enum {
RPMSIG_NONE_TYPE = 0,
RPMSIG_DIGEST_TYPE = (1 << 0),
RPMSIG_SIGNATURE_TYPE = (1 << 1),
RPMSIG_OTHER_TYPE = (1 << 2),
};
#define RPMSIG_VERIFIABLE_TYPE (RPMSIG_DIGEST_TYPE|RPMSIG_SIGNATURE_TYPE)
#define RPMSIG_UNVERIFIED_TYPE (1 << 30)
typedef enum rpmtsOpX_e {
RPMTS_OP_TOTAL = 0,
RPMTS_OP_CHECK = 1,
RPMTS_OP_ORDER = 2,
RPMTS_OP_FINGERPRINT = 3,
RPMTS_OP_INSTALL = 5,
RPMTS_OP_ERASE = 6,
RPMTS_OP_SCRIPTLETS = 7,
RPMTS_OP_COMPRESS = 8,
RPMTS_OP_UNCOMPRESS = 9,
RPMTS_OP_DIGEST = 10,
RPMTS_OP_SIGNATURE = 11,
RPMTS_OP_DBADD = 12,
RPMTS_OP_DBREMOVE = 13,
RPMTS_OP_DBGET = 14,
RPMTS_OP_DBPUT = 15,
RPMTS_OP_DBDEL = 16,
RPMTS_OP_VERIFY = 17,
RPMTS_OP_MAX = 18
} rpmtsOpX;
enum rpmtxnFlags_e {
RPMTXN_READ = (1 << 0),
RPMTXN_WRITE = (1 << 1),
};
typedef rpmFlags rpmtxnFlags;
typedef enum rpmtsEvent_e {
RPMTS_EVENT_ADD = 1,
RPMTS_EVENT_DEL = 2,
} rpmtsEvent;
typedef int (*rpmtsChangeFunction)
(int event, rpmte te, rpmte other, void *data);
int rpmtsCheck(rpmts ts);
int rpmtsOrder(rpmts ts);
int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet);
rpmts rpmtsLink (rpmts ts);
int rpmtsCloseDB(rpmts ts);
int rpmtsOpenDB(rpmts ts, int dbmode);
int rpmtsInitDB(rpmts ts, int perms);
int rpmtsGetDBMode(rpmts ts);
int rpmtsSetDBMode(rpmts ts, int dbmode);
int rpmtsRebuildDB(rpmts ts);
int rpmtsVerifyDB(rpmts ts);
rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmDbiTagVal rpmtag,
const void * keyp, size_t keylen);
rpmRC rpmtsImportHeader(rpmtxn txn, Header h, rpmFlags flags);
rpmRC rpmtsImportPubkey(rpmts ts, const unsigned char * pkt, size_t pktlen);
rpmKeyring rpmtsGetKeyring(rpmts ts, int autoload);
int rpmtsSetKeyring(rpmts ts, rpmKeyring keyring);
int rpmtsSetSolveCallback(rpmts ts,
int (*solve) (rpmts ts, rpmds ds, const void * data),
const void * solveData);
rpmps rpmtsProblems(rpmts ts);
void rpmtsCleanProblems(rpmts ts);
void rpmtsClean(rpmts ts);
void rpmtsEmpty(rpmts ts);
rpmts rpmtsFree(rpmts ts);
rpmVSFlags rpmtsVSFlags(rpmts ts);
rpmVSFlags rpmtsSetVSFlags(rpmts ts, rpmVSFlags vsflags);
rpmVSFlags rpmtsVfyFlags(rpmts ts);
rpmVSFlags rpmtsSetVfyFlags(rpmts ts, rpmVSFlags vfyflags);
int rpmtsVfyLevel(rpmts ts);
int rpmtsSetVfyLevel(rpmts ts, int vfylevel);
const char * rpmtsRootDir(rpmts ts);
int rpmtsSetRootDir(rpmts ts, const char * rootDir);
FD_t rpmtsScriptFd(rpmts ts);
void rpmtsSetScriptFd(rpmts ts, FD_t scriptFd);
rpm_tid_t rpmtsGetTid(rpmts ts);
rpm_tid_t rpmtsSetTid(rpmts ts, rpm_tid_t tid);
rpmdb rpmtsGetRdb(rpmts ts);
void * rpmtsNotify(rpmts ts, rpmte te,
rpmCallbackType what, rpm_loff_t amount, rpm_loff_t total);
int rpmtsNElements(rpmts ts);
rpmte rpmtsElement(rpmts ts, int ix);
rpmprobFilterFlags rpmtsFilterFlags(rpmts ts);
rpmtransFlags rpmtsFlags(rpmts ts);
rpmtransFlags rpmtsSetFlags(rpmts ts, rpmtransFlags transFlags);
rpm_color_t rpmtsColor(rpmts ts);
rpm_color_t rpmtsPrefColor(rpmts ts);
rpm_color_t rpmtsSetColor(rpmts ts, rpm_color_t color);
rpm_color_t rpmtsSetPrefColor(rpmts ts, rpm_color_t color);
rpmop rpmtsOp(rpmts ts, rpmtsOpX opx);
rpmPlugins rpmtsPlugins(rpmts ts);
int rpmtsSetNotifyCallback(rpmts ts,
rpmCallbackFunction notify,
rpmCallbackData notifyData);
int rpmtsSetNotifyStyle(rpmts ts, int style);
int rpmtsGetNotifyStyle(rpmts ts);
int rpmtsSetChangeCallback(rpmts ts, rpmtsChangeFunction notify, void *data);
rpmts rpmtsCreate(void);
int rpmtsAddInstallElement(rpmts ts, Header h,
const fnpyKey key, int upgrade,
rpmRelocation * relocs);
int rpmtsAddReinstallElement(rpmts ts, Header h, const fnpyKey key);
int rpmtsAddRestoreElement(rpmts ts, Header h);
int rpmtsAddEraseElement(rpmts ts, Header h, int dboffset);
rpmtxn rpmtxnBegin(rpmts ts, rpmtxnFlags flags);
rpmtxn rpmtxnEnd(rpmtxn txn);
rpmtsi rpmtsiFree(rpmtsi tsi);
rpmtsi rpmtsiInit(rpmts ts);
rpmte rpmtsiNext(rpmtsi tsi, rpmElementTypes types);
#ifdef __cplusplus
}
#endif
#endif /* H_RPMTS */
rpmtsiNext
rpmte rpmtsiNext(rpmtsi tsi, rpmElementTypes types)
rpmtsiInit
rpmtsi rpmtsiInit(rpmts ts)
rpmtsiFree
rpmtsi rpmtsiFree(rpmtsi tsi)
rpmtsGetNotifyStyle
int rpmtsGetNotifyStyle(rpmts ts)
rpmtxnBegin
rpmtxn rpmtxnBegin(rpmts ts, rpmtxnFlags flags)
rpmVSFlags_e
rpmVSFlags_e
Definition rpmts.h:99
rpmtsSetNotifyCallback
int rpmtsSetNotifyCallback(rpmts ts, rpmCallbackFunction notify, rpmCallbackData notifyData)
rpmtsSetPrefColor
rpm_color_t rpmtsSetPrefColor(rpmts ts, rpm_color_t color)
rpmtsSetColor
rpm_color_t rpmtsSetColor(rpmts ts, rpm_color_t color)
rpmtsAddInstallElement
int rpmtsAddInstallElement(rpmts ts, Header h, const fnpyKey key, int upgrade, rpmRelocation *relocs)
rpmtsFlags
rpmtransFlags rpmtsFlags(rpmts ts)
rpmtsAddReinstallElement
int rpmtsAddReinstallElement(rpmts ts, Header h, const fnpyKey key)
rpmtsProblems
rpmps rpmtsProblems(rpmts ts)
rpmtsElement
rpmte rpmtsElement(rpmts ts, int ix)
rpmtsSetRootDir
int rpmtsSetRootDir(rpmts ts, const char *rootDir)
rpmtsRun
int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet)
rpmtsRebuildDB
int rpmtsRebuildDB(rpmts ts)
rpmtsGetKeyring
rpmKeyring rpmtsGetKeyring(rpmts ts, int autoload)
rpmtsNotify
void * rpmtsNotify(rpmts ts, rpmte te, rpmCallbackType what, rpm_loff_t amount, rpm_loff_t total)
rpmtsSetVfyFlags
rpmVSFlags rpmtsSetVfyFlags(rpmts ts, rpmVSFlags vfyflags)
rpmtsVSFlags
rpmVSFlags rpmtsVSFlags(rpmts ts)
rpmtsGetDBMode
int rpmtsGetDBMode(rpmts ts)
rpmtsFree
rpmts rpmtsFree(rpmts ts)
rpmtsSetKeyring
int rpmtsSetKeyring(rpmts ts, rpmKeyring keyring)
rpmtsSetVSFlags
rpmVSFlags rpmtsSetVSFlags(rpmts ts, rpmVSFlags vsflags)
rpmtsGetTid
rpm_tid_t rpmtsGetTid(rpmts ts)
rpmtsImportHeader
rpmRC rpmtsImportHeader(rpmtxn txn, Header h, rpmFlags flags)
rpmtsVfyFlags
rpmVSFlags rpmtsVfyFlags(rpmts ts)
rpmtsLink
rpmts rpmtsLink(rpmts ts)
rpmtsSetFlags
rpmtransFlags rpmtsSetFlags(rpmts ts, rpmtransFlags transFlags)
rpmtsSetTid
rpm_tid_t rpmtsSetTid(rpmts ts, rpm_tid_t tid)
rpmtsSetScriptFd
void rpmtsSetScriptFd(rpmts ts, FD_t scriptFd)
rpmtsAddEraseElement
int rpmtsAddEraseElement(rpmts ts, Header h, int dboffset)
rpmtsEmpty
void rpmtsEmpty(rpmts ts)
rpmtsSetChangeCallback
int rpmtsSetChangeCallback(rpmts ts, rpmtsChangeFunction notify, void *data)
rpmtsChangeFunction
int(* rpmtsChangeFunction)(int event, rpmte te, rpmte other, void *data)
Definition rpmts.h:204
rpmCallbackFunction
void *(* rpmCallbackFunction)(const void *h, const rpmCallbackType what, const rpm_loff_t amount, const rpm_loff_t total, fnpyKey key, rpmCallbackData data)
Definition rpmcallback.h:61
rpmtsOpenDB
int rpmtsOpenDB(rpmts ts, int dbmode)
rpmtsOpX_e
rpmtsOpX_e
Definition rpmts.h:159
rpmtsSetSolveCallback
int rpmtsSetSolveCallback(rpmts ts, int(*solve)(rpmts ts, rpmds ds, const void *data), const void *solveData)
rpmtsImportPubkey
rpmRC rpmtsImportPubkey(rpmts ts, const unsigned char *pkt, size_t pktlen)
rpmtsCleanProblems
void rpmtsCleanProblems(rpmts ts)
rpmtsRootDir
const char * rpmtsRootDir(rpmts ts)
rpmtsVerifyDB
int rpmtsVerifyDB(rpmts ts)
rpmtsInitIterator
rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmDbiTagVal rpmtag, const void *keyp, size_t keylen)
rpmtsVfyLevel
int rpmtsVfyLevel(rpmts ts)
rpmtsPrefColor
rpm_color_t rpmtsPrefColor(rpmts ts)
rpmtsFilterFlags
rpmprobFilterFlags rpmtsFilterFlags(rpmts ts)
rpmtsOrder
int rpmtsOrder(rpmts ts)
rpmtsOp
rpmop rpmtsOp(rpmts ts, rpmtsOpX opx)
rpmtsSetVfyLevel
int rpmtsSetVfyLevel(rpmts ts, int vfylevel)
rpmtxnEnd
rpmtxn rpmtxnEnd(rpmtxn txn)
rpmtransFlags_e
rpmtransFlags_e
Definition rpmts.h:27
rpmtsCreate
rpmts rpmtsCreate(void)
rpmtsSetDBMode
int rpmtsSetDBMode(rpmts ts, int dbmode)
rpmtsColor
rpm_color_t rpmtsColor(rpmts ts)
rpmtsAddRestoreElement
int rpmtsAddRestoreElement(rpmts ts, Header h)
rpmtsClean
void rpmtsClean(rpmts ts)
rpmtsSetNotifyStyle
int rpmtsSetNotifyStyle(rpmts ts, int style)
rpmtsNElements
int rpmtsNElements(rpmts ts)
rpmtsCloseDB
int rpmtsCloseDB(rpmts ts)
rpmtsGetRdb
rpmdb rpmtsGetRdb(rpmts ts)
rpmtsCheck
int rpmtsCheck(rpmts ts)
rpmtsPlugins
rpmPlugins rpmtsPlugins(rpmts ts)
rpmtsOpX
enum rpmtsOpX_e rpmtsOpX
rpmtsScriptFd
FD_t rpmtsScriptFd(rpmts ts)
rpmtsInitDB
int rpmtsInitDB(rpmts ts, int perms)
RPMTRANS_FLAG_NOCONFIGS
@ RPMTRANS_FLAG_NOCONFIGS
Definition rpmts.h:58
RPMTRANS_FLAG_NOMD5
@ RPMTRANS_FLAG_NOMD5
Definition rpmts.h:54
RPMTRANS_FLAG_NOCAPS
@ RPMTRANS_FLAG_NOCAPS
Definition rpmts.h:38
RPMTRANS_FLAG_NOPREUN
@ RPMTRANS_FLAG_NOPREUN
Definition rpmts.h:48
RPMTRANS_FLAG_NOPLUGINS
@ RPMTRANS_FLAG_NOPLUGINS
Definition rpmts.h:36
RPMTRANS_FLAG_NOFILEDIGEST
@ RPMTRANS_FLAG_NOFILEDIGEST
Definition rpmts.h:55
RPMTRANS_FLAG_NOARTIFACTS
@ RPMTRANS_FLAG_NOARTIFACTS
Definition rpmts.h:57
RPMTRANS_FLAG_NOTRIGGERIN
@ RPMTRANS_FLAG_NOTRIGGERIN
Definition rpmts.h:46
RPMTRANS_FLAG_NOTRIGGERPREIN
@ RPMTRANS_FLAG_NOTRIGGERPREIN
Definition rpmts.h:43
RPMTRANS_FLAG_NOPOSTUNTRANS
@ RPMTRANS_FLAG_NOPOSTUNTRANS
Definition rpmts.h:42
RPMTRANS_FLAG_NOPRETRANS
@ RPMTRANS_FLAG_NOPRETRANS
Definition rpmts.h:51
RPMTRANS_FLAG_NOSCRIPTS
@ RPMTRANS_FLAG_NOSCRIPTS
Definition rpmts.h:31
RPMTRANS_FLAG_NOPOSTUN
@ RPMTRANS_FLAG_NOPOSTUN
Definition rpmts.h:49
RPMTRANS_FLAG_NOPRE
@ RPMTRANS_FLAG_NOPRE
Definition rpmts.h:44
RPMTRANS_FLAG_NOPREUNTRANS
@ RPMTRANS_FLAG_NOPREUNTRANS
Definition rpmts.h:41
RPMTRANS_FLAG_JUSTDB
@ RPMTRANS_FLAG_JUSTDB
Definition rpmts.h:32
RPMTRANS_FLAG_NOTRIGGERPOSTUN
@ RPMTRANS_FLAG_NOTRIGGERPOSTUN
Definition rpmts.h:50
RPMTRANS_FLAG_NOTRIGGERUN
@ RPMTRANS_FLAG_NOTRIGGERUN
Definition rpmts.h:47
RPMTRANS_FLAG_NOPOST
@ RPMTRANS_FLAG_NOPOST
Definition rpmts.h:45
RPMTRANS_FLAG_NODOCS
@ RPMTRANS_FLAG_NODOCS
Definition rpmts.h:34
RPMTRANS_FLAG_NOCONTEXTS
@ RPMTRANS_FLAG_NOCONTEXTS
Definition rpmts.h:37
RPMTRANS_FLAG_NOTRIGGERS
@ RPMTRANS_FLAG_NOTRIGGERS
Definition rpmts.h:33
RPMTRANS_FLAG_NODB
@ RPMTRANS_FLAG_NODB
Definition rpmts.h:39
RPMTRANS_FLAG_ALLFILES
@ RPMTRANS_FLAG_ALLFILES
Definition rpmts.h:35
RPMTRANS_FLAG_TEST
@ RPMTRANS_FLAG_TEST
Definition rpmts.h:29
RPMTRANS_FLAG_DEPLOOPS
@ RPMTRANS_FLAG_DEPLOOPS
Definition rpmts.h:59
RPMTRANS_FLAG_NOPOSTTRANS
@ RPMTRANS_FLAG_NOPOSTTRANS
Definition rpmts.h:52
RPMTRANS_FLAG_NOSYSUSERS
@ RPMTRANS_FLAG_NOSYSUSERS
Definition rpmts.h:53
RPMTRANS_FLAG_BUILD_PROBS
@ RPMTRANS_FLAG_BUILD_PROBS
Definition rpmts.h:30
FD_t
struct _FD_s * FD_t
Definition rpmtypes.h:99
rpmts
struct rpmts_s * rpmts
Definition rpmtypes.h:63
rpmRC
enum rpmRC_e rpmRC
Header
struct headerToken_s * Header
Definition rpmtypes.h:24
rpmcallback.h
rpmCallbackType
enum rpmCallbackType_e rpmCallbackType
rpmfi.h
rpmps.h
rpmsw.h
rpmte.h
rpmtypes.h
rpmRelocation_s
Definition rpmfiles.h:129
rpmop_s
Definition rpmsw.h:42