From 19b4e58944aa3f0ee13140873f9f9764de12eeb5 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Tue, 14 Aug 2018 15:51:57 -0700 Subject: [PATCH] ircd::m: Rename modules map to imports. --- include/ircd/m/import.h | 4 ++-- ircd/m/m.cc | 14 +++++++------- modules/console.cc | 10 +++++----- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/ircd/m/import.h b/include/ircd/m/import.h index 34475b39f..e2016220e 100644 --- a/include/ircd/m/import.h +++ b/include/ircd/m/import.h @@ -15,7 +15,7 @@ namespace ircd::m { template struct import; - extern std::map> modules; + extern std::map> imports; } template @@ -58,7 +58,7 @@ ircd::m::import::reload() try { auto &import(static_cast &>(*this)); - import = { modules.at(modname), symname }; + import = { imports.at(modname), symname }; } catch(const std::out_of_range &e) { diff --git a/ircd/m/m.cc b/ircd/m/m.cc index 6ded84987..866aee107 100644 --- a/ircd/m/m.cc +++ b/ircd/m/m.cc @@ -144,8 +144,8 @@ try } // Manually load first modules - m::modules.emplace("vm"s, "vm"s); - m::modules.emplace("vm_fetch"s, "vm_fetch"s); + m::imports.emplace("vm"s, "vm"s); + m::imports.emplace("vm_fetch"s, "vm_fetch"s); // The order of these prefixes will be the loading order. Order of // specific modules within a prefix is not determined here. @@ -158,10 +158,10 @@ try for(const auto &prefix : prefixes) for(const auto &name : mods::available()) if(startswith(name, prefix)) - m::modules.emplace(name, name); + m::imports.emplace(name, name); // Manually load last modules - m::modules.emplace("webroot"s, "webroot"s); + m::imports.emplace("webroot"s, "webroot"s); } catch(...) { @@ -171,7 +171,7 @@ catch(...) ircd::m::init::modules::~modules() noexcept { - m::modules.clear(); + m::imports.clear(); } namespace ircd::m @@ -3598,8 +3598,8 @@ ircd::m::_hook_match(const m::event &matching, // m/import.h // -decltype(ircd::m::modules) -ircd::m::modules +decltype(ircd::m::imports) +ircd::m::imports {}; /////////////////////////////////////////////////////////////////////////////// diff --git a/modules/console.cc b/modules/console.cc index e6b75d43c..fc49fbb83 100644 --- a/modules/console.cc +++ b/modules/console.cc @@ -751,7 +751,7 @@ console_cmd__mod__reload(opt &out, const string_view &line) for(auto it(names.begin()); it != names.end(); ++it) { const auto &name{*it}; - if(m::modules.erase(std::string{name})) + if(m::imports.erase(std::string{name})) out << name << " unloaded." << std::endl; else out << name << " is not loaded." << std::endl; @@ -760,7 +760,7 @@ console_cmd__mod__reload(opt &out, const string_view &line) for(auto it(names.rbegin()); it != names.rend(); ++it) { const auto &name{*it}; - if(m::modules.emplace(std::string{name}, name).second) + if(m::imports.emplace(std::string{name}, name).second) out << name << " loaded." << std::endl; else out << name << " is already loaded." << std::endl; @@ -775,13 +775,13 @@ console_cmd__mod__load(opt &out, const string_view &line) tokens(line, ' ', [&out] (const string_view &name) { - if(m::modules.find(name) != end(m::modules)) + if(m::imports.find(name) != end(m::imports)) { out << name << " is already loaded." << std::endl; return; } - m::modules.emplace(std::string{name}, name); + m::imports.emplace(std::string{name}, name); out << name << " loaded." << std::endl; }); @@ -794,7 +794,7 @@ console_cmd__mod__unload(opt &out, const string_view &line) tokens(line, ' ', [&out] (const string_view &name) { - if(!m::modules.erase(std::string{name})) + if(!m::imports.erase(std::string{name})) { out << name << " is not loaded." << std::endl; return;