- initial import of revision 374 from cnc
[apt.git] / apt-pkg / version.cc
1 // -*- mode: cpp; mode: fold -*-
2 // Description                                                          /*{{{*/
3 // $Id: version.cc,v 1.1 2002/07/23 17:54:50 niemeyer Exp $
4 /* ######################################################################
5
6    Version - Versioning system..
7    
8    ##################################################################### */
9                                                                         /*}}}*/
10 // Include Files                                                        /*{{{*/
11 #ifdef __GNUG__
12 #pragma implementation "apt-pkg/version.h"
13 #endif 
14
15 #include <apt-pkg/version.h>
16 #include <apt-pkg/pkgcache.h>
17
18 #include <stdlib.h>
19                                                                         /*}}}*/
20     
21 static pkgVersioningSystem *VSList[10];
22 pkgVersioningSystem **pkgVersioningSystem::GlobalList = VSList;
23 unsigned long pkgVersioningSystem::GlobalListLen = 0;
24
25 // pkgVS::pkgVersioningSystem - Constructor                             /*{{{*/
26 // ---------------------------------------------------------------------
27 /* Link to the global list of versioning systems supported */
28 pkgVersioningSystem::pkgVersioningSystem()
29 {
30    VSList[GlobalListLen] = this;
31    GlobalListLen++;
32 }
33                                                                         /*}}}*/
34 // pkgVS::GetVS - Find a VS by name                                     /*{{{*/
35 // ---------------------------------------------------------------------
36 /* */
37 pkgVersioningSystem *pkgVersioningSystem::GetVS(const char *Label)
38 {
39    for (unsigned I = 0; I != GlobalListLen; I++)
40       if (strcmp(VSList[I]->Label,Label) == 0)
41          return VSList[I];
42    return 0;
43 }
44                                                                         /*}}}*/
45 // vim:sts=3:sw=3