From 2aa2f13131663afa0d13259365f824b05e9a2f02 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Thu, 2 May 2019 16:30:33 +0200 Subject: unsquashfs: add argument processing, file listing parameter Signed-off-by: David Oberhollenzer --- lib/Makemodule.am | 1 + lib/util/print_version.c | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 lib/util/print_version.c (limited to 'lib') diff --git a/lib/Makemodule.am b/lib/Makemodule.am index a1bf0f2..3b171c6 100644 --- a/lib/Makemodule.am +++ b/lib/Makemodule.am @@ -18,6 +18,7 @@ libsquashfs_a_SOURCES += lib/sqfs/readdir.c libutil_a_SOURCES = lib/util/canonicalize_name.c lib/util/write_retry.c libutil_a_SOURCES += lib/util/read_retry.c include/util.h +libutil_a_SOURCES += lib/util/print_version.c if WITH_ZLIB libcompress_a_SOURCES += lib/comp/zlib.c diff --git a/lib/util/print_version.c b/lib/util/print_version.c new file mode 100644 index 0000000..7d1b91a --- /dev/null +++ b/lib/util/print_version.c @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: GPL-3.0-or-later */ +#include "config.h" +#include "util.h" + +#include + +#define LICENSE_SHORT "GPLv3+" +#define LICENSE_LONG "GNU GPL version 3 or later" +#define LICENSE_URL "https://gnu.org/licenses/gpl.html" + +extern char *__progname; + +static const char *version_string = +"%s (%s) %s\n" +"Copyright (c) 2019 David Oberhollenzer\n" +"License " LICENSE_SHORT ": " LICENSE_LONG " <" LICENSE_URL ">.\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n" +"\n" +"Written by David Oberhollenzer.\n"; + +void print_version(void) +{ + printf(version_string, __progname, PACKAGE_NAME, PACKAGE_VERSION); +} -- cgit v1.2.3