]> git.saurik.com Git - apt.git/blame_incremental - apt-pkg/version.cc
merged from lp:~donkult/apt/sid/
[apt.git] / apt-pkg / version.cc
... / ...
CommitLineData
1// -*- mode: cpp; mode: fold -*-
2// Description /*{{{*/
3// $Id: version.cc,v 1.10 2001/02/20 07:03:17 jgg Exp $
4/* ######################################################################
5
6 Version - Versioning system..
7
8 ##################################################################### */
9 /*}}}*/
10// Include Files /*{{{*/
11#include <apt-pkg/version.h>
12#include <apt-pkg/pkgcache.h>
13
14#include <stdlib.h>
15 /*}}}*/
16
17static pkgVersioningSystem *VSList[10];
18pkgVersioningSystem **pkgVersioningSystem::GlobalList = VSList;
19unsigned long pkgVersioningSystem::GlobalListLen = 0;
20
21// pkgVS::pkgVersioningSystem - Constructor /*{{{*/
22// ---------------------------------------------------------------------
23/* Link to the global list of versioning systems supported */
24pkgVersioningSystem::pkgVersioningSystem()
25{
26 VSList[GlobalListLen] = this;
27 GlobalListLen++;
28}
29 /*}}}*/
30// pkgVS::GetVS - Find a VS by name /*{{{*/
31// ---------------------------------------------------------------------
32/* */
33pkgVersioningSystem *pkgVersioningSystem::GetVS(const char *Label)
34{
35 for (unsigned I = 0; I != GlobalListLen; I++)
36 if (strcmp(VSList[I]->Label,Label) == 0)
37 return VSList[I];
38 return 0;
39}
40 /*}}}*/