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