]> git.saurik.com Git - apt.git/blob - apt-pkg/deb/debversion.h
Open 0.5.31
[apt.git] / apt-pkg / deb / debversion.h
1 // -*- mode: cpp; mode: fold -*-
2 // Description /*{{{*/
3 // $Id: debversion.h,v 1.3 2001/05/03 05:25:04 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 public:
24
25 static int CmpFragment(const char *A, const char *AEnd, const char *B,
26 const char *BEnd);
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