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.
28 // -*- mode: cpp; mode: fold -*-
29 // Description /*{{{*/
30 // $Id: version.h,v 1.8 2001/05/27 05:55:27 jgg Exp $
31 /* ######################################################################
33 Version - Versioning system..
35 The versioning system represents how versions are compared, represented
36 and how dependencies are evaluated. As a general rule versioning
37 systems are not compatible unless specifically allowed by the
38 TestCompatibility query.
40 The versions are stored in a global list of versions, but that is just
41 so that they can be queried when someone does 'apt-get -v'.
42 pkgSystem provides the proper means to access the VS for the active
45 ##################################################################### */
47 #ifndef PKGLIB_VERSION_H
48 #define PKGLIB_VERSION_H
56 class pkgVersioningSystem
59 // Global list of VS's
60 static pkgVersioningSystem **GlobalList;
61 static unsigned long GlobalListLen;
62 static pkgVersioningSystem *GetVS(const char *Label);
67 virtual int DoCmpVersion(const char *A,const char *Aend,
68 const char *B,const char *Bend) = 0;
70 virtual bool CheckDep(const char *PkgVer,int Op,const char *DepVer) = 0;
71 virtual int DoCmpReleaseVer(const char *A,const char *Aend,
72 const char *B,const char *Bend) = 0;
73 virtual string UpstreamVersion(const char *A) = 0;
75 // See if the given VS is compatible with this one..
76 virtual bool TestCompatibility(pkgVersioningSystem const &Against)
77 {return this == &Against;};
80 APT_MKSTRCMP(CmpVersion,DoCmpVersion);
81 APT_MKSTRCMP(CmpReleaseVer,DoCmpReleaseVer);
83 pkgVersioningSystem();
84 virtual ~pkgVersioningSystem() {};
87 #ifdef APT_COMPATIBILITY
88 #include "debversion.h"