summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Rauwolf <rauwolf@itestra.de>2013-09-13 18:50:32 +0200
committerJohannes Schanda <schanda@itestra.de>2013-09-18 17:50:10 +0200
commit5cfaec7f21db9fa62061b4c87f91bcb2d441603f (patch)
treef9ccda0cc0e60cd9c83677271274918ca3a1932d
parent61229569bfcb6f053eb4b1bbf803881c6c9c0ed6 (diff)
downloadgenivi-common-api-runtime-5cfaec7f21db9fa62061b4c87f91bcb2d441603f.tar.gz
Added version information to middleware
Struct "MiddlewareInfo" was expanded by a member variable "version". Checks against this additional information still need to be implemented. Fixed a possible mismatching on library names along the way.
-rw-r--r--src/CommonAPI/MiddlewareInfo.h9
-rw-r--r--src/CommonAPI/utils.h2
2 files changed, 8 insertions, 3 deletions
diff --git a/src/CommonAPI/MiddlewareInfo.h b/src/CommonAPI/MiddlewareInfo.h
index ffbc21c..7a138b3 100644
--- a/src/CommonAPI/MiddlewareInfo.h
+++ b/src/CommonAPI/MiddlewareInfo.h
@@ -15,6 +15,7 @@
#include <memory>
#include <cstring>
+#include "types.h"
namespace CommonAPI {
@@ -29,10 +30,14 @@ typedef std::shared_ptr<Runtime> (*MiddlewareRuntimeLoadFunction) ();
struct MiddlewareInfo {
const char* middlewareName_;
MiddlewareRuntimeLoadFunction getInstance_;
+ Version version_;
- MiddlewareInfo(const char* middlewareName, MiddlewareRuntimeLoadFunction middlewareRuntimeLoadFunction):
+ MiddlewareInfo(const char* middlewareName,
+ MiddlewareRuntimeLoadFunction middlewareRuntimeLoadFunction,
+ Version version):
middlewareName_(middlewareName),
- getInstance_(middlewareRuntimeLoadFunction) {}
+ getInstance_(middlewareRuntimeLoadFunction),
+ version_(version) {}
};
diff --git a/src/CommonAPI/utils.h b/src/CommonAPI/utils.h
index c1c1c54..7717103 100644
--- a/src/CommonAPI/utils.h
+++ b/src/CommonAPI/utils.h
@@ -247,7 +247,7 @@ inline bool loadGenericLibrary(const std::string& wellKnownMiddlewareName, const
const char* fileNamePtr = libraryName.c_str();
while ((fileNamePtr = strchr(fileNamePtr + 1, '.'))) {
- if (strncmp(".so", fileNamePtr, 3) == 0) {
+ if (strncmp(".so\0", fileNamePtr, 4) == 0 || strncmp(".so.", fileNamePtr, 4) == 0) {
break;
}
}