Module: xenomai-3
Branch: master
Commit: 076e7841de293a6d3695d9a2b6184e260ddbd8bc
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=076e7841de293a6d3695d9a2b6184e260ddbd8bc

Author: Philippe Gerum <r...@xenomai.org>
Date:   Wed May 13 09:13:04 2015 +0200

boilerplate/setup: introduce application_version() hook

Applications can implement this hook for dumping their own version
stamp, which will be dumped when --version is given to the program,
followed by the Xenomai release stamp.

---

 include/xenomai/init.h  |    2 ++
 lib/boilerplate/setup.c |   11 ++++++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/include/xenomai/init.h b/include/xenomai/init.h
index 6b3636b..bed4a28 100644
--- a/include/xenomai/init.h
+++ b/include/xenomai/init.h
@@ -32,6 +32,8 @@ void xenomai_usage(void);
 
 void application_usage(void);
 
+void application_version(void);
+
 extern const char *xenomai_version_string;
 
 #ifdef __cplusplus
diff --git a/lib/boilerplate/setup.c b/lib/boilerplate/setup.c
index 0f69fa2..6a458a1 100644
--- a/lib/boilerplate/setup.c
+++ b/lib/boilerplate/setup.c
@@ -101,9 +101,18 @@ static const struct option base_options[] = {
        }
 };
 
+void __weak application_version(void)
+{
+       /*
+        * Applications can implement this hook for dumping their own
+        * version stamp.
+        */
+}
+
 static inline void print_version(void)
 {
-       fprintf(stderr, "%s\n", xenomai_version_string);
+       application_version();
+       fprintf(stderr, "based on %s\n", xenomai_version_string);
 }
 
 static inline void dump_configuration(void)


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://xenomai.org/mailman/listinfo/xenomai-git

Reply via email to