From 6590f2c3dc10acaa04cea3206fd00445e0a6145c Mon Sep 17 00:00:00 2001 From: hasso Date: Tue, 19 Oct 2004 20:40:08 +0000 Subject: Small copyright string and hostname related cleanup. --- lib/ChangeLog | 8 ++++++++ lib/Makefile.am | 7 ++----- lib/command.c | 30 ++++++++++++++++++------------ lib/command.h | 2 ++ lib/print_version.c | 31 ------------------------------- lib/version.h.in | 3 +-- 6 files changed, 31 insertions(+), 50 deletions(-) delete mode 100644 lib/print_version.c diff --git a/lib/ChangeLog b/lib/ChangeLog index d0a33d40..8551ad25 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,11 @@ +2004-10-19 Hasso Tepper + + * version.h.in: Define copyright string QUAGGA_COPYRIGHT. + * print_version.c: Remove. print_version () function moved to + command.[c|h]. + * command.c: Use QUAGGA_COPYRIGHT. + * Makefile.am: Remove useless version.c and print_version.c files. + 2004-10-19 Andrew J. Schorr * zclient.c: (zebra_interface_address_read) If the destination address diff --git a/lib/Makefile.am b/lib/Makefile.am index 9cb25f77..b4d538bd 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -7,8 +7,8 @@ lib_LTLIBRARIES = libzebra.la libzebra_la_LDFLAGS = -version 0:0:0 libzebra_la_SOURCES = \ - version.c network.c pid_output.c getopt.c getopt1.c daemon.c \ - print_version.c checksum.c vector.c linklist.c vty.c command.c \ + network.c pid_output.c getopt.c getopt1.c daemon.c \ + checksum.c vector.c linklist.c vty.c command.c \ sockunion.c prefix.c thread.c if.c memory.c buffer.c table.c hash.c \ filter.c routemap.c distribute.c stream.c str.c log.c plist.c \ zclient.c sockopt.c smux.c md5.c if_rmap.c keychain.c privs.c \ @@ -27,6 +27,3 @@ pkginclude_HEADERS = \ EXTRA_DIST = regex.c regex-gnu.h -version.c: Makefile - echo '' >version.c - echo 'const char *host_name = "$(host_alias)";' >>version.c diff --git a/lib/command.c b/lib/command.c index 4495d221..fc115d95 100644 --- a/lib/command.c +++ b/lib/command.c @@ -36,13 +36,6 @@ vector cmdvec; /* Host information structure. */ struct host host; -/* Default motd string. */ -const char *default_motd = -"\r\n\ -Hello, this is " QUAGGA_PROGNAME " (version " QUAGGA_VERSION ").\r\n\ -Copyright 1996-2004 Kunihiro Ishiguro, et al.\r\n\ -\r\n"; - /* Standard command node structures. */ struct cmd_node auth_node = { @@ -74,6 +67,21 @@ struct cmd_node config_node = "%s(config)# ", 1 }; + +/* Default motd string. */ +const char *default_motd = +"\r\n\ +Hello, this is " QUAGGA_PROGNAME " (version " QUAGGA_VERSION ").\r\n\ +" QUAGGA_COPYRIGHT "\r\n\ +\r\n"; + +void +print_version (const char *progname) +{ + printf ("%s version %s (%s)\n", progname, QUAGGA_VERSION, host.name); + printf ("%s\n", QUAGGA_COPYRIGHT); +} + /* Utility function to concatenate argv argument into a single string with inserting ' ' character between each argument. */ @@ -2397,10 +2405,8 @@ DEFUN (show_version, SHOW_STR "Displays zebra version\n") { - vty_out (vty, "Quagga %s (%s).%s", QUAGGA_VERSION, - host_name, - VTY_NEWLINE); - vty_out (vty, "Copyright 1996-2002, Kunihiro Ishiguro.%s", VTY_NEWLINE); + vty_out (vty, "Quagga %s (%s).%s", QUAGGA_VERSION, host.name, VTY_NEWLINE); + vty_out (vty, "%s%s", QUAGGA_COPYRIGHT, VTY_NEWLINE); return CMD_SUCCESS; } @@ -2412,7 +2418,7 @@ DEFUN (config_help, "Description of the interactive help system\n") { vty_out (vty, - "Zebra VTY provides advanced help feature. When you need help,%s\ + "Quagga VTY provides advanced help feature. When you need help,%s\ anytime at the command line please press '?'.%s\ %s\ If nothing matches, the help list will be empty and you must backup%s\ diff --git a/lib/command.h b/lib/command.h index 8faf534d..8a17bbb4 100644 --- a/lib/command.h +++ b/lib/command.h @@ -309,4 +309,6 @@ int config_help (struct cmd_element *, struct vty *, int, const char *[]); char *host_config_file (); void host_config_set (char *); +void print_version (const char *); + #endif /* _ZEBRA_COMMAND_H */ diff --git a/lib/print_version.c b/lib/print_version.c deleted file mode 100644 index 3d8e6799..00000000 --- a/lib/print_version.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Print version function. - * Copyright (C) 1997, 98 Kunihiro Ishiguro - * - * This file is part of GNU Zebra. - * - * GNU Zebra 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 2, or (at your option) any - * later version. - * - * GNU Zebra 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 GNU Zebra; see the file COPYING. If not, write to the Free - * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -#include - -#include - -void -print_version (const char *progname) -{ - printf ("%s version %s (%s)\n", progname, QUAGGA_VERSION, host_name); - printf ("Copyright 1996-2001, Kunihiro Ishiguro\n"); -} diff --git a/lib/version.h.in b/lib/version.h.in index e8404b27..f63f1940 100644 --- a/lib/version.h.in +++ b/lib/version.h.in @@ -30,9 +30,8 @@ #define QUAGGA_URL "http://www.quagga.net" -extern char *host_name; +#define QUAGGA_COPYRIGHT "Copyright 1996-2004 Kunihiro Ishiguro, et al." -void print_version (const char *); pid_t pid_output (const char *); pid_t pid_output_lock (const char *); -- cgit v1.2.1