2019-12-22 22:34:12 +00:00
|
|
|
//
|
|
|
|
// Created by loki on 12/22/19.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef SUNSHINE_MAIN_H
|
|
|
|
#define SUNSHINE_MAIN_H
|
|
|
|
|
2021-06-21 19:21:52 +00:00
|
|
|
#include <string_view>
|
|
|
|
|
2019-12-22 22:34:12 +00:00
|
|
|
#include "thread_pool.h"
|
2021-06-21 19:21:52 +00:00
|
|
|
#include "thread_safe.h"
|
|
|
|
|
2021-05-17 19:21:57 +00:00
|
|
|
#include <boost/log/common.hpp>
|
2019-12-22 22:34:12 +00:00
|
|
|
|
|
|
|
extern util::ThreadPool task_pool;
|
2019-12-25 19:57:23 +00:00
|
|
|
extern bool display_cursor;
|
2019-12-22 22:34:12 +00:00
|
|
|
|
2020-01-09 21:02:01 +00:00
|
|
|
extern boost::log::sources::severity_logger<int> verbose;
|
|
|
|
extern boost::log::sources::severity_logger<int> debug;
|
|
|
|
extern boost::log::sources::severity_logger<int> info;
|
|
|
|
extern boost::log::sources::severity_logger<int> warning;
|
|
|
|
extern boost::log::sources::severity_logger<int> error;
|
|
|
|
extern boost::log::sources::severity_logger<int> fatal;
|
|
|
|
|
|
|
|
void log_flush();
|
2021-06-04 19:12:06 +00:00
|
|
|
|
2021-06-09 19:55:13 +00:00
|
|
|
void print_help(const char *name);
|
|
|
|
|
2021-06-04 19:12:06 +00:00
|
|
|
std::string read_file(const char *path);
|
|
|
|
int write_file(const char *path, const std::string_view &contents);
|
2021-06-21 19:21:52 +00:00
|
|
|
|
2021-06-30 13:25:08 +00:00
|
|
|
std::uint16_t map_port(int port);
|
|
|
|
|
2021-06-21 19:21:52 +00:00
|
|
|
namespace mail {
|
|
|
|
#define MAIL(x) \
|
|
|
|
constexpr auto x = std::string_view { #x }
|
|
|
|
|
|
|
|
extern safe::mail_t man;
|
|
|
|
|
2021-06-22 20:26:11 +00:00
|
|
|
// Global mail
|
2021-06-21 19:21:52 +00:00
|
|
|
MAIL(shutdown);
|
|
|
|
MAIL(broadcast_shutdown);
|
|
|
|
|
2021-06-22 20:26:11 +00:00
|
|
|
MAIL(video_packets);
|
|
|
|
MAIL(audio_packets);
|
2021-06-21 19:21:52 +00:00
|
|
|
|
2021-07-29 14:48:03 +00:00
|
|
|
MAIL(switch_display);
|
|
|
|
|
2021-06-22 20:26:11 +00:00
|
|
|
// Local mail
|
|
|
|
MAIL(touch_port);
|
|
|
|
MAIL(idr);
|
2021-07-18 09:05:34 +00:00
|
|
|
MAIL(rumble);
|
2021-06-21 19:21:52 +00:00
|
|
|
#undef MAIL
|
|
|
|
} // namespace mail
|
|
|
|
|
|
|
|
|
2019-12-22 22:34:12 +00:00
|
|
|
#endif //SUNSHINE_MAIN_H
|