0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-25 15:04:10 +01:00
construct/construct/console.h

53 lines
1.5 KiB
C
Raw Normal View History

2019-02-10 01:06:59 +01:00
// 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;
2019-02-10 01:06:59 +01:00
std::string line;
std::string record_path;
ircd::unique_mutable_buffer outbuf;
2019-02-10 01:06:59 +01:00
ircd::module *module {nullptr};
ircd::context context;
ircd::run::changed runlevel_changed;
std::deque<std::string> history;
2019-02-10 01:06:59 +01:00
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();
2019-02-10 01:06:59 +01:00
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();
};