Sunshine master
Self-hosted game stream host for Moonlight.
entry_handler.h
Go to the documentation of this file.
1
5#pragma once
6
7// standard includes
8#include <atomic>
9#include <string_view>
10
11// local includes
12#include "thread_pool.h"
13#include "thread_safe.h"
14
23void launch_ui(const std::optional<std::string> &path = std::nullopt);
24
28namespace args {
40 int creds(const char *name, int argc, char *argv[]);
41
51 int help(const char *name);
52
61 int version();
62
63#ifdef _WIN32
76#endif
77} // namespace args
78
82namespace lifetime {
83 extern char **argv;
84 extern std::atomic_int desired_exit_code;
85
91 void exit_sunshine(int exit_code, bool async);
92
96 void debug_trap();
97
103 char **get_argv();
104} // namespace lifetime
105
109void log_publisher_data();
110
111#ifdef _WIN32
117
121namespace service_ctrl {
130 bool is_service_running();
131
140 bool start_service();
141
150 bool wait_for_ui_ready();
151} // namespace service_ctrl
152#endif
void launch_ui(const std::optional< std::string > &path=std::nullopt)
Launch the Web UI.
Definition entry_handler.cpp:29
bool is_gamestream_enabled()
Check if NVIDIA's GameStream software is running.
Definition entry_handler.cpp:108
void log_publisher_data()
Log the publisher metadata provided from CMake.
Definition entry_handler.cpp:101
Functions for handling command line arguments.
Definition entry_handler.cpp:37
int creds(const char *name, int argc, char *argv[])
Reset the user credentials.
Definition entry_handler.cpp:38
int version()
Print the version to stdout, then exit.
Definition entry_handler.cpp:53
int restore_nvprefs_undo()
Restore global NVIDIA control panel settings. If Sunshine was improperly terminated,...
Definition entry_handler.cpp:59
int help(const char *name)
Print help to stdout, then exit.
Definition entry_handler.cpp:48
Functions for handling the lifetime of Sunshine.
Definition entry_handler.cpp:69
std::atomic_int desired_exit_code
Desired exit code.
Definition entry_handler.cpp:71
void debug_trap()
Breaks into the debugger or terminates Sunshine if no debugger is attached.
Definition entry_handler.cpp:88
void exit_sunshine(int exit_code, bool async)
Terminates Sunshine gracefully with the provided exit code.
Definition entry_handler.cpp:73
char ** argv
Command-line argument vector.
Definition entry_handler.cpp:70
char ** get_argv()
Get the argv array passed to main().
Definition entry_handler.cpp:96
Namespace for controlling the Sunshine service model on Windows.
Definition entry_handler.cpp:123
bool wait_for_ui_ready()
Wait for the UI to be ready after Sunshine startup.
Definition entry_handler.cpp:242
bool start_service()
Start the service and wait for startup to complete.
Definition entry_handler.cpp:217
bool is_service_running()
Check if the service is running.
Definition entry_handler.cpp:206
Declarations for the thread pool system.
Declarations for thread-safe data structures.