Преглед изворни кода

mark private methods as hidden

We are the only possible users of private methods, so we are also the
only users who can potentially export them via using them in inline
methods. The point is: We don't need these symbols exported if we don't
do this, so marking them as hidden removes some methods from the API
without breaking anything as nobody could have used them.

Git-Dch: Ignore
David Kalnischkies пре 11 година
родитељ
комит
3809194b66

+ 2 - 2
apt-pkg/acquire-item.h

@@ -576,7 +576,7 @@ class pkgAcqIndexDiffs : public pkgAcqBaseIndex
     *  \return \b true if an applicable diff was found, \b false
     *  \return \b true if an applicable diff was found, \b false
     *  otherwise.
     *  otherwise.
     */
     */
-   bool QueueNextDiff();
+   APT_HIDDEN bool QueueNextDiff();
 
 
    /** \brief Handle tasks that must be performed after the item
    /** \brief Handle tasks that must be performed after the item
     *  finishes downloading.
     *  finishes downloading.
@@ -589,7 +589,7 @@ class pkgAcqIndexDiffs : public pkgAcqBaseIndex
     *  \param allDone If \b true, the file was entirely reconstructed,
     *  \param allDone If \b true, the file was entirely reconstructed,
     *  and its md5sum is verified. 
     *  and its md5sum is verified. 
     */
     */
-   void Finish(bool allDone=false);
+   APT_HIDDEN void Finish(bool allDone=false);
 
 
    protected:
    protected:
 
 

+ 9 - 9
apt-pkg/algorithms.h

@@ -82,9 +82,9 @@ class pkgSimulate : public pkgPackageManager				/*{{{*/
    virtual bool Remove(PkgIterator Pkg,bool Purge);
    virtual bool Remove(PkgIterator Pkg,bool Purge);
 
 
 private:
 private:
-   void ShortBreaks();
-   void Describe(PkgIterator iPkg,std::ostream &out,bool Current,bool Candidate);
-   
+   APT_HIDDEN void ShortBreaks();
+   APT_HIDDEN void Describe(PkgIterator iPkg,std::ostream &out,bool Current,bool Candidate);
+
    public:
    public:
 
 
    pkgSimulate(pkgDepCache *Cache);
    pkgSimulate(pkgDepCache *Cache);
@@ -114,7 +114,7 @@ class pkgProblemResolver						/*{{{*/
    
    
    // Sort stuff
    // Sort stuff
    static pkgProblemResolver *This;
    static pkgProblemResolver *This;
-   static int ScoreSort(const void *a,const void *b) APT_PURE;
+   APT_HIDDEN static int ScoreSort(const void *a,const void *b) APT_PURE;
 
 
    struct PackageKill
    struct PackageKill
    {
    {
@@ -122,12 +122,12 @@ class pkgProblemResolver						/*{{{*/
       DepIterator Dep;
       DepIterator Dep;
    };
    };
 
 
-   void MakeScores();
-   bool DoUpgrade(pkgCache::PkgIterator Pkg);
+   APT_HIDDEN void MakeScores();
+   APT_HIDDEN bool DoUpgrade(pkgCache::PkgIterator Pkg);
+
+   APT_HIDDEN bool ResolveInternal(bool const BrokenFix = false);
+   APT_HIDDEN bool ResolveByKeepInternal();
 
 
-   bool ResolveInternal(bool const BrokenFix = false);
-   bool ResolveByKeepInternal();
-   
    protected:
    protected:
    bool InstOrNewPolicyBroken(pkgCache::PkgIterator Pkg);
    bool InstOrNewPolicyBroken(pkgCache::PkgIterator Pkg);
 
 

+ 29 - 29
apt-pkg/aptconfiguration.cc

