]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/pkgcache.h
Havocs cancel patch
[apt.git] / apt-pkg / pkgcache.h
index 70d08826e63b4c37b01d20789560148b01cb8a02..f7349c7a12ed001437f07c07fb1914ff6f2fcda1 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: pkgcache.h,v 1.12 1998/12/08 01:34:13 jgg Exp $
+// $Id: pkgcache.h,v 1.20 1999/05/23 22:55:54 jgg Exp $
 /* ######################################################################
    
    Cache - Structure definitions for the cache file
@@ -80,9 +80,8 @@ class pkgCache
    
    struct Flag
    {
-      enum PkgFlags {Auto=(1<<0),New=(1<<1),Obsolete=(1<<2),Essential=(1<<3),
-        ImmediateConf=(1<<4)};
-      enum PkgFFlags {NotSource=(1<<0)};
+      enum PkgFlags {Auto=(1<<0),Essential=(1<<3),Important=(1<<4)};
+      enum PkgFFlags {NotSource=(1<<0),NotAutomatic=(1<<1)};
    };
    
    protected:
@@ -91,8 +90,8 @@ class pkgCache
    string CacheFile;
    MMap &Map;
 
-   static unsigned long sHash(string S);
-   static unsigned long sHash(const char *S);
+   unsigned long sHash(string S) const;
+   unsigned long sHash(const char *S) const;
    
    public:
    
@@ -125,6 +124,7 @@ class pkgCache
    inline PkgIterator PkgEnd();
    inline PkgFileIterator FileBegin();
    inline PkgFileIterator FileEnd();
+   VerIterator GetCandidateVer(PkgIterator Pkg,bool AllowCurrent = true);
    
    pkgCache(MMap &Map);
    virtual ~pkgCache() {};
@@ -153,6 +153,8 @@ struct pkgCache::Header
    unsigned long VersionCount;
    unsigned long DependsCount;
    unsigned long PackageFileCount;
+   unsigned long VerFileCount;
+   unsigned long ProvidesCount;
    
    // Offsets
    __apt_ptrloc FileList;              // struct PackageFile
@@ -164,7 +166,7 @@ struct pkgCache::Header
    DynamicMMap::Pool Pools[7];
    
    // Rapid package name lookup
-   __apt_ptrloc HashTable[2048];
+   __apt_ptrloc HashTable[2*1048];
 
    bool CheckSizes(Header &Against) const;
    Header();
@@ -198,14 +200,18 @@ struct pkgCache::PackageFile
 {
    // Names
    __apt_ptrloc FileName;        // Stringtable
+   __apt_ptrloc Archive;         // Stringtable
+   __apt_ptrloc Component;       // Stringtable
    __apt_ptrloc Version;         // Stringtable
-   __apt_ptrloc Distribution;    // Stringtable
-   __apt_ptrloc Size;
+   __apt_ptrloc Origin;          // Stringtable
+   __apt_ptrloc Label;           // Stringtable
+   __apt_ptrloc Architecture;    // Stringtable
+   unsigned long Size;            
+   unsigned long Flags;
    
    // Linked list
    __apt_ptrloc NextFile;        // PackageFile
    unsigned short ID;
-   unsigned long Flags;
    time_t mtime;                  // Modification time for the file
 };
 
@@ -221,7 +227,8 @@ struct pkgCache::Version
 {
    __apt_ptrloc VerStr;            // Stringtable
    __apt_ptrloc Section;           // StringTable (StringItem)
-   
+   __apt_ptrloc Arch;              // StringTable
+      
    // Lists
    __apt_ptrloc FileList;          // VerFile
    __apt_ptrloc NextVer;           // Version
@@ -231,6 +238,7 @@ struct pkgCache::Version
    
    __apt_ptrloc Size;              // These are the .deb size
    __apt_ptrloc InstalledSize;
+   unsigned short Hash;
    unsigned short ID;
    unsigned char Priority;
 };