moonlight-embedded/src/connection.c
2017-05-28 16:13:09 +02:00

49 lines
1.4 KiB
C

/*
* This file is part of Moonlight Embedded.
*
* 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
* 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 "connection.h"
#include <stdio.h>
#include <signal.h>
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) {
printf("%s\n", msg);
}
static void connection_display_transient_message(const char *msg) {
printf("%s\n", msg);
}
CONNECTION_LISTENER_CALLBACKS connection_callbacks = {
.stageStarting = NULL,
.stageComplete = NULL,
.stageFailed = NULL,
.connectionStarted = NULL,
.connectionTerminated = connection_terminated,
.displayMessage = connection_display_message,
.displayTransientMessage = connection_display_transient_message,
};