Skip to content

Commit

Permalink
refactor(mail): move mail to globals
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher committed Feb 11, 2024
1 parent 97c5b88 commit e7faeb5
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 31 deletions.
2 changes: 1 addition & 1 deletion src/audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include "audio.h"
#include "config.h"
#include "entry_handler.h"
#include "globals.h"
#include "logging.h"
#include "thread_safe.h"
#include "utility.h"
Expand Down
2 changes: 1 addition & 1 deletion src/confighttp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "config.h"
#include "confighttp.h"
#include "crypto.h"
#include "entry_handler.h"
#include "globals.h"
#include "file_handler.h"
#include "httpcommon.h"
#include "logging.h"
Expand Down
25 changes: 0 additions & 25 deletions src/entry_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,31 +50,6 @@ namespace lifetime {
get_argv();
} // namespace lifetime

namespace mail {
#define MAIL(x) \
constexpr auto x = std::string_view { \
#x \
}

extern safe::mail_t man;

// Global mail
MAIL(shutdown);
MAIL(broadcast_shutdown);
MAIL(video_packets);
MAIL(audio_packets);
MAIL(switch_display);

// Local mail
MAIL(touch_port);
MAIL(idr);
MAIL(invalidate_ref_frames);
MAIL(gamepad_feedback);
MAIL(hdr);
#undef MAIL

} // namespace mail

#ifdef _WIN32
namespace service_ctrl {
bool
Expand Down
26 changes: 25 additions & 1 deletion src/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,30 @@
#include "entry_handler.h"
#include "thread_pool.h"

extern safe::mail_t mail::man;
extern thread_pool_util::ThreadPool task_pool;
extern bool display_cursor;

namespace mail {
#define MAIL(x) \
constexpr auto x = std::string_view { \
#x \
}

extern safe::mail_t man;

// Global mail
MAIL(shutdown);
MAIL(broadcast_shutdown);
MAIL(video_packets);
MAIL(audio_packets);
MAIL(switch_display);

// Local mail
MAIL(touch_port);
MAIL(idr);
MAIL(invalidate_ref_frames);
MAIL(gamepad_feedback);
MAIL(hdr);
#undef MAIL

} // namespace mail
2 changes: 1 addition & 1 deletion src/nvhttp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
// local includes
#include "config.h"
#include "crypto.h"
#include "entry_handler.h"
#include "globals.h"
#include "file_handler.h"
#include "httpcommon.h"
#include "logging.h"
Expand Down
2 changes: 1 addition & 1 deletion src/rtsp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ extern "C" {
#include <boost/bind.hpp>

#include "config.h"
#include "entry_handler.h"
#include "globals.h"
#include "input.h"
#include "logging.h"
#include "network.h"
Expand Down
2 changes: 1 addition & 1 deletion src/upnp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "config.h"
#include "confighttp.h"
#include "entry_handler.h"
#include "globals.h"
#include "logging.h"
#include "network.h"
#include "nvhttp.h"
Expand Down

0 comments on commit e7faeb5

Please sign in to comment.