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