libapt-pkg-dev  v0.9.7.5ubuntu5.4
Debian+Ubuntu APT Package Management
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pkgCache::Header Struct Reference

#include <pkgcache.h>

Collaboration diagram for pkgCache::Header:

Public Member Functions

 Header ()
 
bool CheckSizes (Header &Against) const
 

Public Attributes

map_ptrloc Architecture
 Architecture(s) the cache was built against. More...
 
unsigned long CacheFileSize
 Size of the complete cache file. More...
 
unsigned short DependencySz
 
unsigned long DependsCount
 
unsigned long DescFileCount
 
unsigned short DescFileSz
 
unsigned long DescriptionCount
 
unsigned short DescriptionSz
 
bool Dirty
 indicates if the cache should be erased More...
 
map_ptrloc FileList
 index of the first PackageFile structure More...
 
unsigned long GroupCount
 Structure counts. More...
 
unsigned short GroupSz
 
map_ptrloc GrpHashTable [2 *1048]
 
unsigned short HeaderSz
 Size of structure values. More...
 
short MajorVersion
 These contain the version of the cache file. More...
 
unsigned long MaxDescFileSize
 The maximum size of a raw entry from the original Translation file. More...
 
unsigned long MaxVerFileSize
 The maximum size of a raw entry from the original Package file. More...
 
short MinorVersion
 
unsigned long PackageCount
 
unsigned long PackageFileCount
 
unsigned short PackageFileSz
 
unsigned short PackageSz
 
map_ptrloc PkgHashTable [2 *1048]
 hash tables providing rapid group/package name lookup More...
 
DynamicMMap::Pool Pools [9]
 The Pool structures manage the allocation pools that the generator uses. More...
 
unsigned long ProvidesCount
 
unsigned short ProvidesSz
 
unsigned long Signature
 Signature information. More...
 
map_ptrloc StringList
 index of the first StringItem structure More...
 
unsigned long VerFileCount
 
unsigned short VerFileSz
 
unsigned long VersionCount
 
unsigned short VersionSz
 
map_ptrloc VerSysName
 String representing the version system used. More...
 

Constructor & Destructor Documentation

pkgCache::Header::Header ( )

Member Function Documentation

bool pkgCache::Header::CheckSizes ( Header Against) const

Member Data Documentation

map_ptrloc pkgCache::Header::Architecture

Architecture(s) the cache was built against.

Referenced by pkgCache::NativeArch().

unsigned long pkgCache::Header::CacheFileSize

Size of the complete cache file.

unsigned short pkgCache::Header::DependencySz
unsigned long pkgCache::Header::DependsCount
unsigned long pkgCache::Header::DescFileCount
unsigned short pkgCache::Header::DescFileSz
unsigned long pkgCache::Header::DescriptionCount
unsigned short pkgCache::Header::DescriptionSz
bool pkgCache::Header::Dirty

indicates if the cache should be erased

Dirty is true if the cache file was opened for reading, the client expects to have written things to it and have not fully synced it. The file should be erased and rebuilt if it is true.

map_ptrloc pkgCache::Header::FileList

index of the first PackageFile structure

The PackageFile structures are singly linked lists that represent all package files that have been merged into the cache.

Referenced by pkgCache::FileBegin().

unsigned long pkgCache::Header::GroupCount

Structure counts.

These indicate the number of each structure contained in the cache. PackageCount is especially useful for generating user state structures. See Package::Id for more info.

unsigned short pkgCache::Header::GroupSz
map_ptrloc pkgCache::Header::GrpHashTable[2 *1048]
unsigned short pkgCache::Header::HeaderSz

Size of structure values.

All *Sz variables contains the sizeof() that particular structure. It is used as an extra consistency check on the structure of the file.

If any of the size values do not exactly match what the client expects then the client should refuse the load the file.

short pkgCache::Header::MajorVersion

These contain the version of the cache file.

unsigned long pkgCache::Header::MaxDescFileSize

The maximum size of a raw entry from the original Translation file.

unsigned long pkgCache::Header::MaxVerFileSize

The maximum size of a raw entry from the original Package file.

short pkgCache::Header::MinorVersion
unsigned long pkgCache::Header::PackageCount
unsigned long pkgCache::Header::PackageFileCount
unsigned short pkgCache::Header::PackageFileSz
unsigned short pkgCache::Header::PackageSz
map_ptrloc pkgCache::Header::PkgHashTable[2 *1048]

hash tables providing rapid group/package name lookup

Each group/package name is inserted into the hash table using pkgCache::Hash(const &string) By iterating over each entry in the hash table it is possible to iterate over the entire list of packages. Hash Collisions are handled with a singly linked list of packages based at the hash item. The linked list contains only packages that match the hashing function. In the PkgHashTable is it possible that multiple packages have the same name - these packages are stored as a sequence in the list.

Beware: The Hashmethod assumes that the hash table sizes are equal

DynamicMMap::Pool pkgCache::Header::Pools[9]

The Pool structures manage the allocation pools that the generator uses.

Start indicates the first byte of the pool, Count is the number of objects remaining in the pool and ItemSize is the structure size (alignment factor) of the pool. An ItemSize of 0 indicates the pool is empty. There should be the same number of pools as there are structure types. The generator stores this information so future additions can make use of any unused pool blocks.

unsigned long pkgCache::Header::ProvidesCount
unsigned short pkgCache::Header::ProvidesSz
unsigned long pkgCache::Header::Signature

Signature information.

This must contain the hex value 0x98FE76DC which is designed to verify that the system loading the image has the same byte order and byte size as the system saving the image

map_ptrloc pkgCache::Header::StringList

index of the first StringItem structure

The cache contains a list of all the unique strings (StringItems). The parser reads this list into memory so it can match strings against it.

unsigned long pkgCache::Header::VerFileCount
unsigned short pkgCache::Header::VerFileSz
unsigned long pkgCache::Header::VersionCount
unsigned short pkgCache::Header::VersionSz
map_ptrloc pkgCache::Header::VerSysName

String representing the version system used.


The documentation for this struct was generated from the following file: