00001 #ifndef H_RPMLIB
00002 #define H_RPMLIB
00003
00011 #include "rpmio.h"
00012 #include "rpmmessages.h"
00013 #include "rpmerr.h"
00014 #include "header.h"
00015 #include "popt.h"
00016
00020 typedef enum rpmRC_e {
00021 RPMRC_OK = 0,
00022 RPMRC_NOTFOUND = 1,
00023 RPMRC_FAIL = 2,
00024 RPMRC_NOTTRUSTED = 3,
00025 RPMRC_NOKEY = 4
00026 } rpmRC;
00027
00028
00029
00030 extern struct MacroContext_s * rpmGlobalMacroContext;
00031
00032
00033 extern struct MacroContext_s * rpmCLIMacroContext;
00034
00035
00036 extern const char * RPMVERSION;
00037
00038
00039 extern const char * rpmNAME;
00040
00041
00042 extern const char * rpmEVR;
00043
00044
00045 extern int rpmFLAGS;
00046
00047
00048 #ifdef __cplusplus
00049 extern "C" {
00050 #endif
00051
00057 static inline
00058 void * _free( const void * p)
00059
00060 {
00061 if (p != NULL) free((void *)p);
00062 return NULL;
00063 }
00064
00071 typedef struct rpmts_s * rpmts;
00072
00075 typedef struct Spec_s * Spec;
00076
00080 typedef void * alKey;
00081 #define RPMAL_NOMATCH ((alKey)-1L)
00082
00086
00087 typedef int alNum;
00088
00089
00093 typedef struct rpmds_s * rpmds;
00094
00098 typedef struct rpmfi_s * rpmfi;
00099
00103 typedef struct rpmte_s * rpmte;
00104
00108 typedef struct rpmdb_s * rpmdb;
00109
00113 typedef struct _rpmdbMatchIterator * rpmdbMatchIterator;
00114
00118 typedef struct rpmgi_s * rpmgi;
00119
00128 int headerNVR(Header h,
00129 const char ** np,
00130 const char ** vp,
00131 const char ** rp)
00132 ;
00133
00144 int headerNEVRA(Header h,
00145 const char ** np,
00146 const char ** ep,
00147 const char ** vp,
00148 const char ** rp,
00149 const char ** ap)
00150 ;
00151
00158 void headerMergeLegacySigs(Header h, const Header sigh)
00159 ;
00160
00168 Header headerRegenSigHeader(const Header h, int noArchiveSize)
00169 ;
00170
00184
00185 int rpmHeaderGetEntry(Header h, int_32 tag, int_32 *type,
00186 void **p, int_32 *c)
00187 ;
00188
00192
00193
00194 extern const struct headerTagTableEntry_s * rpmTagTable;
00195
00196
00200
00201
00202 extern const int rpmTagTableSize;
00203
00204
00209
00210
00211 extern const struct headerSprintfExtension_s rpmHeaderFormats[];
00212
00213
00217 #define RPMDBI_PACKAGES 0
00218 #define RPMDBI_DEPENDS 1
00219 #define RPMDBI_LABEL 2
00220 #define RPMDBI_ADDED 3
00221 #define RPMDBI_REMOVED 4
00222 #define RPMDBI_AVAILABLE 5
00223 #define RPMDBI_HDLIST 6
00224 #define RPMDBI_ARGLIST 7
00225 #define RPMDBI_FTSWALK 8
00226
00232 typedef enum rpmTag_e {
00233
00234 RPMTAG_HEADERIMAGE = HEADER_IMAGE,
00235 RPMTAG_HEADERSIGNATURES = HEADER_SIGNATURES,
00236 RPMTAG_HEADERIMMUTABLE = HEADER_IMMUTABLE,
00237
00238 RPMTAG_HEADERREGIONS = HEADER_REGIONS,
00240 RPMTAG_HEADERI18NTABLE = HEADER_I18NTABLE,
00241
00242
00243
00244
00245
00246 RPMTAG_SIG_BASE = HEADER_SIGBASE,
00247 RPMTAG_SIGSIZE = RPMTAG_SIG_BASE+1,
00248 RPMTAG_SIGLEMD5_1 = RPMTAG_SIG_BASE+2,
00249 RPMTAG_SIGPGP = RPMTAG_SIG_BASE+3,
00250 RPMTAG_SIGLEMD5_2 = RPMTAG_SIG_BASE+4,
00251 RPMTAG_SIGMD5 = RPMTAG_SIG_BASE+5,
00252 #define RPMTAG_PKGID RPMTAG_SIGMD5
00253 RPMTAG_SIGGPG = RPMTAG_SIG_BASE+6,
00254 RPMTAG_SIGPGP5 = RPMTAG_SIG_BASE+7,
00256 RPMTAG_BADSHA1_1 = RPMTAG_SIG_BASE+8,
00257 RPMTAG_BADSHA1_2 = RPMTAG_SIG_BASE+9,
00258 RPMTAG_PUBKEYS = RPMTAG_SIG_BASE+10,
00259 RPMTAG_DSAHEADER = RPMTAG_SIG_BASE+11,
00260 RPMTAG_RSAHEADER = RPMTAG_SIG_BASE+12,
00261 RPMTAG_SHA1HEADER = RPMTAG_SIG_BASE+13,
00262 #define RPMTAG_HDRID RPMTAG_SHA1HEADER
00263
00264 RPMTAG_NAME = 1000,
00265 #define RPMTAG_N RPMTAG_NAME
00266 RPMTAG_VERSION = 1001,
00267 #define RPMTAG_V RPMTAG_VERSION
00268 RPMTAG_RELEASE = 1002,
00269 #define RPMTAG_R RPMTAG_RELEASE
00270 RPMTAG_EPOCH = 1003,
00271 #define RPMTAG_E RPMTAG_EPOCH
00272 #define RPMTAG_SERIAL RPMTAG_EPOCH
00273 RPMTAG_SUMMARY = 1004,
00274 RPMTAG_DESCRIPTION = 1005,
00275 RPMTAG_BUILDTIME = 1006,
00276 RPMTAG_BUILDHOST = 1007,
00277 RPMTAG_INSTALLTIME = 1008,
00278 RPMTAG_SIZE = 1009,
00279 RPMTAG_DISTRIBUTION = 1010,
00280 RPMTAG_VENDOR = 1011,
00281 RPMTAG_GIF = 1012,
00282 RPMTAG_XPM = 1013,
00283 RPMTAG_LICENSE = 1014,
00284 #define RPMTAG_COPYRIGHT RPMTAG_LICENSE
00285 RPMTAG_PACKAGER = 1015,
00286 RPMTAG_GROUP = 1016,
00287
00288 RPMTAG_CHANGELOG = 1017,
00289
00290 RPMTAG_SOURCE = 1018,
00291 RPMTAG_PATCH = 1019,
00292 RPMTAG_URL = 1020,
00293 RPMTAG_OS = 1021,
00294 RPMTAG_ARCH = 1022,
00295 RPMTAG_PREIN = 1023,
00296 RPMTAG_POSTIN = 1024,
00297 RPMTAG_PREUN = 1025,
00298 RPMTAG_POSTUN = 1026,
00299 RPMTAG_OLDFILENAMES = 1027,
00300 RPMTAG_FILESIZES = 1028,
00301 RPMTAG_FILESTATES = 1029,
00302 RPMTAG_FILEMODES = 1030,
00303 RPMTAG_FILEUIDS = 1031,
00304 RPMTAG_FILEGIDS = 1032,
00305 RPMTAG_FILERDEVS = 1033,
00306 RPMTAG_FILEMTIMES = 1034,
00307 RPMTAG_FILEMD5S = 1035,
00308 RPMTAG_FILELINKTOS = 1036,
00309 RPMTAG_FILEFLAGS = 1037,
00310
00311 RPMTAG_ROOT = 1038,
00312
00313 RPMTAG_FILEUSERNAME = 1039,
00314 RPMTAG_FILEGROUPNAME = 1040,
00315
00316 RPMTAG_EXCLUDE = 1041,
00317 RPMTAG_EXCLUSIVE = 1042,
00318
00319 RPMTAG_ICON = 1043,
00320 RPMTAG_SOURCERPM = 1044,
00321 RPMTAG_FILEVERIFYFLAGS = 1045,
00322 RPMTAG_ARCHIVESIZE = 1046,
00323 RPMTAG_PROVIDENAME = 1047,
00324 #define RPMTAG_PROVIDES RPMTAG_PROVIDENAME
00325 #define RPMTAG_P RPMTAG_PROVIDENAME
00326 RPMTAG_REQUIREFLAGS = 1048,
00327 RPMTAG_REQUIRENAME = 1049,
00328 #define RPMTAG_REQUIRES RPMTAG_REQUIRENAME
00329 #define RPMTAG_D RPMTAG_REQUIRENAME
00330 RPMTAG_REQUIREVERSION = 1050,
00331 RPMTAG_NOSOURCE = 1051,
00332 RPMTAG_NOPATCH = 1052,
00333 RPMTAG_CONFLICTFLAGS = 1053,
00334 RPMTAG_CONFLICTNAME = 1054,
00335 #define RPMTAG_CONFLICTS RPMTAG_CONFLICTNAME
00336 #define RPMTAG_C RPMTAG_CONFLICTNAME
00337 RPMTAG_CONFLICTVERSION = 1055,
00338 RPMTAG_DEFAULTPREFIX = 1056,
00339 RPMTAG_BUILDROOT = 1057,
00340 RPMTAG_INSTALLPREFIX = 1058,
00341 RPMTAG_EXCLUDEARCH = 1059,
00342 RPMTAG_EXCLUDEOS = 1060,
00343 RPMTAG_EXCLUSIVEARCH = 1061,
00344 RPMTAG_EXCLUSIVEOS = 1062,
00345 RPMTAG_AUTOREQPROV = 1063,
00346 RPMTAG_RPMVERSION = 1064,
00347 RPMTAG_TRIGGERSCRIPTS = 1065,
00348 RPMTAG_TRIGGERNAME = 1066,
00349 RPMTAG_TRIGGERVERSION = 1067,
00350 RPMTAG_TRIGGERFLAGS = 1068,
00351 RPMTAG_TRIGGERINDEX = 1069,
00352 RPMTAG_VERIFYSCRIPT = 1079,
00353 RPMTAG_CHANGELOGTIME = 1080,
00354 RPMTAG_CHANGELOGNAME = 1081,
00355 RPMTAG_CHANGELOGTEXT = 1082,
00356
00357 RPMTAG_BROKENMD5 = 1083,
00358
00359 RPMTAG_PREREQ = 1084,
00360 RPMTAG_PREINPROG = 1085,
00361 RPMTAG_POSTINPROG = 1086,
00362 RPMTAG_PREUNPROG = 1087,
00363 RPMTAG_POSTUNPROG = 1088,
00364 RPMTAG_BUILDARCHS = 1089,
00365 RPMTAG_OBSOLETENAME = 1090,
00366 #define RPMTAG_OBSOLETES RPMTAG_OBSOLETENAME
00367 #define RPMTAG_O RPMTAG_OBSOLETENAME
00368 RPMTAG_VERIFYSCRIPTPROG = 1091,
00369 RPMTAG_TRIGGERSCRIPTPROG = 1092,
00370 RPMTAG_DOCDIR = 1093,
00371 RPMTAG_COOKIE = 1094,
00372 RPMTAG_FILEDEVICES = 1095,
00373 RPMTAG_FILEINODES = 1096,
00374 RPMTAG_FILELANGS = 1097,
00375 RPMTAG_PREFIXES = 1098,
00376 RPMTAG_INSTPREFIXES = 1099,
00377 RPMTAG_TRIGGERIN = 1100,
00378 RPMTAG_TRIGGERUN = 1101,
00379 RPMTAG_TRIGGERPOSTUN = 1102,
00380 RPMTAG_AUTOREQ = 1103,
00381 RPMTAG_AUTOPROV = 1104,
00382
00383 RPMTAG_CAPABILITY = 1105,
00384
00385 RPMTAG_SOURCEPACKAGE = 1106,
00386
00387 RPMTAG_OLDORIGFILENAMES = 1107,
00388
00389 RPMTAG_BUILDPREREQ = 1108,
00390 RPMTAG_BUILDREQUIRES = 1109,
00391 RPMTAG_BUILDCONFLICTS = 1110,
00392
00393 RPMTAG_BUILDMACROS = 1111,
00394
00395 RPMTAG_PROVIDEFLAGS = 1112,
00396 RPMTAG_PROVIDEVERSION = 1113,
00397 RPMTAG_OBSOLETEFLAGS = 1114,
00398 RPMTAG_OBSOLETEVERSION = 1115,
00399 RPMTAG_DIRINDEXES = 1116,
00400 RPMTAG_BASENAMES = 1117,
00401 RPMTAG_DIRNAMES = 1118,
00402 RPMTAG_ORIGDIRINDEXES = 1119,
00403 RPMTAG_ORIGBASENAMES = 1120,
00404 RPMTAG_ORIGDIRNAMES = 1121,
00405 RPMTAG_OPTFLAGS = 1122,
00406 RPMTAG_DISTURL = 1123,
00407 RPMTAG_PAYLOADFORMAT = 1124,
00408 RPMTAG_PAYLOADCOMPRESSOR = 1125,
00409 RPMTAG_PAYLOADFLAGS = 1126,
00410 RPMTAG_INSTALLCOLOR = 1127,
00411 RPMTAG_INSTALLTID = 1128,
00412 RPMTAG_REMOVETID = 1129,
00413
00414 RPMTAG_SHA1RHN = 1130,
00415
00416 RPMTAG_RHNPLATFORM = 1131,
00417 RPMTAG_PLATFORM = 1132,
00418 RPMTAG_PATCHESNAME = 1133,
00419 RPMTAG_PATCHESFLAGS = 1134,
00420 RPMTAG_PATCHESVERSION = 1135,
00421 RPMTAG_CACHECTIME = 1136,
00422 RPMTAG_CACHEPKGPATH = 1137,
00423 RPMTAG_CACHEPKGSIZE = 1138,
00424 RPMTAG_CACHEPKGMTIME = 1139,
00425 RPMTAG_FILECOLORS = 1140,
00426 RPMTAG_FILECLASS = 1141,
00427 RPMTAG_CLASSDICT = 1142,
00428 RPMTAG_FILEDEPENDSX = 1143,
00429 RPMTAG_FILEDEPENDSN = 1144,
00430 RPMTAG_DEPENDSDICT = 1145,
00431 RPMTAG_SOURCEPKGID = 1146,
00432 RPMTAG_FILECONTEXTS = 1147,
00433 RPMTAG_FSCONTEXTS = 1148,
00434 RPMTAG_RECONTEXTS = 1149,
00435 RPMTAG_POLICIES = 1150,
00436 RPMTAG_PRETRANS = 1151,
00437 RPMTAG_POSTTRANS = 1152,
00438 RPMTAG_PRETRANSPROG = 1153,
00439 RPMTAG_POSTTRANSPROG = 1154,
00440 RPMTAG_DISTTAG = 1155,
00441 RPMTAG_SUGGESTSNAME = 1156,
00442 RPMTAG_SUGGESTSVERSION = 1157,
00443 RPMTAG_SUGGESTSFLAGS = 1158,
00444 RPMTAG_ENHANCESNAME = 1159,
00445 RPMTAG_ENHANCESVERSION = 1160,
00446 RPMTAG_ENHANCESFLAGS = 1161,
00447 RPMTAG_PRIORITY = 1162,
00448 RPMTAG_CVSID = 1163,
00449 #define RPMTAG_SVNID RPMTAG_CVSID
00450
00451
00452 RPMTAG_FIRSTFREE_TAG
00453
00454 } rpmTag;
00455
00456 #define RPMTAG_EXTERNAL_TAG 1000000
00457
00461 typedef enum rpmfileState_e {
00462 RPMFILE_STATE_NORMAL = 0,
00463 RPMFILE_STATE_REPLACED = 1,
00464 RPMFILE_STATE_NOTINSTALLED = 2,
00465 RPMFILE_STATE_NETSHARED = 3,
00466 RPMFILE_STATE_WRONGCOLOR = 4
00467 } rpmfileState;
00468 #define RPMFILE_STATE_MISSING -1
00469
00473 typedef enum rpmfileAttrs_e {
00474
00475 RPMFILE_NONE = 0,
00476
00477 RPMFILE_CONFIG = (1 << 0),
00478 RPMFILE_DOC = (1 << 1),
00479 RPMFILE_ICON = (1 << 2),
00480 RPMFILE_MISSINGOK = (1 << 3),
00481 RPMFILE_NOREPLACE = (1 << 4),
00482 RPMFILE_SPECFILE = (1 << 5),
00483 RPMFILE_GHOST = (1 << 6),
00484 RPMFILE_LICENSE = (1 << 7),
00485 RPMFILE_README = (1 << 8),
00486 RPMFILE_EXCLUDE = (1 << 9),
00487 RPMFILE_UNPATCHED = (1 << 10),
00488 RPMFILE_PUBKEY = (1 << 11),
00489 RPMFILE_POLICY = (1 << 12)
00490 } rpmfileAttrs;
00491
00492 #define RPMFILE_ALL ~(RPMFILE_NONE)
00493
00497 typedef enum rpmsenseFlags_e {
00498 RPMSENSE_ANY = 0,
00499
00500 RPMSENSE_SERIAL = (1 << 0),
00501
00502 RPMSENSE_LESS = (1 << 1),
00503 RPMSENSE_GREATER = (1 << 2),
00504 RPMSENSE_EQUAL = (1 << 3),
00505 RPMSENSE_PROVIDES = (1 << 4),
00506 RPMSENSE_CONFLICTS = (1 << 5),
00507 RPMSENSE_PREREQ = (1 << 6),
00508 RPMSENSE_OBSOLETES = (1 << 7),
00509 RPMSENSE_INTERP = (1 << 8),
00510 RPMSENSE_SCRIPT_PRE = ((1 << 9)|RPMSENSE_PREREQ),
00511 RPMSENSE_SCRIPT_POST = ((1 << 10)|RPMSENSE_PREREQ),
00512 RPMSENSE_SCRIPT_PREUN = ((1 << 11)|RPMSENSE_PREREQ),
00513 RPMSENSE_SCRIPT_POSTUN = ((1 << 12)|RPMSENSE_PREREQ),
00514 RPMSENSE_SCRIPT_VERIFY = (1 << 13),
00515 RPMSENSE_FIND_REQUIRES = (1 << 14),
00516 RPMSENSE_FIND_PROVIDES = (1 << 15),
00518 RPMSENSE_TRIGGERIN = (1 << 16),
00519 RPMSENSE_TRIGGERUN = (1 << 17),
00520 RPMSENSE_TRIGGERPOSTUN = (1 << 18),
00521 RPMSENSE_MISSINGOK = (1 << 19),
00522 RPMSENSE_SCRIPT_PREP = (1 << 20),
00523 RPMSENSE_SCRIPT_BUILD = (1 << 21),
00524 RPMSENSE_SCRIPT_INSTALL = (1 << 22),
00525 RPMSENSE_SCRIPT_CLEAN = (1 << 23),
00526 RPMSENSE_RPMLIB = ((1 << 24) | RPMSENSE_PREREQ),
00527
00528 RPMSENSE_TRIGGERPREIN = (1 << 25),
00529
00530 RPMSENSE_KEYRING = (1 << 26),
00531 RPMSENSE_PATCHES = (1 << 27),
00532 RPMSENSE_CONFIG = (1 << 28)
00533 } rpmsenseFlags;
00534
00535 #define RPMSENSE_SENSEMASK 15
00536
00537
00538 #define RPMSENSE_TRIGGER \
00539 (RPMSENSE_TRIGGERIN | RPMSENSE_TRIGGERUN | RPMSENSE_TRIGGERPOSTUN)
00540
00541 #define _ALL_REQUIRES_MASK (\
00542 RPMSENSE_INTERP | \
00543 RPMSENSE_SCRIPT_PRE | \
00544 RPMSENSE_SCRIPT_POST | \
00545 RPMSENSE_SCRIPT_PREUN | \
00546 RPMSENSE_SCRIPT_POSTUN | \
00547 RPMSENSE_SCRIPT_VERIFY | \
00548 RPMSENSE_FIND_REQUIRES | \
00549 RPMSENSE_SCRIPT_PREP | \
00550 RPMSENSE_SCRIPT_BUILD | \
00551 RPMSENSE_SCRIPT_INSTALL | \
00552 RPMSENSE_SCRIPT_CLEAN | \
00553 RPMSENSE_RPMLIB | \
00554 RPMSENSE_KEYRING )
00555
00556 #define _notpre(_x) ((_x) & ~RPMSENSE_PREREQ)
00557 #define _INSTALL_ONLY_MASK \
00558 _notpre(RPMSENSE_SCRIPT_PRE|RPMSENSE_SCRIPT_POST|RPMSENSE_RPMLIB|RPMSENSE_KEYRING)
00559 #define _ERASE_ONLY_MASK \
00560 _notpre(RPMSENSE_SCRIPT_PREUN|RPMSENSE_SCRIPT_POSTUN)
00561
00562 #define isLegacyPreReq(_x) (((_x) & _ALL_REQUIRES_MASK) == RPMSENSE_PREREQ)
00563 #define isInstallPreReq(_x) ((_x) & _INSTALL_ONLY_MASK)
00564 #define isErasePreReq(_x) ((_x) & _ERASE_ONLY_MASK)
00565
00566
00569
00570
00571 #define RPMVAR_OPTFLAGS 3
00572 #define RPMVAR_PROVIDES 38
00573 #define RPMVAR_INCLUDE 43
00574 #define RPMVAR_MACROFILES 49
00575
00576 #define RPMVAR_NUM 55
00577
00583
00584 extern const char * rpmGetVar(int var)
00585 ;
00586
00587
00593 void rpmSetVar(int var, const char * val)
00594
00595 ;
00596
00601 enum rpm_machtable_e {
00602 RPM_MACHTABLE_INSTARCH = 0,
00603 RPM_MACHTABLE_INSTOS = 1,
00604 RPM_MACHTABLE_BUILDARCH = 2,
00605 RPM_MACHTABLE_BUILDOS = 3
00606 };
00607 #define RPM_MACHTABLE_COUNT 4
00615 int rpmReadConfigFiles( const char * file,
00616 const char * target)
00617
00618
00619
00620 ;
00621
00628 void rpmGetArchInfo( const char ** name,
00629 int * num)
00630 ;
00631
00638 void rpmGetOsInfo( const char ** name,
00639 int * num)
00640 ;
00641
00655 int rpmMachineScore(int type, const char * name)
00656 ;
00657
00663 int rpmShowRC(FILE * fp)
00664
00665 ;
00666
00674 void rpmSetTables(int archTable, int osTable)
00675
00676 ;
00677
00688 void rpmSetMachine( const char * arch, const char * os)
00689
00690 ;
00691
00700
00701 void rpmGetMachine( const char **arch,
00702 const char **os)
00703 ;
00704
00709 void rpmFreeRpmrc(void)
00710
00711 ;
00712
00714
00724 typedef
00725 void * (*HFD_t) ( const void * data, rpmTagType type)
00726 ;
00727
00742 typedef int (*HGE_t) (Header h, rpmTag tag,
00743 rpmTagType * type,
00744 void ** p,
00745 int_32 * c)
00746 ;
00747
00763 typedef int (*HAE_t) (Header h, rpmTag tag, rpmTagType type,
00764 const void * p, int_32 c)
00765 ;
00766
00778 typedef int (*HME_t) (Header h, rpmTag tag, rpmTagType type,
00779 const void * p, int_32 c)
00780 ;
00781
00792 typedef int (*HRE_t) (Header h, int_32 tag)
00793 ;
00794
00798 typedef enum rpmprobFilterFlags_e {
00799 RPMPROB_FILTER_NONE = 0,
00800 RPMPROB_FILTER_IGNOREOS = (1 << 0),
00801 RPMPROB_FILTER_IGNOREARCH = (1 << 1),
00802 RPMPROB_FILTER_REPLACEPKG = (1 << 2),
00803 RPMPROB_FILTER_FORCERELOCATE= (1 << 3),
00804 RPMPROB_FILTER_REPLACENEWFILES= (1 << 4),
00805 RPMPROB_FILTER_REPLACEOLDFILES= (1 << 5),
00806 RPMPROB_FILTER_OLDPACKAGE = (1 << 6),
00807 RPMPROB_FILTER_DISKSPACE = (1 << 7),
00808 RPMPROB_FILTER_DISKNODES = (1 << 8)
00809 } rpmprobFilterFlags;
00810
00814 typedef struct rpmRelocation_s {
00815
00816 const char * oldPath;
00817
00818 const char * newPath;
00819 } rpmRelocation;
00820
00827 int rpmVersionCompare(Header first, Header second)
00828 ;
00829
00833 typedef enum fileAction_e {
00834 FA_UNKNOWN = 0,
00835 FA_CREATE,
00836 FA_COPYIN,
00837 FA_COPYOUT,
00838 FA_BACKUP,
00839 FA_SAVE,
00840 FA_SKIP,
00841 FA_ALTNAME,
00842 FA_ERASE,
00843 FA_SKIPNSTATE,
00844 FA_SKIPNETSHARED,
00845 FA_SKIPCOLOR
00846 } fileAction;
00847
00848 #define XFA_SKIPPING(_a) \
00849 ((_a) == FA_SKIP || (_a) == FA_SKIPNSTATE || (_a) == FA_SKIPNETSHARED || (_a) == FA_SKIPCOLOR)
00850
00858 typedef enum fileTypes_e {
00859 PIPE = 1,
00860 CDEV = 2,
00861 XDIR = 4,
00862 BDEV = 6,
00863 REG = 8,
00864 LINK = 10,
00865 SOCK = 12
00866 } fileTypes;
00867
00871 typedef struct fsmIterator_s * FSMI_t;
00872
00876 typedef struct fsm_s * FSM_t;
00877
00881 typedef struct rpmpsm_s * rpmpsm;
00882
00892 int headerVerifyInfo(int il, int dl, const void * pev, void * iv, int negate)
00893 ;
00894
00900 rpmRC headerCheckPayloadFormat(Header h);
00901
00915 rpmRC headerCheck(rpmts ts, const void * uh, size_t uc,
00916 const char ** msg)
00917
00918
00919 ;
00920
00929 rpmRC rpmReadHeader(rpmts ts, FD_t fd, Header *hdrp,
00930 const char ** msg)
00931
00932
00933 ;
00934
00943 rpmRC rpmReadPackageFile(rpmts ts, FD_t fd,
00944 const char * fn, Header * hdrp)
00945
00946
00947 ;
00948
00957 rpmRC rpmInstallSourcePackage(rpmts ts, FD_t fd,
00958 const char ** specFilePtr,
00959 const char ** cookie)
00960
00961
00962 ;
00963
00967 typedef enum rpmtransFlags_e {
00968 RPMTRANS_FLAG_NONE = 0,
00969 RPMTRANS_FLAG_TEST = (1 << 0),
00970 RPMTRANS_FLAG_BUILD_PROBS = (1 << 1),
00971 RPMTRANS_FLAG_NOSCRIPTS = (1 << 2),
00972 RPMTRANS_FLAG_JUSTDB = (1 << 3),
00973 RPMTRANS_FLAG_NOTRIGGERS = (1 << 4),
00974 RPMTRANS_FLAG_NODOCS = (1 << 5),
00975 RPMTRANS_FLAG_ALLFILES = (1 << 6),
00976
00977 RPMTRANS_FLAG_KEEPOBSOLETE = (1 << 7),
00978
00979 RPMTRANS_FLAG_NOCONTEXTS = (1 << 8),
00980 RPMTRANS_FLAG_DIRSTASH = (1 << 9),
00981 RPMTRANS_FLAG_REPACKAGE = (1 << 10),
00983 RPMTRANS_FLAG_PKGCOMMIT = (1 << 11),
00984
00985 RPMTRANS_FLAG_PKGUNDO = (1 << 12),
00986
00987 RPMTRANS_FLAG_COMMIT = (1 << 13),
00988
00989 RPMTRANS_FLAG_UNDO = (1 << 14),
00990
00991 RPMTRANS_FLAG_REVERSE = (1 << 15),
00992
00993 RPMTRANS_FLAG_NOTRIGGERPREIN= (1 << 16),
00994 RPMTRANS_FLAG_NOPRE = (1 << 17),
00995 RPMTRANS_FLAG_NOPOST = (1 << 18),
00996 RPMTRANS_FLAG_NOTRIGGERIN = (1 << 19),
00997 RPMTRANS_FLAG_NOTRIGGERUN = (1 << 20),
00998 RPMTRANS_FLAG_NOPREUN = (1 << 21),
00999 RPMTRANS_FLAG_NOPOSTUN = (1 << 22),
01000 RPMTRANS_FLAG_NOTRIGGERPOSTUN = (1 << 23),
01001
01002 RPMTRANS_FLAG_NOPAYLOAD = (1 << 24),
01003
01004 RPMTRANS_FLAG_APPLYONLY = (1 << 25),
01005
01006 RPMTRANS_FLAG_ANACONDA = (1 << 26),
01007 RPMTRANS_FLAG_NOMD5 = (1 << 27),
01008 RPMTRANS_FLAG_NOSUGGEST = (1 << 28),
01009 RPMTRANS_FLAG_ADDINDEPS = (1 << 29),
01010 RPMTRANS_FLAG_NOCONFIGS = (1 << 30),
01011 RPMTRANS_FLAG_DEPLOOPS = (1 << 31)
01012 } rpmtransFlags;
01013
01014 #define _noTransScripts \
01015 ( RPMTRANS_FLAG_NOPRE | \
01016 RPMTRANS_FLAG_NOPOST | \
01017 RPMTRANS_FLAG_NOPREUN | \
01018 RPMTRANS_FLAG_NOPOSTUN \
01019 )
01020
01021 #define _noTransTriggers \
01022 ( RPMTRANS_FLAG_NOTRIGGERPREIN | \
01023 RPMTRANS_FLAG_NOTRIGGERIN | \
01024 RPMTRANS_FLAG_NOTRIGGERUN | \
01025 RPMTRANS_FLAG_NOTRIGGERPOSTUN \
01026 )
01027
01035
01036 int rpmGetRpmlibProvides( const char *** provNames,
01037 int ** provFlags,
01038 const char *** provVersions)
01039 ;
01040
01048 int rpmvercmp(const char * a, const char * b)
01049 ;
01050
01056 int rpmCheckRpmlibProvides(const rpmds key)
01057 ;
01058
01063 void rpmShowRpmlibProvides(FILE * fp)
01064
01065 ;
01066
01074 int tagType(int tag)
01075 ;
01076
01082
01083 extern const char *const tagName(int tag)
01084 ;
01085
01086
01092 int tagValue(const char * tagstr)
01093 ;
01094
01095 #define RPMLEAD_BINARY 0
01096 #define RPMLEAD_SOURCE 1
01097
01098 #define RPMLEAD_MAGIC0 0xed
01099 #define RPMLEAD_MAGIC1 0xab
01100 #define RPMLEAD_MAGIC2 0xee
01101 #define RPMLEAD_MAGIC3 0xdb
01102
01103 #define RPMLEAD_SIZE 96
01111 struct rpmlead {
01112 unsigned char magic[4];
01113 unsigned char major;
01114 unsigned char minor;
01115 short type;
01116 short archnum;
01117 char name[66];
01118 short osnum;
01119 short signature_type;
01120 char reserved[16];
01121 } ;
01122
01126 void freeFilesystems(void)
01127
01128 ;
01129
01136
01137 int rpmGetFilesystemList( const char *** listptr,
01138 int * num)
01139
01140
01141
01142 ;
01143
01144
01154
01155 int rpmGetFilesystemUsage(const char ** fileList, int_32 * fssizes,
01156 int numFiles, uint_32 ** usagesPtr,
01157 int flags)
01158
01159
01160
01161
01162
01163
01164 ;
01165
01166
01167
01170
01171
01176 typedef enum rpmInstallInterfaceFlags_e {
01177 INSTALL_NONE = 0,
01178 INSTALL_PERCENT = (1 << 0),
01179 INSTALL_HASH = (1 << 1),
01180 INSTALL_NODEPS = (1 << 2),
01181 INSTALL_NOORDER = (1 << 3),
01182 INSTALL_LABEL = (1 << 4),
01183 INSTALL_UPGRADE = (1 << 5),
01184 INSTALL_FRESHEN = (1 << 6),
01185 INSTALL_INSTALL = (1 << 7),
01186 INSTALL_ERASE = (1 << 8)
01187 } rpmInstallInterfaceFlags;
01188
01192 typedef enum rpmEraseInterfaceFlags_e {
01193 UNINSTALL_NONE = 0,
01194 UNINSTALL_NODEPS = (1 << 0),
01195 UNINSTALL_ALLMATCHES= (1 << 1)
01196 } rpmEraseInterfaceFlags;
01197
01199
01202
01206 enum rpmtagSignature {
01207 RPMSIGTAG_SIZE = 1000,
01208 RPMSIGTAG_LEMD5_1 = 1001,
01209 RPMSIGTAG_PGP = 1002,
01210 RPMSIGTAG_LEMD5_2 = 1003,
01211 RPMSIGTAG_MD5 = 1004,
01212 RPMSIGTAG_GPG = 1005,
01213 RPMSIGTAG_PGP5 = 1006,
01214 RPMSIGTAG_PAYLOADSIZE = 1007,
01215 RPMSIGTAG_BADSHA1_1 = RPMTAG_BADSHA1_1,
01216 RPMSIGTAG_BADSHA1_2 = RPMTAG_BADSHA1_2,
01217 RPMSIGTAG_SHA1 = RPMTAG_SHA1HEADER,
01218 RPMSIGTAG_DSA = RPMTAG_DSAHEADER,
01219 RPMSIGTAG_RSA = RPMTAG_RSAHEADER
01220 };
01221
01235 rpmRC rpmVerifySignature(const rpmts ts,
01236 char * result)
01237
01238
01239 ;
01240
01246 Header rpmFreeSignature( Header h)
01247 ;
01248
01251 #ifdef __cplusplus
01252 }
01253 #endif
01254
01255 #endif