apt  2.2.4
About: Apt (Advanced Package Tool) is a management system for software packages (Debian/Ubuntu). Release series 2.2.
  Fossies Dox: apt-2.2.4.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

pkgCache< Str, Itr >::Header Struct Reference

#include <pkgcache.h>

Collaboration diagram for pkgCache< Str, Itr >::Header:
[legend]

Public Member Functions

uint32_t GetHashTableSize () const
 
void SetHashTableSize (unsigned int const sz)
 
map_stringitem_t GetArchitectures () const
 
void SetArchitectures (map_stringitem_t const idx)
 
bool CheckSizes (Header &Against) const APT_PURE
 
 Header ()
 

Public Attributes

uint32_t Signature
 Signature information. More...
 
map_number_t MajorVersion
 
map_number_t MinorVersion
 
bool Dirty
 indicates if the cache should be erased More...
 
uint16_t HeaderSz
 Size of structure values. More...
 
map_number_t GroupSz
 
map_number_t PackageSz
 
map_number_t ReleaseFileSz
 
map_number_t PackageFileSz
 
map_number_t VersionSz
 
map_number_t DescriptionSz
 
map_number_t DependencySz
 
map_number_t DependencyDataSz
 
map_number_t ProvidesSz
 
map_number_t VerFileSz
 
map_number_t DescFileSz
 
map_id_t GroupCount
 Structure counts. More...
 
map_id_t PackageCount
 
map_id_t VersionCount
 
map_id_t DescriptionCount
 
map_id_t DependsCount
 
map_id_t DependsDataCount
 
map_fileid_t ReleaseFileCount
 
map_fileid_t PackageFileCount
 
map_fileid_t VerFileCount
 
map_fileid_t DescFileCount
 
map_id_t ProvidesCount
 
map_pointer< PackageFileFileList
 index of the first PackageFile structure More...
 
map_pointer< ReleaseFileRlsFileList
 index of the first ReleaseFile structure More...
 
map_stringitem_t VerSysName
 String representing the version system used. More...
 
map_stringitem_t Architecture
 native architecture the cache was built against More...
 
map_stringitem_t Architectures
 all architectures the cache was built against More...
 
map_filesize_t MaxVerFileSize
 The maximum size of a raw entry from the original Package file. More...
 
map_filesize_t MaxDescFileSize
 The maximum size of a raw entry from the original Translation file. More...
 
DynamicMMap::Pool Pools [2 *12]
 The Pool structures manage the allocation pools that the generator uses. More...
 
uint32_t HashTableSize
 hash tables providing rapid group/package name lookup More...
 
map_filesize_small_t CacheFileSize
 Hash of the file (TODO: Rename) More...
 

Detailed Description

template<typename Str, typename Itr>
struct pkgCache< Str, Itr >::Header

Definition at line 291 of file pkgcache.h.

Constructor & Destructor Documentation

◆ Header()

Header ( )

Definition at line 53 of file pkgcache.cc.

References _config, APT_HEADER_SET, pkgCache< Str, Itr >::Header::Architecture, pkgCache< Str, Itr >::Header::CacheFileSize, pkgCache< Str, Itr >::Header::DependencyDataSz, pkgCache< Str, Itr >::Header::DependencySz, pkgCache< Str, Itr >::Header::DependsCount, pkgCache< Str, Itr >::Header::DependsDataCount, pkgCache< Str, Itr >::Header::DescFileCount, pkgCache< Str, Itr >::Header::DescFileSz, pkgCache< Str, Itr >::Header::DescriptionCount, pkgCache< Str, Itr >::Header::DescriptionSz, pkgCache< Str, Itr >::Header::Dirty, pkgCache< Str, Itr >::Header::FileList, Configuration::FindI(), pkgCache< Str, Itr >::Header::GroupCount, pkgCache< Str, Itr >::Header::GroupSz, pkgCache< Str, Itr >::Header::HeaderSz, pkgCache< Str, Itr >::Header::MajorVersion, pkgCache< Str, Itr >::Header::MaxDescFileSize, pkgCache< Str, Itr >::Header::MaxVerFileSize, pkgCache< Str, Itr >::Header::MinorVersion, pkgCache< Str, Itr >::Header::PackageCount, pkgCache< Str, Itr >::Header::PackageFileCount, pkgCache< Str, Itr >::Header::PackageFileSz, pkgCache< Str, Itr >::Header::PackageSz, pkgCache< Str, Itr >::Header::Pools, pkgCache< Str, Itr >::Header::ProvidesCount, pkgCache< Str, Itr >::Header::ProvidesSz, pkgCache< Str, Itr >::Header::ReleaseFileCount, pkgCache< Str, Itr >::Header::ReleaseFileSz, pkgCache< Str, Itr >::Header::RlsFileList, pkgCache< Str, Itr >::Header::SetArchitectures(), pkgCache< Str, Itr >::Header::SetHashTableSize(), pkgCache< Str, Itr >::Header::Signature, pkgCache< Str, Itr >::Header::VerFileCount, pkgCache< Str, Itr >::Header::VerFileSz, pkgCache< Str, Itr >::Header::VersionCount, pkgCache< Str, Itr >::Header::VersionSz, and pkgCache< Str, Itr >::Header::VerSysName.

