瀏覽代碼

cleanup headers and especially #includes everywhere

Beside being a bit cleaner it hopefully also resolves oddball problems
I have with high levels of parallel jobs.

Git-Dch: Ignore
Reported-By: iwyu (include-what-you-use)
David Kalnischkies 12 年之前
父節點
當前提交
453b82a388
共有 100 個文件被更改,包括 641 次插入272 次删除
  1. 3 1
      apt-inst/contrib/arfile.cc
  2. 4 2
      apt-inst/contrib/extracttar.cc
  3. 9 3
      apt-inst/deb/debfile.cc
  4. 5 1
      apt-inst/deb/debfile.h
  5. 0 1
      apt-inst/dirstream.cc
  6. 8 1
      apt-inst/extract.cc
  7. 3 2
      apt-inst/extract.h
  8. 0 2
      apt-inst/filelist.cc
  9. 12 3
      apt-pkg/acquire-item.cc
  10. 4 0
      apt-pkg/acquire-item.h
  11. 10 2
      apt-pkg/acquire-method.cc
  12. 1 0
      apt-pkg/acquire-method.h
  13. 5 2
      apt-pkg/acquire-worker.cc
  14. 3 0
      apt-pkg/acquire-worker.h
  15. 6 0
      apt-pkg/acquire.cc
  16. 6 1
      apt-pkg/acquire.h
  17. 6 7
      apt-pkg/algorithms.cc
  18. 4 1
      apt-pkg/algorithms.h
  19. 7 2
      apt-pkg/aptconfiguration.cc
  20. 8 1
      apt-pkg/cachefile.cc
  21. 7 2
      apt-pkg/cachefile.h
  22. 3 1
      apt-pkg/cachefilter.cc
  23. 1 0
      apt-pkg/cachefilter.h
  24. 4 0
      apt-pkg/cacheiterators.h
  25. 12 4
      apt-pkg/cacheset.cc
  26. 6 1
      apt-pkg/cacheset.h
  27. 18 16
      apt-pkg/cdrom.cc
  28. 2 0
      apt-pkg/cdrom.h
  29. 4 0
      apt-pkg/clean.cc
  30. 6 1
      apt-pkg/clean.h
  31. 4 1
      apt-pkg/contrib/cdromutl.cc
  32. 5 0
      apt-pkg/contrib/cmndline.cc
  33. 10 3
      apt-pkg/contrib/configuration.cc
  34. 3 1
      apt-pkg/contrib/error.cc
  35. 14 13
      apt-pkg/contrib/error.h
  36. 9 3
      apt-pkg/contrib/fileutl.cc
  37. 6 5
      apt-pkg/contrib/fileutl.h
  38. 10 8
      apt-pkg/contrib/gpgv.cc
  39. 6 8
      apt-pkg/contrib/gpgv.h
  40. 5 1
      apt-pkg/contrib/hashes.cc
  41. 9 4
      apt-pkg/contrib/hashes.h
  42. 3 0
      apt-pkg/contrib/hashsum.cc
  43. 7 3
      apt-pkg/contrib/hashsum_template.h
  44. 4 4
      apt-pkg/contrib/macros.h
  45. 1 5
      apt-pkg/contrib/md5.cc
  46. 5 4
      apt-pkg/contrib/md5.h
  47. 2 2
      apt-pkg/contrib/mmap.cc
  48. 1 2
      apt-pkg/contrib/netrc.cc
  49. 4 2
      apt-pkg/contrib/netrc.h
  50. 2 0
      apt-pkg/contrib/progress.cc
  51. 1 4
      apt-pkg/contrib/sha1.cc
  52. 4 3
      apt-pkg/contrib/sha1.h
  53. 7 3
      apt-pkg/contrib/sha2.h
  54. 1 0
      apt-pkg/contrib/sha2_internal.cc
  55. 1 0
      apt-pkg/contrib/sha2_internal.h
  56. 7 2
      apt-pkg/contrib/strutl.cc
  57. 13 10
      apt-pkg/contrib/strutl.h
  58. 12 2
      apt-pkg/deb/debindexfile.cc
  59. 9 1
      apt-pkg/deb/debindexfile.h
  60. 9 0
      apt-pkg/deb/deblistparser.cc
  61. 7 0
      apt-pkg/deb/deblistparser.h
  62. 9 2
      apt-pkg/deb/debmetaindex.cc
  63. 7 1
      apt-pkg/deb/debmetaindex.h
  64. 7 1
      apt-pkg/deb/debrecords.cc
  65. 3 0
      apt-pkg/deb/debrecords.h
  66. 9 2
      apt-pkg/deb/debsrcrecords.cc
  67. 6 1
      apt-pkg/deb/debsrcrecords.h
  68. 8 1
      apt-pkg/deb/debsystem.cc
  69. 9 1
      apt-pkg/deb/debsystem.h
  70. 2 0
      apt-pkg/deb/debversion.cc
  71. 3 3
      apt-pkg/deb/debversion.h
  72. 28 24
      apt-pkg/deb/dpkgpm.cc
  73. 11 2
      apt-pkg/deb/dpkgpm.h
  74. 10 4
      apt-pkg/depcache.cc
  75. 10 2
      apt-pkg/depcache.h
  76. 13 4
      apt-pkg/edsp.cc
  77. 4 1
      apt-pkg/edsp.h
  78. 11 6
      apt-pkg/edsp/edspindexfile.cc
  79. 4 0
      apt-pkg/edsp/edspindexfile.h
  80. 6 4
      apt-pkg/edsp/edsplistparser.cc
  81. 4 0
      apt-pkg/edsp/edsplistparser.h
  82. 8 7
      apt-pkg/edsp/edspsystem.cc
  83. 9 0
      apt-pkg/edsp/edspsystem.h
  84. 3 3
      apt-pkg/indexcopy.cc
  85. 6 4
      apt-pkg/indexcopy.h
  86. 8 2
      apt-pkg/indexfile.cc
  87. 9 6
      apt-pkg/indexfile.h
  88. 6 1
      apt-pkg/indexrecords.cc
  89. 4 2
      apt-pkg/indexrecords.h
  90. 3 1
      apt-pkg/init.cc
  91. 2 0
      apt-pkg/init.h
  92. 18 12
      apt-pkg/install-progress.cc
  93. 10 5
      apt-pkg/metaindex.h
  94. 5 1
      apt-pkg/orderlist.cc
  95. 4 2
      apt-pkg/orderlist.h
  96. 9 2
      apt-pkg/packagemanager.cc
  97. 7 5
      apt-pkg/packagemanager.h
  98. 5 2
      apt-pkg/pkgcache.cc
  99. 13 7
      apt-pkg/pkgcachegen.cc
  100. 0 0
      apt-pkg/pkgcachegen.h

+ 3 - 1
apt-inst/contrib/arfile.cc

@@ -21,7 +21,9 @@
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/error.h>
 
 
-#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <string>
 
 
 #include <apti18n.h>
 #include <apti18n.h>
 									/*}}}*/
 									/*}}}*/

+ 4 - 2
apt-inst/contrib/extracttar.cc

@@ -23,9 +23,11 @@
 #include <apt-pkg/error.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/configuration.h>
-#include <apt-pkg/macros.h>
+#include <apt-pkg/fileutl.h>
 
 
-#include <stdlib.h>
+#include <string.h>
+#include <algorithm>
+#include <string>
 #include <unistd.h>
 #include <unistd.h>
 #include <signal.h>
 #include <signal.h>
 #include <fcntl.h>
 #include <fcntl.h>

+ 9 - 3
apt-inst/deb/debfile.cc

@@ -21,11 +21,17 @@
 #include <apt-pkg/debfile.h>
 #include <apt-pkg/debfile.h>
 #include <apt-pkg/extracttar.h>
 #include <apt-pkg/extracttar.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/error.h>
-#include <apt-pkg/deblistparser.h>
 #include <apt-pkg/aptconfiguration.h>
 #include <apt-pkg/aptconfiguration.h>
-
+#include <apt-pkg/arfile.h>
+#include <apt-pkg/dirstream.h>
+#include <apt-pkg/fileutl.h>
+#include <apt-pkg/tagfile.h>
+
+#include <string.h>
+#include <string>
+#include <vector>
 #include <sys/stat.h>
 #include <sys/stat.h>
-#include <unistd.h>
+
 #include <apti18n.h>
 #include <apti18n.h>
 									/*}}}*/
 									/*}}}*/
 
 

+ 5 - 1
apt-inst/deb/debfile.h

@@ -27,11 +27,15 @@
 #include <apt-pkg/arfile.h>
 #include <apt-pkg/arfile.h>
 #include <apt-pkg/dirstream.h>
 #include <apt-pkg/dirstream.h>
 #include <apt-pkg/tagfile.h>
 #include <apt-pkg/tagfile.h>
-#include <apt-pkg/pkgcache.h>
+
+#include <string>
 
 
 #ifndef APT_8_CLEANER_HEADERS
 #ifndef APT_8_CLEANER_HEADERS
 #include <apt-pkg/md5.h>
 #include <apt-pkg/md5.h>
 #endif
 #endif
+#ifndef APT_10_CLEANER_HEADERS
+#include <apt-pkg/pkgcache.h>
+#endif
 
 
 class FileFd;
 class FileFd;
 
 

+ 0 - 1
apt-inst/dirstream.cc

@@ -18,7 +18,6 @@
 
 
 #include <fcntl.h>
 #include <fcntl.h>
 #include <sys/stat.h>
 #include <sys/stat.h>
-#include <sys/types.h>
 #include <sys/time.h>
 #include <sys/time.h>
 #include <errno.h>
 #include <errno.h>
 #include <unistd.h>
 #include <unistd.h>

+ 8 - 1
apt-inst/extract.cc

@@ -50,13 +50,20 @@
 #include <apt-pkg/error.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/debversion.h>
 #include <apt-pkg/debversion.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/fileutl.h>
+#include <apt-pkg/dirstream.h>
+#include <apt-pkg/filelist.h>
+#include <apt-pkg/mmap.h>
+#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
 
 
+#include <string.h>
+#include <string>
 #include <sys/stat.h>
 #include <sys/stat.h>
 #include <stdio.h>
 #include <stdio.h>
-#include <unistd.h>
 #include <errno.h>
 #include <errno.h>
 #include <dirent.h>
 #include <dirent.h>
 #include <iostream>
 #include <iostream>
+
 #include <apti18n.h>
 #include <apti18n.h>
 									/*}}}*/
 									/*}}}*/
 using namespace std;
 using namespace std;

+ 3 - 2
apt-inst/extract.h

@@ -17,11 +17,12 @@
 #ifndef PKGLIB_EXTRACT_H
 #ifndef PKGLIB_EXTRACT_H
 #define PKGLIB_EXTRACT_H
 #define PKGLIB_EXTRACT_H
 
 
-
-
 #include <apt-pkg/dirstream.h>
 #include <apt-pkg/dirstream.h>
 #include <apt-pkg/filelist.h>
 #include <apt-pkg/filelist.h>
 #include <apt-pkg/pkgcache.h>
 #include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
