From 66dea0ba9ac413819059606c748cb5446ccbb5d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ram=C5=ABnas=20Ma=C5=BEeikis?= Date: Tue, 9 Apr 2019 16:43:37 +0300 Subject: daemon: added verbose flag. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Stub implementation. This commit closes ticket 23. Signed-off-by: Ramūnas Mažeikis --- include/settings.h | 2 ++ src/daemon/settings.c | 6 ++++++ src/daemon/settings_private.h | 2 ++ 3 files changed, 10 insertions(+) diff --git a/include/settings.h b/include/settings.h index f4bb914..72addd0 100644 --- a/include/settings.h +++ b/include/settings.h @@ -2,6 +2,7 @@ * Usurpation – server daemon settings handling, header * * Copyright (C) 2019 Gediminas Jakutis + * Copyright (C) 2019 Ramūnas Mažeikis * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,5 +25,6 @@ void settings_init(void); int setting_detach(void); unsigned short int setting_port(void); +int setting_verbose(void); #endif /* USURPATION_SETTINGS_H */ diff --git a/src/daemon/settings.c b/src/daemon/settings.c index 9c4011f..622915a 100644 --- a/src/daemon/settings.c +++ b/src/daemon/settings.c @@ -2,6 +2,7 @@ * Usurpation – server daemon settings handling * * Copyright (C) 2019 Gediminas Jakutis + * Copyright (C) 2019 Ramūnas Mažeikis * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -36,6 +37,11 @@ int setting_detach(void) return test_flag(flag_daemonize); } +int setting_verbose(void) +{ + return test_flag(flag_verbose); +} + unsigned short int setting_port(void) { return settings.port; diff --git a/src/daemon/settings_private.h b/src/daemon/settings_private.h index 57ad24c..336c151 100644 --- a/src/daemon/settings_private.h +++ b/src/daemon/settings_private.h @@ -2,6 +2,7 @@ * Usurpation – server daemon settings handling, private header * * Copyright (C) 2019 Gediminas Jakutis + * Copyright (C) 2019 Ramūnas Mažeikis * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -22,6 +23,7 @@ #define USURPATION_SETTINGS_PRIVATE_H static const unsigned int flag_daemonize = 1 << 0; /* 1st bit */ +static const unsigned int flag_verbose = 1 << 1; static struct settings { unsigned int flags; -- cgit v1.2.3