version.cc 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 <apt-pkg/version.h>
  10. #include <apt-pkg/pkgcache.h>
  11. #include <stdlib.h>
  12. /*}}}*/
  13. static pkgVersioningSystem *VSList[10];
  14. pkgVersioningSystem **pkgVersioningSystem::GlobalList = VSList;
  15. unsigned long pkgVersioningSystem::GlobalListLen = 0;
  16. // pkgVS::pkgVersioningSystem - Constructor /*{{{*/
  17. // ---------------------------------------------------------------------
  18. /* Link to the global list of versioning systems supported */
  19. pkgVersioningSystem::pkgVersioningSystem()
  20. {
  21. VSList[GlobalListLen] = this;
  22. GlobalListLen++;
  23. }
  24. /*}}}*/
  25. // pkgVS::GetVS - Find a VS by name /*{{{*/
  26. // ---------------------------------------------------------------------
  27. /* */
  28. pkgVersioningSystem *pkgVersioningSystem::GetVS(const char *Label)
  29. {
  30. for (unsigned I = 0; I != GlobalListLen; I++)
  31. if (strcmp(VSList[I]->Label,Label) == 0)
  32. return VSList[I];
  33. return 0;
  34. }
  35. /*}}}*/