aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/version.cpp20
-rw-r--r--src/utils/version.h15
2 files changed, 25 insertions, 10 deletions
diff --git a/src/utils/version.cpp b/src/utils/version.cpp
index 22827cbe5..cf3205d19 100644
--- a/src/utils/version.cpp
+++ b/src/utils/version.cpp
@@ -1,12 +1,13 @@
/*
* Version Information
-* (C) 1999-2007 Jack Lloyd
+* (C) 1999-2011 Jack Lloyd
*
* Distributed under the terms of the Botan license
*/
#include <botan/version.h>
#include <botan/parsing.h>
+#include <sstream>
namespace Botan {
@@ -21,9 +22,20 @@ namespace Botan {
*/
std::string version_string()
{
- return to_string(version_major()) + "." +
- to_string(version_minor()) + "." +
- to_string(version_patch());
+ std::ostringstream out;
+
+ out << "Botan " << version_major() << "."
+ << version_minor() << "."
+ << version_patch() << " (";
+
+ if(BOTAN_VERSION_DATESTAMP == 0)
+ out << "unreleased version";
+ else
+ out << "released " << version_datestamp();
+
+ out << ", distribution " << BOTAN_DISTRIBUTION_INFO << ")";
+
+ return out.str();
}
u32bit version_datestamp() { return BOTAN_VERSION_DATESTAMP; }
diff --git a/src/utils/version.h b/src/utils/version.h
index 13d0ac8bb..219c261a5 100644
--- a/src/utils/version.h
+++ b/src/utils/version.h
@@ -1,6 +1,6 @@
/*
* Version Information
-* (C) 1999-2007 Jack Lloyd
+* (C) 1999-2011 Jack Lloyd
*
* Distributed under the terms of the Botan license
*/
@@ -18,16 +18,19 @@ namespace Botan {
*/
/**
-* Get the version string identifying the version of Botan.
+* Get a human-readable string identifying the version of Botan.
+* No particular format should be assumed.
* @return version string
*/
BOTAN_DLL std::string version_string();
/**
-* Return the date this version of botan was released, in an
-* integer of the form YYYYMMDD. For instance a version released
-* on May 21, 2013 would return the integer 20130521
-* @return release date
+* Return the date this version of botan was released, in an integer of
+* the form YYYYMMDD. For instance a version released on May 21, 2013
+* would return the integer 20130521. If the currently running version
+* is not an official release, this function will return 0 instead.
+*
+* @return release date, or zero if unreleased
*/
BOTAN_DLL u32bit version_datestamp();