rpm 5.3.7

rpmdb/rpmrepo.h

Go to the documentation of this file.
00001 #ifndef H_RPMREPO
00002 #define H_RPMREPO
00003 
00008 #include <rpmiotypes.h>
00009 #include <rpmio.h>
00010 #include <argv.h>
00011 #include <mire.h>
00012 #include <popt.h>
00013 
00016 typedef /*@abstract@*/ /*@refcounted@*/ struct rpmrepo_s * rpmrepo;
00017 typedef /*@abstract@*/ /*@refcounted@*/ struct rpmrfile_s * rpmrfile;
00018 
00021 /*@unchecked@*/
00022 extern int _rpmrepo_debug;
00023 
00024 #if defined(_RPMREPO_INTERNAL)
00025 
00028 struct rpmrfile_s {
00029 /*@observer@*/
00030     const char * type;
00031 /*@observer@*/
00032     const char * xml_init;
00033 /*@observer@*/ /*@relnull@*/
00034     const char * xml_qfmt;
00035 /*@observer@*/
00036     const char * xml_fini;
00037 /*@observer@*/
00038     const char ** sql_init;
00039 /*@observer@*/
00040     const char * sql_qfmt;
00041 #ifdef  NOTYET  /* XXX char **?!? */
00042 /*@observer@*/
00043     const char ** sql_fini;
00044 #endif
00045 /*@observer@*/
00046     const char * yaml_init;
00047 /*@observer@*/
00048     const char * yaml_qfmt;
00049 /*@observer@*/
00050     const char * yaml_fini;
00051 /*@observer@*/
00052     const char * Packages_init;
00053 /*@observer@*/
00054     const char * Packages_qfmt;
00055 /*@observer@*/
00056     const char * Packages_fini;
00057 /*@observer@*/
00058     const char * Sources_init;
00059 /*@observer@*/
00060     const char * Sources_qfmt;
00061 /*@observer@*/
00062     const char * Sources_fini;
00063 /*@relnull@*/
00064     FD_t fd;
00065 #if defined(WITH_SQLITE)
00066     sqlite3 * sqldb;
00067 #endif
00068 /*@null@*/
00069     const char * digest;
00070 /*@null@*/
00071     const char * Zdigest;
00072     time_t ctime;
00073 };
00074 
00078 #define _RFB(n) ((1U << (n)) | 0x40000000)
00079 
00083 typedef enum rpmrepoFlags_e {
00084     REPO_FLAGS_NONE             = 0,
00085     REPO_FLAGS_DRYRUN           = _RFB( 0), 
00086     REPO_FLAGS_PRETTY           = _RFB( 1), 
00087     REPO_FLAGS_DATABASE         = _RFB( 2), 
00088     REPO_FLAGS_CHECKTS          = _RFB( 3), 
00089     REPO_FLAGS_SPLIT            = _RFB( 4), 
00090     REPO_FLAGS_NOFOLLOW         = _RFB( 5), 
00091     REPO_FLAGS_UNIQUEMDFN       = _RFB( 6), 
00093         /* 7-31 unused */
00094 } rpmrepoFlags;
00095 
00096 #define REPO_ISSET(_FLAG) ((repo->flags & ((REPO_FLAGS_##_FLAG) & ~0x40000000)) != REPO_FLAGS_NONE)
00097 
00098 struct rpmrepo_s {
00099     struct rpmioItem_s _item;   
00100     const char * fn;
00101 
00102     rpmrepoFlags flags;         
00103     poptContext con;            
00104     const char ** av;           
00106     int quiet;
00107     int verbose;
00108 /*@null@*/
00109     ARGV_t exclude_patterns;
00110 /*@relnull@*/
00111     miRE excludeMire;
00112     int nexcludes;
00113 /*@null@*/
00114     ARGV_t include_patterns;
00115 /*@relnull@*/
00116     miRE includeMire;
00117     int nincludes;
00118 /*@null@*/
00119     const char * basedir;
00120 /*@null@*/
00121     const char * baseurl;
00122 #ifdef  NOTYET
00123 /*@null@*/
00124     const char * groupfile;
00125 #endif
00126 /*@relnull@*/
00127     const char * outputdir;
00128 
00129 /*@null@*/
00130     ARGV_t manifests;
00131 
00132 /*@observer@*/ /*@relnull@*/
00133     const char * tempdir;
00134 /*@observer@*/ /*@relnull@*/
00135     const char * finaldir;
00136 /*@observer@*/ /*@relnull@*/
00137     const char * olddir;
00138 
00139     time_t mdtimestamp;
00140 
00141 /*@null@*/
00142     void * _ts;
00143 /*@null@*/
00144     ARGV_t pkglist;
00145     unsigned current;
00146     unsigned pkgcount;
00147 
00148 /*@null@*/
00149     ARGV_t directories;
00150     int ftsoptions;
00151     uint32_t pkgalgo;
00152     uint32_t algo;
00153     int compression;
00154 /*@observer@*/
00155     const char * markup;
00156 /*@observer@*/ /*@null@*/
00157     const char * suffix;
00158 /*@observer@*/
00159     const char * wmode;
00160 
00161     struct rpmrfile_s primary;
00162     struct rpmrfile_s filelists;
00163     struct rpmrfile_s other;
00164     struct rpmrfile_s repomd;
00165 
00166 #if defined(__LCLINT__)
00167 /*@refs@*/
00168     int nrefs;                  
00169 #endif
00170 };
00171 
00172 #endif  /* _RPMREPO_INTERNAL */
00173 
00174 #ifdef __cplusplus
00175 extern "C" {
00176 #endif
00177 
00183 /*@unused@*/ /*@null@*/
00184 rpmrepo rpmrepoUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmrepo repo)
00185         /*@modifies repo @*/;
00186 #define rpmrepoUnlink(_repo)    \
00187     ((rpmrepo)rpmioUnlinkPoolItem((rpmioItem)(_repo), __FUNCTION__, __FILE__, __LINE__))
00188 
00194 /*@unused@*/ /*@newref@*/ /*@null@*/
00195 rpmrepo rpmrepoLink (/*@null@*/ rpmrepo repo)
00196         /*@modifies repo @*/;
00197 #define rpmrepoLink(_repo)      \
00198     ((rpmrepo)rpmioLinkPoolItem((rpmioItem)(_repo), __FUNCTION__, __FILE__, __LINE__))
00199 
00205 /*@null@*/
00206 rpmrepo rpmrepoFree(/*@killref@*/ /*@null@*/rpmrepo repo)
00207         /*@globals fileSystem @*/
00208         /*@modifies repo, fileSystem @*/;
00209 #define rpmrepoFree(_repo)      \
00210     ((rpmrepo)rpmioFreePoolItem((rpmioItem)(_repo), __FUNCTION__, __FILE__, __LINE__))
00211 
00218 /*@newref@*/ /*@null@*/
00219 rpmrepo rpmrepoNew(char ** av, int flags)
00220         /*@globals fileSystem, internalState @*/
00221         /*@modifies fileSystem, internalState @*/;
00222 
00228 /*@mayexit@*/
00229 void rpmrepoError(int lvl, const char *fmt, ...)
00230         /*@globals fileSystem @*/
00231         /*@modifies fileSystem @*/;
00232 
00238 /*@null@*/
00239 const char * rpmrepoRealpath(const char * lpath)
00240         /*@globals fileSystem, internalState @*/
00241         /*@modifies fileSystem, internalState @*/;
00242 
00248 int rpmrepoTestSetupDirs(rpmrepo repo)
00249         /*@globals h_errno, rpmGlobalMacroContext, fileSystem, internalState @*/
00250         /*@modifies repo, rpmGlobalMacroContext, fileSystem, internalState @*/;
00251 
00259 /*@null@*/
00260 const char ** rpmrepoGetFileList(rpmrepo repo, const char *roots[],
00261                 const char * ext)
00262         /*@globals fileSystem, internalState @*/
00263         /*@modifies repo, fileSystem, internalState @*/;
00264 
00270 int rpmrepoCheckTimeStamps(rpmrepo repo)
00271         /*@globals h_errno, fileSystem, internalState @*/
00272         /*@modifies fileSystem, internalState @*/;
00273 
00279 int rpmrepoDoPkgMetadata(rpmrepo repo)
00280         /*@globals h_errno, rpmGlobalMacroContext, fileSystem, internalState @*/
00281         /*@modifies repo, rpmGlobalMacroContext, fileSystem, internalState @*/;
00282 
00288 int rpmrepoDoRepoMetadata(rpmrepo repo)
00289         /*@globals h_errno, rpmGlobalMacroContext, fileSystem, internalState @*/
00290         /*@modifies repo, rpmGlobalMacroContext, fileSystem, internalState @*/;
00291 
00297 int rpmrepoDoFinalMove(rpmrepo repo)
00298         /*@globals h_errno, rpmGlobalMacroContext, fileSystem, internalState @*/
00299         /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/;
00300 
00301 #ifdef __cplusplus
00302 }
00303 #endif
00304 
00305 #endif  /* H_RPMREPO */