]>
git.saurik.com Git - apple/security.git/blob - cdsa/cssm/modloader.cpp
2 * Copyright (c) 2000-2001 Apple Computer, Inc. All Rights Reserved.
4 * The contents of this file constitute Original Code as defined in and are
5 * subject to the Apple Public Source License Version 1.2 (the 'License').
6 * You may not use this file except in compliance with the License. Please obtain
7 * a copy of the License at http://www.apple.com/publicsource and read it before
10 * This Original Code and all software distributed under the License are
11 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
12 * OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
13 * LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14 * PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
15 * specific language governing rights and limitations under the License.
20 // cssm module loader interface - MACOS X (CFBundle/DYLD) version.
22 // This file provides a C++-style interface to CFBundles as managed by the CF-style
23 // system interfaces. The implementation looks a bit, well, hybrid - but the visible
24 // interfaces are pure C++.
26 #include "modloader.h"
27 #include "modload_plugin.h"
29 #if defined(BUILTIN_PLUGINS)
30 # include "modload_static.h"
31 # include "AppleCSP/AppleCSP/AppleCSP.h"
32 # include "AppleCSPDL/CSPDLPlugin.h"
33 # include "AppleDL/AppleFileDL.h"
34 # include "AppleX509CL/AppleX509CL.h"
35 # include "AppleX509TP/AppleTP.h"
36 #endif //BUILTIN_PLUGINS
43 // Construct a ModuleLoader object.
45 ModuleLoader::ModuleLoader()
47 #if defined(BUILTIN_PLUGINS)
48 mPlugins
["*AppleCSP"] = new StaticPlugin
<AppleCSPPlugin
>;
49 mPlugins
["*AppleDL"] = new StaticPlugin
<AppleFileDL
>;
50 mPlugins
["*AppleCSPDL"] = new StaticPlugin
<CSPDLPlugin
>;
51 mPlugins
["*AppleX509CL"] = new StaticPlugin
<AppleX509CL
>;
52 mPlugins
["*AppleX509TP"] = new StaticPlugin
<AppleTP
>;
53 #endif //BUILTIN_PLUGINS
58 // "Load" a plugin, given its MDS path. At this layer, we are performing
59 // a purely physical load operation. No code in the plugin is called.
60 // If "built-in plugins" are enabled, the moduleTable will come pre-initialized
61 // with certain paths. Since we consult this table before going to disk, this
62 // means that we'll pick these up first *as long as the paths match exactly*.
63 // There is nothing magical in the path strings themselves, other than by
66 Plugin
*ModuleLoader::operator () (const char *path
)
68 Plugin
* &plugin
= mPlugins
[path
];
70 plugin
= new LoadablePlugin(path
);
75 } // end namespace Security