@@ -32,6 +32,35 @@
 #include <apti18n.h>
 #include <apti18n.h>
 									/*}}}*/
 									/*}}}*/
 namespace APT {
 namespace APT {
+// setDefaultConfigurationForCompressors				/*{{{*/
+static void setDefaultConfigurationForCompressors() {
+	// Set default application paths to check for optional compression types
+	_config->CndSet("Dir::Bin::bzip2", "/bin/bzip2");
+	_config->CndSet("Dir::Bin::xz", "/usr/bin/xz");
+	if (FileExists(_config->FindFile("Dir::Bin::xz")) == true) {
+		_config->Set("Dir::Bin::lzma", _config->FindFile("Dir::Bin::xz"));
+		_config->Set("APT::Compressor::lzma::Binary", "xz");
+		if (_config->Exists("APT::Compressor::lzma::CompressArg") == false) {
+			_config->Set("APT::Compressor::lzma::CompressArg::", "--format=lzma");
+			_config->Set("APT::Compressor::lzma::CompressArg::", "-9");
+		}
+		if (_config->Exists("APT::Compressor::lzma::UncompressArg") == false) {
+			_config->Set("APT::Compressor::lzma::UncompressArg::", "--format=lzma");
+			_config->Set("APT::Compressor::lzma::UncompressArg::", "-d");
+		}
+	} else {
+		_config->CndSet("Dir::Bin::lzma", "/usr/bin/lzma");
+		if (_config->Exists("APT::Compressor::lzma::CompressArg") == false) {
+			_config->Set("APT::Compressor::lzma::CompressArg::", "--suffix=");
+			_config->Set("APT::Compressor::lzma::CompressArg::", "-9");
+		}
+		if (_config->Exists("APT::Compressor::lzma::UncompressArg") == false) {
+			_config->Set("APT::Compressor::lzma::UncompressArg::", "--suffix=");
+			_config->Set("APT::Compressor::lzma::UncompressArg::", "-d");
+		}
+	}
+}
+									/*}}}*/
 // getCompressionTypes - Return Vector of usable compressiontypes	/*{{{*/
 // getCompressionTypes - Return Vector of usable compressiontypes	/*{{{*/
 // ---------------------------------------------------------------------
 // ---------------------------------------------------------------------
 /* return a vector of compression types in the preferred order. */
 /* return a vector of compression types in the preferred order. */
@@ -402,35 +431,6 @@ bool Configuration::checkArchitecture(std::string const &Arch) {
 	return (std::find(archs.begin(), archs.end(), Arch) != archs.end());
 	return (std::find(archs.begin(), archs.end(), Arch) != archs.end());
 }
 }
 									/*}}}*/
 									/*}}}*/
-// setDefaultConfigurationForCompressors				/*{{{*/
-void Configuration::setDefaultConfigurationForCompressors() {
-	// Set default application paths to check for optional compression types
-	_config->CndSet("Dir::Bin::bzip2", "/bin/bzip2");
-	_config->CndSet("Dir::Bin::xz", "/usr/bin/xz");
-	if (FileExists(_config->FindFile("Dir::Bin::xz")) == true) {
-		_config->Set("Dir::Bin::lzma", _config->FindFile("Dir::Bin::xz"));
-		_config->Set("APT::Compressor::lzma::Binary", "xz");
-		if (_config->Exists("APT::Compressor::lzma::CompressArg") == false) {
-			_config->Set("APT::Compressor::lzma::CompressArg::", "--format=lzma");
-			_config->Set("APT::Compressor::lzma::CompressArg::", "-9");
-		}
-		if (_config->Exists("APT::Compressor::lzma::UncompressArg") == false) {
-			_config->Set("APT::Compressor::lzma::UncompressArg::", "--format=lzma");
-			_config->Set("APT::Compressor::lzma::UncompressArg::", "-d");
-		}
-	} else {
-		_config->CndSet("Dir::Bin::lzma", "/usr/bin/lzma");
-		if (_config->Exists("APT::Compressor::lzma::CompressArg") == false) {
-			_config->Set("APT::Compressor::lzma::CompressArg::", "--suffix=");
-			_config->Set("APT::Compressor::lzma::CompressArg::", "-9");
-		}
-		if (_config->Exists("APT::Compressor::lzma::UncompressArg") == false) {
-			_config->Set("APT::Compressor::lzma::UncompressArg::", "--suffix=");
-			_config->Set("APT::Compressor::lzma::UncompressArg::", "-d");
-		}
-	}
-}
-									/*}}}*/
 // getCompressors - Return Vector of usealbe compressors		/*{{{*/
 // getCompressors - Return Vector of usealbe compressors		/*{{{*/
 // ---------------------------------------------------------------------
 // ---------------------------------------------------------------------
 /* return a vector of compressors used by apt-ftparchive in the
 /* return a vector of compressors used by apt-ftparchive in the

+ 0 - 3
apt-pkg/aptconfiguration.h

@@ -123,9 +123,6 @@ public:									/*{{{*/
 	/** \return Return a comma-separated list of enabled build profile specifications */
 	/** \return Return a comma-separated list of enabled build profile specifications */
 	std::string static const getBuildProfilesString();
 	std::string static const getBuildProfilesString();
 									/*}}}*/
 									/*}}}*/
-	private:							/*{{{*/
-	void static setDefaultConfigurationForCompressors();
-									/*}}}*/
 };
 };
 									/*}}}*/
 									/*}}}*/
 }
 }

