]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/pkgcache.h
Avoid wedging the entire system if recoverable :/.
[apt.git] / apt-pkg / pkgcache.h
index 9fea44e06192f91066d892759bc1e826aefaa8bc..83bf8961def2b2d4afc835dff27e47f5d705575a 100644 (file)
@@ -123,6 +123,7 @@ class pkgCache                                                              /*{{{*/
    struct StringItem;
    struct VerFile;
    struct DescFile;
+   struct Tag;
    
    // Iterators
    template<typename Str, typename Itr> class Iterator;
@@ -136,6 +137,7 @@ class pkgCache                                                              /*{{{*/
    class PkgFileIterator;
    class VerFileIterator;
    class DescFileIterator;
+   class TagIterator;
    
    class Namespace;
    
@@ -214,6 +216,7 @@ class pkgCache                                                              /*{{{*/
    ReleaseFile *RlsFileP;
    PackageFile *PkgFileP;
    Version *VerP;
+   Tag *TagP;
    Description *DescP;
    Provides *ProvideP;
    Dependency *DepP;
@@ -245,6 +248,16 @@ class pkgCache                                                             /*{{{*/
    APT_HIDDEN PkgIterator FindPkg(APT::StringView Name, APT::StringView Arch);
 #endif
 
+#ifdef APT_PKG_EXPOSE_STRING_VIEW
+   APT::StringView ViewString(map_stringitem_t idx) const
+   {
+      char *name = StrP + idx;
+      uint16_t len = *reinterpret_cast<const uint16_t*>(name - sizeof(uint16_t));
+      return APT::StringView(name, len);
+   }
+#endif
+
+
    GrpIterator FindGrp(const std::string &Name);
    PkgIterator FindPkg(const std::string &Name);
    PkgIterator FindPkg(const std::string &Name, const std::string &Arch);
@@ -310,6 +323,7 @@ struct pkgCache::Header
    map_number_t ReleaseFileSz;
    map_number_t PackageFileSz;
    map_number_t VersionSz;
+   map_number_t TagSz;
    map_number_t DescriptionSz;
    map_number_t DependencySz;
    map_number_t DependencyDataSz;
@@ -325,6 +339,7 @@ struct pkgCache::Header
    map_id_t GroupCount;
    map_id_t PackageCount;
    map_id_t VersionCount;
+   map_id_t TagCount;
    map_id_t DescriptionCount;
    map_id_t DependsCount;
    map_id_t DependsDataCount;
@@ -575,6 +590,16 @@ struct pkgCache::VerFile
    map_filesize_t Size;
 };
                                                                        /*}}}*/
+// TagFile structure                                                   /*{{{*/
+/** \brief associates a tag with something */
+struct pkgCache::Tag
+{
+   /** \brief name of this tag */
+   map_stringitem_t Name;
+   /** \brief next step in the linked list */
+   map_pointer_t NextTag;       // Tag
+};
+                                                                       /*}}}*/
 // DescFile structure                                                  /*{{{*/
 /** \brief associates a description with a Translation file */
 struct pkgCache::DescFile
@@ -602,6 +627,8 @@ struct pkgCache::Version
    map_stringitem_t VerStr;
    /** \brief section this version is filled in */
    map_stringitem_t Section;
+   /** \brief high-level name used to display package */
+   map_stringitem_t Display;
    /** \brief source package name this version comes from
       Always contains the name, even if it is the same as the binary name */
    map_stringitem_t SourcePkgName;
@@ -646,6 +673,8 @@ struct pkgCache::Version
    map_pointer_t ParentPkg;         // Package
    /** \brief list of pkgCache::Provides */
    map_pointer_t ProvidesList;      // Provides
+   /** \brief list of pkgCache::Tag */
+   map_pointer_t TagList;           // Tag
 
    /** \brief archive size for this version
 
@@ -798,6 +827,7 @@ class pkgCache::Namespace                                           /*{{{*/
    typedef pkgCache::GrpIterator GrpIterator;
    typedef pkgCache::PkgIterator PkgIterator;
    typedef pkgCache::VerIterator VerIterator;
+   typedef pkgCache::TagIterator TagIterator;
    typedef pkgCache::DescIterator DescIterator;
    typedef pkgCache::DepIterator DepIterator;
    typedef pkgCache::PrvIterator PrvIterator;