]>
Commit | Line | Data |
---|---|---|
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 | ||
16 | ||
17 | #include <apt-pkg/version.h> | |
18 | ||
19 | class debVersioningSystem : public pkgVersioningSystem | |
20 | { | |
21 | public: | |
22 | ||
23 | static int CmpFragment(const char *A, const char *AEnd, const char *B, | |
24 | const char *BEnd); | |
25 | ||
26 | // Compare versions.. | |
27 | virtual int DoCmpVersion(const char *A,const char *Aend, | |
28 | const char *B,const char *Bend); | |
29 | virtual bool CheckDep(const char *PkgVer,int Op,const char *DepVer); | |
30 | virtual int DoCmpReleaseVer(const char *A,const char *Aend, | |
31 | const char *B,const char *Bend) | |
32 | { | |
33 | return DoCmpVersion(A,Aend,B,Bend); | |
34 | } | |
35 | virtual string UpstreamVersion(const char *A); | |
36 | ||
37 | debVersioningSystem(); | |
38 | }; | |
39 | ||
40 | extern debVersioningSystem debVS; | |
41 | ||
42 | #ifdef APT_COMPATIBILITY | |
43 | #if APT_COMPATIBILITY != 986 | |
44 | #warning "Using APT_COMPATIBILITY" | |
45 | #endif | |
46 | ||
47 | inline int pkgVersionCompare(const char *A, const char *B) | |
48 | { | |
49 | return debVS.CmpVersion(A,B); | |
50 | } | |
51 | inline int pkgVersionCompare(const char *A, const char *AEnd, | |
52 | const char *B, const char *BEnd) | |
53 | { | |
54 | return debVS.DoCmpVersion(A,AEnd,B,BEnd); | |
55 | } | |
56 | inline int pkgVersionCompare(string A,string B) | |
57 | { | |
58 | return debVS.CmpVersion(A,B); | |
59 | } | |
60 | inline bool pkgCheckDep(const char *DepVer,const char *PkgVer,int Op) | |
61 | { | |
62 | return debVS.CheckDep(PkgVer,Op,DepVer); | |
63 | } | |
64 | inline string pkgBaseVersion(const char *Ver) | |
65 | { | |
66 | return debVS.UpstreamVersion(Ver); | |
67 | } | |
68 | #endif | |
69 | ||
70 | #endif |