]> git.saurik.com Git - apt-legacy.git/blobdiff - apt-pkg/pkgcache.h
Remove code that isn't being used with Apple http.
[apt-legacy.git] / apt-pkg / pkgcache.h
index a1001f8f423fc9cb3c97d1384267653d7eef0e14..1903b2ffe34cf1b4bb6bba65125739ab68eb9375 100644 (file)
 #include <string>
 #include <time.h>
 #include <apt-pkg/mmap.h>
+#include <apt-pkg/srkstring.h>
 
 using std::string;
-    
+
 class pkgVersioningSystem;
-class pkgCache
+class pkgCache                                                         /*{{{*/
 {
    public:
    // Cache element predeclarations
@@ -73,7 +74,7 @@ class pkgCache
    struct Dep
    {
       enum DepType {Depends=1,PreDepends=2,Suggests=3,Recommends=4,
-        Conflicts=5,Replaces=6,Obsoletes=7,DpkgBreaks=8};
+        Conflicts=5,Replaces=6,Obsoletes=7,DpkgBreaks=8,Enhances=9};
       enum DepCompareOp {Or=0x10,NoOp=0,LessEq=0x1,GreaterEq=0x2,Less=0x3,
         Greater=0x4,Equals=0x5,NotEquals=0x6};
    };
@@ -102,6 +103,7 @@ class pkgCache
 
    unsigned long sHash(const string &S) const;
    unsigned long sHash(const char *S) const;
+   unsigned long sHash(const srkString &S) const;
    
    public:
    
@@ -127,12 +129,14 @@ class pkgCache
    // String hashing function (512 range)
    inline unsigned long Hash(const string &S) const {return sHash(S);};
    inline unsigned long Hash(const char *S) const {return sHash(S);};
+   inline unsigned long Hash(const srkString &S) const {return sHash(S);};
 
    // Usefull transformation things
    const char *Priority(unsigned char Priority);
    
    // Accessors
    PkgIterator FindPkg(const string &Name);
+   PkgIterator FindPkg(const srkString &Name);
    Header &Head() {return *HeaderP;};
    inline PkgIterator PkgBegin();
    inline PkgIterator PkgEnd();
@@ -150,8 +154,8 @@ class pkgCache
    pkgCache(MMap *Map,bool DoMap = true);
    virtual ~pkgCache() {};
 };
-
-// Header structure
+                                                                       /*}}}*/
+// Header structure                                                    /*{{{*/
 struct pkgCache::Header
 {
    // Signature information
@@ -201,8 +205,8 @@ struct pkgCache::Header
    bool CheckSizes(Header &Against) const;
    Header();
 };
-
-struct pkgCache::Package
+                                                                       /*}}}*/
+struct pkgCache::Package                                               /*{{{*/
 {
    // Pointers
    map_ptrloc Name;              // Stringtable
@@ -222,7 +226,7 @@ struct pkgCache::Package
    unsigned char InstState;         // Flags
    unsigned char CurrentState;      // State
    
-   unsigned short ID;
+   unsigned int ID;
    unsigned long Flags;
 };
 
@@ -243,33 +247,33 @@ struct pkgCache::PackageFile
    
    // Linked list
    map_ptrloc NextFile;        // PackageFile
-   unsigned short ID;
+   unsigned int ID;
    time_t mtime;                  // Modification time for the file
 };
-
-struct pkgCache::VerFile
+                                                                       /*}}}*/
+struct pkgCache::VerFile                                               /*{{{*/
 {
    map_ptrloc File;           // PackageFile
    map_ptrloc NextFile;       // PkgVerFile
    map_ptrloc Offset;         // File offset
    unsigned short Size;
 };
-
-struct pkgCache::Tag
+                                                                       /*}}}*/
+struct pkgCache::Tag                                           /*{{{*/
 {
    map_ptrloc Name;           // Stringtable
    map_ptrloc NextTag;        // Tag
 };
-
-struct pkgCache::DescFile
+                                                                       /*}}}*/
+struct pkgCache::DescFile                                              /*{{{*/
 {
    map_ptrloc File;           // PackageFile
    map_ptrloc NextFile;       // PkgVerFile
    map_ptrloc Offset;         // File offset
    unsigned short Size;
 };
-
-struct pkgCache::Version
+                                                                       /*}}}*/
+struct pkgCache::Version                                               /*{{{*/
 {
    map_ptrloc VerStr;            // Stringtable
    map_ptrloc Display;           // Stringtable
@@ -287,11 +291,12 @@ struct pkgCache::Version
    map_ptrloc Size;              // These are the .deb size
    map_ptrloc InstalledSize;
    unsigned short Hash;
-   unsigned short ID;
+   unsigned short ID1;
    unsigned char Priority;
+   unsigned short ID2;
 };
-
-struct pkgCache::Description
+                                                                       /*}}}*/
+struct pkgCache::Description                                           /*{{{*/
 {
    // Language Code store the description translation language code. If
    // the value has a 0 lenght then this is readed using the Package
@@ -304,10 +309,10 @@ struct pkgCache::Description
    map_ptrloc NextDesc;          // Description
    map_ptrloc ParentPkg;         // Package
 
-   unsigned short ID;
+   unsigned int ID;
 };
-
-struct pkgCache::Dependency
+                                                                       /*}}}*/
+struct pkgCache::Dependency                                            /*{{{*/
 {
    map_ptrloc Version;         // Stringtable
    map_ptrloc Package;         // Package
@@ -320,8 +325,8 @@ struct pkgCache::Dependency
    unsigned char Type;
    unsigned char CompareOp;
 };
-
-struct pkgCache::Provides
+                                                                       /*}}}*/
+struct pkgCache::Provides                                              /*{{{*/
 {
    map_ptrloc ParentPkg;        // Pacakge
    map_ptrloc Version;          // Version
@@ -329,13 +334,13 @@ struct pkgCache::Provides
    map_ptrloc NextProvides;     // Provides
    map_ptrloc NextPkgProv;      // Provides
 };
-
-struct pkgCache::StringItem
+                                                                       /*}}}*/
+struct pkgCache::StringItem                                            /*{{{*/
 {
    map_ptrloc String;        // Stringtable
    map_ptrloc NextItem;      // StringItem
 };
-
+                                                                       /*}}}*/
 #include <apt-pkg/cacheiterators.h>
 
 inline pkgCache::PkgIterator pkgCache::PkgBegin() 
@@ -348,7 +353,7 @@ inline pkgCache::PkgFileIterator pkgCache::FileEnd()
        {return PkgFileIterator(*this,PkgFileP);};
 
 // Oh I wish for Real Name Space Support
-class pkgCache::Namespace
+class pkgCache::Namespace                                              /*{{{*/
 {   
    public:
 
@@ -367,5 +372,5 @@ class pkgCache::Namespace
    typedef pkgCache::Dep Dep;
    typedef pkgCache::Flag Flag;
 };
-
+                                                                       /*}}}*/
 #endif