1
1
// -*- mode: cpp; mode: fold -*-
2
2
// Description /*{{{*/
3
// $Id: pkgcachegen.h,v 1.17 1999/07/26 17:46:08 jgg Exp $
3
// $Id: pkgcachegen.h,v 1.18 2001/02/20 07:03:17 jgg Exp $
4
4
/* ######################################################################
6
6
Package Cache Generator - Generator for the cache structure.
54
54
bool NewFileVer(pkgCache::VerIterator &Ver,ListParser &List);
55
55
unsigned long NewVersion(pkgCache::VerIterator &Ver,string VerStr,unsigned long Next);
57
59
unsigned long WriteUniqString(const char *S,unsigned int Size);
58
60
inline unsigned long WriteUniqString(string S) {return WriteUniqString(S.c_str(),S.length());};
62
62
void DropProgress() {Progress = 0;};
63
bool SelectFile(string File,unsigned long Flags = 0);
63
bool SelectFile(string File,string Site,pkgIndexFile const &Index,
64
unsigned long Flags = 0);
64
65
bool MergeList(ListParser &List,pkgCache::VerIterator *Ver = 0);
65
66
inline pkgCache &GetCache() {return Cache;};
66
67
inline pkgCache::PkgFileIterator GetCurFile()
67
68
{return pkgCache::PkgFileIterator(Cache,CurrentFile);};
69
pkgCacheGenerator(DynamicMMap &Map,OpProgress &Progress);
70
pkgCacheGenerator(DynamicMMap *Map,OpProgress *Progress);
70
71
~pkgCacheGenerator();
73
bool pkgSrcCacheCheck(pkgSourceList &List);
74
bool pkgPkgCacheCheck(string CacheFile);
75
bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress);
76
MMap *pkgMakeStatusCacheMem(pkgSourceList &List,OpProgress &Progress);
78
74
// This is the abstract package list parser class.
79
75
class pkgCacheGenerator::ListParser
81
77
pkgCacheGenerator *Owner;
82
friend pkgCacheGenerator;
78
friend class pkgCacheGenerator;
84
80
// Some cache items
85
81
pkgCache::VerIterator OldDepVer;
113
109
virtual ~ListParser() {};
116
bool pkgMergeStatus(OpProgress &Progress,pkgCacheGenerator &Gen,
117
unsigned long &CurrentSize,unsigned long TotalSize);
118
bool pkgAddStatusSize(unsigned long &TotalSize);
112
bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress,
113
MMap **OutMap = 0,bool AllowMem = false);
114
bool pkgMakeOnlyStatusCache(OpProgress &Progress,DynamicMMap **OutMap);
116
#ifdef APT_COMPATIBILITY
117
#if APT_COMPATIBILITY != 986
118
#warning "Using APT_COMPATIBILITY"
120
MMap *pkgMakeStatusCacheMem(pkgSourceList &List,OpProgress &Progress)
123
if (pkgMakeStatusCache(List,Progress,&Map,true) == false)