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

# lib/rpmlib.h

Go to the documentation of this file.

    00001 #ifndef H_RPMLIB
    00002 #define H_RPMLIB
    00003
    00011 #include <rpmtag.h>
    00012 #include <rpmversion.h>
    00013
    00014 #define RPM_FORMAT_VERSION 5
    00015 #define RPM_MAJOR_VERSION 0
    00016 #define RPM_MINOR_VERSION 0
    00017
    00021 typedef enum rpmRC_e {
    00022     RPMRC_OK            = 0,
    00023     RPMRC_NOTFOUND      = 1,
    00024     RPMRC_FAIL          = 2,
    00025     RPMRC_NOTTRUSTED    = 3,
    00026     RPMRC_NOKEY         = 4
    00027 } rpmRC;
    00028
    00029 /*@-redecl@*/
    00030 /*@checked@*/
    00031 extern struct MacroContext_s * rpmGlobalMacroContext;
    00032
    00033 /*@checked@*/
    00034 extern struct MacroContext_s * rpmCLIMacroContext;
    00035
    00036 /*@unchecked@*/ /*@observer@*/
    00037 extern const char * RPMVERSION;
    00038
    00039 /*@unchecked@*/ /*@observer@*/
    00040 extern const char * rpmNAME;
    00041
    00042 /*@unchecked@*/ /*@observer@*/
    00043 extern const char * rpmEVR;
    00044
    00045 /*@unchecked@*/
    00046 extern int rpmFLAGS;
    00047 /*@=redecl@*/
    00048
    00049 /*@unchecked@*/ /*@only@*/ /*@null@*/
    00050 extern unsigned int * keyids;
    00051
    00052 #ifdef __cplusplus
    00053 extern "C" {
    00054 #endif
    00055
    00062 typedef /*@abstract@*/ /*@refcounted@*/ struct rpmts_s * rpmts;
    00063
    00066 typedef struct Spec_s * Spec;
    00067
    00071 typedef /*@abstract@*/ void * alKey;
    00072 #define RPMAL_NOMATCH   ((alKey)-1L)
    00073
    00077 /*@-mutrep@*/
    00078 typedef /*@abstract@*/ int alNum;
    00079 /*@=mutrep@*/
    00080
    00084 typedef /*@abstract@*/ /*@refcounted@*/ struct rpmds_s * rpmds;
    00085
    00089 typedef struct rpmPRCO_s * rpmPRCO;
    00090
    00094 typedef /*@abstract@*/ /*@refcounted@*/ struct rpmfi_s * rpmfi;
    00095
    00099 typedef /*@abstract@*/ struct rpmte_s * rpmte;
    00100
    00104 typedef /*@abstract@*/ /*@refcounted@*/ struct rpmdb_s * rpmdb;
    00105
    00109 typedef /*@abstract@*/ struct rpmdbMatchIterator_s * rpmdbMatchIterator;
    00110
    00114 typedef /*@abstract@*/ /*@refcounted@*/ struct rpmgi_s * rpmgi;
    00115
    00120 /*@-redecl@*/
    00121 /*@unchecked@*/
    00122 extern headerSprintfExtension rpmHeaderFormats;
    00123 /*@=redecl@*/
    00124
    00128 typedef enum rpmScriptID_e {
    00129     RPMSCRIPT_UNKNOWN           =  0,
    00130     RPMSCRIPT_PRETRANS          =  1,
    00131     RPMSCRIPT_TRIGGERPREIN      =  2,
    00132     RPMSCRIPT_PREIN             =  3,
    00133     RPMSCRIPT_POSTIN            =  4,
    00134     RPMSCRIPT_TRIGGERIN         =  5,
    00135     RPMSCRIPT_TRIGGERUN         =  6,
    00136     RPMSCRIPT_PREUN             =  7,
    00137     RPMSCRIPT_POSTUN            =  8,
    00138     RPMSCRIPT_TRIGGERPOSTUN     =  9,
    00139     RPMSCRIPT_POSTTRANS         = 10,
    00140         /* 11-15 unused */
    00141     RPMSCRIPT_VERIFY            = 16,
    00142     RPMSCRIPT_SANITYCHECK       = 17,
    00143     RPMSCRIPT_MAX               = 32
    00144 } rpmScriptID;
    00145
    00149 typedef enum rpmScriptState_e {
    00150     RPMSCRIPT_STATE_UNKNOWN     = 0,
    00151         /* 0-15 reserved for waitpid return. */
    00152     RPMSCRIPT_STATE_EXEC        = (1 << 16),
    00153     RPMSCRIPT_STATE_REAPED      = (1 << 17),
    00154         /* 18-23 unused */
    00155     RPMSCRIPT_STATE_SELINUX     = (1 << 24),
    00156     RPMSCRIPT_STATE_EMULATOR    = (1 << 25),
    00157     RPMSCRIPT_STATE_LUA         = (1 << 26)
    00158 } rpmScriptState;
    00159
    00160 /* ==================================================================== */
    00163
    00169 enum rpm_machtable_e {
    00170     RPM_MACHTABLE_INSTARCH      = 0,
    00171     RPM_MACHTABLE_INSTOS        = 1,
    00172     RPM_MACHTABLE_BUILDARCH     = 2,
    00173     RPM_MACHTABLE_BUILDOS       = 3
    00174 };
    00175 #define RPM_MACHTABLE_COUNT     4
    00183 int rpmReadConfigFiles(/*@null@*/ const char * file,
    00184                 /*@null@*/ const char * target)
    00185         /*@globals rpmGlobalMacroContext, rpmCLIMacroContext, h_errno,
    00186                 fileSystem, internalState @*/
    00187         /*@modifies rpmGlobalMacroContext, rpmCLIMacroContext,
    00188                 fileSystem, internalState @*/;
    00189
    00190 /*@only@*/ /*@null@*/ /*@unchecked@*/
    00191 extern void * platpat;
    00192 /*@unchecked@*/
    00193 extern int nplatpat;
    00194
    00206 int rpmPlatformScore(const char * platform, /*@null@*/ void * mi_re, int mi_nre)
    00207         /*@modifies mi_re @*/;
    00208
    00214 int rpmShowRC(FILE * fp)
    00215         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
    00216         /*@modifies *fp, rpmGlobalMacroContext, fileSystem, internalState  @*/;
    00217
    00225 void rpmSetTables(int archTable, int osTable)
    00226         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
    00227         /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/;
    00228
    00234 void rpmFreeRpmrc(void)
    00235         /*@globals platpat, nplatpat, internalState @*/
    00236         /*@modifies platpat, nplatpat, internalState @*/;
    00237
    00239 /* ==================================================================== */
    00242
    00246 typedef struct rpmRelocation_s * rpmRelocation;
    00247 #if !defined(SWIG)
    00248 struct rpmRelocation_s {
    00249 /*@only@*/ /*@null@*/
    00250     const char * oldPath;
    00251 /*@only@*/ /*@null@*/
    00252     const char * newPath;
    00253 };
    00254 #endif
    00255
    00264 int rpmVersionCompare(Header first, Header second)
    00265         /*@*/;
    00266
    00270 typedef /*@abstract@*/ struct fsmIterator_s * FSMI_t;
    00271
    00275 typedef /*@abstract@*/ struct fsm_s * FSM_t;
    00276
    00280 typedef /*@abstract@*/ /*@refcounted@*/ struct rpmpsm_s * rpmpsm;
    00281
    00290 rpmRC rpmReadPackageFile(rpmts ts, void * _fd,
    00291                 const char * fn, /*@null@*/ /*@out@*/ Header * hdrp)
    00292         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
    00293         /*@modifies ts, *_fd, *hdrp, rpmGlobalMacroContext,
    00294                 fileSystem, internalState @*/;
    00295
    00306 rpmRC rpmInstallSourcePackage(rpmts ts, void * _fd,
    00307                         /*@null@*/ /*@out@*/ const char ** specFilePtr,
    00308                         /*@null@*/ /*@out@*/ const char ** cookie)
    00309         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
    00310         /*@modifies ts, _fd, *specFilePtr, *cookie, rpmGlobalMacroContext,
    00311                 fileSystem, internalState @*/;
    00312
    00315 #ifdef __cplusplus
    00316 }
    00317 #endif
    00318
    00319 #endif  /* H_RPMLIB */