Main Page Modules Data Structures File List Data Fields Globals Related Pages

# 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_NOTFOUND      = 1,
    00020     RPMRC_FAIL          = 2,
    00021     RPMRC_NOTTRUSTED    = 3,
    00022     RPMRC_NOKEY         = 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 /*@unchecked@*/ /*@observer@*/
    00033 extern const char * RPMVERSION;
    00034
    00035 /*@unchecked@*/ /*@observer@*/
    00036 extern const char * rpmNAME;
    00037
    00038 /*@unchecked@*/ /*@observer@*/
    00039 extern const char * rpmEVR;
    00040
    00041 /*@unchecked@*/
    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
    00068 typedef /*@abstract@*/ /*@refcounted@*/ struct rpmts_s * rpmts;
    00069
    00073 typedef /*@abstract@*/ void * alKey;
    00074 #define RPMAL_NOMATCH   ((alKey)-1L)
    00075
    00079 /*@-mutrep@*/
    00080 typedef /*@abstract@*/ int alNum;
    00081 /*@=mutrep@*/
    00082
    00086 typedef /*@abstract@*/ /*@refcounted@*/ struct rpmds_s * rpmds;
    00087
    00091 typedef /*@abstract@*/ /*@refcounted@*/ struct rpmfi_s * rpmfi;
    00092
    00096 typedef /*@abstract@*/ struct rpmte_s * rpmte;
    00097
    00101 typedef /*@abstract@*/ /*@refcounted@*/ struct rpmdb_s * rpmdb;
    00102
    00106 typedef /*@abstract@*/ struct _rpmdbMatchIterator * rpmdbMatchIterator;
    00107
    00116 int headerNVR(Header h,
    00117                 /*@null@*/ /*@out@*/ const char ** np,
    00118                 /*@null@*/ /*@out@*/ const char ** vp,
    00119                 /*@null@*/ /*@out@*/ const char ** rp)
    00120         /*@modifies *np, *vp, *rp @*/;
    00121
    00128 void headerMergeLegacySigs(Header h, const Header sig)
    00129         /*@modifies h, sig @*/;
    00130
    00138 Header headerRegenSigHeader(const Header h, int noArchiveSize)
    00139         /*@modifies h @*/;
    00140
    00154 void rpmBuildFileList(Header h, /*@out@*/ const char *** fileListPtr,
    00155                 /*@out@*/ int * fileCountPtr)
    00156         /*@modifies *fileListPtr, *fileCountPtr @*/;
    00157
    00171 /*@unused@*/
    00172 int rpmHeaderGetEntry(Header h, int_32 tag, /*@out@*/ int_32 *type,
    00173                 /*@out@*/ void **p, /*@out@*/ int_32 *c)
    00174         /*@modifies *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 /*@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     RPMTAG_BADSHA1_1            = RPMTAG_SIG_BASE+8,
    00239     RPMTAG_BADSHA1_2            = RPMTAG_SIG_BASE+9,
    00240     RPMTAG_PUBKEYS              = RPMTAG_SIG_BASE+10,
    00241     RPMTAG_DSAHEADER            = RPMTAG_SIG_BASE+11,
    00242     RPMTAG_RSAHEADER            = RPMTAG_SIG_BASE+12,
    00243     RPMTAG_SHA1HEADER           = RPMTAG_SIG_BASE+13,
    00244
    00245     RPMTAG_NAME                 = 1000,
    00246     RPMTAG_VERSION              = 1001,
    00247     RPMTAG_RELEASE              = 1002,
    00248     RPMTAG_EPOCH                = 1003,
    00249 #define RPMTAG_SERIAL   RPMTAG_EPOCH    /* backward comaptibility */
    00250     RPMTAG_SUMMARY              = 1004,
    00251     RPMTAG_DESCRIPTION          = 1005,
    00252     RPMTAG_BUILDTIME            = 1006,
    00253     RPMTAG_BUILDHOST            = 1007,
    00254     RPMTAG_INSTALLTIME          = 1008,
    00255     RPMTAG_SIZE                 = 1009,
    00256     RPMTAG_DISTRIBUTION         = 1010,
    00257     RPMTAG_VENDOR               = 1011,
    00258     RPMTAG_GIF                  = 1012,
    00259     RPMTAG_XPM                  = 1013,
    00260     RPMTAG_LICENSE              = 1014,
    00261 #define RPMTAG_COPYRIGHT RPMTAG_LICENSE /* backward comaptibility */
    00262     RPMTAG_PACKAGER             = 1015,
    00263     RPMTAG_GROUP                = 1016,
    00264 /*@-enummemuse@*/
    00265     RPMTAG_CHANGELOG            = 1017,
    00266 /*@=enummemuse@*/
    00267     RPMTAG_SOURCE               = 1018,
    00268     RPMTAG_PATCH                = 1019,
    00269     RPMTAG_URL                  = 1020,
    00270     RPMTAG_OS                   = 1021,
    00271     RPMTAG_ARCH                 = 1022,
    00272     RPMTAG_PREIN                = 1023,
    00273     RPMTAG_POSTIN               = 1024,
    00274     RPMTAG_PREUN                = 1025,
    00275     RPMTAG_POSTUN               = 1026,
    00276     RPMTAG_OLDFILENAMES         = 1027, /* obsolete */
    00277     RPMTAG_FILESIZES            = 1028,
    00278     RPMTAG_FILESTATES           = 1029,
    00279     RPMTAG_FILEMODES            = 1030,
    00280     RPMTAG_FILEUIDS             = 1031,
    00281     RPMTAG_FILEGIDS             = 1032,
    00282     RPMTAG_FILERDEVS            = 1033,
    00283     RPMTAG_FILEMTIMES           = 1034,
    00284     RPMTAG_FILEMD5S             = 1035,
    00285     RPMTAG_FILELINKTOS          = 1036,
    00286     RPMTAG_FILEFLAGS            = 1037,
    00287 /*@-enummemuse@*/
    00288     RPMTAG_ROOT                 = 1038,
    00289 /*@=enummemuse@*/
    00290     RPMTAG_FILEUSERNAME         = 1039,
    00291     RPMTAG_FILEGROUPNAME        = 1040,
    00292 /*@-enummemuse@*/
    00293     RPMTAG_EXCLUDE              = 1041,
    00294     RPMTAG_EXCLUSIVE            = 1042,
    00295 /*@=enummemuse@*/
    00296     RPMTAG_ICON                 = 1043,
    00297     RPMTAG_SOURCERPM            = 1044,
    00298     RPMTAG_FILEVERIFYFLAGS      = 1045,
    00299     RPMTAG_ARCHIVESIZE          = 1046,
    00300     RPMTAG_PROVIDENAME          = 1047,
    00301 #define RPMTAG_PROVIDES RPMTAG_PROVIDENAME      /* backward comaptibility */
    00302     RPMTAG_REQUIREFLAGS         = 1048,
    00303     RPMTAG_REQUIRENAME          = 1049,
    00304     RPMTAG_REQUIREVERSION       = 1050,
    00305     RPMTAG_NOSOURCE             = 1051,
    00306     RPMTAG_NOPATCH              = 1052,
    00307     RPMTAG_CONFLICTFLAGS        = 1053,
    00308     RPMTAG_CONFLICTNAME         = 1054,
    00309     RPMTAG_CONFLICTVERSION      = 1055,
    00310     RPMTAG_DEFAULTPREFIX        = 1056,
    00311     RPMTAG_BUILDROOT            = 1057,
    00312     RPMTAG_INSTALLPREFIX        = 1058,
    00313     RPMTAG_EXCLUDEARCH          = 1059,
    00314     RPMTAG_EXCLUDEOS            = 1060,
    00315     RPMTAG_EXCLUSIVEARCH        = 1061,
    00316     RPMTAG_EXCLUSIVEOS          = 1062,
    00317     RPMTAG_AUTOREQPROV          = 1063,
    00318     RPMTAG_RPMVERSION           = 1064,
    00319     RPMTAG_TRIGGERSCRIPTS       = 1065,
    00320     RPMTAG_TRIGGERNAME          = 1066,
    00321     RPMTAG_TRIGGERVERSION       = 1067,
    00322     RPMTAG_TRIGGERFLAGS         = 1068,
    00323     RPMTAG_TRIGGERINDEX         = 1069,
    00324     RPMTAG_VERIFYSCRIPT         = 1079,
    00325     RPMTAG_CHANGELOGTIME        = 1080,
    00326     RPMTAG_CHANGELOGNAME        = 1081,
    00327     RPMTAG_CHANGELOGTEXT        = 1082,
    00328 /*@-enummemuse@*/
    00329     RPMTAG_BROKENMD5            = 1083,
    00330 /*@=enummemuse@*/
    00331     RPMTAG_PREREQ               = 1084,
    00332     RPMTAG_PREINPROG            = 1085,
    00333     RPMTAG_POSTINPROG           = 1086,
    00334     RPMTAG_PREUNPROG            = 1087,
    00335     RPMTAG_POSTUNPROG           = 1088,
    00336     RPMTAG_BUILDARCHS           = 1089,
    00337     RPMTAG_OBSOLETENAME         = 1090,
    00338 #define RPMTAG_OBSOLETES RPMTAG_OBSOLETENAME    /* backward comaptibility */
    00339     RPMTAG_VERIFYSCRIPTPROG     = 1091,
    00340     RPMTAG_TRIGGERSCRIPTPROG    = 1092,
    00341     RPMTAG_DOCDIR               = 1093,
    00342     RPMTAG_COOKIE               = 1094,
    00343     RPMTAG_FILEDEVICES          = 1095,
    00344     RPMTAG_FILEINODES           = 1096,
    00345     RPMTAG_FILELANGS            = 1097,
    00346     RPMTAG_PREFIXES             = 1098,
    00347     RPMTAG_INSTPREFIXES         = 1099,
    00348     RPMTAG_TRIGGERIN            = 1100,
    00349     RPMTAG_TRIGGERUN            = 1101,
    00350     RPMTAG_TRIGGERPOSTUN        = 1102,
    00351     RPMTAG_AUTOREQ              = 1103,
    00352     RPMTAG_AUTOPROV             = 1104,
    00353 /*@-enummemuse@*/
    00354     RPMTAG_CAPABILITY           = 1105,
    00355 /*@=enummemuse@*/
    00356     RPMTAG_SOURCEPACKAGE        = 1106,
    00357 /*@-enummemuse@*/
    00358     RPMTAG_OLDORIGFILENAMES     = 1107,
    00359 /*@=enummemuse@*/
    00360     RPMTAG_BUILDPREREQ          = 1108,
    00361     RPMTAG_BUILDREQUIRES        = 1109,
    00362     RPMTAG_BUILDCONFLICTS       = 1110,
    00363 /*@-enummemuse@*/
    00364     RPMTAG_BUILDMACROS          = 1111,
    00365 /*@=enummemuse@*/
    00366     RPMTAG_PROVIDEFLAGS         = 1112,
    00367     RPMTAG_PROVIDEVERSION       = 1113,
    00368     RPMTAG_OBSOLETEFLAGS        = 1114,
    00369     RPMTAG_OBSOLETEVERSION      = 1115,
    00370     RPMTAG_DIRINDEXES           = 1116,
    00371     RPMTAG_BASENAMES            = 1117,
    00372     RPMTAG_DIRNAMES             = 1118,
    00373     RPMTAG_ORIGDIRINDEXES       = 1119,
    00374     RPMTAG_ORIGBASENAMES        = 1120,
    00375     RPMTAG_ORIGDIRNAMES         = 1121,
    00376     RPMTAG_OPTFLAGS             = 1122,
    00377     RPMTAG_DISTURL              = 1123,
    00378     RPMTAG_PAYLOADFORMAT        = 1124,
    00379     RPMTAG_PAYLOADCOMPRESSOR    = 1125,
    00380     RPMTAG_PAYLOADFLAGS         = 1126,
    00381     RPMTAG_MULTILIBS            = 1127,
    00382     RPMTAG_INSTALLTID           = 1128,
    00383     RPMTAG_REMOVETID            = 1129,
    00384 /*@-enummemuse@*/
    00385     RPMTAG_SHA1RHN              = 1130,
    00386 /*@=enummemuse@*/
    00387     RPMTAG_RHNPLATFORM          = 1131,
    00388     RPMTAG_PLATFORM             = 1132,
    00389     RPMTAG_PATCHESNAME          = 1133,
    00390     RPMTAG_PATCHESFLAGS         = 1134,
    00391     RPMTAG_PATCHESVERSION       = 1135,
    00392     RPMTAG_CACHECTIME           = 1136,
    00393     RPMTAG_CACHEPKGPATH         = 1137,
    00394     RPMTAG_CACHEPKGSIZE         = 1138,
    00395     RPMTAG_CACHEPKGMTIME        = 1139,
    00396 /*@-enummemuse@*/
    00397     RPMTAG_FIRSTFREE_TAG
    00398 /*@=enummemuse@*/
    00399 } rpmTag;
    00400
    00401 #define RPMTAG_EXTERNAL_TAG             1000000
    00402
    00406 typedef enum rpmfileState_e {
    00407     RPMFILE_STATE_NORMAL        = 0,
    00408     RPMFILE_STATE_REPLACED      = 1,
    00409     RPMFILE_STATE_NOTINSTALLED  = 2,
    00410     RPMFILE_STATE_NETSHARED     = 3
    00411 } rpmfileState;
    00412 #define RPMFILE_STATE_MISSING   -1      /* XXX used for unavailable data */
    00413
    00417 typedef enum rpmfileAttrs_e {
    00418 /*@-enummemuse@*/
    00419     RPMFILE_NONE        = 0,
    00420 /*@=enummemuse@*/
    00421     RPMFILE_CONFIG      = (1 << 0),
    00422     RPMFILE_DOC         = (1 << 1),
    00423 /*@-enummemuse@*/
    00424     RPMFILE_DONOTUSE    = (1 << 2),
    00425 /*@=enummemuse@*/
    00426     RPMFILE_MISSINGOK   = (1 << 3),
    00427     RPMFILE_NOREPLACE   = (1 << 4),
    00428     RPMFILE_SPECFILE    = (1 << 5),
    00429     RPMFILE_GHOST       = (1 << 6),
    00430     RPMFILE_LICENSE     = (1 << 7),
    00431     RPMFILE_README      = (1 << 8),
    00432     RPMFILE_EXCLUDE     = (1 << 9),
    00433     RPMFILE_UNPATCHED   = (1 << 10)
    00434 } rpmfileAttrs;
    00435 #define RPMFILE_MULTILIB_SHIFT          9
    00436 #define RPMFILE_MULTILIB(N)             ((N) << RPMFILE_MULTILIB_SHIFT)
    00437 #define RPMFILE_MULTILIB_MASK           RPMFILE_MULTILIB(7)
    00438
    00439 #define RPMFILE_ALL     ~(RPMFILE_NONE)
    00440
    00441 /* XXX Check file flags for multilib marker. */
    00442 #define isFileMULTILIB(_fflags)         ((_fflags) & RPMFILE_MULTILIB_MASK)
    00443
    00447 typedef enum rpmsenseFlags_e {
    00448     RPMSENSE_ANY        = 0,
    00449 /*@-enummemuse@*/
    00450     RPMSENSE_SERIAL     = (1 << 0),
    00451 /*@=enummemuse@*/
    00452     RPMSENSE_LESS       = (1 << 1),
    00453     RPMSENSE_GREATER    = (1 << 2),
    00454     RPMSENSE_EQUAL      = (1 << 3),
    00455     RPMSENSE_PROVIDES   = (1 << 4), /* only used internally by builds */
    00456     RPMSENSE_CONFLICTS  = (1 << 5), /* only used internally by builds */
    00457     RPMSENSE_PREREQ     = (1 << 6),
    00458     RPMSENSE_OBSOLETES  = (1 << 7), /* only used internally by builds */
    00459     RPMSENSE_INTERP     = (1 << 8),
    00460     RPMSENSE_SCRIPT_PRE = ((1 << 9)|RPMSENSE_PREREQ),
    00461     RPMSENSE_SCRIPT_POST = ((1 << 10)|RPMSENSE_PREREQ),
    00462     RPMSENSE_SCRIPT_PREUN = ((1 << 11)|RPMSENSE_PREREQ),
    00463     RPMSENSE_SCRIPT_POSTUN = ((1 << 12)|RPMSENSE_PREREQ),
    00464     RPMSENSE_SCRIPT_VERIFY = (1 << 13),
    00465     RPMSENSE_FIND_REQUIRES = (1 << 14),
    00466     RPMSENSE_FIND_PROVIDES = (1 << 15),
    00468     RPMSENSE_TRIGGERIN  = (1 << 16),
    00469     RPMSENSE_TRIGGERUN  = (1 << 17),
    00470     RPMSENSE_TRIGGERPOSTUN = (1 << 18),
    00471     RPMSENSE_MULTILIB   = (1 << 19),
    00472     RPMSENSE_SCRIPT_PREP = (1 << 20),
    00473     RPMSENSE_SCRIPT_BUILD = (1 << 21),
    00474     RPMSENSE_SCRIPT_INSTALL = (1 << 22),
    00475     RPMSENSE_SCRIPT_CLEAN = (1 << 23),
    00476     RPMSENSE_RPMLIB     = ((1 << 24) | RPMSENSE_PREREQ),
    00477 /*@-enummemuse@*/
    00478     RPMSENSE_TRIGGERPREIN = (1 << 25),
    00479 /*@=enummemuse@*/
    00480     RPMSENSE_KEYRING    = (1 << 26),
    00481     RPMSENSE_PATCHES    = (1 << 27)
    00482 } rpmsenseFlags;
    00483
    00484 #define RPMSENSE_SENSEMASK      15       /* Mask to get senses, ie serial, */
    00485                                          /* less, greater, equal.          */
    00486
    00487 #define RPMSENSE_TRIGGER        \
    00488         (RPMSENSE_TRIGGERIN | RPMSENSE_TRIGGERUN | RPMSENSE_TRIGGERPOSTUN)
    00489
    00490 #define isDependsMULTILIB(_dflags)      ((_dflags) & RPMSENSE_MULTILIB)
    00491
    00492 #define _ALL_REQUIRES_MASK      (\
    00493     RPMSENSE_INTERP | \
    00494     RPMSENSE_SCRIPT_PRE | \
    00495     RPMSENSE_SCRIPT_POST | \
    00496     RPMSENSE_SCRIPT_PREUN | \
    00497     RPMSENSE_SCRIPT_POSTUN | \
    00498     RPMSENSE_SCRIPT_VERIFY | \
    00499     RPMSENSE_FIND_REQUIRES | \
    00500     RPMSENSE_SCRIPT_PREP | \
    00501     RPMSENSE_SCRIPT_BUILD | \
    00502     RPMSENSE_SCRIPT_INSTALL | \
    00503     RPMSENSE_SCRIPT_CLEAN | \
    00504     RPMSENSE_RPMLIB | \
    00505     RPMSENSE_KEYRING )
    00506
    00507 #define _notpre(_x)             ((_x) & ~RPMSENSE_PREREQ)
    00508 #define _INSTALL_ONLY_MASK \
    00509     _notpre(RPMSENSE_SCRIPT_PRE|RPMSENSE_SCRIPT_POST|RPMSENSE_RPMLIB|RPMSENSE_KEYRING)
    00510 #define _ERASE_ONLY_MASK  \
    00511     _notpre(RPMSENSE_SCRIPT_PREUN|RPMSENSE_SCRIPT_POSTUN)
    00512
    00513 #define isLegacyPreReq(_x)  (((_x) & _ALL_REQUIRES_MASK) == RPMSENSE_PREREQ)
    00514 #define isInstallPreReq(_x)     ((_x) & _INSTALL_ONLY_MASK)
    00515 #define isErasePreReq(_x)       ((_x) & _ERASE_ONLY_MASK)
    00516
    00517 /* ==================================================================== */
    00520
    00521 /* Stuff for maintaining "variables" like SOURCEDIR, BUILDDIR, etc */
    00522 #define RPMVAR_OPTFLAGS                 3
    00523 #define RPMVAR_PROVIDES                 38
    00524 #define RPMVAR_INCLUDE                  43
    00525 #define RPMVAR_MACROFILES               49
    00526
    00527 #define RPMVAR_NUM                      55      /* number of RPMVAR entries */
    00528
    00534 /*@-redecl@*/
    00535 /*@observer@*/ /*@null@*/ extern const char * rpmGetVar(int var)
    00536         /*@*/;
    00537 /*@=redecl@*/
    00538
    00544 void rpmSetVar(int var, const char * val)
    00545         /*@globals internalState@*/
    00546         /*@modifies internalState @*/;
    00547
    00552 enum rpm_machtable_e {
    00553     RPM_MACHTABLE_INSTARCH      = 0,
    00554     RPM_MACHTABLE_INSTOS        = 1,
    00555     RPM_MACHTABLE_BUILDARCH     = 2,
    00556     RPM_MACHTABLE_BUILDOS       = 3
    00557 };
    00558 #define RPM_MACHTABLE_COUNT     4
    00566 int rpmReadConfigFiles(/*@null@*/ const char * file,
    00567                 /*@null@*/ const char * target)
    00568         /*@globals rpmGlobalMacroContext, rpmCLIMacroContext,
    00569                 fileSystem, internalState @*/
    00570         /*@modifies rpmGlobalMacroContext, rpmCLIMacroContext,
    00571                 fileSystem, internalState @*/;
    00572
    00579 void rpmGetArchInfo( /*@null@*/ /*@out@*/ const char ** name,
    00580                 /*@null@*/ /*@out@*/ int * num)
    00581         /*@modifies *name, *num @*/;
    00582
    00589 void rpmGetOsInfo( /*@null@*/ /*@out@*/ const char ** name,
    00590                 /*@null@*/ /*@out@*/ int * num)
    00591         /*@modifies *name, *num @*/;
    00592
    00606 int rpmMachineScore(int type, const char * name)
    00607         /*@*/;
    00608
    00614 int rpmShowRC(FILE * fp)
    00615         /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
    00616         /*@modifies *fp, rpmGlobalMacroContext, fileSystem, internalState  @*/;
    00617
    00625 void rpmSetTables(int archTable, int osTable)
    00626         /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
    00627         /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/;
    00628
    00639 void rpmSetMachine(/*@null@*/ const char * arch, /*@null@*/ const char * os)
    00640         /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
    00641         /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/;
    00642
    00651 /*@unused@*/
    00652 void rpmGetMachine( /*@null@*/ /*@out@*/ const char **arch,
    00653                 /*@null@*/ /*@out@*/ const char **os)
    00654         /*@modifies *arch, *os @*/;
    00655
    00660 void rpmFreeRpmrc(void)
    00661         /*@globals internalState @*/
    00662         /*@modifies internalState @*/;
    00663
    00665 /* ==================================================================== */
    00675 typedef /*@null@*/
    00676     void * (*HFD_t) (/*@only@*/ /*@null@*/ const void * data, rpmTagType type)
    00677         /*@modifies data @*/;
    00678
    00693 typedef int (*HGE_t) (Header h, rpmTag tag,
    00694                         /*@null@*/ /*@out@*/ rpmTagType * type,
    00695                         /*@null@*/ /*@out@*/ void ** p,
    00696                         /*@null@*/ /*@out@*/ int_32 * c)
    00697         /*@modifies *type, *p, *c @*/;
    00698
    00714 typedef int (*HAE_t) (Header h, rpmTag tag, rpmTagType type,
    00715                         const void * p, int_32 c)
    00716         /*@modifies h @*/;
    00717
    00729 typedef int (*HME_t) (Header h, rpmTag tag, rpmTagType type,
    00730                         const void * p, int_32 c)
    00731         /*@modifies h @*/;
    00732
    00743 typedef int (*HRE_t) (Header h, int_32 tag)
    00744         /*@modifies h @*/;
    00745
    00749 typedef enum rpmprobFilterFlags_e {
    00750     RPMPROB_FILTER_NONE         = 0,
    00751     RPMPROB_FILTER_IGNOREOS     = (1 << 0),
    00752     RPMPROB_FILTER_IGNOREARCH   = (1 << 1),
    00753     RPMPROB_FILTER_REPLACEPKG   = (1 << 2),
    00754     RPMPROB_FILTER_FORCERELOCATE= (1 << 3),
    00755     RPMPROB_FILTER_REPLACENEWFILES= (1 << 4),
    00756     RPMPROB_FILTER_REPLACEOLDFILES= (1 << 5),
    00757     RPMPROB_FILTER_OLDPACKAGE   = (1 << 6),
    00758     RPMPROB_FILTER_DISKSPACE    = (1 << 7),
    00759     RPMPROB_FILTER_DISKNODES    = (1 << 8)
    00760 } rpmprobFilterFlags;
    00761
    00765 typedef struct rpmRelocation_s {
    00766 /*@only@*/ /*@null@*/
    00767     const char * oldPath;
    00768 /*@only@*/ /*@null@*/
    00769     const char * newPath;
    00770 } rpmRelocation;
    00771
    00778 int rpmVersionCompare(Header first, Header second)
    00779         /*@*/;
    00780
    00784 typedef enum fileAction_e {
    00785     FA_UNKNOWN = 0,
    00786     FA_CREATE,
    00787     FA_COPYIN,
    00788     FA_COPYOUT,
    00789     FA_BACKUP,
    00790     FA_SAVE,
    00791     FA_SKIP,
    00792     FA_ALTNAME,
    00793     FA_ERASE,
    00794     FA_SKIPNSTATE,
    00795     FA_SKIPNETSHARED,
    00796     FA_SKIPMULTILIB
    00797 } fileAction;
    00798
    00799 #define XFA_SKIPPING(_a)        \
    00800     ((_a) == FA_SKIP || (_a) == FA_SKIPNSTATE || (_a) == FA_SKIPNETSHARED || (_a) == FA_SKIPMULTILIB)
    00801
    00809 typedef enum fileTypes_e {
    00810     PIPE        =  1,
    00811     CDEV        =  2,
    00812     XDIR        =  4,
    00813     BDEV        =  6,
    00814     REG         =  8,
    00815     LINK        = 10,
    00816     SOCK        = 12
    00817 } fileTypes;
    00818
    00822 typedef /*@abstract@*/ struct fsmIterator_s * FSMI_t;
    00823
    00827 typedef /*@abstract@*/ struct fsm_s * FSM_t;
    00828
    00832 typedef /*@abstract@*/ /*@refcounted@*/ struct rpmpsm_s * rpmpsm;
    00833
    00843 int headerVerifyInfo(int il, int dl, const void * pev, void * iv, int negate)
    00844         /*@modifies *iv @*/;
    00845
    00859 rpmRC headerCheck(rpmts ts, const void * uh, size_t uc, const char ** msg)
    00860         /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
    00861         /*@modifies ts, *msg, rpmGlobalMacroContext,
    00862                 fileSystem, internalState @*/;
    00863
    00872 rpmRC rpmReadHeader(rpmts ts, FD_t fd, Header *hdrp, const char ** msg)
    00873         /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
    00874         /*@modifies ts, *msg, rpmGlobalMacroContext,
    00875                 fileSystem, internalState @*/;
    00876
    00885 int rpmReadPackageFile(rpmts ts, FD_t fd,
    00886                 const char * fn, /*@null@*/ /*@out@*/ Header * hdrp)
    00887         /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
    00888         /*@modifies ts, fd, *hdrp, rpmGlobalMacroContext,
    00889                 fileSystem, internalState @*/;
    00890
    00899 rpmRC rpmInstallSourcePackage(rpmts ts, FD_t fd,
    00900                         /*@null@*/ /*@out@*/ const char ** specFilePtr,
    00901                         /*@null@*/ /*@out@*/ const char ** cookie)
    00902         /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
    00903         /*@modifies ts, fd, *specFilePtr, *cookie, rpmGlobalMacroContext,
    00904                 fileSystem, internalState @*/;
    00905
    00909 typedef enum rpmtransFlags_e {
    00910     RPMTRANS_FLAG_NONE          = 0,
    00911     RPMTRANS_FLAG_TEST          = (1 <<  0),
    00912     RPMTRANS_FLAG_BUILD_PROBS   = (1 <<  1),
    00913     RPMTRANS_FLAG_NOSCRIPTS     = (1 <<  2),
    00914     RPMTRANS_FLAG_JUSTDB        = (1 <<  3),
    00915     RPMTRANS_FLAG_NOTRIGGERS    = (1 <<  4),
    00916     RPMTRANS_FLAG_NODOCS        = (1 <<  5),
    00917     RPMTRANS_FLAG_ALLFILES      = (1 <<  6),
    00918 /*@-enummemuse@*/
    00919     RPMTRANS_FLAG_KEEPOBSOLETE  = (1 <<  7),
    00920 /*@=enummemuse@*/
    00921     RPMTRANS_FLAG_MULTILIB      = (1 <<  8),
    00922     RPMTRANS_FLAG_DIRSTASH      = (1 <<  9),
    00923     RPMTRANS_FLAG_REPACKAGE     = (1 << 10),
    00925     RPMTRANS_FLAG_PKGCOMMIT     = (1 << 11),
    00926 /*@-enummemuse@*/
    00927     RPMTRANS_FLAG_PKGUNDO       = (1 << 12),
    00928 /*@=enummemuse@*/
    00929     RPMTRANS_FLAG_COMMIT        = (1 << 13),
    00930 /*@-enummemuse@*/
    00931     RPMTRANS_FLAG_UNDO          = (1 << 14),
    00932 /*@=enummemuse@*/
    00933     RPMTRANS_FLAG_REVERSE       = (1 << 15),
    00934
    00935     RPMTRANS_FLAG_NOTRIGGERPREIN= (1 << 16),
    00936     RPMTRANS_FLAG_NOPRE         = (1 << 17),
    00937     RPMTRANS_FLAG_NOPOST        = (1 << 18),
    00938     RPMTRANS_FLAG_NOTRIGGERIN   = (1 << 19),
    00939     RPMTRANS_FLAG_NOTRIGGERUN   = (1 << 20),
    00940     RPMTRANS_FLAG_NOPREUN       = (1 << 21),
    00941     RPMTRANS_FLAG_NOPOSTUN      = (1 << 22),
    00942     RPMTRANS_FLAG_NOTRIGGERPOSTUN = (1 << 23),
    00943 /*@-enummemuse@*/
    00944     RPMTRANS_FLAG_NOPAYLOAD     = (1 << 24),
    00945 /*@=enummemuse@*/
    00946     RPMTRANS_FLAG_APPLYONLY     = (1 << 25),
    00947
    00948 /*@-enummemuse@*/
    00949     RPMTRANS_FLAG_CHAINSAW      = (1 << 26),
    00950 /*@=enummemuse@*/
    00951     RPMTRANS_FLAG_NOMD5         = (1 << 27),
    00952     RPMTRANS_FLAG_NOSUGGEST     = (1 << 28),
    00953     RPMTRANS_FLAG_ADDINDEPS     = (1 << 29)
    00954 } rpmtransFlags;
    00955
    00956 #define _noTransScripts         \
    00957   ( RPMTRANS_FLAG_NOPRE |       \
    00958     RPMTRANS_FLAG_NOPOST |      \
    00959     RPMTRANS_FLAG_NOPREUN |     \
    00960     RPMTRANS_FLAG_NOPOSTUN      \
    00961   )
    00962
    00963 #define _noTransTriggers        \
    00964   ( RPMTRANS_FLAG_NOTRIGGERPREIN | \
    00965     RPMTRANS_FLAG_NOTRIGGERIN | \
    00966     RPMTRANS_FLAG_NOTRIGGERUN | \
    00967     RPMTRANS_FLAG_NOTRIGGERPOSTUN \
    00968   )
    00969
    00977 /*@unused@*/
    00978 int rpmGetRpmlibProvides(/*@null@*/ /*@out@*/ const char *** provNames,
    00979                         /*@null@*/ /*@out@*/ int ** provFlags,
    00980                         /*@null@*/ /*@out@*/ const char *** provVersions)
    00981         /*@modifies *provNames, *provFlags, *provVersions @*/;
    00982
    00990 int rpmvercmp(const char * a, const char * b)
    00991         /*@*/;
    00992
    00998 int rpmCheckRpmlibProvides(const rpmds key)
    00999         /*@*/;
    01000
    01005 void rpmShowRpmlibProvides(FILE * fp)
    01006         /*@globals fileSystem @*/
    01007         /*@modifies *fp, fileSystem @*/;
    01008
    01016 /*@-redecl@*/
    01017 /*@observer@*/ extern const char *const tagName(int tag)
    01018         /*@*/;
    01019 /*@=redecl@*/
    01020
    01026 int tagValue(const char * tagstr)
    01027         /*@*/;
    01028
    01029 #define RPMLEAD_BINARY 0
    01030 #define RPMLEAD_SOURCE 1
    01031
    01032 #define RPMLEAD_MAGIC0 0xed
    01033 #define RPMLEAD_MAGIC1 0xab
    01034 #define RPMLEAD_MAGIC2 0xee
    01035 #define RPMLEAD_MAGIC3 0xdb
    01036
    01037 #define RPMLEAD_SIZE 96
    01045 struct rpmlead {
    01046     unsigned char magic[4];
    01047     unsigned char major;
    01048     unsigned char minor;
    01049     short type;
    01050     short archnum;
    01051     char name[66];
    01052     short osnum;
    01053     short signature_type;
    01054 /*@unused@*/ char reserved[16];
    01055 } ;
    01056
    01060 void freeFilesystems(void)
    01061         /*@globals internalState@*/
    01062         /*@modifies internalState@*/;
    01063
    01070 /*@-incondefs@*/
    01071 int rpmGetFilesystemList( /*@null@*/ /*@out@*/ const char *** listptr,
    01072                 /*@null@*/ /*@out@*/ int * num)
    01073         /*@globals fileSystem, internalState @*/
    01074         /*@modifies *listptr, *num, fileSystem, internalState @*/
    01075         /*@requires maxSet(listptr) >= 0 /\ maxSet(num) >= 0 @*/
    01076         /*@ensures maxRead(num) == 0 @*/;
    01077 /*@=incondefs@*/
    01078
    01088 /*@-incondefs@*/
    01089 int rpmGetFilesystemUsage(const char ** fileList, int_32 * fssizes,
    01090                 int numFiles, /*@null@*/ /*@out@*/ uint_32 ** usagesPtr,
    01091                 int flags)
    01092         /*@globals rpmGlobalMacroContext,
    01093                 fileSystem, internalState @*/
    01094         /*@modifies *usagesPtr, rpmGlobalMacroContext,
    01095                 fileSystem, internalState @*/
    01096         /*@requires maxSet(fileList) >= 0 /\ maxSet(fssizes) == 0
    01097                 /\ maxSet(usagesPtr) >= 0 @*/
    01098         /*@ensures maxRead(usagesPtr) == 0 @*/;
    01099 /*@=incondefs@*/
    01100
    01101 /* ==================================================================== */
    01104 /* --- install/upgrade/erase modes */
    01105
    01110 typedef enum rpmInstallInterfaceFlags_e {
    01111     INSTALL_NONE        = 0,
    01112     INSTALL_PERCENT     = (1 << 0),
    01113     INSTALL_HASH        = (1 << 1),
    01114     INSTALL_NODEPS      = (1 << 2),
    01115     INSTALL_NOORDER     = (1 << 3),
    01116     INSTALL_LABEL       = (1 << 4),
    01117     INSTALL_UPGRADE     = (1 << 5),
    01118     INSTALL_FRESHEN     = (1 << 6),
    01119     INSTALL_INSTALL     = (1 << 7),
    01120     INSTALL_ERASE       = (1 << 8)
    01121 } rpmInstallInterfaceFlags;
    01122
    01126 typedef enum rpmEraseInterfaceFlags_e {
    01127     UNINSTALL_NONE      = 0,
    01128     UNINSTALL_NODEPS    = (1 << 0),
    01129     UNINSTALL_ALLMATCHES= (1 << 1)
    01130 } rpmEraseInterfaceFlags;
    01131
    01133 /* ==================================================================== */
    01136
    01140 enum rpmtagSignature {
    01141     RPMSIGTAG_SIZE      = 1000,
    01142     RPMSIGTAG_LEMD5_1   = 1001,
    01143     RPMSIGTAG_PGP       = 1002,
    01144     RPMSIGTAG_LEMD5_2   = 1003,
    01145     RPMSIGTAG_MD5       = 1004,
    01146     RPMSIGTAG_GPG       = 1005,
    01147     RPMSIGTAG_PGP5      = 1006,
    01148     RPMSIGTAG_PAYLOADSIZE = 1007,
    01149     RPMSIGTAG_BADSHA1_1 = RPMTAG_BADSHA1_1,
    01150     RPMSIGTAG_BADSHA1_2 = RPMTAG_BADSHA1_2,
    01151     RPMSIGTAG_SHA1      = RPMTAG_SHA1HEADER,
    01152     RPMSIGTAG_DSA       = RPMTAG_DSAHEADER,
    01153     RPMSIGTAG_RSA       = RPMTAG_RSAHEADER
    01154 };
    01155
    01169 rpmRC rpmVerifySignature(const rpmts ts,
    01170                 /*@out@*/ char * result)
    01171         /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
    01172         /*@modifies ts, *result, rpmGlobalMacroContext,
    01173                 fileSystem, internalState @*/;
    01174
    01180 /*@null@*/ Header rpmFreeSignature(/*@null@*/ /*@killref@*/ Header h)
    01181         /*@modifies h @*/;
    01182
    01185 #ifdef __cplusplus
    01186 }
    01187 #endif
    01188
    01189 #endif  /* H_RPMLIB */