From c98184f1f5813a081c7b91e7347bd3b4d4f5cb9f Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Wed, 17 Apr 2024 18:03:40 +0200 Subject: [PATCH] created exit_cmd getter & setter --- include/chat/flags.h | 3 +++ src/chat/flags.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 src/chat/flags.c diff --git a/include/chat/flags.h b/include/chat/flags.h index 6dda091..c0b4fec 100644 --- a/include/chat/flags.h +++ b/include/chat/flags.h @@ -46,6 +46,9 @@ extern "C" { //SHORTCUTS CAUSE I'M LAZY BITCH #define WHY2_CHAT_CODE_SSQC WHY2_CHAT_CODE_SERVER_SIDE_QUIT_COMMUNICATION +char *why2_chat_client_get_server_exit_cmd(); //GETTER AND SETTER FOR !exit FROM SERVER +void why2_chat_client_set_server_exit_cmd(char *cmd); + #ifdef __cplusplus } #endif diff --git a/src/chat/flags.c b/src/chat/flags.c new file mode 100644 index 0000000..6285fdf --- /dev/null +++ b/src/chat/flags.c @@ -0,0 +1,33 @@ +/* +This is part of WHY2 +Copyright (C) 2022 Václav Šmejkal + +This program 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. + +This program 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 this program. If not, see . +*/ + +#include + +#include + +char *server_exit_cmd = NULL; + +char *why2_chat_client_get_server_exit_cmd() +{ + return server_exit_cmd; +} + +void why2_chat_client_set_server_exit_cmd(char *cmd) +{ + server_exit_cmd = cmd; +} \ No newline at end of file