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

- File List
- Globals

# 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
    00028 typedef enum rpmtransFlags_e {
    00029     RPMTRANS_FLAG_NONE          = 0,
    00030     RPMTRANS_FLAG_TEST          = (1 <<  0),
    00031     RPMTRANS_FLAG_BUILD_PROBS   = (1 <<  1),
    00032     RPMTRANS_FLAG_NOSCRIPTS     = (1 <<  2),
    00033     RPMTRANS_FLAG_JUSTDB        = (1 <<  3),
    00034     RPMTRANS_FLAG_NOTRIGGERS    = (1 <<  4),
    00035     RPMTRANS_FLAG_NODOCS        = (1 <<  5),
    00036     RPMTRANS_FLAG_ALLFILES      = (1 <<  6),
    00037     RPMTRANS_FLAG_KEEPOBSOLETE  = (1 <<  7),
    00038     RPMTRANS_FLAG_NOCONTEXTS    = (1 <<  8),
    00039     RPMTRANS_FLAG_DIRSTASH      = (1 <<  9),
    00040     RPMTRANS_FLAG_REPACKAGE     = (1 << 10),
    00042     RPMTRANS_FLAG_PKGCOMMIT     = (1 << 11),
    00043     RPMTRANS_FLAG_PKGUNDO       = (1 << 12),
    00044     RPMTRANS_FLAG_COMMIT        = (1 << 13),
    00045     RPMTRANS_FLAG_UNDO          = (1 << 14),
    00046     RPMTRANS_FLAG_REVERSE       = (1 << 15),
    00047
    00048     RPMTRANS_FLAG_NOTRIGGERPREIN= (1 << 16),
    00049     RPMTRANS_FLAG_NOPRE         = (1 << 17),
    00050     RPMTRANS_FLAG_NOPOST        = (1 << 18),
    00051     RPMTRANS_FLAG_NOTRIGGERIN   = (1 << 19),
    00052     RPMTRANS_FLAG_NOTRIGGERUN   = (1 << 20),
    00053     RPMTRANS_FLAG_NOPREUN       = (1 << 21),
    00054     RPMTRANS_FLAG_NOPOSTUN      = (1 << 22),
    00055     RPMTRANS_FLAG_NOTRIGGERPOSTUN = (1 << 23),
    00056     RPMTRANS_FLAG_NOPAYLOAD     = (1 << 24),
    00057     RPMTRANS_FLAG_APPLYONLY     = (1 << 25),
    00058
    00059     RPMTRANS_FLAG_NOMD5         = (1 << 27),
    00060     RPMTRANS_FLAG_NOFILEDIGEST  = (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
    00378 const char * rpmtsRootDir(rpmts ts);
    00379
    00386 int rpmtsSetRootDir(rpmts ts, const char * rootDir);
    00387
    00393 const char * rpmtsCurrDir(rpmts ts);
    00394
    00400 void rpmtsSetCurrDir(rpmts ts, const char * currDir);
    00401
    00407 FD_t rpmtsScriptFd(rpmts ts);
    00408
    00414 void rpmtsSetScriptFd(rpmts ts, FD_t scriptFd);
    00415
    00421 int rpmtsSELinuxEnabled(rpmts ts);
    00422
    00428 int rpmtsChrootDone(rpmts ts);
    00429
    00436 int rpmtsSetChrootDone(rpmts ts, int chrootDone);
    00437
    00443 rpm_tid_t rpmtsGetTid(rpmts ts);
    00444
    00451 rpm_tid_t rpmtsSetTid(rpmts ts, rpm_tid_t tid);
    00452
    00458 rpmdb rpmtsGetRdb(rpmts ts);
    00459
    00469 void * rpmtsNotify(rpmts ts, rpmte te,
    00470                 rpmCallbackType what, rpm_loff_t amount, rpm_loff_t total);
    00471
    00477 int rpmtsNElements(rpmts ts);
    00478
    00485 rpmte rpmtsElement(rpmts ts, int ix);
    00486
    00492 rpmprobFilterFlags rpmtsFilterFlags(rpmts ts);
    00493
    00499 rpmtransFlags rpmtsFlags(rpmts ts);
    00500
    00507 rpmtransFlags rpmtsSetFlags(rpmts ts, rpmtransFlags transFlags);
    00508
    00514 rpmSpec rpmtsSpec(rpmts ts);
    00515
    00522 rpmSpec rpmtsSetSpec(rpmts ts, rpmSpec spec);
    00523
    00529 rpm_color_t rpmtsColor(rpmts ts);
    00530
    00536 rpm_color_t rpmtsPrefColor(rpmts ts);
    00537
    00544 rpm_color_t rpmtsSetColor(rpmts ts, rpm_color_t color);
    00545
    00552 rpm_color_t rpmtsSetPrefColor(rpmts ts, rpm_color_t color);
    00553
    00560 rpmop rpmtsOp(rpmts ts, rpmtsOpX opx);
    00561
    00573 int rpmtsSetNotifyCallback(rpmts ts,
    00574                 rpmCallbackFunction notify,
    00575                 rpmCallbackData notifyData);
    00576
    00581 rpmts rpmtsCreate(void);
    00582
    00596 int rpmtsAddInstallElement(rpmts ts, Header h,
    00597                 const fnpyKey key, int upgrade,
    00598                 rpmRelocation * relocs);
    00599
    00607 int rpmtsAddEraseElement(rpmts ts, Header h, int dboffset);
    00608
    00609 #ifdef __cplusplus
    00610 }
    00611 #endif
    00612
    00613
    00614 #endif  /* H_RPMTS */