psm.h
Go to the documentation of this file.
#ifndef H_PSM
#define H_PSM
typedef /*@abstract@*/ /*@refcounted@*/ struct rpmpsm_s * rpmpsm;
#include <rpmsq.h>
/*@-exportlocal@*/
/*@unchecked@*/
extern int _psm_debug;
/*@=exportlocal@*/
#define PSM_VERBOSE 0x8000
#define PSM_INTERNAL 0x4000
#define PSM_SYSCALL 0x2000
#define PSM_DEAD 0x1000
#define _fv(_a) ((_a) | PSM_VERBOSE)
#define _fi(_a) ((_a) | PSM_INTERNAL)
#define _fs(_a) ((_a) | (PSM_INTERNAL | PSM_SYSCALL))
#define _fd(_a) ((_a) | (PSM_INTERNAL | PSM_DEAD))
typedef enum pkgStage_e {
PSM_UNKNOWN = 0,
PSM_INIT = 1,
PSM_PRE = 2,
PSM_PROCESS = 3,
PSM_POST = 4,
PSM_UNDO = 5,
PSM_FINI = 6,
PSM_PKGINSTALL = 7,
PSM_PKGERASE = 8,
PSM_PKGCOMMIT = 10,
PSM_PKGSAVE = 12,
PSM_CREATE = 17,
PSM_NOTIFY = 22,
PSM_DESTROY = 23,
PSM_COMMIT = 25,
PSM_CHROOT_IN = 51,
PSM_CHROOT_OUT = 52,
PSM_SCRIPT = 53,
PSM_TRIGGERS = 54,
PSM_IMMED_TRIGGERS = 55,
PSM_RPMIO_FLAGS = 56,
PSM_RPMDB_LOAD = 97,
PSM_RPMDB_ADD = 98,
PSM_RPMDB_REMOVE = 99
} pkgStage;
#undef _fv
#undef _fi
#undef _fs
#undef _fd
typedef enum rpmScriptID_e {
RPMSCRIPT_UNKNOWN = 0,
RPMSCRIPT_PRETRANS = 1,
RPMSCRIPT_TRIGGERPREIN = 2,
RPMSCRIPT_PREIN = 3,
RPMSCRIPT_POSTIN = 4,
RPMSCRIPT_TRIGGERIN = 5,
RPMSCRIPT_TRIGGERUN = 6,
RPMSCRIPT_PREUN = 7,
RPMSCRIPT_POSTUN = 8,
RPMSCRIPT_TRIGGERPOSTUN = 9,
RPMSCRIPT_POSTTRANS = 10,
/* 11-15 unused */
RPMSCRIPT_VERIFY = 16,
RPMSCRIPT_SANITYCHECK = 17,
RPMSCRIPT_MAX = 32
} rpmScriptID;
typedef enum rpmScriptState_e {
RPMSCRIPT_STATE_UNKNOWN = 0,
/* 0-15 reserved for waitpid return. */
RPMSCRIPT_STATE_EXEC = (1 << 16),
RPMSCRIPT_STATE_REAPED = (1 << 17),
/* 18-23 unused */
RPMSCRIPT_STATE_SELINUX = (1 << 24),
RPMSCRIPT_STATE_EMULATOR = (1 << 25),
RPMSCRIPT_STATE_LUA = (1 << 26)
} rpmScriptState;
typedef enum rpmpsmFlags_e {
RPMPSM_FLAGS_DEBUG = (1 << 0),
RPMPSM_FLAGS_CHROOTDONE = (1 << 1),
RPMPSM_FLAGS_UNORDERED = (1 << 2),
RPMPSM_FLAGS_GOTTRIGGERS = (1 << 3),
} rpmpsmFlags;
struct rpmpsm_s {
struct rpmioItem_s _item;
struct rpmsqElem sq;
/*@only@*/ /*@null@*/
const char * NVRA;
rpmpsmFlags flags;
/*@refcounted@*/
rpmts ts;
/*@dependent@*/ /*@null@*/
rpmte te;
/*@refcounted@*/ /*@relnull@*/
rpmfi fi;
/*@refcounted@*/ /*@relnull@*/
rpmds triggers;
/*@null@*/
const char ** Tpats;
/*@null@*/
void * Tmires;
int nTmires;
/*@only@*/
HE_t IPhe;
/*@relnull@*/
FD_t cfd;
/*@relnull@*/
FD_t fd;
Header oh;
/*@null@*/
rpmmi mi;
/*@observer@*/
const char * stepName;
/*@only@*/ /*@null@*/
const char * rpmio_flags;
/*@only@*/ /*@null@*/
const char * payload_format;
/*@only@*/ /*@null@*/
const char * failedFile;
/*@only@*/ /*@null@*/
const char * pkgURL;
/*@dependent@*/
const char * pkgfn;
/*@only@*/ /*@null@*/
int *sstates;
rpmTag scriptTag;
rpmTag progTag;
int npkgs_installed;
int scriptArg;
int sense;
int countCorrection;
rpmCallbackType what;
unsigned long long amount;
unsigned long long total;
rpmRC rc;
pkgStage goal;
/*@unused@*/
pkgStage stage;
pkgStage nstage;
#if defined(__LCLINT__)
/*@refs@*/
int nrefs;
#endif
};
#ifdef __cplusplus
extern "C" {
#endif
/*@unused@*/ /*@null@*/
rpmpsm rpmpsmUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmpsm psm,
/*@null@*/ const char * msg)
/*@modifies psm @*/;
#define rpmpsmUnlink(_psm, _msg) \
((rpmpsm)rpmioUnlinkPoolItem((rpmioItem)(_psm), _msg, __FILE__, __LINE__))
/*@unused@*/ /*@newref@*/ /*@null@*/
rpmpsm rpmpsmLink (/*@null@*/ rpmpsm psm, /*@null@*/ const char * msg)
/*@modifies psm @*/;
#define rpmpsmLink(_psm, _msg) \
((rpmpsm)rpmioLinkPoolItem((rpmioItem)(_psm), _msg, __FILE__, __LINE__))
/*@null@*/
rpmpsm rpmpsmFree(/*@killref@*/ /*@only@*/ /*@null@*/ rpmpsm psm,
/*@null@*/ const char * msg)
/*@globals fileSystem @*/
/*@modifies psm, fileSystem @*/;
#define rpmpsmFree(_psm, _msg) \
((rpmpsm)rpmioFreePoolItem((rpmioItem)(_psm), _msg, __FILE__, __LINE__))
/*@null@*/
rpmpsm rpmpsmNew(rpmts ts, /*@null@*/ rpmte te, rpmfi fi)
/*@modifies ts, fi @*/;
rpmRC rpmpsmStage(rpmpsm psm, pkgStage stage)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies psm, rpmGlobalMacroContext, fileSystem, internalState @*/;
#define rpmpsmUNSAFE rpmpsmSTAGE
#ifdef __cplusplus
}
#endif
#endif /* H_PSM */