20 #ifndef __RPM_HELPER__
21 #define __RPM_HELPER__
27 #include <rpm/rpmdb.h>
28 #include <rpm/rpmlib.h>
29 #include <rpm/rpmts.h>
30 #include <rpm/rpmmacro.h>
31 #include <rpm/rpmlog.h>
32 #include <rpm/header.h>
35 #include "common/util.h"
41 pthread_mutex_t mutex;
44 #ifndef HAVE_HEADERFORMAT
45 # define HAVE_LIBRPM44 1
46 # define headerFormat(_h, _fmt, _emsg) headerSprintf((_h),( _fmt), rpmTagTable, rpmHeaderFormats, (_emsg))
49 #ifndef HAVE_RPMFREECRYPTO
50 # define rpmFreeCrypto() while(0)
53 #ifndef HAVE_RPMFREEFILESYSTEMS
54 # define rpmFreeFilesystems() while(0)
57 #define RPM_MUTEX_LOCK(mutex_ptr) \
59 int prev_cancel_state = -1; \
60 if (pthread_mutex_lock(mutex_ptr) != 0) { \
61 dE("Can't lock mutex"); \
64 pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &prev_cancel_state); \
67 #define RPM_MUTEX_UNLOCK(mutex_ptr) \
69 int prev_cancel_state = -1; \
70 if (pthread_mutex_unlock(mutex_ptr) != 0) { \
71 dE("Can't unlock mutex. Aborting..."); \
74 pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &prev_cancel_state); \
77 int rpmErrorCb (rpmlogRec rec, rpmlogCallbackData data);
83 void rpmLibsPreload(
void);
Definition: rpm-helper.h:39
oscap debug helpers private header