00001 #ifndef H_RPMMESSAGES
00002 #define H_RPMMESSAGES
00003
00009 #include "rpmlog.h"
00010
00011 #define RPMMESS_DEBUG RPMLOG_DEBUG
00012 #define RPMMESS_VERBOSE RPMLOG_INFO
00013 #define RPMMESS_NORMAL RPMLOG_NOTICE
00014 #define RPMMESS_WARNING RPMLOG_WARNING
00015 #define RPMMESS_ERROR RPMLOG_ERR
00016 #define RPMMESS_FATALERROR RPMLOG_CRIT
00017
00018 #define RPMMESS_QUIET RPMMESS_WARNING
00019
00020 #define rpmMessage rpmlog
00021 #define rpmSetVerbosity(_lvl) \
00022 ((void)rpmlogSetMask( RPMLOG_UPTO( RPMLOG_PRI(_lvl))))
00023 #define rpmIncreaseVerbosity() \
00024 ((void)rpmlogSetMask(((((unsigned)(rpmlogSetMask(0) & 0xff)) << 1) | 1)))
00025 #define rpmDecreaseVerbosity() \
00026 ((void)rpmlogSetMask((((int)(rpmlogSetMask(0) & 0xff)) >> 1)))
00027 #define rpmIsNormal() \
00028 (rpmlogSetMask(0) >= RPMLOG_MASK( RPMMESS_NORMAL ))
00029 #define rpmIsVerbose() \
00030 (rpmlogSetMask(0) >= RPMLOG_MASK( RPMMESS_VERBOSE ))
00031 #define rpmIsDebug() \
00032 (rpmlogSetMask(0) >= RPMLOG_MASK( RPMMESS_DEBUG ))
00033
00034
00035 typedef const void * fnpyKey;
00036
00037
00040 typedef enum rpmCallbackType_e {
00041 RPMCALLBACK_INST_PROGRESS,
00042 RPMCALLBACK_INST_START,
00043 RPMCALLBACK_INST_OPEN_FILE,
00044 RPMCALLBACK_INST_CLOSE_FILE,
00045 RPMCALLBACK_TRANS_PROGRESS,
00046 RPMCALLBACK_TRANS_START,
00047 RPMCALLBACK_TRANS_STOP,
00048 RPMCALLBACK_UNINST_PROGRESS,
00049 RPMCALLBACK_UNINST_START,
00050 RPMCALLBACK_UNINST_STOP,
00051 RPMCALLBACK_UNPACK_ERROR,
00052 RPMCALLBACK_CPIO_ERROR
00053 } rpmCallbackType;
00054
00057 typedef void * rpmCallbackData;
00058
00059 #ifdef __cplusplus
00060 extern "C" {
00061 #endif
00062
00065 typedef void * (*rpmCallbackFunction)
00066 ( const void * h,
00067 const rpmCallbackType what,
00068 const unsigned long amount,
00069 const unsigned long total,
00070 fnpyKey key,
00071 rpmCallbackData data)
00072
00073 ;
00074
00077
00078 void urlSetCallback(rpmCallbackFunction notify, rpmCallbackData notifyData,
00079 int notifyCount);
00080
00081 #ifdef __cplusplus
00082 }
00083 #endif
00084
00085 #endif