0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-18 07:50:57 +01:00
construct/construct/console.h

52 lines
1.5 KiB
C++

// Matrix Construct
//
// Copyright (C) Matrix Construct Developers, Authors & Contributors
// Copyright (C) 2016-2019 Jason Volk <jason@zemos.net>
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice is present in all copies. The
// full license for this software is available in the LICENSE file.
struct construct::console
{
static ircd::conf::item<size_t> stack_sz;
static ircd::conf::item<size_t> input_max;
static ircd::conf::item<size_t> ratelimit_bytes;
static ircd::conf::item<ircd::milliseconds> ratelimit_sleep;
static const ircd::string_view generic_message;
static const ircd::string_view console_message;
static std::once_flag seen_message;
static std::deque<std::string> queue;
static bool quit_when_done;
std::string line;
std::string record_path;
ircd::unique_mutable_buffer outbuf;
ircd::module *module {nullptr};
ircd::context context;
ircd::run::changed runlevel_changed;
std::deque<std::string> history;
void show_message() const;
void on_runlevel(const enum ircd::run::level &);
bool wait_running() const;
bool next_command();
bool esc_handle_bra();
bool esc_handle();
void wait_input();
bool cmd__record();
bool cmd__watch();
int handle_line_bymodule();
bool handle_line();
void main();
console();
static bool active();
static bool interrupt();
static bool terminate();
static bool spawn();
};