rpmio/rpmmessages.h

Go to the documentation of this file.
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 /*@-redef@*/ /* LCL: ??? */
00035 typedef /*@abstract@*/ const void * fnpyKey;
00036 /*@=redef@*/
00037 
00041 typedef enum rpmCallbackType_e {
00042     RPMCALLBACK_UNKNOWN         = 0,
00043     RPMCALLBACK_INST_PROGRESS   = (1 <<  0),
00044     RPMCALLBACK_INST_START      = (1 <<  1),
00045     RPMCALLBACK_INST_OPEN_FILE  = (1 <<  2),
00046     RPMCALLBACK_INST_CLOSE_FILE = (1 <<  3),
00047     RPMCALLBACK_TRANS_PROGRESS  = (1 <<  4),
00048     RPMCALLBACK_TRANS_START     = (1 <<  5),
00049     RPMCALLBACK_TRANS_STOP      = (1 <<  6),
00050     RPMCALLBACK_UNINST_PROGRESS = (1 <<  7),
00051     RPMCALLBACK_UNINST_START    = (1 <<  8),
00052     RPMCALLBACK_UNINST_STOP     = (1 <<  9),
00053     RPMCALLBACK_REPACKAGE_PROGRESS = (1 << 10),
00054     RPMCALLBACK_REPACKAGE_START = (1 << 11),
00055     RPMCALLBACK_REPACKAGE_STOP  = (1 << 12),
00056     RPMCALLBACK_UNPACK_ERROR    = (1 << 13),
00057     RPMCALLBACK_CPIO_ERROR      = (1 << 14)
00058 } rpmCallbackType;
00059 
00062 typedef void * rpmCallbackData;
00063 
00064 #ifdef __cplusplus
00065 extern "C" {
00066 #endif
00067 
00070 typedef void * (*rpmCallbackFunction)
00071                 (/*@null@*/ const void * h, 
00072                 const rpmCallbackType what, 
00073                 const unsigned long amount, 
00074                 const unsigned long total,
00075                 /*@null@*/ fnpyKey key,
00076                 /*@null@*/ rpmCallbackData data)
00077         /*@globals internalState@*/
00078         /*@modifies internalState@*/;
00079 
00082 /*@unused@*/
00083 void urlSetCallback(rpmCallbackFunction notify, rpmCallbackData notifyData,
00084                 int notifyCount);
00085 
00086 #ifdef __cplusplus
00087 }
00088 #endif
00089 
00090 #endif  /* H_RPMMESSAGES */

Generated on Fri Oct 12 08:44:54 2007 for rpm by  doxygen 1.5.2