You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celix.apache.org by pn...@apache.org on 2018/03/22 08:18:08 UTC
celix git commit: Reverst getPusSubTopicInfo logic (scopes are
optional attribute for pubsub filters). Updates the add_celix_container CMake
commands so that the exe name is equal to the container name.
Repository: celix
Updated Branches:
refs/heads/develop 96cd7e023 -> 857e8129f
Reverst getPusSubTopicInfo logic (scopes are optional attribute for pubsub filters). Updates the add_celix_container CMake commands so that the exe name is equal to the container name.
Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/857e8129
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/857e8129
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/857e8129
Branch: refs/heads/develop
Commit: 857e8129f1579eacd40285db698980a8affde75b
Parents: 96cd7e0
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Thu Mar 22 09:16:47 2018 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Thu Mar 22 09:16:47 2018 +0100
----------------------------------------------------------------------
cmake/cmake_celix/DeployPackaging.cmake | 1 +
pubsub/pubsub_spi/include/pubsub_utils.h | 8 ++++++++
pubsub/pubsub_spi/src/pubsub_utils.c | 9 +++++++--
3 files changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/celix/blob/857e8129/cmake/cmake_celix/DeployPackaging.cmake
----------------------------------------------------------------------
diff --git a/cmake/cmake_celix/DeployPackaging.cmake b/cmake/cmake_celix/DeployPackaging.cmake
index be996df..ab49c1f 100644
--- a/cmake/cmake_celix/DeployPackaging.cmake
+++ b/cmake/cmake_celix/DeployPackaging.cmake
@@ -106,6 +106,7 @@ $<JOIN:$<TARGET_PROPERTY:${CONTAINER_TARGET},CONTAINER_EMBEDDED_PROPERTIES>,\\n\
if (LAUNCHER_SRC) #compilation needed
add_executable(${CONTAINER_TARGET} ${LAUNCHER_SRC})
set_target_properties(${CONTAINER_TARGET} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CONTAINER_LOC})
+ set_target_properties(${CONTAINER_TARGET} PROPERTIES OUTPUT_NAME ${CONTAINER_NAME})
target_link_libraries(${CONTAINER_TARGET} PRIVATE Celix::framework)
set(LAUNCHER "$<TARGET_FILE:${CONTAINER_TARGET}>")
else ()
http://git-wip-us.apache.org/repos/asf/celix/blob/857e8129/pubsub/pubsub_spi/include/pubsub_utils.h
----------------------------------------------------------------------
diff --git a/pubsub/pubsub_spi/include/pubsub_utils.h b/pubsub/pubsub_spi/include/pubsub_utils.h
index 96d20a4..1c92a9b 100644
--- a/pubsub/pubsub_spi/include/pubsub_utils.h
+++ b/pubsub/pubsub_spi/include/pubsub_utils.h
@@ -30,7 +30,15 @@
#include "bundle_context.h"
#include "array_list.h"
+/**
+ * Returns the pubsub info from the provided filter. A pubsub filter should have a topic and can
+ * have a scope. If no topic is present the topic and scope output will be NULL.
+ * If a topic is present the topic output will contain a allocated topic string and if a scope was
+ * present a allocated scope string.
+ * The caller is owner of the topic and scope output string.
+ */
celix_status_t pubsub_getPubSubInfoFromFilter(const char* filterstr, char **topic, char **scope);
+
char* pubsub_getKeysBundleDir(bundle_context_pt ctx);
http://git-wip-us.apache.org/repos/asf/celix/blob/857e8129/pubsub/pubsub_spi/src/pubsub_utils.c
----------------------------------------------------------------------
diff --git a/pubsub/pubsub_spi/src/pubsub_utils.c b/pubsub/pubsub_spi/src/pubsub_utils.c
index 5050077..55185d9 100644
--- a/pubsub/pubsub_spi/src/pubsub_utils.c
+++ b/pubsub/pubsub_spi/src/pubsub_utils.c
@@ -69,9 +69,14 @@ celix_status_t pubsub_getPubSubInfoFromFilter(const char* filterstr, char **topi
}
}
- if (topic != NULL && scope != NULL && objectClass != NULL && strncmp(objectClass, PUBSUB_PUBLISHER_SERVICE_NAME, 128) == 0) {
+ if (topic != NULL && objectClass != NULL && strncmp(objectClass, PUBSUB_PUBLISHER_SERVICE_NAME, 128) == 0) {
+ //NOTE topic must be present, scope can be present in the filter.
*topicOut = strdup(topic);
- *scopeOut = strdup(scope);
+ if (scope != NULL) {
+ *scopeOut = strdup(scope);
+ } else {
+ *scopeOut = NULL;
+ }
} else {
*topicOut = NULL;
*scopeOut = NULL;