mirror of
https://github.com/matrix-construct/construct
synced 2024-11-25 16:22:35 +01:00
modules: Disperse modules to eliminate the s_ prefix-space.
This commit is contained in:
parent
2301d378fa
commit
7843925335
21 changed files with 79 additions and 90 deletions
|
@ -50,7 +50,7 @@ of the daemon has a unique _servername_.
|
|||
to point at Riot's `webapp/` directory by entering the following:
|
||||
```
|
||||
conf set ircd.webroot.path /path/to/riot-web/webapp/
|
||||
mod reload webroot
|
||||
mod reload index
|
||||
```
|
||||
|
||||
6. Browse to `https://host.tld:8448/` and register a user.
|
||||
|
|
|
@ -86,7 +86,7 @@ IRCD_MAPI_VERSION
|
|||
constexpr const ircd::mapi::serial_t
|
||||
IRCD_MAPI_SERIAL
|
||||
{
|
||||
3
|
||||
4
|
||||
};
|
||||
|
||||
/// Module Header
|
||||
|
|
56
ircd/m.cc
56
ircd/m.cc
|
@ -100,7 +100,7 @@ catch(const m::error &e)
|
|||
void
|
||||
ircd::m::init::close()
|
||||
{
|
||||
mods::imports.erase("s_listen"s);
|
||||
mods::imports.erase("net_listener"s);
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -165,7 +165,7 @@ ircd::m::init::modules::fini_imports()
|
|||
noexcept
|
||||
{
|
||||
// Stop the vm (unload) this first even though it loads first.
|
||||
mods::imports.erase("vm");
|
||||
mods::imports.erase("m_vm");
|
||||
|
||||
for(auto it(module_names.rbegin()); it != module_names.rend(); ++it)
|
||||
mods::imports.erase(*it);
|
||||
|
@ -177,16 +177,16 @@ noexcept
|
|||
decltype(ircd::m::module_names)
|
||||
ircd::m::module_names
|
||||
{
|
||||
"vm",
|
||||
"s_conf",
|
||||
"s_node",
|
||||
"s_keys",
|
||||
"s_dns",
|
||||
"s_fetch",
|
||||
"s_command",
|
||||
"s_control",
|
||||
"s_listen",
|
||||
"s_feds",
|
||||
"m_vm",
|
||||
"conf",
|
||||
"m_node",
|
||||
"m_keys",
|
||||
"net_dns",
|
||||
"m_fetch",
|
||||
"m_command",
|
||||
"m_control",
|
||||
"net_listener",
|
||||
"m_feds",
|
||||
"m_events",
|
||||
"m_rooms",
|
||||
"m_user",
|
||||
|
@ -286,9 +286,9 @@ ircd::m::module_names
|
|||
"identity_pubkey",
|
||||
"identity_v1",
|
||||
"well_known",
|
||||
"metrics",
|
||||
"stats",
|
||||
"webhook",
|
||||
"webroot",
|
||||
"index",
|
||||
};
|
||||
|
||||
/// This is a list of modules that are considered "optional" and any loading
|
||||
|
@ -537,7 +537,7 @@ ircd::m::self::init::init(const string_view &origin,
|
|||
// inits of m::self::globals. Calling the inits directly from
|
||||
// here makes the module dependent on libircd and unloadable.
|
||||
assert(ircd::run::level == run::level::START);
|
||||
mods::imports.emplace("s_keys"s, "s_keys"s);
|
||||
mods::imports.emplace("m_keys"s, "m_keys"s);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -558,7 +558,7 @@ ircd::m::fetch::state_ids(const room &r)
|
|||
|
||||
static mods::import<prototype> call
|
||||
{
|
||||
"s_fetch", "ircd::m::fetch::state_ids"
|
||||
"m_fetch", "ircd::m::fetch::state_ids"
|
||||
};
|
||||
|
||||
call(r);
|
||||
|
@ -572,7 +572,7 @@ ircd::m::fetch::auth_chain(const room &r,
|
|||
|
||||
static mods::import<prototype> call
|
||||
{
|
||||
"s_fetch", "ircd::m::fetch::auth_chain"
|
||||
"m_fetch", "ircd::m::fetch::auth_chain"
|
||||
};
|
||||
|
||||
call(r, hp);
|
||||
|
@ -585,7 +585,7 @@ ircd::m::fetch::synchronize(const m::room &room)
|
|||
|
||||
static mods::import<prototype> call
|
||||
{
|
||||
"s_fetch", "ircd::m::fetch::synchronize"
|
||||
"m_fetch", "ircd::m::fetch::synchronize"
|
||||
};
|
||||
|
||||
return call(room);
|
||||
|
@ -599,7 +599,7 @@ ircd::m::fetch::prefetch(const m::room::id &room_id,
|
|||
|
||||
static mods::import<prototype> call
|
||||
{
|
||||
"s_fetch", "ircd::m::fetch::prefetch"
|
||||
"m_fetch", "ircd::m::fetch::prefetch"
|
||||
};
|
||||
|
||||
return call(room_id, event_id);
|
||||
|
@ -613,7 +613,7 @@ ircd::m::fetch::start(const m::room::id &room_id,
|
|||
|
||||
static mods::import<prototype> call
|
||||
{
|
||||
"s_fetch", "ircd::m::fetch::start"
|
||||
"m_fetch", "ircd::m::fetch::start"
|
||||
};
|
||||
|
||||
return call(room_id, event_id);
|
||||
|
@ -626,7 +626,7 @@ ircd::m::fetch::cancel(request &r)
|
|||
|
||||
static mods::import<prototype> call
|
||||
{
|
||||
"s_fetch", "ircd::m::fetch::cancel"
|
||||
"m_fetch", "ircd::m::fetch::cancel"
|
||||
};
|
||||
|
||||
return call(r);
|
||||
|
@ -639,7 +639,7 @@ ircd::m::fetch::exists(const m::event::id &event_id)
|
|||
|
||||
static mods::import<prototype> call
|
||||
{
|
||||
"s_fetch", "ircd::m::fetch::exists"
|
||||
"m_fetch", "ircd::m::fetch::exists"
|
||||
};
|
||||
|
||||
return call(event_id);
|
||||
|
@ -652,7 +652,7 @@ ircd::m::fetch::for_each(const std::function<bool (request &)> &closure)
|
|||
|
||||
static mods::import<prototype> call
|
||||
{
|
||||
"s_fetch", "ircd::m::fetch::for_each"
|
||||
"m_fetch", "ircd::m::fetch::for_each"
|
||||
};
|
||||
|
||||
return call(closure);
|
||||
|
@ -1260,7 +1260,7 @@ ircd::m::feds::acquire::acquire(const vector_view<const opts> &o,
|
|||
|
||||
static mods::import<prototype> call
|
||||
{
|
||||
"s_feds", "ircd::m::feds::execute"
|
||||
"m_feds", "ircd::m::feds::execute"
|
||||
};
|
||||
|
||||
call(o, c);
|
||||
|
@ -1694,7 +1694,7 @@ ircd::m::vm::eval::operator()(const room &room,
|
|||
|
||||
static mods::import<prototype> call
|
||||
{
|
||||
"vm", "ircd::m::vm::inject"
|
||||
"m_vm", "ircd::m::vm::inject"
|
||||
};
|
||||
|
||||
vm::dock.wait([]
|
||||
|
@ -1715,7 +1715,7 @@ ircd::m::vm::eval::operator()(json::iov &event,
|
|||
|
||||
static mods::import<prototype> call
|
||||
{
|
||||
"vm", "ircd::m::vm::inject"
|
||||
"m_vm", "ircd::m::vm::inject"
|
||||
};
|
||||
|
||||
vm::dock.wait([]
|
||||
|
@ -1733,7 +1733,7 @@ ircd::m::vm::eval::operator()(const event &event)
|
|||
|
||||
static mods::import<prototype> call
|
||||
{
|
||||
"vm", "ircd::m::vm::execute"
|
||||
"m_vm", "ircd::m::vm::execute"
|
||||
};
|
||||
|
||||
vm::dock.wait([]
|
||||
|
@ -2383,7 +2383,7 @@ const
|
|||
//TODO: Remove this import once this callsite is outside of libircd.
|
||||
static mods::import<prototype> call
|
||||
{
|
||||
"s_keys", "ircd::m::keys::get"
|
||||
"m_keys", "ircd::m::keys::get"
|
||||
};
|
||||
|
||||
call(node_id, key_id, [&closure, &key_id]
|
||||
|
|
20
ircd/net.cc
20
ircd/net.cc
|
@ -4066,7 +4066,7 @@ ircd::net::dns::resolve(const hostport &hp,
|
|||
|
||||
static mods::import<prototype> call
|
||||
{
|
||||
"s_dns", "ircd::net::dns::resolve"
|
||||
"net_dns", "ircd::net::dns::resolve"
|
||||
};
|
||||
|
||||
call(hp, op, std::move(cb));
|
||||
|
@ -4081,7 +4081,7 @@ ircd::net::dns::resolve(const hostport &hp,
|
|||
|
||||
static mods::import<prototype> call
|
||||
{
|
||||
"s_dns", "ircd::net::dns::resolve"
|
||||
"net_dns", "ircd::net::dns::resolve"
|
||||
};
|
||||
|
||||
call(hp, op, std::move(cb));
|
||||
|
@ -4096,7 +4096,7 @@ ircd::net::dns::resolve(const hostport &hp,
|
|||
|
||||
static mods::import<prototype> call
|
||||
{
|
||||
"s_dns", "ircd::net::dns::resolve"
|
||||
"net_dns", "ircd::net::dns::resolve"
|
||||
};
|
||||
|
||||
call(hp, op, std::move(cb));
|
||||
|
@ -4169,12 +4169,12 @@ ircd::net::dns::expired(const json::object &rr,
|
|||
{
|
||||
static mods::import<conf::item<seconds>> min_ttl
|
||||
{
|
||||
"s_dns", "ircd::net::dns::cache::min_ttl"
|
||||
"net_dns", "ircd::net::dns::cache::min_ttl"
|
||||
};
|
||||
|
||||
static mods::import<conf::item<seconds>> error_ttl
|
||||
{
|
||||
"s_dns", "ircd::net::dns::cache::error_ttl"
|
||||
"net_dns", "ircd::net::dns::cache::error_ttl"
|
||||
};
|
||||
|
||||
const conf::item<seconds> &min_ttl_item
|
||||
|
@ -4261,7 +4261,7 @@ try
|
|||
|
||||
static mods::import<prototype> call
|
||||
{
|
||||
"s_dns", "ircd::net::dns::cache::put"
|
||||
"net_dns", "ircd::net::dns::cache::put"
|
||||
};
|
||||
|
||||
return call(h, o, r, m);
|
||||
|
@ -4289,7 +4289,7 @@ try
|
|||
|
||||
static mods::import<prototype> call
|
||||
{
|
||||
"s_dns", "ircd::net::dns::cache::put"
|
||||
"net_dns", "ircd::net::dns::cache::put"
|
||||
};
|
||||
|
||||
return call(h, o, r);
|
||||
|
@ -4323,7 +4323,7 @@ try
|
|||
|
||||
static mods::import<prototype> call
|
||||
{
|
||||
"s_dns", "ircd::net::dns::cache::get"
|
||||
"net_dns", "ircd::net::dns::cache::get"
|
||||
};
|
||||
|
||||
return call(h, o, c);
|
||||
|
@ -4350,7 +4350,7 @@ ircd::net::dns::cache::for_each(const hostport &h,
|
|||
|
||||
static mods::import<prototype> call
|
||||
{
|
||||
"s_dns", "ircd::net::dns::cache::for_each"
|
||||
"net_dns", "ircd::net::dns::cache::for_each"
|
||||
};
|
||||
|
||||
return call(h, o, c);
|
||||
|
@ -4364,7 +4364,7 @@ ircd::net::dns::cache::for_each(const string_view &type,
|
|||
|
||||
static mods::import<prototype> call
|
||||
{
|
||||
"s_dns", "ircd::net::dns::cache::for_each"
|
||||
"net_dns", "ircd::net::dns::cache::for_each"
|
||||
};
|
||||
|
||||
return call(type, c);
|
||||
|
|
|
@ -67,51 +67,26 @@ endif
|
|||
|
||||
moduledir = @moduledir@
|
||||
|
||||
webroot_la_SOURCES = webroot.cc
|
||||
webhook_la_SOURCES = webhook.cc
|
||||
conf_la_SOURCES = conf.cc
|
||||
stats_la_SOURCES = stats.cc
|
||||
net_dns_la_SOURCES = net_dns.cc net_dns_resolver.cc
|
||||
net_listener_la_SOURCES = net_listener.cc
|
||||
console_la_SOURCES = console.cc
|
||||
vm_la_SOURCES = vm.cc
|
||||
metrics_la_SOURCES = metrics.cc
|
||||
index_la_SOURCES = index.cc
|
||||
webhook_la_SOURCES = webhook.cc
|
||||
well_known_la_SOURCES = well_known.cc
|
||||
|
||||
module_LTLIBRARIES = \
|
||||
webroot.la \
|
||||
webhook.la \
|
||||
conf.la \
|
||||
stats.la \
|
||||
net_dns.la \
|
||||
net_listener.la \
|
||||
console.la \
|
||||
vm.la \
|
||||
metrics.la \
|
||||
index.la \
|
||||
webhook.la \
|
||||
well_known.la \
|
||||
###
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Server modules
|
||||
#
|
||||
|
||||
s_moduledir = @moduledir@
|
||||
|
||||
s_conf_la_SOURCES = s_conf.cc
|
||||
s_control_la_SOURCES = s_control.cc
|
||||
s_command_la_SOURCES = s_command.cc
|
||||
s_dns_la_SOURCES = s_dns.cc s_dns_resolver.cc
|
||||
s_node_la_SOURCES = s_node.cc
|
||||
s_listen_la_SOURCES = s_listen.cc
|
||||
s_keys_la_SOURCES = s_keys.cc
|
||||
s_feds_la_SOURCES = s_feds.cc
|
||||
s_fetch_la_SOURCES = s_fetch.cc
|
||||
|
||||
s_module_LTLIBRARIES = \
|
||||
s_conf.la \
|
||||
s_control.la \
|
||||
s_command.la \
|
||||
s_dns.la \
|
||||
s_node.la \
|
||||
s_listen.la \
|
||||
s_keys.la \
|
||||
s_feds.la \
|
||||
s_fetch.la \
|
||||
###
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Messages / protocol
|
||||
|
@ -119,8 +94,15 @@ s_module_LTLIBRARIES = \
|
|||
|
||||
m_moduledir = @moduledir@
|
||||
|
||||
m_vm_la_SOURCES = m_vm.cc
|
||||
m_noop_la_SOURCES = m_noop.cc
|
||||
m_user_la_SOURCES = m_user.cc
|
||||
m_node_la_SOURCES = m_node.cc
|
||||
m_keys_la_SOURCES = m_keys.cc
|
||||
m_feds_la_SOURCES = m_feds.cc
|
||||
m_fetch_la_SOURCES = m_fetch.cc
|
||||
m_command_la_SOURCES = m_command.cc
|
||||
m_control_la_SOURCES = m_control.cc
|
||||
m_device_la_SOURCES = m_device.cc
|
||||
m_direct_la_SOURCES = m_direct.cc
|
||||
m_typing_la_SOURCES = m_typing.cc
|
||||
|
@ -142,8 +124,15 @@ m_room_power_levels_la_SOURCES = m_room_power_levels.cc
|
|||
m_room_server_acl_la_SOURCES = m_room_server_acl.cc
|
||||
|
||||
m_module_LTLIBRARIES = \
|
||||
m_vm.la \
|
||||
m_noop.la \
|
||||
m_user.la \
|
||||
m_node.la \
|
||||
m_keys.la \
|
||||
m_feds.la \
|
||||
m_fetch.la \
|
||||
m_command.la \
|
||||
m_control.la \
|
||||
m_device.la \
|
||||
m_direct.la \
|
||||
m_typing.la \
|
||||
|
|
|
@ -1296,7 +1296,7 @@ console_cmd__conf__set(opt &out, const string_view &line)
|
|||
|
||||
static mods::import<prototype> set_conf_item
|
||||
{
|
||||
"s_conf", "set_conf_item"
|
||||
"m_conf", "set_conf_item"
|
||||
};
|
||||
|
||||
const auto event_id
|
||||
|
@ -1351,7 +1351,7 @@ console_cmd__conf__rehash(opt &out, const string_view &line)
|
|||
using prototype = void (const string_view &, const bool &);
|
||||
static mods::import<prototype> rehash_conf
|
||||
{
|
||||
"s_conf", "rehash_conf"
|
||||
"m_conf", "rehash_conf"
|
||||
};
|
||||
|
||||
string_view prefix
|
||||
|
@ -1389,7 +1389,7 @@ console_cmd__conf__default(opt &out, const string_view &line)
|
|||
using prototype = void (const string_view &);
|
||||
static mods::import<prototype> default_conf
|
||||
{
|
||||
"s_conf", "default_conf"
|
||||
"m_conf", "default_conf"
|
||||
};
|
||||
|
||||
string_view prefix
|
||||
|
@ -1420,7 +1420,7 @@ console_cmd__conf__reload(opt &out, const string_view &line)
|
|||
using prototype = void ();
|
||||
static mods::import<prototype> reload_conf
|
||||
{
|
||||
"s_conf", "reload_conf"
|
||||
"m_conf", "reload_conf"
|
||||
};
|
||||
|
||||
reload_conf();
|
||||
|
@ -1437,7 +1437,7 @@ console_cmd__conf__reset(opt &out, const string_view &line)
|
|||
using prototype = void ();
|
||||
static mods::import<prototype> refresh_conf
|
||||
{
|
||||
"s_conf", "refresh_conf"
|
||||
"m_conf", "refresh_conf"
|
||||
};
|
||||
|
||||
refresh_conf();
|
||||
|
@ -4946,7 +4946,7 @@ console_cmd__net__listen__list(opt &out, const string_view &line)
|
|||
|
||||
static mods::import<list> listeners
|
||||
{
|
||||
"s_listen", "listeners"
|
||||
"m_listen", "listeners"
|
||||
};
|
||||
|
||||
const list &l(listeners);
|
||||
|
@ -4979,7 +4979,7 @@ console_cmd__net__listen__ciphers(opt &out, const string_view &line)
|
|||
|
||||
static mods::import<list> listeners
|
||||
{
|
||||
"s_listen", "listeners"
|
||||
"m_listen", "listeners"
|
||||
};
|
||||
|
||||
const list &l(listeners);
|
||||
|
@ -5078,7 +5078,7 @@ console_cmd__net__listen__load(opt &out, const string_view &line)
|
|||
|
||||
static mods::import<prototype> load_listener
|
||||
{
|
||||
"s_listen", "load_listener"
|
||||
"m_listen", "load_listener"
|
||||
};
|
||||
|
||||
const params params{line, " ",
|
||||
|
@ -5101,7 +5101,7 @@ console_cmd__net__listen__unload(opt &out, const string_view &line)
|
|||
|
||||
static mods::import<prototype> unload_listener
|
||||
{
|
||||
"s_listen", "unload_listener"
|
||||
"m_listen", "unload_listener"
|
||||
};
|
||||
|
||||
const params params{line, " ",
|
||||
|
@ -5365,7 +5365,7 @@ console_cmd__crt(opt &out, const string_view &line)
|
|||
|
||||
static mods::import<std::list<net::listener>> listeners
|
||||
{
|
||||
"s_listen", "listeners"
|
||||
"m_listen", "listeners"
|
||||
};
|
||||
|
||||
const auto &list{*listeners};
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// copyright notice and this permission notice is present in all copies. The
|
||||
// full license for this software is available in the LICENSE file.
|
||||
|
||||
#include "s_fetch.h"
|
||||
#include "m_fetch.h"
|
||||
|
||||
ircd::mapi::header
|
||||
IRCD_MODULE
|
|
@ -8,7 +8,7 @@
|
|||
// copyright notice and this permission notice is present in all copies. The
|
||||
// full license for this software is available in the LICENSE file.
|
||||
|
||||
#include "s_dns.h"
|
||||
#include "net_dns.h"
|
||||
|
||||
ircd::mapi::header
|
||||
IRCD_MODULE
|
|
@ -8,7 +8,7 @@
|
|||
// copyright notice and this permission notice is present in all copies. The
|
||||
// full license for this software is available in the LICENSE file.
|
||||
|
||||
#include "s_dns.h"
|
||||
#include "net_dns.h"
|
||||
|
||||
decltype(ircd::net::dns::resolver_instance)
|
||||
ircd::net::dns::resolver_instance;
|
Loading…
Reference in a new issue