+
+#include <string>
 
 
 class pkgExtract : public pkgDirStream
 class pkgExtract : public pkgDirStream
 {
 {

+ 0 - 2
apt-inst/filelist.cc

@@ -39,8 +39,6 @@
 #include <apt-pkg/error.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/strutl.h>
 
 
-#include <stdio.h>
-#include <stdlib.h>
 #include <string.h>
 #include <string.h>
 #include <iostream>
 #include <iostream>
 #include <apti18n.h>
 #include <apti18n.h>

+ 12 - 3
apt-pkg/acquire-item.cc

@@ -22,12 +22,21 @@
 #include <apt-pkg/error.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/fileutl.h>
-#include <apt-pkg/md5.h>
 #include <apt-pkg/sha1.h>
 #include <apt-pkg/sha1.h>
 #include <apt-pkg/tagfile.h>
 #include <apt-pkg/tagfile.h>
 #include <apt-pkg/indexrecords.h>
 #include <apt-pkg/indexrecords.h>
-#include <apt-pkg/metaindex.h>
-
+#include <apt-pkg/acquire.h>
+#include <apt-pkg/hashes.h>
+#include <apt-pkg/indexfile.h>
+#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
+#include <apt-pkg/pkgrecords.h>
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+#include <iostream>
+#include <vector>
 #include <sys/stat.h>
 #include <sys/stat.h>
 #include <unistd.h>
 #include <unistd.h>
 #include <errno.h>
 #include <errno.h>

+ 4 - 0
apt-pkg/acquire-item.h

@@ -24,6 +24,10 @@
 #include <apt-pkg/hashes.h>
 #include <apt-pkg/hashes.h>
 #include <apt-pkg/weakptr.h>
 #include <apt-pkg/weakptr.h>
 #include <apt-pkg/pkgcache.h>
 #include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
+
+#include <string>
+#include <vector>
 
 
 #ifndef APT_8_CLEANER_HEADERS
 #ifndef APT_8_CLEANER_HEADERS
 #include <apt-pkg/indexfile.h>
 #include <apt-pkg/indexfile.h>

+ 10 - 2
apt-pkg/acquire-method.cc

@@ -23,10 +23,18 @@
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/hashes.h>
 #include <apt-pkg/hashes.h>
-
+#include <apt-pkg/md5.h>
+#include <apt-pkg/sha1.h>
+#include <apt-pkg/sha2.h>
+
+#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <string>
+#include <vector>
 #include <iostream>
 #include <iostream>
 #include <stdio.h>
 #include <stdio.h>
-#include <sys/signal.h>
 									/*}}}*/
 									/*}}}*/
 
 
 using namespace std;
 using namespace std;

+ 1 - 0
apt-pkg/acquire-method.h

@@ -21,6 +21,7 @@
 #define PKGLIB_ACQUIRE_METHOD_H
 #define PKGLIB_ACQUIRE_METHOD_H
 
 
 #include <stdarg.h>
 #include <stdarg.h>
+#include <time.h>
 
 
 #include <string>
 #include <string>
 #include <vector>
 #include <vector>

+ 5 - 2
apt-pkg/acquire-worker.cc

@@ -14,20 +14,23 @@
 // Include Files							/*{{{*/
 // Include Files							/*{{{*/
 #include <config.h>
 #include <config.h>
 
 
+#include <apt-pkg/acquire.h>
 #include <apt-pkg/acquire-worker.h>
 #include <apt-pkg/acquire-worker.h>
 #include <apt-pkg/acquire-item.h>
 #include <apt-pkg/acquire-item.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/strutl.h>
+#include <apt-pkg/hashes.h>
 
 
+#include <string>
+#include <vector>
 #include <iostream>
 #include <iostream>
 #include <sstream>
 #include <sstream>
-#include <fstream>
 
 
 #include <sys/stat.h>
 #include <sys/stat.h>
+#include <stdlib.h>
 #include <unistd.h>
 #include <unistd.h>
-#include <fcntl.h>
 #include <signal.h>
 #include <signal.h>
 #include <stdio.h>
 #include <stdio.h>
 #include <errno.h>
 #include <errno.h>

+ 3 - 0
apt-pkg/acquire-worker.h

@@ -22,6 +22,9 @@
 #include <apt-pkg/acquire.h>
 #include <apt-pkg/acquire.h>
 #include <apt-pkg/weakptr.h>
 #include <apt-pkg/weakptr.h>
 
 
+#include <sys/types.h>
+#include <string>
+#include <vector>
 
 
 /** \brief A fetch subprocess.
 /** \brief A fetch subprocess.
  *
  *

+ 6 - 0
apt-pkg/acquire.cc

@@ -23,12 +23,18 @@
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/fileutl.h>
 
 
+#include <string>
+#include <vector>
 #include <iostream>
 #include <iostream>
 #include <sstream>
 #include <sstream>
 #include <stdio.h>
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
 
 
 #include <dirent.h>
 #include <dirent.h>
 #include <sys/time.h>
 #include <sys/time.h>
+#include <sys/select.h>
 #include <errno.h>
 #include <errno.h>
 
 
 #include <apti18n.h>
 #include <apti18n.h>

+ 6 - 1
apt-pkg/acquire.h

@@ -72,8 +72,13 @@
 #include <vector>
 #include <vector>
 #include <string>
 #include <string>
 
 
+#include <stddef.h>
 #include <sys/time.h>
 #include <sys/time.h>
+#include <sys/select.h>
+
+#ifndef APT_10_CLEANER_HEADERS
 #include <unistd.h>
 #include <unistd.h>
+#endif
 
 
 #ifndef APT_8_CLEANER_HEADERS
 #ifndef APT_8_CLEANER_HEADERS
 using std::vector;
 using std::vector;
@@ -353,7 +358,7 @@ class pkgAcquire
    void SetLog(pkgAcquireStatus *Progress) { Log = Progress; }
    void SetLog(pkgAcquireStatus *Progress) { Log = Progress; }
 
 
    /** \brief Construct a new pkgAcquire. */
    /** \brief Construct a new pkgAcquire. */
-   pkgAcquire(pkgAcquireStatus *Log) __deprecated;
+   pkgAcquire(pkgAcquireStatus *Log) APT_DEPRECATED;
    pkgAcquire();
    pkgAcquire();
 
 
    /** \brief Destroy this pkgAcquire object.
    /** \brief Destroy this pkgAcquire object.

+ 6 - 7
apt-pkg/algorithms.cc

@@ -19,19 +19,18 @@
 #include <apt-pkg/algorithms.h>
 #include <apt-pkg/algorithms.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/configuration.h>
-#include <apt-pkg/version.h>
 #include <apt-pkg/sptr.h>
 #include <apt-pkg/sptr.h>
-#include <apt-pkg/acquire-item.h>
 #include <apt-pkg/edsp.h>
 #include <apt-pkg/edsp.h>
-#include <apt-pkg/sourcelist.h>
-#include <apt-pkg/fileutl.h>
 #include <apt-pkg/progress.h>
 #include <apt-pkg/progress.h>
+#include <apt-pkg/depcache.h>
+#include <apt-pkg/packagemanager.h>
+#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
 
 
-#include <sys/types.h>
+#include <string.h>
+#include <string>
 #include <cstdlib>
 #include <cstdlib>
-#include <algorithm>
 #include <iostream>
 #include <iostream>
-#include <stdio.h>
 
 
 #include <apti18n.h>
 #include <apti18n.h>
 									/*}}}*/
 									/*}}}*/

+ 4 - 1
apt-pkg/algorithms.h

@@ -33,8 +33,11 @@
 
 
 #include <apt-pkg/packagemanager.h>
 #include <apt-pkg/packagemanager.h>
 #include <apt-pkg/depcache.h>
 #include <apt-pkg/depcache.h>
+#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
 
 
 #include <iostream>
 #include <iostream>
+#include <string>
 
 
 #include <apt-pkg/macros.h>
 #include <apt-pkg/macros.h>
 
 
@@ -140,7 +143,7 @@ class pkgProblemResolver						/*{{{*/
    // Try to resolve problems only by using keep
    // Try to resolve problems only by using keep
    bool ResolveByKeep();
    bool ResolveByKeep();
 
 
-   __deprecated void InstallProtect();
+   APT_DEPRECATED void InstallProtect();
 
 
    pkgProblemResolver(pkgDepCache *Cache);
    pkgProblemResolver(pkgDepCache *Cache);
    ~pkgProblemResolver();
    ~pkgProblemResolver();

+ 7 - 2
apt-pkg/aptconfiguration.cc

@@ -17,14 +17,19 @@
 #include <apt-pkg/macros.h>
 #include <apt-pkg/macros.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/strutl.h>
 
 
-#include <sys/types.h>
 #include <dirent.h>
 #include <dirent.h>
 #include <stdio.h>
 #include <stdio.h>
 #include <fcntl.h>
 #include <fcntl.h>
-
+#include <ctype.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
 #include <algorithm>
 #include <algorithm>
 #include <string>
 #include <string>
 #include <vector>
 #include <vector>
+
+#include <apti18n.h>
 									/*}}}*/
 									/*}}}*/
 namespace APT {
 namespace APT {
 // getCompressionTypes - Return Vector of usable compressiontypes	/*{{{*/
 // getCompressionTypes - Return Vector of usable compressiontypes	/*{{{*/

+ 8 - 1
apt-pkg/cachefile.cc

@@ -21,9 +21,16 @@
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/policy.h>
 #include <apt-pkg/policy.h>
 #include <apt-pkg/pkgsystem.h>
 #include <apt-pkg/pkgsystem.h>
-#include <apt-pkg/acquire-item.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/progress.h>
 #include <apt-pkg/progress.h>
+#include <apt-pkg/depcache.h>
+#include <apt-pkg/mmap.h>
+#include <apt-pkg/pkgcache.h>
+
+#include <string.h>
+#include <unistd.h>
+#include <string>
+#include <vector>
 
 
 #include <apti18n.h>
 #include <apti18n.h>
 									/*}}}*/
 									/*}}}*/

+ 7 - 2
apt-pkg/cachefile.h

@@ -17,8 +17,12 @@
 #ifndef PKGLIB_CACHEFILE_H
 #ifndef PKGLIB_CACHEFILE_H
 #define PKGLIB_CACHEFILE_H
 #define PKGLIB_CACHEFILE_H
 
 
+#include <stddef.h>
+
 #include <apt-pkg/depcache.h>
 #include <apt-pkg/depcache.h>
 #include <apt-pkg/macros.h>
 #include <apt-pkg/macros.h>
+#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
 
 
 #ifndef APT_8_CLEANER_HEADERS
 #ifndef APT_8_CLEANER_HEADERS
 #include <apt-pkg/acquire.h>
 #include <apt-pkg/acquire.h>
@@ -26,6 +30,7 @@
 #include <apt-pkg/sourcelist.h>
 #include <apt-pkg/sourcelist.h>
 #endif
 #endif
 
 
+class MMap;
 class pkgPolicy;
 class pkgPolicy;
 class pkgSourceList;
 class pkgSourceList;
 class OpProgress;
 class OpProgress;
@@ -60,13 +65,13 @@ class pkgCacheFile
    inline unsigned char &operator [](pkgCache::DepIterator const &I) {return (*DCache)[I];};
    inline unsigned char &operator [](pkgCache::DepIterator const &I) {return (*DCache)[I];};
 
 
    bool BuildCaches(OpProgress *Progress = NULL,bool WithLock = true);
    bool BuildCaches(OpProgress *Progress = NULL,bool WithLock = true);
-   __deprecated bool BuildCaches(OpProgress &Progress,bool const &WithLock = true) { return BuildCaches(&Progress, WithLock); };
+   APT_DEPRECATED bool BuildCaches(OpProgress &Progress,bool const &WithLock = true) { return BuildCaches(&Progress, WithLock); };
    bool BuildSourceList(OpProgress *Progress = NULL);
    bool BuildSourceList(OpProgress *Progress = NULL);
    bool BuildPolicy(OpProgress *Progress = NULL);
    bool BuildPolicy(OpProgress *Progress = NULL);
    bool BuildDepCache(OpProgress *Progress = NULL);
    bool BuildDepCache(OpProgress *Progress = NULL);
    bool Open(OpProgress *Progress = NULL, bool WithLock = true);
    bool Open(OpProgress *Progress = NULL, bool WithLock = true);
    inline bool ReadOnlyOpen(OpProgress *Progress = NULL) { return Open(Progress, false); };
    inline bool ReadOnlyOpen(OpProgress *Progress = NULL) { return Open(Progress, false); };
-   __deprecated bool Open(OpProgress &Progress,bool const &WithLock = true) { return Open(&Progress, WithLock); };
+   APT_DEPRECATED bool Open(OpProgress &Progress,bool const &WithLock = true) { return Open(&Progress, WithLock); };
    static void RemoveCaches();
    static void RemoveCaches();
    void Close();
    void Close();
 
 

+ 3 - 1
apt-pkg/cachefilter.cc

@@ -9,10 +9,12 @@
 #include <apt-pkg/cachefilter.h>
 #include <apt-pkg/cachefilter.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/pkgcache.h>
 #include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/strutl.h>
+#include <apt-pkg/macros.h>
 
 
 #include <string>
 #include <string>
-
+#include <string.h>
 #include <regex.h>
 #include <regex.h>
 #include <fnmatch.h>
 #include <fnmatch.h>
 
 

+ 1 - 0
apt-pkg/cachefilter.h

@@ -7,6 +7,7 @@
 #define APT_CACHEFILTER_H
 #define APT_CACHEFILTER_H
 // Include Files							/*{{{*/
 // Include Files							/*{{{*/
 #include <apt-pkg/pkgcache.h>
 #include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
 
 
 #include <string>
 #include <string>
 
 

+ 4 - 0
apt-pkg/cacheiterators.h

@@ -29,7 +29,11 @@
 									/*}}}*/
 									/*}}}*/
 #ifndef PKGLIB_CACHEITERATORS_H
 #ifndef PKGLIB_CACHEITERATORS_H
 #define PKGLIB_CACHEITERATORS_H
 #define PKGLIB_CACHEITERATORS_H
+#include<apt-pkg/pkgcache.h>
+
 #include<iterator>
 #include<iterator>
+#include <iosfwd>
+#include <string>
 
 
 #include<string.h>
 #include<string.h>
 
 

+ 12 - 4
apt-pkg/cacheset.cc

@@ -16,14 +16,22 @@
 #include <apt-pkg/cachefilter.h>
 #include <apt-pkg/cachefilter.h>
 #include <apt-pkg/cacheset.h>
 #include <apt-pkg/cacheset.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/error.h>
-#include <apt-pkg/strutl.h>
 #include <apt-pkg/versionmatch.h>
 #include <apt-pkg/versionmatch.h>
 #include <apt-pkg/pkgrecords.h>
 #include <apt-pkg/pkgrecords.h>
 #include <apt-pkg/policy.h>
 #include <apt-pkg/policy.h>
-
-#include <vector>
-
+#include <apt-pkg/cacheiterators.h>
+#include <apt-pkg/configuration.h>
+#include <apt-pkg/depcache.h>
+#include <apt-pkg/macros.h>
+#include <apt-pkg/pkgcache.h>
+
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
 #include <regex.h>
 #include <regex.h>
+#include <list>
+#include <string>
+#include <vector>
 
 
 #include <apti18n.h>
 #include <apti18n.h>
 									/*}}}*/
 									/*}}}*/

+ 6 - 1
apt-pkg/cacheset.h

@@ -9,7 +9,6 @@
 #ifndef APT_CACHESET_H
 #ifndef APT_CACHESET_H
 #define APT_CACHESET_H
 #define APT_CACHESET_H
 // Include Files							/*{{{*/
 // Include Files							/*{{{*/
-#include <iostream>
 #include <fstream>
 #include <fstream>
 #include <map>
 #include <map>
 #include <set>
 #include <set>
@@ -17,11 +16,17 @@
 #include <string>
 #include <string>
 #include <iterator>
 #include <iterator>
 
 
+#include <stddef.h>
+
 #include <apt-pkg/error.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/pkgcache.h>
 #include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
 
 
 #ifndef APT_8_CLEANER_HEADERS
 #ifndef APT_8_CLEANER_HEADERS
 #include <apt-pkg/cachefile.h>
 #include <apt-pkg/cachefile.h>
+#endif
+#ifndef APT_10_CLEANER_HEADERS
+#include <iostream>
 #endif
 #endif
 									/*}}}*/
 									/*}}}*/
 
 

+ 18 - 16
apt-pkg/cdrom.cc

@@ -1,28 +1,30 @@
 /*
 /*
  */
  */
-#include<config.h>
-
-#include<apt-pkg/init.h>
-#include<apt-pkg/error.h>
-#include<apt-pkg/cdromutl.h>
-#include<apt-pkg/strutl.h>
-#include<apt-pkg/cdrom.h>
-#include<apt-pkg/aptconfiguration.h>
-#include<apt-pkg/configuration.h>
-#include<apt-pkg/fileutl.h>
-
-#include<sstream>
-#include<fstream>
+#include <config.h>
+
+#include <apt-pkg/error.h>
+#include <apt-pkg/cdromutl.h>
+#include <apt-pkg/strutl.h>
+#include <apt-pkg/cdrom.h>
+#include <apt-pkg/aptconfiguration.h>
+#include <apt-pkg/configuration.h>
+#include <apt-pkg/fileutl.h>
+#include <apt-pkg/indexcopy.h>
+
+
+#include <string.h>
+#include <iostream>
+#include <string>
+#include <vector>
+#include <sstream>
+#include <fstream>
 #include <sys/stat.h>
 #include <sys/stat.h>
-#include <fcntl.h>
 #include <dirent.h>
 #include <dirent.h>
 #include <unistd.h>
 #include <unistd.h>
 #include <stdio.h>
 #include <stdio.h>
 #include <algorithm>
 #include <algorithm>
 #include <dlfcn.h>
 #include <dlfcn.h>
 
 
-#include "indexcopy.h"
-
 #include<apti18n.h>
 #include<apti18n.h>
 
 
 using namespace std;
 using namespace std;

+ 2 - 0
apt-pkg/cdrom.h

@@ -4,6 +4,8 @@
 #include<string>
 #include<string>
 #include<vector>
 #include<vector>
 
 
+#include <stddef.h>
+
 #ifndef APT_8_CLEANER_HEADERS
 #ifndef APT_8_CLEANER_HEADERS
 #include <apt-pkg/init.h>
 #include <apt-pkg/init.h>
 using namespace std;
 using namespace std;

+ 4 - 0
apt-pkg/clean.cc

@@ -16,7 +16,11 @@
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/aptconfiguration.h>
 #include <apt-pkg/aptconfiguration.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/fileutl.h>
+#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
 
 
+#include <string>
+#include <string.h>
 #include <dirent.h>
 #include <dirent.h>
 #include <sys/stat.h>
 #include <sys/stat.h>
 #include <unistd.h>
 #include <unistd.h>

+ 6 - 1
apt-pkg/clean.h

@@ -10,8 +10,13 @@
 #ifndef APTPKG_CLEAN_H
 #ifndef APTPKG_CLEAN_H
 #define APTPKG_CLEAN_H
 #define APTPKG_CLEAN_H
 
 
-
+#ifndef APT_10_CLEANER_HEADERS
 #include <apt-pkg/pkgcache.h>
 #include <apt-pkg/pkgcache.h>
+#endif
+
+#include <string>
+
+class pkgCache;
 
 
 class pkgArchiveCleaner
 class pkgArchiveCleaner
 {
 {

+ 4 - 1
apt-pkg/contrib/cdromutl.cc

@@ -19,7 +19,10 @@
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/strutl.h>
 
 
-#include <sys/wait.h>
+#include <stdlib.h>
+#include <string.h>
+#include <iostream>
+#include <string>
 #include <sys/statvfs.h>
 #include <sys/statvfs.h>
 #include <dirent.h>
 #include <dirent.h>
 #include <fcntl.h>
 #include <fcntl.h>

+ 5 - 0
apt-pkg/contrib/cmndline.cc

@@ -18,6 +18,11 @@
 #include <apt-pkg/error.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/strutl.h>
 
 
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+#include <string>
+
 #include <apti18n.h>
 #include <apti18n.h>
 									/*}}}*/
 									/*}}}*/
 using namespace std;
 using namespace std;

+ 10 - 3
apt-pkg/contrib/configuration.cc

@@ -21,11 +21,18 @@
 #include <apt-pkg/error.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/fileutl.h>
-#include <apt-pkg/init.h>
-
+#include <apt-pkg/macros.h>
+
+#include <ctype.h>
+#include <regex.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <algorithm>
+#include <string>
 #include <vector>
 #include <vector>
 #include <fstream>
 #include <fstream>
-#include <iostream>
 
 
 #include <apti18n.h>
 #include <apti18n.h>
 
 

+ 3 - 1
apt-pkg/contrib/error.cc

@@ -17,12 +17,14 @@
 
 
 #include <apt-pkg/error.h>
 #include <apt-pkg/error.h>
 
 
+#include <stdarg.h>
+#include <stddef.h>
+#include <list>
 #include <iostream>
 #include <iostream>
 #include <errno.h>
 #include <errno.h>
 #include <stdio.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <unistd.h>
-
 #include <string>
 #include <string>
 #include <cstring>
 #include <cstring>
 
 

+ 14 - 13
apt-pkg/contrib/error.h

@@ -46,6 +46,7 @@
 #include <list>
 #include <list>
 #include <string>
 #include <string>
 
 
+#include <stddef.h>
 #include <stdarg.h>
 #include <stdarg.h>
 
 
 class GlobalError							/*{{{*/
 class GlobalError							/*{{{*/
@@ -73,7 +74,7 @@ public:									/*{{{*/
 	 *
 	 *
 	 *  \return \b false
 	 *  \return \b false
 	 */
 	 */
-	bool FatalE(const char *Function,const char *Description,...) __like_printf(3) __cold;
+	bool FatalE(const char *Function,const char *Description,...) APT_PRINTF(3) APT_COLD;
 
 
 	/** \brief add an Error message with errno to the list
 	/** \brief add an Error message with errno to the list
 	 *
 	 *
@@ -82,7 +83,7 @@ public:									/*{{{*/
 	 *
 	 *
 	 *  \return \b false
 	 *  \return \b false
 	 */
 	 */
-	bool Errno(const char *Function,const char *Description,...) __like_printf(3) __cold;
+	bool Errno(const char *Function,const char *Description,...) APT_PRINTF(3) APT_COLD;
 
 
 	/** \brief add a warning message with errno to the list
 	/** \brief add a warning message with errno to the list
 	 *
 	 *
@@ -94,7 +95,7 @@ public:									/*{{{*/
 	 *
 	 *
 	 *  \return \b false
 	 *  \return \b false
 	 */
 	 */
-	bool WarningE(const char *Function,const char *Description,...) __like_printf(3) __cold;
+	bool WarningE(const char *Function,const char *Description,...) APT_PRINTF(3) APT_COLD;
 
 
 	/** \brief add a notice message with errno to the list
 	/** \brief add a notice message with errno to the list
 	 *
 	 *
@@ -103,7 +104,7 @@ public:									/*{{{*/
 	 *
 	 *
 	 *  \return \b false
 	 *  \return \b false
 	 */
 	 */
-	bool NoticeE(const char *Function,const char *Description,...) __like_printf(3) __cold;
+	bool NoticeE(const char *Function,const char *Description,...) APT_PRINTF(3) APT_COLD;
 
 
 	/** \brief add a debug message with errno to the list
 	/** \brief add a debug message with errno to the list
 	 *
 	 *
@@ -112,7 +113,7 @@ public:									/*{{{*/
 	 *
 	 *
 	 *  \return \b false
 	 *  \return \b false
 	 */
 	 */
-	bool DebugE(const char *Function,const char *Description,...) __like_printf(3) __cold;
+	bool DebugE(const char *Function,const char *Description,...) APT_PRINTF(3) APT_COLD;
 
 
 	/** \brief adds an errno message with the given type
 	/** \brief adds an errno message with the given type
 	 *
 	 *
@@ -121,7 +122,7 @@ public:									/*{{{*/
 	 * \param Description of the error
 	 * \param Description of the error
 	 */
 	 */
 	bool InsertErrno(MsgType const &type, const char* Function,
 	bool InsertErrno(MsgType const &type, const char* Function,
-			 const char* Description,...) __like_printf(4) __cold;
+			 const char* Description,...) APT_PRINTF(4) APT_COLD;
 
 
 	/** \brief adds an errno message with the given type
 	/** \brief adds an errno message with the given type
 	 *
 	 *
@@ -155,7 +156,7 @@ public:									/*{{{*/
 	 *
 	 *
 	 *  \return \b false
 	 *  \return \b false
 	 */
 	 */
-	bool Fatal(const char *Description,...) __like_printf(2) __cold;
+	bool Fatal(const char *Description,...) APT_PRINTF(2) APT_COLD;
 
 
 	/** \brief add an Error message to the list
 	/** \brief add an Error message to the list
 	 *
 	 *
@@ -163,7 +164,7 @@ public:									/*{{{*/
 	 *
 	 *
 	 *  \return \b false
 	 *  \return \b false
 	 */
 	 */
-	bool Error(const char *Description,...) __like_printf(2) __cold;
+	bool Error(const char *Description,...) APT_PRINTF(2) APT_COLD;
 
 
 	/** \brief add a warning message to the list
 	/** \brief add a warning message to the list
 	 *
 	 *
@@ -174,7 +175,7 @@ public:									/*{{{*/
 	 *
 	 *
 	 *  \return \b false
 	 *  \return \b false
 	 */
 	 */
-	bool Warning(const char *Description,...) __like_printf(2) __cold;
+	bool Warning(const char *Description,...) APT_PRINTF(2) APT_COLD;
 
 
 	/** \brief add a notice message to the list
 	/** \brief add a notice message to the list
 	 *
 	 *
@@ -187,7 +188,7 @@ public:									/*{{{*/
 	 *
 	 *
 	 *  \return \b false
 	 *  \return \b false
 	 */
 	 */
-	bool Notice(const char *Description,...) __like_printf(2) __cold;
+	bool Notice(const char *Description,...) APT_PRINTF(2) APT_COLD;
 
 
 	/** \brief add a debug message to the list
 	/** \brief add a debug message to the list
 	 *
 	 *
@@ -195,14 +196,14 @@ public:									/*{{{*/
 	 *
 	 *
 	 *  \return \b false
 	 *  \return \b false
 	 */
 	 */
-	bool Debug(const char *Description,...) __like_printf(2) __cold;
+	bool Debug(const char *Description,...) APT_PRINTF(2) APT_COLD;
 
 
 	/** \brief adds an error message with the given type
 	/** \brief adds an error message with the given type
 	 *
 	 *
 	 * \param type of the error message
 	 * \param type of the error message
 	 * \param Description of the error
 	 * \param Description of the error
 	 */
 	 */
-	bool Insert(MsgType const &type, const char* Description,...) __like_printf(3) __cold;
+	bool Insert(MsgType const &type, const char* Description,...) APT_PRINTF(3) APT_COLD;
 
 
 	/** \brief adds an error message with the given type
 	/** \brief adds an error message with the given type
 	 *
 	 *
@@ -218,7 +219,7 @@ public:									/*{{{*/
 	 * should call this method again in that case
 	 * should call this method again in that case
 	 */
 	 */
 	bool Insert(MsgType type, const char* Description,
 	bool Insert(MsgType type, const char* Description,
-			 va_list &args, size_t &msgSize) __cold;
+			 va_list &args, size_t &msgSize) APT_COLD;
 
 
 	/** \brief is an error in the list?
 	/** \brief is an error in the list?
 	 *
 	 *

+ 9 - 3
apt-pkg/contrib/fileutl.cc

@@ -26,16 +26,22 @@
 #include <apt-pkg/sptr.h>
 #include <apt-pkg/sptr.h>
 #include <apt-pkg/aptconfiguration.h>
 #include <apt-pkg/aptconfiguration.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/configuration.h>
-
+#include <apt-pkg/macros.h>
+
+#include <ctype.h>
+#include <stdarg.h>
+#include <stddef.h>
+#include <sys/select.h>
+#include <time.h>
+#include <string>
+#include <vector>
 #include <cstdlib>
 #include <cstdlib>
 #include <cstring>
 #include <cstring>
 #include <cstdio>
 #include <cstdio>
-
 #include <iostream>
 #include <iostream>
 #include <unistd.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <fcntl.h>
 #include <sys/stat.h>
 #include <sys/stat.h>
-#include <sys/types.h>
 #include <sys/time.h>
 #include <sys/time.h>
 #include <sys/wait.h>
 #include <sys/wait.h>
 #include <dirent.h>
 #include <dirent.h>

+ 6 - 5
apt-pkg/contrib/fileutl.h

@@ -27,6 +27,7 @@
 #include <string>
 #include <string>
 #include <vector>
 #include <vector>
 #include <set>
 #include <set>
+#include <time.h>
 
 
 #include <zlib.h>
 #include <zlib.h>
 
 
@@ -94,7 +95,7 @@ class FileFd
       And as the auto-conversation converts a 'unsigned long *' to a 'bool'
       And as the auto-conversation converts a 'unsigned long *' to a 'bool'
       instead of 'unsigned long long *' we need to provide this explicitely -
       instead of 'unsigned long long *' we need to provide this explicitely -
       otherwise applications magically start to fail… */
       otherwise applications magically start to fail… */
-   __deprecated bool Read(void *To,unsigned long long Size,unsigned long *Actual)
+   bool Read(void *To,unsigned long long Size,unsigned long *Actual) APT_DEPRECATED
    {
    {
 	unsigned long long R;
 	unsigned long long R;
 	bool const T = Read(To, Size, &R);
 	bool const T = Read(To, Size, &R);
@@ -118,7 +119,7 @@ class FileFd
    // Simple manipulators
    // Simple manipulators
    inline int Fd() {return iFd;};
    inline int Fd() {return iFd;};
    inline void Fd(int fd) { OpenDescriptor(fd, ReadWrite);};
    inline void Fd(int fd) { OpenDescriptor(fd, ReadWrite);};
-   __deprecated gzFile gzFd();
+   gzFile gzFd() APT_DEPRECATED;
 
 
    inline bool IsOpen() {return iFd >= 0;};
    inline bool IsOpen() {return iFd >= 0;};
    inline bool Failed() {return (Flags & Fail) == Fail;};
    inline bool Failed() {return (Flags & Fail) == Fail;};
@@ -152,8 +153,8 @@ class FileFd
    bool OpenInternDescriptor(unsigned int const Mode, APT::Configuration::Compressor const &compressor);
    bool OpenInternDescriptor(unsigned int const Mode, APT::Configuration::Compressor const &compressor);
 
 
    // private helpers to set Fail flag and call _error->Error
    // private helpers to set Fail flag and call _error->Error
-   bool FileFdErrno(const char* Function, const char* Description,...) __like_printf(3) __cold;
-   bool FileFdError(const char* Description,...) __like_printf(2) __cold;
+   bool FileFdErrno(const char* Function, const char* Description,...) APT_PRINTF(3) APT_COLD;
+   bool FileFdError(const char* Description,...) APT_PRINTF(2) APT_COLD;
 };
 };
 
 
 bool RunScripts(const char *Cnf);
 bool RunScripts(const char *Cnf);
@@ -161,7 +162,7 @@ bool CopyFile(FileFd &From,FileFd &To);
 int GetLock(std::string File,bool Errors = true);
 int GetLock(std::string File,bool Errors = true);
 bool FileExists(std::string File);
 bool FileExists(std::string File);
 bool RealFileExists(std::string File);
 bool RealFileExists(std::string File);
-bool DirectoryExists(std::string const &Path) __attrib_const;
+bool DirectoryExists(std::string const &Path) APT_CONST;
 bool CreateDirectory(std::string const &Parent, std::string const &Path);
 bool CreateDirectory(std::string const &Parent, std::string const &Path);
 time_t GetModificationTime(std::string const &Path);
 time_t GetModificationTime(std::string const &Path);
 
 

+ 10 - 8
apt-pkg/contrib/gpgv.cc

@@ -2,21 +2,23 @@
 // Include Files							/*{{{*/
 // Include Files							/*{{{*/
 #include<config.h>
 #include<config.h>
 
 
+#include<apt-pkg/configuration.h>
+#include<apt-pkg/error.h>
+#include<apt-pkg/strutl.h>
+#include<apt-pkg/fileutl.h>
+#include<apt-pkg/gpgv.h>
+
 #include <errno.h>
 #include <errno.h>
 #include <stdio.h>
 #include <stdio.h>
 #include <string.h>
 #include <string.h>
 #include <stdlib.h>
 #include <stdlib.h>
 #include <fcntl.h>
 #include <fcntl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
 #include <sys/wait.h>
 #include <sys/wait.h>
 #include <unistd.h>
 #include <unistd.h>
-
-#include<apt-pkg/configuration.h>
-#include<apt-pkg/error.h>
-#include<apt-pkg/strutl.h>
-#include<apt-pkg/fileutl.h>
-#include<apt-pkg/gpgv.h>
+#include <stddef.h>
+#include <iostream>
+#include <string>
+#include <vector>
 
 
 #include <apti18n.h>
 #include <apti18n.h>
 									/*}}}*/
 									/*}}}*/

+ 6 - 8
apt-pkg/contrib/gpgv.h

@@ -9,17 +9,17 @@
 #ifndef CONTRIB_GPGV_H
 #ifndef CONTRIB_GPGV_H
 #define CONTRIB_GPGV_H
 #define CONTRIB_GPGV_H
 
 
+#include <apt-pkg/macros.h>
+
 #include <string>
 #include <string>
 #include <vector>
 #include <vector>
 
 
+#ifndef APT_10_CLEANER_HEADERS
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/fileutl.h>
-
-#if __GNUC__ >= 4
-	#define APT_noreturn	__attribute__ ((noreturn))
-#else
-	#define APT_noreturn	/* no support */
 #endif
 #endif
 
 
+class FileFd;
+
 /** \brief generates and run the command to verify a file with gpgv
 /** \brief generates and run the command to verify a file with gpgv
  *
  *
  * If File and FileSig specify the same file it is assumed that we
  * If File and FileSig specify the same file it is assumed that we
@@ -40,15 +40,13 @@
  * @param FileSig is the signature (detached or clear-signed)
  * @param FileSig is the signature (detached or clear-signed)
  */
  */
 void ExecGPGV(std::string const &File, std::string const &FileSig,
 void ExecGPGV(std::string const &File, std::string const &FileSig,
-      int const &statusfd, int fd[2]) APT_noreturn;
+      int const &statusfd, int fd[2]) APT_NORETURN;
 inline void ExecGPGV(std::string const &File, std::string const &FileSig,
 inline void ExecGPGV(std::string const &File, std::string const &FileSig,
       int const &statusfd = -1) {
       int const &statusfd = -1) {
    int fd[2];
    int fd[2];
    ExecGPGV(File, FileSig, statusfd, fd);
    ExecGPGV(File, FileSig, statusfd, fd);
 }
 }
 
 
-#undef APT_noreturn
-
 /** \brief Split an inline signature into message and signature
 /** \brief Split an inline signature into message and signature
  *
  *
  *  Takes a clear-signed message and puts the first signed message
  *  Takes a clear-signed message and puts the first signed message

+ 5 - 1
apt-pkg/contrib/hashes.cc

@@ -16,8 +16,12 @@
 #include <apt-pkg/hashes.h>
 #include <apt-pkg/hashes.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/configuration.h>
-#include <apt-pkg/macros.h>
+#include <apt-pkg/md5.h>
+#include <apt-pkg/sha1.h>
+#include <apt-pkg/sha2.h>
 
 
+#include <stddef.h>
+#include <algorithm>
 #include <unistd.h>
 #include <unistd.h>
 #include <string>
 #include <string>
 #include <iostream>
 #include <iostream>

+ 9 - 4
apt-pkg/contrib/hashes.h

@@ -17,17 +17,22 @@
 #include <apt-pkg/md5.h>
 #include <apt-pkg/md5.h>
 #include <apt-pkg/sha1.h>
 #include <apt-pkg/sha1.h>
 #include <apt-pkg/sha2.h>
 #include <apt-pkg/sha2.h>
-#include <apt-pkg/fileutl.h>
 
 
-#include <algorithm>
-#include <vector>
 #include <cstring>
 #include <cstring>
-
+#include <string>
 
 
 #ifndef APT_8_CLEANER_HEADERS
 #ifndef APT_8_CLEANER_HEADERS
 using std::min;
 using std::min;
 using std::vector;
 using std::vector;
 #endif
 #endif
+#ifndef APT_10_CLEANER_HEADERS
+#include <apt-pkg/fileutl.h>
+#include <algorithm>
+#include <vector>
+#endif
+
+
+class FileFd;
 
 
 // helper class that contains hash function name
 // helper class that contains hash function name
 // and hash
 // and hash

+ 3 - 0
apt-pkg/contrib/hashsum.cc

@@ -1,6 +1,9 @@
 // Cryptographic API Base
 // Cryptographic API Base
 #include <config.h>
 #include <config.h>
 
 
+#include <apt-pkg/fileutl.h>
+
+#include <algorithm>
 #include <unistd.h>
 #include <unistd.h>
 #include "hashsum_template.h"
 #include "hashsum_template.h"
 
 

+ 7 - 3
apt-pkg/contrib/hashsum_template.h

@@ -10,20 +10,24 @@
 #ifndef APTPKG_HASHSUM_TEMPLATE_H
 #ifndef APTPKG_HASHSUM_TEMPLATE_H
 #define APTPKG_HASHSUM_TEMPLATE_H
 #define APTPKG_HASHSUM_TEMPLATE_H
 
 
-#include <apt-pkg/fileutl.h>
 
 
 #include <string>
 #include <string>
 #include <cstring>
 #include <cstring>
-#include <algorithm>
-#include <stdint.h>
 
 
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/strutl.h>
 
 
+#ifndef APT_10_CLEANER_HEADERS
+#include <apt-pkg/fileutl.h>
+#include <algorithm>
+#include <stdint.h>
+#endif
 #ifndef APT_8_CLEANER_HEADERS
 #ifndef APT_8_CLEANER_HEADERS
 using std::string;
 using std::string;
 using std::min;
 using std::min;
 #endif
 #endif
 
 
+class FileFd;
+
 template<int N>
 template<int N>
 class HashSumValue
 class HashSumValue
 {
 {

+ 4 - 4
apt-pkg/contrib/macros.h

@@ -71,13 +71,13 @@
 #endif
 #endif
 
 
 #if APT_GCC_VERSION >= 0x0300
 #if APT_GCC_VERSION >= 0x0300
-	#define APT_UNUSED	__attribute__((unused))
+	#define APT_DEPRECATED	__attribute__ ((deprecated))
 	#define APT_CONST	__attribute__((const))
 	#define APT_CONST	__attribute__((const))
 	#define APT_PURE	__attribute__((pure))
 	#define APT_PURE	__attribute__((pure))
 	#define APT_NORETURN	__attribute__((noreturn))
 	#define APT_NORETURN	__attribute__((noreturn))
 	#define APT_PRINTF(n)	__attribute__((format(printf, n, n + 1)))
 	#define APT_PRINTF(n)	__attribute__((format(printf, n, n + 1)))
 #else
 #else
-	#define APT_UNUSED
+	#define APT_DEPRECATED
 	#define APT_CONST
 	#define APT_CONST
 	#define APT_PURE
 	#define APT_PURE
 	#define APT_NORETURN
 	#define APT_NORETURN
@@ -103,8 +103,8 @@
 	#define APT_COLD	__attribute__ ((__cold__))
 	#define APT_COLD	__attribute__ ((__cold__))
 	#define APT_HOT		__attribute__ ((__hot__))
 	#define APT_HOT		__attribute__ ((__hot__))
 #else
 #else
-	#define __cold
-	#define __hot
+	#define APT_COLD
+	#define APT_HOT
 #endif
 #endif
 
 
 #ifndef APT_10_CLEANER_HEADERS
 #ifndef APT_10_CLEANER_HEADERS

+ 1 - 5
apt-pkg/contrib/md5.cc

@@ -38,13 +38,9 @@
 #include <config.h>
 #include <config.h>
 
 
 #include <apt-pkg/md5.h>
 #include <apt-pkg/md5.h>
-#include <apt-pkg/strutl.h>
-#include <apt-pkg/macros.h>
 
 
+#include <stdint.h>
 #include <string.h>
 #include <string.h>
-#include <unistd.h>
-#include <netinet/in.h>                          // For htonl
-#include <inttypes.h>
 									/*}}}*/
 									/*}}}*/
 
 
 // byteSwap - Swap bytes in a buffer					/*{{{*/
 // byteSwap - Swap bytes in a buffer					/*{{{*/

+ 5 - 4
apt-pkg/contrib/md5.h

@@ -23,14 +23,15 @@
 #ifndef APTPKG_MD5_H
 #ifndef APTPKG_MD5_H
 #define APTPKG_MD5_H
 #define APTPKG_MD5_H
 
 
-
-#include <string>
-#include <cstring>
-#include <algorithm>
 #include <stdint.h>
 #include <stdint.h>
 
 
 #include "hashsum_template.h"
 #include "hashsum_template.h"
 
 
+#ifndef APT_10_CLEANER_HEADERS
+#include <string>
+#include <cstring>
+#include <algorithm>
+#endif
 #ifndef APT_8_CLEANER_HEADERS
 #ifndef APT_8_CLEANER_HEADERS
 using std::string;
 using std::string;
 using std::min;
 using std::min;

+ 2 - 2
apt-pkg/contrib/mmap.cc

@@ -22,11 +22,11 @@
 #include <apt-pkg/mmap.h>
 #include <apt-pkg/mmap.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/fileutl.h>
+#include <apt-pkg/macros.h>
 
 
+#include <string>
 #include <sys/mman.h>
 #include <sys/mman.h>
-#include <sys/stat.h>
 #include <unistd.h>
 #include <unistd.h>
-#include <fcntl.h>
 #include <stdlib.h>
 #include <stdlib.h>
 #include <errno.h>
 #include <errno.h>
 #include <cstring>
 #include <cstring>

+ 1 - 2
apt-pkg/contrib/netrc.cc

@@ -15,14 +15,13 @@
 
 
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/strutl.h>
-#include <apt-pkg/error.h>
-#include <apt-pkg/fileutl.h>
 
 
 #include <iostream>
 #include <iostream>
 #include <stdio.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdlib.h>
 #include <string.h>
 #include <string.h>
 #include <unistd.h>
 #include <unistd.h>
+#include <stddef.h>
 #include <pwd.h>
 #include <pwd.h>
 
 
 #include "netrc.h"
 #include "netrc.h"

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

@@ -16,6 +16,8 @@
 
 
 #include <string>
 #include <string>
 
 
+#include <apt-pkg/macros.h>
+
 #ifndef APT_8_CLEANER_HEADERS
 #ifndef APT_8_CLEANER_HEADERS
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/strutl.h>
 #endif
 #endif
@@ -25,9 +27,9 @@
 
 
 class URI;
 class URI;
 
 
-// kill this export on the next ABI break - strongly doubt its in use anyway
+// FIXME: kill this export on the next ABI break - strongly doubt its in use anyway
 // outside of the apt itself, its really a internal interface
 // outside of the apt itself, its really a internal interface
-__deprecated int parsenetrc (char *host, char *login, char *password, char *filename);
+APT_DEPRECATED int parsenetrc (char *host, char *login, char *password, char *filename);
 
 
 void maybe_add_auth (URI &Uri, std::string NetRCFile);
 void maybe_add_auth (URI &Uri, std::string NetRCFile);
 #endif
 #endif

+ 2 - 0
apt-pkg/contrib/progress.cc

@@ -14,6 +14,8 @@
 #include <apt-pkg/error.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/configuration.h>
 
 
+#include <sys/time.h>
+#include <string>
 #include <iostream>
 #include <iostream>
 #include <stdio.h>
 #include <stdio.h>
 #include <cstring>
 #include <cstring>

+ 1 - 4
apt-pkg/contrib/sha1.cc

@@ -32,12 +32,9 @@
 #include <config.h>
 #include <config.h>
 
 
 #include <apt-pkg/sha1.h>
 #include <apt-pkg/sha1.h>
-#include <apt-pkg/strutl.h>
-#include <apt-pkg/macros.h>
 
 
+#include <stdint.h>
 #include <string.h>
 #include <string.h>
-#include <unistd.h>
-#include <inttypes.h>
 									/*}}}*/
 									/*}}}*/
 
 
 // SHA1Transform - Alters an existing SHA-1 hash			/*{{{*/
 // SHA1Transform - Alters an existing SHA-1 hash			/*{{{*/

+ 4 - 3
apt-pkg/contrib/sha1.h

@@ -14,12 +14,13 @@
 #ifndef APTPKG_SHA1_H
 #ifndef APTPKG_SHA1_H
 #define APTPKG_SHA1_H
 #define APTPKG_SHA1_H
 
 
+#include "hashsum_template.h"
+
+#ifndef APT_10_CLEANER_HEADERS
 #include <string>
 #include <string>
 #include <cstring>
 #include <cstring>
 #include <algorithm>
 #include <algorithm>
-
-#include "hashsum_template.h"
-
+#endif
 #ifndef APT_8_CLEANER_HEADERS
 #ifndef APT_8_CLEANER_HEADERS
 using std::string;
 using std::string;
 using std::min;
 using std::min;

+ 7 - 3
apt-pkg/contrib/sha2.h

@@ -14,14 +14,18 @@
 #ifndef APTPKG_SHA2_H
 #ifndef APTPKG_SHA2_H
 #define APTPKG_SHA2_H
 #define APTPKG_SHA2_H
 
 
-#include <string>
 #include <cstring>
 #include <cstring>
-#include <algorithm>
-#include <stdint.h>
 
 
 #include "sha2_internal.h"
 #include "sha2_internal.h"
 #include "hashsum_template.h"
 #include "hashsum_template.h"
 
 
+#ifndef APT_10_CLEANER_HEADERS
+#include <string>
+#include <algorithm>
+#include <stdint.h>
+#endif
+
+
 typedef HashSumValue<512> SHA512SumValue;
 typedef HashSumValue<512> SHA512SumValue;
 typedef HashSumValue<256> SHA256SumValue;
 typedef HashSumValue<256> SHA256SumValue;
 
 

+ 1 - 0
apt-pkg/contrib/sha2_internal.cc

@@ -33,6 +33,7 @@
  */
  */
 #include <config.h>
 #include <config.h>
 
 
+#include <endian.h>
 #include <string.h>	/* memcpy()/memset() or bcopy()/bzero() */
 #include <string.h>	/* memcpy()/memset() or bcopy()/bzero() */
 #include <assert.h>	/* assert() */
 #include <assert.h>	/* assert() */
 #include "sha2_internal.h"
 #include "sha2_internal.h"

+ 1 - 0
apt-pkg/contrib/sha2_internal.h

@@ -44,6 +44,7 @@
 
 
 #ifdef SHA2_USE_INTTYPES_H
 #ifdef SHA2_USE_INTTYPES_H
 
 
+#include <stddef.h>
 #include <inttypes.h>
 #include <inttypes.h>
 
 
 #endif /* SHA2_USE_INTTYPES_H */
 #endif /* SHA2_USE_INTTYPES_H */

+ 7 - 2
apt-pkg/contrib/strutl.cc

@@ -21,6 +21,11 @@
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/error.h>
 
 
+#include <stddef.h>
+#include <stdlib.h>
+#include <time.h>
+#include <string>
+#include <vector>
 #include <ctype.h>
 #include <ctype.h>
 #include <string.h>
 #include <string.h>
 #include <sstream>
 #include <sstream>
@@ -33,9 +38,9 @@
 #include <iconv.h>
 #include <iconv.h>
 
 
 #include <apti18n.h>
 #include <apti18n.h>
-
-using namespace std;
 									/*}}}*/
 									/*}}}*/
+using namespace std;
+
 // Strip - Remove white space from the front and back of a string       /*{{{*/
 // Strip - Remove white space from the front and back of a string       /*{{{*/
 // ---------------------------------------------------------------------
 // ---------------------------------------------------------------------
 namespace APT {
 namespace APT {

+ 13 - 10
apt-pkg/contrib/strutl.h

@@ -18,15 +18,18 @@
 
 
 
 
 #include <limits>
 #include <limits>
-#include <stdlib.h>
 #include <string>
 #include <string>
 #include <cstring>
 #include <cstring>
 #include <vector>
 #include <vector>
 #include <iostream>
 #include <iostream>
 #include <time.h>
 #include <time.h>
+#include <stddef.h>
 
 
 #include "macros.h"
 #include "macros.h"
 
 
+#ifndef APT_10_CLEANER_HEADERS
+#include <stdlib.h>
+#endif
 #ifndef APT_8_CLEANER_HEADERS
 #ifndef APT_8_CLEANER_HEADERS
 using std::string;
 using std::string;
 using std::vector;
 using std::vector;
@@ -60,9 +63,9 @@ std::string Base64Encode(const std::string &Str);
 std::string OutputInDepth(const unsigned long Depth, const char* Separator="  ");
 std::string OutputInDepth(const unsigned long Depth, const char* Separator="  ");
 std::string URItoFileName(const std::string &URI);
 std::string URItoFileName(const std::string &URI);
 std::string TimeRFC1123(time_t Date);
 std::string TimeRFC1123(time_t Date);
-bool RFC1123StrToTime(const char* const str,time_t &time) __must_check;
-bool FTPMDTMStrToTime(const char* const str,time_t &time) __must_check;
-__deprecated bool StrToTime(const std::string &Val,time_t &Result);
+bool RFC1123StrToTime(const char* const str,time_t &time) APT_MUSTCHECK;
+bool FTPMDTMStrToTime(const char* const str,time_t &time) APT_MUSTCHECK;
+APT_DEPRECATED bool StrToTime(const std::string &Val,time_t &Result);
 std::string LookupTag(const std::string &Message,const char *Tag,const char *Default = 0);
 std::string LookupTag(const std::string &Message,const char *Tag,const char *Default = 0);
 int StringToBool(const std::string &Text,int Default = -1);
 int StringToBool(const std::string &Text,int Default = -1);
 bool ReadMessages(int Fd, std::vector<std::string> &List);
 bool ReadMessages(int Fd, std::vector<std::string> &List);
@@ -76,7 +79,7 @@ bool TokSplitString(char Tok,char *Input,char **List,
 		    unsigned long ListMax);
 		    unsigned long ListMax);
 
 
 // split a given string by a char
 // split a given string by a char
-std::vector<std::string> VectorizeString(std::string const &haystack, char const &split) __attrib_const;
+std::vector<std::string> VectorizeString(std::string const &haystack, char const &split) APT_CONST;
 
 
 /* \brief Return a vector of strings from string "input" where "sep"
 /* \brief Return a vector of strings from string "input" where "sep"
  * is used as the delimiter string.
  * is used as the delimiter string.
@@ -94,13 +97,13 @@ std::vector<std::string> VectorizeString(std::string const &haystack, char const
  */
  */
 std::vector<std::string> StringSplit(std::string const &input, 
 std::vector<std::string> StringSplit(std::string const &input, 
                                      std::string const &sep, 
                                      std::string const &sep, 
-                                     unsigned int maxsplit=std::numeric_limits<unsigned int>::max()) __attrib_const;
+                                     unsigned int maxsplit=std::numeric_limits<unsigned int>::max()) APT_CONST;
 
 
-void ioprintf(std::ostream &out,const char *format,...) __like_printf(2);
-void strprintf(std::string &out,const char *format,...) __like_printf(2);
-char *safe_snprintf(char *Buffer,char *End,const char *Format,...) __like_printf(3);
+void ioprintf(std::ostream &out,const char *format,...) APT_PRINTF(2);
+void strprintf(std::string &out,const char *format,...) APT_PRINTF(2);
+char *safe_snprintf(char *Buffer,char *End,const char *Format,...) APT_PRINTF(3);
 bool CheckDomainList(const std::string &Host, const std::string &List);
 bool CheckDomainList(const std::string &Host, const std::string &List);
-int tolower_ascii(int const c) __attrib_const __hot;
+int tolower_ascii(int const c) APT_CONST APT_HOT;
 std::string StripEpoch(const std::string &VerStr);
 std::string StripEpoch(const std::string &VerStr);
 
 
 #define APT_MKSTRCMP(name,func) \
 #define APT_MKSTRCMP(name,func) \

+ 12 - 2
apt-pkg/deb/debindexfile.cc

@@ -15,7 +15,6 @@
 #include <apt-pkg/debsrcrecords.h>
 #include <apt-pkg/debsrcrecords.h>
 #include <apt-pkg/deblistparser.h>
 #include <apt-pkg/deblistparser.h>
 #include <apt-pkg/debrecords.h>
 #include <apt-pkg/debrecords.h>
-#include <apt-pkg/sourcelist.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/progress.h>
 #include <apt-pkg/progress.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/error.h>
@@ -23,7 +22,18 @@
 #include <apt-pkg/acquire-item.h>
 #include <apt-pkg/acquire-item.h>
 #include <apt-pkg/debmetaindex.h>
 #include <apt-pkg/debmetaindex.h>
 #include <apt-pkg/gpgv.h>
 #include <apt-pkg/gpgv.h>
-
+#include <apt-pkg/fileutl.h>
+#include <apt-pkg/indexfile.h>
+#include <apt-pkg/mmap.h>
+#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
+#include <apt-pkg/pkgcachegen.h>
+#include <apt-pkg/pkgrecords.h>
+#include <apt-pkg/srcrecords.h>
+
+#include <stdio.h>
+#include <iostream>
+#include <string>
 #include <sys/stat.h>
 #include <sys/stat.h>
 									/*}}}*/
 									/*}}}*/
 
 

+ 9 - 1
apt-pkg/deb/debindexfile.h

@@ -16,9 +16,17 @@
 #ifndef PKGLIB_DEBINDEXFILE_H
 #ifndef PKGLIB_DEBINDEXFILE_H
 #define PKGLIB_DEBINDEXFILE_H
 #define PKGLIB_DEBINDEXFILE_H
 
 
+#include <apt-pkg/indexfile.h>
+#include <apt-pkg/cacheiterators.h>
+#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/srcrecords.h>
 
 
+#include <string>
+
+class OpProgress;
+class pkgAcquire;
+class pkgCacheGenerator;
 
 
-#include <apt-pkg/indexfile.h>
 
 
 class debStatusIndex : public pkgIndexFile
 class debStatusIndex : public pkgIndexFile
 {
 {

+ 9 - 0
apt-pkg/deb/deblistparser.cc

@@ -21,8 +21,17 @@
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/crc-16.h>
 #include <apt-pkg/crc-16.h>
 #include <apt-pkg/md5.h>
 #include <apt-pkg/md5.h>
+#include <apt-pkg/mmap.h>
+#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
+#include <apt-pkg/tagfile.h>
 #include <apt-pkg/macros.h>
 #include <apt-pkg/macros.h>
 
 
+#include <stddef.h>
+#include <string.h>
+#include <algorithm>
+#include <string>
+#include <vector>
 #include <ctype.h>
 #include <ctype.h>
 									/*}}}*/
 									/*}}}*/
 
 

+ 7 - 0
apt-pkg/deb/deblistparser.h

@@ -13,11 +13,18 @@
 
 
 #include <apt-pkg/pkgcachegen.h>
 #include <apt-pkg/pkgcachegen.h>
 #include <apt-pkg/tagfile.h>
 #include <apt-pkg/tagfile.h>
+#include <apt-pkg/md5.h>
+#include <apt-pkg/pkgcache.h>
+
+#include <string>
+#include <vector>
 
 
 #ifndef APT_8_CLEANER_HEADERS
 #ifndef APT_8_CLEANER_HEADERS
 #include <apt-pkg/indexfile.h>
 #include <apt-pkg/indexfile.h>
 #endif
 #endif
 
 
+class FileFd;
+
 class debListParser : public pkgCacheGenerator::ListParser
 class debListParser : public pkgCacheGenerator::ListParser
 {
 {
    public:
    public:

+ 9 - 2
apt-pkg/deb/debmetaindex.cc

@@ -9,8 +9,15 @@
 #include <apt-pkg/aptconfiguration.h>
 #include <apt-pkg/aptconfiguration.h>
 #include <apt-pkg/indexrecords.h>
 #include <apt-pkg/indexrecords.h>
 #include <apt-pkg/sourcelist.h>
 #include <apt-pkg/sourcelist.h>
-#include <apt-pkg/error.h>
-
+#include <apt-pkg/hashes.h>
+#include <apt-pkg/macros.h>
+#include <apt-pkg/metaindex.h>
+
+#include <string.h>
+#include <map>
+#include <string>
+#include <utility>
+#include <vector>
 #include <set>
 #include <set>
 #include <algorithm>
 #include <algorithm>
 
 

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

@@ -3,7 +3,7 @@
 #define PKGLIB_DEBMETAINDEX_H
 #define PKGLIB_DEBMETAINDEX_H
 
 
 #include <apt-pkg/metaindex.h>
 #include <apt-pkg/metaindex.h>
-#include <apt-pkg/init.h>
+#include <apt-pkg/macros.h>
 
 
 #include <map>
 #include <map>
 #include <string>
 #include <string>
@@ -12,6 +12,12 @@
 #ifndef APT_8_CLEANER_HEADERS
 #ifndef APT_8_CLEANER_HEADERS
 #include <apt-pkg/sourcelist.h>
 #include <apt-pkg/sourcelist.h>
 #endif
 #endif
+#ifndef APT_10_CLEANER_HEADERS
+#include <apt-pkg/init.h>
+#endif
+
+class pkgAcquire;
+class pkgIndexFile;
 
 
 class debReleaseIndex : public metaIndex {
 class debReleaseIndex : public metaIndex {
    public:
    public:

+ 7 - 1
apt-pkg/deb/debrecords.cc

@@ -12,10 +12,16 @@
 
 
 #include <apt-pkg/debrecords.h>
 #include <apt-pkg/debrecords.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/strutl.h>
-#include <apt-pkg/error.h>
 #include <apt-pkg/aptconfiguration.h>
 #include <apt-pkg/aptconfiguration.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/fileutl.h>
+#include <apt-pkg/cacheiterators.h>
+#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/tagfile.h>
 
 
+#include <string.h>
+#include <algorithm>
+#include <string>
+#include <vector>
 #include <langinfo.h>
 #include <langinfo.h>
 									/*}}}*/
 									/*}}}*/
 
 

+ 3 - 0
apt-pkg/deb/debrecords.h

@@ -17,6 +17,9 @@
 #include <apt-pkg/pkgrecords.h>
 #include <apt-pkg/pkgrecords.h>
 #include <apt-pkg/tagfile.h>
 #include <apt-pkg/tagfile.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/fileutl.h>
+#include <apt-pkg/pkgcache.h>
+
+#include <string>
 
 
 #ifndef APT_8_CLEANER_HEADERS
 #ifndef APT_8_CLEANER_HEADERS
 #include <apt-pkg/indexfile.h>
 #include <apt-pkg/indexfile.h>

+ 9 - 2
apt-pkg/deb/debsrcrecords.cc

@@ -15,12 +15,19 @@
 #include <apt-pkg/debsrcrecords.h>
 #include <apt-pkg/debsrcrecords.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/strutl.h>
-#include <apt-pkg/configuration.h>
 #include <apt-pkg/aptconfiguration.h>
 #include <apt-pkg/aptconfiguration.h>
+#include <apt-pkg/srcrecords.h>
+#include <apt-pkg/tagfile.h>
 
 
-using std::max;
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+#include <algorithm>
+#include <string>
+#include <vector>
 									/*}}}*/
 									/*}}}*/
 
 
+using std::max;
 using std::string;
 using std::string;
 
 
 // SrcRecordParser::Binaries - Return the binaries field		/*{{{*/
 // SrcRecordParser::Binaries - Return the binaries field		/*{{{*/

+ 6 - 1
apt-pkg/deb/debsrcrecords.h

@@ -11,11 +11,16 @@
 #ifndef PKGLIB_DEBSRCRECORDS_H
 #ifndef PKGLIB_DEBSRCRECORDS_H
 #define PKGLIB_DEBSRCRECORDS_H
 #define PKGLIB_DEBSRCRECORDS_H
 
 
-
 #include <apt-pkg/srcrecords.h>
 #include <apt-pkg/srcrecords.h>
 #include <apt-pkg/tagfile.h>
 #include <apt-pkg/tagfile.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/fileutl.h>
 
 
+#include <stddef.h>
+#include <string>
+#include <vector>
+
+class pkgIndexFile;
+
 class debSrcRecordParser : public pkgSrcRecords::Parser
 class debSrcRecordParser : public pkgSrcRecords::Parser
 {
 {
    /** \brief dpointer placeholder (for later in case we need it) */
    /** \brief dpointer placeholder (for later in case we need it) */

+ 8 - 1
apt-pkg/deb/debsystem.cc

@@ -19,7 +19,14 @@
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/fileutl.h>
-#include <sys/types.h>
+#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
+
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+#include <string>
+#include <vector>
 #include <unistd.h>
 #include <unistd.h>
 #include <dirent.h>
 #include <dirent.h>
 #include <errno.h>
 #include <errno.h>

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

@@ -12,11 +12,19 @@
 
 
 #include <apt-pkg/pkgsystem.h>
 #include <apt-pkg/pkgsystem.h>
 #include <apt-pkg/pkgcache.h>
 #include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
 
 
+#include <vector>
+class Configuration;
+class pkgIndexFile;
+class pkgPackageManager;
 class debSystemPrivate;
 class debSystemPrivate;
-class debStatusIndex;
 class pkgDepCache;
 class pkgDepCache;
 
 
+#ifndef APT_10_CLEANER_HEADERS
+class debStatusIndex;
+#endif
+
 class debSystem : public pkgSystem
 class debSystem : public pkgSystem
 {
 {
    // private d-pointer
    // private d-pointer

+ 2 - 0
apt-pkg/deb/debversion.cc

@@ -15,6 +15,8 @@
 #include <apt-pkg/debversion.h>
 #include <apt-pkg/debversion.h>
 #include <apt-pkg/pkgcache.h>
 #include <apt-pkg/pkgcache.h>
 
 
+#include <string.h>
+#include <string>
 #include <stdlib.h>
 #include <stdlib.h>
 #include <ctype.h>
 #include <ctype.h>
 									/*}}}*/
 									/*}}}*/

+ 3 - 3
apt-pkg/deb/debversion.h

@@ -12,12 +12,12 @@
 #ifndef PKGLIB_DEBVERSION_H
 #ifndef PKGLIB_DEBVERSION_H
 #define PKGLIB_DEBVERSION_H
 #define PKGLIB_DEBVERSION_H
 
 
+#include <apt-pkg/version.h>
 
 
+#include <string>
 
 
-#include <apt-pkg/version.h>
-    
 class debVersioningSystem : public pkgVersioningSystem
 class debVersioningSystem : public pkgVersioningSystem
-{     
+{
    public:
    public:
    
    
    static int CmpFragment(const char *A, const char *AEnd, const char *B,
    static int CmpFragment(const char *A, const char *AEnd, const char *B,

+ 28 - 24
apt-pkg/deb/dpkgpm.cc

@@ -10,41 +10,45 @@
 // Includes								/*{{{*/
 // Includes								/*{{{*/
 #include <config.h>
 #include <config.h>
 
 
-#include <apt-pkg/dpkgpm.h>
-#include <apt-pkg/error.h>
+#include <apt-pkg/cachefile.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/depcache.h>
 #include <apt-pkg/depcache.h>
-#include <apt-pkg/pkgrecords.h>
-#include <apt-pkg/strutl.h>
+#include <apt-pkg/dpkgpm.h>
+#include <apt-pkg/error.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/fileutl.h>
-#include <apt-pkg/cachefile.h>
-#include <apt-pkg/packagemanager.h>
 #include <apt-pkg/install-progress.h>
 #include <apt-pkg/install-progress.h>
+#include <apt-pkg/packagemanager.h>
+#include <apt-pkg/pkgrecords.h>
+#include <apt-pkg/strutl.h>
+#include <apt-pkg/cacheiterators.h>
+#include <apt-pkg/macros.h>
+#include <apt-pkg/pkgcache.h>
 
 
-#include <unistd.h>
-#include <stdlib.h>
+#include <errno.h>
 #include <fcntl.h>
 #include <fcntl.h>
+#include <grp.h>
+#include <pty.h>
+#include <pwd.h>
+#include <signal.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/ioctl.h>
 #include <sys/select.h>
 #include <sys/select.h>
 #include <sys/stat.h>
 #include <sys/stat.h>
-#include <sys/types.h>
+#include <sys/time.h>
 #include <sys/wait.h>
 #include <sys/wait.h>
-#include <signal.h>
-#include <errno.h>
-#include <string.h>
-#include <stdio.h>
-#include <string.h>
-#include <algorithm>
-#include <sstream>
-#include <map>
-#include <pwd.h>
-#include <grp.h>
-#include <iomanip>
-
 #include <termios.h>
 #include <termios.h>
+#include <time.h>
 #include <unistd.h>
 #include <unistd.h>
-#include <sys/ioctl.h>
-#include <pty.h>
-#include <stdio.h>
+#include <algorithm>
+#include <cstring>
+#include <iostream>
+#include <map>
+#include <set>
+#include <string>
+#include <utility>
+#include <vector>
 
 
 #include <apti18n.h>
 #include <apti18n.h>
 									/*}}}*/
 									/*}}}*/

+ 11 - 2
apt-pkg/deb/dpkgpm.h

@@ -11,11 +11,20 @@
 #define PKGLIB_DPKGPM_H
 #define PKGLIB_DPKGPM_H
 
 
 #include <apt-pkg/packagemanager.h>
 #include <apt-pkg/packagemanager.h>
+#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/macros.h>
+
 #include <vector>
 #include <vector>
 #include <map>
 #include <map>
 #include <stdio.h>
 #include <stdio.h>
-#include <apt-pkg/macros.h>
+#include <string>
+
+#ifndef APT_10_CLEANER_HEADERS
 #include <apt-pkg/init.h>
 #include <apt-pkg/init.h>
+#endif
+
+class pkgDepCache;
+namespace APT { namespace Progress { class PackageManager; } }
 
 
 #ifndef APT_8_CLEANER_HEADERS
 #ifndef APT_8_CLEANER_HEADERS
 using std::vector;
 using std::vector;
@@ -82,7 +91,7 @@ class pkgDPkgPM : public pkgPackageManager
 
 
    // Helpers
    // Helpers
    bool RunScriptsWithPkgs(const char *Cnf);
    bool RunScriptsWithPkgs(const char *Cnf);
-   __deprecated bool SendV2Pkgs(FILE *F);
+   APT_DEPRECATED bool SendV2Pkgs(FILE *F);
    bool SendPkgsInfo(FILE * const F, unsigned int const &Version);
    bool SendPkgsInfo(FILE * const F, unsigned int const &Version);
    void WriteHistoryTag(std::string const &tag, std::string value);
    void WriteHistoryTag(std::string const &tag, std::string value);
    std::string ExpandShortPackageName(pkgDepCache &Cache,
    std::string ExpandShortPackageName(pkgDepCache &Cache,

+ 10 - 4
apt-pkg/depcache.cc

@@ -11,20 +11,26 @@
 #include<config.h>
 #include<config.h>
 
 
 #include <apt-pkg/depcache.h>
 #include <apt-pkg/depcache.h>
-#include <apt-pkg/version.h>
 #include <apt-pkg/versionmatch.h>
 #include <apt-pkg/versionmatch.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/sptr.h>
 #include <apt-pkg/sptr.h>
-#include <apt-pkg/algorithms.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/aptconfiguration.h>
 #include <apt-pkg/aptconfiguration.h>
-#include <apt-pkg/pkgsystem.h>
 #include <apt-pkg/tagfile.h>
 #include <apt-pkg/tagfile.h>
 #include <apt-pkg/progress.h>
 #include <apt-pkg/progress.h>
 #include <apt-pkg/cacheset.h>
 #include <apt-pkg/cacheset.h>
-
+#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
+#include <apt-pkg/macros.h>
+
+#include <stdio.h>
+#include <string.h>
+#include <list>
+#include <string>
+#include <utility>
+#include <vector>
 #include <algorithm>
 #include <algorithm>
 #include <iostream>
 #include <iostream>
 #include <sstream>
 #include <sstream>

+ 10 - 2
apt-pkg/depcache.h

@@ -40,18 +40,26 @@
 
 
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/pkgcache.h>
 #include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
+
+#include <stddef.h>
 
 
-#include <vector>
 #include <memory>
 #include <memory>
-#include <set>
 #include <list>
 #include <list>
+#include <string>
+#include <utility>
 
 
 #ifndef APT_8_CLEANER_HEADERS
 #ifndef APT_8_CLEANER_HEADERS
 #include <apt-pkg/progress.h>
 #include <apt-pkg/progress.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/error.h>
 #endif
 #endif
+#ifndef APT_10_CLEANER_HEADERS
+#include <set>
+#include <vector>
+#endif
 
 
 class OpProgress;
 class OpProgress;
+class pkgVersioningSystem;
 
 
 class pkgDepCache : protected pkgCache::Namespace
 class pkgDepCache : protected pkgCache::Namespace
 {
 {

+ 13 - 4
apt-pkg/edsp.cc

@@ -11,16 +11,25 @@
 #include <apt-pkg/error.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/cacheset.h>
 #include <apt-pkg/cacheset.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/configuration.h>
-#include <apt-pkg/version.h>
-#include <apt-pkg/policy.h>
 #include <apt-pkg/tagfile.h>
 #include <apt-pkg/tagfile.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/progress.h>
 #include <apt-pkg/progress.h>
+#include <apt-pkg/depcache.h>
+#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
+#include <apt-pkg/strutl.h>
 
 
-#include <limits>
+#include <ctype.h>
+#include <stddef.h>
+#include <string.h>
+#include <time.h>
+#include <unistd.h>
 #include <stdio.h>
 #include <stdio.h>
-
+#include <iostream>
+#include <vector>
+#include <limits>
 #include <string>
 #include <string>
+#include <list>
 
 
 #include <apti18n.h>
 #include <apti18n.h>
 									/*}}}*/
 									/*}}}*/

+ 4 - 1
apt-pkg/edsp.h

@@ -9,8 +9,11 @@
 #ifndef PKGLIB_EDSP_H
 #ifndef PKGLIB_EDSP_H
 #define PKGLIB_EDSP_H
 #define PKGLIB_EDSP_H
 
 
-#include <apt-pkg/pkgcache.h>
 #include <apt-pkg/cacheset.h>
 #include <apt-pkg/cacheset.h>
+#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
+
+#include <stdio.h>
 
 
 #include <list>
 #include <list>
 #include <string>
 #include <string>

+ 11 - 6
apt-pkg/edsp/edspindexfile.cc

@@ -10,15 +10,20 @@
 
 
 #include <apt-pkg/edspindexfile.h>
 #include <apt-pkg/edspindexfile.h>
 #include <apt-pkg/edsplistparser.h>
 #include <apt-pkg/edsplistparser.h>
-#include <apt-pkg/sourcelist.h>
-#include <apt-pkg/configuration.h>
-#include <apt-pkg/progress.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/error.h>
-#include <apt-pkg/strutl.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/fileutl.h>
-#include <apt-pkg/acquire-item.h>
+#include <apt-pkg/progress.h>
+#include <apt-pkg/debindexfile.h>
+#include <apt-pkg/indexfile.h>
+#include <apt-pkg/mmap.h>
+#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
+#include <apt-pkg/pkgcachegen.h>
+#include <apt-pkg/pkgrecords.h>
 
 
-#include <sys/stat.h>
+#include <stddef.h>
+#include <unistd.h>
+#include <string>
 									/*}}}*/
 									/*}}}*/
 
 
 // edspIndex::edspIndex - Constructor					/*{{{*/
 // edspIndex::edspIndex - Constructor					/*{{{*/

+ 4 - 0
apt-pkg/edsp/edspindexfile.h

@@ -9,11 +9,15 @@
 #define PKGLIB_EDSPINDEXFILE_H
 #define PKGLIB_EDSPINDEXFILE_H
 
 
 #include <apt-pkg/debindexfile.h>
 #include <apt-pkg/debindexfile.h>
+#include <string>
 
 
 #ifndef APT_8_CLEANER_HEADERS
 #ifndef APT_8_CLEANER_HEADERS
 #include <apt-pkg/indexfile.h>
 #include <apt-pkg/indexfile.h>
 #endif
 #endif
 
 
+class OpProgress;
+class pkgCacheGenerator;
+
 class edspIndex : public debStatusIndex
 class edspIndex : public debStatusIndex
 {
 {
    /** \brief dpointer placeholder (for later in case we need it) */
    /** \brief dpointer placeholder (for later in case we need it) */

+ 6 - 4
apt-pkg/edsp/edsplistparser.cc

@@ -12,11 +12,13 @@
 #include <config.h>
 #include <config.h>
 
 
 #include <apt-pkg/edsplistparser.h>
 #include <apt-pkg/edsplistparser.h>
-#include <apt-pkg/error.h>
-#include <apt-pkg/configuration.h>
-#include <apt-pkg/strutl.h>
 #include <apt-pkg/md5.h>
 #include <apt-pkg/md5.h>
-#include <apt-pkg/macros.h>
+#include <apt-pkg/deblistparser.h>
+#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
+#include <apt-pkg/tagfile.h>
+
+#include <string>
 									/*}}}*/
 									/*}}}*/
 
 
 // ListParser::edspListParser - Constructor				/*{{{*/
 // ListParser::edspListParser - Constructor				/*{{{*/

+ 4 - 0
apt-pkg/edsp/edsplistparser.h

@@ -12,6 +12,10 @@
 #define PKGLIB_EDSPLISTPARSER_H
 #define PKGLIB_EDSPLISTPARSER_H
 
 
 #include <apt-pkg/deblistparser.h>
 #include <apt-pkg/deblistparser.h>
+#include <apt-pkg/md5.h>
+#include <apt-pkg/pkgcache.h>
+
+#include <string>
 
 
 #ifndef APT_8_CLEANER_HEADERS
 #ifndef APT_8_CLEANER_HEADERS
 #include <apt-pkg/pkgcachegen.h>
 #include <apt-pkg/pkgcachegen.h>

+ 8 - 7
apt-pkg/edsp/edspsystem.cc

@@ -11,16 +11,17 @@
 // Include Files							/*{{{*/
 // Include Files							/*{{{*/
 #include <config.h>
 #include <config.h>
 
 
-#include <apt-pkg/edspsystem.h>
+#include <apt-pkg/configuration.h>
 #include <apt-pkg/debversion.h>
 #include <apt-pkg/debversion.h>
 #include <apt-pkg/edspindexfile.h>
 #include <apt-pkg/edspindexfile.h>
-#include <apt-pkg/configuration.h>
-#include <apt-pkg/error.h>
+#include <apt-pkg/edspsystem.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/fileutl.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <dirent.h>
-#include <errno.h>
+#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
+
+#include <stddef.h>
+#include <string>
+#include <vector>
 
 
 #include <apti18n.h>
 #include <apti18n.h>
 									/*}}}*/
 									/*}}}*/

+ 9 - 0
apt-pkg/edsp/edspsystem.h

@@ -11,8 +11,17 @@
 #define PKGLIB_EDSPSYSTEM_H
 #define PKGLIB_EDSPSYSTEM_H
 
 
 #include <apt-pkg/pkgsystem.h>
 #include <apt-pkg/pkgsystem.h>
+#include <apt-pkg/cacheiterators.h>
+#include <apt-pkg/pkgcache.h>
 
 
+#include <vector>
+
+class Configuration;
+class pkgDepCache;
+class pkgIndexFile;
+class pkgPackageManager;
 class edspIndex;
 class edspIndex;
+
 class edspSystem : public pkgSystem
 class edspSystem : public pkgSystem
 {
 {
    /** \brief dpointer placeholder (for later in case we need it) */
    /** \brief dpointer placeholder (for later in case we need it) */

+ 3 - 3
apt-pkg/indexcopy.cc

@@ -20,17 +20,17 @@
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/tagfile.h>
 #include <apt-pkg/tagfile.h>
 #include <apt-pkg/indexrecords.h>
 #include <apt-pkg/indexrecords.h>
-#include <apt-pkg/md5.h>
 #include <apt-pkg/cdrom.h>
 #include <apt-pkg/cdrom.h>
+#include <apt-pkg/gpgv.h>
+#include <apt-pkg/hashes.h>
 
 
 #include <iostream>
 #include <iostream>
 #include <sstream>
 #include <sstream>
 #include <unistd.h>
 #include <unistd.h>
 #include <sys/stat.h>
 #include <sys/stat.h>
-#include <sys/types.h>
-#include <fcntl.h>
 #include <stdio.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdlib.h>
+#include <string.h>
 
 
 #include "indexcopy.h"
 #include "indexcopy.h"
 #include <apti18n.h>
 #include <apti18n.h>

+ 6 - 4
apt-pkg/indexcopy.h

@@ -14,16 +14,18 @@
 #include <string>
 #include <string>
 #include <stdio.h>
 #include <stdio.h>
 
 
-#include <apt-pkg/gpgv.h>
 #include <apt-pkg/macros.h>
 #include <apt-pkg/macros.h>
 
 
+#ifndef APT_10_CLEANER_HEADERS
+#include <apt-pkg/gpgv.h>
+class FileFd;
+#endif
 #ifndef APT_8_CLEANER_HEADERS
 #ifndef APT_8_CLEANER_HEADERS
 using std::string;
 using std::string;
 using std::vector;
 using std::vector;
 #endif
 #endif
 
 
 class pkgTagSection;
 class pkgTagSection;
-class FileFd;
 class indexRecords;
 class indexRecords;
 class pkgCdromStatus;
 class pkgCdromStatus;
 
 
@@ -99,9 +101,9 @@ class SigVerify								/*{{{*/
    bool CopyAndVerify(std::string CDROM,std::string Name,std::vector<std::string> &SigList,
    bool CopyAndVerify(std::string CDROM,std::string Name,std::vector<std::string> &SigList,
 		      std::vector<std::string> PkgList,std::vector<std::string> SrcList);
 		      std::vector<std::string> PkgList,std::vector<std::string> SrcList);
 
 
-   __deprecated static bool RunGPGV(std::string const &File, std::string const &FileOut,
+   APT_DEPRECATED static bool RunGPGV(std::string const &File, std::string const &FileOut,
 		       int const &statusfd, int fd[2]);
 		       int const &statusfd, int fd[2]);
-   __deprecated static bool RunGPGV(std::string const &File, std::string const &FileOut,
+   APT_DEPRECATED static bool RunGPGV(std::string const &File, std::string const &FileOut,
 			      int const &statusfd = -1);
 			      int const &statusfd = -1);
 };
 };
 									/*}}}*/
 									/*}}}*/

+ 8 - 2
apt-pkg/indexfile.cc

@@ -13,7 +13,13 @@
 #include <apt-pkg/indexfile.h>
 #include <apt-pkg/indexfile.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/aptconfiguration.h>
 #include <apt-pkg/aptconfiguration.h>
+#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
+#include <apt-pkg/srcrecords.h>
+#include <apt-pkg/macros.h>
 
 
+#include <string>
+#include <vector>
 #include <clocale>
 #include <clocale>
 #include <cstring>
 #include <cstring>
 									/*}}}*/
 									/*}}}*/
@@ -82,7 +88,7 @@ bool pkgIndexFile::TranslationsAvailable() {
    is already done in getLanguages(). Note also that this check is
    is already done in getLanguages(). Note also that this check is
    rather bad (doesn't take three character like ast into account).
    rather bad (doesn't take three character like ast into account).
    TODO: Remove method with next API break */
    TODO: Remove method with next API break */
-__attribute__ ((deprecated)) bool pkgIndexFile::CheckLanguageCode(const char *Lang)
+APT_DEPRECATED bool pkgIndexFile::CheckLanguageCode(const char *Lang)
 {
 {
   if (strlen(Lang) == 2 || (strlen(Lang) == 5 && Lang[2] == '_'))
   if (strlen(Lang) == 2 || (strlen(Lang) == 5 && Lang[2] == '_'))
     return true;
     return true;
@@ -98,7 +104,7 @@ __attribute__ ((deprecated)) bool pkgIndexFile::CheckLanguageCode(const char *La
 /* As we have now possibly more than one LanguageCode this method is
 /* As we have now possibly more than one LanguageCode this method is
    supersided by a) private classmembers or b) getLanguages().
    supersided by a) private classmembers or b) getLanguages().
    TODO: Remove method with next API break */
    TODO: Remove method with next API break */
-__attribute__ ((deprecated)) std::string pkgIndexFile::LanguageCode() {
+APT_DEPRECATED std::string pkgIndexFile::LanguageCode() {
 	if (TranslationsAvailable() == false)
 	if (TranslationsAvailable() == false)
 		return "";
 		return "";
 	return APT::Configuration::getLanguages()[0];
 	return APT::Configuration::getLanguages()[0];

+ 9 - 6
apt-pkg/indexfile.h

@@ -22,18 +22,21 @@
 #ifndef PKGLIB_INDEXFILE_H
 #ifndef PKGLIB_INDEXFILE_H
 #define PKGLIB_INDEXFILE_H
 #define PKGLIB_INDEXFILE_H
 
 
-
-#include <string>
-#include <apt-pkg/pkgcache.h>
 #include <apt-pkg/srcrecords.h>
 #include <apt-pkg/srcrecords.h>
 #include <apt-pkg/pkgrecords.h>
 #include <apt-pkg/pkgrecords.h>
+#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
 #include <apt-pkg/macros.h>
 #include <apt-pkg/macros.h>
 
 
+#include <string>
+
 #ifndef APT_8_CLEANER_HEADERS
 #ifndef APT_8_CLEANER_HEADERS
 using std::string;
 using std::string;
 #endif
 #endif
-
+#ifndef APT_10_CLEANER_HEADERS
 class pkgAcquire;
 class pkgAcquire;
+#endif
+
 class pkgCacheGenerator;
 class pkgCacheGenerator;
 class OpProgress;
 class OpProgress;
 
 
@@ -79,10 +82,10 @@ class pkgIndexFile
    virtual bool HasPackages() const = 0;
    virtual bool HasPackages() const = 0;
    virtual unsigned long Size() const = 0;
    virtual unsigned long Size() const = 0;
    virtual bool Merge(pkgCacheGenerator &/*Gen*/, OpProgress* /*Prog*/) const { return false; };
    virtual bool Merge(pkgCacheGenerator &/*Gen*/, OpProgress* /*Prog*/) const { return false; };
-   __deprecated virtual bool Merge(pkgCacheGenerator &Gen, OpProgress &Prog) const
+   APT_DEPRECATED virtual bool Merge(pkgCacheGenerator &Gen, OpProgress &Prog) const
       { return Merge(Gen, &Prog); };
       { return Merge(Gen, &Prog); };
    virtual bool MergeFileProvides(pkgCacheGenerator &/*Gen*/,OpProgress* /*Prog*/) const {return true;};
    virtual bool MergeFileProvides(pkgCacheGenerator &/*Gen*/,OpProgress* /*Prog*/) const {return true;};
-   __deprecated virtual bool MergeFileProvides(pkgCacheGenerator &Gen, OpProgress &Prog) const
+   APT_DEPRECATED virtual bool MergeFileProvides(pkgCacheGenerator &Gen, OpProgress &Prog) const
       {return MergeFileProvides(Gen, &Prog);};
       {return MergeFileProvides(Gen, &Prog);};
    virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const;
    virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const;
 
 

+ 6 - 1
apt-pkg/indexrecords.cc

@@ -14,8 +14,13 @@
 #include <apt-pkg/hashes.h>
 #include <apt-pkg/hashes.h>
 #include <apt-pkg/gpgv.h>
 #include <apt-pkg/gpgv.h>
 
 
-#include <sys/stat.h>
+#include <stdlib.h>
+#include <time.h>
 #include <clocale>
 #include <clocale>
+#include <map>
+#include <string>
+#include <utility>
+#include <vector>
 
 
 #include <apti18n.h>
 #include <apti18n.h>
 									/*}}}*/
 									/*}}}*/

+ 4 - 2
apt-pkg/indexrecords.h

@@ -5,17 +5,19 @@
 #ifndef PKGLIB_INDEXRECORDS_H
 #ifndef PKGLIB_INDEXRECORDS_H
 #define PKGLIB_INDEXRECORDS_H
 #define PKGLIB_INDEXRECORDS_H
 
 
-
-#include <apt-pkg/pkgcache.h>
 #include <apt-pkg/hashes.h>
 #include <apt-pkg/hashes.h>
 
 
 #include <map>
 #include <map>
 #include <vector>
 #include <vector>
 #include <ctime>
 #include <ctime>
+#include <string>
 
 
 #ifndef APT_8_CLEANER_HEADERS
 #ifndef APT_8_CLEANER_HEADERS
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/fileutl.h>
 #endif
 #endif
+#ifndef APT_10_CLEANER_HEADERS
+#include <apt-pkg/pkgcache.h>
+#endif
 
 
 class indexRecords
 class indexRecords
 {
 {

+ 3 - 1
apt-pkg/init.cc

@@ -15,9 +15,11 @@
 #include <apt-pkg/error.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/pkgsystem.h>
 #include <apt-pkg/pkgsystem.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/configuration.h>
+#include <apt-pkg/macros.h>
 
 
+#include <string.h>
+#include <string>
 #include <cstdlib>
 #include <cstdlib>
-#include <sys/stat.h>
 
 
 #include <apti18n.h>
 #include <apti18n.h>
 									/*}}}*/
 									/*}}}*/

+ 2 - 0
apt-pkg/init.h

@@ -16,7 +16,9 @@
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/pkgsystem.h>
 #include <apt-pkg/pkgsystem.h>
 #endif
 #endif
+#ifndef APT_10_CLEANER_HEADERS
 #include <apt-pkg/macros.h>
 #include <apt-pkg/macros.h>
+#endif
 
 
 class pkgSystem;
 class pkgSystem;
 class Configuration;
 class Configuration;

+ 18 - 12
apt-pkg/install-progress.cc

@@ -1,17 +1,23 @@
+#include <config.h>
+
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/install-progress.h>
 #include <apt-pkg/install-progress.h>
 
 
-#include <apti18n.h>
-
-#include <termios.h>
+#include <signal.h>
+#include <unistd.h>
+#include <iostream>
+#include <string>
+#include <vector>
 #include <sys/ioctl.h>
 #include <sys/ioctl.h>
 #include <sstream>
 #include <sstream>
 #include <fcntl.h>
 #include <fcntl.h>
 #include <algorithm>
 #include <algorithm>
 #include <stdio.h>
 #include <stdio.h>
 
 
+#include <apti18n.h>
+
 namespace APT {
 namespace APT {
 namespace Progress {
 namespace Progress {
 
 
@@ -329,15 +335,15 @@ bool PackageManagerFancy::StatusChanged(std::string PackageName,
 
 
    int row = GetNumberTerminalRows();
    int row = GetNumberTerminalRows();
 
 
-   static string save_cursor = "\033[s";
-   static string restore_cursor = "\033[u";
-   
-   static string set_bg_color = "\033[42m"; // green
-   static string set_fg_color = "\033[30m"; // black
-   
-   static string restore_bg =  "\033[49m";
-   static string restore_fg = "\033[39m";
-   
+   static std::string save_cursor = "\033[s";
+   static std::string restore_cursor = "\033[u";
+
+   static std::string set_bg_color = "\033[42m"; // green
+   static std::string set_fg_color = "\033[30m"; // black
+
+   static std::string restore_bg =  "\033[49m";
+   static std::string restore_fg = "\033[39m";
+
    std::cout << save_cursor
    std::cout << save_cursor
       // move cursor position to last row
       // move cursor position to last row
              << "\033[" << row << ";0f" 
              << "\033[" << row << ";0f" 

+ 10 - 5
apt-pkg/metaindex.h

@@ -1,12 +1,19 @@
 #ifndef PKGLIB_METAINDEX_H
 #ifndef PKGLIB_METAINDEX_H
 #define PKGLIB_METAINDEX_H
 #define PKGLIB_METAINDEX_H
 
 
-
-#include <string>
-#include <apt-pkg/pkgcache.h>
 #include <apt-pkg/indexfile.h>
 #include <apt-pkg/indexfile.h>
 #include <apt-pkg/init.h>
 #include <apt-pkg/init.h>
 
 
+#include <stddef.h>
+
+#include <string>
+#include <vector>
+
+#ifndef APT_10_CLEANER_HEADERS
+#include <apt-pkg/pkgcache.h>
+class pkgCacheGenerator;
+class OpProgress;
+#endif
 #ifndef APT_8_CLEANER_HEADERS
 #ifndef APT_8_CLEANER_HEADERS
 #include <apt-pkg/srcrecords.h>
 #include <apt-pkg/srcrecords.h>
 #include <apt-pkg/pkgrecords.h>
 #include <apt-pkg/pkgrecords.h>
@@ -15,8 +22,6 @@ using std::string;
 #endif
 #endif
 
 
 class pkgAcquire;
 class pkgAcquire;
-class pkgCacheGenerator;
-class OpProgress;
 
 
 class metaIndex
 class metaIndex
 {
 {

+ 5 - 1
apt-pkg/orderlist.cc

@@ -68,10 +68,14 @@
 #include <apt-pkg/orderlist.h>
 #include <apt-pkg/orderlist.h>
 #include <apt-pkg/depcache.h>
 #include <apt-pkg/depcache.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/error.h>
-#include <apt-pkg/version.h>
 #include <apt-pkg/sptr.h>
 #include <apt-pkg/sptr.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/configuration.h>
+#include <apt-pkg/cacheiterators.h>
+#include <apt-pkg/pkgcache.h>
 
 
+#include <stdlib.h>
+#include <string.h>
+#include <string>
 #include <iostream>
 #include <iostream>
 									/*}}}*/
 									/*}}}*/
 
 

+ 4 - 2
apt-pkg/orderlist.h

@@ -16,10 +16,12 @@
 #ifndef PKGLIB_ORDERLIST_H
 #ifndef PKGLIB_ORDERLIST_H
 #define PKGLIB_ORDERLIST_H
 #define PKGLIB_ORDERLIST_H
 
 
-
 #include <apt-pkg/pkgcache.h>
 #include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
 #include <apt-pkg/macros.h>
 #include <apt-pkg/macros.h>
 
 
+#include <string>
+
 class pkgDepCache;
 class pkgDepCache;
 class pkgOrderList : protected pkgCache::Namespace
 class pkgOrderList : protected pkgCache::Namespace
 {
 {
@@ -46,7 +48,7 @@ class pkgOrderList : protected pkgCache::Namespace
    bool Debug;
    bool Debug;
    
    
    // Main visit function
    // Main visit function
-   __deprecated bool VisitNode(PkgIterator Pkg) { return VisitNode(Pkg, "UNKNOWN"); };
+   APT_DEPRECATED bool VisitNode(PkgIterator Pkg) { return VisitNode(Pkg, "UNKNOWN"); };
    bool VisitNode(PkgIterator Pkg, char const* from);
    bool VisitNode(PkgIterator Pkg, char const* from);
    bool VisitDeps(DepFunc F,PkgIterator Pkg);
    bool VisitDeps(DepFunc F,PkgIterator Pkg);
    bool VisitRDeps(DepFunc F,PkgIterator Pkg);
    bool VisitRDeps(DepFunc F,PkgIterator Pkg);

+ 9 - 2
apt-pkg/packagemanager.cc

@@ -13,7 +13,7 @@
    ##################################################################### */
    ##################################################################### */
 									/*}}}*/
 									/*}}}*/
 // Include Files							/*{{{*/
 // Include Files							/*{{{*/
-#include<config.h>
+#include <config.h>
 
 
 #include <apt-pkg/packagemanager.h>
 #include <apt-pkg/packagemanager.h>
 #include <apt-pkg/orderlist.h>
 #include <apt-pkg/orderlist.h>
@@ -24,7 +24,14 @@
 #include <apt-pkg/algorithms.h>
 #include <apt-pkg/algorithms.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/sptr.h>
 #include <apt-pkg/sptr.h>
-
+#include <apt-pkg/macros.h>
+#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
+#include <apt-pkg/strutl.h>
+
+#include <stddef.h>
+#include <list>
+#include <string>
 #include <iostream>
 #include <iostream>
 
 
 #include <apti18n.h>
 #include <apti18n.h>

+ 7 - 5
apt-pkg/packagemanager.h

@@ -23,15 +23,17 @@
 #ifndef PKGLIB_PACKAGEMANAGER_H
 #ifndef PKGLIB_PACKAGEMANAGER_H
 #define PKGLIB_PACKAGEMANAGER_H
 #define PKGLIB_PACKAGEMANAGER_H
 
 
-#include <apt-pkg/macros.h>
 #include <apt-pkg/pkgcache.h>
 #include <apt-pkg/pkgcache.h>
-#include <apt-pkg/install-progress.h>
 #include <apt-pkg/init.h>
 #include <apt-pkg/init.h>
+#include <apt-pkg/macros.h>
 
 
 #include <string>
 #include <string>
-#include <iostream>
 #include <set>
 #include <set>
 
 
+#ifndef APT_10_CLEANER_HEADERS
+#include <apt-pkg/install-progress.h>
+#include <iostream>
+#endif
 #ifndef APT_8_CLEANER_HEADERS
 #ifndef APT_8_CLEANER_HEADERS
 #include <apt-pkg/depcache.h>
 #include <apt-pkg/depcache.h>
 using std::string;
 using std::string;
@@ -109,7 +111,7 @@ class pkgPackageManager : protected pkgCache::Namespace
 #if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 13)
 #if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 13)
    OrderResult DoInstall(APT::Progress::PackageManager *progress);
    OrderResult DoInstall(APT::Progress::PackageManager *progress);
    // compat
    // compat
-   __deprecated OrderResult DoInstall(int statusFd=-1);
+   APT_DEPRECATED OrderResult DoInstall(int statusFd=-1);
 #else
 #else
    OrderResult DoInstall(int statusFd=-1);
    OrderResult DoInstall(int statusFd=-1);
 #endif
 #endif
@@ -124,7 +126,7 @@ class pkgPackageManager : protected pkgCache::Namespace
    // stuff that needs to be done after the fork
    // stuff that needs to be done after the fork
    OrderResult DoInstallPostFork(APT::Progress::PackageManager *progress);
    OrderResult DoInstallPostFork(APT::Progress::PackageManager *progress);
    // compat
    // compat
-   __deprecated OrderResult DoInstallPostFork(int statusFd=-1);
+   APT_DEPRECATED OrderResult DoInstallPostFork(int statusFd=-1);
 #else
 #else
    OrderResult DoInstallPostFork(int statusFd=-1);
    OrderResult DoInstallPostFork(int statusFd=-1);
 #endif
 #endif

+ 5 - 2
apt-pkg/pkgcache.cc

@@ -29,12 +29,15 @@
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/aptconfiguration.h>
 #include <apt-pkg/aptconfiguration.h>
+#include <apt-pkg/mmap.h>
 #include <apt-pkg/macros.h>
 #include <apt-pkg/macros.h>
 
 
+#include <stddef.h>
+#include <string.h>
+#include <ostream>
+#include <vector>
 #include <string>
 #include <string>
 #include <sys/stat.h>
 #include <sys/stat.h>
-#include <unistd.h>
-#include <ctype.h>
 
 
 #include <apti18n.h>
 #include <apti18n.h>
 									/*}}}*/
 									/*}}}*/

+ 13 - 7
apt-pkg/pkgcachegen.cc

@@ -18,20 +18,26 @@
 #include <apt-pkg/progress.h>
 #include <apt-pkg/progress.h>
 #include <apt-pkg/sourcelist.h>
 #include <apt-pkg/sourcelist.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/configuration.h>
-#include <apt-pkg/aptconfiguration.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/sptr.h>
 #include <apt-pkg/sptr.h>
 #include <apt-pkg/pkgsystem.h>
 #include <apt-pkg/pkgsystem.h>
 #include <apt-pkg/macros.h>
 #include <apt-pkg/macros.h>
-#include <apt-pkg/tagfile.h>
 #include <apt-pkg/metaindex.h>
 #include <apt-pkg/metaindex.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/fileutl.h>
-
+#include <apt-pkg/hashsum_template.h>
+#include <apt-pkg/indexfile.h>
+#include <apt-pkg/md5.h>
+#include <apt-pkg/mmap.h>
+#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
+
+#include <stddef.h>
+#include <string.h>
+#include <iostream>
+#include <string>
 #include <vector>
 #include <vector>
 #include <sys/stat.h>
 #include <sys/stat.h>
 #include <unistd.h>
 #include <unistd.h>
-#include <errno.h>
-#include <stdio.h>
 
 
 #include <apti18n.h>
 #include <apti18n.h>
 									/*}}}*/
 									/*}}}*/
@@ -1333,7 +1339,7 @@ DynamicMMap* pkgCacheGenerator::CreateDynamicMMap(FileFd *CacheF, unsigned long
    the cache will be stored there. This is pretty much mandetory if you
    the cache will be stored there. This is pretty much mandetory if you
    are using AllowMem. AllowMem lets the function be run as non-root
    are using AllowMem. AllowMem lets the function be run as non-root
    where it builds the cache 'fast' into a memory buffer. */
    where it builds the cache 'fast' into a memory buffer. */
-__deprecated bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress,
+APT_DEPRECATED bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress,
 			MMap **OutMap, bool AllowMem)
 			MMap **OutMap, bool AllowMem)
    { return pkgCacheGenerator::MakeStatusCache(List, &Progress, OutMap, AllowMem); }
    { return pkgCacheGenerator::MakeStatusCache(List, &Progress, OutMap, AllowMem); }
 bool pkgCacheGenerator::MakeStatusCache(pkgSourceList &List,OpProgress *Progress,
 bool pkgCacheGenerator::MakeStatusCache(pkgSourceList &List,OpProgress *Progress,
@@ -1534,7 +1540,7 @@ bool pkgCacheGenerator::MakeStatusCache(pkgSourceList &List,OpProgress *Progress
 // CacheGenerator::MakeOnlyStatusCache - Build only a status files cache/*{{{*/
 // CacheGenerator::MakeOnlyStatusCache - Build only a status files cache/*{{{*/
 // ---------------------------------------------------------------------
 // ---------------------------------------------------------------------
 /* */
 /* */
-__deprecated bool pkgMakeOnlyStatusCache(OpProgress &Progress,DynamicMMap **OutMap)
+APT_DEPRECATED bool pkgMakeOnlyStatusCache(OpProgress &Progress,DynamicMMap **OutMap)
    { return pkgCacheGenerator::MakeOnlyStatusCache(&Progress, OutMap); }
    { return pkgCacheGenerator::MakeOnlyStatusCache(&Progress, OutMap); }
 bool pkgCacheGenerator::MakeOnlyStatusCache(OpProgress *Progress,DynamicMMap **OutMap)
 bool pkgCacheGenerator::MakeOnlyStatusCache(OpProgress *Progress,DynamicMMap **OutMap)
 {
 {

+ 0 - 0
apt-pkg/pkgcachegen.h


部分文件因文件數量過多而無法顯示