diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/ChangeLog | 8 | ||||
| -rw-r--r-- | lib/Makefile.am | 2 | ||||
| -rw-r--r-- | lib/system.h | 2 | ||||
| -rw-r--r-- | lib/version.c | 47 |
4 files changed, 57 insertions, 2 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog index afb18b11..1fe59067 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,4 +1,10 @@ -2015-10-11 Akihiko Odaki <[email protected]> +2016-12-24 Mark Wielaard <[email protected]> + + * version.c: New source file. + * Makefile.am (libeu_a_SOURCES): Add version.c + * system.h (print_version): New function definition. + +2016-10-11 Akihiko Odaki <[email protected]> * fixedsizehash.h (CONCAT): Use __CONCAT when available. * system.h: Include config.h and errno.h. diff --git a/lib/Makefile.am b/lib/Makefile.am index 7ca2bd41..1ad9ce8f 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -35,7 +35,7 @@ noinst_LIBRARIES = libeu.a libeu_a_SOURCES = xstrdup.c xstrndup.c xmalloc.c next_prime.c \ crc32.c crc32_file.c md5.c sha1.c \ - color.c + color.c version.c noinst_HEADERS = fixedsizehash.h libeu.h system.h dynamicsizehash.h list.h \ md5.h sha1.h eu-config.h diff --git a/lib/system.h b/lib/system.h index e1c1c698..ccd99d63 100644 --- a/lib/system.h +++ b/lib/system.h @@ -152,6 +152,8 @@ pread_retry (int fd, void *buf, size_t len, off_t off) #define ARGP_PROGRAM_BUG_ADDRESS_DEF \ const char *const apba__ __asm ("argp_program_bug_address") +/* Defined in version.c. Common ARGP_PROGRAM_VERSION_HOOK_DEF. */ +void print_version (FILE *stream, struct argp_state *state); /* The demangler from libstdc++. */ extern char *__cxa_demangle (const char *mangled_name, char *output_buffer, diff --git a/lib/version.c b/lib/version.c new file mode 100644 index 00000000..b8d70cbf --- /dev/null +++ b/lib/version.c @@ -0,0 +1,47 @@ +/* Common argp_print_version_hook for all tools. + Copyright (C) 2016 Red Hat, Inc. + This file is part of elfutils. + + This file is free software; you can redistribute it and/or modify + it under the terms of either + + * the GNU Lesser General Public License as published by the Free + Software Foundation; either version 3 of the License, or (at + your option) any later version + + or + + * the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at + your option) any later version + + or both in parallel, as here. + + elfutils 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 copies of the GNU General Public License and + the GNU Lesser General Public License along with this program. If + not, see <http://www.gnu.org/licenses/>. */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <argp.h> +#include <libintl.h> +#include <stdio.h> +#include "system.h" + +void +print_version (FILE *stream, struct argp_state *state) +{ + fprintf (stream, "%s (%s) %s\n", state->name, PACKAGE_NAME, PACKAGE_VERSION); + fprintf (stream, gettext ("\ +Copyright (C) %s The elfutils developers <%s>.\n\ +This is free software; see the source for copying conditions. There is NO\n\ +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ +"), "2016", PACKAGE_URL); +} |
