refactor error message-related functions

split message print fuctions (mpr_*), strerrno, and mscp_get/set_error
into print.c/h and strerrno.c/h.

ToDo: revise usages of priv_set_errv and pr_* functions.
This commit is contained in:
Ryo Nakamura
2024-02-06 21:54:04 +09:00
parent 76892a69f9
commit 4f0669f8f8
18 changed files with 268 additions and 292 deletions

19
src/print.c Normal file
View File

@@ -0,0 +1,19 @@
/* SPDX-License-Identifier: GPL-3.0-only */
#include <print.h>
/* message print functions */
static int __print_severity = MSCP_SEVERITY_WARN;
void set_print_severity(int serverity)
{
if (serverity < 0)
__print_severity = -1; /* no print */
__print_severity = serverity;
}
int get_print_severity()
{
return __print_severity;
}