00001 #ifndef H_RPMERR
00002 #define H_RPMERR
00003
00009 #include "rpmlog.h"
00010
00011 #define _em(_e) \
00012 (((_e) << 16) | RPMLOG_MAKEPRI(RPMLOG_ERRMSG, RPMLOG_ERR))
00013 #define _wm(_e) \
00014 (((_e) << 16) | RPMLOG_MAKEPRI(RPMLOG_ERRMSG, RPMLOG_WARNING))
00015 #define _nm(_e) \
00016 (((_e) << 16) | RPMLOG_MAKEPRI(RPMLOG_ERRMSG, RPMLOG_NOTICE))
00017 #define _im(_e) \
00018 (((_e) << 16) | RPMLOG_MAKEPRI(RPMLOG_ERRMSG, RPMLOG_INFO))
00019 #define _dm(_e) \
00020 (((_e) << 16) | RPMLOG_MAKEPRI(RPMLOG_ERRMSG, RPMLOG_DEBUG))
00021
00025
00026 typedef enum rpmerrCode_e {
00027
00028 RPMERR_GDBMOPEN = _em(2),
00029 RPMERR_GDBMREAD = _em(3),
00030 RPMERR_GDBMWRITE = _em(4),
00031
00032 RPMERR_INTERNAL = _em(5),
00033 RPMERR_DBCORRUPT = _em(6),
00034
00035 RPMERR_OLDDBCORRUPT = _em(7),
00036 RPMERR_OLDDBMISSING = _em(8),
00037 RPMERR_NOCREATEDB = _em(9),
00038
00039 RPMERR_DBOPEN = _em(10),
00040 RPMERR_DBGETINDEX = _em(11),
00041 RPMERR_DBPUTINDEX = _em(12),
00042 RPMERR_NEWPACKAGE = _em(13),
00043 RPMERR_BADMAGIC = _em(14),
00044 RPMERR_RENAME = _em(15),
00045 RPMERR_UNLINK = _em(16),
00046 RPMERR_RMDIR = _em(17),
00047
00048 RPMERR_PKGINSTALLED = _em(18),
00049 RPMERR_CHOWN = _em(19),
00050 RPMERR_NOUSER = _em(20),
00051 RPMERR_NOGROUP = _em(21),
00052
00053 RPMERR_MKDIR = _em(22),
00054
00055 RPMERR_FILECONFLICT = _em(23),
00056
00057 RPMERR_RPMRC = _em(24),
00058 RPMERR_NOSPEC = _em(25),
00059 RPMERR_NOTSRPM = _em(26),
00060
00061 RPMERR_FLOCK = _em(27),
00062 RPMERR_OLDPACKAGE = _em(28),
00063
00064
00065 RPMERR_CREATE = _em(30),
00066 RPMERR_NOSPACE = _em(31),
00067
00068 RPMERR_NORELOCATE = _em(32),
00069
00070 RPMMESS_BACKUP = _em(34),
00071
00072 RPMERR_MTAB = _em(35),
00073 RPMERR_STAT = _em(36),
00074 RPMERR_BADDEV = _em(37),
00075
00076 RPMMESS_ALTNAME = _em(38),
00077 RPMMESS_PREREQLOOP = _em(39),
00078 RPMERR_BADRELOCATE = _em(40),
00079 RPMERR_OLDDB = _em(41),
00080
00081
00082 RPMERR_UNMATCHEDIF = _em(107),
00083 RPMERR_RELOAD = _em(108),
00084 RPMERR_BADARG = _em(109),
00085 RPMERR_SCRIPT = _em(110),
00086 RPMERR_READ = _em(111),
00087
00088 RPMERR_UNKNOWNOS = _em(112),
00089 RPMERR_UNKNOWNARCH = _em(113),
00090
00091 RPMERR_EXEC = _em(114),
00092 RPMERR_FORK = _em(115),
00093 RPMERR_CPIO = _em(116),
00094
00095 RPMERR_GZIP = _em(117),
00096
00097 RPMERR_BADSPEC = _em(118),
00098
00099 RPMERR_LDD = _em(119),
00100
00101 RPMERR_BADFILENAME = _em(120),
00102 RPMERR_OPEN = _em(121),
00103 RPMERR_POPEN = _em(122),
00104 RPMERR_NOTREG = _em(123),
00105 RPMERR_QUERY = _em(124),
00106 RPMERR_QFMT = _em(125),
00107 RPMERR_DBCONFIG = _em(126),
00108
00109 RPMERR_DBERR = _em(127),
00110 RPMERR_BADPACKAGE = _em(128),
00111 RPMERR_FREELIST = _em(129),
00112
00113 RPMERR_DATATYPE = _em(130),
00114 RPMERR_BUILDROOT = _em(131),
00115 RPMERR_MAKETEMP = _em(132),
00116 RPMERR_FWRITE = _em(133),
00117 RPMERR_FREAD = _em(134),
00118 RPMERR_READLEAD = _em(135),
00119 RPMERR_WRITELEAD = _em(136),
00120 RPMERR_QUERYINFO = _nm(137),
00121 RPMERR_MANIFEST = _nm(138),
00122 RPMERR_BADHEADER = _em(139),
00123 RPMERR_FSEEK = _em(140),
00124 RPMERR_REGCOMP = _em(141),
00125 RPMERR_REGEXEC = _em(142),
00127 RPMERR_BADSIGTYPE = _em(200),
00128 RPMERR_SIGGEN = _em(201),
00129 RPMERR_SIGVFY = _nm(202),
00130 RPMERR_IMPORT = _em(203),
00132 RPMDEBUG_UNLINK = _dm(512u+16),
00133 RPMDEBUG_RMDIR = _dm(512u+17),
00134
00135 RPMWARN_FLOCK = _wm(512u+27)
00136
00137 } rpmerrCode;
00138
00139
00143 #define rpmError rpmlog
00144 #define rpmErrorCode() rpmlogCode()
00145 #define rpmErrorString() rpmlogMessage()
00146 #define rpmErrorSetCallback(_cb) rpmlogSetCallback(_cb)
00147
00148 typedef rpmlogCallback rpmErrorCallBackType;
00149
00150
00151
00152 #endif