From a5e04a10e697d6c617edff3ea6e488876606146f Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Tue, 5 Aug 2003 14:37:50 +0000 Subject: [PATCH] * src/misc/version.hh, src/misc/version.cc: New files. * src/misc/Makefile.am (libmisc_la_SOURCES, misc_HEADERS): Add them. * wrap/python/spot.i: Include misc/version.hh. * wrap/python/cgi/ltl2tgba.in: Print spot.version(). --- ChangeLog | 5 +++++ src/misc/Makefile.am | 6 ++++-- src/misc/version.cc | 12 ++++++++++++ src/misc/version.hh | 10 ++++++++++ wrap/python/cgi/ltl2tgba.in | 2 +- wrap/python/spot.i | 4 ++++ 6 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 src/misc/version.cc create mode 100644 src/misc/version.hh diff --git a/ChangeLog b/ChangeLog index 51e54baff..1a4989d81 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2003-08-05 Alexandre Duret-Lutz + * src/misc/version.hh, src/misc/version.cc: New files. + * src/misc/Makefile.am (libmisc_la_SOURCES, misc_HEADERS): Add them. + * wrap/python/spot.i: Include misc/version.hh. + * wrap/python/cgi/ltl2tgba.in: Print spot.version(). + * README: Update layout. * wrap/python/cgi/Makefile.am, wrap/python/cgi/ltl2tgba.in, diff --git a/src/misc/Makefile.am b/src/misc/Makefile.am index 0696b2cf6..86d96a4a7 100644 --- a/src/misc/Makefile.am +++ b/src/misc/Makefile.am @@ -5,8 +5,10 @@ miscdir = $(pkgincludedir)/misc misc_HEADERS = \ bddalloc.hh \ - bddlt.hh + bddlt.hh \ + version.hh noinst_LTLIBRARIES = libmisc.la libmisc_la_SOURCES = \ - bddalloc.cc + bddalloc.cc \ + version.cc diff --git a/src/misc/version.cc b/src/misc/version.cc new file mode 100644 index 000000000..0323f762f --- /dev/null +++ b/src/misc/version.cc @@ -0,0 +1,12 @@ +#include "version.hh" + +namespace spot +{ + static const char version_[] = VERSION; + + const char* + version() + { + return version_; + } +} diff --git a/src/misc/version.hh b/src/misc/version.hh new file mode 100644 index 000000000..06d5e4fb9 --- /dev/null +++ b/src/misc/version.hh @@ -0,0 +1,10 @@ +#ifndef SPOT_MISC_VERSION_HH +# define SPOT_MISC_VERSION_HH + +namespace spot +{ + /// Return Spot's version. + const char* version(); +} + +#endif // SPOT_MISC_VERSION_HH diff --git a/wrap/python/cgi/ltl2tgba.in b/wrap/python/cgi/ltl2tgba.in index 4e393fed8..c4c536aaf 100644 --- a/wrap/python/cgi/ltl2tgba.in +++ b/wrap/python/cgi/ltl2tgba.in @@ -224,4 +224,4 @@ del degen del concrete print '
' -print 'Spot @PACKAGE_VERSION@' \ No newline at end of file +print 'ltl2tgba.py @PACKAGE_VERSION@; Spot', spot.version() diff --git a/wrap/python/spot.i b/wrap/python/spot.i index 2db779335..33c128199 100644 --- a/wrap/python/spot.i +++ b/wrap/python/spot.i @@ -10,6 +10,8 @@ #include #include +#include "misc/version.hh" + #include "ltlast/formula.hh" #include "ltlast/refformula.hh" #include "ltlast/atomic_prop.hh" @@ -56,6 +58,8 @@ using namespace spot::ltl; using namespace spot; %} +%include "misc/version.hh" + %include "ltlast/formula.hh" %include "ltlast/refformula.hh" %include "ltlast/atomic_prop.hh" -- GitLab