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

# rpmts.h

Go to the documentation of this file.

    00001 #ifndef H_RPMTS
    00002 #define H_RPMTS
    00003
    00009 #include <sys/types.h>
    00010
    00011 #include <rpm/rpmtypes.h>
    00012 #include <rpm/rpmps.h>
    00013 #include <rpm/rpmsw.h>
    00014 #include <rpm/rpmpgp.h>
    00015 #include <rpm/rpmfi.h>
    00016 #include <rpm/rpmcallback.h>
    00017
    00018 #ifdef __cplusplus
    00019 extern "C" {
    00020 #endif
    00021
    00022 extern int _rpmts_debug;
    00023 extern int _rpmts_stats;
    00024 extern int _fps_debug;
    00025
    00029 typedef enum rpmtransFlags_e {
    00030     RPMTRANS_FLAG_NONE          = 0,
    00031     RPMTRANS_FLAG_TEST          = (1 <<  0),
    00032     RPMTRANS_FLAG_BUILD_PROBS   = (1 <<  1),
    00033     RPMTRANS_FLAG_NOSCRIPTS     = (1 <<  2),
    00034     RPMTRANS_FLAG_JUSTDB        = (1 <<  3),
    00035     RPMTRANS_FLAG_NOTRIGGERS    = (1 <<  4),
    00036     RPMTRANS_FLAG_NODOCS        = (1 <<  5),
    00037     RPMTRANS_FLAG_ALLFILES      = (1 <<  6),
    00038     RPMTRANS_FLAG_KEEPOBSOLETE  = (1 <<  7),
    00039     RPMTRANS_FLAG_NOCONTEXTS    = (1 <<  8),
    00040     RPMTRANS_FLAG_DIRSTASH      = (1 <<  9),
    00041     RPMTRANS_FLAG_REPACKAGE     = (1 << 10),
    00043     RPMTRANS_FLAG_PKGCOMMIT     = (1 << 11),
    00044     RPMTRANS_FLAG_PKGUNDO       = (1 << 12),
    00045     RPMTRANS_FLAG_COMMIT        = (1 << 13),
    00046     RPMTRANS_FLAG_UNDO          = (1 << 14),
    00047     RPMTRANS_FLAG_REVERSE       = (1 << 15),
    00048
    00049     RPMTRANS_FLAG_NOTRIGGERPREIN= (1 << 16),
    00050     RPMTRANS_FLAG_NOPRE         = (1 << 17),
    00051     RPMTRANS_FLAG_NOPOST        = (1 << 18),
    00052     RPMTRANS_FLAG_NOTRIGGERIN   = (1 << 19),
    00053     RPMTRANS_FLAG_NOTRIGGERUN   = (1 << 20),
    00054     RPMTRANS_FLAG_NOPREUN       = (1 << 21),
    00055     RPMTRANS_FLAG_NOPOSTUN      = (1 << 22),
    00056     RPMTRANS_FLAG_NOTRIGGERPOSTUN = (1 << 23),
    00057     RPMTRANS_FLAG_NOPAYLOAD     = (1 << 24),
    00058     RPMTRANS_FLAG_APPLYONLY     = (1 << 25),
    00059
    00060     RPMTRANS_FLAG_NOMD5         = (1 << 27),
    00061     RPMTRANS_FLAG_NOSUGGEST     = (1 << 28),
    00062     RPMTRANS_FLAG_ADDINDEPS     = (1 << 29),
    00063     RPMTRANS_FLAG_NOCONFIGS     = (1 << 30),
    00064     RPMTRANS_FLAG_DEPLOOPS      = (1 << 31)
    00065 } rpmtransFlags;
    00066
    00067 #define _noTransScripts         \
    00068   ( RPMTRANS_FLAG_NOPRE |       \
    00069     RPMTRANS_FLAG_NOPOST |      \
    00070     RPMTRANS_FLAG_NOPREUN |     \
    00071     RPMTRANS_FLAG_NOPOSTUN      \
    00072   )
    00073
    00074 #define _noTransTriggers        \
    00075   ( RPMTRANS_FLAG_NOTRIGGERPREIN | \
    00076     RPMTRANS_FLAG_NOTRIGGERIN | \
    00077     RPMTRANS_FLAG_NOTRIGGERUN | \
    00078     RPMTRANS_FLAG_NOTRIGGERPOSTUN \
    00079   )
    00080
    00084 typedef enum rpmVSFlags_e {
    00085     RPMVSF_DEFAULT      = 0,
    00086     RPMVSF_NOHDRCHK     = (1 <<  0),
    00087     RPMVSF_NEEDPAYLOAD  = (1 <<  1),
    00088     /* bit(s) 2-7 unused */
    00089     RPMVSF_NOSHA1HEADER = (1 <<  8),
    00090     RPMVSF_NOMD5HEADER  = (1 <<  9),    /* unimplemented */
    00091     RPMVSF_NODSAHEADER  = (1 << 10),
    00092     RPMVSF_NORSAHEADER  = (1 << 11),    /* unimplemented */
    00093     /* bit(s) 12-15 unused */
    00094     RPMVSF_NOSHA1       = (1 << 16),    /* unimplemented */
    00095     RPMVSF_NOMD5        = (1 << 17),
    00096     RPMVSF_NODSA        = (1 << 18),
    00097     RPMVSF_NORSA        = (1 << 19)
    00098     /* bit(s) 16-31 unused */
    00099 } rpmVSFlags;
    00100
    00101 #define _RPMVSF_NODIGESTS       \
    00102   ( RPMVSF_NOSHA1HEADER |       \
    00103     RPMVSF_NOMD5HEADER |        \
    00104     RPMVSF_NOSHA1 |             \
    00105     RPMVSF_NOMD5 )
    00106
    00107 #define _RPMVSF_NOSIGNATURES    \
    00108   ( RPMVSF_NODSAHEADER |        \
    00109     RPMVSF_NORSAHEADER |        \
    00110     RPMVSF_NODSA |              \
    00111     RPMVSF_NORSA )
    00112
    00113 #define _RPMVSF_NOHEADER        \
    00114   ( RPMVSF_NOSHA1HEADER |       \
    00115     RPMVSF_NOMD5HEADER |        \
    00116     RPMVSF_NODSAHEADER |        \
    00117     RPMVSF_NORSAHEADER )
    00118
    00119 #define _RPMVSF_NOPAYLOAD       \
    00120   ( RPMVSF_NOSHA1 |             \
    00121     RPMVSF_NOMD5 |              \
    00122     RPMVSF_NODSA |              \
    00123     RPMVSF_NORSA )
    00124
    00128 typedef enum rpmtsOpX_e {
    00129     RPMTS_OP_TOTAL              =  0,
    00130     RPMTS_OP_CHECK              =  1,
    00131     RPMTS_OP_ORDER              =  2,
    00132     RPMTS_OP_FINGERPRINT        =  3,
    00133     RPMTS_OP_INSTALL            =  5,
    00134     RPMTS_OP_ERASE              =  6,
    00135     RPMTS_OP_SCRIPTLETS         =  7,
    00136     RPMTS_OP_COMPRESS           =  8,
    00137     RPMTS_OP_UNCOMPRESS         =  9,
    00138     RPMTS_OP_DIGEST             = 10,
    00139     RPMTS_OP_SIGNATURE          = 11,
    00140     RPMTS_OP_DBADD              = 12,
    00141     RPMTS_OP_DBREMOVE           = 13,
    00142     RPMTS_OP_DBGET              = 14,
    00143     RPMTS_OP_DBPUT              = 15,
    00144     RPMTS_OP_DBDEL              = 16,
    00145     RPMTS_OP_MAX                = 17
    00146 } rpmtsOpX;
    00147
    00158 int rpmtsCheck(rpmts ts);
    00159
    00176 int rpmtsOrder(rpmts ts);
    00177
    00195 int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet);
    00196
    00203 rpmts rpmtsUnlink (rpmts ts,
    00204                 const char * msg);
    00205
    00212 rpmts rpmtsLink (rpmts ts, const char * msg);
    00213
    00219 int rpmtsCloseDB(rpmts ts);
    00220
    00227 int rpmtsOpenDB(rpmts ts, int dbmode);
    00228
    00236 int rpmtsInitDB(rpmts ts, int dbmode);
    00237
    00243 int rpmtsGetDBMode(rpmts ts);
    00244
    00252 int rpmtsSetDBMode(rpmts ts, int dbmode);
    00253
    00259 int rpmtsRebuildDB(rpmts ts);
    00260
    00266 int rpmtsVerifyDB(rpmts ts);
    00267
    00276 rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
    00277                         const void * keyp, size_t keylen);
    00278
    00285 rpmRC rpmtsFindPubkey(rpmts ts, pgpDig dig) RPM_GNUC_DEPRECATED;
    00286
    00295 rpmRC rpmtsImportPubkey(rpmts ts, const unsigned char * pkt, size_t pktlen);
    00296
    00303 rpmKeyring rpmtsGetKeyring(rpmts ts, int autoload);
    00304
    00313 int rpmtsSetKeyring(rpmts ts, rpmKeyring keyring);
    00314
    00322 int rpmtsSetSolveCallback(rpmts ts,
    00323                 int (*solve) (rpmts ts, rpmds ds, const void * data),
    00324                 const void * solveData);
    00325
    00331 rpmps rpmtsProblems(rpmts ts);
    00332
    00337 void rpmtsCleanProblems(rpmts ts);
    00338
    00343 void rpmtsClean(rpmts ts);
    00344
    00349 void rpmtsEmpty(rpmts ts);
    00350
    00356 rpmts rpmtsFree(rpmts ts);
    00357
    00363 rpmVSFlags rpmtsVSFlags(rpmts ts);
    00364
    00371 rpmVSFlags rpmtsSetVSFlags(rpmts ts, rpmVSFlags vsflags);
    00372
    00379 int rpmtsUnorderedSuccessors(rpmts ts, int first);
    00380
    00386 const char * rpmtsRootDir(rpmts ts);
    00387
    00394 int rpmtsSetRootDir(rpmts ts, const char * rootDir);
    00395
    00401 const char * rpmtsCurrDir(rpmts ts);
    00402
    00408 void rpmtsSetCurrDir(rpmts ts, const char * currDir);
    00409
    00415 FD_t rpmtsScriptFd(rpmts ts);
    00416
    00422 void rpmtsSetScriptFd(rpmts ts, FD_t scriptFd);
    00423
    00429 int rpmtsSELinuxEnabled(rpmts ts);
    00430
    00436 int rpmtsChrootDone(rpmts ts);
    00437
    00444 int rpmtsSetChrootDone(rpmts ts, int chrootDone);
    00445
    00451 rpm_tid_t rpmtsGetTid(rpmts ts);
    00452
    00459 rpm_tid_t rpmtsSetTid(rpmts ts, rpm_tid_t tid);
    00460
    00466 rpmdb rpmtsGetRdb(rpmts ts);
    00467
    00473 int rpmtsInitDSI(const rpmts ts);
    00474
    00484 void rpmtsUpdateDSI(const rpmts ts, dev_t dev,
    00485                 rpm_loff_t fileSize, rpm_loff_t prevSize, rpm_loff_t fixupSize,
    00486                 rpmFileAction action);
    00487
    00493 void rpmtsCheckDSIProblems(const rpmts ts, const rpmte te);
    00494
    00504 void * rpmtsNotify(rpmts ts, rpmte te,
    00505                 rpmCallbackType what, rpm_loff_t amount, rpm_loff_t total);
    00506
    00512 int rpmtsNElements(rpmts ts);
    00513
    00520 rpmte rpmtsElement(rpmts ts, int ix);
    00521
    00527 rpmprobFilterFlags rpmtsFilterFlags(rpmts ts);
    00528
    00534 rpmtransFlags rpmtsFlags(rpmts ts);
    00535
    00542 rpmtransFlags rpmtsSetFlags(rpmts ts, rpmtransFlags transFlags);
    00543
    00549 rpmSpec rpmtsSpec(rpmts ts);
    00550
    00557 rpmSpec rpmtsSetSpec(rpmts ts, rpmSpec spec);
    00558
    00564 rpmte rpmtsRelocateElement(rpmts ts);
    00565
    00572 rpmte rpmtsSetRelocateElement(rpmts ts, rpmte relocateElement);
    00573
    00579 rpm_color_t rpmtsColor(rpmts ts);
    00580
    00586 rpm_color_t rpmtsPrefColor(rpmts ts);
    00587
    00594 rpm_color_t rpmtsSetColor(rpmts ts, rpm_color_t color);
    00595
    00602 rpmop rpmtsOp(rpmts ts, rpmtsOpX opx);
    00603
    00615 int rpmtsSetNotifyCallback(rpmts ts,
    00616                 rpmCallbackFunction notify,
    00617                 rpmCallbackData notifyData);
    00618
    00623 rpmts rpmtsCreate(void);
    00624
    00638 int rpmtsAddInstallElement(rpmts ts, Header h,
    00639                 const fnpyKey key, int upgrade,
    00640                 rpmRelocation * relocs);
    00641
    00649 int rpmtsAddEraseElement(rpmts ts, Header h, int dboffset);
    00650
    00659 int rpmtsGetKeys(rpmts ts,
    00660                 fnpyKey ** ep,
    00661                 int * nep);
    00662
    00663 #ifdef __cplusplus
    00664 }
    00665 #endif
    00666
    00667
    00668 #endif  /* H_RPMTS */