2 Apt is copyright 1997, 1998, 1999 Jason Gunthorpe and others.
3 Apt is currently developed by APT Development Team <deity@lists.debian.org>.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 See /usr/share/common-licenses/GPL-2, or
22 <http://www.gnu.org/copyleft/gpl.txt> for the terms of the latest version
23 of the GNU General Public License.
26 // -*- mode: cpp; mode: fold -*-
27 // Description /*{{{*/
28 // $Id: debversion.h,v 1.3 2001/05/03 05:25:04 jgg Exp $
29 /* ######################################################################
31 Debian Version - Versioning system for Debian
33 This implements the standard Debian versioning system.
35 ##################################################################### */
37 #ifndef PKGLIB_DEBVERSION_H
38 #define PKGLIB_DEBVERSION_H
44 class debVersioningSystem : public pkgVersioningSystem
48 static int CmpFragment(const char *A, const char *AEnd, const char *B,
52 virtual int DoCmpVersion(const char *A,const char *Aend,
53 const char *B,const char *Bend);
54 virtual bool CheckDep(const char *PkgVer,int Op,const char *DepVer);
55 virtual int DoCmpReleaseVer(const char *A,const char *Aend,
56 const char *B,const char *Bend)
58 return DoCmpVersion(A,Aend,B,Bend);
60 virtual string UpstreamVersion(const char *A);
62 debVersioningSystem();
65 extern debVersioningSystem debVS;
67 #ifdef APT_COMPATIBILITY
68 #if APT_COMPATIBILITY != 986
69 #warning "Using APT_COMPATIBILITY"
72 inline int pkgVersionCompare(const char *A, const char *B)
74 return debVS.CmpVersion(A,B);
76 inline int pkgVersionCompare(const char *A, const char *AEnd,
77 const char *B, const char *BEnd)
79 return debVS.DoCmpVersion(A,AEnd,B,BEnd);
81 inline int pkgVersionCompare(string A,string B)
83 return debVS.CmpVersion(A,B);
85 inline bool pkgCheckDep(const char *DepVer,const char *PkgVer,int Op)
87 return debVS.CheckDep(PkgVer,Op,DepVer);
89 inline string pkgBaseVersion(const char *Ver)
91 return debVS.UpstreamVersion(Ver);