Member Function Documentation

◆ CheckSizes()

◆ GetArchitectures()

map_stringitem_t GetArchitectures ( ) const
inline

Definition at line 388 of file pkgcache.h.

References pkgCache< Str, Itr >::Header::Architectures.

Referenced by pkgCache< Str, Itr >::ReMap().

◆ GetHashTableSize()

uint32_t GetHashTableSize ( ) const
inline

◆ SetArchitectures()

void SetArchitectures ( map_stringitem_t const  idx)
inline

◆ SetHashTableSize()

void SetHashTableSize ( unsigned int const  sz)
inline

Member Data Documentation

◆ Architecture

◆ Architectures

map_stringitem_t Architectures

all architectures the cache was built against

Definition at line 359 of file pkgcache.h.

Referenced by pkgCache< Str, Itr >::Header::GetArchitectures(), and pkgCache< Str, Itr >::Header::SetArchitectures().

◆ CacheFileSize

◆ DependencyDataSz

map_number_t DependencyDataSz

◆ DependencySz

◆ DependsCount

◆ DependsDataCount

map_id_t DependsDataCount

◆ DescFileCount

map_fileid_t DescFileCount

◆ DescFileSz

◆ DescriptionCount

◆ DescriptionSz

◆ Dirty

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.

Definition at line 307 of file pkgcache.h.

Referenced by pkgCache< Str, Itr >::CacheHash(), pkgCache< Str, Itr >::Header::Header(), pkgCache< Str, Itr >::ReMap(), pkgCacheGenerator::Start(), writeBackMMapToFile(), and pkgCacheGenerator::~pkgCacheGenerator().

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

Definition at line 350 of file pkgcache.h.

Referenced by pkgCache< Str, Itr >::FileBegin(), pkgCache< Str, Itr >::Header::Header(), and pkgCacheGenerator::SelectFile().

◆ GroupCount

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

Definition at line 334 of file pkgcache.h.

Referenced by pkgCache< Str, Itr >::Header::Header(), and pkgCacheGenerator::NewGroup().

◆ GroupSz

◆ HashTableSize

uint32_t HashTableSize

hash tables providing rapid group/package name lookup

Each group/package name is inserted into a 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. The size of both tables is the same.

Definition at line 385 of file pkgcache.h.

Referenced by pkgCache< Str, Itr >::Header::GetHashTableSize(), and pkgCache< Str, Itr >::Header::SetHashTableSize().

◆ HeaderSz

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

Definition at line 316 of file pkgcache.h.

Referenced by pkgCache< Str, Itr >::Header::CheckSizes(), and pkgCache< Str, Itr >::Header::Header().

◆ MajorVersion

map_number_t MajorVersion

These contain the version of the cache file

Definition at line 300 of file pkgcache.h.

Referenced by pkgCache< Str, Itr >::Header::Header(), and pkgCache< Str, Itr >::ReMap().

◆ MaxDescFileSize

map_filesize_t MaxDescFileSize

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

Definition at line 363 of file pkgcache.h.

Referenced by pkgCache< Str, Itr >::Header::Header(), and pkgCacheGenerator::NewFileDesc().

◆ MaxVerFileSize

map_filesize_t MaxVerFileSize

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

Definition at line 361 of file pkgcache.h.

Referenced by pkgCache< Str, Itr >::Header::Header(), and pkgCacheGenerator::NewFileVer().

◆ MinorVersion

map_number_t MinorVersion

◆ PackageCount

◆ PackageFileCount

map_fileid_t PackageFileCount

◆ PackageFileSz

◆ PackageSz

◆ Pools

DynamicMMap::Pool Pools[2 *12]

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 twice the number of pools as there are non-private structure types. The generator stores this information so future additions can make use of any unused pool blocks.

Definition at line 373 of file pkgcache.h.

Referenced by pkgCache< Str, Itr >::Header::Header(), and pkgCacheGenerator::Start().

◆ ProvidesCount

map_id_t ProvidesCount

◆ ProvidesSz

◆ ReleaseFileCount

◆ ReleaseFileSz

◆ RlsFileList

◆ Signature

uint32_t 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

Definition at line 298 of file pkgcache.h.

Referenced by pkgCache< Str, Itr >::Header::Header(), and pkgCache< Str, Itr >::ReMap().

◆ VerFileCount

map_fileid_t VerFileCount

◆ VerFileSz

◆ VersionCount

◆ VersionSz

◆ VerSysName

map_stringitem_t VerSysName

String representing the version system used.

Definition at line 355 of file pkgcache.h.

Referenced by pkgCache< Str, Itr >::Header::Header(), pkgCache< Str, Itr >::ReMap(), and pkgCacheGenerator::Start().


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