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