]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/mag/plugins/src/plugin.cc
d616dcfc400d8a27590b4714e0e0a5496e21c8e3
[l4.git] / l4 / pkg / mag / plugins / src / plugin.cc
1 /*
2  * (c) 2010 Technische Universität Dresden
3  * This file is part of TUD:OS and distributed under the terms of the
4  * GNU General Public License 2.
5  * Please see the COPYING-GPL-2 file for details.
6  */
7 #include <l4/mag/server/plugin>
8 #include <cstdio>
9
10 namespace Mag_server {
11
12 Plugin *Plugin::_first __attribute__((visibility("hidden")));
13
14 class Plugin_manager
15 {
16 public:
17   static void init(Core_api *core)
18   {
19     printf("core-init\n");
20     for (Plugin *p = Plugin::_first; p; p = p->_next)
21       {
22         printf("plugin: %p\n", p);
23       if (!p->started())
24         {
25           printf("starting %s plugin: %s\n", p->type(), p->name());
26           p->start(core);
27         }
28       }
29   }
30 };
31
32
33 extern "C" void init_plugin(Core_api *core)
34 {
35   Plugin_manager::init(core);
36 }
37
38 }