cleanup
[fapman] / apt-src / version.cc
1 /*
2 Apt is copyright 1997, 1998, 1999 Jason Gunthorpe and others.
3 Apt is currently developed by APT Development Team <deity@lists.debian.org>.
4
5 License: GPLv2+
6
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.
11
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.
16
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
20
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.
24 */
25
26
27 // -*- mode: cpp; mode: fold -*-
28 // Description                                                          /*{{{*/
29 // $Id: version.cc,v 1.10 2001/02/20 07:03:17 jgg Exp $
30 /* ######################################################################
31
32    Version - Versioning system..
33    
34    ##################################################################### */
35                                                                         /*}}}*/
36 // Include Files                                                        /*{{{*/
37 #include "version.h"
38 #include "pkgcache.h"
39
40 #include <stdlib.h>
41                                                                         /*}}}*/
42     
43 static pkgVersioningSystem *VSList[10];
44 pkgVersioningSystem **pkgVersioningSystem::GlobalList = VSList;
45 unsigned long pkgVersioningSystem::GlobalListLen = 0;
46
47 // pkgVS::pkgVersioningSystem - Constructor                             /*{{{*/
48 // ---------------------------------------------------------------------
49 /* Link to the global list of versioning systems supported */
50 pkgVersioningSystem::pkgVersioningSystem()
51 {
52    VSList[GlobalListLen] = this;
53    GlobalListLen++;
54 }
55                                                                         /*}}}*/
56 // pkgVS::GetVS - Find a VS by name                                     /*{{{*/
57 // ---------------------------------------------------------------------
58 /* */
59 pkgVersioningSystem *pkgVersioningSystem::GetVS(const char *Label)
60 {
61    for (unsigned I = 0; I != GlobalListLen; I++)
62       if (strcmp(VSList[I]->Label,Label) == 0)
63          return VSList[I];
64    return 0;
65 }
66                                                                         /*}}}*/