~mvo/apt/dep8

« back to all changes in this revision

Viewing changes to apt-pkg/pkgcachegen.h

  • Committer: Arch Librarian
  • Date: 2004-09-20 16:56:32 UTC
  • Revision ID: Arch-1:apt@arch.ubuntu.com%apt--MAIN--0--patch-614
Join with aliencode
Author: jgg
Date: 2001-02-20 07:03:16 GMT
Join with aliencode

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
/* ######################################################################
5
5
   
6
6
   Package Cache Generator - Generator for the cache structure.
16
16
   
17
17
   ##################################################################### */
18
18
                                                                        /*}}}*/
19
 
// Header section: pkglib
20
19
#ifndef PKGLIB_PKGCACHEGEN_H
21
20
#define PKGLIB_PKGCACHEGEN_H
22
21
 
29
28
class pkgSourceList;
30
29
class OpProgress;
31
30
class MMap;
 
31
class pkgIndexFile;
32
32
 
33
33
class pkgCacheGenerator
34
34
{
39
39
   public:
40
40
   
41
41
   class ListParser;
42
 
   friend ListParser;
 
42
   friend class ListParser;
43
43
   
44
44
   protected:
45
45
   
54
54
   bool NewFileVer(pkgCache::VerIterator &Ver,ListParser &List);
55
55
   unsigned long NewVersion(pkgCache::VerIterator &Ver,string VerStr,unsigned long Next);
56
56
 
 
57
   public:
 
58
 
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());};
59
61
 
60
 
   public:   
61
 
 
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);};
68
69
      
69
 
   pkgCacheGenerator(DynamicMMap &Map,OpProgress &Progress);
 
70
   pkgCacheGenerator(DynamicMMap *Map,OpProgress *Progress);
70
71
   ~pkgCacheGenerator();
71
72
};
72
73
 
73
 
bool pkgSrcCacheCheck(pkgSourceList &List);
74
 
bool pkgPkgCacheCheck(string CacheFile);
75
 
bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress);
76
 
MMap *pkgMakeStatusCacheMem(pkgSourceList &List,OpProgress &Progress);
77
 
 
78
74
// This is the abstract package list parser class.
79
75
class pkgCacheGenerator::ListParser
80
76
{
81
77
   pkgCacheGenerator *Owner;
82
 
   friend pkgCacheGenerator;
 
78
   friend class pkgCacheGenerator;
83
79
   
84
80
   // Some cache items
85
81
   pkgCache::VerIterator OldDepVer;
113
109
   virtual ~ListParser() {};
114
110
};
115
111
 
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);
 
115
 
 
116
#ifdef APT_COMPATIBILITY
 
117
#if APT_COMPATIBILITY != 986
 
118
#warning "Using APT_COMPATIBILITY"
 
119
#endif
 
120
MMap *pkgMakeStatusCacheMem(pkgSourceList &List,OpProgress &Progress)
 
121
{
 
122
   MMap *Map = 0;
 
123
   if (pkgMakeStatusCache(List,Progress,&Map,true) == false)
 
124
      return 0;
 
125
   return Map;
 
126
}
 
127
#endif
119
128
 
120
129
#endif