apt @VERSION@
Public Member Functions | Public Attributes

pkgCache::Header Struct Reference

List of all members.

Public Member Functions

bool CheckSizes (Header &Against) const

Public Attributes

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

Member Data Documentation

bool 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 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.

unsigned long 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 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 MajorVersion

These contain the version of the cache file

map_ptrloc 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

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 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 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.


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