/* * Version string boilerplate for slide puzzle game. * Copyright © 2022-2023 Nick Bowler * * 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 #include #include #include #include "version.h" #include "copysym.h" #define VERSION_HEAD_FMT "%s (RRace) %s\nCopyright %s 2023 Nick Bowler" #define VERSION_HEAD_ARGS progname, PACKAGE_VERSION, copysign void version_print_head(const char *progname, FILE *f) { const char *copysign = copyright_symbol(locale_charset()); printf(VERSION_HEAD_FMT, VERSION_HEAD_ARGS); putc('\n', f); } char *version_format_head(const char *progname) { const char *copysign = copyright_symbol(locale_charset()); char *ret; ret = malloc(sizeof VERSION_HEAD_FMT + 100); if (ret) sprintf(ret, VERSION_HEAD_FMT, VERSION_HEAD_ARGS); return ret; }