]>
git.saurik.com Git - apt-legacy.git/blob - apt-pkg/pkgsystem.cc
1 // -*- mode: cpp; mode: fold -*-
3 // $Id: pkgsystem.cc,v 1.3 2004/02/27 00:43:16 mdz 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>
22 pkgSystem
*_system
= 0;
23 static pkgSystem
*SysList
[10];
24 pkgSystem
**pkgSystem::GlobalList
= SysList
;
25 unsigned long pkgSystem::GlobalListLen
= 0;
27 // System::pkgSystem - Constructor /*{{{*/
28 // ---------------------------------------------------------------------
29 /* Add it to the global list.. */
30 pkgSystem::pkgSystem()
32 assert(GlobalListLen
< sizeof(SysList
)/sizeof(*SysList
));
33 SysList
[GlobalListLen
] = this;
37 // System::GetSystem - Get the named system /*{{{*/
38 // ---------------------------------------------------------------------
40 pkgSystem
*pkgSystem::GetSystem(const char *Label
)
42 for (unsigned I
= 0; I
!= GlobalListLen
; I
++)
43 if (strcmp(SysList
[I
]->Label
,Label
) == 0)