// http://www.apache.org/licenses/LICENSE-2.0 // Copyright 2014 Perttu Ahola #pragma once #include "core/json.h" #include "interface/event.h" #include "interface/server.h" #include "interface/module.h" #include namespace loader { struct ModuleDependency { ss_ module; bool optional = false; }; struct ModuleMeta { ss_ cxxflags; ss_ ldflags; sv_ dependencies; sv_ reverse_dependencies; }; struct ModuleInfo { ss_ name; ss_ path; ModuleMeta meta; }; struct Interface { virtual void activate() = 0; virtual ModuleInfo* get_module_info(const ss_ &name) = 0; }; inline bool access(interface::Server *server, std::function cb) { return server->access_module("loader", [&](interface::Module * module){ cb((loader::Interface*)module->check_interface()); }); } } // vim: set noet ts=4 sw=4: