mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-02-16 02:20:42 +00:00
Combine 'global' with connection code
This commit is contained in:
@@ -18,12 +18,15 @@
|
||||
*/
|
||||
|
||||
#include "connection.h"
|
||||
#include "global.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
|
||||
static void connection_connection_terminated() {
|
||||
quit();
|
||||
pthread_t main_thread_id = 0;
|
||||
|
||||
static void connection_terminated() {
|
||||
if (main_thread_id != 0)
|
||||
pthread_kill(main_thread_id, SIGTERM);
|
||||
}
|
||||
|
||||
static void connection_display_message(const char *msg) {
|
||||
@@ -39,7 +42,7 @@ CONNECTION_LISTENER_CALLBACKS connection_callbacks = {
|
||||
.stageComplete = NULL,
|
||||
.stageFailed = NULL,
|
||||
.connectionStarted = NULL,
|
||||
.connectionTerminated = connection_connection_terminated,
|
||||
.connectionTerminated = connection_terminated,
|
||||
.displayMessage = connection_display_message,
|
||||
.displayTransientMessage = connection_display_transient_message,
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* This file is part of Moonlight Embedded.
|
||||
*
|
||||
* Copyright (C) 2015 Iwan Timmer
|
||||
* Copyright (C) 2015-2017 Iwan Timmer
|
||||
*
|
||||
* Moonlight is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,4 +19,7 @@
|
||||
|
||||
#include <Limelight.h>
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
extern CONNECTION_LISTENER_CALLBACKS connection_callbacks;
|
||||
extern pthread_t main_thread_id;
|
||||
|
||||
27
src/global.c
27
src/global.c
@@ -1,27 +0,0 @@
|
||||
/*
|
||||
* This file is part of Moonlight Embedded.
|
||||
*
|
||||
* Copyright (C) 2015 Iwan Timmer
|
||||
*
|
||||
* Moonlight is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Moonlight is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Moonlight; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <signal.h>
|
||||
#include <pthread.h>
|
||||
|
||||
pthread_t main_thread_id;
|
||||
|
||||
void quit() {
|
||||
pthread_kill(main_thread_id, SIGTERM);
|
||||
}
|
||||
24
src/global.h
24
src/global.h
@@ -1,24 +0,0 @@
|
||||
/*
|
||||
* This file is part of Moonlight Embedded.
|
||||
*
|
||||
* Copyright (C) 2015 Iwan Timmer
|
||||
*
|
||||
* Moonlight is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Moonlight is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Moonlight; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
extern pthread_t main_thread_id;
|
||||
|
||||
void quit();
|
||||
@@ -18,7 +18,6 @@
|
||||
*/
|
||||
|
||||
#include "../loop.h"
|
||||
#include "../global.h"
|
||||
|
||||
#include "keyboard.h"
|
||||
#include "mapping.h"
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "loop.h"
|
||||
|
||||
#include "global.h"
|
||||
#include "connection.h"
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <sys/signalfd.h>
|
||||
|
||||
Reference in New Issue
Block a user