aboutsummaryrefslogtreecommitdiff
path: root/malloc
diff options
context:
space:
mode:
Diffstat (limited to 'malloc')
-rwxr-xr-xmalloc/memusage.sh6
-rw-r--r--malloc/memusagestat.c22
2 files changed, 25 insertions, 3 deletions
diff --git a/malloc/memusage.sh b/malloc/memusage.sh
index 1c906a1be5..8b372e4b8e 100755
--- a/malloc/memusage.sh
+++ b/malloc/memusage.sh
@@ -61,8 +61,10 @@ Profile memory usage of PROGRAM.
Mandatory arguments to long options are also mandatory for any corresponding
short options.
-For bug reporting instructions, please see:
-<http://www.gnu.org/software/libc/bugs.html>."
+"
+ print $"For bug reporting instructions, please see:
+<http://www.gnu.org/software/libc/bugs.html>.
+"
exit 0
}
diff --git a/malloc/memusagestat.c b/malloc/memusagestat.c
index 779d5c0a59..bf33175415 100644
--- a/malloc/memusagestat.c
+++ b/malloc/memusagestat.c
@@ -1,5 +1,6 @@
/* Generate graphic from memory profiling data.
- Copyright (C) 1998, 1999, 2000, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2005, 2006,
+ 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -38,6 +39,8 @@
#include <gdfontl.h>
#include <gdfonts.h>
+#include "../version.h"
+#define PACKAGE _libc_intl_domainname
/* Default size of the generated image. */
#define XSIZE 800
@@ -73,6 +76,10 @@ static error_t parse_opt (int key, char *arg, struct argp_state *state);
/* Function to print some extra text in the help message. */
static char *more_help (int key, const char *text, void *input);
+/* Name and version of program. */
+static void print_version (FILE *stream, struct argp_state *state);
+void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
+
/* Data structure to communicate with argp functions. */
static struct argp argp =
{
@@ -535,3 +542,16 @@ For bug reporting instructions, please see:\n\
}
return (char *) text;
}
+
+/* Print the version information. */
+static void
+print_version (FILE *stream, struct argp_state *state)
+{
+ fprintf (stream, "memusagestat (GNU %s) %s\n", PACKAGE, VERSION);
+ fprintf (stream, gettext ("\
+Copyright (C) %s Free Software Foundation, Inc.\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\
+"), "2009");
+ fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
+}