]>
git.saurik.com Git - apt.git/blob - apt-pkg/pkgsystem.cc
   1 // -*- mode: cpp; mode: fold -*- 
   3 // $Id: pkgsystem.cc,v 1.2 2001/02/20 07:03:17 jgg Exp $ 
   4 /* ###################################################################### 
   6    System - Abstraction for running on different systems. 
   8    Basic general structure.. 
  10    ##################################################################### */ 
  12 // Include Files                                                        /*{{{*/ 
  14 #pragma implementation "apt-pkg/pkgsystem.h" 
  17 #include <apt-pkg/pkgsystem.h> 
  18 #include <apt-pkg/policy.h> 
  21 pkgSystem 
*_system 
= 0; 
  22 static pkgSystem 
*SysList
[10]; 
  23 pkgSystem 
**pkgSystem::GlobalList 
= SysList
; 
  24 unsigned long pkgSystem::GlobalListLen 
= 0; 
  26 // System::pkgSystem - Constructor                                      /*{{{*/ 
  27 // --------------------------------------------------------------------- 
  28 /* Add it to the global list.. */ 
  29 pkgSystem::pkgSystem() 
  31    SysList
[GlobalListLen
] = this; 
  35 // System::GetSystem - Get the named system                             /*{{{*/ 
  36 // --------------------------------------------------------------------- 
  38 pkgSystem 
*pkgSystem::GetSystem(const char *Label
) 
  40    for (unsigned I 
= 0; I 
!= GlobalListLen
; I
++) 
  41       if (strcmp(SysList
[I
]->Label
,Label
) == 0)