Hermes 0.7.0
Linux game streaming host
Loading...
Searching...
No Matches
main.cpp File Reference

Definitions for the main entry point for Sunshine. More...

#include <algorithm>
#include <codecvt>
#include <csignal>
#include <fstream>
#include <iostream>
#include "confighttp.h"
#include "display_device.h"
#include "entry_handler.h"
#include "globals.h"
#include "httpcommon.h"
#include "logging.h"
#include "main.h"
#include "nvhttp.h"
#include "process.h"
#include "system_tray.h"
#include "upnp.h"
#include "uuid.h"
#include "video.h"
#include "platform/linux/virtual_display.h"
#include "platform/linux/prelogin.h"
#include "platform/linux/session_attach.h"
#include <boost/log/core.hpp>
#include "rswrapper.h"
Include dependency graph for main.cpp:

Go to the source code of this file.

Macros

#define PROBE_DISPLAY_UUID   "38F72B96-B00C-4F21-8B6C-E1BFF1602B0E"

Functions

void on_signal_forwarder (int sig)
template<class FN>
void on_signal (int sig, FN &&fn)
void mainThreadLoop (const std::shared_ptr< safe::event_t< bool > > &shutdown_event)
int main (int argc, char *argv[])
 Main application entry point.

Variables

std::map< int, std::function< void()> > signal_handlers
std::map< std::string_view, std::function< int(const char *name, int argc, char **argv)> > cmd_to_func
constexpr bool tray_is_enabled = true

Detailed Description

Definitions for the main entry point for Sunshine.

Definition in file main.cpp.

Macro Definition Documentation

◆ PROBE_DISPLAY_UUID

#define PROBE_DISPLAY_UUID   "38F72B96-B00C-4F21-8B6C-E1BFF1602B0E"

Definition at line 33 of file main.cpp.

Function Documentation

◆ main()

int main ( int argc,
char * argv[] )

Main application entry point.

Parameters
argcThe number of arguments.
argvThe arguments.

Examples

main(1, const char* args[] = {"sunshine", nullptr});
int main(int argc, char *argv[])
Main application entry point.
Definition main.cpp:104
Functions for handling command line arguments.

Definition at line 104 of file main.cpp.

◆ mainThreadLoop()

void mainThreadLoop ( const std::shared_ptr< safe::event_t< bool > > & shutdown_event)

Definition at line 73 of file main.cpp.

◆ on_signal()

template<class FN>
void on_signal ( int sig,
FN && fn )

Definition at line 48 of file main.cpp.

◆ on_signal_forwarder()

void on_signal_forwarder ( int sig)

Definition at line 43 of file main.cpp.

Variable Documentation

◆ cmd_to_func

std::map<std::string_view, std::function<int(const char *name, int argc, char **argv)> > cmd_to_func
Initial value:
{
{"creds"sv, [](const char *name, int argc, char **argv) {
return args::creds(name, argc, argv);
}},
{"help"sv, [](const char *name, int argc, char **argv) {
return args::help(name);
}},
{"version"sv, [](const char *name, int argc, char **argv) {
return args::version();
}},
}
int creds(const char *name, int argc, char *argv[])
Reset the user credentials.
int version()
Print the version to stdout, then exit.
int help(const char *name)
Print help to stdout, then exit.

Definition at line 54 of file main.cpp.

◆ signal_handlers

std::map<int, std::function<void()> > signal_handlers

Definition at line 41 of file main.cpp.

◆ tray_is_enabled

bool tray_is_enabled = true
constexpr

Definition at line 68 of file main.cpp.