version.cc 1.3 KB

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