diff options
author | Michael Vogt <mvo@debian.org> | 2014-05-07 17:55:10 +0200 |
---|---|---|
committer | Michael Vogt <mvo@debian.org> | 2014-05-07 17:55:10 +0200 |
commit | 38d2959ffb8c6f5f291b2910014a67b1b352ab4c (patch) | |
tree | c5977b8f34aaf973ed3956952ec3ff43ac59f143 /apt-pkg/pkgcache.h | |
parent | fce69e7a0f38299c57ef96ae1c1dd9a5379bfd5a (diff) | |
parent | 3fa4e98f62e469f4292d2811b4e15f4afb678fbd (diff) |
Merge branch 'debian/sid' into debian/experimental
Conflicts:
apt-pkg/cachefilter.h
apt-pkg/contrib/fileutl.cc
apt-pkg/contrib/netrc.h
apt-pkg/deb/debsrcrecords.cc
apt-pkg/init.h
apt-pkg/pkgcache.cc
debian/apt.install.in
debian/changelog
Diffstat (limited to 'apt-pkg/pkgcache.h')
-rw-r--r-- | apt-pkg/pkgcache.h | 68 |
1 files changed, 35 insertions, 33 deletions
diff --git a/apt-pkg/pkgcache.h b/apt-pkg/pkgcache.h index 7c01258f1..151de7d25 100644 --- a/apt-pkg/pkgcache.h +++ b/apt-pkg/pkgcache.h @@ -74,9 +74,11 @@ #ifndef PKGLIB_PKGCACHE_H #define PKGLIB_PKGCACHE_H +#include <apt-pkg/mmap.h> +#include <apt-pkg/macros.h> + #include <string> #include <time.h> -#include <apt-pkg/mmap.h> #ifndef APT_8_CLEANER_HEADERS using std::string; @@ -156,8 +158,8 @@ class pkgCache /*{{{*/ std::string CacheFile; MMap ⤅ - unsigned long sHash(const std::string &S) const; - unsigned long sHash(const char *S) const; + unsigned long sHash(const std::string &S) const APT_PURE; + unsigned long sHash(const char *S) const APT_PURE; public: @@ -176,13 +178,13 @@ class pkgCache /*{{{*/ char *StrP; virtual bool ReMap(bool const &Errorchecks = true); - inline bool Sync() {return Map.Sync();}; - inline MMap &GetMap() {return Map;}; - inline void *DataEnd() {return ((unsigned char *)Map.Data()) + Map.Size();}; + inline bool Sync() {return Map.Sync();} + inline MMap &GetMap() {return Map;} + inline void *DataEnd() {return ((unsigned char *)Map.Data()) + Map.Size();} // String hashing function (512 range) - inline unsigned long Hash(const std::string &S) const {return sHash(S);}; - inline unsigned long Hash(const char *S) const {return sHash(S);}; + inline unsigned long Hash(const std::string &S) const {return sHash(S);} + inline unsigned long Hash(const char *S) const {return sHash(S);} // Useful transformation things const char *Priority(unsigned char Priority); @@ -192,7 +194,7 @@ class pkgCache /*{{{*/ PkgIterator FindPkg(const std::string &Name); PkgIterator FindPkg(const std::string &Name, const std::string &Arch); - Header &Head() {return *HeaderP;}; + Header &Head() {return *HeaderP;} inline GrpIterator GrpBegin(); inline GrpIterator GrpEnd(); inline PkgIterator PkgBegin(); @@ -200,19 +202,19 @@ class pkgCache /*{{{*/ inline PkgFileIterator FileBegin(); inline PkgFileIterator FileEnd(); - inline bool MultiArchCache() const { return MultiArchEnabled; }; - inline char const * const NativeArch() const; + inline bool MultiArchCache() const { return MultiArchEnabled; } + inline char const * NativeArch(); // Make me a function pkgVersioningSystem *VS; // Converters - static const char *CompTypeDeb(unsigned char Comp); - static const char *CompType(unsigned char Comp); + static const char *CompTypeDeb(unsigned char Comp) APT_CONST; + static const char *CompType(unsigned char Comp) APT_CONST; static const char *DepType(unsigned char Dep); pkgCache(MMap *Map,bool DoMap = true); - virtual ~pkgCache() {}; + virtual ~pkgCache() {} private: bool MultiArchEnabled; @@ -318,7 +320,7 @@ struct pkgCache::Header /** \brief Size of the complete cache file */ unsigned long CacheFileSize; - bool CheckSizes(Header &Against) const; + bool CheckSizes(Header &Against) const APT_PURE; Header(); }; /*}}}*/ @@ -451,7 +453,7 @@ struct pkgCache::PackageFile /** \brief Modification time for the file */ time_t mtime; - /* @TODO document PackageFile::Flags */ + /** @TODO document PackageFile::Flags */ unsigned long Flags; // Linked list @@ -474,7 +476,7 @@ struct pkgCache::VerFile map_ptrloc NextFile; // PkgVerFile /** \brief position in the package file */ map_ptrloc Offset; // File offset - /* @TODO document pkgCache::VerFile::Size */ + /** @TODO document pkgCache::VerFile::Size */ unsigned long Size; }; /*}}}*/ @@ -488,7 +490,7 @@ struct pkgCache::DescFile map_ptrloc NextFile; // PkgVerFile /** \brief position in the file */ map_ptrloc Offset; // File offset - /* @TODO document pkgCache::DescFile::Size */ + /** @TODO document pkgCache::DescFile::Size */ unsigned long Size; }; /*}}}*/ @@ -571,7 +573,7 @@ struct pkgCache::Description and to check that the Translation is up-to-date. */ map_ptrloc md5sum; // StringItem - /* @TODO document pkgCache::Description::FileList */ + /** @TODO document pkgCache::Description::FileList */ map_ptrloc FileList; // DescFile /** \brief next translation for this description */ map_ptrloc NextDesc; // Description @@ -661,27 +663,27 @@ struct pkgCache::StringItem /*}}}*/ -inline char const * const pkgCache::NativeArch() const - { return StrP + HeaderP->Architecture; }; +inline char const * pkgCache::NativeArch() + { return StrP + HeaderP->Architecture; } #include <apt-pkg/cacheiterators.h> -inline pkgCache::GrpIterator pkgCache::GrpBegin() - {return GrpIterator(*this);}; -inline pkgCache::GrpIterator pkgCache::GrpEnd() - {return GrpIterator(*this,GrpP);}; -inline pkgCache::PkgIterator pkgCache::PkgBegin() - {return PkgIterator(*this);}; -inline pkgCache::PkgIterator pkgCache::PkgEnd() - {return PkgIterator(*this,PkgP);}; +inline pkgCache::GrpIterator pkgCache::GrpBegin() + {return GrpIterator(*this);} +inline pkgCache::GrpIterator pkgCache::GrpEnd() + {return GrpIterator(*this,GrpP);} +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,PkgFileP + HeaderP->FileList);}; + {return PkgFileIterator(*this,PkgFileP + HeaderP->FileList);} inline pkgCache::PkgFileIterator pkgCache::FileEnd() - {return PkgFileIterator(*this,PkgFileP);}; + {return PkgFileIterator(*this,PkgFileP);} // Oh I wish for Real Name Space Support class pkgCache::Namespace /*{{{*/ -{ +{ public: typedef pkgCache::GrpIterator GrpIterator; typedef pkgCache::PkgIterator PkgIterator; @@ -690,7 +692,7 @@ class pkgCache::Namespace /*{{{*/ typedef pkgCache::DepIterator DepIterator; typedef pkgCache::PrvIterator PrvIterator; typedef pkgCache::PkgFileIterator PkgFileIterator; - typedef pkgCache::VerFileIterator VerFileIterator; + typedef pkgCache::VerFileIterator VerFileIterator; typedef pkgCache::Version Version; typedef pkgCache::Description Description; typedef pkgCache::Package Package; |