20 #ifndef __RPM_HELPER__
21 #define __RPM_HELPER__
27 #include <rpm/rpmdb.h>
28 #include <rpm/rpmfi.h>
29 #include <rpm/rpmlib.h>
30 #include <rpm/rpmts.h>
31 #include <rpm/rpmmacro.h>
32 #include <rpm/rpmlog.h>
33 #include <rpm/rpmpgp.h>
34 #include <rpm/header.h>
37 #include "common/util.h"
43 pthread_mutex_t mutex;
46 #ifndef HAVE_HEADERFORMAT
47 # define HAVE_LIBRPM44 1
48 # define headerFormat(_h, _fmt, _emsg) headerSprintf((_h),( _fmt), rpmTagTable, rpmHeaderFormats, (_emsg))
51 #ifndef HAVE_RPMFREECRYPTO
52 # define rpmFreeCrypto() while(0)
55 #ifndef HAVE_RPMFREEFILESYSTEMS
56 # define rpmFreeFilesystems() while(0)
59 #define RPM_MUTEX_LOCK(mutex_ptr) \
61 int prev_cancel_state = -1; \
62 if (pthread_mutex_lock(mutex_ptr) != 0) { \
63 dE("Can't lock mutex"); \
66 pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &prev_cancel_state); \
69 #define RPM_MUTEX_UNLOCK(mutex_ptr) \
71 int prev_cancel_state = -1; \
72 if (pthread_mutex_unlock(mutex_ptr) != 0) { \
73 dE("Can't unlock mutex. Aborting..."); \
76 pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &prev_cancel_state); \
80 int rpmErrorCb (rpmlogRec rec, rpmlogCallbackData data);
86 #define DISABLE_PLUGINS(ts) rpmtsSetFlags(ts, RPMTRANS_FLAG_NOPLUGINS)
88 #define DISABLE_PLUGINS(ts) rpmDefineMacro(NULL,"__plugindir \"\"", 0);
91 #ifndef HAVE_RPMVERIFYFILE
92 int rpmVerifyFile(
const rpmts ts,
const rpmfi fi,
93 rpmVerifyAttrs * res, rpmVerifyAttrs omitMask);
100 void rpmLibsPreload(
void);
oscap debug helpers private header
Definition: rpm-helper.h:41