diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 18:07:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 18:07:13 +0000 |
commit | 636c7dc17286d93d788c741d15fd756aeda066d5 (patch) | |
tree | e7ae158cc54f591041a061b9865bcae51854f15c /apt-pkg/version.cc | |
parent | Initial commit. (diff) | |
download | apt-636c7dc17286d93d788c741d15fd756aeda066d5.tar.xz apt-636c7dc17286d93d788c741d15fd756aeda066d5.zip |
Adding upstream version 1.8.2.3.upstream/1.8.2.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'apt-pkg/version.cc')
-rw-r--r-- | apt-pkg/version.cc | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/apt-pkg/version.cc b/apt-pkg/version.cc new file mode 100644 index 0000000..e0b83e0 --- /dev/null +++ b/apt-pkg/version.cc @@ -0,0 +1,44 @@ +// -*- mode: cpp; mode: fold -*- +// Description /*{{{*/ +/* ###################################################################### + + Version - Versioning system.. + + ##################################################################### */ + /*}}}*/ +// Include Files /*{{{*/ +#include <config.h> + +#include <apt-pkg/version.h> + +#include <stdlib.h> +#include <string.h> + /*}}}*/ + +static pkgVersioningSystem *VSList[10]; +pkgVersioningSystem **pkgVersioningSystem::GlobalList = VSList; +unsigned long pkgVersioningSystem::GlobalListLen = 0; + +// pkgVS::pkgVersioningSystem - Constructor /*{{{*/ +// --------------------------------------------------------------------- +/* Link to the global list of versioning systems supported */ +pkgVersioningSystem::pkgVersioningSystem() : Label(NULL) +{ + VSList[GlobalListLen] = this; + ++GlobalListLen; +} + /*}}}*/ +// pkgVS::GetVS - Find a VS by name /*{{{*/ +// --------------------------------------------------------------------- +/* */ +pkgVersioningSystem *pkgVersioningSystem::GetVS(const char *Label) +{ + for (unsigned I = 0; I != GlobalListLen; I++) + if (strcmp(VSList[I]->Label,Label) == 0) + return VSList[I]; + return 0; +} + /*}}}*/ + + +pkgVersioningSystem::~pkgVersioningSystem() {} |