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/rpmte.h>
    00013 #include <rpm/rpmps.h>
    00014 #include <rpm/rpmsw.h>
    00015 #include <rpm/rpmpgp.h>
    00016 #include <rpm/rpmfi.h>
    00017 #include <rpm/rpmcallback.h>
    00018
    00019 #ifdef __cplusplus
    00020 extern "C" {
    00021 #endif
    00022
    00023 extern int _rpmts_stats;
    00024
    00028 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     /* bit 7 unused */
    00038     RPMTRANS_FLAG_NOCONTEXTS    = (1 <<  8),
    00039     /* bits 9-15 unused */
    00040     RPMTRANS_FLAG_NOTRIGGERPREIN= (1 << 16),
    00041     RPMTRANS_FLAG_NOPRE         = (1 << 17),
    00042     RPMTRANS_FLAG_NOPOST        = (1 << 18),
    00043     RPMTRANS_FLAG_NOTRIGGERIN   = (1 << 19),
    00044     RPMTRANS_FLAG_NOTRIGGERUN   = (1 << 20),
    00045     RPMTRANS_FLAG_NOPREUN       = (1 << 21),
    00046     RPMTRANS_FLAG_NOPOSTUN      = (1 << 22),
    00047     RPMTRANS_FLAG_NOTRIGGERPOSTUN = (1 << 23),
    00048     /* bits 24-25 unused */
    00049     RPMTRANS_FLAG_NOCOLLECTIONS = (1 << 26),
    00050     RPMTRANS_FLAG_NOMD5         = (1 << 27),
    00051     RPMTRANS_FLAG_NOFILEDIGEST  = (1 << 27),
    00052     /* bits 28-29 unused */
    00053     RPMTRANS_FLAG_NOCONFIGS     = (1 << 30),
    00054     RPMTRANS_FLAG_DEPLOOPS      = (1 << 31)
    00055 };
    00056
    00057 typedef rpmFlags rpmtransFlags;
    00058
    00059 #define _noTransScripts         \
    00060   ( RPMTRANS_FLAG_NOPRE |       \
    00061     RPMTRANS_FLAG_NOPOST |      \
    00062     RPMTRANS_FLAG_NOPREUN |     \
    00063     RPMTRANS_FLAG_NOPOSTUN      \
    00064   )
    00065
    00066 #define _noTransTriggers        \
    00067   ( RPMTRANS_FLAG_NOTRIGGERPREIN | \
    00068     RPMTRANS_FLAG_NOTRIGGERIN | \
    00069     RPMTRANS_FLAG_NOTRIGGERUN | \
    00070     RPMTRANS_FLAG_NOTRIGGERPOSTUN \
    00071   )
    00072
    00073 /* Avoid unnecessary breakage for stuff referring to these unused flags */
    00074 #define RPMTRANS_FLAG_NOPAYLOAD 0
    00075 #define RPMTRANS_FLAG_APPLYONLY 0
    00076 #define RPMTRANS_FLAG_KEEPOBSOLETE 0
    00077 #define RPMTRANS_FLAG_DIRSTASH 0
    00078 #define RPMTRANS_FLAG_REPACKAGE 0
    00079 #define RPMTRANS_FLAG_PKGCOMMIT 0
    00080 #define RPMTRANS_FLAG_PKGUNDO 0
    00081 #define RPMTRANS_FLAG_COMMIT 0
    00082 #define RPMTRANS_FLAG_UNDO 0
    00083 #define RPMTRANS_FLAG_REVERSE 0
    00084 #define RPMTRANS_FLAG_NOSUGGEST 0
    00085 #define RPMTRANS_FLAG_ADDINDEPS 0
    00086
    00090 enum rpmVSFlags_e {
    00091     RPMVSF_DEFAULT      = 0,
    00092     RPMVSF_NOHDRCHK     = (1 <<  0),
    00093     RPMVSF_NEEDPAYLOAD  = (1 <<  1),
    00094     /* bit(s) 2-7 unused */
    00095     RPMVSF_NOSHA1HEADER = (1 <<  8),
    00096     RPMVSF_NOMD5HEADER  = (1 <<  9),    /* unimplemented */
    00097     RPMVSF_NODSAHEADER  = (1 << 10),
    00098     RPMVSF_NORSAHEADER  = (1 << 11),    /* unimplemented */
    00099     /* bit(s) 12-15 unused */
    00100     RPMVSF_NOSHA1       = (1 << 16),    /* unimplemented */
    00101     RPMVSF_NOMD5        = (1 << 17),
    00102     RPMVSF_NODSA        = (1 << 18),
    00103     RPMVSF_NORSA        = (1 << 19)
    00104     /* bit(s) 16-31 unused */
    00105 };
    00106
    00107 typedef rpmFlags rpmVSFlags;
    00108
    00109 #define _RPMVSF_NODIGESTS       \
    00110   ( RPMVSF_NOSHA1HEADER |       \
    00111     RPMVSF_NOMD5HEADER |        \
    00112     RPMVSF_NOSHA1 |             \
    00113     RPMVSF_NOMD5 )
    00114
    00115 #define _RPMVSF_NOSIGNATURES    \
    00116   ( RPMVSF_NODSAHEADER |        \
    00117     RPMVSF_NORSAHEADER |        \
    00118     RPMVSF_NODSA |              \
    00119     RPMVSF_NORSA )
    00120
    00121 #define _RPMVSF_NOHEADER        \
    00122   ( RPMVSF_NOSHA1HEADER |       \
    00123     RPMVSF_NOMD5HEADER |        \
    00124     RPMVSF_NODSAHEADER |        \
    00125     RPMVSF_NORSAHEADER )
    00126
    00127 #define _RPMVSF_NOPAYLOAD       \
    00128   ( RPMVSF_NOSHA1 |             \
    00129     RPMVSF_NOMD5 |              \
    00130     RPMVSF_NODSA |              \
    00131     RPMVSF_NORSA )
    00132
    00136 typedef enum rpmtsOpX_e {
    00137     RPMTS_OP_TOTAL              =  0,
    00138     RPMTS_OP_CHECK              =  1,
    00139     RPMTS_OP_ORDER              =  2,
    00140     RPMTS_OP_FINGERPRINT        =  3,
    00141     RPMTS_OP_INSTALL            =  5,
    00142     RPMTS_OP_ERASE              =  6,
    00143     RPMTS_OP_SCRIPTLETS         =  7,
    00144     RPMTS_OP_COMPRESS           =  8,
    00145     RPMTS_OP_UNCOMPRESS         =  9,
    00146     RPMTS_OP_DIGEST             = 10,
    00147     RPMTS_OP_SIGNATURE          = 11,
    00148     RPMTS_OP_DBADD              = 12,
    00149     RPMTS_OP_DBREMOVE           = 13,
    00150     RPMTS_OP_DBGET              = 14,
    00151     RPMTS_OP_DBPUT              = 15,
    00152     RPMTS_OP_DBDEL              = 16,
    00153     RPMTS_OP_MAX                = 17
    00154 } rpmtsOpX;
    00155
    00166 int rpmtsCheck(rpmts ts);
    00167
    00184 int rpmtsOrder(rpmts ts);
    00185
    00203 int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet);
    00204
    00210 rpmts rpmtsLink (rpmts ts);
    00211
    00217 int rpmtsCloseDB(rpmts ts);
    00218
    00225 int rpmtsOpenDB(rpmts ts, int dbmode);
    00226
    00234 int rpmtsInitDB(rpmts ts, int dbmode);
    00235
    00241 int rpmtsGetDBMode(rpmts ts);
    00242
    00250 int rpmtsSetDBMode(rpmts ts, int dbmode);
    00251
    00257 int rpmtsRebuildDB(rpmts ts);
    00258
    00264 int rpmtsVerifyDB(rpmts ts);
    00265
    00274 rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmDbiTagVal rpmtag,
    00275                         const void * keyp, size_t keylen);
    00276
    00285 rpmRC rpmtsImportPubkey(rpmts ts, const unsigned char * pkt, size_t pktlen);
    00286
    00293 rpmKeyring rpmtsGetKeyring(rpmts ts, int autoload);
    00294
    00303 int rpmtsSetKeyring(rpmts ts, rpmKeyring keyring);
    00304
    00312 int rpmtsSetSolveCallback(rpmts ts,
    00313                 int (*solve) (rpmts ts, rpmds ds, const void * data),
    00314                 const void * solveData);
    00315
    00321 rpmps rpmtsProblems(rpmts ts);
    00322
    00327 void rpmtsCleanProblems(rpmts ts);
    00328
    00333 void rpmtsClean(rpmts ts);
    00334
    00339 void rpmtsEmpty(rpmts ts);
    00340
    00346 rpmts rpmtsFree(rpmts ts);
    00347
    00353 rpmVSFlags rpmtsVSFlags(rpmts ts);
    00354
    00361 rpmVSFlags rpmtsSetVSFlags(rpmts ts, rpmVSFlags vsflags);
    00362
    00368 const char * rpmtsRootDir(rpmts ts);
    00369
    00376 int rpmtsSetRootDir(rpmts ts, const char * rootDir);
    00377
    00383 FD_t rpmtsScriptFd(rpmts ts);
    00384
    00390 void rpmtsSetScriptFd(rpmts ts, FD_t scriptFd);
    00391
    00397 rpm_tid_t rpmtsGetTid(rpmts ts);
    00398
    00405 rpm_tid_t rpmtsSetTid(rpmts ts, rpm_tid_t tid);
    00406
    00412 rpmdb rpmtsGetRdb(rpmts ts);
    00413
    00423 void * rpmtsNotify(rpmts ts, rpmte te,
    00424                 rpmCallbackType what, rpm_loff_t amount, rpm_loff_t total);
    00425
    00431 int rpmtsNElements(rpmts ts);
    00432
    00439 rpmte rpmtsElement(rpmts ts, int ix);
    00440
    00446 rpmprobFilterFlags rpmtsFilterFlags(rpmts ts);
    00447
    00453 rpmtransFlags rpmtsFlags(rpmts ts);
    00454
    00461 rpmtransFlags rpmtsSetFlags(rpmts ts, rpmtransFlags transFlags);
    00462
    00468 rpm_color_t rpmtsColor(rpmts ts);
    00469
    00475 rpm_color_t rpmtsPrefColor(rpmts ts);
    00476
    00483 rpm_color_t rpmtsSetColor(rpmts ts, rpm_color_t color);
    00484
    00491 rpm_color_t rpmtsSetPrefColor(rpmts ts, rpm_color_t color);
    00492
    00499 rpmop rpmtsOp(rpmts ts, rpmtsOpX opx);
    00500
    00506 rpmPlugins rpmtsPlugins(rpmts ts);
    00507
    00519 int rpmtsSetNotifyCallback(rpmts ts,
    00520                 rpmCallbackFunction notify,
    00521                 rpmCallbackData notifyData);
    00522
    00527 rpmts rpmtsCreate(void);
    00528
    00542 int rpmtsAddInstallElement(rpmts ts, Header h,
    00543                 const fnpyKey key, int upgrade,
    00544                 rpmRelocation * relocs);
    00545
    00553 int rpmtsAddEraseElement(rpmts ts, Header h, int dboffset);
    00554
    00560 rpmtsi rpmtsiFree(rpmtsi tsi);
    00561
    00567 rpmtsi rpmtsiInit(rpmts ts);
    00568
    00575 rpmte rpmtsiNext(rpmtsi tsi, rpmElementTypes types);
    00576
    00577 #ifdef __cplusplus
    00578 }
    00579 #endif
    00580
    00581
    00582 #endif  /* H_RPMTS */