| 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 | |
| 17 | static pkgVersioningSystem *VSList[10]; |
| 18 | pkgVersioningSystem **pkgVersioningSystem::GlobalList = VSList; |
| 19 | unsigned long pkgVersioningSystem::GlobalListLen = 0; |
| 20 | |
| 21 | // pkgVS::pkgVersioningSystem - Constructor /*{{{*/ |
| 22 | // --------------------------------------------------------------------- |
| 23 | /* Link to the global list of versioning systems supported */ |
| 24 | pkgVersioningSystem::pkgVersioningSystem() |
| 25 | { |
| 26 | VSList[GlobalListLen] = this; |
| 27 | GlobalListLen++; |
| 28 | } |
| 29 | /*}}}*/ |
| 30 | // pkgVS::GetVS - Find a VS by name /*{{{*/ |
| 31 | // --------------------------------------------------------------------- |
| 32 | /* */ |
| 33 | pkgVersioningSystem *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 | /*}}}*/ |