[libmultipath] move the tools' version string to the lib
authorChristophe Varoqui <root@xa-s05.(none)>
Tue, 14 Mar 2006 13:06:30 +0000 (14:06 +0100)
committerChristophe Varoqui <root@xa-s05.(none)>
Tue, 14 Mar 2006 13:06:30 +0000 (14:06 +0100)
o Remove multipath/main.h
o Print the version string in the CLI syntax reference

libmultipath/version.h [moved from multipath/main.h with 60% similarity]
multipath/main.c
multipathd/cli.c

similarity index 60%
rename from multipath/main.h
rename to libmultipath/version.h
index 8d5b285..d577ec9 100644 (file)
@@ -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
  *              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 */
index 931b137..07c046b 100644 (file)
@@ -46,8 +46,7 @@
 #include <alias.h>
 #include <configure.h>
 #include <pgpolicies.h>
-
-#include "main.h"
+#include <version.h>
 
 static int
 filter_pathvec (vector pathvec, char * refwwid)
index 475819b..bd0d03b 100644 (file)
@@ -4,6 +4,7 @@
 #include <memory.h>
 #include <vector.h>
 #include <util.h>
+#include <version.h>
 
 #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;