Sunshine v2025.118.151840
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
21void
22launch_ui();
23
30void
31launch_ui_with_path(std::string path);
32
36namespace args {
46 int
47 creds(const char *name, int argc, char *argv[]);
48
56 int
57 help(const char *name);
58
65 int
66 version();
67
68#ifdef _WIN32
78 int
80#endif
81} // namespace args
82
86namespace lifetime {
87 extern char **argv;
88 extern std::atomic_int desired_exit_code;
89
95 void
96 exit_sunshine(int exit_code, bool async);
97
101 void
102 debug_trap();
103
107 char **
108 get_argv();
109} // namespace lifetime
110
114void
116
117#ifdef _WIN32
122bool
124
128namespace service_ctrl {
135 bool
137
144 bool
146
153 bool
155} // namespace service_ctrl
156#endif
bool is_gamestream_enabled()
Check if NVIDIA's GameStream software is running.
Definition entry_handler.cpp:121
void log_publisher_data()
Log the publisher metadata provided from CMake.
Definition entry_handler.cpp:113
void launch_ui_with_path(std::string path)
Launch the Web UI at a specific endpoint.
Definition entry_handler.cpp:36
void launch_ui()
Launch the Web UI.
Definition entry_handler.cpp:30
Functions for handling command line arguments.
Definition entry_handler.cpp:41
int creds(const char *name, int argc, char *argv[])
Reset the user credentials.
Definition entry_handler.cpp:43
int version()
Print the version to stdout, then exit.
Definition entry_handler.cpp:60
int restore_nvprefs_undo()
Restore global NVIDIA control panel settings. If Sunshine was improperly terminated,...
Definition entry_handler.cpp:67
int help(const char *name)
Print help to stdout, then exit.
Definition entry_handler.cpp:54
Functions for handling the lifetime of Sunshine.
Definition entry_handler.cpp:77
void debug_trap()
Breaks into the debugger or terminates Sunshine if no debugger is attached.
Definition entry_handler.cpp:98
void exit_sunshine(int exit_code, bool async)
Terminates Sunshine gracefully with the provided exit code.
Definition entry_handler.cpp:82
char ** get_argv()
Get the argv array passed to main().
Definition entry_handler.cpp:107
Namespace for controlling the Sunshine service model on Windows.
Definition entry_handler.cpp:135
bool wait_for_ui_ready()
Wait for the UI to be ready after Sunshine startup.
Definition entry_handler.cpp:251
bool start_service()
Start the service and wait for startup to complete.
Definition entry_handler.cpp:225
bool is_service_running()
Check if the service is running.
Definition entry_handler.cpp:213
Declarations for the thread pool system.
Declarations for thread-safe data structures.