~mvo/apt/dep8

« back to all changes in this revision

Viewing changes to apt-pkg/deb/debversion.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
// -*- mode: cpp; mode: fold -*-
 
2
// Description                                                          /*{{{*/
 
3
// $Id: debversion.h,v 1.2 2001/02/20 07:03:17 jgg Exp $
 
4
/* ######################################################################
 
5
 
 
6
   Debian Version - Versioning system for Debian
 
7
 
 
8
   This implements the standard Debian versioning system.
 
9
   
 
10
   ##################################################################### */
 
11
                                                                        /*}}}*/
 
12
#ifndef PKGLIB_DEBVERSION_H
 
13
#define PKGLIB_DEBVERSION_H
 
14
 
 
15
#ifdef __GNUG__
 
16
#pragma interface "apt-pkg/debversion.h"
 
17
#endif 
 
18
 
 
19
#include <apt-pkg/version.h>
 
20
    
 
21
class debVersioningSystem : public pkgVersioningSystem
 
22
{  
 
23
   static int CmpFragment(const char *A, const char *AEnd, const char *B,
 
24
                          const char *BEnd);
 
25
   
 
26
   public:
 
27
   
 
28
   // Compare versions..
 
29
   virtual int DoCmpVersion(const char *A,const char *Aend,
 
30
                          const char *B,const char *Bend);
 
31
   virtual bool CheckDep(const char *PkgVer,int Op,const char *DepVer);
 
32
   virtual int DoCmpReleaseVer(const char *A,const char *Aend,
 
33
                             const char *B,const char *Bend)
 
34
   {
 
35
      return DoCmpVersion(A,Aend,B,Bend);
 
36
   }   
 
37
   virtual string UpstreamVersion(const char *A);
 
38
 
 
39
   debVersioningSystem();
 
40
};
 
41
 
 
42
extern debVersioningSystem debVS;
 
43
 
 
44
#ifdef APT_COMPATIBILITY
 
45
#if APT_COMPATIBILITY != 986
 
46
#warning "Using APT_COMPATIBILITY"
 
47
#endif
 
48
 
 
49
inline int pkgVersionCompare(const char *A, const char *B)
 
50
{
 
51
   return debVS.CmpVersion(A,B);
 
52
}
 
53
inline int pkgVersionCompare(const char *A, const char *AEnd, 
 
54
                             const char *B, const char *BEnd)
 
55
{
 
56
   return debVS.DoCmpVersion(A,AEnd,B,BEnd);
 
57
}
 
58
inline int pkgVersionCompare(string A,string B)
 
59
{
 
60
   return debVS.CmpVersion(A,B);
 
61
}
 
62
inline bool pkgCheckDep(const char *DepVer,const char *PkgVer,int Op)
 
63
{
 
64
   return debVS.CheckDep(PkgVer,Op,DepVer);
 
65
}
 
66
inline string pkgBaseVersion(const char *Ver)
 
67
{
 
68
   return debVS.UpstreamVersion(Ver);
 
69
}
 
70
#endif
 
71
 
 
72
#endif