- Main Page
- Modules
- Data Structures
- Files
- Related Pages

- File List
- Globals

# lib/rpmlib.h

Go to the documentation of this file.

    00001 #ifndef H_RPMLIB
    00002 #define H_RPMLIB
    00003
    00008 #include "rpmio.h"
    00009 #include "rpmmessages.h"
    00010 #include "rpmerr.h"
    00011 #include "header.h"
    00012 #include "popt.h"
    00013
    00017 typedef enum rpmRC_e {
    00018     RPMRC_OK            = 0,
    00019     RPMRC_BADMAGIC      = 1,
    00020     RPMRC_FAIL          = 2,
    00021     RPMRC_BADSIZE       = 3,
    00022     RPMRC_SHORTREAD     = 4
    00023 } rpmRC;
    00024
    00025 /*@-redecl@*/
    00026 /*@checked@*/
    00027 extern struct MacroContext_s * rpmGlobalMacroContext;
    00028
    00029 /*@checked@*/
    00030 extern struct MacroContext_s * rpmCLIMacroContext;
    00031
    00032 /*@observer@*/ /*@checked@*/
    00033 extern const char * RPMVERSION;
    00034
    00035 /*@observer@*/ /*@checked@*/
    00036 extern const char * rpmNAME;
    00037
    00038 /*@observer@*/ /*@checked@*/
    00039 extern const char * rpmEVR;
    00040
    00041 /*@checked@*/
    00042 extern int rpmFLAGS;
    00043 /*@=redecl@*/
    00044
    00045 #ifdef __cplusplus
    00046 extern "C" {
    00047 #endif
    00048
    00054 /*@unused@*/ static inline /*@null@*/
    00055 void * _free(/*@only@*/ /*@null@*/ /*@out@*/ const void * p)
    00056         /*@modifies p @*/
    00057 {
    00058     if (p != NULL)      free((void *)p);
    00059     return NULL;
    00060 }
    00061
    00071 rpmRC rpmReadPackageInfo(FD_t fd, /*@null@*/ /*@out@*/ Header * sigp,
    00072                 /*@null@*/ /*@out@*/ Header * hdrp)
    00073         /*@globals fileSystem @*/
    00074         /*@modifies fd, *sigp, *hdrp, fileSystem @*/;
    00075
    00085 rpmRC rpmReadPackageHeader(FD_t fd, /*@null@*/ /*@out@*/ Header * hdrp,
    00086                 /*@null@*/ /*@out@*/ int * isSource,
    00087                 /*@null@*/ /*@out@*/ int * major,
    00088                 /*@null@*/ /*@out@*/ int * minor)
    00089         /*@globals fileSystem @*/
    00090         /*@modifies fd, *hdrp, *isSource, *major, *minor, fileSystem @*/;
    00091
    00100 int headerNVR(Header h,
    00101                 /*@null@*/ /*@out@*/ const char ** np,
    00102                 /*@null@*/ /*@out@*/ const char ** vp,
    00103                 /*@null@*/ /*@out@*/ const char ** rp)
    00104         /*@modifies *np, *vp, *rp @*/;
    00105
    00111 void headerMergeLegacySigs(Header h, const Header sig)
    00112         /*@modifies h @*/;
    00113
    00119 Header headerRegenSigHeader(const Header h)
    00120         /*@*/;
    00121
    00135 void rpmBuildFileList(Header h, /*@out@*/ const char *** fileListPtr,
    00136                 /*@out@*/ int * fileCountPtr)
    00137         /*@modifies *fileListPtr, *fileCountPtr @*/;
    00138
    00152 int rpmHeaderGetEntry(Header h, int_32 tag, /*@out@*/ int_32 *type,
    00153                 /*@out@*/ void **p, /*@out@*/ int_32 *c)
    00154         /*@modifies *type, *p, *c @*/;
    00155
    00171 /*@unused@*/
    00172 int rpmPackageGetEntry(void *leadp, Header sigs, Header h,
    00173                 int_32 tag, int_32 *type, void **p, int_32 *c)
    00174         /*@modifies h, *type, *p, *c @*/;
    00175
    00179 /*@-redecl@*/
    00180 /*@observer@*/ /*@unchecked@*/
    00181 extern const struct headerTagTableEntry_s rpmTagTable[];
    00182 /*@=redecl@*/
    00183
    00187 /*@-redecl@*/
    00188 /*@unchecked@*/
    00189 extern const int rpmTagTableSize;
    00190 /*@=redecl@*/
    00191
    00196 /*@-redecl@*/
    00197 /*@observer@*/ /*@unchecked@*/
    00198 extern const struct headerSprintfExtension_s rpmHeaderFormats[];
    00199 /*@=redecl@*/
    00200
    00204 #define RPMDBI_PACKAGES         0
    00205 #define RPMDBI_DEPENDS          1
    00206 #define RPMDBI_LABEL            2
    00207 #define RPMDBI_ADDED            3
    00208 #define RPMDBI_REMOVED          4
    00209 #define RPMDBI_AVAILABLE        5
    00215 typedef enum rpmTag_e {
    00216
    00217     RPMTAG_HEADERIMAGE          = HEADER_IMAGE,
    00218     RPMTAG_HEADERSIGNATURES     = HEADER_SIGNATURES,
    00219     RPMTAG_HEADERIMMUTABLE      = HEADER_IMMUTABLE,
    00220 /*@-enummemuse@*/
    00221     RPMTAG_HEADERREGIONS        = HEADER_REGIONS,
    00223     RPMTAG_HEADERI18NTABLE      = HEADER_I18NTABLE,
    00224 /*@=enummemuse@*/
    00225
    00226 /* Retrofit (and uniqify) signature tags for use by tagName() and rpmQuery. */
    00227 /* the md5 sum was broken *twice* on big endian machines */
    00228 /* XXX 2nd underscore prevents tagTable generation */
    00229     RPMTAG_SIG_BASE             = HEADER_SIGBASE,
    00230     RPMTAG_SIGSIZE              = RPMTAG_SIG_BASE+1,
    00231     RPMTAG_SIGLEMD5_1           = RPMTAG_SIG_BASE+2,
    00232     RPMTAG_SIGPGP               = RPMTAG_SIG_BASE+3,
    00233     RPMTAG_SIGLEMD5_2           = RPMTAG_SIG_BASE+4,
    00234     RPMTAG_SIGMD5               = RPMTAG_SIG_BASE+5,
    00235     RPMTAG_SIGGPG               = RPMTAG_SIG_BASE+6,
    00236     RPMTAG_SIGPGP5              = RPMTAG_SIG_BASE+7,
    00238 /*@-enummemuse@*/
    00239     RPMTAG_BADSHA1HEADER        = RPMTAG_SIG_BASE+8,
    00240 /*@=enummemuse@*/
    00241     RPMTAG_SHA1HEADER           = RPMTAG_SIG_BASE+9,
    00242
    00243     RPMTAG_NAME                 = 1000,
    00244     RPMTAG_VERSION              = 1001,
    00245     RPMTAG_RELEASE              = 1002,
    00246     RPMTAG_EPOCH                = 1003,
    00247 #define RPMTAG_SERIAL   RPMTAG_EPOCH    /* backward comaptibility */
    00248     RPMTAG_SUMMARY              = 1004,
    00249     RPMTAG_DESCRIPTION          = 1005,
    00250     RPMTAG_BUILDTIME            = 1006,
    00251     RPMTAG_BUILDHOST            = 1007,
    00252     RPMTAG_INSTALLTIME          = 1008,
    00253     RPMTAG_SIZE                 = 1009,
    00254     RPMTAG_DISTRIBUTION         = 1010,
    00255     RPMTAG_VENDOR               = 1011,
    00256     RPMTAG_GIF                  = 1012,
    00257     RPMTAG_XPM                  = 1013,
    00258     RPMTAG_LICENSE              = 1014,
    00259 #define RPMTAG_COPYRIGHT RPMTAG_LICENSE /* backward comaptibility */
    00260     RPMTAG_PACKAGER             = 1015,
    00261     RPMTAG_GROUP                = 1016,
    00262 /*@-enummemuse@*/
    00263     RPMTAG_CHANGELOG            = 1017,
    00264 /*@=enummemuse@*/
    00265     RPMTAG_SOURCE               = 1018,
    00266     RPMTAG_PATCH                = 1019,
    00267     RPMTAG_URL                  = 1020,
    00268     RPMTAG_OS                   = 1021,
    00269     RPMTAG_ARCH                 = 1022,
    00270     RPMTAG_PREIN                = 1023,
    00271     RPMTAG_POSTIN               = 1024,
    00272     RPMTAG_PREUN                = 1025,
    00273     RPMTAG_POSTUN               = 1026,
    00274     RPMTAG_OLDFILENAMES         = 1027, /* obsolete */
    00275     RPMTAG_FILESIZES            = 1028,
    00276     RPMTAG_FILESTATES           = 1029,
    00277     RPMTAG_FILEMODES            = 1030,
    00278     RPMTAG_FILEUIDS             = 1031,
    00279     RPMTAG_FILEGIDS             = 1032,
    00280     RPMTAG_FILERDEVS            = 1033,
    00281     RPMTAG_FILEMTIMES           = 1034,
    00282     RPMTAG_FILEMD5S             = 1035,
    00283     RPMTAG_FILELINKTOS          = 1036,
    00284     RPMTAG_FILEFLAGS            = 1037,
    00285 /*@-enummemuse@*/
    00286     RPMTAG_ROOT                 = 1038,
    00287 /*@=enummemuse@*/
    00288     RPMTAG_FILEUSERNAME         = 1039,
    00289     RPMTAG_FILEGROUPNAME        = 1040,
    00290 /*@-enummemuse@*/
    00291     RPMTAG_EXCLUDE              = 1041,
    00292     RPMTAG_EXCLUSIVE            = 1042,
    00293 /*@=enummemuse@*/
    00294     RPMTAG_ICON                 = 1043,
    00295     RPMTAG_SOURCERPM            = 1044,
    00296     RPMTAG_FILEVERIFYFLAGS      = 1045,
    00297     RPMTAG_ARCHIVESIZE          = 1046,
    00298     RPMTAG_PROVIDENAME          = 1047,
    00299 #define RPMTAG_PROVIDES RPMTAG_PROVIDENAME      /* backward comaptibility */
    00300     RPMTAG_REQUIREFLAGS         = 1048,
    00301     RPMTAG_REQUIRENAME          = 1049,
    00302     RPMTAG_REQUIREVERSION       = 1050,
    00303     RPMTAG_NOSOURCE             = 1051,
    00304     RPMTAG_NOPATCH              = 1052,
    00305     RPMTAG_CONFLICTFLAGS        = 1053,
    00306     RPMTAG_CONFLICTNAME         = 1054,
    00307     RPMTAG_CONFLICTVERSION      = 1055,
    00308     RPMTAG_DEFAULTPREFIX        = 1056,
    00309     RPMTAG_BUILDROOT            = 1057,
    00310     RPMTAG_INSTALLPREFIX        = 1058,
    00311     RPMTAG_EXCLUDEARCH          = 1059,
    00312     RPMTAG_EXCLUDEOS            = 1060,
    00313     RPMTAG_EXCLUSIVEARCH        = 1061,
    00314     RPMTAG_EXCLUSIVEOS          = 1062,
    00315     RPMTAG_AUTOREQPROV          = 1063,
    00316     RPMTAG_RPMVERSION           = 1064,
    00317     RPMTAG_TRIGGERSCRIPTS       = 1065,
    00318     RPMTAG_TRIGGERNAME          = 1066,
    00319     RPMTAG_TRIGGERVERSION       = 1067,
    00320     RPMTAG_TRIGGERFLAGS         = 1068,
    00321     RPMTAG_TRIGGERINDEX         = 1069,
    00322     RPMTAG_VERIFYSCRIPT         = 1079,
    00323     RPMTAG_CHANGELOGTIME        = 1080,
    00324     RPMTAG_CHANGELOGNAME        = 1081,
    00325     RPMTAG_CHANGELOGTEXT        = 1082,
    00326 /*@-enummemuse@*/
    00327     RPMTAG_BROKENMD5            = 1083,
    00328 /*@=enummemuse@*/
    00329     RPMTAG_PREREQ               = 1084,
    00330     RPMTAG_PREINPROG            = 1085,
    00331     RPMTAG_POSTINPROG           = 1086,
    00332     RPMTAG_PREUNPROG            = 1087,
    00333     RPMTAG_POSTUNPROG           = 1088,
    00334     RPMTAG_BUILDARCHS           = 1089,
    00335     RPMTAG_OBSOLETENAME         = 1090,
    00336 #define RPMTAG_OBSOLETES RPMTAG_OBSOLETENAME    /* backward comaptibility */
    00337     RPMTAG_VERIFYSCRIPTPROG     = 1091,
    00338     RPMTAG_TRIGGERSCRIPTPROG    = 1092,
    00339     RPMTAG_DOCDIR               = 1093,
    00340     RPMTAG_COOKIE               = 1094,
    00341     RPMTAG_FILEDEVICES          = 1095,
    00342     RPMTAG_FILEINODES           = 1096,
    00343     RPMTAG_FILELANGS            = 1097,
    00344     RPMTAG_PREFIXES             = 1098,
    00345     RPMTAG_INSTPREFIXES         = 1099,
    00346     RPMTAG_TRIGGERIN            = 1100,
    00347     RPMTAG_TRIGGERUN            = 1101,
    00348     RPMTAG_TRIGGERPOSTUN        = 1102,
    00349     RPMTAG_AUTOREQ              = 1103,
    00350     RPMTAG_AUTOPROV             = 1104,
    00351 /*@-enummemuse@*/
    00352     RPMTAG_CAPABILITY           = 1105,
    00353 /*@=enummemuse@*/
    00354     RPMTAG_SOURCEPACKAGE        = 1106,
    00355 /*@-enummemuse@*/
    00356     RPMTAG_OLDORIGFILENAMES     = 1107,
    00357 /*@=enummemuse@*/
    00358     RPMTAG_BUILDPREREQ          = 1108,
    00359     RPMTAG_BUILDREQUIRES        = 1109,
    00360     RPMTAG_BUILDCONFLICTS       = 1110,
    00361 /*@-enummemuse@*/
    00362     RPMTAG_BUILDMACROS          = 1111,
    00363 /*@=enummemuse@*/
    00364     RPMTAG_PROVIDEFLAGS         = 1112,
    00365     RPMTAG_PROVIDEVERSION       = 1113,
    00366     RPMTAG_OBSOLETEFLAGS        = 1114,
    00367     RPMTAG_OBSOLETEVERSION      = 1115,
    00368     RPMTAG_DIRINDEXES           = 1116,
    00369     RPMTAG_BASENAMES            = 1117,
    00370     RPMTAG_DIRNAMES             = 1118,
    00371     RPMTAG_ORIGDIRINDEXES       = 1119,
    00372     RPMTAG_ORIGBASENAMES        = 1120,
    00373     RPMTAG_ORIGDIRNAMES         = 1121,
    00374     RPMTAG_OPTFLAGS             = 1122,
    00375     RPMTAG_DISTURL              = 1123,
    00376     RPMTAG_PAYLOADFORMAT        = 1124,
    00377     RPMTAG_PAYLOADCOMPRESSOR    = 1125,
    00378     RPMTAG_PAYLOADFLAGS         = 1126,
    00379     RPMTAG_MULTILIBS            = 1127,
    00380     RPMTAG_INSTALLTID           = 1128,
    00381     RPMTAG_REMOVETID            = 1129,
    00382     RPMTAG_SHA1RHN              = 1130,
    00383     RPMTAG_RHNPLATFORM          = 1131,
    00384     RPMTAG_PLATFORM             = 1132,
    00385 /*@-enummemuse@*/
    00386     RPMTAG_FIRSTFREE_TAG
    00387 /*@=enummemuse@*/
    00388 } rpmTag;
    00389
    00390 #define RPMTAG_EXTERNAL_TAG             1000000
    00391
    00395 typedef enum rpmfileState_e {
    00396     RPMFILE_STATE_NORMAL        = 0,
    00397     RPMFILE_STATE_REPLACED      = 1,
    00398     RPMFILE_STATE_NOTINSTALLED  = 2,
    00399     RPMFILE_STATE_NETSHARED     = 3
    00400 } rpmfileState;
    00401
    00405 typedef enum rpmfileAttrs_e {
    00406 /*@-enummemuse@*/
    00407     RPMFILE_NONE        = 0,
    00408 /*@=enummemuse@*/
    00409     RPMFILE_CONFIG      = (1 << 0),
    00410     RPMFILE_DOC         = (1 << 1),
    00411 /*@-enummemuse@*/
    00412     RPMFILE_DONOTUSE    = (1 << 2),
    00413 /*@=enummemuse@*/
    00414     RPMFILE_MISSINGOK   = (1 << 3),
    00415     RPMFILE_NOREPLACE   = (1 << 4),
    00416     RPMFILE_SPECFILE    = (1 << 5),
    00417     RPMFILE_GHOST       = (1 << 6),
    00418     RPMFILE_LICENSE     = (1 << 7),
    00419     RPMFILE_README      = (1 << 8),
    00420     RPMFILE_EXCLUDE     = (1 << 9)
    00421 } rpmfileAttrs;
    00422 #define RPMFILE_MULTILIB_SHIFT          9
    00423 #define RPMFILE_MULTILIB(N)             ((N) << RPMFILE_MULTILIB_SHIFT)
    00424 #define RPMFILE_MULTILIB_MASK           RPMFILE_MULTILIB(7)
    00425
    00426 #define RPMFILE_ALL     ~(RPMFILE_NONE)
    00427
    00428 /* XXX Check file flags for multilib marker. */
    00429 #define isFileMULTILIB(_fflags)         ((_fflags) & RPMFILE_MULTILIB_MASK)
    00430
    00434 typedef enum rpmsenseFlags_e {
    00435     RPMSENSE_ANY        = 0,
    00436 /*@-enummemuse@*/
    00437     RPMSENSE_SERIAL     = (1 << 0),
    00438 /*@=enummemuse@*/
    00439     RPMSENSE_LESS       = (1 << 1),
    00440     RPMSENSE_GREATER    = (1 << 2),
    00441     RPMSENSE_EQUAL      = (1 << 3),
    00442     RPMSENSE_PROVIDES   = (1 << 4), /* only used internally by builds */
    00443     RPMSENSE_CONFLICTS  = (1 << 5), /* only used internally by builds */
    00444     RPMSENSE_PREREQ     = (1 << 6),
    00445     RPMSENSE_OBSOLETES  = (1 << 7), /* only used internally by builds */
    00446     RPMSENSE_INTERP     = (1 << 8),
    00447     RPMSENSE_SCRIPT_PRE = ((1 << 9)|RPMSENSE_PREREQ),
    00448     RPMSENSE_SCRIPT_POST = ((1 << 10)|RPMSENSE_PREREQ),
    00449     RPMSENSE_SCRIPT_PREUN = ((1 << 11)|RPMSENSE_PREREQ),
    00450     RPMSENSE_SCRIPT_POSTUN = ((1 << 12)|RPMSENSE_PREREQ),
    00451     RPMSENSE_SCRIPT_VERIFY = (1 << 13),
    00452     RPMSENSE_FIND_REQUIRES = (1 << 14),
    00453     RPMSENSE_FIND_PROVIDES = (1 << 15),
    00455     RPMSENSE_TRIGGERIN  = (1 << 16),
    00456     RPMSENSE_TRIGGERUN  = (1 << 17),
    00457     RPMSENSE_TRIGGERPOSTUN = (1 << 18),
    00458     RPMSENSE_MULTILIB   = (1 << 19),
    00459     RPMSENSE_SCRIPT_PREP = (1 << 20),
    00460     RPMSENSE_SCRIPT_BUILD = (1 << 21),
    00461     RPMSENSE_SCRIPT_INSTALL = (1 << 22),
    00462     RPMSENSE_SCRIPT_CLEAN = (1 << 23),
    00463     RPMSENSE_RPMLIB     = ((1 << 24) | RPMSENSE_PREREQ),
    00464 /*@-enummemuse@*/
    00465     RPMSENSE_TRIGGERPREIN = (1 << 25),
    00466 /*@=enummemuse@*/
    00467
    00468 /*@-enummemuse@*/
    00469     RPMSENSE_KEYRING    = (1 << 26)
    00470 /*@=enummemuse@*/
    00471 } rpmsenseFlags;
    00472
    00473 #define RPMSENSE_SENSEMASK      15       /* Mask to get senses, ie serial, */
    00474                                          /* less, greater, equal.          */
    00475
    00476 #define RPMSENSE_TRIGGER        \
    00477         (RPMSENSE_TRIGGERIN | RPMSENSE_TRIGGERUN | RPMSENSE_TRIGGERPOSTUN)
    00478
    00479 #define isDependsMULTILIB(_dflags)      ((_dflags) & RPMSENSE_MULTILIB)
    00480
    00481 #define _ALL_REQUIRES_MASK      (\
    00482     RPMSENSE_INTERP | \
    00483     RPMSENSE_SCRIPT_PRE | \
    00484     RPMSENSE_SCRIPT_POST | \
    00485     RPMSENSE_SCRIPT_PREUN | \
    00486     RPMSENSE_SCRIPT_POSTUN | \
    00487     RPMSENSE_SCRIPT_VERIFY | \
    00488     RPMSENSE_FIND_REQUIRES | \
    00489     RPMSENSE_SCRIPT_PREP | \
    00490     RPMSENSE_SCRIPT_BUILD | \
    00491     RPMSENSE_SCRIPT_INSTALL | \
    00492     RPMSENSE_SCRIPT_CLEAN | \
    00493     RPMSENSE_RPMLIB | \
    00494     RPMSENSE_KEYRING )
    00495
    00496 #define _notpre(_x)             ((_x) & ~RPMSENSE_PREREQ)
    00497 #define _INSTALL_ONLY_MASK \
    00498     _notpre(RPMSENSE_SCRIPT_PRE|RPMSENSE_SCRIPT_POST|RPMSENSE_RPMLIB|RPMSENSE_KEYRING)
    00499 #define _ERASE_ONLY_MASK  \
    00500     _notpre(RPMSENSE_SCRIPT_PREUN|RPMSENSE_SCRIPT_POSTUN)
    00501
    00502 #define isLegacyPreReq(_x)  (((_x) & _ALL_REQUIRES_MASK) == RPMSENSE_PREREQ)
    00503 #define isInstallPreReq(_x)     ((_x) & _INSTALL_ONLY_MASK)
    00504 #define isErasePreReq(_x)       ((_x) & _ERASE_ONLY_MASK)
    00505
    00506 /* ==================================================================== */
    00509
    00510 /* Stuff for maintaining "variables" like SOURCEDIR, BUILDDIR, etc */
    00511 #define RPMVAR_OPTFLAGS                 3
    00512 #define RPMVAR_PROVIDES                 38
    00513 #define RPMVAR_INCLUDE                  43
    00514 #define RPMVAR_MACROFILES               49
    00515
    00516 #define RPMVAR_NUM                      55      /* number of RPMVAR entries */
    00517
    00523 /*@-redecl@*/
    00524 /*@observer@*/ /*@null@*/ extern const char * rpmGetVar(int var)
    00525         /*@*/;
    00526 /*@=redecl@*/
    00527
    00533 void rpmSetVar(int var, const char * val)
    00534         /*@globals internalState @*/
    00535         /*@modifies internalState @*/;
    00536
    00542 /*@-redecl@*/
    00543 /*@observer@*/ /*@unchecked@*/
    00544 extern const char * macrofiles;
    00545 /*@=redecl@*/
    00546
    00551 enum rpm_machtable_e {
    00552     RPM_MACHTABLE_INSTARCH      = 0,
    00553     RPM_MACHTABLE_INSTOS        = 1,
    00554     RPM_MACHTABLE_BUILDARCH     = 2,
    00555     RPM_MACHTABLE_BUILDOS       = 3
    00556 };
    00557 #define RPM_MACHTABLE_COUNT     4
    00565 int rpmReadConfigFiles(/*@null@*/ const char * file,
    00566                 /*@null@*/ const char * target)
    00567         /*@globals rpmGlobalMacroContext, rpmCLIMacroContext,
    00568                 fileSystem, internalState @*/
    00569         /*@modifies rpmGlobalMacroContext, rpmCLIMacroContext,
    00570                 fileSystem, internalState @*/;
    00571
    00578 void rpmGetArchInfo( /*@null@*/ /*@out@*/ const char ** name,
    00579                 /*@null@*/ /*@out@*/ int * num)
    00580         /*@modifies *name, *num @*/;
    00581
    00588 void rpmGetOsInfo( /*@null@*/ /*@out@*/ const char ** name,
    00589                 /*@null@*/ /*@out@*/ int * num)
    00590         /*@modifies *name, *num @*/;
    00591
    00605 int rpmMachineScore(int type, const char * name)
    00606         /*@*/;
    00607
    00613 int rpmShowRC(FILE * fp)
    00614         /*@globals rpmGlobalMacroContext, fileSystem @*/
    00615         /*@modifies *fp, rpmGlobalMacroContext, fileSystem @*/;
    00616
    00624 void rpmSetTables(int archTable, int osTable)
    00625         /*@globals internalState @*/
    00626         /*@modifies internalState @*/;
    00627
    00638 void rpmSetMachine(/*@null@*/ const char * arch, /*@null@*/ const char * os)
    00639         /*@globals internalState @*/
    00640         /*@modifies internalState @*/;
    00641
    00650 /*@unused@*/
    00651 void rpmGetMachine( /*@null@*/ /*@out@*/ const char **arch,
    00652                 /*@null@*/ /*@out@*/ const char **os)
    00653         /*@modifies *arch, *os @*/;
    00654
    00659 void rpmFreeRpmrc(void)
    00660         /*@globals internalState @*/
    00661         /*@modifies internalState @*/;
    00662
    00664 /* ==================================================================== */
    00667
    00670 typedef /*@abstract@*/ struct rpmdb_s * rpmdb;
    00671
    00674 typedef /*@abstract@*/ struct _dbiIndexSet * dbiIndexSet;
    00675
    00679 /*@unchecked@*/
    00680 /*@only@*/ /*@null@*/ extern int * dbiTags;
    00681 /*@unchecked@*/
    00682 extern int dbiTagsMax;
    00683
    00692 int rpmdbOpen (/*@null@*/ const char * prefix, /*@null@*/ /*@out@*/ rpmdb * dbp,
    00693                 int mode, int perms)
    00694         /*@globals fileSystem @*/
    00695         /*@modifies *dbp, fileSystem @*/;
    00696
    00703 int rpmdbInit(/*@null@*/ const char * prefix, int perms)
    00704         /*@globals fileSystem @*/
    00705         /*@modifies fileSystem @*/;
    00706
    00712 int rpmdbVerify(/*@null@*/ const char * prefix)
    00713         /*@globals fileSystem @*/
    00714         /*@modifies fileSystem @*/;
    00715
    00721 int rpmdbClose (/*@only@*/ /*@null@*/ rpmdb db)
    00722         /*@globals fileSystem @*/
    00723         /*@modifies fileSystem @*/;
    00724
    00730 int rpmdbSync (/*@null@*/ rpmdb db)
    00731         /*@globals fileSystem @*/
    00732         /*@modifies fileSystem @*/;
    00733
    00739 int rpmdbOpenAll (/*@null@*/ rpmdb db)
    00740         /*@modifies db @*/;
    00741
    00748 int rpmdbCountPackages(/*@null@*/ rpmdb db, const char * name)
    00749         /*@globals fileSystem @*/
    00750         /*@modifies db, fileSystem @*/;
    00751
    00754 typedef /*@abstract@*/ struct _rpmdbMatchIterator * rpmdbMatchIterator;
    00755
    00761 /*@null@*/ rpmdbMatchIterator rpmdbFreeIterator(
    00762                 /*@only@*//*@null@*/rpmdbMatchIterator mi)
    00763         /*@globals fileSystem @*/
    00764         /*@modifies mi, fileSystem @*/;
    00765
    00771 /*@kept@*/ /*@null@*/ rpmdb rpmdbGetIteratorRpmDB(
    00772                 /*@null@*/ rpmdbMatchIterator mi)
    00773         /*@*/;
    00774
    00780 unsigned int rpmdbGetIteratorOffset(/*@null@*/ rpmdbMatchIterator mi)
    00781         /*@*/;
    00782
    00788 int rpmdbGetIteratorCount(/*@null@*/ rpmdbMatchIterator mi)
    00789         /*@*/;
    00790
    00798 int rpmdbAppendIterator(/*@null@*/ rpmdbMatchIterator mi,
    00799                 /*@null@*/ const int * hdrNums, int nHdrNums)
    00800         /*@modifies mi @*/;
    00801
    00811 int rpmdbPruneIterator(/*@null@*/ rpmdbMatchIterator mi,
    00812                 /*@null@*/ int * hdrNums, int nHdrNums, int sorted)
    00813         /*@modifies mi, hdrNums @*/;
    00814
    00818 typedef enum rpmMireMode_e {
    00819     RPMMIRE_DEFAULT     = 0,
    00820     RPMMIRE_STRCMP      = 1,
    00821     RPMMIRE_REGEX       = 2,
    00822     RPMMIRE_GLOB        = 3
    00823 } rpmMireMode;
    00824
    00833 int rpmdbSetIteratorRE(/*@null@*/ rpmdbMatchIterator mi, rpmTag tag,
    00834                 rpmMireMode mode, /*@null@*/ const char * pattern)
    00835         /*@modifies mi @*/;
    00836
    00847 /*@unused@*/
    00848 int rpmdbSetIteratorVersion(/*@null@*/ rpmdbMatchIterator mi,
    00849                 /*@null@*/ const char * version)
    00850         /*@modifies mi @*/;
    00851
    00862 /*@unused@*/
    00863 int rpmdbSetIteratorRelease(/*@null@*/ rpmdbMatchIterator mi,
    00864                 /*@null@*/ const char * release)
    00865         /*@modifies mi @*/;
    00866
    00874 int rpmdbSetIteratorRewrite(/*@null@*/ rpmdbMatchIterator mi, int rewrite)
    00875         /*@modifies mi @*/;
    00876
    00883 int rpmdbSetIteratorModified(/*@null@*/ rpmdbMatchIterator mi, int modified)
    00884         /*@modifies mi @*/;
    00885
    00891 /*@null@*/ Header rpmdbNextIterator(/*@null@*/ rpmdbMatchIterator mi)
    00892         /*@globals fileSystem @*/
    00893         /*@modifies mi, fileSystem @*/;
    00894
    00896 /*@unused@*/
    00897 /*@null@*/ Header XrpmdbNextIterator(rpmdbMatchIterator mi,
    00898                 const char * f, unsigned int l)
    00899         /*@globals fileSystem @*/
    00900         /*@modifies mi, fileSystem @*/;
    00901
    00910 /*@only@*/ /*@null@*/ rpmdbMatchIterator rpmdbInitIterator(
    00911                         /*@kept@*/ /*@null@*/ rpmdb db, int rpmtag,
    00912                         /*@null@*/ const void * keyp, size_t keylen)
    00913         /*@globals fileSystem @*/
    00914         /*@modifies db, fileSystem @*/;
    00915
    00923 int rpmdbAdd(/*@null@*/ rpmdb db, int iid, Header h)
    00924         /*@globals fileSystem @*/
    00925         /*@modifies db, h, fileSystem @*/;
    00926
    00934 int rpmdbRemove(/*@null@*/ rpmdb db, /*@unused@*/ int rid, unsigned int hdrNum)
    00935         /*@globals fileSystem @*/
    00936         /*@modifies db, fileSystem @*/;
    00937
    00943 int rpmdbRebuild(/*@null@*/ const char * prefix)
    00944         /*@globals fileSystem @*/
    00945         /*@modifies fileSystem @*/;
    00946
    00948 /* ==================================================================== */
    00951
    00955 typedef enum rpmProblemType_e {
    00956     RPMPROB_BADARCH,
    00957     RPMPROB_BADOS,
    00958     RPMPROB_PKG_INSTALLED,
    00959     RPMPROB_BADRELOCATE,
    00960     RPMPROB_REQUIRES,
    00961     RPMPROB_CONFLICT,
    00962     RPMPROB_NEW_FILE_CONFLICT,
    00963     RPMPROB_FILE_CONFLICT,
    00964     RPMPROB_OLDPACKAGE,
    00965     RPMPROB_DISKSPACE,
    00966     RPMPROB_DISKNODES,
    00967     RPMPROB_BADPRETRANS
    00968  } rpmProblemType;
    00969
    00972 typedef /*@abstract@*/ struct rpmProblem_s {
    00973 /*@only@*/ /*@null@*/ const char * pkgNEVR;
    00974 /*@only@*/ /*@null@*/ const char * altNEVR;
    00975 /*@kept@*/ /*@null@*/ const void * key;
    00976 /*@null@*/ Header h;
    00977     rpmProblemType type;
    00978     int ignoreProblem;
    00979 /*@only@*/ /*@null@*/ const char * str1;
    00980     unsigned long ulong1;
    00981 } * rpmProblem;
    00982
    00985 typedef /*@abstract@*/ struct rpmProblemSet_s {
    00986     int numProblems;
    00987     int numProblemsAlloced;
    00988     rpmProblem probs;
    00989 } * rpmProblemSet;
    00990
    00993 void printDepFlags(FILE *fp, const char *version, int flags)
    00994         /*@globals fileSystem @*/
    00995         /*@modifies *fp, fileSystem @*/;
    00996
    01000 typedef /*@abstract@*/ struct rpmDependencyConflict_s {
    01001     const char * byName;
    01002     const char * byVersion;
    01003     const char * byRelease;
    01004     Header byHeader;
    01005     /*
    01006      * These needs fields are misnamed -- they are used for the package
    01007      * which isn't needed as well.
    01008      */
    01009     const char * needsName;
    01010     const char * needsVersion;
    01011     int needsFlags;
    01012 /*@owned@*/ /*@null@*/ const void ** suggestedPackages; /* terminated by NULL */
    01013     enum {
    01014         RPMDEP_SENSE_REQUIRES,
    01015         RPMDEP_SENSE_CONFLICTS
    01016     } sense;
    01017 } * rpmDependencyConflict;
    01018
    01025 void printDepProblems(FILE * fp, const rpmDependencyConflict conflicts,
    01026                         int numConflicts)
    01027         /*@globals fileSystem @*/
    01028         /*@modifies *fp, fileSystem @*/;
    01029
    01036 /*@-redecl@*/   /* LCL: is confused. */
    01037 /*@only@*/ extern const char * rpmProblemString(const rpmProblem prob)
    01038         /*@*/;
    01039 /*@=redecl@*/
    01040
    01047 void rpmProblemPrint(FILE *fp, rpmProblem prob)
    01048         /*@globals fileSystem @*/
    01049         /*@modifies prob, *fp, fileSystem @*/;
    01050
    01056 void rpmProblemSetPrint(FILE *fp, rpmProblemSet probs)
    01057         /*@globals fileSystem @*/
    01058         /*@modifies probs, *fp, fileSystem @*/;
    01059
    01064 void rpmProblemSetFree( /*@only@*/ rpmProblemSet probs)
    01065         /*@modifies probs @*/;
    01066
    01068 /* ==================================================================== */
    01077 typedef /*@null@*/
    01078     void * (*HFD_t) (/*@only@*/ /*@null@*/ const void * data, rpmTagType type)
    01079         /*@modifies data @*/;
    01080
    01094 typedef int (*HGE_t) (Header h, rpmTag tag,
    01095                         /*@null@*/ /*@out@*/ rpmTagType * type,
    01096                         /*@null@*/ /*@out@*/ void ** p,
    01097                         /*@null@*/ /*@out@*/ int_32 * c)
    01098         /*@modifies *type, *p, *c @*/;
    01099
    01114 typedef int (*HAE_t) (Header h, rpmTag tag, rpmTagType type,
    01115                         const void * p, int_32 c)
    01116         /*@modifies h @*/;
    01117
    01128 typedef int (*HME_t) (Header h, rpmTag tag, rpmTagType type,
    01129                         const void * p, int_32 c)
    01130         /*@modifies h @*/;
    01131
    01142 typedef int (*HRE_t) (Header h, int_32 tag)
    01143         /*@modifies h @*/;
    01144
    01148 typedef struct rpmRelocation_s {
    01149 /*@only@*/ /*@null@*/
    01150     const char * oldPath;
    01151 /*@only@*/ /*@null@*/
    01152     const char * newPath;
    01153 } rpmRelocation;
    01154
    01165 rpmRC rpmInstallSourcePackage(/*@null@*/ const char * rootDir, FD_t fd,
    01166                         /*@null@*/ /*@out@*/ const char ** specFilePtr,
    01167                         /*@null@*/ rpmCallbackFunction notify,
    01168                         /*@null@*/ rpmCallbackData notifyData,
    01169                         /*@null@*/ /*@out@*/ char ** cookie)
    01170         /*@modifies fd, *specFilePtr, *cookie @*/;
    01171
    01178 int rpmVersionCompare(Header first, Header second)
    01179         /*@*/;
    01180
    01184 typedef enum fileAction_e {
    01185     FA_UNKNOWN = 0,
    01186     FA_CREATE,
    01187     FA_COPYIN,
    01188     FA_COPYOUT,
    01189     FA_BACKUP,
    01190     FA_SAVE,
    01191     FA_SKIP,
    01192     FA_ALTNAME,
    01193     FA_ERASE,
    01194     FA_SKIPNSTATE,
    01195     FA_SKIPNETSHARED,
    01196     FA_SKIPMULTILIB
    01197 } fileAction;
    01198
    01199 #define XFA_SKIPPING(_a)        \
    01200     ((_a) == FA_SKIP || (_a) == FA_SKIPNSTATE || (_a) == FA_SKIPNETSHARED || (_a) == FA_SKIPMULTILIB)
    01201
    01209 typedef enum fileTypes_e {
    01210     PIPE        =  1,
    01211     CDEV        =  2,
    01212     XDIR        =  4,
    01213     BDEV        =  6,
    01214     REG         =  8,
    01215     LINK        = 10,
    01216     SOCK        = 12
    01217 } fileTypes;
    01218
    01222 typedef /*@abstract@*/ struct fsmIterator_s * FSMI_t;
    01223
    01227 typedef /*@abstract@*/ struct fsm_s * FSM_t;
    01228
    01232 typedef /*@abstract@*/ struct psm_s * PSM_t;
    01233
    01236 typedef /*@abstract@*/ struct transactionFileInfo_s * TFI_t;
    01237
    01244 typedef /*@abstract@*/ struct rpmTransactionSet_s * rpmTransactionSet;
    01245
    01252 /*@only@*/ rpmTransactionSet rpmtransCreateSet(
    01253                 /*@null@*/ /*@kept@*/ rpmdb rpmdb,
    01254                 /*@null@*/ const char * rootDir)
    01255         /*@*/;
    01256
    01273 int rpmtransAddPackage(rpmTransactionSet ts, Header h, /*@null@*/ FD_t fd,
    01274                 /*@null@*/ /*@owned@*/ const void * key, int upgrade,
    01275                 /*@null@*/ rpmRelocation * relocs)
    01276         /*@modifies fd, h, ts @*/;
    01277
    01284 /*@unused@*/
    01285 void rpmtransAvailablePackage(rpmTransactionSet ts, Header h,
    01286                 /*@null@*/ /*@owned@*/ const void * key)
    01287         /*@modifies h, ts @*/;
    01288
    01295 int rpmtransRemovePackage(rpmTransactionSet ts, int dboffset)
    01296         /*@modifies ts @*/;
    01297
    01303 /*@null@*/ rpmTransactionSet
    01304 rpmtransFree(/*@only@*//*@null@*/ rpmTransactionSet ts)
    01305         /*@modifies ts @*/;
    01306
    01312 /*@unused@*/
    01313 void rpmtransSetScriptFd(rpmTransactionSet ts, FD_t fd)
    01314         /*@modifies ts, fd @*/;
    01315
    01324 /*@unused@*/
    01325 int rpmtransGetKeys(const rpmTransactionSet ts,
    01326                 /*@null@*/ /*@out@*/ const void *** ep,
    01327                 /*@null@*/ /*@out@*/ int * nep)
    01328         /*@modifies ep, nep @*/;
    01329
    01337 int rpmdepCheck(rpmTransactionSet ts,
    01338                 /*@exposed@*/ /*@out@*/ rpmDependencyConflict * conflicts,
    01339                 /*@exposed@*/ /*@out@*/ int * numConflicts)
    01340         /*@globals fileSystem, internalState @*/
    01341         /*@modifies ts, *conflicts, *numConflicts,
    01342                 fileSystem, internalState @*/;
    01343
    01363 int rpmdepOrder(rpmTransactionSet ts)
    01364         /*@globals fileSystem, internalState@*/
    01365         /*@modifies ts, fileSystem, internalState @*/;
    01366
    01373 /*@null@*/ rpmDependencyConflict rpmdepFreeConflicts(
    01374                 /*@only@*/ /*@null@*/ rpmDependencyConflict conflicts,
    01375                 int numConflicts)
    01376         /*@modifies conflicts @*/;
    01377
    01381 typedef enum rpmtransFlags_e {
    01382     RPMTRANS_FLAG_NONE          = 0,
    01383     RPMTRANS_FLAG_TEST          = (1 <<  0),
    01384     RPMTRANS_FLAG_BUILD_PROBS   = (1 <<  1),
    01385     RPMTRANS_FLAG_NOSCRIPTS     = (1 <<  2),
    01386     RPMTRANS_FLAG_JUSTDB        = (1 <<  3),
    01387     RPMTRANS_FLAG_NOTRIGGERS    = (1 <<  4),
    01388     RPMTRANS_FLAG_NODOCS        = (1 <<  5),
    01389     RPMTRANS_FLAG_ALLFILES      = (1 <<  6),
    01390 /*@-enummemuse@*/
    01391     RPMTRANS_FLAG_KEEPOBSOLETE  = (1 <<  7),
    01392 /*@=enummemuse@*/
    01393     RPMTRANS_FLAG_MULTILIB      = (1 <<  8),
    01394     RPMTRANS_FLAG_DIRSTASH      = (1 <<  9),
    01395     RPMTRANS_FLAG_REPACKAGE     = (1 << 10),
    01397     RPMTRANS_FLAG_PKGCOMMIT     = (1 << 11),
    01398 /*@-enummemuse@*/
    01399     RPMTRANS_FLAG_PKGUNDO       = (1 << 12),
    01400 /*@=enummemuse@*/
    01401     RPMTRANS_FLAG_COMMIT        = (1 << 13),
    01402 /*@-enummemuse@*/
    01403     RPMTRANS_FLAG_UNDO          = (1 << 14),
    01404 /*@=enummemuse@*/
    01405     RPMTRANS_FLAG_REVERSE       = (1 << 15),
    01406
    01407     RPMTRANS_FLAG_NOTRIGGERPREIN= (1 << 16),
    01408     RPMTRANS_FLAG_NOPRE         = (1 << 17),
    01409     RPMTRANS_FLAG_NOPOST        = (1 << 18),
    01410     RPMTRANS_FLAG_NOTRIGGERIN   = (1 << 19),
    01411     RPMTRANS_FLAG_NOTRIGGERUN   = (1 << 20),
    01412     RPMTRANS_FLAG_NOPREUN       = (1 << 21),
    01413     RPMTRANS_FLAG_NOPOSTUN      = (1 << 22),
    01414     RPMTRANS_FLAG_NOTRIGGERPOSTUN = (1 << 23),
    01415 /*@-enummemuse@*/
    01416     RPMTRANS_FLAG_NOPAYLOAD     = (1 << 24),
    01417 /*@=enummemuse@*/
    01418     RPMTRANS_FLAG_APPLYONLY     = (1 << 25),
    01419
    01420 /*@-enummemuse@*/
    01421     RPMTRANS_FLAG_CHAINSAW      = (1 << 26),
    01422 /*@=enummemuse@*/
    01423     RPMTRANS_FLAG_NOMD5         = (1 << 27)
    01424 } rpmtransFlags;
    01425
    01426 #define _noTransScripts         \
    01427   ( RPMTRANS_FLAG_NOPRE |       \
    01428     RPMTRANS_FLAG_NOPOST |      \
    01429     RPMTRANS_FLAG_NOPREUN |     \
    01430     RPMTRANS_FLAG_NOPOSTUN      \
    01431   )
    01432
    01433 #define _noTransTriggers        \
    01434   ( RPMTRANS_FLAG_NOTRIGGERPREIN | \
    01435     RPMTRANS_FLAG_NOTRIGGERIN | \
    01436     RPMTRANS_FLAG_NOTRIGGERUN | \
    01437     RPMTRANS_FLAG_NOTRIGGERPOSTUN \
    01438   )
    01439
    01447 /*@unused@*/
    01448 int rpmGetRpmlibProvides(/*@null@*/ /*@out@*/ const char *** provNames,
    01449                         /*@null@*/ /*@out@*/ int ** provFlags,
    01450                         /*@null@*/ /*@out@*/ const char *** provVersions)
    01451         /*@modifies *provNames, *provFlags, *provVersions @*/;
    01452
    01460 int rpmvercmp(const char * a, const char * b)
    01461         /*@*/;
    01462
    01473 int rpmRangesOverlap(const char * AName, const char * AEVR, int AFlags,
    01474                         const char * BName, const char * BEVR, int BFlags)
    01475         /*@*/;
    01476
    01484 int rpmCheckRpmlibProvides(const char * keyName, const char * keyEVR,
    01485                 int keyFlags)
    01486         /*@*/;
    01487
    01492 void rpmShowRpmlibProvides(FILE * fp)
    01493         /*@globals fileSystem @*/
    01494         /*@modifies *fp, fileSystem @*/;
    01495
    01499 typedef enum rpmprobFilterFlags_e {
    01500     RPMPROB_FILTER_NONE         = 0,
    01501     RPMPROB_FILTER_IGNOREOS     = (1 << 0),
    01502     RPMPROB_FILTER_IGNOREARCH   = (1 << 1),
    01503     RPMPROB_FILTER_REPLACEPKG   = (1 << 2),
    01504     RPMPROB_FILTER_FORCERELOCATE= (1 << 3),
    01505     RPMPROB_FILTER_REPLACENEWFILES= (1 << 4),
    01506     RPMPROB_FILTER_REPLACEOLDFILES= (1 << 5),
    01507     RPMPROB_FILTER_OLDPACKAGE   = (1 << 6),
    01508     RPMPROB_FILTER_DISKSPACE    = (1 << 7),
    01509     RPMPROB_FILTER_DISKNODES    = (1 << 8)
    01510 } rpmprobFilterFlags;
    01511
    01523 int rpmRunTransactions(rpmTransactionSet ts,
    01524                         rpmCallbackFunction notify,
    01525                         /*@owned@*/ rpmCallbackData notifyData,
    01526                         rpmProblemSet okProbs,
    01527                         /*@out@*/ rpmProblemSet * newProbs,
    01528                         rpmtransFlags transFlags,
    01529                         rpmprobFilterFlags ignoreSet)
    01530         /*@globals rpmGlobalMacroContext,
    01531                 fileSystem, internalState@*/
    01532         /*@modifies ts, *newProbs, rpmGlobalMacroContext,
    01533                 fileSystem, internalState @*/;
    01534
    01542 /*@-redecl@*/
    01543 /*@observer@*/ extern const char *const tagName(int tag)
    01544         /*@*/;
    01545 /*@=redecl@*/
    01546
    01552 int tagValue(const char *tagstr)
    01553         /*@*/;
    01554
    01555 #define RPMLEAD_BINARY 0
    01556 #define RPMLEAD_SOURCE 1
    01557
    01558 #define RPMLEAD_MAGIC0 0xed
    01559 #define RPMLEAD_MAGIC1 0xab
    01560 #define RPMLEAD_MAGIC2 0xee
    01561 #define RPMLEAD_MAGIC3 0xdb
    01562
    01563 #define RPMLEAD_SIZE 96
    01571 struct rpmlead {
    01572     unsigned char magic[4];
    01573     unsigned char major, minor;
    01574     short type;
    01575     short archnum;
    01576     char name[66];
    01577     short osnum;
    01578     short signature_type;
    01579 /*@unused@*/ char reserved[16];
    01580 } ;
    01581
    01585 void freeFilesystems(void)
    01586         /*@globals internalState@*/
    01587         /*@modifies internalState@*/;
    01588
    01595 int rpmGetFilesystemList( /*@null@*/ /*@out@*/ const char *** listptr,
    01596                 /*@null@*/ /*@out@*/ int * num)
    01597         /*@globals fileSystem, internalState @*/
    01598         /*@modifies *listptr, *num, fileSystem, internalState @*/;
    01599
    01609 int rpmGetFilesystemUsage(const char ** fileList, int_32 * fssizes,
    01610                 int numFiles, /*@null@*/ /*@out@*/ uint_32 ** usagesPtr,
    01611                 int flags)
    01612         /*@globals rpmGlobalMacroContext,
    01613                 fileSystem, internalState @*/
    01614         /*@modifies *usagesPtr, rpmGlobalMacroContext,
    01615                 fileSystem, internalState @*/;
    01616
    01617 /* ==================================================================== */
    01620
    01623 typedef struct rpmQVArguments_s * QVA_t;
    01624
    01629 typedef enum rpmQVSources_e {
    01630     RPMQV_PACKAGE = 0,
    01631     RPMQV_PATH,
    01632     RPMQV_ALL,
    01633     RPMQV_RPM,
    01634     RPMQV_GROUP,
    01635     RPMQV_WHATPROVIDES,
    01636     RPMQV_WHATREQUIRES,
    01637     RPMQV_TRIGGEREDBY,
    01638     RPMQV_DBOFFSET,
    01639     RPMQV_SPECFILE,
    01640     RPMQV_PKGID,
    01641     RPMQV_HDRID,
    01642     RPMQV_FILEID,
    01643     RPMQV_TID
    01644 } rpmQVSources;
    01645
    01650 typedef enum rpmVerifyAttrs_e {
    01651     RPMVERIFY_NONE      = 0,
    01652     RPMVERIFY_MD5       = (1 << 0),
    01653     RPMVERIFY_FILESIZE  = (1 << 1),
    01654     RPMVERIFY_LINKTO    = (1 << 2),
    01655     RPMVERIFY_USER      = (1 << 3),
    01656     RPMVERIFY_GROUP     = (1 << 4),
    01657     RPMVERIFY_MTIME     = (1 << 5),
    01658     RPMVERIFY_MODE      = (1 << 6),
    01659     RPMVERIFY_RDEV      = (1 << 7),
    01660         /* bits 8-15 unused, reserved for rpmVerifyAttrs */
    01661         /* bits 16-19 used in rpmVerifyFlags */
    01662         /* bits 20-22 unused */
    01663         /* bits 23-27 used in rpmQueryFlags */
    01664     RPMVERIFY_READLINKFAIL= (1 << 28),
    01665     RPMVERIFY_READFAIL  = (1 << 29),
    01666     RPMVERIFY_LSTATFAIL = (1 << 30)
    01667         /* bit 31 unused */
    01668 } rpmVerifyAttrs;
    01669 #define RPMVERIFY_ALL           ~(RPMVERIFY_NONE)
    01670
    01681 int rpmVerifyFile(const char * root, Header h, int filenum,
    01682                 /*@out@*/ rpmVerifyAttrs * result, rpmVerifyAttrs omitMask)
    01683         /*@globals fileSystem @*/
    01684         /*@modifies h, *result, fileSystem @*/;
    01685
    01694 int rpmVerifyScript(const char * rootDir, Header h, /*@null@*/ FD_t scriptFd)
    01695         /*@globals rpmGlobalMacroContext, fileSystem @*/
    01696         /*@modifies h, scriptFd,
    01697                 rpmGlobalMacroContext, fileSystem @*/;
    01698
    01700 /* ==================================================================== */
    01703 /* --- install/upgrade/erase modes */
    01704
    01709 typedef enum rpmInstallInterfaceFlags_e {
    01710     INSTALL_NONE        = 0,
    01711     INSTALL_PERCENT     = (1 << 0),
    01712     INSTALL_HASH        = (1 << 1),
    01713     INSTALL_NODEPS      = (1 << 2),
    01714     INSTALL_NOORDER     = (1 << 3),
    01715     INSTALL_LABEL       = (1 << 4),
    01716     INSTALL_UPGRADE     = (1 << 5),
    01717     INSTALL_FRESHEN     = (1 << 6),
    01718     INSTALL_INSTALL     = (1 << 7),
    01719     INSTALL_ERASE       = (1 << 8)
    01720 } rpmInstallInterfaceFlags;
    01721
    01725 typedef enum rpmEraseInterfaceFlags_e {
    01726     UNINSTALL_NONE      = 0,
    01727     UNINSTALL_NODEPS    = (1 << 0),
    01728     UNINSTALL_ALLMATCHES= (1 << 1)
    01729 } rpmEraseInterfaceFlags;
    01730
    01732 /* ==================================================================== */
    01735
    01739 enum rpmtagSignature {
    01740     RPMSIGTAG_SIZE      = 1000,
    01741 /* the md5 sum was broken *twice* on big endian machines */
    01742     RPMSIGTAG_LEMD5_1   = 1001,
    01743     RPMSIGTAG_PGP       = 1002,
    01744     RPMSIGTAG_LEMD5_2   = 1003,
    01745     RPMSIGTAG_MD5       = 1004,
    01746     RPMSIGTAG_GPG       = 1005,
    01747     RPMSIGTAG_PGP5      = 1006,
    01748 };
    01749
    01753 typedef enum rpmVerifySignatureReturn_e {
    01754     RPMSIG_OK           = 0,
    01755     RPMSIG_UNKNOWN      = 1,
    01756     RPMSIG_BAD          = 2,
    01757     RPMSIG_NOKEY        = 3,
    01758     RPMSIG_NOTTRUSTED   = 4
    01759 } rpmVerifySignatureReturn;
    01760
    01770 rpmVerifySignatureReturn rpmVerifySignature(const char *file,
    01771                 int_32 sigTag, const void * sig, int count,
    01772                 /*@out@*/ char * result)
    01773         /*@globals rpmGlobalMacroContext, fileSystem @*/
    01774         /*@modifies *result, rpmGlobalMacroContext, fileSystem @*/;
    01775
    01781 /*@null@*/ Header rpmFreeSignature(/*@null@*/ /*@killref@*/ Header h)
    01782         /*@modifies h @*/;
    01783
    01786 #ifdef __cplusplus
    01787 }
    01788 #endif
    01789
    01790 #endif  /* H_RPMLIB */