summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjhurst <jhurst@cinecert.com>2008-05-20 22:40:09 +0000
committerjhurst <>2008-05-20 22:40:09 +0000
commit8bf17481fbd360094c04d25023986b38e57205bc (patch)
tree222c85334489434c4bb2177212956c205d2c2a93 /src
parent71e5dbde64e9186cfd5de462553485612218d6fc (diff)
version reorg, precedence patch for stat check
Diffstat (limited to 'src')
-rwxr-xr-xsrc/AS_DCP.cpp4
-rwxr-xr-xsrc/AS_DCP.h13
-rw-r--r--src/KM_fileio.cpp4
-rwxr-xr-xsrc/asdcp-test.cpp5
-rwxr-xr-xsrc/h__Writer.cpp34
5 files changed, 37 insertions, 23 deletions
diff --git a/src/AS_DCP.cpp b/src/AS_DCP.cpp
index 10d5c66..9bb8dd5 100755
--- a/src/AS_DCP.cpp
+++ b/src/AS_DCP.cpp
@@ -35,9 +35,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
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;
}
diff --git a/src/AS_DCP.h b/src/AS_DCP.h
index e03557a..bda4c13 100755
--- a/src/AS_DCP.h
+++ b/src/AS_DCP.h
@@ -146,17 +146,8 @@ typedef unsigned int ui32_t;
// 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
diff --git a/src/KM_fileio.cpp b/src/KM_fileio.cpp
index 5a56c44..918a852 100644
--- a/src/KM_fileio.cpp
+++ b/src/KM_fileio.cpp
@@ -103,7 +103,7 @@ do_stat(const char* path, fstat_t* stat_info)
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
@@ -123,7 +123,7 @@ do_fstat(HANDLE handle, fstat_t* stat_info)
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;
diff --git a/src/asdcp-test.cpp b/src/asdcp-test.cpp
index c77cd89..daa8b4f 100755
--- a/src/asdcp-test.cpp
+++ b/src/asdcp-test.cpp
@@ -83,10 +83,7 @@ public:
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;
diff --git a/src/h__Writer.cpp b/src/h__Writer.cpp
index 4517966..fb66b68 100755
--- a/src/h__Writer.cpp
+++ b/src/h__Writer.cpp
@@ -41,6 +41,31 @@ using namespace ASDCP::MXF;
#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() :
@@ -124,9 +149,12 @@ ASDCP::h__Writer::InitHeader()
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;
}