From b1e81de69e08c04b8d78ce7f6a7687d395550b35 Mon Sep 17 00:00:00 2001 From: Alessandro Iezzi Date: Thu, 15 May 2025 22:56:35 +0200 Subject: Add util --- src/main/util.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/main/util.c (limited to 'src/main/util.c') diff --git a/src/main/util.c b/src/main/util.c new file mode 100644 index 0000000..30492ea --- /dev/null +++ b/src/main/util.c @@ -0,0 +1,34 @@ +/*- + * Copyright (C) 2025 Alessandro Iezzi + * + * This file is part of Tris Game. + * + * Tris Game 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. + * + * Tris Game 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 Tris Game. If not, see . + */ + +#include +#include + +void +log_error(const char *format, ...) +{ + va_list args; + va_start(args, format); + + fprintf(stderr, "ERROR: "); + vfprintf(stderr, format, args); + fprintf(stderr, "\n"); + + va_end(args); +} -- cgit v1.2.3