# If you change this, you should update the libtool version number specified
# in src/Makefile.am. Read <http://www.gnu.org/software/libtool/manual.html#Versioning>
# for suggestions on doing so.
+
+# The version number consists of three segments: major, API minor, and
+# implementation minor. Whenever a change is made to AS_DCP.h, the API minor
+# version will increment. Changes made to the internal implementation will
+# result in the incrementing of the implementation minor version.
+#
+# For example, if asdcplib version 1.0.0 were modified to accomodate changes
+# in file format, and if no changes were made to AS_DCP.h, the new version would be
+# 1.0.1. If changes were also required in AS_DCP.h, the new version would be 1.1.1.
AC_INIT([asdcplib], [1.3.19], [asdcplib@cinecert.com])
+
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_SRCDIR([src/KM_error.h])
#AC_CONFIG_HEADER([src/config.h])
const char*
ASDCP::Version()
{
- static char ver[16];
- snprintf(ver, 16, "%u.%u.%u", VERSION_MAJOR, VERSION_APIMINOR, VERSION_IMPMINOR);
- return ver;
+ return PACKAGE_VERSION;
}
// All library components are defined in the namespace ASDCP
//
namespace ASDCP {
- // The version number consists of three segments: major, API minor, and
- // implementation minor. Whenever a change is made to AS_DCP.h, the API minor
- // version will increment. Changes made to the internal implementation will
- // result in the incrementing of the implementation minor version.
-
- // For example, if asdcplib version 1.0.0 were modified to accomodate changes
- // in file format, and if no changes were made to AS_DCP.h, the new version would be
- // 1.0.1. If changes were also required in AS_DCP.h, the new version would be 1.1.1.
- const ui32_t VERSION_MAJOR = 1;
- const ui32_t VERSION_APIMINOR = 3;
- const ui32_t VERSION_IMPMINOR = 19;
+ //
+ // The version number declaration and explanation have moved to ../configure.ac
const char* Version();
// UUIDs are passed around as strings of UUIDlen bytes
if ( stat(path, stat_info) == -1L )
result = Kumu::RESULT_FILEOPEN;
- if ( stat_info->st_mode & (S_IFREG|S_IFLNK|S_IFDIR) == 0 )
+ if ( (stat_info->st_mode & (S_IFREG|S_IFLNK|S_IFDIR)) == 0 )
result = Kumu::RESULT_FILEOPEN;
#endif
if ( fstat(handle, stat_info) == -1L )
result = Kumu::RESULT_FILEOPEN;
- if ( stat_info->st_mode & (S_IFREG|S_IFLNK|S_IFDIR) == 0 )
+ if ( (stat_info->st_mode & (S_IFREG|S_IFLNK|S_IFDIR)) == 0 )
result = Kumu::RESULT_FILEOPEN;
return result;
memcpy(ProductUUID, default_ProductUUID_Data, UUIDlen);
CompanyName = "WidgetCo";
ProductName = "asdcp-test";
-
- char s_buf[128];
- snprintf(s_buf, 128, "%u.%u.%u", VERSION_MAJOR, VERSION_APIMINOR, VERSION_IMPMINOR);
- ProductVersion = s_buf;
+ ProductVersion = ASDCP::Version();
}
} s_MyInfo;
#endif
+static std::vector<int>
+version_split(const char* str)
+{
+ std::vector<int> result;
+
+ const char* pstr = str;
+ const char* r = strchr(pstr, '.');
+
+ while ( r != 0 )
+ {
+ assert(r >= pstr);
+ if ( r > pstr )
+ result.push_back(atoi(pstr));
+
+ pstr = r + 1;
+ r = strchr(pstr, '.');
+ }
+
+ if( strlen(pstr) > 0 )
+ result.push_back(atoi(pstr));
+
+ assert(result.size() == 3);
+ return result;
+}
+
//
ASDCP::h__Writer::h__Writer() :
Ident->VersionString = m_Info.ProductVersion.c_str();
Ident->ProductUID.Set(m_Info.ProductUUID);
Ident->Platform = ASDCP_PLATFORM;
- Ident->ToolkitVersion.Major = VERSION_MAJOR;
- Ident->ToolkitVersion.Minor = VERSION_APIMINOR;
- Ident->ToolkitVersion.Patch = VERSION_IMPMINOR;
+
+ std::vector<int> version = version_split(Version());
+
+ Ident->ToolkitVersion.Major = version[0];
+ Ident->ToolkitVersion.Minor = version[1];
+ Ident->ToolkitVersion.Patch = version[2];
Ident->ToolkitVersion.Build = ASDCP_BUILD_NUMBER;
Ident->ToolkitVersion.Release = VersionType::RL_RELEASE;
}