]> git.saurik.com Git - apt.git/blame_incremental - apt-pkg/version.cc
* apt-pkg/pkgcachegen.cc:
[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#ifdef __GNUG__
12#pragma implementation "apt-pkg/version.h"
13#endif
14
15#include <apt-pkg/version.h>
16#include <apt-pkg/pkgcache.h>
17
18#include <stdlib.h>
19 /*}}}*/
20
21static pkgVersioningSystem *VSList[10];
22pkgVersioningSystem **pkgVersioningSystem::GlobalList = VSList;
23unsigned long pkgVersioningSystem::GlobalListLen = 0;
24
25// pkgVS::pkgVersioningSystem - Constructor /*{{{*/
26// ---------------------------------------------------------------------
27/* Link to the global list of versioning systems supported */
28pkgVersioningSystem::pkgVersioningSystem()
29{
30 VSList[GlobalListLen] = this;
31 GlobalListLen++;
32}
33 /*}}}*/
34// pkgVS::GetVS - Find a VS by name /*{{{*/
35// ---------------------------------------------------------------------
36/* */
37pkgVersioningSystem *pkgVersioningSystem::GetVS(const char *Label)
38{
39 for (unsigned I = 0; I != GlobalListLen; I++)
40 if (strcmp(VSList[I]->Label,Label) == 0)
41 return VSList[I];
42 return 0;
43}
44 /*}}}*/