+ 8 - 8
apt-pkg/cacheset.h

@@ -574,21 +574,21 @@ template<> template<class Compare> inline bool PackageContainer<std::vector<pkgC
 
 
     The wrapping is read-only in practice modeled by making erase and co
     The wrapping is read-only in practice modeled by making erase and co
     private methods. */
     private methods. */
-class PackageUniverse : public PackageContainerInterface {
+class APT_HIDDEN PackageUniverse : public PackageContainerInterface {
 	pkgCache * const _cont;
 	pkgCache * const _cont;
 public:
 public:
 	typedef pkgCache::PkgIterator iterator;
 	typedef pkgCache::PkgIterator iterator;
 	typedef pkgCache::PkgIterator const_iterator;
 	typedef pkgCache::PkgIterator const_iterator;
 
 
-	bool empty() const { return false; }
-	size_t size() const { return _cont->Head().PackageCount; }
+	APT_PUBLIC bool empty() const { return false; }
+	APT_PUBLIC size_t size() const { return _cont->Head().PackageCount; }
 
 
-	const_iterator begin() const { return _cont->PkgBegin(); }
-	const_iterator end() const { return  _cont->PkgEnd(); }
-	iterator begin() { return _cont->PkgBegin(); }
-	iterator end() { return _cont->PkgEnd(); }
+	APT_PUBLIC const_iterator begin() const { return _cont->PkgBegin(); }
+	APT_PUBLIC const_iterator end() const { return  _cont->PkgEnd(); }
+	APT_PUBLIC iterator begin() { return _cont->PkgBegin(); }
+	APT_PUBLIC iterator end() { return _cont->PkgEnd(); }
 
 
-	PackageUniverse(pkgCache * const Owner) : _cont(Owner) { }
+	APT_PUBLIC PackageUniverse(pkgCache * const Owner) : _cont(Owner) { }
 
 
 private:
 private:
 	bool insert(pkgCache::PkgIterator const &) { return true; }
 	bool insert(pkgCache::PkgIterator const &) { return true; }

+ 4 - 2
apt-pkg/contrib/configuration.h

@@ -34,6 +34,8 @@
 #include <vector>
 #include <vector>
 #include <iostream>
 #include <iostream>
 
 
+#include <apt-pkg/macros.h>
+
 #ifndef APT_8_CLEANER_HEADERS
 #ifndef APT_8_CLEANER_HEADERS
 using std::string;
 using std::string;
 #endif
 #endif
@@ -59,7 +61,7 @@ class Configuration
    
    
    Item *Root;
    Item *Root;
    bool ToFree;
    bool ToFree;
-   
+
    Item *Lookup(Item *Head,const char *S,unsigned long const &Len,bool const &Create);
    Item *Lookup(Item *Head,const char *S,unsigned long const &Len,bool const &Create);
    Item *Lookup(const char *Name,const bool &Create);
    Item *Lookup(const char *Name,const bool &Create);
    inline const Item *Lookup(const char *Name) const
    inline const Item *Lookup(const char *Name) const
@@ -123,7 +125,7 @@ class Configuration
    class MatchAgainstConfig
    class MatchAgainstConfig
    {
    {
      std::vector<regex_t *> patterns;
      std::vector<regex_t *> patterns;
-     void clearPatterns();
+     APT_HIDDEN void clearPatterns();
 
 
    public:
    public:
      MatchAgainstConfig(char const * Config);
      MatchAgainstConfig(char const * Config);

+ 2 - 2
apt-pkg/contrib/strutl.h

@@ -153,9 +153,9 @@ inline const char *DeNull(const char *s) {return (s == 0?"(null)":s);}
 class URI
 class URI
 {
 {
    void CopyFrom(const std::string &From);
    void CopyFrom(const std::string &From);
-		 
+
    public:
    public:
-   
+
    std::string Access;
    std::string Access;
    std::string User;
    std::string User;
    std::string Password;
    std::string Password;

+ 3 - 3
apt-pkg/deb/debindexfile.cc

@@ -131,7 +131,7 @@ string debSourcesIndex::Info(const char *Type) const
 // SourcesIndex::Index* - Return the URI to the index files		/*{{{*/
 // SourcesIndex::Index* - Return the URI to the index files		/*{{{*/
 // ---------------------------------------------------------------------
 // ---------------------------------------------------------------------
 /* */
 /* */
-inline string debSourcesIndex::IndexFile(const char *Type) const
+string debSourcesIndex::IndexFile(const char *Type) const
 {
 {
    string s = URItoFileName(IndexURI(Type));
    string s = URItoFileName(IndexURI(Type));
 
 
@@ -265,7 +265,7 @@ string debPackagesIndex::Info(const char *Type) const
 // PackagesIndex::Index* - Return the URI to the index files		/*{{{*/
 // PackagesIndex::Index* - Return the URI to the index files		/*{{{*/
 // ---------------------------------------------------------------------
 // ---------------------------------------------------------------------
 /* */
 /* */
-inline string debPackagesIndex::IndexFile(const char *Type) const
+string debPackagesIndex::IndexFile(const char *Type) const
 {
 {
    string s =_config->FindDir("Dir::State::lists") + URItoFileName(IndexURI(Type));
    string s =_config->FindDir("Dir::State::lists") + URItoFileName(IndexURI(Type));
 
 
@@ -421,7 +421,7 @@ debTranslationsIndex::debTranslationsIndex(string URI,string Dist,string Section
 // TranslationIndex::Trans* - Return the URI to the translation files	/*{{{*/
 // TranslationIndex::Trans* - Return the URI to the translation files	/*{{{*/
 // ---------------------------------------------------------------------
 // ---------------------------------------------------------------------
 /* */
 /* */
-inline string debTranslationsIndex::IndexFile(const char *Type) const
+string debTranslationsIndex::IndexFile(const char *Type) const
 {
 {
    string s =_config->FindDir("Dir::State::lists") + URItoFileName(IndexURI(Type));
    string s =_config->FindDir("Dir::State::lists") + URItoFileName(IndexURI(Type));
 
 

+ 13 - 12
apt-pkg/deb/debindexfile.h

@@ -65,10 +65,10 @@ class debPackagesIndex : public pkgIndexFile
    std::string Section;
    std::string Section;
    std::string Architecture;
    std::string Architecture;
 
 
-   std::string Info(const char *Type) const;
-   std::string IndexFile(const char *Type) const;
-   std::string IndexURI(const char *Type) const;
-   
+   APT_HIDDEN std::string Info(const char *Type) const;
+   APT_HIDDEN std::string IndexFile(const char *Type) const;
+   APT_HIDDEN std::string IndexURI(const char *Type) const;
+
    public:
    public:
    
    
    virtual const Type *GetType() const APT_CONST;
    virtual const Type *GetType() const APT_CONST;
@@ -102,11 +102,11 @@ class debTranslationsIndex : public pkgIndexFile
    std::string Section;
    std::string Section;
    const char * const Language;
    const char * const Language;
    
    
-   std::string Info(const char *Type) const;
-   std::string IndexFile(const char *Type) const;
-   std::string IndexURI(const char *Type) const;
+   APT_HIDDEN std::string Info(const char *Type) const;
+   APT_HIDDEN std::string IndexFile(const char *Type) const;
+   APT_HIDDEN std::string IndexURI(const char *Type) const;
 
 
-   inline std::string TranslationFile() const {return std::string("Translation-").append(Language);};
+   APT_HIDDEN std::string TranslationFile() const {return std::string("Translation-").append(Language);};
 
 
    public:
    public:
    
    
@@ -136,10 +136,10 @@ class debSourcesIndex : public pkgIndexFile
    std::string Dist;
    std::string Dist;
    std::string Section;
    std::string Section;
 
 
-   std::string Info(const char *Type) const;
-   std::string IndexFile(const char *Type) const;
-   std::string IndexURI(const char *Type) const;
-   
+   APT_HIDDEN std::string Info(const char *Type) const;
+   APT_HIDDEN std::string IndexFile(const char *Type) const;
+   APT_HIDDEN std::string IndexURI(const char *Type) const;
+
    public:
    public:
 
 
    virtual const Type *GetType() const APT_CONST;
    virtual const Type *GetType() const APT_CONST;
@@ -214,6 +214,7 @@ class debDscFileIndex : public pkgIndexFile
 
 
 class debDebianSourceDirIndex : public debDscFileIndex
 class debDebianSourceDirIndex : public debDscFileIndex
 {
 {
+ public:
    virtual const Type *GetType() const APT_CONST;
    virtual const Type *GetType() const APT_CONST;
 };
 };
 
 

+ 1 - 1
apt-pkg/deb/debmetaindex.h

@@ -36,7 +36,7 @@ class debReleaseIndex : public metaIndex {
    /** \brief dpointer placeholder (for later in case we need it) */
    /** \brief dpointer placeholder (for later in case we need it) */
    void *d;
    void *d;
    std::map<std::string, std::vector<debSectionEntry const*> > ArchEntries;
    std::map<std::string, std::vector<debSectionEntry const*> > ArchEntries;
-   enum { ALWAYS_TRUSTED, NEVER_TRUSTED, CHECK_TRUST } Trusted;
+   enum APT_HIDDEN { ALWAYS_TRUSTED, NEVER_TRUSTED, CHECK_TRUST } Trusted;
 
 
    public:
    public:
 
 

+ 1 - 1
apt-pkg/deb/debsystem.h

@@ -29,7 +29,7 @@ class debSystem : public pkgSystem
 {
 {
    // private d-pointer
    // private d-pointer
    debSystemPrivate *d;
    debSystemPrivate *d;
-   bool CheckUpdates();
+   APT_HIDDEN bool CheckUpdates();
 
 
    public:
    public:
 
 

+ 1 - 1
apt-pkg/deb/dpkgpm.h

@@ -52,7 +52,7 @@ class pkgDPkgPM : public pkgPackageManager
       needs to declare a Replaces on the disappeared package.
       needs to declare a Replaces on the disappeared package.
       \param pkgname Name of the package that disappeared
       \param pkgname Name of the package that disappeared
    */
    */
-   void handleDisappearAction(std::string const &pkgname);
+   APT_HIDDEN void handleDisappearAction(std::string const &pkgname);
 
 
    protected:
    protected:
    int pkgFailures;
    int pkgFailures;

+ 5 - 5
apt-pkg/depcache.h

@@ -91,7 +91,7 @@ class pkgDepCache : protected pkgCache::Namespace
     *  \param follow_suggests If \b true, suggestions of the package
     *  \param follow_suggests If \b true, suggestions of the package
     *  will be recursively marked.
     *  will be recursively marked.
     */
     */
-   void MarkPackage(const pkgCache::PkgIterator &pkg,
+   APT_HIDDEN void MarkPackage(const pkgCache::PkgIterator &pkg,
 		    const pkgCache::VerIterator &ver,
 		    const pkgCache::VerIterator &ver,
 		    bool const &follow_recommends,
 		    bool const &follow_recommends,
 		    bool const &follow_suggests);
 		    bool const &follow_suggests);
@@ -109,7 +109,7 @@ class pkgDepCache : protected pkgCache::Namespace
     *
     *
     *  \return \b false if an error occurred.
     *  \return \b false if an error occurred.
     */
     */
-   bool MarkRequired(InRootSetFunc &rootFunc);
+   APT_HIDDEN bool MarkRequired(InRootSetFunc &rootFunc);
 
 
    /** \brief Set the StateCache::Garbage flag on all packages that
    /** \brief Set the StateCache::Garbage flag on all packages that
     *  should be removed.
     *  should be removed.
@@ -120,7 +120,7 @@ class pkgDepCache : protected pkgCache::Namespace
     *
     *
     *  \return \b false if an error occurred.
     *  \return \b false if an error occurred.
     */
     */
-   bool Sweep();
+   APT_HIDDEN bool Sweep();
 
 
    public:
    public:
    
    
@@ -169,7 +169,7 @@ class pkgDepCache : protected pkgCache::Namespace
        bool released;
        bool released;
 
 
        /** Action groups are noncopyable. */
        /** Action groups are noncopyable. */
-       ActionGroup(const ActionGroup &other);
+       APT_HIDDEN ActionGroup(const ActionGroup &other);
    public:
    public:
        /** \brief Create a new ActionGroup.
        /** \brief Create a new ActionGroup.
 	*
 	*
@@ -514,7 +514,7 @@ class pkgDepCache : protected pkgCache::Namespace
 	 bool const rPurge, unsigned long const Depth, bool const FromUser);
 	 bool const rPurge, unsigned long const Depth, bool const FromUser);
 
 
    private:
    private:
-   bool IsModeChangeOk(ModeList const mode, PkgIterator const &Pkg,
+   APT_HIDDEN bool IsModeChangeOk(ModeList const mode, PkgIterator const &Pkg,
 			unsigned long const Depth, bool const FromUser);
 			unsigned long const Depth, bool const FromUser);
 };
 };
 
 

+ 2 - 2
apt-pkg/indexcopy.h

@@ -93,8 +93,8 @@ class SigVerify								/*{{{*/
    /** \brief dpointer placeholder (for later in case we need it) */
    /** \brief dpointer placeholder (for later in case we need it) */
    void *d;
    void *d;
 
 
-   bool Verify(std::string prefix,std::string file, indexRecords *records);
-   bool CopyMetaIndex(std::string CDROM, std::string CDName, 
+   APT_HIDDEN bool Verify(std::string prefix,std::string file, indexRecords *records);
+   APT_HIDDEN bool CopyMetaIndex(std::string CDROM, std::string CDName,
 		      std::string prefix, std::string file);
 		      std::string prefix, std::string file);
 
 
  public:
  public:

+ 1 - 1
apt-pkg/indexrecords.h

@@ -21,7 +21,7 @@
 
 
 class indexRecords
 class indexRecords
 {
 {
-   bool parseSumData(const char *&Start, const char *End, std::string &Name,
+   APT_HIDDEN bool parseSumData(const char *&Start, const char *End, std::string &Name,
 		     std::string &Hash, unsigned long long &Size);
 		     std::string &Hash, unsigned long long &Size);
    public:
    public:
    struct checkSum;
    struct checkSum;

+ 1 - 1
apt-pkg/install-progress.h

@@ -119,7 +119,7 @@ namespace Progress {
  class PackageManagerFancy : public PackageManager
  class PackageManagerFancy : public PackageManager
  {
  {
  private:
  private:
-    static void staticSIGWINCH(int);
+    APT_HIDDEN static void staticSIGWINCH(int);
     static std::vector<PackageManagerFancy*> instances;
     static std::vector<PackageManagerFancy*> instances;
     APT_HIDDEN bool DrawStatusLine();
     APT_HIDDEN bool DrawStatusLine();
 
 

+ 1 - 1
apt-pkg/pkgcache.h

@@ -228,7 +228,7 @@ class pkgCache								/*{{{*/
 
 
 private:
 private:
    bool MultiArchEnabled;
    bool MultiArchEnabled;
-   PkgIterator SingleArchFindPkg(const std::string &Name);
+   APT_HIDDEN PkgIterator SingleArchFindPkg(const std::string &Name);
 };
 };
 									/*}}}*/
 									/*}}}*/
 // Header structure							/*{{{*/
 // Header structure							/*{{{*/

+ 2 - 1
apt-pkg/update.h

@@ -11,7 +11,8 @@
 #define PKGLIB_UPDATE_H
 #define PKGLIB_UPDATE_H
 
 
 class pkgAcquireStatus;
 class pkgAcquireStatus;
-
+class pkgSourceList;
+class pkgAcquire;
 
 
 bool ListUpdate(pkgAcquireStatus &progress, pkgSourceList &List, int PulseInterval=0);
 bool ListUpdate(pkgAcquireStatus &progress, pkgSourceList &List, int PulseInterval=0);
 bool AcquireUpdate(pkgAcquire &Fetcher, int const PulseInterval = 0,
 bool AcquireUpdate(pkgAcquire &Fetcher, int const PulseInterval = 0,

Разлика између датотеке није приказан због своје велике величине
+ 3 - 28
debian/libapt-pkg4.13.symbols