X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/dcb79bae22bd3e4739db39e56d00b4d65ff42269..6fc33863f31051a5fc2726a236ce8b64d33bc964:/apt-pkg/pkgcache.h diff --git a/apt-pkg/pkgcache.h b/apt-pkg/pkgcache.h index 836418c2c..2e695ab7b 100644 --- a/apt-pkg/pkgcache.h +++ b/apt-pkg/pkgcache.h @@ -1,11 +1,11 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: pkgcache.h,v 1.4 1998/07/05 05:33:55 jgg Exp $ +// $Id: pkgcache.h,v 1.7 1998/07/19 04:22:01 jgg Exp $ /* ###################################################################### Cache - Structure definitions for the cache file - Please see doc/pkglib/cache.sgml for a more detailed description of + Please see doc/apt-pkg/cache.sgml for a more detailed description of this format. Also be sure to keep that file up-to-date!! Clients should always use the CacheIterators classes for access to the @@ -20,9 +20,13 @@ #ifndef PKGLIB_PKGCACHE_H #define PKGLIB_PKGCACHE_H +#ifdef __GNUG__ +#pragma interface "apt-pkg/pkgcache.h" +#endif + #include #include -#include +#include class pkgCache { @@ -52,19 +56,29 @@ class pkgCache friend VerFileIterator; // These are all the constants used in the cache structures - enum DepType {Depends=1,PreDepends=2,Suggests=3,Recommends=4, - Conflicts=5,Replaces=6}; - enum VerPriority {Important=1,Required=2,Standard=3,Optional=5,Extra=5}; - enum PkgSelectedState {Unknown=0,Install=1,Hold=2,DeInstall=3,Purge=4}; - enum PkgFlags {Auto=(1<<0),New=(1<<1),Obsolete=(1<<2),Essential=(1<<3), - ImmediateConf=(1<<4)}; - enum PkgInstState {Ok=0,ReInstReq=1,HoldInst=2,HoldReInstReq=3}; - enum PkgCurrentState {NotInstalled=0,UnPacked=1,HalfConfigured=2, - UnInstalled=3,HalfInstalled=4,ConfigFiles=5, - Installed=6}; - enum PkgFFlags {NotSource=(1<<0)}; - enum DepCompareOp {Or=0x10,NoOp=0,LessEq=0x1,GreaterEq=0x2,Less=0x3, - Greater=0x4,Equals=0x5,NotEquals=0x6}; + struct Dep + { + enum DepType {Depends=1,PreDepends=2,Suggests=3,Recommends=4, + Conflicts=5,Replaces=6}; + enum DepCompareOp {Or=0x10,NoOp=0,LessEq=0x1,GreaterEq=0x2,Less=0x3, + Greater=0x4,Equals=0x5,NotEquals=0x6}; + }; + + struct State + { + enum VerPriority {Important=1,Required=2,Standard=3,Optional=5,Extra=5}; + enum PkgSelectedState {Unknown=0,Install=1,Hold=2,DeInstall=3,Purge=4}; + enum PkgInstState {Ok=0,ReInstReq=1,HoldInst=2,HoldReInstReq=3}; + enum PkgCurrentState {NotInstalled=0,UnPacked=1,HalfConfigured=2, + UnInstalled=3,HalfInstalled=4,ConfigFiles=5,Installed=6}; + }; + + struct Flag + { + enum PkgFlags {Auto=(1<<0),New=(1<<1),Obsolete=(1<<2),Essential=(1<<3), + ImmediateConf=(1<<4)}; + enum PkgFFlags {NotSource=(1<<0)}; + }; protected: @@ -106,7 +120,9 @@ class pkgCache Header &Head() {return *HeaderP;}; inline PkgIterator PkgBegin(); inline PkgIterator PkgEnd(); - + inline PkgFileIterator FileBegin(); + inline PkgFileIterator FileEnd(); + pkgCache(MMap &Map); virtual ~pkgCache() {}; }; @@ -138,6 +154,7 @@ struct pkgCache::Header // Offsets unsigned long FileList; // struct PackageFile unsigned long StringList; // struct StringItem + unsigned long MaxVerFileSize; /* Allocation pools, there should be one of these for each structure excluding the header */ @@ -244,11 +261,15 @@ struct pkgCache::StringItem unsigned long NextItem; // StringItem }; -#include +#include inline pkgCache::PkgIterator pkgCache::PkgBegin() {return PkgIterator(*this);}; inline pkgCache::PkgIterator pkgCache::PkgEnd() {return PkgIterator(*this,PkgP);}; +inline pkgCache::PkgFileIterator pkgCache::FileBegin() + {return PkgFileIterator(*this);}; +inline pkgCache::PkgFileIterator pkgCache::FileEnd() + {return PkgFileIterator(*this,PkgFileP);}; #endif