]> git.saurik.com Git - apt.git/commitdiff
* apt-pkg/pkgcache.h:
authorDavid Kalnischkies <kalnischkies@gmail.com>
Tue, 4 May 2010 10:43:08 +0000 (12:43 +0200)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Tue, 4 May 2010 10:43:08 +0000 (12:43 +0200)
  - enhance the Groups ABI by providing a ID as the other structs does
  - check also the size of the Group struct then checking for the others

apt-pkg/pkgcache.cc
apt-pkg/pkgcache.h
apt-pkg/pkgcachegen.cc
debian/changelog

index 1bbd74bd9815fc197e67a7c78bf3994c92bebf80..ba3c5cbf8b54fa6f9418e6db692c90a6ba4ea1e3 100644 (file)
@@ -55,6 +55,7 @@ pkgCache::Header::Header()
    Dirty = false;
    
    HeaderSz = sizeof(pkgCache::Header);
+   GroupSz = sizeof(pkgCache::Group);
    PackageSz = sizeof(pkgCache::Package);
    PackageFileSz = sizeof(pkgCache::PackageFile);
    VersionSz = sizeof(pkgCache::Version);
@@ -64,6 +65,7 @@ pkgCache::Header::Header()
    VerFileSz = sizeof(pkgCache::VerFile);
    DescFileSz = sizeof(pkgCache::DescFile);
    
+   GroupCount = 0;
    PackageCount = 0;
    VersionCount = 0;
    DescriptionCount = 0;
@@ -90,6 +92,7 @@ pkgCache::Header::Header()
 bool pkgCache::Header::CheckSizes(Header &Against) const
 {
    if (HeaderSz == Against.HeaderSz &&
+       GroupSz == Against.GroupSz &&
        PackageSz == Against.PackageSz &&
        PackageFileSz == Against.PackageFileSz &&
        VersionSz == Against.VersionSz &&
index a2e63ff0392fa17f63399a7135c56c297930af4c..643f240b0da6071456c1827e675736d5356e2000 100644 (file)
@@ -244,6 +244,7 @@ struct pkgCache::Header
        If any of the size values do not exactly match what the client expects
        then the client should refuse the load the file. */
    unsigned short HeaderSz;
+   unsigned short GroupSz;
    unsigned short PackageSz;
    unsigned short PackageFileSz;
    unsigned short VersionSz;
@@ -329,12 +330,15 @@ struct pkgCache::Group
    map_ptrloc Name;            // StringItem
 
    // Linked List
-   /** Link to the first package which belongs to the group */
+   /** \brief Link to the first package which belongs to the group */
    map_ptrloc FirstPackage;    // Package
-   /** Link to the last package which belongs to the group */
+   /** \brief Link to the last package which belongs to the group */
    map_ptrloc LastPackage;     // Package
-   /** Link to the next Group */
+   /** \brief Link to the next Group */
    map_ptrloc Next;            // Group
+   /** \brief unique sequel ID */
+   unsigned int ID;
+
 };
                                                                        /*}}}*/
 // Package structure                                                   /*{{{*/
index 114c9d5ed36b727686fad86752471ce0d52f3c1f..d96d3370fcf38a7372e3744a6c2ad40b720db079 100644 (file)
@@ -356,8 +356,7 @@ bool pkgCacheGenerator::NewGroup(pkgCache::GrpIterator &Grp, const string &Name)
    Grp->Next = Cache.HeaderP->GrpHashTable[Hash];
    Cache.HeaderP->GrpHashTable[Hash] = Group;
 
-   Cache.HeaderP->GroupCount++;
-
+   Grp->ID = Cache.HeaderP->GroupCount++;
    return true;
 }
                                                                        /*}}}*/
index 76fc2550bb40143e487ec431c3bca01ee33d5029..5885f9246cc130d0c70f4840ce5ad59e725ef067 100644 (file)
@@ -43,6 +43,9 @@ apt (0.7.26~exp4) experimental; urgency=low
       use, extended_states and uri schemes.
   * doc/cache.sgml:
     - drop the file in favor of inplace documentation with doxygen
+  * apt-pkg/pkgcache.h:
+    - enhance the Groups ABI by providing a ID as the other structs does
+    - check also the size of the Group struct then checking for the others
 
   [ Jari Aalto ]
   * cmdline/apt-get.cc: