From: Christophe Varoqui Date: Tue, 14 Mar 2006 13:06:30 +0000 (+0100) Subject: [libmultipath] move the tools' version string to the lib X-Git-Tag: 0.4.8~152 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=812fd77a992fbbdd22303a58ba3ca9f975ef9c30;p=platform%2Fupstream%2Fmultipath-tools.git [libmultipath] move the tools' version string to the lib o Remove multipath/main.h o Print the version string in the CLI syntax reference --- diff --git a/multipath/main.h b/libmultipath/version.h similarity index 60% rename from multipath/main.h rename to libmultipath/version.h index 8d5b285..d577ec9 100644 --- a/multipath/main.h +++ b/libmultipath/version.h @@ -1,9 +1,9 @@ /* - * Soft: Description here... + * Soft: multipath device mapper target autoconfig * * Version: $Id: main.h,v 0.0.1 2003/09/18 15:13:38 cvaroqui Exp $ * - * Author: Copyright (C) 2003 Christophe Varoqui + * Author: Christophe Varoqui * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,26 +14,24 @@ * modify it under the terms of 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. + * + * Copyright (c) 2006 Christophe Varoqui */ - -#ifndef _MAIN_H -#define _MAIN_H - -/* - * Build version - */ -#define PROG "multipath" +#ifndef _VERSION_H +#define _VERSION_H #define VERSION_CODE 0x000407 #define DATE_CODE 0x030c06 -#define MULTIPATH_VERSION(version) \ - (version >> 16) & 0xFF, \ - (version >> 8) & 0xFF, \ +#define PROG "multipath-tools" + +#define MULTIPATH_VERSION(version) \ + (version >> 16) & 0xFF, \ + (version >> 8) & 0xFF, \ version & 0xFF -#define VERSION_STRING PROG" v%d.%d.%d (%.2d/%.2d, 20%.2d)\n", \ - MULTIPATH_VERSION(VERSION_CODE), \ - MULTIPATH_VERSION(DATE_CODE) +#define VERSION_STRING PROG" v%d.%d.%d (%.2d/%.2d, 20%.2d)\n", \ + MULTIPATH_VERSION(VERSION_CODE), \ + MULTIPATH_VERSION(DATE_CODE) -#endif +#endif /* _VERSION_H */ diff --git a/multipath/main.c b/multipath/main.c index 931b137..07c046b 100644 --- a/multipath/main.c +++ b/multipath/main.c @@ -46,8 +46,7 @@ #include #include #include - -#include "main.h" +#include static int filter_pathvec (vector pathvec, char * refwwid) diff --git a/multipathd/cli.c b/multipathd/cli.c index 475819b..bd0d03b 100644 --- a/multipathd/cli.c +++ b/multipathd/cli.c @@ -4,6 +4,7 @@ #include #include #include +#include #include "cli.h" @@ -305,6 +306,8 @@ genhelp_handler (void) return NULL; p = reply; + p += sprintf(p, VERSION_STRING); + p += sprintf(p, "CLI commands reference:\n"); vector_foreach_slot (handlers, h, i) { fp = h->fingerprint;