Two small bug fixes
[ntk/apt.git] / apt-pkg / pkgsystem.cc
CommitLineData
b2e465d6
AL
1// -*- mode: cpp; mode: fold -*-
2// Description /*{{{*/
3// $Id: pkgsystem.cc,v 1.2 2001/02/20 07:03:17 jgg Exp $
4/* ######################################################################
5
6 System - Abstraction for running on different systems.
7
8 Basic general structure..
9
10 ##################################################################### */
11 /*}}}*/
12// Include Files /*{{{*/
13#ifdef __GNUG__
14#pragma implementation "apt-pkg/pkgsystem.h"
15#endif
16
17#include <apt-pkg/pkgsystem.h>
18#include <apt-pkg/policy.h>
19 /*}}}*/
20
21pkgSystem *_system = 0;
22static pkgSystem *SysList[10];
23pkgSystem **pkgSystem::GlobalList = SysList;
24unsigned long pkgSystem::GlobalListLen = 0;
25
26// System::pkgSystem - Constructor /*{{{*/
27// ---------------------------------------------------------------------
28/* Add it to the global list.. */
29pkgSystem::pkgSystem()
30{
31 SysList[GlobalListLen] = this;
32 GlobalListLen++;
33}
34 /*}}}*/
35// System::GetSystem - Get the named system /*{{{*/
36// ---------------------------------------------------------------------
37/* */
38pkgSystem *pkgSystem::GetSystem(const char *Label)
39{
40 for (unsigned I = 0; I != GlobalListLen; I++)
41 if (strcmp(SysList[I]->Label,Label) == 0)
42 return SysList[I];
43 return 0;
44}
45 /*}}}*/