svn commit: r1623876 - in /celix/trunk/cmake: FindCELIX.cmake cmake_celix/Packaging.cmake
Author: pnoltes Date: Tue Sep 9 20:03:56 2014 New Revision: 1623876 URL: http://svn.apache.org/r1623876 Log: CELIX-144: Changed FindCelix, additional include(..) not needed anymore. assuming celix binaries/headers are findable relative form FindCELIX.cmake. Also exports CELIX_BUNDLES_DIR for use in the deploy.cmake files. Packinging now regonizes bunles with a full path (e.g. using CELIX_BUNDLES_DIR) and add those bundles to the deployment. Modified: celix/trunk/cmake/FindCELIX.cmake celix/trunk/cmake/cmake_celix/Packaging.cmake Modified: celix/trunk/cmake/FindCELIX.cmake URL: http://svn.apache.org/viewvc/celix/trunk/cmake/FindCELIX.cmake?rev=1623876r1=1623875r2=1623876view=diff == --- celix/trunk/cmake/FindCELIX.cmake (original) +++ celix/trunk/cmake/FindCELIX.cmake Tue Sep 9 20:03:56 2014 @@ -16,39 +16,55 @@ # under the License. -# - Try to find Celix +# - Try to find Celix define the variables for the binaries/headers and include +# the Celix cmake modules needed to build bundles +# # Once done this will define # CELIX_FOUND - System has Apache Celix # CELIX_INCLUDE_DIRS - The Apache Celix include directories # CELIX_LIBRARIES - The libraries needed to use Apache Celix -## # CELIX_LAUNCHER - The path to the celix launcher +# CELIX_BUNDLES_DIR - The path where the Celix provided bundles are installed + +set(CELIX_DIR_FROM_FINDCELIX ${CMAKE_CURRENT_LIST_DIR}/../../../..) + find_path(CELIX_INCLUDE_DIR celix_errno.h - PATHS $ENV{CELIX_DIR} ${CELIX_DIR} /usr /usr/local + PATHS ${CELIX_DIR_FROM_FINDCELIX} $ENV{CELIX_DIR} ${CELIX_DIR} /usr /usr/local PATH_SUFFIXES include include/celix) find_library(CELIX_FRAMEWORK_LIBRARY NAMES celix_framework - PATHS $ENV{CELIX_DIR} ${CELIX_DIR} /usr /usr/local + PATHS ${CELIX_DIR_FROM_FINDCELIX} $ENV{CELIX_DIR} ${CELIX_DIR} /usr /usr/local PATH_SUFFIXES lib lib64) find_library(CELIX_UTILS_LIBRARY NAMES celix_utils - PATHS $ENV{CELIX_DIR} ${CELIX_DIR} /usr /usr/local + PATHS ${CELIX_DIR_FROM_FINDCELIX} $ENV{CELIX_DIR} ${CELIX_DIR} /usr /usr/local PATH_SUFFIXES lib lib64) find_program(CELIX_LAUNCHER NAMES celix - PATHS $ENV{CELIX_DIR} ${CELIX_DIR} /usr /usr/local + PATHS ${CELIX_DIR_FROM_FINDCELIX} $ENV{CELIX_DIR} ${CELIX_DIR} /usr /usr/local PATH_SUFFIXES bin) +find_file(CELIX_CMAKECELIX_FILE CMakeCelix.cmake + PATHS ${CELIX_DIR_FROM_FINDCELIX} $ENV{CELIX_DIR} ${CELIX_DIR} /usr /usr/local + PATH_SUFFIXES share/celix/cmake/modules) + +#NOTE assuming shell.zip is always installed. +find_path(CELIX_BUNDLES_DIR shell.zip + PATHS ${CELIX_DIR_FROM_FINDCELIX} $ENV{CELIX_DIR} ${CELIX_DIR} /usr /usr/local + PATH_SUFFIXES share/celix/bundles) + + include(FindPackageHandleStandardArgs) # handle the QUIETLY and REQUIRED arguments and set CELIX_FOUND to TRUE # if all listed variables are TRUE find_package_handle_standard_args(CELIX DEFAULT_MSG - CELIX_FRAMEWORK_LIBRARY CELIX_UTILS_LIBRARY CELIX_INCLUDE_DIR CELIX_LAUNCHER) -mark_as_advanced(CELIX_INCLUDE_DIR CELIX_FRAMEWORK_LIBRARY CELIX_UTILS_LIBRARY CELIX_LAUNCHER) + CELIX_FRAMEWORK_LIBRARY CELIX_UTILS_LIBRARY CELIX_INCLUDE_DIR CELIX_LAUNCHER CELIX_CMAKECELIX_FILE) +mark_as_advanced(CELIX_INCLUDE_DIR CELIX_FRAMEWORK_LIBRARY CELIX_UTILS_LIBRARY CELIX_LAUNCHER CELIX_CMAKECELIX_FILE) if(CELIX_FOUND) set(CELIX_LIBRARIES ${CELIX_FRAMEWORK_LIBRARY} ${CELIX_UTILS_LIBRARY}) set(CELIX_INCLUDE_DIRS ${CELIX_INCLUDE_DIR}) + include(${CELIX_CMAKECELIX_FILE}) endif() Modified: celix/trunk/cmake/cmake_celix/Packaging.cmake URL: http://svn.apache.org/viewvc/celix/trunk/cmake/cmake_celix/Packaging.cmake?rev=1623876r1=1623875r2=1623876view=diff == --- celix/trunk/cmake/cmake_celix/Packaging.cmake (original) +++ celix/trunk/cmake/cmake_celix/Packaging.cmake Tue Sep 9 20:03:56 2014 @@ -336,15 +336,25 @@ MACRO(deploy) FOREACH(BUNDLE ${DEPLOY_BUNDLES}) SET(DEP_NAME ${DEPLOY_NAME}_${BUNDLE}) - get_property(bundle_file TARGET ${BUNDLE} PROPERTY BUNDLE) - add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/bundles/${BUNDLE}.zip - COMMAND ${CMAKE_COMMAND} -E copy ${bundle_file} - ${CMAKE_CURRENT_BINARY_DIR}/deploy/${DEPLOY_NAME}/bundles/${BUNDLE}.zip - DEPENDS ${BUNDLE} - COMMENT Deploying ${BUNDLE} to ${DEPLOY_NAME} - ) - SET(BUNDLES ${BUNDLES} bundles/${BUNDLE}.zip) - SET(DEPS ${DEPS
svn commit: r1623877 - /celix/site/trunk/content/documentation/getting_started.md
Author: pnoltes Date: Tue Sep 9 20:04:47 2014 New Revision: 1623877 URL: http://svn.apache.org/r1623877 Log: CELIX-144: added first draft of getting started documented. not yet complete or ready for public view .. Added: celix/site/trunk/content/documentation/getting_started.md Added: celix/site/trunk/content/documentation/getting_started.md URL: http://svn.apache.org/viewvc/celix/site/trunk/content/documentation/getting_started.md?rev=1623877view=auto == --- celix/site/trunk/content/documentation/getting_started.md (added) +++ celix/site/trunk/content/documentation/getting_started.md Tue Sep 9 20:04:47 2014 @@ -0,0 +1,208 @@ +##Intro +This page is intended for first time users of Apache Celix. It should guide you through building installing Apache Celix, setting up a new eclipse project, creating your first bundle and finally running and debugging your bundle directly from eclipse workspace. + +If there are any uncertainties or question, don't hesitate to ask your questions in the [Apache Celix mailing](https://celix.apache.org/support/mailinglist.html). + +##Prerequisite +Some experience with a command line interface (X terminal) is expected to be able to follow this guide. + +The following packages (libraries + headers) should be installed on the system: + +* Development Environment + * build-essentials (duh) + * subversion + * cmake +* Apache Celix Dependencies + * apr + * apr-util + * curl + * jansson + +For a debian based systems, the following command could help: +pre +apt-get install -yq --no-install-recommends \ + build-essential \ + curl \ + libapr1-dev \ + libaprutil1-dev \ + subversion \ + libjansson-dev \ + libcurl4-openssl-dev \ + cmake +/pre + + +##Building Installing Apache Celix +To get started we first have to install Apache Celix, to do this you can download a source release from the [download page](/celix/download.cgi) or checkout the latest version from svn. For this getting started guide the latest trunk version is assumed. Then choose a workspace dir to work in , set the location to the environment variable WS and follow the following guide: + + #Create a new workspace to work in + + #e.g + #mkdir ${HOME}/workspace + #export WS=${HOME}/workspace + + cd ${WS} + + #checkout Apache Celix + svn co https://svn.apache.org/repos/asf/celix/trunk/ celix-src + + #create a build directory to build Celix in (out of source build) + mkdir celix-build + + #build Apache Celix with the default settings + #Note1 if you want to change the install path add -DCMAKE_INSTALL_PREFIX=/opt/local + #Note2 If you want to be able to edit all the available options, + # use the ccmake (ncursus) instead of cmake. + #TODO check which bundles or on default. probably not shell shell_tui... + cd celix-build + cmake ../celix-src + make all + + #install the framework and the bundles + make install-all + +##Installing Eclipse CDT +Download the latest eclipse CDT at [www.eclipse.org](www.eclipse.org) and install it on your system. For more information on how the install eclipse on your system consult the eclipse documentation. In this getting started guide the luna version of eclipse was used ([linux](http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/luna/R/eclipse-cpp-luna-R-linux-gtk-x86_64.tar.gz) [mac](http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/luna/R/eclipse-cpp-luna-R-macosx-cocoa-x86_64.tar.gz)). + + + +##Apache Celix Bundle project +Create a new project dir to work in: + + mkdir ${WS}/myproject + cd ${WS}/myproject + +For Apache Celix and an Apache Celix Bundle project CMake is used as build system. CMake is a cross platform build system which is uses a declarative way of describing build. This getting started will only roughly explain how CMake works, for a more detail introduction on CMake consult the CMake documentation. + +The Apache Celix installed additional cmake files to extend the default functionality of CMake to support the creating and testing of OSGi bundles. + +CMake expects a CMakeLists.txt file in the root of a project directory. To get started add an initial CMakeLists.txt file to the project root with your favourite editor: + + #${WS}/myproject/CMakeLists.txt + + #PART1 + cmake_minimum_required(VERSION 2.8) + project(myproject C) + cmake_policy(SET CMP0012 NEW) + + #PART2 + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} /usr/share/celix/cmake/modules) + find_package(CELIX REQUIRED
svn commit: r1633566 - in /celix/trunk: ./ shell_bonjour/ shell_bonjour/private/ shell_bonjour/private/include/ shell_bonjour/private/src/
Author: pnoltes Date: Wed Oct 22 09:07:10 2014 New Revision: 1633566 URL: http://svn.apache.org/r1633566 Log: CELIX-172: Initial commit for the bonjour shell. Added: celix/trunk/shell_bonjour/ celix/trunk/shell_bonjour/CMakeLists.txt celix/trunk/shell_bonjour/deploy.cmake celix/trunk/shell_bonjour/private/ celix/trunk/shell_bonjour/private/include/ celix/trunk/shell_bonjour/private/include/bonjour_shell.h celix/trunk/shell_bonjour/private/src/ celix/trunk/shell_bonjour/private/src/activator.c celix/trunk/shell_bonjour/private/src/bonjour_shell.c Modified: celix/trunk/CMakeLists.txt Modified: celix/trunk/CMakeLists.txt URL: http://svn.apache.org/viewvc/celix/trunk/CMakeLists.txt?rev=1633566r1=1633565r2=1633566view=diff == --- celix/trunk/CMakeLists.txt (original) +++ celix/trunk/CMakeLists.txt Wed Oct 22 09:07:10 2014 @@ -58,6 +58,7 @@ add_subdirectory(device_access) add_subdirectory(deployment_admin) add_subdirectory(remote_services) add_subdirectory(remote_shell) +add_subdirectory(shell_bonjour) add_subdirectory(shell_tui) add_subdirectory(shell) add_subdirectory(log_writer) Added: celix/trunk/shell_bonjour/CMakeLists.txt URL: http://svn.apache.org/viewvc/celix/trunk/shell_bonjour/CMakeLists.txt?rev=1633566view=auto == --- celix/trunk/shell_bonjour/CMakeLists.txt (added) +++ celix/trunk/shell_bonjour/CMakeLists.txt Wed Oct 22 09:07:10 2014 @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# License); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +celix_subproject(SHELL_BONJOUR Option to enable building the Bonjour Shell (shell access by chat clients) OFF DEPS LAUNCHER shell) +if (SHELL_BONJOUR) + + find_package(LibXml2 REQUIRED) + + #TODO create/add FindDNS_SD.cmake and use it (with required) + find_library(DNS_SD_LIB NAMES dns_sd) + + set(BUNDLE_SYMBOLICNAME bonjour_shell) + set(BUNDLE_VERSION 0.1.0) + set(BUNDLE_NAME bonjour_shell) + + include_directories(${PROJECT_SOURCE_DIR}/utils/public/include) + include_directories(${PROJECT_SOURCE_DIR}/shell/public/include) + include_directories(${LIBXML2_INCLUDE_DIR}) + include_directories(private/include) + + bundle(bonjour_shell + SOURCES + private/src/activator.c + private/src/bonjour_shell.c + ) + + target_link_libraries(bonjour_shell ${CELIX_LIBRARIES} ${APR_LIBRARIES} ${LIBXML2_LIBRARIES} ${DNS_SD_LIB}) + +endif (SHELL_BONJOUR) + Added: celix/trunk/shell_bonjour/deploy.cmake URL: http://svn.apache.org/viewvc/celix/trunk/shell_bonjour/deploy.cmake?rev=1633566view=auto == --- celix/trunk/shell_bonjour/deploy.cmake (added) +++ celix/trunk/shell_bonjour/deploy.cmake Wed Oct 22 09:07:10 2014 @@ -0,0 +1,25 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# License); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +is_enabled(SHELL_BONJOUR) +if (SHELL_BONJOUR) + deploy(bonjour_shell BUNDLES + shell + bonjour_shell + PROPERTIES bonjour.shell.id=Apache Celix + ) +endif (SHELL_BONJOUR) Added: celix/trunk/shell_bonjour/private/include/bonjour_shell.h URL: http://svn.apache.org/viewvc/celix/trunk/shell_bonjour/private/include/bonjour_shell.h?rev=1633566view=auto
svn commit: r1654892 - /celix/site/trunk/content/documentation.mdtext
Author: pnoltes Date: Mon Jan 26 20:37:52 2015 New Revision: 1654892 URL: http://svn.apache.org/r1654892 Log: CELIX-144: remove a white space from the md text Modified: celix/site/trunk/content/documentation.mdtext Modified: celix/site/trunk/content/documentation.mdtext URL: http://svn.apache.org/viewvc/celix/site/trunk/content/documentation.mdtext?rev=1654892r1=1654891r2=1654892view=diff == --- celix/site/trunk/content/documentation.mdtext (original) +++ celix/site/trunk/content/documentation.mdtext Mon Jan 26 20:37:52 2015 @@ -2,7 +2,7 @@ Title: Documentation Currently the documentation for Celix contains information about building and running Celix, as well as some examples. -- [Getting Started] (/celix/documentation/getting_started.html) +- [Getting Started](/celix/documentation/getting_started.html) - [Building and Running Celix](/celix/documentation/buildingandrunning.html) - [Design](/celix/documentation/design.html) - [Mapping](/celix/documentation/mapping.html)
svn commit: r1654895 - /celix/site/trunk/content/documentation/getting_started.mdtext
Author: pnoltes Date: Mon Jan 26 21:03:55 2015 New Revision: 1654895 URL: http://svn.apache.org/r1654895 Log: CELIX-144: removed tab from image markdown text, see if that works Modified: celix/site/trunk/content/documentation/getting_started.mdtext Modified: celix/site/trunk/content/documentation/getting_started.mdtext URL: http://svn.apache.org/viewvc/celix/site/trunk/content/documentation/getting_started.mdtext?rev=1654895r1=1654894r2=1654895view=diff == --- celix/site/trunk/content/documentation/getting_started.mdtext (original) +++ celix/site/trunk/content/documentation/getting_started.mdtext Mon Jan 26 21:03:55 2015 @@ -234,15 +234,15 @@ To get started change directory to the b Startup the Eclipse EDI and a chose the `${WS}` - ![select workspace](/documentation/getting_started_img1.png) +![select workspace](/documentation/getting_started_img1.png) Import the project with existing project. - ![import project](/documentation/getting_started_img2.png) +![import project](/documentation/getting_started_img2.png) To build the project, use Project-Build All. To run or debug from Eclipse navigate to the myproject deploy directory and right click on the 'myproject.launch' file. And select Run As or Debug As to run or debug the bundle. - ![run project](/documentation/getting_started_img3.png) +![run project](/documentation/getting_started_img3.png)
svn commit: r1654897 - /celix/site/trunk/templates/sidenav.mdtext
Author: pnoltes Date: Mon Jan 26 21:11:03 2015 New Revision: 1654897 URL: http://svn.apache.org/r1654897 Log: CELIX-144: removed mem pool page form sidenav Modified: celix/site/trunk/templates/sidenav.mdtext Modified: celix/site/trunk/templates/sidenav.mdtext URL: http://svn.apache.org/viewvc/celix/site/trunk/templates/sidenav.mdtext?rev=1654897r1=1654896r2=1654897view=diff == --- celix/site/trunk/templates/sidenav.mdtext (original) +++ celix/site/trunk/templates/sidenav.mdtext Mon Jan 26 21:11:03 2015 @@ -21,7 +21,6 @@ - [How To Release](/documentation/releasing.html) - [Design](/documentation/design.html) - [Mapping](/documentation/mapping.html) -- [Memory Pools](/documentation/memorypools.html) - [Examples](/documentation/examples.html) - [Hello World Example](/examples/helloworld.html) - [Download](/download.cgi)
svn commit: r937785 - /websites/production/celix/content/
Author: pnoltes Date: Mon Jan 26 21:04:36 2015 New Revision: 937785 Log: CELIX-144: added getting started page Added: websites/production/celix/content/ - copied from r937784, websites/staging/celix/trunk/content/
svn commit: r1654896 - /celix/site/trunk/templates/sidenav.mdtext
Author: pnoltes Date: Mon Jan 26 21:07:02 2015 New Revision: 1654896 URL: http://svn.apache.org/r1654896 Log: CELIX-144: update the sidenav for the getting started page Modified: celix/site/trunk/templates/sidenav.mdtext Modified: celix/site/trunk/templates/sidenav.mdtext URL: http://svn.apache.org/viewvc/celix/site/trunk/templates/sidenav.mdtext?rev=1654896r1=1654895r2=1654896view=diff == --- celix/site/trunk/templates/sidenav.mdtext (original) +++ celix/site/trunk/templates/sidenav.mdtext Mon Jan 26 21:07:02 2015 @@ -16,6 +16,7 @@ - [Shell TUI](/subprojects/shelltui.html) - [Utils](/subprojects/utils.html) - [Documentation](/documentation.html) +- [Getting Started](/documentation/getting_started.html) - [Building and Running](/documentation/buildingandrunning.html) - [How To Release](/documentation/releasing.html) - [Design](/documentation/design.html)
svn commit: r945053 - /websites/production/celix/content/
Author: pnoltes Date: Wed Mar 25 19:36:37 2015 New Revision: 945053 Log: Publishing svnmucc operation to celix site by pnoltes Added: websites/production/celix/content/ - copied from r945052, websites/staging/celix/trunk/content/
celix git commit: CELIX-228: Added README.md to give a short intro into Apache Celix for github users
Repository: celix Updated Branches: refs/heads/master 5984c1a70 - b577cce99 CELIX-228: Added README.md to give a short intro into Apache Celix for github users Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/b577cce9 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/b577cce9 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/b577cce9 Branch: refs/heads/master Commit: b577cce9942adbda310d4bc7f134144dd0d6ae90 Parents: 5984c1a Author: Pepijn Noltes pepijnnol...@gmail.com Authored: Fri Mar 27 11:12:56 2015 +0100 Committer: Pepijn Noltes pepijnnol...@gmail.com Committed: Fri Mar 27 11:12:56 2015 +0100 -- README.md | 8 1 file changed, 8 insertions(+) -- http://git-wip-us.apache.org/repos/asf/celix/blob/b577cce9/README.md -- diff --git a/README.md b/README.md new file mode 100644 index 000..e187ebb --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ +#Apache Celix +Apache Celix is an implementation of the OSGi specification adapted to C. It will follow the API as close as possible, but since the OSGi specification is written primarily for Java, there will be differences (Java is OO, C is procedural). An important aspect of the implementation is interoperability between Java and C. This interoperability is achieved by porting and implementing the Remote Services specification in Celix. + +##Building +For information how to build Apache Celix see BUILDING + +##Introduction to Apache Celix +For an introduction into Apache Celix see [Getting Started Guide](https://celix.apache.org/documentation/getting_started.html)
Git Push Summary
Repository: celix Updated Branches: refs/heads/feature/CELIX-77_config_admin [created] 3b1f1756a
celix git commit: CELIX-229:
Repository: celix Updated Branches: refs/heads/develop b3271bcad - e8984dad1 CELIX-229: * Removed unneeded APR_INCLUDE_DIR and APR_LIBRARY usage in cmake files * corrected some missing includes Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/e8984dad Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/e8984dad Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/e8984dad Branch: refs/heads/develop Commit: e8984dad1f646edd73cba196d1d77c5dd3594ea1 Parents: b3271bc Author: Pepijn Noltes pepijnnol...@gmail.com Authored: Fri Mar 27 21:01:18 2015 +0100 Committer: Pepijn Noltes pepijnnol...@gmail.com Committed: Fri Mar 27 21:01:18 2015 +0100 -- deployment_admin/CMakeLists.txt | 4 +--- deployment_admin/private/src/deployment_admin.c | 1 + device_access/device_access/CMakeLists.txt | 2 +- device_access/driver_locator/CMakeLists.txt | 2 +- device_access/example/base_driver/CMakeLists.txt | 2 +- device_access/example/consuming_driver/CMakeLists.txt| 2 +- device_access/example/refining_driver/CMakeLists.txt | 2 +- .../example/refining_driver/private/src/refining_driver.c| 1 + framework/private/src/service_reference.c| 1 + launcher/private/src/launcher.c | 1 + utils/CMakeLists.txt | 1 - 11 files changed, 10 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/e8984dad/deployment_admin/CMakeLists.txt -- diff --git a/deployment_admin/CMakeLists.txt b/deployment_admin/CMakeLists.txt index cdb1acd..cd267bf 100644 --- a/deployment_admin/CMakeLists.txt +++ b/deployment_admin/CMakeLists.txt @@ -27,8 +27,6 @@ if (DEPLOYMENT_ADMIN) SET_HEADERS(Bundle-Name: Apache Celix Deployment Admin) include_directories(${CURL_INCLUDE_DIR}) -include_directories(${APR_INCLUDE_DIR}) -include_directories(${APRUTIL_INCLUDE_DIR}) include_directories(${PROJECT_SOURCE_DIR}/utils/public/include) include_directories(${PROJECT_SOURCE_DIR}/deployment_admin/private/include) include_directories(${PROJECT_SOURCE_DIR}/deployment_admin/public/include) @@ -60,5 +58,5 @@ if (DEPLOYMENT_ADMIN) public/include/resource_processor.h ) -target_link_libraries(deployment_admin celix_framework ${CURL_LIBRARIES} ${APR_LIBRARY} ${APRUTIL_LIBRARY}) +target_link_libraries(deployment_admin celix_framework ${CURL_LIBRARIES}) endif (DEPLOYMENT_ADMIN) http://git-wip-us.apache.org/repos/asf/celix/blob/e8984dad/deployment_admin/private/src/deployment_admin.c -- diff --git a/deployment_admin/private/src/deployment_admin.c b/deployment_admin/private/src/deployment_admin.c index 6ef80dc..8c81b59 100644 --- a/deployment_admin/private/src/deployment_admin.c +++ b/deployment_admin/private/src/deployment_admin.c @@ -29,6 +29,7 @@ #include stdio.h #include unistd.h #include string.h +#include stdint.h #include dirent.h #include sys/types.h http://git-wip-us.apache.org/repos/asf/celix/blob/e8984dad/device_access/device_access/CMakeLists.txt -- diff --git a/device_access/device_access/CMakeLists.txt b/device_access/device_access/CMakeLists.txt index 82b9e09..7d7b79b 100644 --- a/device_access/device_access/CMakeLists.txt +++ b/device_access/device_access/CMakeLists.txt @@ -52,4 +52,4 @@ include_directories(${PROJECT_SOURCE_DIR}/log_service/public/include) include_directories(public/include) include_directories(private/include) -target_link_libraries(device_manager celix_framework celix_utils ${APR_LIBRARY}) +target_link_libraries(device_manager celix_framework celix_utils) http://git-wip-us.apache.org/repos/asf/celix/blob/e8984dad/device_access/driver_locator/CMakeLists.txt -- diff --git a/device_access/driver_locator/CMakeLists.txt b/device_access/driver_locator/CMakeLists.txt index 29b0352..61d25f9 100644 --- a/device_access/driver_locator/CMakeLists.txt +++ b/device_access/driver_locator/CMakeLists.txt @@ -33,4 +33,4 @@ include_directories(private/include) include_directories(${PROJECT_SOURCE_DIR}/framework/public/include) include_directories(${PROJECT_SOURCE_DIR}/utils/public/include) -target_link_libraries(driver_locator celix_utils celix_framework ${APR_LIBRARY}) +target_link_libraries(driver_locator celix_utils celix_framework)
celix git commit: CELIX-236: Initial drop of celix-bootstrap
Repository: celix Updated Branches: refs/heads/feature/CELIX-236_celix-boostrap [created] 5d703d3ae CELIX-236: Initial drop of celix-bootstrap Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/5d703d3a Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/5d703d3a Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/5d703d3a Branch: refs/heads/feature/CELIX-236_celix-boostrap Commit: 5d703d3ae9949072d433f3893c49316b6ccf4eaf Parents: e2598c1 Author: Pepijn Noltes pepijnnol...@gmail.com Authored: Fri May 15 21:33:15 2015 +0200 Committer: Pepijn Noltes pepijnnol...@gmail.com Committed: Fri May 15 21:33:15 2015 +0200 -- celix-bootstrap/README.md | 56 +++ celix-bootstrap/celix/__init__.py | 2 + celix-bootstrap/celix/bootstrap/__init__.py | 0 celix-bootstrap/celix/bootstrap/__main__.py | 4 + .../celix/bootstrap/argument_parser.py | 73 +++ celix-bootstrap/celix/bootstrap/generators.py | 163 +++ .../bootstrap/templates/bundle/CMakeLists.txt | 55 +++ .../bootstrap/templates/bundle/bundle.json | 18 + .../templates/bundle/bundle_activator.c | 471 +++ .../bootstrap/templates/bundle/component.c | 174 +++ .../bootstrap/templates/bundle/component.h | 69 +++ .../bootstrap/templates/bundle/deploy.cmake | 18 + .../bootstrap/templates/project/CMakeLists.txt | 30 ++ .../bootstrap/templates/project/project.json| 4 + .../bootstrap/templates/services/service.h | 48 ++ .../bootstrap/templates/services/services.json | 4 + celix-bootstrap/scripts/celix-bootstrap | 5 + celix-bootstrap/setup.py| 31 ++ 18 files changed, 1225 insertions(+) -- http://git-wip-us.apache.org/repos/asf/celix/blob/5d703d3a/celix-bootstrap/README.md -- diff --git a/celix-bootstrap/README.md b/celix-bootstrap/README.md new file mode 100644 index 000..ef63c8a --- /dev/null +++ b/celix-bootstrap/README.md @@ -0,0 +1,56 @@ +# celix-bootstrap +A (python based) code generation tool for [Apache Celix](https://celix.apache.org/) projects and bundles. + +##Installation + +###Option 1 (install with distutils) + +* Download Cog from https://pypi.python.org/pypi/cogapp +* Unpack and run `python setup.py install' in the cogapp directory +* Clone this repository +* Run `python setup.py install` in the celix-bootstrap directory + +###Option 2 (configure with alias) +* Download Cog from https://pypi.python.org/pypi/cogapp +* Unpack it in a convenient directory +* Clone this repository +* Create a celix-bootstrap alias: +``` +alias celix-bootstrap='PYTHONPATH=${cog_dir}:${celix-boostrap_dir} python -m celix-bootstrap' +``` + +#Concept +The idea behind celix-boostrap is to enable users of Apache Celix to very fast setup of Apache Celix bundle projects. And after that to be able to generate and update the initial bundle code based on some declaritive attributes. + +celix-boostrap is build on top of [Cog](https://celix.apache.org/). Cog is a file generation tool. It lets you use pieces of Python code as generators in your source files to generate whatever text you need. + +The code generation code is added in the comments of the source code (in this case C or CMake syntax). This enables a +source files which contains manual code and generated code to coexists and to able to rerun code generation after manual editing source files. + +Is good to known that you should not edit anything between the following comments. +``` +{{ +{{end}} +``` + +#Usage + +You can setup a new Apache Celix project by executing following steps: +* Choose a project directory and cd to it +* Run `celix-bootstrap create_project .` +* Edit the project.json file and ensure that the celix_install_dir points to the directory where Apache Celix is installed +* Run `celix-bootstrap update .` to generate the needed files +* (Optional) Update the project.json file and run `celix-bootstrap update .` again to update the generated files +* (Optional) Run `celix-bootstrap update . -e` to update the project source files one more time and remove the code generation parts + +You can create a new bundle by executing the following steps: +* cd to the project directory +* Run `celix-bootstrap create_bundle mybundle` +* Edit the `mybundle/bundle.json` file to declare which components you like to create and what services those components depends on and/or provide +* Run `celix-bootstrap update mybundle` to generate the neccesary files +* Add the bundle to the project CMakeLists.txt file by adding the `add_subdirectory(mybundle)` line +* Add code to the component and when providing service also add the necesarry code to the bundle
celix git commit: CELIX-237: Added dyn_function.c for dynamically calling function and dynamically creating closure using a schema
Repository: celix Updated Branches: refs/heads/feature/CELIX-237_rsa-ffi 387f7792d - 7f3383247 CELIX-237: Added dyn_function.c for dynamically calling function and dynamically creating closure using a schema Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/7f338324 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/7f338324 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/7f338324 Branch: refs/heads/feature/CELIX-237_rsa-ffi Commit: 7f338324707f1100f25f7b1f3ca82f01e56663fc Parents: 387f779 Author: Pepijn Noltes pepijnnol...@gmail.com Authored: Wed Jun 17 13:46:18 2015 +0200 Committer: Pepijn Noltes pepijnnol...@gmail.com Committed: Wed Jun 17 13:46:18 2015 +0200 -- remote_services/dyn_type/CMakeLists.txt | 14 ++ remote_services/dyn_type/closure_tests.c | 98 remote_services/dyn_type/dyn_function.c | 209 ++ remote_services/dyn_type/dyn_function.h | 24 +++ remote_services/dyn_type/dyn_type.c | 26 +--- remote_services/dyn_type/dyn_type.h | 28 +++- remote_services/dyn_type/func_tests.c| 66 7 files changed, 443 insertions(+), 22 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/7f338324/remote_services/dyn_type/CMakeLists.txt -- diff --git a/remote_services/dyn_type/CMakeLists.txt b/remote_services/dyn_type/CMakeLists.txt index 8b5b78f..351bb7c 100644 --- a/remote_services/dyn_type/CMakeLists.txt +++ b/remote_services/dyn_type/CMakeLists.txt @@ -6,4 +6,18 @@ add_executable(struct_tests json_serializer.c ) +add_executable(func_tests +func_tests.c +dyn_type.c +dyn_function.c +) + +add_executable(closure_tests +closure_tests.c +dyn_type.c +dyn_function.c +) + target_link_libraries(struct_tests ${JANSSON_LIBRARIES} /lib64/libffi.so ) +target_link_libraries(func_tests ${JANSSON_LIBRARIES} /lib64/libffi.so ) +target_link_libraries(closure_tests ${JANSSON_LIBRARIES} /lib64/libffi.so ) http://git-wip-us.apache.org/repos/asf/celix/blob/7f338324/remote_services/dyn_type/closure_tests.c -- diff --git a/remote_services/dyn_type/closure_tests.c b/remote_services/dyn_type/closure_tests.c new file mode 100644 index 000..39e4ca5 --- /dev/null +++ b/remote_services/dyn_type/closure_tests.c @@ -0,0 +1,98 @@ +#include stdio.h +#include stdint.h +#include stdlib.h +#include string.h +#include ctype.h + +#include dyn_function.h + +#define EXAMPLE1_SCHEMA example(III)I +void example1_binding(void *userData, void* args[], void *out) { +printf(example1 closure called\n); +int32_t a = *((int32_t *)args[0]); +int32_t b = *((int32_t *)args[1]); +int32_t c = *((int32_t *)args[2]); +int32_t *ret = out; +*ret = a + b + c; +} + +#define EXAMPLE2_SCHEMA example(I{DDD val1 val2 val3}I)D +struct example2_arg2 { +double val1; +double val2; +double val3; +}; +void example2_binding(void *userData, void* args[], void *out) { +printf(example2 closure called\n); +int32_t a = *((int32_t *)args[0]); +struct example2_arg2 *b = *((struct example2_arg2 **)args[1]); +int32_t c = *((int32_t *)args[2]); +int32_t *ret = out; +*ret = a + b-val1 + b-val2 + b-val3 + c; +} + + +#define EXAMPLE3_SCHEMA example(III){III sum max min} +struct example3_ret { +int32_t sum; +int32_t max; +int32_t min; +}; + +void example3_binding(void *userData, void* args[], void *out) { +printf(exampleelosure called\n); +int32_t a = *((int32_t *)args[0]); +int32_t b = *((int32_t *)args[1]); +int32_t c = *((int32_t *)args[2]); +struct example3_ret *result = calloc(1,sizeof(*result)); +result-sum = a + b + c; +result-min = a = b ? a : b; +result-max = a = b ? a : b; +result-min = result-min = c ? result-min : c; +result-max = result-max = c ? result-max : c; + +struct example3_ret **ret = out; +(*ret) = result; +} + +int main() { +dyn_closure_type *dynClosure = NULL; +int rc; + +rc = dynClosure_create(EXAMPLE1_SCHEMA, example1_binding, NULL, dynClosure); +if (rc == 0) { +int32_t (*func)(int32_t a, int32_t b, int32_t c) = NULL; +dynClosure_getFnPointer(dynClosure, (void *)func); +int32_t ret = func(2,3,4); +printf(Return value for example1 is %i\n, ret); +dynClosure_destroy(dynClosure); +} else { +printf(example1 failed\n); +} + +dynClosure = NULL; +rc = dynClosure_create(EXAMPLE2_SCHEMA, example2_binding, NULL, dynClosure); +if (rc == 0) { +double (*func)(int32_t a, struct example2_arg2 *b, int32_t c) = NULL; +dynClosure_getFnPointer(dynClosure, (void *)func); +struct
[2/2] celix git commit: CELIX-237: refactoring to dynamic_function_interface. dyn_type now uses mem stream and avro descriptor translator added
CELIX-237: refactoring to dynamic_function_interface. dyn_type now uses mem stream and avro descriptor translator added Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/bdeba2bc Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/bdeba2bc Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/bdeba2bc Branch: refs/heads/feature/CELIX-237_rsa-ffi Commit: bdeba2bcb6ef277ad7e809fbd482f6a6cd2ff1ce Parents: 7f33832 Author: Pepijn Noltes pepijnnol...@gmail.com Authored: Thu Jul 2 09:59:43 2015 +0200 Committer: Pepijn Noltes pepijnnol...@gmail.com Committed: Thu Jul 2 09:59:43 2015 +0200 -- remote_services/CMakeLists.txt | 2 +- remote_services/dyn_type/CMakeLists.txt | 23 - remote_services/dyn_type/closure_tests.c| 98 --- remote_services/dyn_type/dyn_function.c | 209 - remote_services/dyn_type/dyn_function.h | 24 - remote_services/dyn_type/dyn_type.c | 535 remote_services/dyn_type/dyn_type.h | 104 --- remote_services/dyn_type/func_tests.c | 66 -- remote_services/dyn_type/json_serializer.c | 123 --- remote_services/dyn_type/json_serializer.h | 9 - remote_services/dyn_type/struct_tests.c | 159 .../dynamic_function_interface/CMakeLists.txt | 40 + .../avro_descriptor_translator.c| 294 +++ .../descriptor_translator.h | 28 + .../dynamic_function_interface/dfi_log_util.h | 50 ++ .../dynamic_function_interface/dyn_function.c | 185 + .../dynamic_function_interface/dyn_function.h | 30 + .../dynamic_function_interface/dyn_type.c | 822 +++ .../dynamic_function_interface/dyn_type.h | 137 .../json_serializer.c | 151 .../json_serializer.h | 12 + .../schemas/complex.avdl| 11 + .../schemas/complex.avpr| 36 + .../schemas/simple.avdl | 6 + .../schemas/simple.avpr | 33 + .../schemas/simple_min.avpr | 1 + .../tst/avro_descriptor_translator_tests.cpp| 67 ++ .../tst/dyn_closure_tests.cpp | 139 .../tst/dyn_function_tests.cpp | 109 +++ .../tst/dyn_type_tests.cpp | 183 + .../tst/json_serializer_tests.cpp | 182 .../tst/run_tests.cpp | 9 + 32 files changed, 2526 insertions(+), 1351 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/bdeba2bc/remote_services/CMakeLists.txt -- diff --git a/remote_services/CMakeLists.txt b/remote_services/CMakeLists.txt index 9f56b58..b7dc13c 100644 --- a/remote_services/CMakeLists.txt +++ b/remote_services/CMakeLists.txt @@ -42,7 +42,7 @@ if (REMOTE_SERVICE_ADMIN) add_subdirectory(discovery_etcd) #add_subdirectory(discovery_shm) -add_subdirectory(dyn_type) +add_subdirectory(dynamic_function_interface) endif (REMOTE_SERVICE_ADMIN) http://git-wip-us.apache.org/repos/asf/celix/blob/bdeba2bc/remote_services/dyn_type/CMakeLists.txt -- diff --git a/remote_services/dyn_type/CMakeLists.txt b/remote_services/dyn_type/CMakeLists.txt deleted file mode 100644 index 351bb7c..000 --- a/remote_services/dyn_type/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -find_package(Jansson REQUIRED) - -add_executable(struct_tests -struct_tests.c -dyn_type.c -json_serializer.c -) - -add_executable(func_tests -func_tests.c -dyn_type.c -dyn_function.c -) - -add_executable(closure_tests -closure_tests.c -dyn_type.c -dyn_function.c -) - -target_link_libraries(struct_tests ${JANSSON_LIBRARIES} /lib64/libffi.so ) -target_link_libraries(func_tests ${JANSSON_LIBRARIES} /lib64/libffi.so ) -target_link_libraries(closure_tests ${JANSSON_LIBRARIES} /lib64/libffi.so ) http://git-wip-us.apache.org/repos/asf/celix/blob/bdeba2bc/remote_services/dyn_type/closure_tests.c -- diff --git a/remote_services/dyn_type/closure_tests.c b/remote_services/dyn_type/closure_tests.c deleted file mode 100644 index 39e4ca5..000 --- a/remote_services/dyn_type/closure_tests.c +++ /dev/null @@ -1,98 +0,0 @@ -#include stdio.h -#include stdint.h -#include stdlib.h -#include string.h -#include ctype.h - -#include dyn_function.h - -#define EXAMPLE1_SCHEMA example(III)I -void example1_binding(void *userData, void* args[], void *out) { -printf(example1 closure called\n); -int32_t a = *((int32_t *)args[0]); -int32_t b =
[1/2] celix git commit: CELIX-237: refactoring to dynamic_function_interface. dyn_type now uses mem stream and avro descriptor translator added
Repository: celix Updated Branches: refs/heads/feature/CELIX-237_rsa-ffi 7f3383247 - bdeba2bcb http://git-wip-us.apache.org/repos/asf/celix/blob/bdeba2bc/remote_services/dynamic_function_interface/dyn_type.c -- diff --git a/remote_services/dynamic_function_interface/dyn_type.c b/remote_services/dynamic_function_interface/dyn_type.c new file mode 100644 index 000..5ad18f4 --- /dev/null +++ b/remote_services/dynamic_function_interface/dyn_type.c @@ -0,0 +1,822 @@ +/** + * Licensed under Apache License v2. See LICENSE for more information. + */ +#include dyn_type.h + +#include stdlib.h +#include string.h +#include stdio.h +#include stddef.h +#include stdint.h +#include string.h +#include ctype.h +#include assert.h +#include errno.h + +static int dynType_createWithStream(FILE *stream, dyn_type *parent, dyn_type **type); +static void dynType_clear(dyn_type *type); +static void dynType_clearComplex(dyn_type *type); +static void dynType_clearSequence(dyn_type *type); +static void dynType_clearTypedPointer(dyn_type *type); + +static ffi_type * dynType_ffiTypeFor(int c); +static dyn_type * dynType_findType(dyn_type *type, char *name); +static int dynType_parse(FILE *stream, dyn_type *type); +static int dynType_parseComplex(FILE *stream, dyn_type *type); +static int dynType_parseName(FILE *stream, char **name); +static int dynType_parseNestedType(FILE *stream, dyn_type *type); +static int dynType_parseReference(FILE *stream, dyn_type *type); +static int dynType_parseRefByValue(FILE *stream, dyn_type *type); +static int dynType_parseSequence(FILE *stream, dyn_type *type); +static int dynType_parseSimple(int c, dyn_type *type); +static int dynType_parseTypedPointer(FILE *stream, dyn_type *type); +static void dynType_prepCif(ffi_type *type); +static unsigned short dynType_getOffset(dyn_type *type, int index); + +static void dynType_printAny(char *name, dyn_type *type, int depth); +static void dynType_printComplex(char *name, dyn_type *type, int depth); +static void dynType_printSequence(char *name, dyn_type *type, int depth); +static void dynType_printSimple(char *name, dyn_type *type, int depth); +static void dynType_printTypedPointer(char *name, dyn_type *type, int depth); +static void printDepth(int depth); + +static void dynType_printTypes(dyn_type *type); +static void dynType_printComplexType(dyn_type *type); +static void dynType_printSimpleType(dyn_type *type); + +struct generic_sequence { +uint32_t cap; +uint32_t len; +void *buf; +}; + +static const int DT_OK = 0; +static const int DT_ERROR = 1; +static const int DT_MEM_ERROR = 2; +static const int DT_PARSE_ERROR = 3; + +#define DT_LOG_ERROR1 +#define DT_LOG_WARNING 2 +#define DT_LOG_INFO 3 +#define DT_LOG_DEBUG4 +#define DT_LOG(lvl, msg, ...) if(g_logf != NULL) { \ +g_logf(g_logHandle, (lvl), __FILE__, __LINE__, (msg), ##__VA_ARGS__); \ +} + +static void (*g_logf)(void *handle, int level, const char *file, int line, const char *msgFormat, ...) = NULL; +static void *g_logHandle = NULL; + +void dynType_setupLogger(void (*logf)(void *handle, int level, const char *file, int line, const char *msgFormat, ...), void *handle) { +g_logHandle = handle; +g_logf = logf; +} + +int dynType_create(const char *descriptor, dyn_type **type) { +int status = DT_OK; +FILE *stream = fmemopen((char *)descriptor, strlen(descriptor), r); +if (stream != NULL) { +status = dynType_createWithStream(stream, NULL, type); +if (status == DT_OK) { +int c = fgetc(stream); +if (c != '\0' c != EOF) { +status = DT_PARSE_ERROR; +DT_LOG(DT_LOG_ERROR, Expected EOF got %c, c); +} +} +fclose(stream); +} else { +status = DT_ERROR; +DT_LOG(DT_LOG_ERROR, Error creating mem stream for descriptor string. %s, strerror(errno)); +} +return status; +} + +static int dynType_createWithStream(FILE *stream, dyn_type *parent, dyn_type **result) { +int status = DT_OK; +dyn_type *type = calloc(1, sizeof(*type)); +if (type != NULL) { +type-parent = parent; +type-type = DYN_TYPE_INVALID; +TAILQ_INIT(type-nestedTypesHead); +status = dynType_parse(stream, type); +if (status == DT_OK) { +*result = type; +} else { +dynType_destroy(type); +} +} else { +status = DT_MEM_ERROR; +DT_LOG(DT_LOG_ERROR, Error allocating memory for type); +} +return status; +} + +static int dynType_parse(FILE *stream, dyn_type *type) { +int status = DT_OK; + +int c = fgetc(stream); +switch(c) { +case 'T' : +status = dynType_parseNestedType(stream, type); +if (status == DT_OK) { +status = dynType_parse(stream, type); +} +break; +case 'L' : +status =
celix git commit: CELIX-237: Changed jansson build from ./configure and make to cmake
Repository: celix Updated Branches: refs/heads/feature/CELIX-237_rsa-ffi 5f62e97e6 - 6eaf4f4e8 CELIX-237: Changed jansson build from ./configure and make to cmake Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/6eaf4f4e Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/6eaf4f4e Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/6eaf4f4e Branch: refs/heads/feature/CELIX-237_rsa-ffi Commit: 6eaf4f4e804c91ea745864cd2b27d1e4eb03ea6e Parents: 5f62e97 Author: Pepijn Noltes pepijnnol...@gmail.com Authored: Sat Jul 4 17:02:40 2015 +0200 Committer: Pepijn Noltes pepijnnol...@gmail.com Committed: Sat Jul 4 17:02:40 2015 +0200 -- .travis.yml | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/6eaf4f4e/.travis.yml -- diff --git a/.travis.yml b/.travis.yml index f4e93f9..f3c5113 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,14 +11,13 @@ matrix: before_script: - git clone https://github.com/cpputest/cpputest.git cpputest-build -- mkdir -p cpputest-build/build -- cd cpputest-build/build -- cmake .. make +- cd cpputest-build +- cmake . make - sudo make install -- cd ../.. +- cd .. - git clone https://github.com/akheron/jansson.git jansson-build - cd jansson-build -- ./configure make +- cmake . make - sudo make install - cd .. - mkdir build install
celix git commit: CELIX-237: added FindFFI.cmake file and updated cmake file accordingly
Repository: celix Updated Branches: refs/heads/feature/CELIX-237_rsa-ffi 6eaf4f4e8 - 5b20ddb02 CELIX-237: added FindFFI.cmake file and updated cmake file accordingly Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/5b20ddb0 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/5b20ddb0 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/5b20ddb0 Branch: refs/heads/feature/CELIX-237_rsa-ffi Commit: 5b20ddb020f151d0f6721e765671aa22d54f4af3 Parents: 6eaf4f4 Author: Pepijn Noltes pepijnnol...@gmail.com Authored: Sat Jul 4 17:24:18 2015 +0200 Committer: Pepijn Noltes pepijnnol...@gmail.com Committed: Sat Jul 4 17:24:18 2015 +0200 -- .travis.yml | 2 +- cmake/FindFFI.cmake | 45 .../dynamic_function_interface/CMakeLists.txt | 12 ++ .../CMakeLists.txt | 10 ++--- 4 files changed, 53 insertions(+), 16 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/5b20ddb0/.travis.yml -- diff --git a/.travis.yml b/.travis.yml index f3c5113..707b712 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: c before_install: - sudo apt-get update -qq - - sudo apt-get install -y uuid-dev libjansson-dev libxml2-dev libffi-dev lcov + - sudo apt-get install -y uuid-dev libxml2-dev libffi-dev lcov matrix: include: http://git-wip-us.apache.org/repos/asf/celix/blob/5b20ddb0/cmake/FindFFI.cmake -- diff --git a/cmake/FindFFI.cmake b/cmake/FindFFI.cmake new file mode 100644 index 000..9ee947c --- /dev/null +++ b/cmake/FindFFI.cmake @@ -0,0 +1,45 @@ + +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# License); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +# - Try to find libffi define the variables for the binaries/headers and include +# +# Once done this will define +# FFI_FOUND - System has libffi +# FFI_INCLUDE_DIRS - The package include directories +# FFI_LIBRARIES - The libraries needed to use this package + +find_path(FFI_INCLUDE_DIR ffi.h + PATHS $ENV{FFI_DIR} ${FFI_DIR} /usr /usr/local /opt/local + PATH_SUFFIXES include include/ffi) + +find_library(FFI_LIBRARY NAMES ffi + PATHS $ENV{FFI_DIR} ${FFI_DIR} /usr /usr/local /opt/local + PATH_SUFFIXES lib lib64) + + +include(FindPackageHandleStandardArgs) +# handle the QUIETLY and REQUIRED arguments and set FFI_FOUND to TRUE +# if all listed variables are TRUE +find_package_handle_standard_args(FFI DEFAULT_MSG + FFI_LIBRARY FFI_INCLUDE_DIR) +mark_as_advanced(FFI_INCLUDE_DIR FFI_LIBRARY) + +if(FFI_FOUND) + set(FFI_LIBRARIES ${FFI_LIBRARY}) + set(FFI_INCLUDE_DIRS ${FFI_INCLUDE_DIR}) +endif() http://git-wip-us.apache.org/repos/asf/celix/blob/5b20ddb0/remote_services/dynamic_function_interface/CMakeLists.txt -- diff --git a/remote_services/dynamic_function_interface/CMakeLists.txt b/remote_services/dynamic_function_interface/CMakeLists.txt index 7825e07..f1a8890 100644 --- a/remote_services/dynamic_function_interface/CMakeLists.txt +++ b/remote_services/dynamic_function_interface/CMakeLists.txt @@ -3,17 +3,13 @@ # find_package(Jansson REQUIRED) find_package(CppUTest REQUIRED) - -#set(FFI_LIB /lib64/libffi.so) #TODO add findPackag for lib ffi -#set(FFI_LIB /opt/local/lib/libffi.dylib) -#set(FFI_INCLUDE /opt/local/lib/libffi-3.2.1/include) -set(FFI_LIB /lib/libffi.so) +find_package(FFI REQUIRED) include_directories( ${CPPUTEST_INCLUDE_DIR} ${JANSSON_INCLUDE_DIRS} ${CMAKE_CURRENT_LIST_DIR} -${FFI_INCLUDE} +${FFI_INCLUDE_DIRS} memstream ) @@ -29,7 +25,7 @@ add_library(dfi avro_descriptor_translator.c ${MEMSTREAM_SOURCES} ) -target_link_libraries(dfi ${FFI_LIB} ${JANSSON_LIBRARY}) +target_link_libraries(dfi ${FFI_LIBRARIES} ${JANSSON_LIBRARY}) #if (FRAMEWORK_TESTS) @@ -41,7 +37,7 @@ target_link_libraries(dfi ${FFI_LIB}
celix git commit: CELIX-237: updated CMakeLists. for include dirs (janson/libffi) and libs (libffi)
Repository: celix Updated Branches: refs/heads/feature/CELIX-237_rsa-ffi 4f7c48000 - c4f2daf5a CELIX-237: updated CMakeLists. for include dirs (janson/libffi) and libs (libffi) Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/c4f2daf5 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/c4f2daf5 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/c4f2daf5 Branch: refs/heads/feature/CELIX-237_rsa-ffi Commit: c4f2daf5a53789618bf7e84183d13388eff2892b Parents: 4f7c480 Author: Pepijn Noltes pepijnnol...@gmail.com Authored: Sat Jul 4 16:20:16 2015 +0200 Committer: Pepijn Noltes pepijnnol...@gmail.com Committed: Sat Jul 4 16:20:16 2015 +0200 -- .../CMakeLists.txt | 60 +++- 1 file changed, 33 insertions(+), 27 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/c4f2daf5/remote_services/remote_service_admin_http_ffi/CMakeLists.txt -- diff --git a/remote_services/remote_service_admin_http_ffi/CMakeLists.txt b/remote_services/remote_service_admin_http_ffi/CMakeLists.txt index ea94b16..1b9b823 100644 --- a/remote_services/remote_service_admin_http_ffi/CMakeLists.txt +++ b/remote_services/remote_service_admin_http_ffi/CMakeLists.txt @@ -16,34 +16,40 @@ # under the License. celix_subproject(RSA_REMOTE_SERVICE_ADMIN_HTTP Option to enable building the Remote Service Admin Service HTTP ffi OFF) if (RSA_REMOTE_SERVICE_ADMIN_HTTP) - find_package(CURL REQUIRED) - find_package(Jansson REQUIRED) - - include_directories(${CURL_INCLUDE_DIRS}) - include_directories(${Jansson}) - include_directories(${PROJECT_SOURCE_DIR}/utils/public/include) - include_directories(${PROJECT_SOURCE_DIR}/log_service/public/include) - include_directories(${PROJECT_SOURCE_DIR}/remote_services/utils/private/include) - include_directories(${PROJECT_SOURCE_DIR}/remote_services/utils/public/include) - include_directories(${PROJECT_SOURCE_DIR}/remote_services/remote_service_admin/public/include) - include_directories(${PROJECT_SOURCE_DIR}/remote_services/remote_service_admin/private/include) - include_directories(${PROJECT_SOURCE_DIR}/remote_services/remote_service_admin_http/private/include) - include_directories(${PROJECT_SOURCE_DIR}/remote_services/endpoint_listener/public/include) - - SET_HEADER(BUNDLE_SYMBOLICNAME apache_celix_remote_service_admin_http_ffi) - SET(BUNDLE_VERSION 0.0.1) - SET_HEADERS(Bundle-Name: Apache Celix Remote Service Admin HTTP for ffi) - - bundle(remote_service_admin_http SOURCES - private/src/remote_service_admin_impl - private/src/remote_service_admin_activator - ${PROJECT_SOURCE_DIR}/remote_services/remote_service_admin/private/src/export_registration_impl - ${PROJECT_SOURCE_DIR}/remote_services/remote_service_admin/private/src/import_registration_impl - ${PROJECT_SOURCE_DIR}/remote_services/utils/private/src/civetweb.c - ${PROJECT_SOURCE_DIR}/log_service/public/src/log_helper.c - ) +find_package(CURL REQUIRED) +find_package(Jansson REQUIRED) + +#TODO add findPackage for libffi +#set(FFI_INCLUDE /opt/local/lib/libffi-3.2.1/include) +#set(FFI_LIB /opt/local/lib/libffi.dylib) +set(FFI_LIB /lib/libffi.so) + +include_directories(${FFI_INCLUDE}) +include_directories(${CURL_INCLUDE_DIRS}) +include_directories(${JANSSON_INCLUDE_DIRS}) +include_directories(${PROJECT_SOURCE_DIR}/utils/public/include) +include_directories(${PROJECT_SOURCE_DIR}/log_service/public/include) + include_directories(${PROJECT_SOURCE_DIR}/remote_services/utils/private/include) + include_directories(${PROJECT_SOURCE_DIR}/remote_services/utils/public/include) + include_directories(${PROJECT_SOURCE_DIR}/remote_services/remote_service_admin/public/include) + include_directories(${PROJECT_SOURCE_DIR}/remote_services/remote_service_admin/private/include) + include_directories(${PROJECT_SOURCE_DIR}/remote_services/remote_service_admin_http/private/include) + include_directories(${PROJECT_SOURCE_DIR}/remote_services/endpoint_listener/public/include) + +SET_HEADER(BUNDLE_SYMBOLICNAME apache_celix_remote_service_admin_http_ffi) +SET(BUNDLE_VERSION 0.0.1) +SET_HEADERS(Bundle-Name: Apache Celix Remote Service Admin HTTP for ffi) + +bundle(remote_service_admin_http SOURCES +private/src/remote_service_admin_impl +private/src/remote_service_admin_activator + ${PROJECT_SOURCE_DIR}/remote_services/remote_service_admin/private/src/export_registration_impl + ${PROJECT_SOURCE_DIR}/remote_services/remote_service_admin/private/src/import_registration_impl +
celix git commit: CELIX-237: updated FindFFI added hints for unbuntu's ffi directory layout
Repository: celix Updated Branches: refs/heads/feature/CELIX-237_rsa-ffi 5b20ddb02 - 951d66106 CELIX-237: updated FindFFI added hints for unbuntu's ffi directory layout Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/951d6610 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/951d6610 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/951d6610 Branch: refs/heads/feature/CELIX-237_rsa-ffi Commit: 951d66106084e44c0a9870c1708fefa3dcca3c44 Parents: 5b20ddb Author: Pepijn Noltes pepijnnol...@gmail.com Authored: Sat Jul 4 17:41:27 2015 +0200 Committer: Pepijn Noltes pepijnnol...@gmail.com Committed: Sat Jul 4 17:41:27 2015 +0200 -- cmake/FindFFI.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/951d6610/cmake/FindFFI.cmake -- diff --git a/cmake/FindFFI.cmake b/cmake/FindFFI.cmake index 9ee947c..cc6c8c8 100644 --- a/cmake/FindFFI.cmake +++ b/cmake/FindFFI.cmake @@ -24,12 +24,12 @@ # FFI_LIBRARIES - The libraries needed to use this package find_path(FFI_INCLUDE_DIR ffi.h - PATHS $ENV{FFI_DIR} ${FFI_DIR} /usr /usr/local /opt/local - PATH_SUFFIXES include include/ffi) + PATHS $ENV{FFI_DIR} ${FFI_DIR} /usr /usr/local /opt/local +PATH_SUFFIXES include include/ffi include/x86_64-linux-gnu) find_library(FFI_LIBRARY NAMES ffi PATHS $ENV{FFI_DIR} ${FFI_DIR} /usr /usr/local /opt/local - PATH_SUFFIXES lib lib64) + PATH_SUFFIXES lib lib64 lib/x86_64-linux-gnu) include(FindPackageHandleStandardArgs)
celix git commit: CELIX-237: Disabled coverage for now.
Repository: celix Updated Branches: refs/heads/feature/CELIX-237_rsa-ffi dbdda15ed - c97d16746 CELIX-237: Disabled coverage for now. Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/c97d1674 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/c97d1674 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/c97d1674 Branch: refs/heads/feature/CELIX-237_rsa-ffi Commit: c97d1674608fde718e2c5cb8fe291a86a950560d Parents: dbdda15 Author: Pepijn Noltes pepijnnol...@gmail.com Authored: Sat Jul 4 18:36:31 2015 +0200 Committer: Pepijn Noltes pepijnnol...@gmail.com Committed: Sat Jul 4 18:36:31 2015 +0200 -- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/c97d1674/.travis.yml -- diff --git a/.travis.yml b/.travis.yml index 26e664d..2c8d7cd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,7 @@ before_script: - cd .. - mkdir build install - cd build -- cmake -DCMAKE_SKIP_BUILD_RPATH=FALSE -DENABLE_CODE_COVERAGE=ON -DBUILD_DEPLOYMENT_ADMIN=ON -DBUILD_EXAMPLES=ON -DBUILD_LOG_SERVICE=ON -DBUILD_LOG_WRITER=ON -DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON -DBUILD_RSA_DISCOVERY_SHM=ON -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_SHM=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_SHELL=ON -DBUILD_SHELL_TUI=ON -DCMAKE_INSTALL_PREFIX=../install .. +- cmake -DCMAKE_SKIP_BUILD_RPATH=FALSE -DBUILD_DEPLOYMENT_ADMIN=ON -DBUILD_EXAMPLES=ON -DBUILD_LOG_SERVICE=ON -DBUILD_LOG_WRITER=ON -DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON -DBUILD_RSA_DISCOVERY_SHM=ON -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_SHM=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_SHELL=ON -DBUILD_SHELL_TUI=ON -DCMAKE_INSTALL_PREFIX=../install .. script: -- make all make deploy make coverage make install-all +- make all make deploy make test make install-all
celix git commit: CELIX-237: change struct assigment in ccputest.
Repository: celix Updated Branches: refs/heads/feature/CELIX-237_rsa-ffi 36bd57740 - 04c384714 CELIX-237: change struct assigment in ccputest. Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/04c38471 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/04c38471 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/04c38471 Branch: refs/heads/feature/CELIX-237_rsa-ffi Commit: 04c384714c628a64a0cebe9075b63fd285297b7e Parents: 36bd577 Author: Pepijn Noltes pepijnnol...@gmail.com Authored: Sat Jul 4 18:18:13 2015 +0200 Committer: Pepijn Noltes pepijnnol...@gmail.com Committed: Sat Jul 4 18:18:13 2015 +0200 -- .../dynamic_function_interface/tst/dyn_closure_tests.cpp| 5 - 1 file changed, 4 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/04c38471/remote_services/dynamic_function_interface/tst/dyn_closure_tests.cpp -- diff --git a/remote_services/dynamic_function_interface/tst/dyn_closure_tests.cpp b/remote_services/dynamic_function_interface/tst/dyn_closure_tests.cpp index 30b0b65..c3ea1de 100644 --- a/remote_services/dynamic_function_interface/tst/dyn_closure_tests.cpp +++ b/remote_services/dynamic_function_interface/tst/dyn_closure_tests.cpp @@ -100,7 +100,10 @@ static void tests() { double (*func)(int32_t a, struct example2_arg2 b, int32_t c) = NULL; rc = dynClosure_getFnPointer(dynClosure, (void(**)(void))func); CHECK_EQUAL(0, rc); -struct example2_arg2 b = { .val1 = 1.0, .val2 = 1.5, .val3 = 2.0 }; +struct example2_arg2 b; +b.val1 = 1.0; +b.val2 = 1.5; +b.val3 = 2.0; double ret = func(2,b,4); printf(Return value for example2 is %f\n, ret); CHECK_EQUAL(2, g_count);
celix git commit: CELIX-237: Update to travix.yml. trying to clone and build cpputest, because cpputest in not avialable for ubuntu precision
Repository: celix Updated Branches: refs/heads/feature/CELIX-237_rsa-ffi 8aec1e4ed - d3b6a236c CELIX-237: Update to travix.yml. trying to clone and build cpputest, because cpputest in not avialable for ubuntu precision Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/d3b6a236 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/d3b6a236 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/d3b6a236 Branch: refs/heads/feature/CELIX-237_rsa-ffi Commit: d3b6a236c98aa12eee046b1346701cc475798198 Parents: 8aec1e4 Author: Pepijn Noltes pepijnnol...@gmail.com Authored: Sat Jul 4 15:39:46 2015 +0200 Committer: Pepijn Noltes pepijnnol...@gmail.com Committed: Sat Jul 4 15:39:46 2015 +0200 -- .travis.yml | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/d3b6a236/.travis.yml -- diff --git a/.travis.yml b/.travis.yml index 0b43241..f148014 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,9 +10,14 @@ matrix: - compiler: clang before_script: +- git clone https://github.com/cpputest/cpputest.git cpputest-build +- cd cpputest-build +- ./configure make +- sudo make install +- cd .. - mkdir build install - cd build -- cmake -DBUILD_DEPLOYMENT_ADMIN=ON -DBUILD_EXAMPLES=ON -DBUILD_LOG_SERVICE=ON -DBUILD_LOG_WRITER=ON -DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON -DBUILD_RSA_DISCOVERY_SHM=ON -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_SHM=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_SHELL=ON -DBUILD_SHELL_TUI=ON -DCMAKE_INSTALL_PREFIX=../install .. +- cmake -DENABLE_CODE_COVERAGE=ON -DBUILD_DEPLOYMENT_ADMIN=ON -DBUILD_EXAMPLES=ON -DBUILD_LOG_SERVICE=ON -DBUILD_LOG_WRITER=ON -DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON -DBUILD_RSA_DISCOVERY_SHM=ON -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_SHM=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_SHELL=ON -DBUILD_SHELL_TUI=ON -DCMAKE_INSTALL_PREFIX=../install .. script: -- make all make deploy make install +- make all make deploy make coverage make install-all
celix git commit: CELIX-237: Update travis config and libffi location
Repository: celix Updated Branches: refs/heads/feature/CELIX-237_rsa-ffi 549997b88 - 8aec1e4ed CELIX-237: Update travis config and libffi location Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/8aec1e4e Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/8aec1e4e Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/8aec1e4e Branch: refs/heads/feature/CELIX-237_rsa-ffi Commit: 8aec1e4ed2bb7685b315d8ff8f2df86b6f6d1208 Parents: 549997b Author: Pepijn Noltes pepijnnol...@gmail.com Authored: Sat Jul 4 13:43:58 2015 +0200 Committer: Pepijn Noltes pepijnnol...@gmail.com Committed: Sat Jul 4 13:43:58 2015 +0200 -- .travis.yml | 2 +- remote_services/dynamic_function_interface/CMakeLists.txt | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/8aec1e4e/.travis.yml -- diff --git a/.travis.yml b/.travis.yml index d66498f..0b43241 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: c before_install: - sudo apt-get update -qq - - sudo apt-get install -y uuid-dev libjansson-dev libxml2-dev + - sudo apt-get install -y uuid-dev libjansson-dev libxml2-dev cpputest libffi-dev matrix: include: http://git-wip-us.apache.org/repos/asf/celix/blob/8aec1e4e/remote_services/dynamic_function_interface/CMakeLists.txt -- diff --git a/remote_services/dynamic_function_interface/CMakeLists.txt b/remote_services/dynamic_function_interface/CMakeLists.txt index bf3a628..7825e07 100644 --- a/remote_services/dynamic_function_interface/CMakeLists.txt +++ b/remote_services/dynamic_function_interface/CMakeLists.txt @@ -5,8 +5,9 @@ find_package(Jansson REQUIRED) find_package(CppUTest REQUIRED) #set(FFI_LIB /lib64/libffi.so) #TODO add findPackag for lib ffi -set(FFI_LIB /opt/local/lib/libffi.dylib) -set(FFI_INCLUDE /opt/local/lib/libffi-3.2.1/include) +#set(FFI_LIB /opt/local/lib/libffi.dylib) +#set(FFI_INCLUDE /opt/local/lib/libffi-3.2.1/include) +set(FFI_LIB /lib/libffi.so) include_directories( ${CPPUTEST_INCLUDE_DIR}
[08/16] celix git commit: CELIX-240: copy export_registrations to dedicated list to prevent deadlock during shutdown
CELIX-240: copy export_registrations to dedicated list to prevent deadlock during shutdown Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/cabd41a7 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/cabd41a7 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/cabd41a7 Branch: refs/heads/feature/CELIX-237_rsa-ffi Commit: cabd41a75321afb27b20664250a5fc6cccf9dec6 Parents: bdf8e06 Author: Bjoern Petri bpe...@apache.org Authored: Sat Jun 20 16:03:14 2015 +0200 Committer: Bjoern Petri bpe...@apache.org Committed: Sat Jun 20 16:03:14 2015 +0200 -- .../private/src/remote_service_admin_activator.c| 3 ++- .../private/src/remote_service_admin_impl.c | 16 +++- 2 files changed, 17 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/cabd41a7/remote_services/remote_service_admin_http/private/src/remote_service_admin_activator.c -- diff --git a/remote_services/remote_service_admin_http/private/src/remote_service_admin_activator.c b/remote_services/remote_service_admin_http/private/src/remote_service_admin_activator.c index e4125fc..1b4c59c 100644 --- a/remote_services/remote_service_admin_http/private/src/remote_service_admin_activator.c +++ b/remote_services/remote_service_admin_http/private/src/remote_service_admin_activator.c @@ -99,10 +99,11 @@ celix_status_t bundleActivator_stop(void * userData, bundle_context_pt context) celix_status_t status = CELIX_SUCCESS; struct activator *activator = userData; -remoteServiceAdmin_stop(activator-admin); serviceRegistration_unregister(activator-registration); activator-registration = NULL; +remoteServiceAdmin_stop(activator-admin); + remoteServiceAdmin_destroy(activator-admin); free(activator-adminService); http://git-wip-us.apache.org/repos/asf/celix/blob/cabd41a7/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c -- diff --git a/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c b/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c index 63e5192..319c849 100644 --- a/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c +++ b/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c @@ -207,18 +207,32 @@ celix_status_t remoteServiceAdmin_stop(remote_service_admin_pt admin) { celixThreadMutex_lock(admin-exportedServicesLock); +array_list_pt exportRegistrationList = NULL; + +arrayList_create(exportRegistrationList); + hash_map_iterator_pt iter = hashMapIterator_create(admin-exportedServices); while (hashMapIterator_hasNext(iter)) { array_list_pt exports = hashMapIterator_nextValue(iter); int i; + for (i = 0; i arrayList_size(exports); i++) { export_registration_pt export = arrayList_get(exports, i); - exportRegistration_stopTracking(export); + arrayList_add(exportRegistrationList, export); } } hashMapIterator_destroy(iter); celixThreadMutex_unlock(admin-exportedServicesLock); + int i; + + for (i = 0; i arrayList_size(exportRegistrationList); i++) { + export_registration_pt export = arrayList_get(exportRegistrationList, i); + exportRegistration_stopTracking(export); + } + + arrayList_destroy(exportRegistrationList); + celixThreadMutex_lock(admin-importedServicesLock); iter = hashMapIterator_create(admin-importedServices);
[14/16] celix git commit: CELIX-246: Add travis config, update readme
CELIX-246: Add travis config, update readme Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/3b36eb2f Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/3b36eb2f Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/3b36eb2f Branch: refs/heads/feature/CELIX-237_rsa-ffi Commit: 3b36eb2f87778852542c7e192025144027b66db6 Parents: 3de9caf Author: Bjoern Petri bpe...@apache.org Authored: Thu Jul 2 21:53:21 2015 +0200 Committer: Bjoern Petri bpe...@apache.org Committed: Thu Jul 2 21:53:21 2015 +0200 -- .travis.yml | 18 ++ README.md | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/3b36eb2f/.travis.yml -- diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000..d66498f --- /dev/null +++ b/.travis.yml @@ -0,0 +1,18 @@ +language: c + +before_install: + - sudo apt-get update -qq + - sudo apt-get install -y uuid-dev libjansson-dev libxml2-dev + +matrix: + include: +- compiler: gcc +- compiler: clang + +before_script: +- mkdir build install +- cd build +- cmake -DBUILD_DEPLOYMENT_ADMIN=ON -DBUILD_EXAMPLES=ON -DBUILD_LOG_SERVICE=ON -DBUILD_LOG_WRITER=ON -DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON -DBUILD_RSA_DISCOVERY_SHM=ON -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_SHM=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_SHELL=ON -DBUILD_SHELL_TUI=ON -DCMAKE_INSTALL_PREFIX=../install .. + +script: +- make all make deploy make install http://git-wip-us.apache.org/repos/asf/celix/blob/3b36eb2f/README.md -- diff --git a/README.md b/README.md index e187ebb..473418a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -#Apache Celix +#Apache Celix [![Build Status](https://travis-ci.org/apache/celix.svg?branch=develop)](https://travis-ci.org/apache/celix) Apache Celix is an implementation of the OSGi specification adapted to C. It will follow the API as close as possible, but since the OSGi specification is written primarily for Java, there will be differences (Java is OO, C is procedural). An important aspect of the implementation is interoperability between Java and C. This interoperability is achieved by porting and implementing the Remote Services specification in Celix. ##Building
[16/16] celix git commit: CELIX-237
CELIX-237 Merge remote-tracking branch 'remotes/origin/develop' into dfi Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/549997b8 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/549997b8 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/549997b8 Branch: refs/heads/feature/CELIX-237_rsa-ffi Commit: 549997b88f99b1b4bbfd44be3c4841bb3296e034 Parents: fd7662c 3b36eb2 Author: Pepijn Noltes pepijnnol...@gmail.com Authored: Sat Jul 4 13:25:31 2015 +0200 Committer: Pepijn Noltes pepijnnol...@gmail.com Committed: Sat Jul 4 13:25:31 2015 +0200 -- .travis.yml |18 + README.md | 2 +- .../private/src/deployment_package.c| 1 + .../device_access/private/src/device_manager.c | 1 + .../private/src/driver_attributes.c | 1 + .../device_access/private/src/driver_loader.c | 1 + framework/private/include/framework_private.h | 4 +- framework/private/src/framework.c |97 +- .../private/src/log_writer_syslog.c | 2 - .../discovery/private/src/discovery.c | 1 + .../discovery/private/src/discovery_activator.c | 186 +- .../private/src/endpoint_discovery_server.c | 1 + .../discovery_etcd/private/src/etcd_watcher.c | 1 + .../discovery_shm/private/src/shm_watcher.c | 1 + .../private/src/calculator_endpoint_activator.c | 8 +- .../private/src/calculator_proxy_activator.c|12 +- .../private/src/calculator_activator.c |12 +- .../public/include/calculator_service.h | 2 + .../calculator_shell/private/src/sqrt_command.c | 1 + .../calculator_shell/private/src/sub_command.c | 1 + .../private/src/import_registration_impl.c | 1 + .../private/src/remote_proxy_factory_impl.c | 1 + .../src/remote_service_admin_activator.c| 3 +- .../private/src/remote_service_admin_impl.c |16 +- .../private/src/remote_service_admin_impl.c | 1 + .../private/include/topology_manager.h | 5 + .../topology_manager/private/src/activator.c| 296 +- .../private/src/topology_manager.c | 920 +- .../utils/private/include/civetweb.h| 538 +- remote_services/utils/private/src/civetweb.c| 14923 ++--- remote_shell/private/src/activator.c| 2 +- remote_shell/private/src/connection_listener.c | 1 + remote_shell/private/src/remote_shell.c | 3 +- remote_shell/private/src/shell_mediator.c | 3 +- 34 files changed, 9858 insertions(+), 7208 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/549997b8/remote_services/examples/calculator_service/private/src/calculator_activator.c -- diff --cc remote_services/examples/calculator_service/private/src/calculator_activator.c index d280eaa,13ea995..a4dfa46 --- a/remote_services/examples/calculator_service/private/src/calculator_activator.c +++ b/remote_services/examples/calculator_service/private/src/calculator_activator.c @@@ -75,15 -75,14 +75,15 @@@ celix_status_t bundleActivator_start(vo properties = properties_create(); properties_set(properties, (char *) OSGI_RSA_SERVICE_EXPORTED_INTERFACES, (char *) CALCULATOR_SERVICE); + properties_set(properties, (char *) protocol.schema, (char *)CALC_SCHEMA); - bundleContext_registerService(context, (char *) CALCULATOR_SERVICE, activator-service, properties, activator-calculatorReg); + bundleContext_registerService(context, (char *) CALCULATOR_SERVICE, activator-service, properties, activator-calculatorReg); - properties_pt properties2 = properties_create(); - properties_set(properties2, (char *) OSGI_RSA_SERVICE_EXPORTED_INTERFACES, (char *) org.apache.celix.calc.api.Calculator2); - bundleContext_registerService(context, org.apache.celix.calc.api.Calculator2, activator-service, properties2, activator-calculatorReg2); - } - } + properties_pt properties2 = properties_create(); + properties_set(properties2, (char *) OSGI_RSA_SERVICE_EXPORTED_INTERFACES, (char *) CALCULATOR2_SERVICE); + bundleContext_registerService(context, CALCULATOR2_SERVICE, activator-service, properties2, activator-calculatorReg2); + } + } return status; } http://git-wip-us.apache.org/repos/asf/celix/blob/549997b8/remote_services/examples/calculator_service/public/include/calculator_service.h
[3/3] celix git commit: CELIX-237: commented out some printf statements
CELIX-237: commented out some printf statements Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/eb31d9d9 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/eb31d9d9 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/eb31d9d9 Branch: refs/heads/feature/CELIX-237_rsa-ffi Commit: eb31d9d97b455094babd7027e1d1fc4f27c060c7 Parents: ed3fbb4 Author: Pepijn Noltes pepijnnol...@gmail.com Authored: Tue Jul 7 21:27:31 2015 +0200 Committer: Pepijn Noltes pepijnnol...@gmail.com Committed: Tue Jul 7 21:27:31 2015 +0200 -- .../dynamic_function_interface/tst/dyn_type_tests.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/eb31d9d9/remote_services/dynamic_function_interface/tst/dyn_type_tests.cpp -- diff --git a/remote_services/dynamic_function_interface/tst/dyn_type_tests.cpp b/remote_services/dynamic_function_interface/tst/dyn_type_tests.cpp index 7ea9ea7..706e9af 100644 --- a/remote_services/dynamic_function_interface/tst/dyn_type_tests.cpp +++ b/remote_services/dynamic_function_interface/tst/dyn_type_tests.cpp @@ -23,14 +23,14 @@ extern C { dyn_type *type; int i; type = NULL; -printf(\n-- example %s with descriptor string '%s' --\n, exName, descriptorStr); +//printf(\n-- example %s with descriptor string '%s' --\n, exName, descriptorStr); int status = dynType_create(descriptorStr, type); CHECK_EQUAL(0, status); if (status == 0) { -dynType_print(type); +//dynType_print(type); dynType_destroy(type); } -printf(--\n\n); +//printf(--\n\n); } }
[4/5] celix git commit: CELIX-237: Refactoring of rsa_dfi layout (lib, lib-tst, rsa bundle, rsa tst)
CELIX-237: Refactoring of rsa_dfi layout (lib, lib-tst, rsa bundle, rsa tst) Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/a129b488 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/a129b488 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/a129b488 Branch: refs/heads/feature/CELIX-237_rsa-ffi Commit: a129b4884451d7347749faa43915dcc8452e14b8 Parents: 2522330 Author: Pepijn Noltes pepijnnol...@gmail.com Authored: Thu Aug 13 11:08:56 2015 +0200 Committer: Pepijn Noltes pepijnnol...@gmail.com Committed: Thu Aug 13 11:08:56 2015 +0200 -- remote_services/CMakeLists.txt | 1 - .../public/include/endpoint_listener.h | 48 -- .../public/include/endpoint_listener.h | 48 ++ .../public/include/remote_constants.h | 38 + .../remote_service_admin_dfi/CMakeLists.txt | 75 +- .../dynamic_function_interface/CMakeLists.txt | 37 +- .../avro_descriptor_translator.c| 319 .../descriptor_translator.h | 18 - .../descriptors/example1.descriptor | 13 - .../schemas/complex.avdl| 11 - .../schemas/complex.avpr| 36 - .../schemas/invalid1.avpr | 29 - .../schemas/invalid2.avpr | 31 - .../schemas/simple.avdl | 6 - .../schemas/simple.avpr | 33 - .../schemas/simple_min.avpr | 1 - .../tst/avro_descriptor_translator_tests.cpp| 164 .../tst/dyn_closure_tests.cpp | 146 .../tst/dyn_function_tests.cpp | 231 -- .../tst/dyn_interface_tests.cpp | 87 --- .../tst/dyn_type_tests.cpp | 190 - .../tst/json_serializer_tests.cpp | 398 -- .../tst/run_tests.cpp | 9 - .../CMakeLists.txt | 26 + .../avro_descriptor_translator_tests.cpp| 164 .../descriptors/example1.descriptor | 13 + .../dyn_closure_tests.cpp | 146 .../dyn_function_tests.cpp | 231 ++ .../dyn_interface_tests.cpp | 87 +++ .../dyn_type_tests.cpp | 190 + .../json_serializer_tests.cpp | 398 ++ .../run_tests.cpp | 9 + .../schemas/complex.avdl| 11 + .../schemas/complex.avpr| 36 + .../schemas/invalid1.avpr | 29 + .../schemas/invalid2.avpr | 31 + .../schemas/simple.avdl | 6 + .../schemas/simple.avpr | 33 + .../schemas/simple_min.avpr | 1 + .../private/include/export_registration_dfi.h | 21 - .../private/include/import_registration_dfi.h | 25 - .../include/remote_service_admin_http_impl.h| 73 -- .../private/src/export_registration_dfi.c | 239 -- .../private/src/import_registration_dfi.c | 318 .../src/remote_service_admin_activator.c| 122 --- .../private/src/remote_service_admin_dfi.c | 747 --- .../remote_service_admin_dfi/rsa/CMakeLists.txt | 45 ++ .../private/include/export_registration_dfi.h | 21 + .../private/include/import_registration_dfi.h | 25 + .../include/remote_service_admin_http_impl.h| 73 ++ .../rsa/private/src/export_registration_dfi.c | 239 ++ .../rsa/private/src/import_registration_dfi.c | 318 .../src/remote_service_admin_activator.c| 122 +++ .../rsa/private/src/remote_service_admin_dfi.c | 747 +++ .../rsa_tst/CMakeLists.txt | 47 ++ .../rsa_tst/bundle/CMakeLists.txt | 24 + .../rsa_tst/bundle/tst_activator.c | 137 .../rsa_tst/bundle/tst_service.h| 17 + .../rsa_tst/client.properties.in| 8 + .../rsa_tst/config.properties.in| 3 + .../rsa_tst/rsa_client_server_tests.cpp | 113 +++ .../rsa_tst/rsa_tests.cpp | 201 + .../rsa_tst/run_tests.cpp | 9 + .../rsa_tst/server.properties.in| 8 + .../remote_service_admin_dfi/tst/CMakeLists.txt | 47 -- .../tst/bundle/CMakeLists.txt | 25 - .../tst/bundle/tst_activator.c | 137 .../tst/bundle/tst_service.h| 17 - .../tst/client.properties.in| 8 - .../tst/config.properties.in| 3 - .../tst/rsa_client_server_tests.cpp | 113 --- .../remote_service_admin_dfi/tst/rsa_tests.cpp | 201 - .../remote_service_admin_dfi/tst/run_tests.cpp
[2/5] celix git commit: CELIX-237: Refactoring of rsa_dfi layout (lib, lib-tst, rsa bundle, rsa tst)
http://git-wip-us.apache.org/repos/asf/celix/blob/a129b488/remote_services/remote_service_admin_dfi/private/src/remote_service_admin_dfi.c -- diff --git a/remote_services/remote_service_admin_dfi/private/src/remote_service_admin_dfi.c b/remote_services/remote_service_admin_dfi/private/src/remote_service_admin_dfi.c deleted file mode 100644 index c78cc19..000 --- a/remote_services/remote_service_admin_dfi/private/src/remote_service_admin_dfi.c +++ /dev/null @@ -1,747 +0,0 @@ -/** - *Licensed to the Apache Software Foundation (ASF) under one - *or more contributor license agreements. See the NOTICE file - *distributed with this work for additional information - *regarding copyright ownership. The ASF licenses this file - *to you under the Apache License, Version 2.0 (the - *License); you may not use this file except in compliance - *with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - *Unless required by applicable law or agreed to in writing, - *software distributed under the License is distributed on an - *AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - *specific language governing permissions and limitations - *under the License. - */ -/* - * remote_service_admin_impl.c - * - * \date May 21, 2015 - * \authora href=mailto:d...@celix.apache.org;Apache Celix Project Team/a - * \copyright Apache License, Version 2.0 - */ -#include stdio.h -#include stdlib.h - -#include arpa/inet.h -#include netdb.h -#include ifaddrs.h -#include string.h -#include uuid/uuid.h -#include curl/curl.h - -#include jansson.h - -#include import_registration_dfi.h -#include export_registration_dfi.h -#include dyn_interface.h - -#include remote_service_admin.h -#include remote_constants.h -#include constants.h -#include civetweb.h - -// defines how often the webserver is restarted (with an increased port number) -#define MAX_NUMBER_OF_RESTARTS 5 - -struct remote_service_admin { -bundle_context_pt context; -log_helper_pt loghelper; - -celix_thread_mutex_t exportedServicesLock; -hash_map_pt exportedServices; - -celix_thread_mutex_t importedServicesLock; -hash_map_pt importedServices; - -char *port; -char *ip; - -struct mg_context *ctx; -}; - -struct post { -const char *readptr; -int size; -}; - -struct get { -char *writeptr; -int size; -}; - -#define OSGI_RSA_REMOTE_PROXY_FACTORY remote_proxy_factory -#define OSGI_RSA_REMOTE_PROXY_TIMEOUT remote_proxy_timeout - -static const char *data_response_headers = -HTTP/1.1 200 OK\r\n -Cache: no-cache\r\n -Content-Type: application/json\r\n -\r\n; - -static const char *no_content_response_headers = -HTTP/1.1 204 OK\r\n; - -// TODO do we need to specify a non-Amdatu specific configuration type?! -static const char * const CONFIGURATION_TYPE = org.amdatu.remote.admin.http; -static const char * const ENDPOINT_URL = org.amdatu.remote.admin.http.url; - -static const char *DEFAULT_PORT = ; -static const char *DEFAULT_IP = 127.0.0.1; - -static const unsigned int DEFAULT_TIMEOUT = 0; - -static int remoteServiceAdmin_callback(struct mg_connection *conn); -static celix_status_t remoteServiceAdmin_createEndpointDescription(remote_service_admin_pt admin, service_reference_pt reference, char *interface, endpoint_description_pt *description); -static celix_status_t remoteServiceAdmin_send(void *handle, endpoint_description_pt endpointDescription, char *request, char **reply, int* replyStatus); -static celix_status_t remoteServiceAdmin_getIpAdress(char* interface, char** ip); -static size_t remoteServiceAdmin_readCallback(void *ptr, size_t size, size_t nmemb, void *userp); -static size_t remoteServiceAdmin_write(void *contents, size_t size, size_t nmemb, void *userp); -static void remoteServiceAdmin_log(remote_service_admin_pt admin, int level, const char *file, int line, const char *msg, ...); - -celix_status_t remoteServiceAdmin_create(bundle_context_pt context, remote_service_admin_pt *admin) { -celix_status_t status = CELIX_SUCCESS; - -*admin = calloc(1, sizeof(**admin)); - -if (!*admin) { -status = CELIX_ENOMEM; -} else { -unsigned int port_counter = 0; -char *port = NULL; -char *ip = NULL; -char *detectedIp = NULL; -(*admin)-context = context; -(*admin)-exportedServices = hashMap_create(NULL, NULL, NULL, NULL); -(*admin)-importedServices = hashMap_create(NULL, NULL, NULL, NULL); - -celixThreadMutex_create((*admin)-exportedServicesLock, NULL); -celixThreadMutex_create((*admin)-importedServicesLock, NULL); - -if (logHelper_create(context, (*admin)-loghelper) == CELIX_SUCCESS) { -logHelper_start((*admin)-loghelper); -
[3/5] celix git commit: CELIX-237: Refactoring of rsa_dfi layout (lib, lib-tst, rsa bundle, rsa tst)
http://git-wip-us.apache.org/repos/asf/celix/blob/a129b488/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_closure_tests.cpp -- diff --git a/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_closure_tests.cpp b/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_closure_tests.cpp new file mode 100644 index 000..b2b11d7 --- /dev/null +++ b/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_closure_tests.cpp @@ -0,0 +1,146 @@ +/* + * Licensed under Apache License v2. See LICENSE for more information. + */ +#include CppUTest/TestHarness.h +#include CppUTest/CommandLineTestRunner.h + +extern C { + +#include stdio.h +#include stdint.h +#include stdlib.h +#include string.h +#include ctype.h + +#include dyn_common.h +#include dyn_function.h + +static int g_count; + +static void stdLog(void *handle, int level, const char *file, int line, const char *msg, ...) { +va_list ap; +const char *levels[5] = {NIL, ERROR, WARNING, INFO, DEBUG}; +fprintf(stderr, %s: FILE:%s, LINE:%i, MSG:,levels[level], file, line); +va_start(ap, msg); +vfprintf(stderr, msg, ap); +fprintf(stderr, \n); +} + +#define EXAMPLE1_DESCRIPTOR example(III)I +static void example1_binding(void *userData, void* args[], void *out) { +int32_t a = *((int32_t *)args[0]); +int32_t b = *((int32_t *)args[1]); +int32_t c = *((int32_t *)args[2]); +int32_t *ret = (int32_t *)out; +*ret = a + b + c; +g_count += 1; +} + +#define EXAMPLE2_DESCRIPTOR example(I{DDD val1 val2 val3}I)D +struct example2_arg2 { +double val1; +double val2; +double val3; +}; +void example2_binding(void *userData, void* args[], void *out) { +int32_t a = *((int32_t *)args[0]); +struct example2_arg2 b = *((struct example2_arg2 *)args[1]); +int32_t c = *((int32_t *)args[2]); +double *ret = (double *)out; +*ret = a + b.val1 + b.val2 + b.val3 + c; +g_count += 1; +} + + +#define EXAMPLE3_DESCRIPTOR example(III){III sum max min} +struct example3_ret { +int32_t sum; +int32_t max; +int32_t min; +}; + +static void example3_binding(void *userData, void* args[], void *out) { +int32_t a = *((int32_t *)args[0]); +int32_t b = *((int32_t *)args[1]); +int32_t c = *((int32_t *)args[2]); +struct example3_ret *result = (struct example3_ret *)calloc(1,sizeof(struct example3_ret)); +result-sum = a + b + c; +result-min = a = b ? a : b; +result-max = a = b ? a : b; +result-min = result-min = c ? result-min : c; +result-max = result-max = c ? result-max : c; + +struct example3_ret **ret = (struct example3_ret **)out; +(*ret) = result; +g_count += 1; +} + +static void tests() { +dyn_function_type *dynFunction = NULL; +int rc = 0; + +{ +int32_t (*func)(int32_t a, int32_t b, int32_t c) = NULL; +rc = dynFunction_parseWithStr(EXAMPLE1_DESCRIPTOR, NULL, dynFunction); +CHECK_EQUAL(0, rc); +rc = dynFunction_createClosure(dynFunction, example1_binding, NULL, (void(**)(void))func); +CHECK_EQUAL(0, rc); +int32_t ret = func(2,3,4); +CHECK_EQUAL(1, g_count); +CHECK_EQUAL(9, ret); +dynFunction_destroy(dynFunction); +} + +{ +double (*func)(int32_t a, struct example2_arg2 b, int32_t c) = NULL; +double (*func2)(int32_t a, struct example2_arg2 b, int32_t c) = NULL; +dynFunction = NULL; +rc = dynFunction_parseWithStr(EXAMPLE2_DESCRIPTOR, NULL, dynFunction); +CHECK_EQUAL(0, rc); +rc = dynFunction_createClosure(dynFunction, example2_binding, NULL, (void(**)(void))func); +CHECK_EQUAL(0, rc); +rc = dynFunction_getFnPointer(dynFunction, (void(**)(void))func2); +CHECK_EQUAL(0, rc); +CHECK(func == func2); +struct example2_arg2 b; +b.val1 = 1.0; +b.val2 = 1.5; +b.val3 = 2.0; +double ret = func(2,b,4); +CHECK_EQUAL(2, g_count); +CHECK_EQUAL(10.5, ret); +dynFunction_destroy(dynFunction); +} + +{ +struct example3_ret * (*func)(int32_t a, int32_t b, int32_t c) = NULL; +dynFunction = NULL; +rc = dynFunction_parseWithStr(EXAMPLE3_DESCRIPTOR, NULL, dynFunction); +CHECK_EQUAL(0, rc); +rc = dynFunction_createClosure(dynFunction, example3_binding, NULL, (void(**)(void))func); +CHECK_EQUAL(0, rc); +struct example3_ret *ret = func(2,8,4); +CHECK_EQUAL(3, g_count); +CHECK_EQUAL(14, ret-sum); +dynFunction_destroy(dynFunction); +free(ret); +} +} + +} + + +TEST_GROUP(DynClosureTests) { +void setup() { +
celix git commit: CELIX-237: Moved celix launcher to framework. Adjusted testing setup
Repository: celix Updated Branches: refs/heads/feature/CELIX-237_rsa-ffi fdade6aaa - 16853770c CELIX-237: Moved celix launcher to framework. Adjusted testing setup Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/16853770 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/16853770 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/16853770 Branch: refs/heads/feature/CELIX-237_rsa-ffi Commit: 16853770c82d8744d4e30f168652e1021f87b068 Parents: fdade6a Author: Pepijn Noltes pepijnnol...@gmail.com Authored: Tue Aug 18 12:22:27 2015 +0200 Committer: Pepijn Noltes pepijnnol...@gmail.com Committed: Tue Aug 18 12:22:27 2015 +0200 -- CMakeLists.txt | 7 +- framework/CMakeLists.txt| 6 +- framework/private/src/celix_launcher.c | 190 +++ framework/public/include/celix_launcher.h | 41 launcher/CMakeLists.txt | 2 +- launcher/private/src/launcher.c | 190 --- launcher/private/src/main.c | 2 +- launcher/public/include/launcher.h | 41 .../remote_service_admin_dfi/CMakeLists.txt | 12 +- .../rsa_tst/CMakeLists.txt | 2 - .../rsa_tst/rsa_client_server_tests.cpp | 2 +- .../rsa_tst/rsa_tests.cpp | 2 +- 12 files changed, 249 insertions(+), 248 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/16853770/CMakeLists.txt -- diff --git a/CMakeLists.txt b/CMakeLists.txt index 137c81b..2f78e1f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,7 +41,12 @@ SET(CELIX_MINOR 0) SET(CELIX_MICRO 0) SET(CELIX_QUALIFIER ) -enable_testing() +option(ENABLE_TESTING Enables unit/bundle testing FALSE) + +if (ENABLE_TESTING) + enable_testing() +endif() + include(CMakeCelix) include(cmake_celix/installation) http://git-wip-us.apache.org/repos/asf/celix/blob/16853770/framework/CMakeLists.txt -- diff --git a/framework/CMakeLists.txt b/framework/CMakeLists.txt index 1719d2c..429dd04 100644 --- a/framework/CMakeLists.txt +++ b/framework/CMakeLists.txt @@ -55,7 +55,7 @@ if (FRAMEWORK) private/src/requirement.c private/src/resolver.c private/src/service_reference.c private/src/service_registration.c private/src/service_registry.c private/src/service_tracker.c private/src/service_tracker_customizer.c private/src/unzip.c private/src/utils.c private/src/version.c private/src/version_range.c private/src/wire.c -private/src/celix_log.c +private/src/celix_log.c private/src/celix_launcher.c private/include/attribute.h public/include/framework_exports.h @@ -81,7 +81,7 @@ if (FRAMEWORK) INSTALL(DIRECTORY ${PROJECT_SOURCE_DIR}/cmake/ DESTINATION share/celix/cmake/modules COMPONENT framework) celix_subproject(FRAMEWORK_TESTS Option to build the framework tests OFF DEPS) -if (FRAMEWORK_TESTS) +if (ENABLE_TESTING AND FRAMEWORK_TESTS) find_package(CppUTest REQUIRED) include_directories(${CPPUTEST_INCLUDE_DIR}) @@ -374,5 +374,5 @@ if (FRAMEWORK) SETUP_TARGET_FOR_COVERAGE(attribute_test_c attribute_test ${CMAKE_BINARY_DIR}/coverage/attribute_test) SETUP_TARGET_FOR_COVERAGE(wire_test_c wire_test ${CMAKE_BINARY_DIR}/coverage/wire_test) - endif (FRAMEWORK_TESTS) + endif (ENABLE_TESTING AND FRAMEWORK_TESTS) endif (FRAMEWORK) http://git-wip-us.apache.org/repos/asf/celix/blob/16853770/framework/private/src/celix_launcher.c -- diff --git a/framework/private/src/celix_launcher.c b/framework/private/src/celix_launcher.c new file mode 100644 index 000..bc6bd34 --- /dev/null +++ b/framework/private/src/celix_launcher.c @@ -0,0 +1,190 @@ +/** + *Licensed to the Apache Software Foundation (ASF) under one + *or more contributor license agreements. See the NOTICE file + *distributed with this work for additional information + *regarding copyright ownership. The ASF licenses this file + *to you under the Apache License, Version 2.0 (the + *License); you may not use this file except in compliance + *with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + *Unless required by applicable law or agreed to in writing, + *software distributed under the License is distributed on an + *AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + *specific language governing permissions
[7/7] celix git commit: CELIX_237: Merge remote-tracking branch 'origin/develop' into ffi
CELIX_237: Merge remote-tracking branch 'origin/develop' into ffi Conflicts: .travis.yml Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/b5d2367d Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/b5d2367d Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/b5d2367d Branch: refs/heads/feature/CELIX-237_rsa-ffi Commit: b5d2367d88b4969cb00eb7a9f40fd09e03cf5bd8 Parents: 1685377 f32a233 Author: Pepijn Noltes pepijnnol...@gmail.com Authored: Tue Aug 18 12:46:11 2015 +0200 Committer: Pepijn Noltes pepijnnol...@gmail.com Committed: Tue Aug 18 12:46:11 2015 +0200 -- CMakeLists.txt | 1 + cmake/CMakeCelix.cmake | 4 + deployment_admin/private/src/deployment_admin.c | 2 +- device_access/device_access/CMakeLists.txt | 2 - device_access/driver_locator/CMakeLists.txt | 2 - .../example/base_driver/CMakeLists.txt | 2 - .../base_driver/private/src/base_driver.c | 2 +- .../example/consuming_driver/CMakeLists.txt | 2 - .../private/src/consuming_driver.c | 1 + .../example/refining_driver/CMakeLists.txt | 2 - examples/CMakeLists.txt | 7 +- examples/deploy.cmake | 6 +- framework/private/src/framework.c | 3 +- .../private/src/endpoint_discovery_server.c | 9 + .../discovery_configured/CMakeLists.txt |22 +- .../remote_service_admin_http/CMakeLists.txt| 6 +- .../private/src/remote_service_admin_impl.c |10 +- .../utils/private/include/civetweb.h| 542 +- remote_services/utils/private/src/civetweb.c| 14935 +++-- 19 files changed, 6574 insertions(+), 8986 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/b5d2367d/CMakeLists.txt -- http://git-wip-us.apache.org/repos/asf/celix/blob/b5d2367d/cmake/CMakeCelix.cmake -- http://git-wip-us.apache.org/repos/asf/celix/blob/b5d2367d/framework/private/src/framework.c -- http://git-wip-us.apache.org/repos/asf/celix/blob/b5d2367d/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c --
[4/7] celix git commit: CELIX-119: Remove apr from device_access
CELIX-119: Remove apr from device_access Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/b0688a4d Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/b0688a4d Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/b0688a4d Branch: refs/heads/feature/CELIX-237_rsa-ffi Commit: b0688a4d9154ade806a2f4d284127469f92ed787 Parents: 57a1578 Author: Bjoern Petri bpe...@apache.org Authored: Tue Aug 11 16:16:32 2015 +0200 Committer: Bjoern Petri bpe...@apache.org Committed: Tue Aug 11 16:16:32 2015 +0200 -- .travis.yml | 2 +- device_access/device_access/CMakeLists.txt| 2 -- device_access/driver_locator/CMakeLists.txt | 2 -- device_access/example/base_driver/CMakeLists.txt | 2 -- device_access/example/consuming_driver/CMakeLists.txt | 2 -- device_access/example/refining_driver/CMakeLists.txt | 2 -- 6 files changed, 1 insertion(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/b0688a4d/.travis.yml -- diff --git a/.travis.yml b/.travis.yml index d66498f..bb53363 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ matrix: before_script: - mkdir build install - cd build -- cmake -DBUILD_DEPLOYMENT_ADMIN=ON -DBUILD_EXAMPLES=ON -DBUILD_LOG_SERVICE=ON -DBUILD_LOG_WRITER=ON -DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON -DBUILD_RSA_DISCOVERY_SHM=ON -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_SHM=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_SHELL=ON -DBUILD_SHELL_TUI=ON -DCMAKE_INSTALL_PREFIX=../install .. +- cmake -DBUILD_DEPLOYMENT_ADMIN=ON -DBUILD_EXAMPLES=ON -DBUILD_LOG_SERVICE=ON -DBUILD_LOG_WRITER=ON -DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON -DBUILD_RSA_DISCOVERY_SHM=ON -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_SHM=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_SHELL=ON -DBUILD_SHELL_TUI=ON -DBUILD_DEVICE_ACCESS=ON -DBUILD_DEVICE_ACCESS_EXAMPLE=ON -DCMAKE_INSTALL_PREFIX=../install .. script: - make all make deploy make install http://git-wip-us.apache.org/repos/asf/celix/blob/b0688a4d/device_access/device_access/CMakeLists.txt -- diff --git a/device_access/device_access/CMakeLists.txt b/device_access/device_access/CMakeLists.txt index 7d7b79b..03e7817 100644 --- a/device_access/device_access/CMakeLists.txt +++ b/device_access/device_access/CMakeLists.txt @@ -15,8 +15,6 @@ # specific language governing permissions and limitations # under the License. -find_package(APR REQUIRED) - SET_HEADER(BUNDLE_SYMBOLICNAME apache_celix_device_manager) SET(BUNDLE_VERSION 0.0.1) SET_HEADERS(Bundle-Name: Apache Celix Device Access Device Manager) http://git-wip-us.apache.org/repos/asf/celix/blob/b0688a4d/device_access/driver_locator/CMakeLists.txt -- diff --git a/device_access/driver_locator/CMakeLists.txt b/device_access/driver_locator/CMakeLists.txt index 61d25f9..f47696a 100644 --- a/device_access/driver_locator/CMakeLists.txt +++ b/device_access/driver_locator/CMakeLists.txt @@ -15,8 +15,6 @@ # specific language governing permissions and limitations # under the License. -find_package(APR REQUIRED) - SET_HEADER(BUNDLE_SYMBOLICNAME apache_celix_driver_locator) SET(BUNDLE_VERSION 0.0.1) SET_HEADERS(Bundle-Name: Apache Celix Device Access Driver Locator) http://git-wip-us.apache.org/repos/asf/celix/blob/b0688a4d/device_access/example/base_driver/CMakeLists.txt -- diff --git a/device_access/example/base_driver/CMakeLists.txt b/device_access/example/base_driver/CMakeLists.txt index ffed3d3..82b916e 100644 --- a/device_access/example/base_driver/CMakeLists.txt +++ b/device_access/example/base_driver/CMakeLists.txt @@ -15,8 +15,6 @@ # specific language governing permissions and limitations # under the License. -find_package(APR REQUIRED) - SET_HEADER(BUNDLE_SYMBOLICNAME apache_celix_base_driver_example) SET(BUNDLE_VERSION 0.0.1) SET_HEADERS(Bundle-Name: Apache Celix Device Access Base Driver Example) http://git-wip-us.apache.org/repos/asf/celix/blob/b0688a4d/device_access/example/consuming_driver/CMakeLists.txt -- diff --git a/device_access/example/consuming_driver/CMakeLists.txt b/device_access/example/consuming_driver/CMakeLists.txt index bb6795b..96dc8e8 100644 --- a/device_access/example/consuming_driver/CMakeLists.txt
[5/7] celix git commit: CELIX-250: Add cmake install statement for config.h
CELIX-250: Add cmake install statement for config.h Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/12083361 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/12083361 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/12083361 Branch: refs/heads/feature/CELIX-237_rsa-ffi Commit: 12083361f671c4fd62ec90a10859f0c5f7498de2 Parents: b0688a4 Author: Bjoern Petri bpe...@apache.org Authored: Mon Aug 17 11:09:55 2015 +0200 Committer: Bjoern Petri bpe...@apache.org Committed: Mon Aug 17 11:09:55 2015 +0200 -- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/celix/blob/12083361/CMakeLists.txt -- diff --git a/CMakeLists.txt b/CMakeLists.txt index 137c81b..4bee365 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,6 +59,7 @@ if(${WITH_APR}) endif() CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/config.h DESTINATION include/celix) ## New sub project must use a buildoption to be able to enable/disable the project using the CMake Editor ## Sub projects depending on another sub project automatically enable these dependencies
[6/7] celix git commit: CELIX-251: added missing includes
CELIX-251: added missing includes Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/f32a2335 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/f32a2335 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/f32a2335 Branch: refs/heads/feature/CELIX-237_rsa-ffi Commit: f32a2335989ad6f9710a55c385b85c3b83413afd Parents: 1208336 Author: Bjoern Petri bpe...@apache.org Authored: Mon Aug 17 11:11:41 2015 +0200 Committer: Bjoern Petri bpe...@apache.org Committed: Mon Aug 17 11:11:41 2015 +0200 -- device_access/example/base_driver/private/src/base_driver.c| 2 +- .../example/consuming_driver/private/src/consuming_driver.c| 1 + 2 files changed, 2 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/f32a2335/device_access/example/base_driver/private/src/base_driver.c -- diff --git a/device_access/example/base_driver/private/src/base_driver.c b/device_access/example/base_driver/private/src/base_driver.c index fafec6d..33a2dca 100644 --- a/device_access/example/base_driver/private/src/base_driver.c +++ b/device_access/example/base_driver/private/src/base_driver.c @@ -24,7 +24,7 @@ * \copyright Apache License, Version 2.0 */ #include stdlib.h - +#include string.h #include celix_errno.h #include bundle_activator.h #include bundle_context.h http://git-wip-us.apache.org/repos/asf/celix/blob/f32a2335/device_access/example/consuming_driver/private/src/consuming_driver.c -- diff --git a/device_access/example/consuming_driver/private/src/consuming_driver.c b/device_access/example/consuming_driver/private/src/consuming_driver.c index 0842d57..b44ac32 100644 --- a/device_access/example/consuming_driver/private/src/consuming_driver.c +++ b/device_access/example/consuming_driver/private/src/consuming_driver.c @@ -24,6 +24,7 @@ * \copyright Apache License, Version 2.0 */ #include stdlib.h +#include string.h #include device.h #include service_tracker.h
[1/2] celix git commit: CELIX-237: Removed unused function
Repository: celix Updated Branches: refs/heads/feature/CELIX-237_rsa-ffi 24d13f2ef - f9ed9b33b CELIX-237: Removed unused function Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/e9954746 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/e9954746 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/e9954746 Branch: refs/heads/feature/CELIX-237_rsa-ffi Commit: e99547469face64cc3f330d3602efe1869fafc20 Parents: 24d13f2 Author: Pepijn Noltes pepijnnol...@gmail.com Authored: Fri Jul 31 12:59:55 2015 +0200 Committer: Pepijn Noltes pepijnnol...@gmail.com Committed: Fri Jul 31 12:59:55 2015 +0200 -- remote_services/dynamic_function_interface/dyn_type.c | 7 --- remote_services/dynamic_function_interface/dyn_type.h | 1 - 2 files changed, 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/e9954746/remote_services/dynamic_function_interface/dyn_type.c -- diff --git a/remote_services/dynamic_function_interface/dyn_type.c b/remote_services/dynamic_function_interface/dyn_type.c index 6de9736..87ebb5d 100644 --- a/remote_services/dynamic_function_interface/dyn_type.c +++ b/remote_services/dynamic_function_interface/dyn_type.c @@ -478,13 +478,6 @@ int dynType_complex_indexForName(dyn_type *type, const char *name) { return index; } -char dynType_complex_descriptorTypeAt(dyn_type *type, int index) { -assert(type-type == DYN_TYPE_COMPLEX); - -dyn_type *item = type-complex.types[index]; -return item-descriptor; -} - int dynType_complex_dynTypeAt(dyn_type *type, int index, dyn_type **result) { assert(type-type == DYN_TYPE_COMPLEX); dyn_type *sub = type-complex.types[index]; http://git-wip-us.apache.org/repos/asf/celix/blob/e9954746/remote_services/dynamic_function_interface/dyn_type.h -- diff --git a/remote_services/dynamic_function_interface/dyn_type.h b/remote_services/dynamic_function_interface/dyn_type.h index bf6dfc8..7334da3 100644 --- a/remote_services/dynamic_function_interface/dyn_type.h +++ b/remote_services/dynamic_function_interface/dyn_type.h @@ -148,7 +148,6 @@ int dynType_descriptorType(dyn_type *type); //complexType int dynType_complex_indexForName(dyn_type *type, const char *name); -char dynType_complex_descriptorTypeAt(dyn_type *type, int index); int dynType_complex_dynTypeAt(dyn_type *type, int index, dyn_type **subType); int dynType_complex_setValueAt(dyn_type *type, int index, void *inst, void *in); int dynType_complex_valLocAt(dyn_type *type, int index, void *inst, void **valLoc);
[1/2] celix git commit: CELIX-237: Some small changes needed for Mac
Repository: celix Updated Branches: refs/heads/feature/CELIX-237_rsa-ffi 481e5c861 - 87f3fabf7 CELIX-237: Some small changes needed for Mac Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/4e3be109 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/4e3be109 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/4e3be109 Branch: refs/heads/feature/CELIX-237_rsa-ffi Commit: 4e3be109d24da30b787a753a00e8462a6f905e52 Parents: 481e5c8 Author: Pepijn Noltes pepijnnol...@gmail.com Authored: Sat Aug 1 21:15:51 2015 +0200 Committer: Pepijn Noltes pepijnnol...@gmail.com Committed: Sat Aug 1 21:15:51 2015 +0200 -- .../tst/json_serializer_tests.cpp | 10 +- .../remote_service_admin_dfi/tst/CMakeLists.txt | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/4e3be109/remote_services/remote_service_admin_dfi/dynamic_function_interface/tst/json_serializer_tests.cpp -- diff --git a/remote_services/remote_service_admin_dfi/dynamic_function_interface/tst/json_serializer_tests.cpp b/remote_services/remote_service_admin_dfi/dynamic_function_interface/tst/json_serializer_tests.cpp index c21d594..5ee71ac 100644 --- a/remote_services/remote_service_admin_dfi/dynamic_function_interface/tst/json_serializer_tests.cpp +++ b/remote_services/remote_service_admin_dfi/dynamic_function_interface/tst/json_serializer_tests.cpp @@ -49,9 +49,9 @@ struct example1 { static void check_example1(void *data) { struct example1 *ex = (struct example1 *)data; CHECK_EQUAL(1.0, ex-a); -CHECK_EQUAL(22, ex-b); -CHECK_EQUAL(32, ex-c); -CHECK_EQUAL(42, ex-d); +LONGS_EQUAL(22, ex-b); +LONGS_EQUAL(32, ex-c); +LONGS_EQUAL(42, ex-d); CHECK_EQUAL(4.4f, ex-e); } @@ -79,8 +79,8 @@ struct example2 { static void check_example2(void *data) { struct example2 *ex = (struct example2 *)data; CHECK_EQUAL(42, ex-byte); -CHECK_EQUAL(232, ex-long1); -CHECK_EQUAL(242, ex-long2); +LONGS_EQUAL(232, ex-long1); +LONGS_EQUAL(242, ex-long2); CHECK_EQUAL(4.2, ex-double1); CHECK_EQUAL(3.2f, ex-float1); CHECK_EQUAL(4.4, ex-double2); http://git-wip-us.apache.org/repos/asf/celix/blob/4e3be109/remote_services/remote_service_admin_dfi/tst/CMakeLists.txt -- diff --git a/remote_services/remote_service_admin_dfi/tst/CMakeLists.txt b/remote_services/remote_service_admin_dfi/tst/CMakeLists.txt index d71186e..a9b7b00 100644 --- a/remote_services/remote_service_admin_dfi/tst/CMakeLists.txt +++ b/remote_services/remote_service_admin_dfi/tst/CMakeLists.txt @@ -12,7 +12,7 @@ include_directories( #if (FRAMEWORK_TESTS) TODO SET(CMAKE_SKIP_BUILD_RPATH FALSE) #TODO needed? SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) #TODO needed? -SET(CMAKE_INSTALL_RPATH ${PROJECT_BINARY_DIR}/framework:${PROJECT_BINARY_DIR}/utils) +SET(CMAKE_INSTALL_RPATH ${PROJECT_BINARY_DIR}/framework ${PROJECT_BINARY_DIR}/utils) add_executable(rsa_dfi_tests ${PROJECT_SOURCE_DIR}/launcher/private/src/launcher.c
[07/10] celix git commit: CELIX-237: moved rsa_http_ffi source to rsa_dfi
CELIX-237: moved rsa_http_ffi source to rsa_dfi Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/3d7f7641 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/3d7f7641 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/3d7f7641 Branch: refs/heads/feature/CELIX-237_rsa-ffi Commit: 3d7f7641fbd58c79b54e00d9d7d1395f54db166c Parents: bf76d21 Author: Pepijn Noltes pepijnnol...@gmail.com Authored: Fri Jul 31 16:11:31 2015 +0200 Committer: Pepijn Noltes pepijnnol...@gmail.com Committed: Fri Jul 31 16:11:31 2015 +0200 -- .../remote_service_admin_dfi/CMakeLists.txt | 26 +- .../dynamic_function_interface/CMakeLists.txt |5 +- .../include/remote_service_admin_http_impl.h| 52 + .../src/remote_service_admin_activator.c| 122 ++ .../private/src/remote_service_admin_impl.c | 1085 ++ .../CMakeLists.txt | 51 - .../include/remote_service_admin_http_impl.h| 52 - .../src/remote_service_admin_activator.c| 122 -- .../private/src/remote_service_admin_impl.c | 1085 -- 9 files changed, 1274 insertions(+), 1326 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/3d7f7641/remote_services/remote_service_admin_dfi/CMakeLists.txt -- diff --git a/remote_services/remote_service_admin_dfi/CMakeLists.txt b/remote_services/remote_service_admin_dfi/CMakeLists.txt index f74cac1..500e40e 100644 --- a/remote_services/remote_service_admin_dfi/CMakeLists.txt +++ b/remote_services/remote_service_admin_dfi/CMakeLists.txt @@ -34,19 +34,19 @@ if (RSA_REMOTE_SERVICE_ADMIN_DFI) include_directories(${PROJECT_SOURCE_DIR}/remote_services/remote_service_admin_http/private/include) include_directories(${PROJECT_SOURCE_DIR}/remote_services/endpoint_listener/public/include) -#SET_HEADER(BUNDLE_SYMBOLICNAME apache_celix_remote_service_admin_dfi) -#SET(BUNDLE_VERSION 0.0.1) -#SET_HEADERS(Bundle-Name: Apache Celix Remote Service Admin HTTP for dynamic function interface) +SET_HEADER(BUNDLE_SYMBOLICNAME apache_celix_remote_service_admin_dfi) +SET(BUNDLE_VERSION 0.0.1) +SET_HEADERS(Bundle-Name: Apache Celix Remote Service Admin HTTP for dynamic function interface) -#bundle(remote_service_admin_dfi SOURCES -#private/src/remote_service_admin_impl -#private/src/remote_service_admin_activator -# ${PROJECT_SOURCE_DIR}/remote_services/remote_service_admin/private/src/export_registration_impl -# ${PROJECT_SOURCE_DIR}/remote_services/remote_service_admin/private/src/import_registration_impl -#${PROJECT_SOURCE_DIR}/remote_services/utils/private/src/civetweb.c -#${PROJECT_SOURCE_DIR}/log_service/public/src/log_helper.c -#) -#target_link_libraries(remote_service_admin_dfi celix_framework ${CURL_LIBRARIES} ${JANSSON_LIBRARIES} ${FFI_LIBRARIES}) +bundle(remote_service_admin_dfi SOURCES +private/src/remote_service_admin_impl +private/src/remote_service_admin_activator + ${PROJECT_SOURCE_DIR}/remote_services/remote_service_admin/private/src/export_registration_impl + ${PROJECT_SOURCE_DIR}/remote_services/remote_service_admin/private/src/import_registration_impl +${PROJECT_SOURCE_DIR}/remote_services/utils/private/src/civetweb.c +${PROJECT_SOURCE_DIR}/log_service/public/src/log_helper.c +) +target_link_libraries(remote_service_admin_dfi celix_framework ${CURL_LIBRARIES} ${JANSSON_LIBRARIES} ${FFI_LIBRARIES} dfi) -#install_bundle(remote_service_admin_dfi) +install_bundle(remote_service_admin_dfi) endif (RSA_REMOTE_SERVICE_ADMIN_DFI) http://git-wip-us.apache.org/repos/asf/celix/blob/3d7f7641/remote_services/remote_service_admin_dfi/dynamic_function_interface/CMakeLists.txt -- diff --git a/remote_services/remote_service_admin_dfi/dynamic_function_interface/CMakeLists.txt b/remote_services/remote_service_admin_dfi/dynamic_function_interface/CMakeLists.txt index 309176f..ae1d5c3 100644 --- a/remote_services/remote_service_admin_dfi/dynamic_function_interface/CMakeLists.txt +++ b/remote_services/remote_service_admin_dfi/dynamic_function_interface/CMakeLists.txt @@ -18,7 +18,7 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL Darwin) set(MEMSTREAM_SOURCES memstream/open_memstream.c memstream/fmemopen.c) endif() -add_library(dfi +add_library(dfi STATIC dyn_common.c dyn_type.c dyn_function.c @@ -30,14 +30,13 @@ add_library(dfi target_link_libraries(dfi ${FFI_LIBRARIES} ${JANSSON_LIBRARY}) -#if (FRAMEWORK_TESTS) +#if (FRAMEWORK_TESTS) TODO add_executable(dfi_tests
[10/10] celix git commit: CELIX-237: Finished ccputest setup for testing the rsa dfi bundle. Cpputest uses the launcher to launch an embedded celix
CELIX-237: Finished ccputest setup for testing the rsa dfi bundle. Cpputest uses the launcher to launch an embedded celix Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/481e5c86 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/481e5c86 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/481e5c86 Branch: refs/heads/feature/CELIX-237_rsa-ffi Commit: 481e5c86114ecdd2bef5b2f5f6afdb32a6a6a537 Parents: 1e618fb Author: Pepijn Noltes pepijnnol...@gmail.com Authored: Fri Jul 31 22:56:02 2015 +0200 Committer: Pepijn Noltes pepijnnol...@gmail.com Committed: Fri Jul 31 22:56:02 2015 +0200 -- launcher/private/src/launcher.c | 9 +++-- launcher/public/include/launcher.h | 1 + .../remote_service_admin_dfi/CMakeLists.txt | 4 ++- .../remote_service_admin_dfi/tst/CMakeLists.txt | 18 ++ .../remote_service_admin_dfi/tst/rsa_tests.cpp | 36 .../remote_service_admin_dfi/tst/run_tests.cpp | 21 +--- 6 files changed, 74 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/481e5c86/launcher/private/src/launcher.c -- diff --git a/launcher/private/src/launcher.c b/launcher/private/src/launcher.c index 9292ffb..4f0f3de 100644 --- a/launcher/private/src/launcher.c +++ b/launcher/private/src/launcher.c @@ -183,15 +183,18 @@ void celixLauncher_waitForShutdown(void) { properties_destroy(config); } +void celixLauncher_stop(void) { +bundle_pt fwBundle = NULL; +framework_getFrameworkBundle(framework, fwBundle); +bundle_stop(fwBundle); +} struct framework *celixLauncher_getFramework(void) { return framework; } static void launcher_shutdown(int signal) { -bundle_pt fwBundle = NULL; -framework_getFrameworkBundle(framework, fwBundle); -bundle_stop(fwBundle); +celixLauncher_stop(); // if (framework_waitForStop(framework) != CELIX_SUCCESS) { // celix_log(Error waiting for stop.); // } http://git-wip-us.apache.org/repos/asf/celix/blob/481e5c86/launcher/public/include/launcher.h -- diff --git a/launcher/public/include/launcher.h b/launcher/public/include/launcher.h index f95e160..6ee8357 100644 --- a/launcher/public/include/launcher.h +++ b/launcher/public/include/launcher.h @@ -32,6 +32,7 @@ int celixLauncher_launch(const char *configFile); int celixLauncher_launchWithStream(FILE *config); +void celixLauncher_stop(void); void celixLauncher_waitForShutdown(void); struct framework *celixLauncher_getFramework(void); http://git-wip-us.apache.org/repos/asf/celix/blob/481e5c86/remote_services/remote_service_admin_dfi/CMakeLists.txt -- diff --git a/remote_services/remote_service_admin_dfi/CMakeLists.txt b/remote_services/remote_service_admin_dfi/CMakeLists.txt index 500e40e..3937605 100644 --- a/remote_services/remote_service_admin_dfi/CMakeLists.txt +++ b/remote_services/remote_service_admin_dfi/CMakeLists.txt @@ -46,7 +46,9 @@ if (RSA_REMOTE_SERVICE_ADMIN_DFI) ${PROJECT_SOURCE_DIR}/remote_services/utils/private/src/civetweb.c ${PROJECT_SOURCE_DIR}/log_service/public/src/log_helper.c ) -target_link_libraries(remote_service_admin_dfi celix_framework ${CURL_LIBRARIES} ${JANSSON_LIBRARIES} ${FFI_LIBRARIES} dfi) +target_link_libraries(remote_service_admin_dfi celix_framework celix_utils ${CURL_LIBRARIES} ${JANSSON_LIBRARIES} ${FFI_LIBRARIES} dfi) install_bundle(remote_service_admin_dfi) + +add_subdirectory(tst) endif (RSA_REMOTE_SERVICE_ADMIN_DFI) http://git-wip-us.apache.org/repos/asf/celix/blob/481e5c86/remote_services/remote_service_admin_dfi/tst/CMakeLists.txt -- diff --git a/remote_services/remote_service_admin_dfi/tst/CMakeLists.txt b/remote_services/remote_service_admin_dfi/tst/CMakeLists.txt index fb1834a..d71186e 100644 --- a/remote_services/remote_service_admin_dfi/tst/CMakeLists.txt +++ b/remote_services/remote_service_admin_dfi/tst/CMakeLists.txt @@ -3,20 +3,26 @@ # include_directories( - ${PROJECT_SOURCE_DIR}/launcher/public + ${PROJECT_SOURCE_DIR}/launcher/public/include ${CPPUTEST_INCLUDE_DIR} +${PROJECT_SOURCE_DIR}/framework/public/include +${PROJECT_SOURCE_DIR}/utils/public/include ) - #if (FRAMEWORK_TESTS) TODO +SET(CMAKE_SKIP_BUILD_RPATH FALSE) #TODO needed? +SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) #TODO needed? +SET(CMAKE_INSTALL_RPATH ${PROJECT_BINARY_DIR}/framework:${PROJECT_BINARY_DIR}/utils) + add_executable(rsa_dfi_tests -
[01/10] celix git commit: CELIX-237: Added extra test
Repository: celix Updated Branches: refs/heads/feature/CELIX-237_rsa-ffi f9ed9b33b - 481e5c861 CELIX-237: Added extra test Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/a2b09e22 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/a2b09e22 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/a2b09e22 Branch: refs/heads/feature/CELIX-237_rsa-ffi Commit: a2b09e223114b509a01209d418cd479bb09e4b7c Parents: f9ed9b3 Author: Pepijn Noltes pepijnnol...@gmail.com Authored: Fri Jul 31 15:57:42 2015 +0200 Committer: Pepijn Noltes pepijnnol...@gmail.com Committed: Fri Jul 31 15:57:42 2015 +0200 -- .../dynamic_function_interface/dyn_type.c| 4 ++-- .../dynamic_function_interface/dyn_type.h| 2 ++ .../tst/dyn_type_tests.cpp | 15 +++ 3 files changed, 19 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/a2b09e22/remote_services/dynamic_function_interface/dyn_type.c -- diff --git a/remote_services/dynamic_function_interface/dyn_type.c b/remote_services/dynamic_function_interface/dyn_type.c index af98fe9..2946607 100644 --- a/remote_services/dynamic_function_interface/dyn_type.c +++ b/remote_services/dynamic_function_interface/dyn_type.c @@ -595,7 +595,7 @@ void dynType_free(dyn_type *type, void *loc) { void dynType_deepFree(dyn_type *type, void *loc, bool alsoDeleteSelf) { if (loc != NULL) { dyn_type *subType = NULL; -const char *text = NULL; +char *text = NULL; switch (type-type) { case DYN_TYPE_COMPLEX : dynType_freeComplexType(type, loc); @@ -608,7 +608,7 @@ void dynType_deepFree(dyn_type *type, void *loc, bool alsoDeleteSelf) { dynType_deepFree(subType, *(void **)loc, true); break; case DYN_TYPE_TEXT : -text = *(const char **)loc; +text = *(char **)loc; free(text); break; } http://git-wip-us.apache.org/repos/asf/celix/blob/a2b09e22/remote_services/dynamic_function_interface/dyn_type.h -- diff --git a/remote_services/dynamic_function_interface/dyn_type.h b/remote_services/dynamic_function_interface/dyn_type.h index c4f33a2..9fdbff2 100644 --- a/remote_services/dynamic_function_interface/dyn_type.h +++ b/remote_services/dynamic_function_interface/dyn_type.h @@ -128,8 +128,10 @@ int dynType_sequence_increaseLengthAndReturnLastLoc(dyn_type *type, void *seqLoc dyn_type * dynType_sequence_itemType(dyn_type *type); uint32_t dynType_sequence_length(void *seqLoc); +//typed pointer int dynType_typedPointer_getTypedType(dyn_type *type, dyn_type **typedType); +//text int dynType_text_allocAndInit(dyn_type *type, void *textLoc, const char *value); //simple http://git-wip-us.apache.org/repos/asf/celix/blob/a2b09e22/remote_services/dynamic_function_interface/tst/dyn_type_tests.cpp -- diff --git a/remote_services/dynamic_function_interface/tst/dyn_type_tests.cpp b/remote_services/dynamic_function_interface/tst/dyn_type_tests.cpp index daee4cf..96f64fa 100644 --- a/remote_services/dynamic_function_interface/tst/dyn_type_tests.cpp +++ b/remote_services/dynamic_function_interface/tst/dyn_type_tests.cpp @@ -173,3 +173,18 @@ TEST(DynTypeTests, AssignTest2) { dynType_destroy(type); } + +TEST(DynTypeTests, AssignTest3) { +int simple = 1; +dyn_type *type = NULL; +int rc = dynType_parseWithStr(N, NULL, NULL, type); +CHECK_EQUAL(0, rc); + +int newValue = 42; +void *loc = simple; +void *input = newValue; +dynType_simple_setValue(type, loc, input); +CHECK_EQUAL(42, simple); +dynType_destroy(type); +} +
[02/10] celix git commit: CELIX-237: Moved dynamic function interface under remote_service_admin_dfi
http://git-wip-us.apache.org/repos/asf/celix/blob/bf76d213/remote_services/remote_service_admin_dfi/dynamic_function_interface/memstream/open_memstream.h -- diff --git a/remote_services/remote_service_admin_dfi/dynamic_function_interface/memstream/open_memstream.h b/remote_services/remote_service_admin_dfi/dynamic_function_interface/memstream/open_memstream.h new file mode 100644 index 000..e87bb0a --- /dev/null +++ b/remote_services/remote_service_admin_dfi/dynamic_function_interface/memstream/open_memstream.h @@ -0,0 +1,15 @@ +#ifndef OPEN_MEMSTREAM_H_ +#define OPEN_MEMSTREAM_H_ + +#ifdef __cplusplus +extern C +{ +#endif + +FILE *open_memstream(char **cp, size_t *lenp); + +#ifdef __cplusplus +} +#endif + +#endif // #ifndef FMEMOPEN_H_ http://git-wip-us.apache.org/repos/asf/celix/blob/bf76d213/remote_services/remote_service_admin_dfi/dynamic_function_interface/schemas/complex.avdl -- diff --git a/remote_services/remote_service_admin_dfi/dynamic_function_interface/schemas/complex.avdl b/remote_services/remote_service_admin_dfi/dynamic_function_interface/schemas/complex.avdl new file mode 100644 index 000..0490dcd --- /dev/null +++ b/remote_services/remote_service_admin_dfi/dynamic_function_interface/schemas/complex.avdl @@ -0,0 +1,11 @@ +protocol Complex { + + record StatResult { +double sum; +double min; +double max; +arraydouble input; + } + + StatResult stats(arraydouble input); +} http://git-wip-us.apache.org/repos/asf/celix/blob/bf76d213/remote_services/remote_service_admin_dfi/dynamic_function_interface/schemas/complex.avpr -- diff --git a/remote_services/remote_service_admin_dfi/dynamic_function_interface/schemas/complex.avpr b/remote_services/remote_service_admin_dfi/dynamic_function_interface/schemas/complex.avpr new file mode 100644 index 000..0577397 --- /dev/null +++ b/remote_services/remote_service_admin_dfi/dynamic_function_interface/schemas/complex.avpr @@ -0,0 +1,36 @@ +{ + protocol : Complex, + namespace : null, + types : [ { +type : record, +name : StatResult, +fields : [ { + name : sum, + type : double +}, { + name : min, + type : double +}, { + name : max, + type : double +}, { + name : input, + type : { +type : array, +items : double + } +} ] + } ], + messages : { +stats : { + request : [ { +name : input, +type : { + type : array, + items : double +} + } ], + response : StatResult +} + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/celix/blob/bf76d213/remote_services/remote_service_admin_dfi/dynamic_function_interface/schemas/invalid1.avpr -- diff --git a/remote_services/remote_service_admin_dfi/dynamic_function_interface/schemas/invalid1.avpr b/remote_services/remote_service_admin_dfi/dynamic_function_interface/schemas/invalid1.avpr new file mode 100644 index 000..c968c61 --- /dev/null +++ b/remote_services/remote_service_admin_dfi/dynamic_function_interface/schemas/invalid1.avpr @@ -0,0 +1,29 @@ +{ + protocol : Complex, + namespace : null, + types : [ { +type : record, +name : StatResult, +fields : [ { + name : sum, + type : double +}, { + name : min, + type : double +}, { + name : max, + type : double +}, { + name : input, + type : { +type : array, +items : double + } +} ] + } ], + messages : { +stats : { + response : StatResult +} + } +} http://git-wip-us.apache.org/repos/asf/celix/blob/bf76d213/remote_services/remote_service_admin_dfi/dynamic_function_interface/schemas/invalid2.avpr -- diff --git a/remote_services/remote_service_admin_dfi/dynamic_function_interface/schemas/invalid2.avpr b/remote_services/remote_service_admin_dfi/dynamic_function_interface/schemas/invalid2.avpr new file mode 100644 index 000..fc48ca9 --- /dev/null +++ b/remote_services/remote_service_admin_dfi/dynamic_function_interface/schemas/invalid2.avpr @@ -0,0 +1,31 @@ +{ + protocol : Simple, + types : [ ], + messages : { +sum : { + request : [ { +name : a + }, { +name : b, +type : double + } ], + response : double +}, +sub : { + request : [ { +name : a, +type : double + }, { +name : b, +type : double + } ], + response : double +}, +sqrt : { + request : [ { +name : a + } ], + response : double +} + } +}
[3/5] celix git commit: CELIX-237: Some mem leak fixed based on valgrind results
CELIX-237: Some mem leak fixed based on valgrind results Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/195c83d0 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/195c83d0 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/195c83d0 Branch: refs/heads/feature/CELIX-237_rsa-ffi Commit: 195c83d0747c7e13cd0ed4321f27fd2768fc3ee2 Parents: 794f797 Author: Pepijn Noltes pepijnnol...@gmail.com Authored: Thu Jul 30 13:49:20 2015 +0200 Committer: Pepijn Noltes pepijnnol...@gmail.com Committed: Thu Jul 30 13:49:20 2015 +0200 -- remote_services/CMakeLists.txt | 12 +- .../dynamic_function_interface/dyn_common.c | 22 +++-- .../dynamic_function_interface/dyn_common.h | 11 - .../dynamic_function_interface/dyn_interface.c | 25 +++- .../dynamic_function_interface/dyn_interface.h | 10 ++-- .../tst/dyn_interface_tests.cpp | 5 6 files changed, 47 insertions(+), 38 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/195c83d0/remote_services/CMakeLists.txt -- diff --git a/remote_services/CMakeLists.txt b/remote_services/CMakeLists.txt index b7dc13c..957f468 100644 --- a/remote_services/CMakeLists.txt +++ b/remote_services/CMakeLists.txt @@ -33,14 +33,14 @@ if (REMOTE_SERVICE_ADMIN) add_subdirectory(topology_manager) -#add_subdirectory(remote_service_admin) -#add_subdirectory(remote_service_admin_http) -add_subdirectory(remote_service_admin_http_ffi) -#add_subdirectory(remote_service_admin_shm) +add_subdirectory(remote_service_admin) +add_subdirectory(remote_service_admin_http) +#add_subdirectory(remote_service_admin_http_ffi) +add_subdirectory(remote_service_admin_shm) -#add_subdirectory(discovery_configured) +add_subdirectory(discovery_configured) add_subdirectory(discovery_etcd) -#add_subdirectory(discovery_shm) +add_subdirectory(discovery_shm) add_subdirectory(dynamic_function_interface) http://git-wip-us.apache.org/repos/asf/celix/blob/195c83d0/remote_services/dynamic_function_interface/dyn_common.c -- diff --git a/remote_services/dynamic_function_interface/dyn_common.c b/remote_services/dynamic_function_interface/dyn_common.c index 057ddcf..0cca69b 100644 --- a/remote_services/dynamic_function_interface/dyn_common.c +++ b/remote_services/dynamic_function_interface/dyn_common.c @@ -51,14 +51,15 @@ int dynCommon_parseNameAlsoAccept(FILE *stream, const char *acceptedChars, char if (strLen == 0) { status = ERROR; LOG_ERROR(Parsed empty name); -free(buf); } } if (status == OK) { LOG_DEBUG(Parsed name '%s', buf); *result = buf; -} +} else if (buf != NULL) { +free(buf); +} return status; } @@ -116,3 +117,20 @@ static bool dynCommon_charIn(int c, const char *acceptedChars) { return status; } + +void dynCommon_clearNamValHead(struct namvals_head *head) { +struct namval_entry *tmp = NULL; +struct namval_entry *entry = TAILQ_FIRST(head); +while (entry != NULL) { +tmp = entry; + +if (entry-name != NULL) { +free(entry-name); +} +if (entry-value != NULL) { +free(entry-value); +} +entry = TAILQ_NEXT(entry, entries); +free(tmp); +} +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/celix/blob/195c83d0/remote_services/dynamic_function_interface/dyn_common.h -- diff --git a/remote_services/dynamic_function_interface/dyn_common.h b/remote_services/dynamic_function_interface/dyn_common.h index 308b75a..a31cbc4 100644 --- a/remote_services/dynamic_function_interface/dyn_common.h +++ b/remote_services/dynamic_function_interface/dyn_common.h @@ -14,20 +14,19 @@ //logging DFI_SETUP_LOG_HEADER(dynCommon); -/* -typedef struct _dyn_annotation_list_type annotation_list_type; -TAILQ_HEAD(_dyn_annotation_list_type, _dyn_annotation_type); +TAILQ_HEAD(namvals_head, namval_entry); -typedef struct _dyn_annotation_type dyn_annotation_type; -struct _dyn_annotation_type { +struct namval_entry { char *name; char *value; +TAILQ_ENTRY(namval_entry) entries; }; -*/ int dynCommon_parseName(FILE *stream, char **result); int dynCommon_parseNameAlsoAccept(FILE *stream, const char *acceptedChars, char **result); int dynCommon_parseNameValue(FILE *stream, char **name, char **value); int dynCommon_eatChar(FILE *stream, int c); +void dynCommon_clearNamValHead(struct namvals_head *head); +
[5/5] celix git commit: CELIX-237: Updated serialized. Added parse tests and conresponding implementation and added write functionality
CELIX-237: Updated serialized. Added parse tests and conresponding implementation and added write functionality Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/24d13f2e Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/24d13f2e Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/24d13f2e Branch: refs/heads/feature/CELIX-237_rsa-ffi Commit: 24d13f2ef08de444739e441471e87b349eb6972e Parents: 9f2ea10 Author: Pepijn Noltes pepijnnol...@gmail.com Authored: Fri Jul 31 12:17:30 2015 +0200 Committer: Pepijn Noltes pepijnnol...@gmail.com Committed: Fri Jul 31 12:17:30 2015 +0200 -- .../dynamic_function_interface/dyn_type.c | 234 --- .../dynamic_function_interface/dyn_type.h | 30 +- .../json_serializer.c | 407 +++ .../json_serializer.h | 8 +- .../tst/json_serializer_tests.cpp | 265 ++-- 5 files changed, 765 insertions(+), 179 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/24d13f2e/remote_services/dynamic_function_interface/dyn_type.c -- diff --git a/remote_services/dynamic_function_interface/dyn_type.c b/remote_services/dynamic_function_interface/dyn_type.c index f90f432..6de9736 100644 --- a/remote_services/dynamic_function_interface/dyn_type.c +++ b/remote_services/dynamic_function_interface/dyn_type.c @@ -47,43 +47,45 @@ static void dynType_printTypes(dyn_type *type, FILE *stream); static void dynType_printComplexType(dyn_type *type, FILE *stream); static void dynType_printSimpleType(dyn_type *type, FILE *stream); +static int dynType_parseText(FILE *stream, dyn_type *type); + struct generic_sequence { uint32_t cap; uint32_t len; void *buf; }; -static const int DT_OK = 0; -static const int DT_ERROR = 1; -static const int DT_MEM_ERROR = 2; -static const int DT_PARSE_ERROR = 3; +static const int OK = 0; +static const int ERROR = 1; +static const int MEM_ERROR = 2; +static const int PARSE_ERROR = 3; int dynType_parse(FILE *descriptorStream, const char *name, struct reference_types_head *refTypes, dyn_type **type) { return dynType_parseWithStream(descriptorStream, name, NULL, refTypes, type); } int dynType_parseWithStr(const char *descriptor, const char *name, struct reference_types_head *refTypes, dyn_type **type) { -int status = DT_OK; +int status = OK; FILE *stream = fmemopen((char *)descriptor, strlen(descriptor), r); if (stream != NULL) { status = dynType_parseWithStream(stream, name, NULL, refTypes, type); -if (status == DT_OK) { +if (status == OK) { int c = fgetc(stream); if (c != '\0' c != EOF) { -status = DT_PARSE_ERROR; +status = PARSE_ERROR; LOG_ERROR(Expected EOF got %c, c); } } fclose(stream); } else { -status = DT_ERROR; +status = ERROR; LOG_ERROR(Error creating mem stream for descriptor string. %s, strerror(errno)); } return status; } static int dynType_parseWithStream(FILE *stream, const char *name, dyn_type *parent, struct reference_types_head *refTypes, dyn_type **result) { -int status = DT_OK; +int status = OK; dyn_type *type = calloc(1, sizeof(*type)); if (type != NULL) { type-parent = parent; @@ -93,33 +95,33 @@ static int dynType_parseWithStream(FILE *stream, const char *name, dyn_type *par if (name != NULL) { type-name = strdup(name); if (type-name == NULL) { -status = DT_MEM_ERROR; +status = MEM_ERROR; LOG_ERROR(Error strdup'ing name '%s'\n, name); } } -if (status == DT_OK) { +if (status == OK) { status = dynType_parseAny(stream, type); } -if (status == DT_OK) { +if (status == OK) { *result = type; } else { dynType_destroy(type); } } else { -status = DT_MEM_ERROR; +status = MEM_ERROR; LOG_ERROR(Error allocating memory for type); } return status; } static int dynType_parseAny(FILE *stream, dyn_type *type) { -int status = DT_OK; +int status = OK; int c = fgetc(stream); switch(c) { case 'T' : status = dynType_parseNestedType(stream, type); -if (status == DT_OK) { +if (status == OK) { status = dynType_parseAny(stream, type); } break; @@ -138,6 +140,9 @@ static int dynType_parseAny(FILE *stream, dyn_type *type) { case '*' :
[4/5] celix git commit: CELIX-237: refactoring of dynType_print added FILE * as argument
CELIX-237: refactoring of dynType_print added FILE * as argument Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/9f2ea106 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/9f2ea106 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/9f2ea106 Branch: refs/heads/feature/CELIX-237_rsa-ffi Commit: 9f2ea106a553715e7e7fd1505ee135738b14adb4 Parents: 195c83d Author: Pepijn Noltes pepijnnol...@gmail.com Authored: Thu Jul 30 15:42:04 2015 +0200 Committer: Pepijn Noltes pepijnnol...@gmail.com Committed: Thu Jul 30 15:42:04 2015 +0200 -- .../dynamic_function_interface/dyn_type.c | 123 ++- .../dynamic_function_interface/dyn_type.h | 6 +- .../tst/dyn_type_tests.cpp | 8 +- 3 files changed, 72 insertions(+), 65 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/9f2ea106/remote_services/dynamic_function_interface/dyn_type.c -- diff --git a/remote_services/dynamic_function_interface/dyn_type.c b/remote_services/dynamic_function_interface/dyn_type.c index 720f929..f90f432 100644 --- a/remote_services/dynamic_function_interface/dyn_type.c +++ b/remote_services/dynamic_function_interface/dyn_type.c @@ -36,16 +36,16 @@ static int dynType_parseTypedPointer(FILE *stream, dyn_type *type); static void dynType_prepCif(ffi_type *type); static unsigned short dynType_getOffset(dyn_type *type, int index); -static void dynType_printAny(char *name, dyn_type *type, int depth); -static void dynType_printComplex(char *name, dyn_type *type, int depth); -static void dynType_printSequence(char *name, dyn_type *type, int depth); -static void dynType_printSimple(char *name, dyn_type *type, int depth); -static void dynType_printTypedPointer(char *name, dyn_type *type, int depth); -static void printDepth(int depth); +static void dynType_printAny(char *name, dyn_type *type, int depth, FILE *stream); +static void dynType_printComplex(char *name, dyn_type *type, int depth, FILE *stream); +static void dynType_printSequence(char *name, dyn_type *type, int depth, FILE *stream); +static void dynType_printSimple(char *name, dyn_type *type, int depth, FILE *stream); +static void dynType_printTypedPointer(char *name, dyn_type *type, int depth, FILE *stream); +static void dynType_printDepth(int depth, FILE *stream); -static void dynType_printTypes(dyn_type *type); -static void dynType_printComplexType(dyn_type *type); -static void dynType_printSimpleType(dyn_type *type); +static void dynType_printTypes(dyn_type *type, FILE *stream); +static void dynType_printComplexType(dyn_type *type, FILE *stream); +static void dynType_printSimpleType(dyn_type *type, FILE *stream); struct generic_sequence { uint32_t cap; @@ -442,7 +442,7 @@ int dynType_alloc(dyn_type *type, void **bufLoc) { *bufLoc = inst; } else { status = DT_MEM_ERROR; -//TODO log +LOG_ERROR(Error allocating memory for type '%c', type-descriptor); } return status; } @@ -515,6 +515,11 @@ int dynType_sequence_alloc(dyn_type *type, void *inst, int cap, void **out) { return status; } +void dynType_free(dyn_type *type, void *loc) { +//TODO +LOG_INFO(TODO); +} + int dynType_sequence_append(dyn_type *type, void *inst, void *in) { assert(type-type == DYN_TYPE_SEQUENCE); int status = DT_OK; @@ -653,99 +658,99 @@ int dynType_type(dyn_type *type) { return type-type; } -void dynType_print(dyn_type *type) { +void dynType_print(dyn_type *type, FILE *stream) { if (type != NULL) { -dynType_printTypes(type); +dynType_printTypes(type, stream); -printf(main type:\n); -dynType_printAny(root, type, 0); +fprintf(stream, main type:\n); +dynType_printAny(root, type, 0, stream); } else { -printf(invalid type\n); +fprintf(stream, invalid type\n); } } -static void printDepth(int depth) { +static void dynType_printDepth(int depth, FILE *stream) { int i; for (i = 0; i depth; i +=1 ) { -printf(\t); +fprintf(stream, \t); } } -static void dynType_printAny(char *name, dyn_type *type, int depth) { +static void dynType_printAny(char *name, dyn_type *type, int depth, FILE *stream) { dyn_type *toPrint = type; if (toPrint-type == DYN_TYPE_REF) { toPrint = toPrint-ref.ref; } switch(toPrint-type) { case DYN_TYPE_COMPLEX : -dynType_printComplex(name, toPrint, depth); +dynType_printComplex(name, toPrint, depth, stream); break; case DYN_TYPE_SIMPLE : -dynType_printSimple(name, toPrint, depth); +dynType_printSimple(name, toPrint, depth, stream);
celix git commit: CELIX-237: Implemented client server test and needed changes to get that working. There is still an issue in the export_registration
Repository: celix Updated Branches: refs/heads/feature/CELIX-237_rsa-ffi fa527209f - 7dc2039f1 CELIX-237: Implemented client server test and needed changes to get that working. There is still an issue in the export_registration Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/7dc2039f Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/7dc2039f Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/7dc2039f Branch: refs/heads/feature/CELIX-237_rsa-ffi Commit: 7dc2039f11b6fc3505ce2677ad2a59bfdb423d1f Parents: fa52720 Author: Pepijn Noltes pepijnnol...@gmail.com Authored: Tue Aug 11 20:18:15 2015 +0200 Committer: Pepijn Noltes pepijnnol...@gmail.com Committed: Tue Aug 11 20:18:15 2015 +0200 -- launcher/private/src/main.c | 8 +- remote_services/CMakeLists.txt | 1 + .../remote_service_admin_dfi/CMakeLists.txt | 2 +- .../dynamic_function_interface/dyn_function.c | 2 + .../dynamic_function_interface/dyn_type.c | 16 +-- .../json_serializer.c | 6 +- .../json_serializer.h | 1 + .../tst/dyn_function_tests.cpp | 7 +- .../private/include/import_registration_dfi.h | 5 + .../private/src/export_registration_dfi.c | 81 --- .../private/src/import_registration_dfi.c | 135 --- .../private/src/remote_service_admin_dfi.c | 38 ++ .../remote_service_admin_dfi/tst/CMakeLists.txt | 4 +- .../tst/bundle/CMakeLists.txt | 5 + .../tst/bundle/tst_activator.c | 86 +--- .../tst/bundle/tst_service.h| 2 +- .../tst/client.properties.in| 1 + .../tst/rsa_client_server_tests.cpp | 19 +-- .../tst/server.properties.in| 1 + 19 files changed, 296 insertions(+), 124 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/7dc2039f/launcher/private/src/main.c -- diff --git a/launcher/private/src/main.c b/launcher/private/src/main.c index 82530e1..90e5612 100644 --- a/launcher/private/src/main.c +++ b/launcher/private/src/main.c @@ -63,9 +63,11 @@ int main(int argc, char *argv[]) { // Set signal handler (void) signal(SIGINT, shutdown_framework); -celixLauncher_launch(config_file, framework); -celixLauncher_waitForShutdown(framework); -celixLauncher_destroy(framework); +int rc = celixLauncher_launch(config_file, framework); +if (rc == 0) { +celixLauncher_waitForShutdown(framework); +celixLauncher_destroy(framework); +} } static void show_usage(char* prog_name) { http://git-wip-us.apache.org/repos/asf/celix/blob/7dc2039f/remote_services/CMakeLists.txt -- diff --git a/remote_services/CMakeLists.txt b/remote_services/CMakeLists.txt index abc9177..f39b604 100644 --- a/remote_services/CMakeLists.txt +++ b/remote_services/CMakeLists.txt @@ -39,6 +39,7 @@ if (REMOTE_SERVICE_ADMIN) add_subdirectory(remote_service_admin) add_subdirectory(remote_service_admin_http) +add_subdirectory(remote_service_admin_dfi/tst/bundle) add_subdirectory(remote_service_admin_dfi) add_subdirectory(remote_service_admin_shm) http://git-wip-us.apache.org/repos/asf/celix/blob/7dc2039f/remote_services/remote_service_admin_dfi/CMakeLists.txt -- diff --git a/remote_services/remote_service_admin_dfi/CMakeLists.txt b/remote_services/remote_service_admin_dfi/CMakeLists.txt index b7a66f3..83dfc41 100644 --- a/remote_services/remote_service_admin_dfi/CMakeLists.txt +++ b/remote_services/remote_service_admin_dfi/CMakeLists.txt @@ -44,7 +44,7 @@ if (RSA_REMOTE_SERVICE_ADMIN_DFI) SET_HEADER(BUNDLE_SYMBOLICNAME apache_celix_remote_service_admin_dfi) SET(BUNDLE_VERSION 0.0.1) -SET_HEADERS(Bundle-Name: Apache Celix Remote Service Admin HTTP for dynamic function interface) +SET_HEADERS(Bundle-Name: Apache Celix Remote Service Admin Dynamic Function Interface (DFI)) bundle(remote_service_admin_dfi SOURCES private/src/remote_service_admin_dfi.c http://git-wip-us.apache.org/repos/asf/celix/blob/7dc2039f/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_function.c -- diff --git a/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_function.c b/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_function.c index f80d26f..af3902c 100644 ---
celix git commit: CELIX-237: fixed an issue in dfi export services and fixed an import.
Repository: celix Updated Branches: refs/heads/feature/CELIX-237_rsa-ffi 7dc2039f1 - 4c4a5e9bd CELIX-237: fixed an issue in dfi export services and fixed an import. - Added dummy access to ptr in export_registration to force full mem initialization for modern unix (linux osx) systems - remove incorrect ffi-x86.. import Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/4c4a5e9b Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/4c4a5e9b Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/4c4a5e9b Branch: refs/heads/feature/CELIX-237_rsa-ffi Commit: 4c4a5e9bd064e60b0d6d1569a4208d4c3276c669 Parents: 7dc2039 Author: Pepijn Noltes pepijnnol...@gmail.com Authored: Tue Aug 11 20:52:58 2015 +0200 Committer: Pepijn Noltes pepijnnol...@gmail.com Committed: Tue Aug 11 20:52:58 2015 +0200 -- .../dynamic_function_interface/dyn_function.c| 8 .../private/src/export_registration_dfi.c| 6 ++ 2 files changed, 6 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/4c4a5e9b/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_function.c -- diff --git a/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_function.c b/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_function.c index af3902c..0e12791 100644 --- a/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_function.c +++ b/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_function.c @@ -3,18 +3,10 @@ */ #include dyn_function.h -#include stdio.h -#include stdarg.h #include strings.h -#include string.h #include stdlib.h -#include ffi.h -#include ffi-x86_64.h - #include dyn_common.h -#include dyn_type.h -#include dfi_log_util.h struct _dyn_function_type { char *name; http://git-wip-us.apache.org/repos/asf/celix/blob/4c4a5e9b/remote_services/remote_service_admin_dfi/private/src/export_registration_dfi.c -- diff --git a/remote_services/remote_service_admin_dfi/private/src/export_registration_dfi.c b/remote_services/remote_service_admin_dfi/private/src/export_registration_dfi.c index 0713efb..74512d3 100644 --- a/remote_services/remote_service_admin_dfi/private/src/export_registration_dfi.c +++ b/remote_services/remote_service_admin_dfi/private/src/export_registration_dfi.c @@ -162,6 +162,12 @@ celix_status_t exportRegistration_call(export_registration_pt export, char *data void *out = NULL; dynType_alloc(lastType, out); //TODO, NOTE only for simple types or single pointer types.. TODO check + +//NOTE !! Need to access out, else it is a dummy pointer which will result in errors. +char b; +memcpy(b, out, 1); + +dynType_alloc(lastType, out); //TODO, NOTE only for simple types or single pointer types.. TODO check printf(out ptr is %p value is %f\n, out, *(double *)out); args[nrOfArgs-1] = out; //NOTE for simple type no double
[3/3] celix git commit: CELIX-237: A lot of work on the rsa dfi bundle and some needed refactoring for the remote_service_admin setup to support an non proxy approach.
CELIX-237: A lot of work on the rsa dfi bundle and some needed refactoring for the remote_service_admin setup to support an non proxy approach. - Fixed issue in launcher (cleared curl to soon) - update service registry/registration so that error status for the factory will be returned. - Fixed issue in log_factory, concerning a wrong assumption of the provided struct. - Added rpath for the launcher. Have to see if this works with install, but for now this make running deployment from ide (clion) possible. Just set the workdir to the deploy location and use celix as executable - Removed schema properties from calculator example - Created a generic export/import_registration header for the (OSGi) generic api - Moved some export/import_registration/reference code the import/export_registration source files - Small updated to dfi for additional getters - Updated rsa_dfi. rsa_dfi now creates a proxy based on dfi and also dfi for export - Added rsa_dfi cpputest Note: Still alot of work is needed in the dfi. Also rsa etcd deployment has problem. shm not tested, cfg works fine. Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/da86474f Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/da86474f Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/da86474f Branch: refs/heads/feature/CELIX-237_rsa-ffi Commit: da86474fb187707d8443a3aeb30ac965b74b1d43 Parents: 55e75be Author: Pepijn Noltes pepijnnol...@gmail.com Authored: Fri Aug 7 16:19:05 2015 +0200 Committer: Pepijn Noltes pepijnnol...@gmail.com Committed: Fri Aug 7 16:19:05 2015 +0200 -- framework/private/src/service_registration.c|5 +- framework/private/src/service_registry.c|2 +- launcher/CMakeLists.txt |4 + launcher/private/src/launcher.c | 29 +- log_service/private/src/log_factory.c |2 +- .../examples/calculator_service/CMakeLists.txt |5 +- apache.celix.calc.api.Calculator.descriptor | 11 + .../private/src/calculator_activator.c |1 - .../public/include/calculator_service.h | 25 - remote_services/examples/deploy.cmake | 40 +- .../private/include/export_registration_impl.h |3 - .../private/include/remote_service_admin_impl.h | 17 - .../private/src/export_registration_impl.c | 22 +- .../private/src/import_registration_impl.c | 17 + .../public/include/export_registration.h| 22 + .../public/include/import_registration.h| 22 + .../public/include/remote_service_admin.h |6 +- .../remote_service_admin_dfi/CMakeLists.txt | 21 +- .../dynamic_function_interface/CMakeLists.txt | 10 +- .../dynamic_function_interface/dyn_function.c | 31 +- .../dynamic_function_interface/dyn_function.h |5 +- .../dynamic_function_interface/dyn_interface.c | 22 + .../dynamic_function_interface/dyn_interface.h |9 +- .../dynamic_function_interface/dyn_type.c |2 + .../json_serializer.c | 21 +- .../json_serializer.h |3 + .../tst/dyn_function_tests.cpp | 29 + .../tst/dyn_interface_tests.cpp | 10 +- .../private/include/export_registration_dfi.h | 21 + .../private/include/import_registration_dfi.h | 20 + .../include/remote_service_admin_http_impl.h| 23 +- .../private/src/export_registration_dfi.c | 159 +++ .../private/src/import_registration_dfi.c | 231 .../src/remote_service_admin_activator.c|4 +- .../private/src/remote_service_admin_dfi.c | 783 + .../private/src/remote_service_admin_impl.c | 1085 -- .../remote_service_admin_dfi/tst/CMakeLists.txt | 18 +- .../tst/config.properties.in|3 +- .../remote_service_admin_dfi/tst/rsa_tests.cpp | 182 ++- .../private/src/remote_service_admin_impl.c | 129 +-- .../private/src/remote_service_admin_impl.c | 26 +- 41 files changed, 1734 insertions(+), 1346 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/da86474f/framework/private/src/service_registration.c -- diff --git a/framework/private/src/service_registration.c b/framework/private/src/service_registration.c index 8e84d1a..c7eb010 100644 --- a/framework/private/src/service_registration.c +++ b/framework/private/src/service_registration.c @@ -146,13 +146,14 @@ celix_status_t serviceRegistration_unregister(service_registration_pt registrati } celix_status_t serviceRegistration_getService(service_registration_pt registration, bundle_pt bundle, void **service) { + int status = CELIX_SUCCESS; if
[2/3] celix git commit: CELIX-237: A lot of work on the rsa dfi bundle and some needed refactoring for the remote_service_admin setup to support an non proxy approach.
http://git-wip-us.apache.org/repos/asf/celix/blob/da86474f/remote_services/remote_service_admin_dfi/private/src/remote_service_admin_dfi.c -- diff --git a/remote_services/remote_service_admin_dfi/private/src/remote_service_admin_dfi.c b/remote_services/remote_service_admin_dfi/private/src/remote_service_admin_dfi.c new file mode 100644 index 000..eae2816 --- /dev/null +++ b/remote_services/remote_service_admin_dfi/private/src/remote_service_admin_dfi.c @@ -0,0 +1,783 @@ +/** + *Licensed to the Apache Software Foundation (ASF) under one + *or more contributor license agreements. See the NOTICE file + *distributed with this work for additional information + *regarding copyright ownership. The ASF licenses this file + *to you under the Apache License, Version 2.0 (the + *License); you may not use this file except in compliance + *with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + *Unless required by applicable law or agreed to in writing, + *software distributed under the License is distributed on an + *AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + *specific language governing permissions and limitations + *under the License. + */ +/* + * remote_service_admin_impl.c + * + * \date May 21, 2015 + * \authora href=mailto:d...@celix.apache.org;Apache Celix Project Team/a + * \copyright Apache License, Version 2.0 + */ +#include stdio.h +#include stdlib.h + +#include arpa/inet.h +#include sys/socket.h +#include netdb.h +#include ifaddrs.h +#include stdio.h +#include stdlib.h +#include unistd.h +#include string.h +#include uuid/uuid.h +#include curl/curl.h +#include sys/queue.h + +#include jansson.h + +#include import_registration_dfi.h +#include export_registration_dfi.h +#include dyn_interface.h + +#include remote_service_admin.h +#include remote_constants.h +#include constants.h +#include utils.h +#include bundle_context.h +#include bundle.h +#include service_reference.h +#include service_registration.h +#include log_helper.h +#include log_service.h +#include celix_threads.h +#include civetweb.h +#include log_helper.h +#include endpoint_description.h +#include dyn_interface.h +#include json_serializer.h + +// defines how often the webserver is restarted (with an increased port number) +#define MAX_NUMBER_OF_RESTARTS 5 + +struct remote_service_admin { +bundle_context_pt context; +log_helper_pt loghelper; + +celix_thread_mutex_t exportedServicesLock; +hash_map_pt exportedServices; + +celix_thread_mutex_t importedServicesLock; +hash_map_pt importedServices; + +char *port; +char *ip; + +struct mg_context *ctx; +}; + +struct post { +const char *readptr; +int size; +}; + +struct get { +char *writeptr; +int size; +}; + +#define OSGI_RSA_REMOTE_PROXY_FACTORY remote_proxy_factory +#define OSGI_RSA_REMOTE_PROXY_TIMEOUT remote_proxy_timeout + +static const char *data_response_headers = +HTTP/1.1 200 OK\r\n +Cache: no-cache\r\n +Content-Type: application/json\r\n +\r\n; + +static const char *no_content_response_headers = +HTTP/1.1 204 OK\r\n; + +// TODO do we need to specify a non-Amdatu specific configuration type?! +static const char * const CONFIGURATION_TYPE = org.amdatu.remote.admin.http; +static const char * const ENDPOINT_URL = org.amdatu.remote.admin.http.url; + +static const char *DEFAULT_PORT = ; +static const char *DEFAULT_IP = 127.0.0.1; + +static const unsigned int DEFAULT_TIMEOUT = 0; + +static int remoteServiceAdmin_callback(struct mg_connection *conn); + +static celix_status_t remoteServiceAdmin_createEndpointDescription(remote_service_admin_pt admin, service_reference_pt reference, char *interface, endpoint_description_pt *description); + +static celix_status_t remoteServiceAdmin_getIpAdress(char* interface, char** ip); + +static size_t remoteServiceAdmin_readCallback(void *ptr, size_t size, size_t nmemb, void *userp); +static size_t remoteServiceAdmin_write(void *contents, size_t size, size_t nmemb, void *userp); +static void remoteServiceAdmin_log(remote_service_admin_pt admin, int level, const char *file, int line, const char *msg, ...); + +celix_status_t remoteServiceAdmin_create(bundle_context_pt context, remote_service_admin_pt *admin) { +celix_status_t status = CELIX_SUCCESS; + +*admin = calloc(1, sizeof(**admin)); + +if (!*admin) { +status = CELIX_ENOMEM; +} else { +unsigned int port_counter = 0; +char *port = NULL; +char *ip = NULL; +char *detectedIp = NULL; +(*admin)-context = context; +(*admin)-exportedServices = hashMap_create(NULL, NULL, NULL, NULL); +(*admin)-importedServices = hashMap_create(NULL, NULL, NULL, NULL); + +
[1/3] celix git commit: CELIX-237: Updated celix launcher so that mutiple embedded framework can be started (e.g. testing client / server rsa)
Repository: celix Updated Branches: refs/heads/feature/CELIX-237_rsa-ffi 87f3fabf7 - da86474fb CELIX-237: Updated celix launcher so that mutiple embedded framework can be started (e.g. testing client / server rsa) Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/55e75be7 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/55e75be7 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/55e75be7 Branch: refs/heads/feature/CELIX-237_rsa-ffi Commit: 55e75be72c24a62818fe3e2326c396725f1d7557 Parents: 87f3fab Author: Pepijn Noltes pepijnnol...@gmail.com Authored: Thu Aug 6 13:27:13 2015 +0200 Committer: Pepijn Noltes pepijnnol...@gmail.com Committed: Thu Aug 6 13:27:13 2015 +0200 -- framework/private/src/framework.c | 2 + launcher/private/src/launcher.c | 46 ++-- launcher/private/src/main.c | 24 ++ launcher/public/include/launcher.h | 12 ++--- .../remote_service_admin_dfi/tst/rsa_tests.cpp | 24 ++ .../remote_service_admin_dfi/tst/run_tests.cpp | 17 6 files changed, 62 insertions(+), 63 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/55e75be7/framework/private/src/framework.c -- diff --git a/framework/private/src/framework.c b/framework/private/src/framework.c index 3f49cdc..6e6e1ba 100644 --- a/framework/private/src/framework.c +++ b/framework/private/src/framework.c @@ -335,6 +335,8 @@ celix_status_t framework_destroy(framework_pt framework) { celixThreadMutex_destroy(framework-mutex); celixThreadCondition_destroy(framework-condition); +properties_destroy(framework-configurationMap); + free(framework); return status; http://git-wip-us.apache.org/repos/asf/celix/blob/55e75be7/launcher/private/src/launcher.c -- diff --git a/launcher/private/src/launcher.c b/launcher/private/src/launcher.c index 9c021ed..432c709 100644 --- a/launcher/private/src/launcher.c +++ b/launcher/private/src/launcher.c @@ -32,23 +32,22 @@ #include libgen.h #include signal.h +#ifndef CELIX_NO_CURLINIT #include curl/curl.h +#endif #include framework.h #include linked_list_iterator.h -static struct framework * framework; -static properties_pt config; - #ifdef WITH_APR static apr_pool_t *memoryPool; #endif -int celixLauncher_launch(const char *configFile) { +int celixLauncher_launch(const char *configFile, framework_pt *framework) { int status = 0; FILE *config = fopen(configFile, r); if (config != NULL) { -status = celixLauncher_launchWithStream(config); +status = celixLauncher_launchWithStream(config, framework); } else { fprintf(stderr, Error: invalid or non-existing configuration file: '%s'., configFile); perror(); @@ -57,10 +56,10 @@ int celixLauncher_launch(const char *configFile) { return status; } -int celixLauncher_launchWithStream(FILE *stream) { +int celixLauncher_launchWithStream(FILE *stream, framework_pt *framework) { int status = 0; -config = properties_loadWithStream(stream); +properties_pt config = properties_loadWithStream(stream); fclose(stream); // Make sure we've read it and that nothing went wrong with the file access... if (config == NULL) { @@ -69,14 +68,16 @@ int celixLauncher_launchWithStream(FILE *stream) { status = 1; } -// Set signal handler + #ifdef WITH_APR apr_status_t rv; apr_status_t s; #endif +#ifndef CELIX_NO_CURLINIT // Before doing anything else, let's setup Curl curl_global_init(CURL_GLOBAL_NOTHING); +#endif #ifdef WITH_APR rv = apr_initialize(); @@ -93,19 +94,18 @@ int celixLauncher_launchWithStream(FILE *stream) { if (status == 0) { char *autoStart = properties_get(config, cosgi.auto.start.1); -framework = NULL; celix_status_t status; #ifdef WITH_APR -status = framework_create(framework, memoryPool, config); +status = framework_create(framework, memoryPool, config); #else -status = framework_create(framework, config); +status = framework_create(framework, config); #endif bundle_pt fwBundle = NULL; if (status == CELIX_SUCCESS) { -status = fw_init(framework); +status = fw_init(*framework); if (status == CELIX_SUCCESS) { // Start the system bundle -framework_getFrameworkBundle(framework, fwBundle); +framework_getFrameworkBundle(*framework, fwBundle); bundle_start(fwBundle); char delims[] = ; @@ -128,7 +128,7 @@ int
celix git commit: CELIX-237: Added setup for client - server ccputest. This test start two embedded Celix frameworks for remote services test
Repository: celix Updated Branches: refs/heads/feature/CELIX-237_rsa-ffi da86474fb - 30f7e8419 CELIX-237: Added setup for client - server ccputest. This test start two embedded Celix frameworks for remote services test Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/30f7e841 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/30f7e841 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/30f7e841 Branch: refs/heads/feature/CELIX-237_rsa-ffi Commit: 30f7e8419c28d085e7e782a7dcd6828c1eb79e3f Parents: da86474 Author: Pepijn Noltes pepijnnol...@gmail.com Authored: Mon Aug 10 22:07:15 2015 +0200 Committer: Pepijn Noltes pepijnnol...@gmail.com Committed: Mon Aug 10 22:07:15 2015 +0200 -- remote_services/CMakeLists.txt | 7 +- .../private/src/endpoint_discovery_poller.c | 5 +- .../examples/calculator_service/CMakeLists.txt | 2 +- apache.celix.calc.api.Calculator.descriptor | 11 -- ...apache.celix.calc.api.Calculator2.descriptor | 11 ++ .../examples/calculator_shell/CMakeLists.txt| 4 + .../dynamic_function_interface/dyn_type.h | 6 +- .../private/include/export_registration_dfi.h | 2 +- .../private/src/export_registration_dfi.c | 131 +++ .../private/src/import_registration_dfi.c | 12 +- .../private/src/remote_service_admin_dfi.c | 32 + .../remote_service_admin_dfi/tst/CMakeLists.txt | 52 +--- .../tst/bundle/CMakeLists.txt | 20 +++ .../tst/bundle/tst_activator.c | 91 + .../tst/bundle/tst_service.h| 17 +++ .../tst/client.properties.in| 7 + .../tst/config.properties.in| 3 +- .../tst/rsa_client_server_tests.cpp | 118 + .../remote_service_admin_dfi/tst/rsa_tests.cpp | 28 +++- .../tst/server.properties.in| 7 + 20 files changed, 464 insertions(+), 102 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/30f7e841/remote_services/CMakeLists.txt -- diff --git a/remote_services/CMakeLists.txt b/remote_services/CMakeLists.txt index a16977f..abc9177 100644 --- a/remote_services/CMakeLists.txt +++ b/remote_services/CMakeLists.txt @@ -33,14 +33,15 @@ if (REMOTE_SERVICE_ADMIN) add_subdirectory(topology_manager) +add_subdirectory(discovery_configured) +add_subdirectory(discovery_etcd) +add_subdirectory(discovery_shm) + add_subdirectory(remote_service_admin) add_subdirectory(remote_service_admin_http) add_subdirectory(remote_service_admin_dfi) add_subdirectory(remote_service_admin_shm) -add_subdirectory(discovery_configured) -add_subdirectory(discovery_etcd) -add_subdirectory(discovery_shm) endif (REMOTE_SERVICE_ADMIN) http://git-wip-us.apache.org/repos/asf/celix/blob/30f7e841/remote_services/discovery/private/src/endpoint_discovery_poller.c -- diff --git a/remote_services/discovery/private/src/endpoint_discovery_poller.c b/remote_services/discovery/private/src/endpoint_discovery_poller.c index 569d7a9..d8c16a5 100644 --- a/remote_services/discovery/private/src/endpoint_discovery_poller.c +++ b/remote_services/discovery/private/src/endpoint_discovery_poller.c @@ -325,6 +325,8 @@ static size_t endpointDiscoveryPoller_writeMemory(void *contents, size_t size, s static celix_status_t endpointDiscoveryPoller_getEndpoints(endpoint_discovery_poller_pt poller, char *url, array_list_pt *updatedEndpoints) { celix_status_t status = CELIX_SUCCESS; + logHelper_log(*poller-loghelper, OSGI_LOGSERVICE_DEBUG, Polling url '%s', url); + CURL *curl = NULL; CURLcode res = CURLE_OK; @@ -349,6 +351,7 @@ static celix_status_t endpointDiscoveryPoller_getEndpoints(endpoint_discovery_po status = endpointDescriptorReader_create(poller, reader); if (status == CELIX_SUCCESS) { + logHelper_log(*poller-loghelper, OSGI_LOGSERVICE_DEBUG, Polled data '%s', chunk.memory); status = endpointDescriptorReader_parseDocument(reader, chunk.memory, updatedEndpoints); } @@ -356,7 +359,7 @@ static celix_status_t endpointDiscoveryPoller_getEndpoints(endpoint_discovery_po endpointDescriptorReader_destroy(reader); } } else { - logHelper_log(*poller-loghelper, OSGI_LOGSERVICE_ERROR, ENDPOINT_POLLER: unable to read endpoints, reason: %s, curl_easy_strerror(res)); + logHelper_log(*poller-loghelper, OSGI_LOGSERVICE_ERROR, ENDPOINT_POLLER: unable to read endpoints at '%s', reason: %s, url, curl_easy_strerror(res)); }
celix git commit: CELIX-237: Added support for argument meta info (output types) and added use of this info in the export_registration
Repository: celix Updated Branches: refs/heads/feature/CELIX-237_rsa-ffi 4c4a5e9bd - 62ede189c CELIX-237: Added support for argument meta info (output types) and added use of this info in the export_registration Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/62ede189 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/62ede189 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/62ede189 Branch: refs/heads/feature/CELIX-237_rsa-ffi Commit: 62ede189c0e5cbc32b1a29256f3c109e8acef02c Parents: 4c4a5e9 Author: Pepijn Noltes pepijnnol...@gmail.com Authored: Wed Aug 12 18:16:08 2015 +0200 Committer: Pepijn Noltes pepijnnol...@gmail.com Committed: Wed Aug 12 18:16:08 2015 +0200 -- ...apache.celix.calc.api.Calculator2.descriptor | 6 +- .../dynamic_function_interface/dyn_function.c | 114 +-- .../dynamic_function_interface/dyn_function.h | 15 ++- .../dynamic_function_interface/dyn_type.c | 13 ++- .../tst/dyn_function_tests.cpp | 55 - .../private/src/export_registration_dfi.c | 81 - 6 files changed, 238 insertions(+), 46 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/62ede189/remote_services/examples/calculator_service/public/include/org.apache.celix.calc.api.Calculator2.descriptor -- diff --git a/remote_services/examples/calculator_service/public/include/org.apache.celix.calc.api.Calculator2.descriptor b/remote_services/examples/calculator_service/public/include/org.apache.celix.calc.api.Calculator2.descriptor index 711df0b..52e3322 100644 --- a/remote_services/examples/calculator_service/public/include/org.apache.celix.calc.api.Calculator2.descriptor +++ b/remote_services/examples/calculator_service/public/include/org.apache.celix.calc.api.Calculator2.descriptor @@ -6,6 +6,6 @@ version=1.0.0 classname=org.example.Calculator :types :methods -add(DD)D=add(PDD*D)N -sub(DD)D=sub(PDD*D)N -sqrt(D)D=sqrt(PD*D)N +add(DD)D=add(#PDD^*D)N +sub(DD)D=sub(#PDD^*D)N +sqrt(D)D=sqrt(#PD^*D)N http://git-wip-us.apache.org/repos/asf/celix/blob/62ede189/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_function.c -- diff --git a/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_function.c b/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_function.c index 0e12791..8880bc7 100644 --- a/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_function.c +++ b/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_function.c @@ -27,6 +27,7 @@ typedef struct _dyn_function_argument_type dyn_function_argument_type; struct _dyn_function_argument_type { int index; char *name; +int argumentType; dyn_type *type; TAILQ_ENTRY(_dyn_function_argument_type) entries; }; @@ -40,7 +41,11 @@ DFI_SETUP_LOG(dynFunction) static int dynFunction_initCif(dyn_function_type *dynFunc); static int dynFunction_parseDescriptor(dyn_function_type *dynFunc, FILE *descriptor); -static void dynFunction_ffiBind(ffi_cif *cif, void *ret, void *args[], void *userData); +static void dynFunction_ffiBind(ffi_cif *cif, void *ret, void *args[], void *userData); + +static int dynFunction_checkArgument(dyn_function_argument_type *argument); + +static void dynFunction_parseArgMeta(FILE *descriptor, int *meta); int dynFunction_parse(FILE *descriptor, struct types_head *refTypes, dyn_function_type **out) { int status = OK; @@ -67,7 +72,12 @@ int dynFunction_parse(FILE *descriptor, struct types_head *refTypes, dyn_functio if (status == 0) { *out = dynFunc; -} +}else { +if (dynFunc != NULL) { +dynFunction_destroy(dynFunc); +} + +} return status; } @@ -106,22 +116,50 @@ static int dynFunction_parseDescriptor(dyn_function_type *dynFunc, FILE *descrip int nextChar = fgetc(descriptor); int index = 0; dyn_type *type = NULL; +int argMetaInfo = DYN_FUNCTION_ARG_META_STD_TYPE; +char argName[32]; while (nextChar != ')' status == 0) { -type = NULL; ungetc(nextChar, descriptor); -status = dynType_parse(descriptor, NULL, dynFunc-refTypes, type); +type = NULL; + +dynFunction_parseArgMeta(descriptor, argMetaInfo); +dyn_function_argument_type *arg = NULL; + +status = dynType_parse(descriptor, NULL, dynFunc-refTypes, type); if (status == 0) { -dyn_function_argument_type *arg = calloc(1, sizeof(*arg)); -arg-index = index++; -arg-type = type; -arg-name = NULL; //TODO +
celix git commit: CELIX-237: dyn_interface now parses types and methods sections
Repository: celix Updated Branches: refs/heads/feature/CELIX-237_rsa-ffi 723d5aed0 - f1252e248 CELIX-237: dyn_interface now parses types and methods sections Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/f1252e24 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/f1252e24 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/f1252e24 Branch: refs/heads/feature/CELIX-237_rsa-ffi Commit: f1252e248bb100e04412c836b2bdf84d5fd3673a Parents: 723d5ae Author: Pepijn Noltes pepijnnol...@gmail.com Authored: Tue Jul 14 21:56:18 2015 +0200 Committer: Pepijn Noltes pepijnnol...@gmail.com Committed: Tue Jul 14 21:56:18 2015 +0200 -- .../descriptors/example1.descriptor | 11 +- .../dynamic_function_interface/dyn_common.c | 26 ++- .../dynamic_function_interface/dyn_common.h | 3 + .../dynamic_function_interface/dyn_function.c | 27 ++- .../dynamic_function_interface/dyn_function.h | 4 +- .../dynamic_function_interface/dyn_interface.c | 229 ++- .../dynamic_function_interface/dyn_interface.h | 31 ++- .../dynamic_function_interface/dyn_type.c | 39 ++-- .../dynamic_function_interface/dyn_type.h | 18 +- .../tst/dyn_closure_tests.cpp | 4 + .../tst/dyn_interface_tests.cpp | 8 +- 11 files changed, 277 insertions(+), 123 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/f1252e24/remote_services/dynamic_function_interface/descriptors/example1.descriptor -- diff --git a/remote_services/dynamic_function_interface/descriptors/example1.descriptor b/remote_services/dynamic_function_interface/descriptors/example1.descriptor index 251219a..a0eacfa 100644 --- a/remote_services/dynamic_function_interface/descriptors/example1.descriptor +++ b/remote_services/dynamic_function_interface/descriptors/example1.descriptor @@ -5,10 +5,9 @@ major_version=1 minor_version=0 micro_version=0 :types -StatResult={DDD[D average min max input} +StatsResult={DDD[D average min max input} :methods -add(PDD*D)N -sub(PDD*D)N -sqrt(PD*D)N -stats(P[D*LStatsResult;)N - +add(DD)D=add(PDD*D)N +sub(DD)D=sub(PDD*D)N +sqrt(D)D=sqrt(PD*D)N +stats([D)LStatsResult;=stats(P[D*LStatsResult;)N http://git-wip-us.apache.org/repos/asf/celix/blob/f1252e24/remote_services/dynamic_function_interface/dyn_common.c -- diff --git a/remote_services/dynamic_function_interface/dyn_common.c b/remote_services/dynamic_function_interface/dyn_common.c index 05844ef..5ee1a5a 100644 --- a/remote_services/dynamic_function_interface/dyn_common.c +++ b/remote_services/dynamic_function_interface/dyn_common.c @@ -6,6 +6,7 @@ #include stdlib.h #include stdio.h #include ctype.h +#include stdbool.h #if defined(BSD) || defined(__APPLE__) #include open_memstream.h @@ -17,7 +18,13 @@ static const int ERROR = 1; DFI_SETUP_LOG(dynCommon) +static bool dynCommon_charIn(int c, const char *acceptedChars); + int dynCommon_parseName(FILE *stream, char **result) { +return dynCommon_parseNameAlsoAccept(stream, NULL, result); +} + +int dynCommon_parseNameAlsoAccept(FILE *stream, const char *acceptedChars, char **result) { int status = OK; char *buf = NULL; @@ -27,7 +34,7 @@ int dynCommon_parseName(FILE *stream, char **result) { if (name != NULL) { int c = getc(stream); -while (isalnum(c) || c == '_') { +while (isalnum(c) || c == '_' || dynCommon_charIn(c, acceptedChars)) { fputc(c, name); c = getc(stream); strLen += 1; @@ -83,7 +90,7 @@ int dynCommon_parseNameValue(FILE *stream, char **outName, char **outValue) { return status; } -int dynCommon_eatChar(FILE *stream, int expected) { +inline int dynCommon_eatChar(FILE *stream, int expected) { int status = OK; int c = fgetc(stream); if (c != expected) { @@ -92,3 +99,18 @@ int dynCommon_eatChar(FILE *stream, int expected) { } return status; } + +static bool dynCommon_charIn(int c, const char *acceptedChars) { +bool status = false; +if (acceptedChars != NULL) { +int i; +for (i = 0; acceptedChars[i] != '\0'; i += 1) { +if (c == acceptedChars[i]) { +status = true; +break; +} +} +} + +return status; +} http://git-wip-us.apache.org/repos/asf/celix/blob/f1252e24/remote_services/dynamic_function_interface/dyn_common.h -- diff --git a/remote_services/dynamic_function_interface/dyn_common.h b/remote_services/dynamic_function_interface/dyn_common.h index 16df6e2..163bafc 100644 ---
celix git commit: CELIX-237: Added needed test input
Repository: celix Updated Branches: refs/heads/feature/CELIX-237_rsa-ffi 3cc606e8e - 723d5aed0 CELIX-237: Added needed test input Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/723d5aed Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/723d5aed Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/723d5aed Branch: refs/heads/feature/CELIX-237_rsa-ffi Commit: 723d5aed08fac90ee48121259ebcc3ba649e070c Parents: 3cc606e Author: Pepijn Noltes pepijnnol...@gmail.com Authored: Sun Jul 12 22:10:32 2015 +0200 Committer: Pepijn Noltes pepijnnol...@gmail.com Committed: Sun Jul 12 22:10:32 2015 +0200 -- .../descriptors/example1.descriptor | 14 ++ 1 file changed, 14 insertions(+) -- http://git-wip-us.apache.org/repos/asf/celix/blob/723d5aed/remote_services/dynamic_function_interface/descriptors/example1.descriptor -- diff --git a/remote_services/dynamic_function_interface/descriptors/example1.descriptor b/remote_services/dynamic_function_interface/descriptors/example1.descriptor new file mode 100644 index 000..251219a --- /dev/null +++ b/remote_services/dynamic_function_interface/descriptors/example1.descriptor @@ -0,0 +1,14 @@ +:annotations +type=interface +name=calculator +major_version=1 +minor_version=0 +micro_version=0 +:types +StatResult={DDD[D average min max input} +:methods +add(PDD*D)N +sub(PDD*D)N +sqrt(PD*D)N +stats(P[D*LStatsResult;)N +
[3/5] celix git commit: CELIX-210: Added licence headers to source files.
CELIX-210: Added licence headers to source files. Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/b12c40ff Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/b12c40ff Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/b12c40ff Branch: refs/heads/feature/CELIX-269_depman Commit: b12c40ff2cd93163e3cd6a93af8c799d6f2d7f44 Parents: b2ed188 Author: Erjan AltenaAuthored: Fri Oct 16 16:44:27 2015 +0200 Committer: Pepijn Noltes Committed: Mon Oct 19 20:45:03 2015 +0200 -- dependency_manager/public/include/dm_server.h | 26 +- 1 file changed, 25 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/b12c40ff/dependency_manager/public/include/dm_server.h -- diff --git a/dependency_manager/public/include/dm_server.h b/dependency_manager/public/include/dm_server.h index fa8da78..15c87d5 100644 --- a/dependency_manager/public/include/dm_server.h +++ b/dependency_manager/public/include/dm_server.h @@ -1,4 +1,28 @@ - +/** + *Licensed to the Apache Software Foundation (ASF) under one + *or more contributor license agreements. See the NOTICE file + *distributed with this work for additional information + *regarding copyright ownership. The ASF licenses this file + *to you under the Apache License, Version 2.0 (the + *"License"); you may not use this file except in compliance + *with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + *Unless required by applicable law or agreed to in writing, + *software distributed under the License is distributed on an + *"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + *specific language governing permissions and limitations + *under the License. + */ +/* + * dm_server.h + * + * \date 15 Oct 2015 + * \author mailto:d...@celix.apache.org;>Apache Celix Project Team + * \copyright Apache License, Version 2.0 + */ #ifndef CELIX_DM_SERVICE_H #define CELIX_DM_SERVICE_H
[1/5] celix git commit: CELIX-210: Added Set fucntion to dependency manager and added bundle with shell command to get overview of the depenency-manages components
Repository: celix Updated Branches: refs/heads/feature/CELIX-269_depman cc6fd4322 -> 664845cac CELIX-210: Added Set fucntion to dependency manager and added bundle with shell command to get overview of the depenency-manages components Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/9203fddd Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/9203fddd Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/9203fddd Branch: refs/heads/feature/CELIX-269_depman Commit: 9203f03ebc787544863841069e621bdf7edb Parents: cc6fd43 Author: Erjan AltenaAuthored: Fri Oct 16 14:09:42 2015 +0200 Committer: Pepijn Noltes Committed: Mon Oct 19 20:44:30 2015 +0200 -- dependency_manager/CMakeLists.txt | 18 +++- .../private/include/dm_component_impl.h | 2 +- .../include/dm_dependency_manager_impl.h| 11 ++ .../private/include/dm_server_impl.h| 10 ++ .../include/dm_service_dependency_impl.h| 3 + .../private/include/dm_shell_list_command.h | 34 +++ .../private/src/dm_activator_base.c | 20 +++- .../private/src/dm_component_impl.c | 19 +++- .../private/src/dm_dependency_manager_impl.c| 6 +- dependency_manager/private/src/dm_server.c | 71 + .../private/src/dm_service_dependency.c | 66 +++- .../private/src/dm_shell_activator.c| 72 + .../private/src/dm_shell_list_command.c | 101 +++ .../public/include/dm_component.h | 4 +- dependency_manager/public/include/dm_server.h | 36 +++ .../public/include/dm_service_dependency.h | 6 +- examples/deploy.cmake | 2 +- .../publisherA/private/src/activator.c | 2 + .../publisherB/private/src/activator.c | 2 + .../tracker_depman/private/include/tracker.h| 4 +- .../private/src/dependency_activator.c | 18 ++-- .../tracker_depman/private/src/tracker.c| 27 - 22 files changed, 496 insertions(+), 38 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/9203fddd/dependency_manager/CMakeLists.txt -- diff --git a/dependency_manager/CMakeLists.txt b/dependency_manager/CMakeLists.txt index 6b76658..931dd3c 100644 --- a/dependency_manager/CMakeLists.txt +++ b/dependency_manager/CMakeLists.txt @@ -16,7 +16,10 @@ # under the License. celix_subproject(DEPENDENCY_MANAGER "Option to build the dependency manager static library" ON DEPS framework) -if (DEPENDENCY_MANAGER) +if (DEPENDENCY_MANAGER) +SET(BUNDLE_SYMBOLICNAME "apache_celix_dm_shell") +SET(BUNDLE_VERSION "0.0.1") +SET(BUNDLE_NAME "Apache Celix DM Shell commands") # Add -fPIC for x86_64 Unix platforms; this lib will be linked to a shared lib if(UNIX AND NOT WIN32) find_program(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin ) @@ -34,15 +37,22 @@ if (DEPENDENCY_MANAGER) DESCRIPTION "The Apache Celix dependency manager (static) library" GROUP all ) - +bundle(dm_shell SOURCES +private/src/dm_shell_activator +private/src/dm_shell_list_command +) add_library(dependency_manager STATIC private/src/dm_activator_base private/src/dm_component_impl private/src/dm_service_dependency private/src/dm_event - private/src/dm_dependency_manager_impl) + private/src/dm_dependency_manager_impl +private/src/dm_server +) + include_directories("public/include") include_directories("private/include") +include_directories("../shell/public/include") include_directories("${PROJECT_SOURCE_DIR}/utils/public/include") target_link_libraries(dependency_manager celix_framework) @@ -52,10 +62,12 @@ if (DEPENDENCY_MANAGER) public/include/dm_component.h public/include/dm_dependency_manager.h public/include/dm_service_dependency.h +public/include/dm_server.h DESTINATION include/celix/dependency_manager COMPONENT dependency_manager ) +install_bundle(dm_shell) install(TARGETS dependency_manager DESTINATION lib COMPONENT dependency_manager) endif (DEPENDENCY_MANAGER) http://git-wip-us.apache.org/repos/asf/celix/blob/9203fddd/dependency_manager/private/include/dm_component_impl.h -- diff --git a/dependency_manager/private/include/dm_component_impl.h b/dependency_manager/private/include/dm_component_impl.h index 133ef06..ad742b8
[2/5] celix git commit: CELIX-210: Added licence headers to source files.
CELIX-210: Added licence headers to source files. Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/b2ed1882 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/b2ed1882 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/b2ed1882 Branch: refs/heads/feature/CELIX-269_depman Commit: b2ed18827e6892bf5845a203fcaf7bab88c6eff2 Parents: 9203fdd Author: Erjan AltenaAuthored: Fri Oct 16 16:39:14 2015 +0200 Committer: Pepijn Noltes Committed: Mon Oct 19 20:44:59 2015 +0200 -- .../include/dm_dependency_manager_impl.h| 25 +++ .../private/include/dm_server_impl.h| 26 .../include/dm_service_dependency_impl.h| 2 +- .../private/include/dm_shell_list_command.h | 4 +-- .../private/src/dm_component_impl.c | 2 +- dependency_manager/private/src/dm_server.c | 26 .../private/src/dm_shell_activator.c| 26 .../private/src/dm_shell_list_command.c | 4 +-- 8 files changed, 109 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/b2ed1882/dependency_manager/private/include/dm_dependency_manager_impl.h -- diff --git a/dependency_manager/private/include/dm_dependency_manager_impl.h b/dependency_manager/private/include/dm_dependency_manager_impl.h index 8a0cae8..3c9db01 100644 --- a/dependency_manager/private/include/dm_dependency_manager_impl.h +++ b/dependency_manager/private/include/dm_dependency_manager_impl.h @@ -1,3 +1,28 @@ +/** + *Licensed to the Apache Software Foundation (ASF) under one + *or more contributor license agreements. See the NOTICE file + *distributed with this work for additional information + *regarding copyright ownership. The ASF licenses this file + *to you under the Apache License, Version 2.0 (the + *"License"); you may not use this file except in compliance + *with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + *Unless required by applicable law or agreed to in writing, + *software distributed under the License is distributed on an + *"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + *specific language governing permissions and limitations + *under the License. + */ +/* + * dm_dependency_manager_impl.h + * + * \date 15 Oct 2015 + * \author mailto:d...@celix.apache.org;>Apache Celix Project Team + * \copyright Apache License, Version 2.0 + */ #ifndef CELIX_DM_DEPENDENCY_MANAGER_IMPL_H #define CELIX_DM_DEPENDENCY_MANAGER_IMPL_H http://git-wip-us.apache.org/repos/asf/celix/blob/b2ed1882/dependency_manager/private/include/dm_server_impl.h -- diff --git a/dependency_manager/private/include/dm_server_impl.h b/dependency_manager/private/include/dm_server_impl.h index f54aece..117c561 100644 --- a/dependency_manager/private/include/dm_server_impl.h +++ b/dependency_manager/private/include/dm_server_impl.h @@ -1,3 +1,29 @@ +/** + *Licensed to the Apache Software Foundation (ASF) under one + *or more contributor license agreements. See the NOTICE file + *distributed with this work for additional information + *regarding copyright ownership. The ASF licenses this file + *to you under the Apache License, Version 2.0 (the + *"License"); you may not use this file except in compliance + *with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + *Unless required by applicable law or agreed to in writing, + *software distributed under the License is distributed on an + *"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + *specific language governing permissions and limitations + *under the License. + */ +/* + * dm_server_impl.h + * + * \date 16 Oct 2015 + * \author mailto:d...@celix.apache.org;>Apache Celix Project Team + * \copyright Apache License, Version 2.0 + */ + #include "dm_server.h" #include "dm_component.h" #include "dm_component_impl.h" http://git-wip-us.apache.org/repos/asf/celix/blob/b2ed1882/dependency_manager/private/include/dm_service_dependency_impl.h -- diff --git a/dependency_manager/private/include/dm_service_dependency_impl.h b/dependency_manager/private/include/dm_service_dependency_impl.h index 0f80cef..7f2a736 100644 --- a/dependency_manager/private/include/dm_service_dependency_impl.h +++
[4/5] celix git commit: CELIX-210: Fixed typo
CELIX-210: Fixed typo Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/01c19680 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/01c19680 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/01c19680 Branch: refs/heads/feature/CELIX-269_depman Commit: 01c19680a2a3dfdf65c9c10a2edc4d6491fc93cb Parents: b12c40f Author: Erjan AltenaAuthored: Fri Oct 16 16:51:00 2015 +0200 Committer: Pepijn Noltes Committed: Mon Oct 19 20:45:08 2015 +0200 -- dependency_manager/private/src/dm_component_impl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/01c19680/dependency_manager/private/src/dm_component_impl.c -- diff --git a/dependency_manager/private/src/dm_component_impl.c b/dependency_manager/private/src/dm_component_impl.c index bac73eb..801d426 100644 --- a/dependency_manager/private/src/dm_component_impl.c +++ b/dependency_manager/private/src/dm_component_impl.c @@ -120,7 +120,7 @@ celix_status_t component_create(bundle_context_pt context, dm_dependency_manager (*component)->state = DM_CMP_STATE_INACTIVE; (*component)->isStarted = false; -(*component)->active = a; +(*component)->active = false; (*component)->dependencyEvents = hashMap_create(NULL, NULL, NULL, NULL);
celix git commit: CELIX-279: Added missing end if (fi) to travis config
Repository: celix Updated Branches: refs/heads/develop 6a4da96e2 -> 3e4e9d23b CELIX-279: Added missing end if (fi) to travis config Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/3e4e9d23 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/3e4e9d23 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/3e4e9d23 Branch: refs/heads/develop Commit: 3e4e9d23b763a23edb8052807bd1752b9ef3a95d Parents: 6a4da96 Author: Pepijn NoltesAuthored: Mon Oct 26 20:42:54 2015 +0100 Committer: Pepijn Noltes Committed: Mon Oct 26 20:42:54 2015 +0100 -- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/3e4e9d23/.travis.yml -- diff --git a/.travis.yml b/.travis.yml index 52c81d8..d233897 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,7 +29,7 @@ script: # RSA_DISCOVERY_SHM is only working on linux, but both compilers (see CELIX-277) # RSA_SHM is only working on linux, but both compilers (see CELIX-277) - cd build -- if [ "$TRAVIS_OS_NAME" = "osx" ]; then export BUILD_OPTS="-DFFI_INCLUDE_DIR=/usr/local/lib/libffi-3.0.13/include -DFFI_LIBRARY=/usr/local/lib/libffi.dylib" +- if [ "$TRAVIS_OS_NAME" = "osx" ]; then export BUILD_OPTS="-DFFI_INCLUDE_DIR=/usr/local/lib/libffi-3.0.13/include -DFFI_LIBRARY=/usr/local/lib/libffi.dylib"; fi - if [ "$CC" = "clang" ] || [ "$TRAVIS_OS_NAME" = "osx" ]; then export BUILD_OPTS="${BUILD_OPTS}"; else export BUILD_OPTS="${BUILD_OPTS} -DBUILD_RSA_REMOTE_SERVICE_ADMIN_DFI=ON"; fi - if [ "$TRAVIS_OS_NAME" = "linux" ]; then cmake -DBUILD_DEPLOYMENT_ADMIN=ON -DBUILD_EXAMPLES=ON -DBUILD_LOG_SERVICE=ON -DBUILD_LOG_WRITER=ON -DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON -DBUILD_RSA_DISCOVERY_SHM=ON -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_SHM=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_SHELL=ON -DBUILD_SHELL_TUI=ON -DBUILD_DEVICE_ACCESS=ON -DBUILD_DEVICE_ACCESS_EXAMPLE=ON -DBUILD_FRAMEWORK_TESTS=OFF -DENABLE_CODE_COVERAGE=ON -DENABLE_TESTING=ON ${BUILD_OPTS} -DCMAKE_INSTALL_PREFIX=../install ..; fi - if [ "$TRAVIS_OS_NAME" = "osx" ]; then cmake -DBUILD_DEPLOYMENT_ADMIN=ON -DBUILD_EXAMPLES=ON -DBUILD_LOG_SERVICE=ON -DBUILD_LOG_WRITER=ON -DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON -DBUILD_RSA_DISCOVERY_SHM=OFF -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_SHM=OFF -DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_SHELL=ON -DBUILD_SHELL_TUI=ON -DBUILD_DEVICE_ACCESS=ON -DBUILD_DEVICE_ACCESS_EXAMPLE=ON -DBUILD_FRAMEWORK_TESTS=OFF -DENABLE_CODE_COVERAGE=ON -DENABLE_TESTING=ON -DFFI_LIBRARY=/usr/local/opt/libffi/lib/libffi.dylib ${BUILD_OPTS} -DCMAKE_INSTALL_PREFIX=../install ..; fi
[48/50] celix git commit: CELIX-190: fixed wrong initialization
CELIX-190: fixed wrong initialization Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/c58615d2 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/c58615d2 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/c58615d2 Branch: refs/heads/feature/CELIX-269_depman Commit: c58615d2ac73828c6f27c7d8916f281c437fb579 Parents: 4834283 Author: Bjoern PetriAuthored: Thu Oct 29 09:01:37 2015 +0100 Committer: Bjoern Petri Committed: Thu Oct 29 09:01:37 2015 +0100 -- remote_services/discovery/private/src/endpoint_discovery_poller.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/c58615d2/remote_services/discovery/private/src/endpoint_discovery_poller.c -- diff --git a/remote_services/discovery/private/src/endpoint_discovery_poller.c b/remote_services/discovery/private/src/endpoint_discovery_poller.c index 60a9236..ec0a1b3 100644 --- a/remote_services/discovery/private/src/endpoint_discovery_poller.c +++ b/remote_services/discovery/private/src/endpoint_discovery_poller.c @@ -242,7 +242,7 @@ celix_status_t endpointDiscoveryPoller_removeDiscoveryEndpoint(endpoint_discover celix_status_t endpointDiscoveryPoller_poll(endpoint_discovery_poller_pt poller, char *url, array_list_pt currentEndpoints) { - celix_status_t status = NULL; + celix_status_t status; array_list_pt updatedEndpoints = NULL; // create an arraylist with a custom equality test to ensure we can find endpoints properly...
[33/50] celix git commit: CELIX-279: added error message in case broken CMake Version is used
CELIX-279: added error message in case broken CMake Version is used Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/9550e630 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/9550e630 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/9550e630 Branch: refs/heads/feature/CELIX-269_depman Commit: 9550e630abd11c4b06ae76335a3c9c1f6403ce4b Parents: 4023f36 Author: Bjoern PetriAuthored: Sat Oct 24 09:02:10 2015 +0200 Committer: Bjoern Petri Committed: Sat Oct 24 09:02:10 2015 +0200 -- CMakeLists.txt | 6 ++ 1 file changed, 6 insertions(+) -- http://git-wip-us.apache.org/repos/asf/celix/blob/9550e630/CMakeLists.txt -- diff --git a/CMakeLists.txt b/CMakeLists.txt index dccee8d..78f5c1c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,12 @@ set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) set(CMAKE_INSTALL_NAME_DIR "@rpath") SET(CMAKE_BUILD_TYPE "Debug") + +# see https://public.kitware.com/Bug/view.php?id=15696 +IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} EQUAL 3.3) + message( FATAL_ERROR "Building Celix using CMake 3.3 is not supported due to a bug in the Makefile Generator (see Bug 15696). Please change the used CMake version - both, CMake 3.2 and CMake 3.4 are working fine." ) +ENDIF() + IF(UNIX) SET(CMAKE_C_FLAGS "-D_GNU_SOURCE -std=gnu99 -Wall -pthread ${CMAKE_C_FLAGS}") set(CMAKE_EXE_LINKER_FLAGS "-pthread ${CMAKE_EXE_LINKER_FLAGS}")
[29/50] celix git commit: CELIX-237: fix json serialization
CELIX-237: fix json serialization Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/d2c53ed9 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/d2c53ed9 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/d2c53ed9 Branch: refs/heads/feature/CELIX-269_depman Commit: d2c53ed93373cd7010ec960ac4de6f66f5540131 Parents: ade96be Author: Bjoern PetriAuthored: Wed Oct 21 21:53:24 2015 +0200 Committer: Bjoern Petri Committed: Wed Oct 21 21:53:24 2015 +0200 -- .../examples/calculator_proxy/private/src/calculator_proxy_impl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/d2c53ed9/remote_services/examples/calculator_proxy/private/src/calculator_proxy_impl.c -- diff --git a/remote_services/examples/calculator_proxy/private/src/calculator_proxy_impl.c b/remote_services/examples/calculator_proxy/private/src/calculator_proxy_impl.c index af2cfc3..fc21412 100644 --- a/remote_services/examples/calculator_proxy/private/src/calculator_proxy_impl.c +++ b/remote_services/examples/calculator_proxy/private/src/calculator_proxy_impl.c @@ -68,7 +68,7 @@ celix_status_t calculatorProxy_add(calculator_pt calculator, double a, double b, if (calculator->endpoint != NULL) { json_t *root; - root = json_pack("{s:s, s:[fmt]}", "m", "add(DD)D", "a", a, b); + root = json_pack("{s:s, s:[ff]}", "m", "add(DD)D", "a", a, b); char *data = json_dumps(root, 0); char *reply = NULL;
[28/50] celix git commit: Revert "CELIX-237: travis: remove default ffi-installation for osx, enable RSA_DI"
Revert "CELIX-237: travis: remove default ffi-installation for osx, enable RSA_DI" This reverts commit 485c43a7e8c90d49dc9e1a11deb5f20ccf74f2c5. Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/ade96be0 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/ade96be0 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/ade96be0 Branch: refs/heads/feature/CELIX-269_depman Commit: ade96be021844baf8317610ee5eb168af3eb16e2 Parents: 485c43a Author: Bjoern PetriAuthored: Tue Oct 20 19:34:35 2015 +0200 Committer: Bjoern Petri Committed: Tue Oct 20 19:34:35 2015 +0200 -- .travis.yml | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/ade96be0/.travis.yml -- diff --git a/.travis.yml b/.travis.yml index c753d97..caba64f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ compiler: before_install: - if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get -qq update && sudo apt-get install -y uuid-dev libjansson-dev libxml2-dev lcov libffi-dev; fi - - if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update && brew install lcov libffi && sudo rm -rf /usr/include/ffi; fi + - if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update && brew install lcov libffi; fi before_script: - wget https://github.com/cpputest/cpputest.github.io/blob/master/releases/cpputest-3.7.1.tar.gz?raw=true -O /tmp/cpputest.tar.gz @@ -25,12 +25,13 @@ before_script: script: # the following setup is broken: + # RSA_DFI is only working for gcc on linux # RSA_DISCOVERY_SHM is only working on linux, but both compilers (see CELIX-277) # RSA_SHM is only working on linux, but both compilers (see CELIX-277) - cd build -- if [ "$CC" = "clang" ] && [ "$TRAVIS_OS_NAME" = "linux" ]; then export BUILD_OPTS=""; else export BUILD_OPTS="-DBUILD_RSA_REMOTE_SERVICE_ADMIN_DFI=ON"; fi +- if [ "$CC" = "clang" ] || [ "$TRAVIS_OS_NAME" = "osx" ]; then export BUILD_OPTS=""; else export BUILD_OPTS="-DBUILD_RSA_REMOTE_SERVICE_ADMIN_DFI=ON"; fi - if [ "$TRAVIS_OS_NAME" = "linux" ]; then cmake -DBUILD_DEPLOYMENT_ADMIN=ON -DBUILD_EXAMPLES=ON -DBUILD_LOG_SERVICE=ON -DBUILD_LOG_WRITER=ON -DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON -DBUILD_RSA_DISCOVERY_SHM=ON -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_SHM=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_SHELL=ON -DBUILD_SHELL_TUI=ON -DBUILD_DEVICE_ACCESS=ON -DBUILD_DEVICE_ACCESS_EXAMPLE=ON -DBUILD_FRAMEWORK_TESTS=OFF -DENABLE_CODE_COVERAGE=ON -DENABLE_TESTING=ON ${BUILD_OPTS} -DCMAKE_INSTALL_PREFIX=../install ..; fi -- if [ "$TRAVIS_OS_NAME" = "osx" ]; then cmake -DBUILD_DEPLOYMENT_ADMIN=ON -DBUILD_EXAMPLES=ON -DBUILD_LOG_SERVICE=ON -DBUILD_LOG_WRITER=ON -DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON -DBUILD_RSA_DISCOVERY_SHM=OFF -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_SHM=OFF -DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_SHELL=ON -DBUILD_SHELL_TUI=ON -DBUILD_DEVICE_ACCESS=ON -DBUILD_DEVICE_ACCESS_EXAMPLE=ON -DBUILD_FRAMEWORK_TESTS=OFF -DENABLE_CODE_COVERAGE=ON -DENABLE_TESTING=ON -DFFI_INCLUDE_DIR=/usr/local/opt/libffi/lib/libffi-3.0.13/include -DFFI_LIBRARY=/usr/local/opt/libffi/lib/libffi.dylib ${BUILD_OPTS} -DCMAKE_INSTALL_PREFIX=../install ..; fi +- if [ "$TRAVIS_OS_NAME" = "osx" ]; then cmake -DBUILD_DEPLOYMENT_ADMIN=ON -DBUILD_EXAMPLES=ON -DBUILD_LOG_SERVICE=ON -DBUILD_LOG_WRITER=ON -DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON -DBUILD_RSA_DISCOVERY_SHM=OFF -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_SHM=OFF -DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_SHELL=ON -DBUILD_SHELL_TUI=ON -DBUILD_DEVICE_ACCESS=ON -DBUILD_DEVICE_ACCESS_EXAMPLE=ON -DBUILD_FRAMEWORK_TESTS=OFF -DENABLE_CODE_COVERAGE=ON -DENABLE_TESTING=ON -DFFI_LIBRARY=/usr/local/opt/libffi/lib/libffi.dylib ${BUILD_OPTS} -DCMAKE_INSTALL_PREFIX=../install ..; fi - make all && make deploy && make install-all - export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH:`pwd`/utils:`pwd`/framework && make test ARGS="-V" && make coverage
[49/50] celix git commit: CELIX-269: Added dependency manager example. Addded phtread_kill support to celix threads.
CELIX-269: Added dependency manager example. Addded phtread_kill support to celix threads. Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/0ad3a1fb Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/0ad3a1fb Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/0ad3a1fb Branch: refs/heads/feature/CELIX-269_depman Commit: 0ad3a1fb05b467e45fe6c486926a9dd6c0beb17f Parents: 2246174 Author: Pepijn NoltesAuthored: Thu Oct 29 16:22:41 2015 +0100 Committer: Pepijn Noltes Committed: Thu Oct 29 16:22:41 2015 +0100 -- examples/CMakeLists.txt | 1 + examples/dm_example/CMakeLists.txt | 29 + examples/dm_example/deploy.cmake| 29 + examples/dm_example/phase1/CMakeLists.txt | 38 ++ .../phase1/private/include/phase1_cmp.h | 42 +++ .../phase1/private/src/phase1_activator.c | 85 + .../dm_example/phase1/private/src/phase1_cmp.c | 94 +++ examples/dm_example/phase2a/CMakeLists.txt | 37 ++ .../phase2a/private/include/phase2a_cmp.h | 45 +++ .../phase2a/private/src/phase2a_activator.c | 94 +++ .../phase2a/private/src/phase2a_cmp.c | 111 + examples/dm_example/phase2b/CMakeLists.txt | 37 ++ .../phase2b/private/include/phase2b_cmp.h | 45 +++ .../phase2b/private/src/phase2b_activator.c | 94 +++ .../phase2b/private/src/phase2b_cmp.c | 111 + examples/dm_example/phase3/CMakeLists.txt | 37 ++ .../phase3/private/include/phase3_cmp.h | 44 +++ .../phase3/private/src/phase3_activator.c | 86 + .../dm_example/phase3/private/src/phase3_cmp.c | 120 +++ examples/dm_example/services/phase1.h | 39 ++ examples/dm_example/services/phase2.h | 40 +++ utils/private/src/celix_threads.c | 5 + utils/public/include/celix_threads.h| 1 + 23 files changed, 1264 insertions(+) -- http://git-wip-us.apache.org/repos/asf/celix/blob/0ad3a1fb/examples/CMakeLists.txt -- diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 25eac59..fc79400 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -26,6 +26,7 @@ if (EXAMPLES) add_subdirectory(whiteboard) add_subdirectory(echo_service) add_subdirectory(producer_consumer) +add_subdirectory(dm_example) add_subdirectory(osgi-in-action/chapter04-correct-lookup) add_subdirectory(osgi-in-action/chapter04-correct-listener) http://git-wip-us.apache.org/repos/asf/celix/blob/0ad3a1fb/examples/dm_example/CMakeLists.txt -- diff --git a/examples/dm_example/CMakeLists.txt b/examples/dm_example/CMakeLists.txt new file mode 100644 index 000..a08e7b4 --- /dev/null +++ b/examples/dm_example/CMakeLists.txt @@ -0,0 +1,29 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +if (BUILD_DEPENDENCY_MANAGER) +include_directories( +${PROJECT_SOURCE_DIR}/dependency_manager/public/include +${PROJECT_SOURCE_DIR}/utils/public/include +services +) + +add_subdirectory(phase1) +add_subdirectory(phase2a) +add_subdirectory(phase2b) +add_subdirectory(phase3) + +endif () http://git-wip-us.apache.org/repos/asf/celix/blob/0ad3a1fb/examples/dm_example/deploy.cmake -- diff --git a/examples/dm_example/deploy.cmake b/examples/dm_example/deploy.cmake new file mode 100644 index 000..9cf2c10 --- /dev/null +++ b/examples/dm_example/deploy.cmake @@ -0,0 +1,29 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +#
[14/50] celix git commit: CELIX-237: Added destroy of import reg when removing imported services
CELIX-237: Added destroy of import reg when removing imported services Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/523bd657 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/523bd657 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/523bd657 Branch: refs/heads/feature/CELIX-269_depman Commit: 523bd657d993e6fe31e4b0615fc5b0f01a620af6 Parents: aa1797a Author: Pepijn NoltesAuthored: Thu Oct 15 09:58:57 2015 +0200 Committer: Pepijn Noltes Committed: Thu Oct 15 09:58:57 2015 +0200 -- .../rsa/private/src/remote_service_admin_dfi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/523bd657/remote_services/remote_service_admin_dfi/rsa/private/src/remote_service_admin_dfi.c -- diff --git a/remote_services/remote_service_admin_dfi/rsa/private/src/remote_service_admin_dfi.c b/remote_services/remote_service_admin_dfi/rsa/private/src/remote_service_admin_dfi.c index db48634..a66bd27 100644 --- a/remote_services/remote_service_admin_dfi/rsa/private/src/remote_service_admin_dfi.c +++ b/remote_services/remote_service_admin_dfi/rsa/private/src/remote_service_admin_dfi.c @@ -623,7 +623,7 @@ celix_status_t remoteServiceAdmin_removeImportedService(remote_service_admin_pt if (current == registration) { arrayList_remove(admin->importedServices, i); importRegistration_close(current); -//TODO, FIXME -> segfault. importRegistration_destroy(current); +importRegistration_destroy(current); break; } }
[42/50] celix git commit: CELIX-273: Added missing descriptor
CELIX-273: Added missing descriptor Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/10067909 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/10067909 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/10067909 Branch: refs/heads/feature/CELIX-269_depman Commit: 100679096835867805a0081577e6b5d8244181bb Parents: 343e53f Author: Bjoern PetriAuthored: Wed Oct 28 08:30:59 2015 +0100 Committer: Bjoern Petri Committed: Wed Oct 28 08:30:59 2015 +0100 -- .../descriptors/example4.descriptor | 8 1 file changed, 8 insertions(+) -- http://git-wip-us.apache.org/repos/asf/celix/blob/10067909/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/descriptors/example4.descriptor -- diff --git a/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/descriptors/example4.descriptor b/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/descriptors/example4.descriptor new file mode 100644 index 000..542d21b --- /dev/null +++ b/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/descriptors/example4.descriptor @@ -0,0 +1,8 @@ +:header +type=interface +name=example4 +version=1.0.0 +:annotations +:types +:methods +getName(V)t=getName(#am=handle;P#am=pre;*t)N
[18/50] celix git commit: CELIX-237: Merge branch 'develop' of https://git-wip-us.apache.org/repos/asf/celix into develop
CELIX-237: Merge branch 'develop' of https://git-wip-us.apache.org/repos/asf/celix into develop Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/2963e3c2 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/2963e3c2 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/2963e3c2 Branch: refs/heads/feature/CELIX-269_depman Commit: 2963e3c286367c19681e834ff261e75eca186aa8 Parents: 75773ba 48558e8 Author: Pepijn NoltesAuthored: Fri Oct 16 13:31:09 2015 +0200 Committer: Pepijn Noltes Committed: Fri Oct 16 13:31:09 2015 +0200 -- .../private/include/topology_manager.h | 2 + .../topology_manager/private/src/activator.c| 2 +- .../private/src/topology_manager.c | 47 +--- 3 files changed, 33 insertions(+), 18 deletions(-) --
[34/50] celix git commit: CELIX-280: 280 fixed deployment_admin shutdown
CELIX-280: 280 fixed deployment_admin shutdown Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/6c938519 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/6c938519 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/6c938519 Branch: refs/heads/feature/CELIX-269_depman Commit: 6c9385199bf2bb026c4919b2def71d2eda4f0ff0 Parents: 9550e63 Author: Bjoern PetriAuthored: Sun Oct 25 16:00:57 2015 +0100 Committer: Bjoern Petri Committed: Sun Oct 25 16:00:57 2015 +0100 -- deployment_admin/private/src/deployment_admin.c | 24 ++-- 1 file changed, 17 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/6c938519/deployment_admin/private/src/deployment_admin.c -- diff --git a/deployment_admin/private/src/deployment_admin.c b/deployment_admin/private/src/deployment_admin.c index 7a78012..7e936e4 100644 --- a/deployment_admin/private/src/deployment_admin.c +++ b/deployment_admin/private/src/deployment_admin.c @@ -67,7 +67,7 @@ static void* deploymentAdmin_poll(void *deploymentAdmin); celix_status_t deploymentAdmin_download(deployment_admin_pt admin, char * url, char **inputFile); size_t deploymentAdmin_writeData(void *ptr, size_t size, size_t nmemb, FILE *stream); static celix_status_t deploymentAdmin_deleteTree(char * directory); -celix_status_t deploymentAdmin_readVersions(deployment_admin_pt admin, array_list_pt *versions); +celix_status_t deploymentAdmin_readVersions(deployment_admin_pt admin, array_list_pt versions); celix_status_t deploymentAdmin_stopDeploymentPackageBundles(deployment_admin_pt admin, deployment_package_pt target); celix_status_t deploymentAdmin_updateDeploymentPackageBundles(deployment_admin_pt admin, deployment_package_pt source); @@ -145,6 +145,10 @@ celix_status_t deploymentAdmin_create(bundle_context_pt context, deployment_admi celix_status_t deploymentAdmin_destroy(deployment_admin_pt admin) { celix_status_t status = CELIX_SUCCESS; +admin->running = false; + +celixThread_join(admin->poller, NULL); + hash_map_iterator_pt iter = hashMapIterator_create(admin->packages); while (hashMapIterator_hasNext(iter)) { @@ -214,7 +218,9 @@ static void *deploymentAdmin_poll(void *deploymentAdmin) { while (admin->running) { //poll ace array_list_pt versions = NULL; - deploymentAdmin_readVersions(admin, ); + arrayList_create(); + + deploymentAdmin_readVersions(admin, versions); char *last = arrayList_get(versions, arrayList_size(versions) - 1); @@ -299,10 +305,12 @@ static void *deploymentAdmin_poll(void *deploymentAdmin) { } } } + sleep(5); + + arrayList_destroy(versions); } - celixThread_exit(NULL); return NULL; } @@ -329,9 +337,9 @@ size_t deploymentAdmin_parseVersions(void *contents, size_t size, size_t nmemb, return realsize; } -celix_status_t deploymentAdmin_readVersions(deployment_admin_pt admin, array_list_pt *versions) { +celix_status_t deploymentAdmin_readVersions(deployment_admin_pt admin, array_list_pt versions) { celix_status_t status = CELIX_SUCCESS; - arrayList_create(versions); + CURL *curl; CURLcode res; curl = curl_easy_init(); @@ -353,12 +361,14 @@ celix_status_t deploymentAdmin_readVersions(deployment_admin_pt admin, array_lis char *last; char *token = strtok_r(chunk.memory, "\n", ); while (token != NULL) { - arrayList_add(*versions, strdup(token)); + arrayList_add(versions, strdup(token)); token = strtok_r(NULL, "\n", ); } } - +if (chunk.memory) { +free(chunk.memory); +} return status; }
[19/50] celix git commit: CELIX-237: Disabled rsa dfi for clang. There seems to be an issue with clang icm the travis linux env. Cannot reproduce this locally, so for now disableing it.
CELIX-237: Disabled rsa dfi for clang. There seems to be an issue with clang icm the travis linux env. Cannot reproduce this locally, so for now disableing it. Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/e3ce10b3 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/e3ce10b3 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/e3ce10b3 Branch: refs/heads/feature/CELIX-269_depman Commit: e3ce10b3200083f62636e82f5553e8d58745b208 Parents: 2963e3c Author: Pepijn NoltesAuthored: Fri Oct 16 13:50:47 2015 +0200 Committer: Pepijn Noltes Committed: Fri Oct 16 13:50:47 2015 +0200 -- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/e3ce10b3/.travis.yml -- diff --git a/.travis.yml b/.travis.yml index 8b7f0d3..8b46bec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,8 @@ before_script: script: - cd build -- cmake -DBUILD_DEPLOYMENT_ADMIN=ON -DBUILD_EXAMPLES=ON -DBUILD_LOG_SERVICE=ON -DBUILD_LOG_WRITER=ON -DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON -DBUILD_RSA_DISCOVERY_SHM=ON -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_SHM=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_SHELL=ON -DBUILD_SHELL_TUI=ON -DBUILD_DEVICE_ACCESS=ON -DBUILD_DEVICE_ACCESS_EXAMPLE=ON -DBUILD_FRAMEWORK_TESTS=OFF -DENABLE_CODE_COVERAGE=ON -DENABLE_TESTING=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_DFI=ON -DCMAKE_INSTALL_PREFIX=../install .. +- if [ "$CC" = "clang" ]; then export BUILD_OPTS="-DBUILD_RSA_REMOTE_SERVICE_ADMIN_DFI=ON"; else export BUILD_OPTS=""; fi +- cmake -DBUILD_DEPLOYMENT_ADMIN=ON -DBUILD_EXAMPLES=ON -DBUILD_LOG_SERVICE=ON -DBUILD_LOG_WRITER=ON -DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON -DBUILD_RSA_DISCOVERY_SHM=ON -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_SHM=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_SHELL=ON -DBUILD_SHELL_TUI=ON -DBUILD_DEVICE_ACCESS=ON -DBUILD_DEVICE_ACCESS_EXAMPLE=ON -DBUILD_FRAMEWORK_TESTS=OFF -DENABLE_CODE_COVERAGE=ON -DENABLE_TESTING=ON ${BUILD_OPTS} -DCMAKE_INSTALL_PREFIX=../install .. - make all && make deploy && make install-all - export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH:`pwd`/utils:`pwd`/framework && make test ARGS="-V" && make coverage
[09/50] celix git commit: CELIX-237: enabling rsa dfi build & test
CELIX-237: enabling rsa dfi build & test Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/1feaba8d Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/1feaba8d Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/1feaba8d Branch: refs/heads/feature/CELIX-269_depman Commit: 1feaba8d7bb7043362238f60963279705cd41c58 Parents: 746b30e Author: Pepijn NoltesAuthored: Wed Oct 14 21:40:51 2015 +0200 Committer: Pepijn Noltes Committed: Wed Oct 14 21:40:51 2015 +0200 -- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/1feaba8d/.travis.yml -- diff --git a/.travis.yml b/.travis.yml index 678a47f..55d4008 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ before_script: script: - cd build -- cmake -DFFI_LIBRARY=/usr/local/lib/libffi.so -DFFI_INCLUDE_DIR=/usr/local/include -DBUILD_DEPLOYMENT_ADMIN=ON -DBUILD_EXAMPLES=ON -DBUILD_LOG_SERVICE=ON -DBUILD_LOG_WRITER=ON -DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON -DBUILD_RSA_DISCOVERY_SHM=ON -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_SHM=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_SHELL=ON -DBUILD_SHELL_TUI=ON -DBUILD_DEVICE_ACCESS=ON -DBUILD_DEVICE_ACCESS_EXAMPLE=ON -DBUILD_FRAMEWORK_TESTS=OFF -DENABLE_CODE_COVERAGE=ON -DENABLE_TESTING=ON -DCMAKE_INSTALL_PREFIX=../install .. +- cmake -DFFI_LIBRARY=/usr/local/lib/libffi.so -DFFI_INCLUDE_DIR=/usr/local/include -DBUILD_DEPLOYMENT_ADMIN=ON -DBUILD_EXAMPLES=ON -DBUILD_LOG_SERVICE=ON -DBUILD_LOG_WRITER=ON -DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON -DBUILD_RSA_DISCOVERY_SHM=ON -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_SHM=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_SHELL=ON -DBUILD_SHELL_TUI=ON -DBUILD_DEVICE_ACCESS=ON -DBUILD_DEVICE_ACCESS_EXAMPLE=ON -DBUILD_FRAMEWORK_TESTS=OFF -DENABLE_CODE_COVERAGE=ON -DENABLE_TESTING=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_DFI=ON -DCMAKE_INSTALL_PREFIX=../install .. - make all && make deploy && make install-all - export LD_PRELOAD=/usr/local/lib/libffi.so && export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH:`pwd`/utils:`pwd`/framework && make test ARGS="-V" && make coverage
[40/50] celix git commit: CELIX-237: add test for serializing char*
CELIX-237: add test for serializing char* Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/e5dfdf53 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/e5dfdf53 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/e5dfdf53 Branch: refs/heads/feature/CELIX-269_depman Commit: e5dfdf5366575846a86b6cec65b137cf85e90b72 Parents: 5463a35 Author: Bjoern PetriAuthored: Tue Oct 27 14:29:52 2015 +0100 Committer: Bjoern Petri Committed: Tue Oct 27 14:29:52 2015 +0100 -- .../json_serializer_tests.cpp | 33 +++- 1 file changed, 32 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/e5dfdf53/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/json_serializer_tests.cpp -- diff --git a/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/json_serializer_tests.cpp b/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/json_serializer_tests.cpp index 1d64ad1..e20cea4 100644 --- a/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/json_serializer_tests.cpp +++ b/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/json_serializer_tests.cpp @@ -142,7 +142,7 @@ static void check_example4(void *data) { } -/*** example 4 / +/*** example 5 / /** structs within a struct (by reference)***/ const char *example5_descriptor = "Tleaf={ts name age};Tnode={Lnode;Lnode;Lleaf; left right value};{Lnode; head}"; @@ -224,6 +224,22 @@ static void check_example6(struct ex6_sequence seq) { } +/*** example 7 / +const char *example7_descriptor = "{t a}"; + +const char *example7_input = "{ \ +\"a\" : \"apache celix\" \ +}"; + +struct example7 { +char* a; //0 +}; + +static void check_example7(void *data) { +struct example7 *ex = (struct example7 *)data; +STRCMP_EQUAL("apache celix", ex->a); +} + static void parseTests(void) { dyn_type *type; void *inst; @@ -288,6 +304,17 @@ static void parseTests(void) { check_example6((*seq)); dynType_free(type, seq); dynType_destroy(type); + + +type = NULL; +inst = NULL; +rc = dynType_parseWithStr(example7_descriptor, NULL, NULL, ); +CHECK_EQUAL(0, rc); +rc = jsonSerializer_deserialize(type, example7_input, ); +CHECK_EQUAL(0, rc); +check_example7(inst); +dynType_free(type, inst); +dynType_destroy(type); } const char *write_example1_descriptor = "{BSIJsijFDN a b c d e f g h i j}"; @@ -433,6 +460,8 @@ void writeTest3(void) { free(result); } + + } TEST_GROUP(JsonSerializerTests) { @@ -460,3 +489,5 @@ TEST(JsonSerializerTests, WriteTest2) { TEST(JsonSerializerTests, WriteTest3) { writeTest3(); } + +
[43/50] celix git commit: CELIX-273: Added sring handling for output parameters
CELIX-273: Added sring handling for output parameters Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/57991e92 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/57991e92 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/57991e92 Branch: refs/heads/feature/CELIX-269_depman Commit: 57991e923c13c49575d33b32591a4acafe6f5d42 Parents: 1006790 Author: Bjoern PetriAuthored: Wed Oct 28 19:24:32 2015 +0100 Committer: Bjoern Petri Committed: Wed Oct 28 19:24:32 2015 +0100 -- .../dynamic_function_interface/json_rpc.c | 40 +- .../descriptors/example4.descriptor | 2 +- .../json_rpc_tests.cpp | 56 +--- 3 files changed, 78 insertions(+), 20 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/57991e92/remote_services/remote_service_admin_dfi/dynamic_function_interface/json_rpc.c -- diff --git a/remote_services/remote_service_admin_dfi/dynamic_function_interface/json_rpc.c b/remote_services/remote_service_admin_dfi/dynamic_function_interface/json_rpc.c index 48f9ba5..14967a5 100644 --- a/remote_services/remote_service_admin_dfi/dynamic_function_interface/json_rpc.c +++ b/remote_services/remote_service_admin_dfi/dynamic_function_interface/json_rpc.c @@ -145,22 +145,26 @@ int jsonRpc_call(dyn_interface_type *intf, void *service, const char *request, c dynType_free(argType, args[i]); } else if (meta == DYN_FUNCTION_ARGUMENT_META__OUTPUT) { if (ptr != NULL) { - dyn_type *typedType = NULL; if (status == OK) { status = dynType_typedPointer_getTypedType(argType, ); } - -dyn_type *typedTypedType = NULL; -if (status == OK) { -status = dynType_typedPointer_getTypedType(typedType, ); +if (dynType_descriptorType(typedType) == 't') { +status = jsonSerializer_serializeJson(typedType, (void*) , ); } +else { +dyn_type *typedTypedType = NULL; +if (status == OK) { +status = dynType_typedPointer_getTypedType(typedType, ); +} -status = jsonSerializer_serializeJson(typedTypedType, ptr, ); +status = jsonSerializer_serializeJson(typedTypedType, ptr, ); -if (status == OK) { -dynType_free(typedTypedType, ptr); +if (status == OK) { +dynType_free(typedTypedType, ptr); +} } + } else { LOG_DEBUG("Output ptr is null"); } @@ -272,13 +276,13 @@ int jsonRpc_handleReply(dyn_function_type *func, const char *reply, void *args[] void **out = (void **) args[i]; size_t size = 0; -dynType_typedPointer_getTypedType(argType, ); if (dynType_descriptorType(argType) == 't') { status = jsonSerializer_deserializeJson(argType, result, ); size = strnlen(((char *) *(char**) tmp), 1024 * 1024); memcpy(*out, *(void**) tmp, size); } else { +dynType_typedPointer_getTypedType(argType, ); status = jsonSerializer_deserializeJson(argType, result, ); size = dynType_size(argType); memcpy(*out, tmp, size); @@ -287,11 +291,21 @@ int jsonRpc_handleReply(dyn_function_type *func, const char *reply, void *args[] dynType_free(argType, tmp); } else if (meta == DYN_FUNCTION_ARGUMENT_META__OUTPUT) { dyn_type *subType = NULL; + dynType_typedPointer_getTypedType(argType, ); -dyn_type *subSubType = NULL; -dynType_typedPointer_getTypedType(subType, ); -void **out = (void **) args[i]; -status = jsonSerializer_deserializeJson(subSubType, result, *out); + +if (dynType_descriptorType(subType) == 't') { +void* tmp = NULL; +status = jsonSerializer_deserializeJson(subType, result, ); +void ***out = (void ***) args[i]; +**out = * (void**) tmp; +} +else { +dyn_type *subSubType = NULL; +dynType_typedPointer_getTypedType(subType, ); +
[07/50] celix git commit: CELIX-237: remote_service_admin.h is dependent on export_registration.h, import_registration.h - so they should be exported as well
CELIX-237: remote_service_admin.h is dependent on export_registration.h, import_registration.h - so they should be exported as well Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/93902231 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/93902231 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/93902231 Branch: refs/heads/feature/CELIX-269_depman Commit: 939022312e8f17e0e5e42dc7db68d0e1d96f5b59 Parents: e14cc7d Author: Bjoern PetriAuthored: Wed Oct 14 15:25:28 2015 +0200 Committer: Bjoern Petri Committed: Wed Oct 14 15:25:28 2015 +0200 -- remote_services/remote_service_admin/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/celix/blob/93902231/remote_services/remote_service_admin/CMakeLists.txt -- diff --git a/remote_services/remote_service_admin/CMakeLists.txt b/remote_services/remote_service_admin/CMakeLists.txt index 310dafa..9d0f4f7 100644 --- a/remote_services/remote_service_admin/CMakeLists.txt +++ b/remote_services/remote_service_admin/CMakeLists.txt @@ -25,6 +25,8 @@ install (FILES public/include/remote_endpoint.h public/include/remote_proxy.h public/include/remote_service_admin.h +public/include/export_registration.h +public/include/import_registration.h public/include/endpoint_description.h public/include/endpoint_listener.h public/include/remote_constants.h
[31/50] celix git commit: CELIX-272: remove arraylist_destroy of exportList (this is allocated in the rsa and also destroyed there)
CELIX-272: remove arraylist_destroy of exportList (this is allocated in the rsa and also destroyed there) Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/80a4f03f Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/80a4f03f Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/80a4f03f Branch: refs/heads/feature/CELIX-269_depman Commit: 80a4f03fcaaca8db77205af86aef3d8bd339c02f Parents: 78bb1e3 Author: Bjoern PetriAuthored: Thu Oct 22 15:09:01 2015 +0200 Committer: Bjoern Petri Committed: Thu Oct 22 15:09:01 2015 +0200 -- remote_services/topology_manager/private/src/topology_manager.c | 3 --- 1 file changed, 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/80a4f03f/remote_services/topology_manager/private/src/topology_manager.c -- diff --git a/remote_services/topology_manager/private/src/topology_manager.c b/remote_services/topology_manager/private/src/topology_manager.c index 68be8c8..424c00c 100644 --- a/remote_services/topology_manager/private/src/topology_manager.c +++ b/remote_services/topology_manager/private/src/topology_manager.c @@ -287,9 +287,6 @@ celix_status_t topologyManager_rsaRemoved(void * handle, service_reference_pt re topologyManager_notifyListenersEndpointRemoved(manager, rsa, export); rsa->exportRegistration_close(export); } - -arrayList_destroy(exports_list); -exports_list = NULL; } hashMap_remove(exports, rsa);
[47/50] celix git commit: CELIX-237: added missing initialization
CELIX-237: added missing initialization Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/48342833 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/48342833 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/48342833 Branch: refs/heads/feature/CELIX-269_depman Commit: 48342833ae1d29094c4f28006e0bef2210338c53 Parents: d7246c4 Author: Bjoern PetriAuthored: Thu Oct 29 09:00:49 2015 +0100 Committer: Bjoern Petri Committed: Thu Oct 29 09:00:49 2015 +0100 -- .../dynamic_function_interface/json_rpc.c| 2 +- .../dynamic_function_interface_tst/dyn_function_tests.cpp| 4 ++-- .../remote_service_admin_dfi/rsa_tst/bundle/tst_activator.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/48342833/remote_services/remote_service_admin_dfi/dynamic_function_interface/json_rpc.c -- diff --git a/remote_services/remote_service_admin_dfi/dynamic_function_interface/json_rpc.c b/remote_services/remote_service_admin_dfi/dynamic_function_interface/json_rpc.c index 14967a5..52487fc 100644 --- a/remote_services/remote_service_admin_dfi/dynamic_function_interface/json_rpc.c +++ b/remote_services/remote_service_admin_dfi/dynamic_function_interface/json_rpc.c @@ -114,7 +114,7 @@ int jsonRpc_call(dyn_interface_type *intf, void *service, const char *request, c status = ERROR; } -ffi_sarg returnVal; +ffi_sarg returnVal = 1; if (status == OK) { dynFunction_call(func, fp, (void *) , args); http://git-wip-us.apache.org/repos/asf/celix/blob/48342833/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_function_tests.cpp -- diff --git a/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_function_tests.cpp b/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_function_tests.cpp index d1bc82e..397540c 100644 --- a/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_function_tests.cpp +++ b/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_function_tests.cpp @@ -146,7 +146,7 @@ extern "C" { args[0] = args[1] = args[2] = -int rVal; +int rVal = 0; rc = dynFunction_call(dynFunc, fp, , args); CHECK_EQUAL(0, rc); CHECK_EQUAL(4.0, result); @@ -158,7 +158,7 @@ extern "C" { args[0] = args[1] = args[2] = -rVal; +rVal = 0; rc = dynFunction_call(dynFunc, fp, , args); CHECK_EQUAL(0, rc); CHECK_EQUAL(4.0, result); http://git-wip-us.apache.org/repos/asf/celix/blob/48342833/remote_services/remote_service_admin_dfi/rsa_tst/bundle/tst_activator.c -- diff --git a/remote_services/remote_service_admin_dfi/rsa_tst/bundle/tst_activator.c b/remote_services/remote_service_admin_dfi/rsa_tst/bundle/tst_activator.c index c067abf..6fb7682 100644 --- a/remote_services/remote_service_admin_dfi/rsa_tst/bundle/tst_activator.c +++ b/remote_services/remote_service_admin_dfi/rsa_tst/bundle/tst_activator.c @@ -122,7 +122,7 @@ static int test(void *handle) { double result = -1.0; -int rc; +int rc = 1; if (act->calc != NULL) { rc = act->calc->sqrt(act->calc->calculator, 4, ); printf("calc result is %f\n", result);
[35/50] celix git commit: CELIX-278: deployment_admin: added capability to add tags, minor refactoring
CELIX-278: deployment_admin: added capability to add tags, minor refactoring Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/a8942991 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/a8942991 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/a8942991 Branch: refs/heads/feature/CELIX-269_depman Commit: a89429917439c93fdd8fb0ae2598b8842e472c9a Parents: 6c93851 Author: Bjoern PetriAuthored: Mon Oct 26 18:22:19 2015 +0100 Committer: Bjoern Petri Committed: Mon Oct 26 18:22:19 2015 +0100 -- .../private/include/deployment_admin.h | 4 +- deployment_admin/private/src/deployment_admin.c | 110 --- .../private/src/deployment_admin_activator.c| 2 +- .../private/src/deployment_package.c| 2 +- deployment_admin/private/src/log.c | 2 +- 5 files changed, 79 insertions(+), 41 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/a8942991/deployment_admin/private/include/deployment_admin.h -- diff --git a/deployment_admin/private/include/deployment_admin.h b/deployment_admin/private/include/deployment_admin.h index f6244b2..a7e3a39 100644 --- a/deployment_admin/private/include/deployment_admin.h +++ b/deployment_admin/private/include/deployment_admin.h @@ -46,7 +46,9 @@ struct deployment_admin { }; typedef enum { - DEPLOYMENT_ADMIN_AUDIT_EVENT__FRAMEWORK_STARTED = 1005 + DEPLOYMENT_ADMIN_AUDIT_EVENT__FRAMEWORK_STARTED = 1005, + DEPLOYMENT_ADMIN_AUDIT_EVENT__TARGETPROPERTIES_SET = 4001 + } DEPLOYMENT_ADMIN_AUDIT_EVENT; celix_status_t deploymentAdmin_create(bundle_context_pt context, deployment_admin_pt *admin); http://git-wip-us.apache.org/repos/asf/celix/blob/a8942991/deployment_admin/private/src/deployment_admin.c -- diff --git a/deployment_admin/private/src/deployment_admin.c b/deployment_admin/private/src/deployment_admin.c index 7e936e4..eaf2468 100644 --- a/deployment_admin/private/src/deployment_admin.c +++ b/deployment_admin/private/src/deployment_admin.c @@ -59,6 +59,7 @@ #define IDENTIFICATION_ID "deployment_admin_identification" #define DISCOVERY_URL "deployment_admin_url" #define DEPLOYMENT_CACHE_DIR "deployment_cache_dir" +#define DEPLOYMENT_TAGS "deployment_tags" // "http://localhost:8080/deployment/; #define VERSIONS "/versions" @@ -172,48 +173,86 @@ celix_status_t deploymentAdmin_destroy(deployment_admin_pt admin) { return status; } -static celix_status_t deploymentAdmin_updateAuditPool(deployment_admin_pt admin, DEPLOYMENT_ADMIN_AUDIT_EVENT auditEvent) { - celix_status_t status = CELIX_SUCCESS; +static celix_status_t deploymentAdmin_performRequest(deployment_admin_pt admin, char* entry) { +celix_status_t status = CELIX_SUCCESS; - CURL *curl; - CURLcode res; - curl = curl_easy_init(); +CURL *curl; +CURLcode res; +curl = curl_easy_init(); - if (!curl) { - status = CELIX_BUNDLE_EXCEPTION; +if (!curl) { +status = CELIX_BUNDLE_EXCEPTION; - fw_log(logger, OSGI_FRAMEWORK_LOG_ERROR, "Error initializing curl."); - } +fw_log(logger, OSGI_FRAMEWORK_LOG_ERROR, "Error initializing curl."); +} - char url[strlen(admin->auditlogUrl)+6]; - sprintf(url, "%s/send", admin->auditlogUrl); - char entry[512]; - int entrySize = snprintf(entry, 512, "%s,%llu,%u,0,%i\n", admin->targetIdentification, admin->auditlogId, admin->aditlogSeqNr++, auditEvent); - if (entrySize >= 512) { - status = CELIX_BUNDLE_EXCEPTION; - fw_log(logger, OSGI_FRAMEWORK_LOG_ERROR, "Error, entry buffer is too small"); - } +char url[strlen(admin->auditlogUrl)+6]; +sprintf(url, "%s/send", admin->auditlogUrl); - if (status == CELIX_SUCCESS) { - curl_easy_setopt(curl, CURLOPT_URL, url); - curl_easy_setopt(curl, CURLOPT_POSTFIELDS, entry); - res = curl_easy_perform(curl); +if (status == CELIX_SUCCESS) { +curl_easy_setopt(curl, CURLOPT_URL, url); +curl_easy_setopt(curl, CURLOPT_POSTFIELDS, entry); +res = curl_easy_perform(curl); - if (res != CURLE_OK ) { - status = CELIX_BUNDLE_EXCEPTION; - fw_log(logger, OSGI_FRAMEWORK_LOG_ERROR, "Error sending auditlog, got curl error code %d", res); - } - } +if (res != CURLE_OK ) { +status = CELIX_BUNDLE_EXCEPTION; +fw_log(logger,
[17/50] celix git commit: CELIX-237: Added interface check to that method must return an int. This to always be able to throw "exceptions". disabled printing dyn_types to stdout.
CELIX-237: Added interface check to that method must return an int. This to always be able to throw "exceptions". disabled printing dyn_types to stdout. Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/75773baf Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/75773baf Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/75773baf Branch: refs/heads/feature/CELIX-269_depman Commit: 75773baf300fea80a790efa0d7f53a7acb68ef86 Parents: f60ca0d Author: Pepijn NoltesAuthored: Fri Oct 16 13:26:47 2015 +0200 Committer: Pepijn Noltes Committed: Fri Oct 16 13:26:47 2015 +0200 -- .../dynamic_function_interface/dyn_interface.c | 11 +++ .../dynamic_function_interface_tst/dyn_type_tests.cpp| 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/75773baf/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_interface.c -- diff --git a/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_interface.c b/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_interface.c index 9bb7bcc..823957b 100644 --- a/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_interface.c +++ b/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_interface.c @@ -95,6 +95,17 @@ static int dynInterface_checkInterface(dyn_interface_type *intf) { status = ERROR; LOG_ERROR("Parse Error. There must be a header section with a type, version and name entry"); } + +struct method_entry *mEntry = NULL; +TAILQ_FOREACH(mEntry, >methods, entries) { +dyn_type *type = dynFunction_returnType(mEntry->dynFunc); +int descriptor = dynType_descriptorType(type); +if (descriptor != 'N') { +status = ERROR; +LOG_ERROR("Parse Error. Only method with a return type 'N' (native int) are supported. Got return type '%c'\n", descriptor); +break; +} +} } return status; http://git-wip-us.apache.org/repos/asf/celix/blob/75773baf/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_type_tests.cpp -- diff --git a/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_type_tests.cpp b/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_type_tests.cpp index 9cf81c5..4b9bd41 100644 --- a/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_type_tests.cpp +++ b/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_type_tests.cpp @@ -43,7 +43,7 @@ extern "C" { } FILE *stream = fopen("/dev/null", "w"); -dynType_print(type, stdout); +dynType_print(type, stream); fclose(stream); dynType_destroy(type); //printf("--\n\n");
[50/50] celix git commit: CELIX-269: Merge branch 'develop' into depman
CELIX-269: Merge branch 'develop' into depman Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/d040f001 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/d040f001 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/d040f001 Branch: refs/heads/feature/CELIX-269_depman Commit: d040f001a4a23e03d314556c806c6864a730afce Parents: 0ad3a1f c58615d Author: Pepijn NoltesAuthored: Thu Oct 29 16:24:13 2015 +0100 Committer: Pepijn Noltes Committed: Thu Oct 29 16:24:13 2015 +0100 -- .gitignore |3 + .travis.yml | 45 +- CMakeLists.txt | 15 +- LICENSE | 26 +- README.md |2 +- cmake/CMakeCelix.cmake |2 +- cmake/FindCppUTest.cmake| 34 +- cmake/FindFFI.cmake | 57 + cmake/cmake_celix/CodeCoverage.cmake| 48 +- cmake/cmake_celix/Test.cmake| 52 - deployment_admin/CMakeLists.txt |2 +- .../private/include/deployment_admin.h |4 +- deployment_admin/private/src/deployment_admin.c | 253 ++-- .../private/src/deployment_admin_activator.c|2 +- .../private/src/deployment_package.c| 19 +- deployment_admin/private/src/log.c |2 +- framework/CMakeLists.txt| 62 +- framework/private/include/framework_private.h |2 + framework/private/src/bundle_cache.c|5 +- framework/private/src/celix_launcher.c | 190 +++ framework/private/src/celix_log.c |5 +- framework/private/src/framework.c | 173 +-- framework/private/src/properties.c | 13 +- framework/private/src/service_registration.c|7 +- framework/private/src/service_registry.c|2 +- framework/public/include/celix_launcher.h | 41 + framework/public/include/properties.h |3 + framework/tst/CMakeLists.txt| 30 + framework/tst/config.properties.in |2 + framework/tst/framework1.properties.in |3 + framework/tst/framework2.properties.in |3 + framework/tst/multiple_frameworks_test.cpp | 89 ++ framework/tst/run_tests.cpp |9 + framework/tst/single_framework_test.cpp | 69 ++ launcher/CMakeLists.txt | 10 +- launcher/private/src/launcher.c | 204 launcher/private/src/main.c | 88 ++ log_service/private/src/log_factory.c |2 +- remote_services/CMakeLists.txt | 11 +- .../private/src/endpoint_discovery_poller.c |5 +- .../public/include/endpoint_listener.h | 48 - .../examples/calculator_service/CMakeLists.txt |5 +- .../public/include/calculator_service.h |6 +- ...apache.celix.calc.api.Calculator2.descriptor | 11 + .../examples/calculator_shell/CMakeLists.txt|4 + .../calculator_shell/private/src/add_command.c |2 +- .../calculator_shell/private/src/sqrt_command.c |2 +- .../calculator_shell/private/src/sub_command.c |2 +- remote_services/examples/deploy.cmake |4 +- .../remote_service_admin/CMakeLists.txt |8 +- .../private/include/export_registration_impl.h |3 - .../private/include/remote_service_admin_impl.h | 17 - .../private/src/export_registration_impl.c | 22 +- .../private/src/import_registration_impl.c | 17 + .../public/include/endpoint_listener.h | 48 + .../public/include/export_registration.h| 22 + .../public/include/import_registration.h| 22 + .../public/include/remote_constants.h | 38 + .../public/include/remote_service_admin.h |6 +- .../remote_service_admin_dfi/CMakeLists.txt | 31 + .../dynamic_function_interface/CMakeLists.txt | 22 + .../dynamic_function_interface/dfi_log_util.h | 48 + .../dynamic_function_interface/dyn_common.c | 136 +++ .../dynamic_function_interface/dyn_common.h | 32 + .../dynamic_function_interface/dyn_function.c | 320 + .../dynamic_function_interface/dyn_function.h | 46 + .../dynamic_function_interface/dyn_interface.c | 416 +++ .../dynamic_function_interface/dyn_interface.h | 48 + .../dynamic_function_interface/dyn_type.c | 1129 ++ .../dynamic_function_interface/dyn_type.h | 142 +++ .../dynamic_function_interface/json_rpc.c | 318 + .../dynamic_function_interface/json_rpc.h | 22 + .../json_serializer.c | 452 +++
[41/50] celix git commit: CELIX-237: fixed handling of preAlloated char* output params
CELIX-237: fixed handling of preAlloated char* output params Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/343e53fa Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/343e53fa Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/343e53fa Branch: refs/heads/feature/CELIX-269_depman Commit: 343e53faf70f28e94a8328ae077b4a014e69ef46 Parents: e5dfdf5 Author: Bjoern PetriAuthored: Tue Oct 27 16:30:15 2015 +0100 Committer: Bjoern Petri Committed: Tue Oct 27 16:30:15 2015 +0100 -- .../dynamic_function_interface/json_rpc.c | 28 +- .../json_rpc_tests.cpp | 40 2 files changed, 58 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/343e53fa/remote_services/remote_service_admin_dfi/dynamic_function_interface/json_rpc.c -- diff --git a/remote_services/remote_service_admin_dfi/dynamic_function_interface/json_rpc.c b/remote_services/remote_service_admin_dfi/dynamic_function_interface/json_rpc.c index 1aa0d62..48f9ba5 100644 --- a/remote_services/remote_service_admin_dfi/dynamic_function_interface/json_rpc.c +++ b/remote_services/remote_service_admin_dfi/dynamic_function_interface/json_rpc.c @@ -268,21 +268,29 @@ int jsonRpc_handleReply(dyn_function_type *func, const char *reply, void *args[] dyn_type *argType = dynFunction_argumentTypeForIndex(func, i); enum dyn_function_argument_meta meta = dynFunction_argumentMetaForIndex(func, i); if (meta == DYN_FUNCTION_ARGUMENT_META__PRE_ALLOCATED_OUTPUT) { -//FIXME need a tmp because deserialize does always does a create (add option?) -dyn_type *subType = NULL; -dynType_typedPointer_getTypedType(argType, ); void *tmp = NULL; -size_t size = dynType_size(subType); -status = jsonSerializer_deserializeJson(subType, result, ); -void **out = (void **)args[i]; -memcpy(*out, tmp, size); -dynType_free(subType, tmp); +void **out = (void **) args[i]; + +size_t size = 0; +dynType_typedPointer_getTypedType(argType, ); + +if (dynType_descriptorType(argType) == 't') { +status = jsonSerializer_deserializeJson(argType, result, ); +size = strnlen(((char *) *(char**) tmp), 1024 * 1024); +memcpy(*out, *(void**) tmp, size); +} else { +status = jsonSerializer_deserializeJson(argType, result, ); +size = dynType_size(argType); +memcpy(*out, tmp, size); +} + +dynType_free(argType, tmp); } else if (meta == DYN_FUNCTION_ARGUMENT_META__OUTPUT) { dyn_type *subType = NULL; dynType_typedPointer_getTypedType(argType, ); dyn_type *subSubType = NULL; dynType_typedPointer_getTypedType(subType, ); -void **out = (void **)args[i]; +void **out = (void **) args[i]; status = jsonSerializer_deserializeJson(subSubType, result, *out); } else { //skip @@ -293,4 +301,4 @@ int jsonRpc_handleReply(dyn_function_type *func, const char *reply, void *args[] json_decref(replyJson); return status; -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/celix/blob/343e53fa/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/json_rpc_tests.cpp -- diff --git a/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/json_rpc_tests.cpp b/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/json_rpc_tests.cpp index f49f9a5..c84ccd1 100644 --- a/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/json_rpc_tests.cpp +++ b/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/json_rpc_tests.cpp @@ -286,6 +286,42 @@ static void stdLog(void *handle, int level, const char *file, int line, const ch dynInterface_destroy(intf); } + +void handleTestOutChar(void) { +dyn_interface_type *intf = NULL; +FILE *desc = fopen("descriptors/example4.descriptor", "r"); +CHECK(desc != NULL); +int rc = dynInterface_parse(desc, ); +CHECK_EQUAL(0, rc); +fclose(desc); + +struct methods_head *head; +dynInterface_methods(intf, ); +dyn_function_type *func = NULL; +struct
[01/50] celix git commit: CELIX-237: Update FindFFI. updated travis.yml to see if the correct libffi is selected
Repository: celix Updated Branches: refs/heads/feature/CELIX-269_depman 224617488 -> d040f001a CELIX-237: Update FindFFI. updated travis.yml to see if the correct libffi is selected Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/bfa056cb Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/bfa056cb Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/bfa056cb Branch: refs/heads/feature/CELIX-269_depman Commit: bfa056cb9644da5ec973503695bebcf2842b Parents: 9e99105 Author: Pepijn NoltesAuthored: Wed Oct 14 10:41:53 2015 +0200 Committer: Pepijn Noltes Committed: Wed Oct 14 10:41:53 2015 +0200 -- .travis.yml | 1 + cmake/FindFFI.cmake | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/bfa056cb/.travis.yml -- diff --git a/.travis.yml b/.travis.yml index 9816f17..1fea4db 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,7 @@ before_script: - cmake -DJANSSON_BUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=/usr . && make - sudo make install - cd - +- ls /usr/lib/x86_64-linux-gnu/libffi.so - wget ftp://sourceware.org/pub/libffi/libffi-3.2.1.tar.gz -O /tmp/libffi.tar.gz - tar xzf /tmp/libffi.tar.gz - cd libffi* http://git-wip-us.apache.org/repos/asf/celix/blob/bfa056cb/cmake/FindFFI.cmake -- diff --git a/cmake/FindFFI.cmake b/cmake/FindFFI.cmake index 59b805a..b94642d 100644 --- a/cmake/FindFFI.cmake +++ b/cmake/FindFFI.cmake @@ -33,8 +33,8 @@ endif () mark_as_advanced(GNUTLS_INCLUDE_DIR GNUTLS_LIBRARY) find_library(FFI_LIBRARY NAMES ffi libffi -PATHS $ENV{FFI_DIR} ${FFI_DIR} /usr/local /opt/local -PATH_SUFFIXES lib x86_64-linux-gnu lib/x86_64-linux-gnu lib64 +PATHS $ENV{FFI_DIR} ${FFI_DIR} /usr /usr/local /opt/local +PATH_SUFFIXES lib lib64 x86_64-linux-gnu lib/x86_64-linux-gnu HINTS ${PC_LIBFFI_LIBDIR} ${PC_LIBFFI_LIBRARY_DIRS} )
celix git commit: CELIX-269: Changed the component add service dependency function from vararg to non vararg
Repository: celix Updated Branches: refs/heads/feature/CELIX-269_depman d040f001a -> 02c563103 CELIX-269: Changed the component add service dependency function from vararg to non vararg Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/02c56310 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/02c56310 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/02c56310 Branch: refs/heads/feature/CELIX-269_depman Commit: 02c56310348cf341c0d4c2bf43c6a373fcb05246 Parents: d040f00 Author: Pepijn NoltesAuthored: Thu Oct 29 16:43:50 2015 +0100 Committer: Pepijn Noltes Committed: Thu Oct 29 16:43:50 2015 +0100 -- dependency_manager/private/src/dm_component_impl.c| 10 +++--- dependency_manager/public/include/dm_component.h | 2 +- .../tracker_depman/private/src/dependency_activator.c | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/02c56310/dependency_manager/private/src/dm_component_impl.c -- diff --git a/dependency_manager/private/src/dm_component_impl.c b/dependency_manager/private/src/dm_component_impl.c index ec13933..a36e232 100644 --- a/dependency_manager/private/src/dm_component_impl.c +++ b/dependency_manager/private/src/dm_component_impl.c @@ -166,23 +166,25 @@ celix_status_t component_destroy(dm_component_pt *component_ptr) { return status; } -celix_status_t component_addServiceDependency(dm_component_pt component, ...) { +celix_status_t component_addServiceDependency(dm_component_pt component, dm_service_dependency_pt dep) { celix_status_t status = CELIX_SUCCESS; array_list_pt dependenciesList = NULL; arrayList_create(); +arrayList_add(dependenciesList, dep); +/* va_list dependencies; va_start(dependencies, component); dm_service_dependency_pt dependency = va_arg(dependencies, dm_service_dependency_pt); while (dependency != NULL) { arrayList_add(dependenciesList, dependency); - dependency = va_arg(dependencies, dm_service_dependency_pt); } va_end(dependencies); + */ executor_executeTask(component->executor, component, component_addTask, dependenciesList); //component_addTask(component, dependenciesList); @@ -1351,12 +1353,14 @@ celix_status_t component_getComponentInfo(dm_component_pt component, dm_componen celixThreadMutex_lock(>mutex); size = arrayList_size(component->dependencies); -for (i = 0; status == CELIX_SUCCESS && i < size; i += 1) { +for (i = 0; i < size; i += 1) { dm_service_dependency_pt dep = arrayList_get(component->dependencies, i); dm_service_dependency_info_pt depInfo= NULL; status = serviceDependency_getServiceDependencyInfo(dep, ); if (status == CELIX_SUCCESS) { arrayList_add(info->dependency_list, depInfo); +} else { +break; } } celixThreadMutex_unlock(>mutex); http://git-wip-us.apache.org/repos/asf/celix/blob/02c56310/dependency_manager/public/include/dm_component.h -- diff --git a/dependency_manager/public/include/dm_component.h b/dependency_manager/public/include/dm_component.h index 12dbcca..cf709cd 100644 --- a/dependency_manager/public/include/dm_component.h +++ b/dependency_manager/public/include/dm_component.h @@ -55,7 +55,7 @@ celix_status_t component_setImplementation(dm_component_pt component, void *impl */ celix_status_t component_getInterfaces(dm_component_pt component, array_list_pt *servicesNames); -celix_status_t component_addServiceDependency(dm_component_pt component, ...); +celix_status_t component_addServiceDependency(dm_component_pt component, dm_service_dependency_pt dep); celix_status_t component_removeServiceDependency(dm_component_pt component, dm_service_dependency_pt dependency); celix_status_t component_setCallbacks(dm_component_pt component, init_fpt init, start_fpt start, stop_fpt stop, deinit_fpt deinit); http://git-wip-us.apache.org/repos/asf/celix/blob/02c56310/examples/whiteboard/tracker_depman/private/src/dependency_activator.c -- diff --git a/examples/whiteboard/tracker_depman/private/src/dependency_activator.c b/examples/whiteboard/tracker_depman/private/src/dependency_activator.c index 4e36321..2ce9bab 100644 --- a/examples/whiteboard/tracker_depman/private/src/dependency_activator.c +++ b/examples/whiteboard/tracker_depman/private/src/dependency_activator.c @@ -62,14 +62,14 @@ celix_status_t dm_init(void * userData, bundle_context_pt context,
[02/50] celix git commit: CELIX-237: Updated travis to use a fixed location of libffi
CELIX-237: Updated travis to use a fixed location of libffi Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/15fc3ab9 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/15fc3ab9 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/15fc3ab9 Branch: refs/heads/feature/CELIX-269_depman Commit: 15fc3ab9616f7418e641e1b79ba8c2eb10c26ebd Parents: bfa056c Author: Pepijn NoltesAuthored: Wed Oct 14 10:53:12 2015 +0200 Committer: Pepijn Noltes Committed: Wed Oct 14 10:53:12 2015 +0200 -- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/15fc3ab9/.travis.yml -- diff --git a/.travis.yml b/.travis.yml index 1fea4db..574540d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,17 +18,17 @@ before_script: - cmake -DJANSSON_BUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=/usr . && make - sudo make install - cd - -- ls /usr/lib/x86_64-linux-gnu/libffi.so - wget ftp://sourceware.org/pub/libffi/libffi-3.2.1.tar.gz -O /tmp/libffi.tar.gz - tar xzf /tmp/libffi.tar.gz - cd libffi* -- ./configure --prefix=/usr && make && sudo make install +- ./configure --prefix=/usr/local && make && sudo make install +- ls /usr/local - cd - - mkdir build install script: - cd build -- cmake -DBUILD_DEPLOYMENT_ADMIN=ON -DBUILD_EXAMPLES=ON -DBUILD_LOG_SERVICE=ON -DBUILD_LOG_WRITER=ON -DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON -DBUILD_RSA_DISCOVERY_SHM=ON -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_SHM=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_SHELL=ON -DBUILD_SHELL_TUI=ON -DBUILD_DEVICE_ACCESS=ON -DBUILD_DEVICE_ACCESS_EXAMPLE=ON -DBUILD_FRAMEWORK_TESTS=OFF -DENABLE_CODE_COVERAGE=ON -DENABLE_TESTING=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_DFI=ON -DCMAKE_INSTALL_PREFIX=../install .. +- cmake -DFFI_LIBRARY=/usr/local/lib/libffi.so -DFFI_INCLUDE_DIR=/usr/local/include -DBUILD_DEPLOYMENT_ADMIN=ON -DBUILD_EXAMPLES=ON -DBUILD_LOG_SERVICE=ON -DBUILD_LOG_WRITER=ON -DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON -DBUILD_RSA_DISCOVERY_SHM=ON -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_SHM=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_SHELL=ON -DBUILD_SHELL_TUI=ON -DBUILD_DEVICE_ACCESS=ON -DBUILD_DEVICE_ACCESS_EXAMPLE=ON -DBUILD_FRAMEWORK_TESTS=OFF -DENABLE_CODE_COVERAGE=ON -DENABLE_TESTING=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_DFI=ON -DCMAKE_INSTALL_PREFIX=../install .. - make all && make deploy && make install-all - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/utils:`pwd`/framework && make test ARGS="-V" && make coverage
[37/50] celix git commit: CELIX-279: Added missing end if (fi) to travis config
CELIX-279: Added missing end if (fi) to travis config Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/3e4e9d23 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/3e4e9d23 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/3e4e9d23 Branch: refs/heads/feature/CELIX-269_depman Commit: 3e4e9d23b763a23edb8052807bd1752b9ef3a95d Parents: 6a4da96 Author: Pepijn NoltesAuthored: Mon Oct 26 20:42:54 2015 +0100 Committer: Pepijn Noltes Committed: Mon Oct 26 20:42:54 2015 +0100 -- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/3e4e9d23/.travis.yml -- diff --git a/.travis.yml b/.travis.yml index 52c81d8..d233897 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,7 +29,7 @@ script: # RSA_DISCOVERY_SHM is only working on linux, but both compilers (see CELIX-277) # RSA_SHM is only working on linux, but both compilers (see CELIX-277) - cd build -- if [ "$TRAVIS_OS_NAME" = "osx" ]; then export BUILD_OPTS="-DFFI_INCLUDE_DIR=/usr/local/lib/libffi-3.0.13/include -DFFI_LIBRARY=/usr/local/lib/libffi.dylib" +- if [ "$TRAVIS_OS_NAME" = "osx" ]; then export BUILD_OPTS="-DFFI_INCLUDE_DIR=/usr/local/lib/libffi-3.0.13/include -DFFI_LIBRARY=/usr/local/lib/libffi.dylib"; fi - if [ "$CC" = "clang" ] || [ "$TRAVIS_OS_NAME" = "osx" ]; then export BUILD_OPTS="${BUILD_OPTS}"; else export BUILD_OPTS="${BUILD_OPTS} -DBUILD_RSA_REMOTE_SERVICE_ADMIN_DFI=ON"; fi - if [ "$TRAVIS_OS_NAME" = "linux" ]; then cmake -DBUILD_DEPLOYMENT_ADMIN=ON -DBUILD_EXAMPLES=ON -DBUILD_LOG_SERVICE=ON -DBUILD_LOG_WRITER=ON -DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON -DBUILD_RSA_DISCOVERY_SHM=ON -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_SHM=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_SHELL=ON -DBUILD_SHELL_TUI=ON -DBUILD_DEVICE_ACCESS=ON -DBUILD_DEVICE_ACCESS_EXAMPLE=ON -DBUILD_FRAMEWORK_TESTS=OFF -DENABLE_CODE_COVERAGE=ON -DENABLE_TESTING=ON ${BUILD_OPTS} -DCMAKE_INSTALL_PREFIX=../install ..; fi - if [ "$TRAVIS_OS_NAME" = "osx" ]; then cmake -DBUILD_DEPLOYMENT_ADMIN=ON -DBUILD_EXAMPLES=ON -DBUILD_LOG_SERVICE=ON -DBUILD_LOG_WRITER=ON -DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON -DBUILD_RSA_DISCOVERY_SHM=OFF -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_SHM=OFF -DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_SHELL=ON -DBUILD_SHELL_TUI=ON -DBUILD_DEVICE_ACCESS=ON -DBUILD_DEVICE_ACCESS_EXAMPLE=ON -DBUILD_FRAMEWORK_TESTS=OFF -DENABLE_CODE_COVERAGE=ON -DENABLE_TESTING=ON -DFFI_LIBRARY=/usr/local/opt/libffi/lib/libffi.dylib ${BUILD_OPTS} -DCMAKE_INSTALL_PREFIX=../install ..; fi
[06/50] celix git commit: CELIX-237: Disabling rsa dfi build & test
CELIX-237: Disabling rsa dfi build & test Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/e14cc7da Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/e14cc7da Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/e14cc7da Branch: refs/heads/feature/CELIX-269_depman Commit: e14cc7dad2e273914e6c77b7489b686f115998a6 Parents: 05ece94 Author: Pepijn NoltesAuthored: Wed Oct 14 12:29:44 2015 +0200 Committer: Pepijn Noltes Committed: Wed Oct 14 12:29:44 2015 +0200 -- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/e14cc7da/.travis.yml -- diff --git a/.travis.yml b/.travis.yml index 55d4008..678a47f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ before_script: script: - cd build -- cmake -DFFI_LIBRARY=/usr/local/lib/libffi.so -DFFI_INCLUDE_DIR=/usr/local/include -DBUILD_DEPLOYMENT_ADMIN=ON -DBUILD_EXAMPLES=ON -DBUILD_LOG_SERVICE=ON -DBUILD_LOG_WRITER=ON -DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON -DBUILD_RSA_DISCOVERY_SHM=ON -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_SHM=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_SHELL=ON -DBUILD_SHELL_TUI=ON -DBUILD_DEVICE_ACCESS=ON -DBUILD_DEVICE_ACCESS_EXAMPLE=ON -DBUILD_FRAMEWORK_TESTS=OFF -DENABLE_CODE_COVERAGE=ON -DENABLE_TESTING=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_DFI=ON -DCMAKE_INSTALL_PREFIX=../install .. +- cmake -DFFI_LIBRARY=/usr/local/lib/libffi.so -DFFI_INCLUDE_DIR=/usr/local/include -DBUILD_DEPLOYMENT_ADMIN=ON -DBUILD_EXAMPLES=ON -DBUILD_LOG_SERVICE=ON -DBUILD_LOG_WRITER=ON -DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON -DBUILD_RSA_DISCOVERY_SHM=ON -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_SHM=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_SHELL=ON -DBUILD_SHELL_TUI=ON -DBUILD_DEVICE_ACCESS=ON -DBUILD_DEVICE_ACCESS_EXAMPLE=ON -DBUILD_FRAMEWORK_TESTS=OFF -DENABLE_CODE_COVERAGE=ON -DENABLE_TESTING=ON -DCMAKE_INSTALL_PREFIX=../install .. - make all && make deploy && make install-all - export LD_PRELOAD=/usr/local/lib/libffi.so && export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH:`pwd`/utils:`pwd`/framework && make test ARGS="-V" && make coverage
[27/50] celix git commit: CELIX-237: travis: remove default ffi-installation for osx, enable RSA_DI
CELIX-237: travis: remove default ffi-installation for osx, enable RSA_DI Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/485c43a7 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/485c43a7 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/485c43a7 Branch: refs/heads/feature/CELIX-269_depman Commit: 485c43a7e8c90d49dc9e1a11deb5f20ccf74f2c5 Parents: d3b68da Author: Bjoern PetriAuthored: Tue Oct 20 14:26:57 2015 +0200 Committer: Bjoern Petri Committed: Tue Oct 20 14:26:57 2015 +0200 -- .travis.yml | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/485c43a7/.travis.yml -- diff --git a/.travis.yml b/.travis.yml index caba64f..c753d97 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ compiler: before_install: - if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get -qq update && sudo apt-get install -y uuid-dev libjansson-dev libxml2-dev lcov libffi-dev; fi - - if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update && brew install lcov libffi; fi + - if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update && brew install lcov libffi && sudo rm -rf /usr/include/ffi; fi before_script: - wget https://github.com/cpputest/cpputest.github.io/blob/master/releases/cpputest-3.7.1.tar.gz?raw=true -O /tmp/cpputest.tar.gz @@ -25,13 +25,12 @@ before_script: script: # the following setup is broken: - # RSA_DFI is only working for gcc on linux # RSA_DISCOVERY_SHM is only working on linux, but both compilers (see CELIX-277) # RSA_SHM is only working on linux, but both compilers (see CELIX-277) - cd build -- if [ "$CC" = "clang" ] || [ "$TRAVIS_OS_NAME" = "osx" ]; then export BUILD_OPTS=""; else export BUILD_OPTS="-DBUILD_RSA_REMOTE_SERVICE_ADMIN_DFI=ON"; fi +- if [ "$CC" = "clang" ] && [ "$TRAVIS_OS_NAME" = "linux" ]; then export BUILD_OPTS=""; else export BUILD_OPTS="-DBUILD_RSA_REMOTE_SERVICE_ADMIN_DFI=ON"; fi - if [ "$TRAVIS_OS_NAME" = "linux" ]; then cmake -DBUILD_DEPLOYMENT_ADMIN=ON -DBUILD_EXAMPLES=ON -DBUILD_LOG_SERVICE=ON -DBUILD_LOG_WRITER=ON -DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON -DBUILD_RSA_DISCOVERY_SHM=ON -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_SHM=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_SHELL=ON -DBUILD_SHELL_TUI=ON -DBUILD_DEVICE_ACCESS=ON -DBUILD_DEVICE_ACCESS_EXAMPLE=ON -DBUILD_FRAMEWORK_TESTS=OFF -DENABLE_CODE_COVERAGE=ON -DENABLE_TESTING=ON ${BUILD_OPTS} -DCMAKE_INSTALL_PREFIX=../install ..; fi -- if [ "$TRAVIS_OS_NAME" = "osx" ]; then cmake -DBUILD_DEPLOYMENT_ADMIN=ON -DBUILD_EXAMPLES=ON -DBUILD_LOG_SERVICE=ON -DBUILD_LOG_WRITER=ON -DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON -DBUILD_RSA_DISCOVERY_SHM=OFF -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_SHM=OFF -DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_SHELL=ON -DBUILD_SHELL_TUI=ON -DBUILD_DEVICE_ACCESS=ON -DBUILD_DEVICE_ACCESS_EXAMPLE=ON -DBUILD_FRAMEWORK_TESTS=OFF -DENABLE_CODE_COVERAGE=ON -DENABLE_TESTING=ON -DFFI_LIBRARY=/usr/local/opt/libffi/lib/libffi.dylib ${BUILD_OPTS} -DCMAKE_INSTALL_PREFIX=../install ..; fi +- if [ "$TRAVIS_OS_NAME" = "osx" ]; then cmake -DBUILD_DEPLOYMENT_ADMIN=ON -DBUILD_EXAMPLES=ON -DBUILD_LOG_SERVICE=ON -DBUILD_LOG_WRITER=ON -DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON -DBUILD_RSA_DISCOVERY_SHM=OFF -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_SHM=OFF -DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_SHELL=ON -DBUILD_SHELL_TUI=ON -DBUILD_DEVICE_ACCESS=ON -DBUILD_DEVICE_ACCESS_EXAMPLE=ON -DBUILD_FRAMEWORK_TESTS=OFF -DENABLE_CODE_COVERAGE=ON -DENABLE_TESTING=ON -DFFI_INCLUDE_DIR=/usr/local/opt/libffi/lib/libffi-3.0.13/include -DFFI_LIBRARY=/usr/local/opt/libffi/lib/libffi.dylib ${BUILD_OPTS} -DCMAKE_INSTALL_PREFIX=../install ..; fi - make all && make deploy && make install-all - export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH:`pwd`/utils:`pwd`/framework && make test ARGS="-V" && make coverage
[21/50] celix git commit: CELIX-263: fixed wrong constants used in celix_thread_test
CELIX-263: fixed wrong constants used in celix_thread_test Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/9806a809 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/9806a809 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/9806a809 Branch: refs/heads/feature/CELIX-269_depman Commit: 9806a809220a3fd47a91519a2ca152cfb7a31f66 Parents: fe81655 Author: Bjoern PetriAuthored: Sun Oct 18 20:05:09 2015 +0200 Committer: Bjoern Petri Committed: Sun Oct 18 20:05:09 2015 +0200 -- utils/private/test/celix_threads_test.cpp | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/9806a809/utils/private/test/celix_threads_test.cpp -- diff --git a/utils/private/test/celix_threads_test.cpp b/utils/private/test/celix_threads_test.cpp index d5a01b4..6d62bad 100644 --- a/utils/private/test/celix_threads_test.cpp +++ b/utils/private/test/celix_threads_test.cpp @@ -172,6 +172,9 @@ TEST(celix_thread_mutex, lock) { //possible race condition, not perfect test celixThreadMutex_unlock(>mu); + + sleep(2); + celixThreadMutex_lock(>mu2); LONGS_EQUAL(666, params->i); celixThreadMutex_unlock(>mu2); @@ -191,14 +194,14 @@ TEST(celix_thread_mutex, attrSettype) { celixThreadMutexAttr_create(_attr); //test recursive mutex - celixThreadMutexAttr_settype(_attr, PTHREAD_MUTEX_RECURSIVE); + celixThreadMutexAttr_settype(_attr, CELIX_THREAD_MUTEX_RECURSIVE); celixThreadMutex_create(, _attr); //if program doesnt deadlock: succes! also check factorial of 10, for reasons unknown LONGS_EQUAL(3628800, thread_test_func_recur_lock(, 10)); celixThreadMutex_destroy(); //test deadlock check mutex - celixThreadMutexAttr_settype(_attr, PTHREAD_MUTEX_ERRORCHECK); + celixThreadMutexAttr_settype(_attr, CELIX_THREAD_MUTEX_ERRORCHECK); celixThreadMutex_create(, _attr); //get deadlock error celixThreadMutex_lock();
[08/50] celix git commit: CELIX-237: Added several fixed and one work around for rsa dfi issues
CELIX-237: Added several fixed and one work around for rsa dfi issues Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/746b30e8 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/746b30e8 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/746b30e8 Branch: refs/heads/feature/CELIX-269_depman Commit: 746b30e8dd12921dd66da61bb7b2c4e4b506d5d7 Parents: e14cc7d Author: Pepijn NoltesAuthored: Wed Oct 14 21:39:41 2015 +0200 Committer: Pepijn Noltes Committed: Wed Oct 14 21:39:41 2015 +0200 -- framework/tst/multiple_frameworks_test.cpp | 3 ++- .../dynamic_function_interface/dyn_interface.c | 18 - .../dynamic_function_interface/dyn_type.c | 2 +- .../dynamic_function_interface/json_rpc.c | 21 ++-- .../rsa/private/src/import_registration_dfi.c | 5 + .../rsa_tst/rsa_client_server_tests.cpp | 5 ++--- 6 files changed, 34 insertions(+), 20 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/746b30e8/framework/tst/multiple_frameworks_test.cpp -- diff --git a/framework/tst/multiple_frameworks_test.cpp b/framework/tst/multiple_frameworks_test.cpp index b732000..4e568cd 100644 --- a/framework/tst/multiple_frameworks_test.cpp +++ b/framework/tst/multiple_frameworks_test.cpp @@ -68,7 +68,8 @@ extern "C" { } static void testFrameworks(void) { -printf("testing startup/shutdown mutiple frameworks\n");} +printf("testing startup/shutdown mutiple frameworks\n"); +} } http://git-wip-us.apache.org/repos/asf/celix/blob/746b30e8/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_interface.c -- diff --git a/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_interface.c b/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_interface.c index d869d16..9bb7bcc 100644 --- a/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_interface.c +++ b/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_interface.c @@ -323,15 +323,6 @@ void dynInterface_destroy(dyn_interface_type *intf) { dynCommon_clearNamValHead(>header); dynCommon_clearNamValHead(>annotations); -struct type_entry *tmp = NULL; -struct type_entry *tInfo = TAILQ_FIRST(>types); -while (tInfo != NULL) { -tmp = tInfo; -tInfo = TAILQ_NEXT(tInfo, entries); -dynType_destroy(tmp->type); -free(tmp); -} - struct method_entry *mTmp = NULL; struct method_entry *mInfo = TAILQ_FIRST(>methods); while (mInfo != NULL) { @@ -350,6 +341,15 @@ void dynInterface_destroy(dyn_interface_type *intf) { free(mTmp); } +struct type_entry *tmp = NULL; +struct type_entry *tInfo = TAILQ_FIRST(>types); +while (tInfo != NULL) { +tmp = tInfo; +tInfo = TAILQ_NEXT(tInfo, entries); +dynType_destroy(tmp->type); +free(tmp); +} + free(intf); } } http://git-wip-us.apache.org/repos/asf/celix/blob/746b30e8/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_type.c -- diff --git a/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_type.c b/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_type.c index 972278d..35275cd 100644 --- a/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_type.c +++ b/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_type.c @@ -297,8 +297,8 @@ static int dynType_parseComplex(FILE *stream, dyn_type *type) { if (status == OK) { type->complex.structType.type = FFI_TYPE_STRUCT; type->complex.structType.elements = calloc(count + 1, sizeof(ffi_type)); -type->complex.structType.elements[count] = NULL; if (type->complex.structType.elements != NULL) { +type->complex.structType.elements[count] = NULL; int index = 0; TAILQ_FOREACH(entry, >complex.entriesHead, entries) { type->complex.structType.elements[index++] = dynType_ffiType(entry->type); http://git-wip-us.apache.org/repos/asf/celix/blob/746b30e8/remote_services/remote_service_admin_dfi/dynamic_function_interface/json_rpc.c -- diff --git a/remote_services/remote_service_admin_dfi/dynamic_function_interface/json_rpc.c
celix git commit: CELIX-269: Added marco for the callback functions which can be used to prevent warning instead of casting to (void *)
Repository: celix Updated Branches: refs/heads/feature/CELIX-269_depman 02c563103 -> e302c2d36 CELIX-269: Added marco for the callback functions which can be used to prevent warning instead of casting to (void *) Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/e302c2d3 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/e302c2d3 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/e302c2d3 Branch: refs/heads/feature/CELIX-269_depman Commit: e302c2d369c66c045b333088be0718b03c04bf15 Parents: 02c5631 Author: Pepijn NoltesAuthored: Thu Oct 29 17:35:20 2015 +0100 Committer: Pepijn Noltes Committed: Thu Oct 29 17:35:20 2015 +0100 -- .../private/src/dm_shell_list_command.c | 8 +++ .../public/include/dm_component.h | 17 +++ dependency_manager/public/include/dm_info.h | 2 +- .../public/include/dm_service_dependency.h | 22 +++- .../phase1/private/include/phase1_cmp.h | 1 + .../phase1/private/src/phase1_activator.c | 4 ++-- .../dm_example/phase1/private/src/phase1_cmp.c | 5 + .../phase2a/private/include/phase2a_cmp.h | 1 + .../phase2a/private/src/phase2a_activator.c | 4 ++-- .../phase2a/private/src/phase2a_cmp.c | 5 + .../phase2b/private/include/phase2b_cmp.h | 1 + .../phase2b/private/src/phase2b_activator.c | 4 ++-- .../phase2b/private/src/phase2b_cmp.c | 5 + .../phase3/private/include/phase3_cmp.h | 1 + .../phase3/private/src/phase3_activator.c | 4 ++-- .../dm_example/phase3/private/src/phase3_cmp.c | 5 + 16 files changed, 67 insertions(+), 22 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/e302c2d3/dependency_manager/private/src/dm_shell_list_command.c -- diff --git a/dependency_manager/private/src/dm_shell_list_command.c b/dependency_manager/private/src/dm_shell_list_command.c index 4d08068..1855664 100644 --- a/dependency_manager/private/src/dm_shell_list_command.c +++ b/dependency_manager/private/src/dm_shell_list_command.c @@ -75,8 +75,8 @@ void dmListCommand_execute(command_pt command, char * line, void (*out)(char *), int cmpCnt; for (cmpCnt = 0; cmpCnt < arrayList_size(info->components); cmpCnt++) { dm_component_info_pt compInfo = arrayList_get(info->components, cmpCnt); -char *startColors = ""; -char *endColors = ""; +const char *startColors = ""; +const char *endColors = ""; if (colors) { startColors = compInfo->active ? OK_COLOR : NOK_COLOR; endColors = END_COLOR; @@ -100,8 +100,8 @@ void dmListCommand_execute(command_pt command, char * line, void (*out)(char *), for(depCnt = 0 ;depCnt < arrayList_size(compInfo->dependency_list); depCnt++) { dm_service_dependency_info_pt dependency; dependency = arrayList_get(compInfo->dependency_list, depCnt); -char *startColors = ""; -char *endColors = ""; +const char *startColors = ""; +const char *endColors = ""; if (colors) { if (dependency->required) { startColors = dependency->available ? OK_COLOR : NOK_COLOR; http://git-wip-us.apache.org/repos/asf/celix/blob/e302c2d3/dependency_manager/public/include/dm_component.h -- diff --git a/dependency_manager/public/include/dm_component.h b/dependency_manager/public/include/dm_component.h index cf709cd..b558aea 100644 --- a/dependency_manager/public/include/dm_component.h +++ b/dependency_manager/public/include/dm_component.h @@ -39,10 +39,10 @@ typedef struct dm_component *dm_component_pt; #define DM_COMPONENT_MAX_ID_LENGTH 64 #define DM_COMPONENT_MAX_NAME_LENGTH 128 -typedef celix_status_t (*init_fpt)(void *userData); -typedef celix_status_t (*start_fpt)(void *userData); -typedef celix_status_t (*stop_fpt)(void *userData); -typedef celix_status_t (*deinit_fpt)(void *userData); +typedef int (*init_fpt)(void *userData); +typedef int (*start_fpt)(void *userData); +typedef int (*stop_fpt)(void *userData); +typedef int (*deinit_fpt)(void *userData); celix_status_t component_create(bundle_context_pt context, const char *name, dm_component_pt *component); celix_status_t component_destroy(dm_component_pt *component); @@ -58,6 +58,15 @@ celix_status_t component_getInterfaces(dm_component_pt component, array_list_pt celix_status_t component_addServiceDependency(dm_component_pt component, dm_service_dependency_pt dep);
[19/50] celix git commit: CELIX-237: Added remove of standard installed libffi
CELIX-237: Added remove of standard installed libffi Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/a5d95e94 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/a5d95e94 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/a5d95e94 Branch: refs/heads/feature/CELIX-230_Refactoring_of_the_shell_command_service Commit: a5d95e94e183da68496645d808c3c9db809110c6 Parents: 9562f3d Author: Pepijn NoltesAuthored: Wed Oct 14 11:11:51 2015 +0200 Committer: Pepijn Noltes Committed: Wed Oct 14 11:11:51 2015 +0200 -- .travis.yml | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/celix/blob/a5d95e94/.travis.yml -- diff --git a/.travis.yml b/.travis.yml index f875ced..66f4c2e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ language: c before_install: - sudo apt-get update -qq - sudo apt-get install -y uuid-dev libjansson-dev libxml2-dev lcov pkg-config + - sudo apt-get remove -y libffi matrix: include:
[36/50] celix git commit: CELIX-263: fixed wrong constants used in celix_thread_test
CELIX-263: fixed wrong constants used in celix_thread_test Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/9806a809 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/9806a809 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/9806a809 Branch: refs/heads/feature/CELIX-230_Refactoring_of_the_shell_command_service Commit: 9806a809220a3fd47a91519a2ca152cfb7a31f66 Parents: fe81655 Author: Bjoern PetriAuthored: Sun Oct 18 20:05:09 2015 +0200 Committer: Bjoern Petri Committed: Sun Oct 18 20:05:09 2015 +0200 -- utils/private/test/celix_threads_test.cpp | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/9806a809/utils/private/test/celix_threads_test.cpp -- diff --git a/utils/private/test/celix_threads_test.cpp b/utils/private/test/celix_threads_test.cpp index d5a01b4..6d62bad 100644 --- a/utils/private/test/celix_threads_test.cpp +++ b/utils/private/test/celix_threads_test.cpp @@ -172,6 +172,9 @@ TEST(celix_thread_mutex, lock) { //possible race condition, not perfect test celixThreadMutex_unlock(>mu); + + sleep(2); + celixThreadMutex_lock(>mu2); LONGS_EQUAL(666, params->i); celixThreadMutex_unlock(>mu2); @@ -191,14 +194,14 @@ TEST(celix_thread_mutex, attrSettype) { celixThreadMutexAttr_create(_attr); //test recursive mutex - celixThreadMutexAttr_settype(_attr, PTHREAD_MUTEX_RECURSIVE); + celixThreadMutexAttr_settype(_attr, CELIX_THREAD_MUTEX_RECURSIVE); celixThreadMutex_create(, _attr); //if program doesnt deadlock: succes! also check factorial of 10, for reasons unknown LONGS_EQUAL(3628800, thread_test_func_recur_lock(, 10)); celixThreadMutex_destroy(); //test deadlock check mutex - celixThreadMutexAttr_settype(_attr, PTHREAD_MUTEX_ERRORCHECK); + celixThreadMutexAttr_settype(_attr, CELIX_THREAD_MUTEX_ERRORCHECK); celixThreadMutex_create(, _attr); //get deadlock error celixThreadMutex_lock();
[35/50] celix git commit: CELIX-237: Reversed disableling rsa dfi build. Now rsa dfi should not be build for clang
CELIX-237: Reversed disableling rsa dfi build. Now rsa dfi should not be build for clang Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/fe816550 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/fe816550 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/fe816550 Branch: refs/heads/feature/CELIX-230_Refactoring_of_the_shell_command_service Commit: fe816550e1ef7b9aa483069b431e46ce029e70b7 Parents: e3ce10b Author: Pepijn NoltesAuthored: Fri Oct 16 14:29:29 2015 +0200 Committer: Pepijn Noltes Committed: Fri Oct 16 14:29:29 2015 +0200 -- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/fe816550/.travis.yml -- diff --git a/.travis.yml b/.travis.yml index 8b46bec..11f04eb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,7 @@ before_script: script: - cd build -- if [ "$CC" = "clang" ]; then export BUILD_OPTS="-DBUILD_RSA_REMOTE_SERVICE_ADMIN_DFI=ON"; else export BUILD_OPTS=""; fi +- if [ "$CC" = "clang" ]; then export BUILD_OPTS=""; else export BUILD_OPTS="-DBUILD_RSA_REMOTE_SERVICE_ADMIN_DFI=ON"; fi - cmake -DBUILD_DEPLOYMENT_ADMIN=ON -DBUILD_EXAMPLES=ON -DBUILD_LOG_SERVICE=ON -DBUILD_LOG_WRITER=ON -DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON -DBUILD_RSA_DISCOVERY_SHM=ON -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_SHM=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_SHELL=ON -DBUILD_SHELL_TUI=ON -DBUILD_DEVICE_ACCESS=ON -DBUILD_DEVICE_ACCESS_EXAMPLE=ON -DBUILD_FRAMEWORK_TESTS=OFF -DENABLE_CODE_COVERAGE=ON -DENABLE_TESTING=ON ${BUILD_OPTS} -DCMAKE_INSTALL_PREFIX=../install .. - make all && make deploy && make install-all - export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH:`pwd`/utils:`pwd`/framework && make test ARGS="-V" && make coverage
[29/50] celix git commit: CELIX-237: Added destroy of import reg when removing imported services
CELIX-237: Added destroy of import reg when removing imported services Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/523bd657 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/523bd657 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/523bd657 Branch: refs/heads/feature/CELIX-230_Refactoring_of_the_shell_command_service Commit: 523bd657d993e6fe31e4b0615fc5b0f01a620af6 Parents: aa1797a Author: Pepijn NoltesAuthored: Thu Oct 15 09:58:57 2015 +0200 Committer: Pepijn Noltes Committed: Thu Oct 15 09:58:57 2015 +0200 -- .../rsa/private/src/remote_service_admin_dfi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/523bd657/remote_services/remote_service_admin_dfi/rsa/private/src/remote_service_admin_dfi.c -- diff --git a/remote_services/remote_service_admin_dfi/rsa/private/src/remote_service_admin_dfi.c b/remote_services/remote_service_admin_dfi/rsa/private/src/remote_service_admin_dfi.c index db48634..a66bd27 100644 --- a/remote_services/remote_service_admin_dfi/rsa/private/src/remote_service_admin_dfi.c +++ b/remote_services/remote_service_admin_dfi/rsa/private/src/remote_service_admin_dfi.c @@ -623,7 +623,7 @@ celix_status_t remoteServiceAdmin_removeImportedService(remote_service_admin_pt if (current == registration) { arrayList_remove(admin->importedServices, i); importRegistration_close(current); -//TODO, FIXME -> segfault. importRegistration_destroy(current); +importRegistration_destroy(current); break; } }
[28/50] celix git commit: CELIX-237: Fixed an issue in service_regisration, the ungetService for a service factory was not correctly called (wrong handle).
CELIX-237: Fixed an issue in service_regisration, the ungetService for a service factory was not correctly called (wrong handle). Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/aa1797ab Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/aa1797ab Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/aa1797ab Branch: refs/heads/feature/CELIX-230_Refactoring_of_the_shell_command_service Commit: aa1797ab90090ea556d4e367c390e5430cefea6c Parents: 2fe04c0 Author: Pepijn NoltesAuthored: Thu Oct 15 09:56:00 2015 +0200 Committer: Pepijn Noltes Committed: Thu Oct 15 09:56:00 2015 +0200 -- framework/private/src/service_registration.c| 2 +- .../rsa/private/src/import_registration_dfi.c | 16 ++-- 2 files changed, 7 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/aa1797ab/framework/private/src/service_registration.c -- diff --git a/framework/private/src/service_registration.c b/framework/private/src/service_registration.c index 82d0ee9..1817784 100644 --- a/framework/private/src/service_registration.c +++ b/framework/private/src/service_registration.c @@ -163,7 +163,7 @@ celix_status_t serviceRegistration_getService(service_registration_pt registrati celix_status_t serviceRegistration_ungetService(service_registration_pt registration, bundle_pt bundle, void **service) { if (registration->isServiceFactory) { service_factory_pt factory = registration->serviceFactory; -factory->ungetService(registration->serviceFactory, bundle, registration, service); +factory->ungetService(factory->factory, bundle, registration, service); } return CELIX_SUCCESS; } http://git-wip-us.apache.org/repos/asf/celix/blob/aa1797ab/remote_services/remote_service_admin_dfi/rsa/private/src/import_registration_dfi.c -- diff --git a/remote_services/remote_service_admin_dfi/rsa/private/src/import_registration_dfi.c b/remote_services/remote_service_admin_dfi/rsa/private/src/import_registration_dfi.c index 8616f0c..cb40f0b 100644 --- a/remote_services/remote_service_admin_dfi/rsa/private/src/import_registration_dfi.c +++ b/remote_services/remote_service_admin_dfi/rsa/private/src/import_registration_dfi.c @@ -13,7 +13,6 @@ struct import_registration { const char *classObject; //NOTE owned by endpoint celix_thread_mutex_t mutex; //protects send & sendhandle - send_func_type send; void *sendHandle; @@ -27,7 +26,7 @@ struct import_registration { struct service_proxy { dyn_interface_type *intf; void *service; -int count; +size_t count; }; static celix_status_t importRegistration_createProxy(import_registration_pt import, bundle_pt bundle, @@ -128,12 +127,13 @@ celix_status_t importRegistration_start(import_registration_pt import) { celix_status_t importRegistration_stop(import_registration_pt import) { celix_status_t status = CELIX_SUCCESS; -importRegistration_clearProxies(import); - if (import->factoryReg != NULL) { serviceRegistration_unregister(import->factoryReg); +import->factoryReg = NULL; } +importRegistration_clearProxies(import); + return status; } @@ -289,10 +289,6 @@ static void importRegistration_proxyFunc(void *userData, void *args[], void *ret celix_status_t importRegistration_ungetService(import_registration_pt import, bundle_pt bundle, service_registration_pt registration, void **out) { celix_status_t status = CELIX_SUCCESS; -return status; - -/* TODO, FIXME ungetService can happen after importRegistration destroy leading to segfaults - assert(import != NULL); assert(import->proxies != NULL); @@ -307,14 +303,14 @@ celix_status_t importRegistration_ungetService(import_registration_pt import, bu } if (proxy->count == 0) { +hashMap_remove(import->proxies, bundle); importRegistration_destroyProxy(proxy); } } -pthread_mutex_lock(>proxiesMutex); +pthread_mutex_unlock(>proxiesMutex); return status; - */ } static void importRegistration_destroyProxy(struct service_proxy *proxy) {
[05/50] celix git commit: CELIX-237: Changed intialization of test structs.
CELIX-237: Changed intialization of test structs. Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/22797e10 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/22797e10 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/22797e10 Branch: refs/heads/feature/CELIX-230_Refactoring_of_the_shell_command_service Commit: 22797e1005681ade3b6a2b189a1430fffe7c3250 Parents: c5de698 Author: Pepijn NoltesAuthored: Tue Oct 13 19:27:26 2015 +0200 Committer: Pepijn Noltes Committed: Tue Oct 13 19:27:26 2015 +0200 -- .../json_serializer_tests.cpp | 41 1 file changed, 34 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/22797e10/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/json_serializer_tests.cpp -- diff --git a/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/json_serializer_tests.cpp b/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/json_serializer_tests.cpp index db81ade..1d64ad1 100644 --- a/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/json_serializer_tests.cpp +++ b/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/json_serializer_tests.cpp @@ -306,7 +306,18 @@ struct write_example1 { }; void writeTest1(void) { -struct write_example1 ex1 = {.a=1, .b=2, .c=3, .d=4, .e=5, .f=6, .g=7, .h=8.8f, .i=9.9, .j=10}; +struct write_example1 ex1; +ex1.a=1; +ex1.b=2; +ex1.c=3; +ex1.d=4; +ex1.e=5; +ex1.f=6; +ex1.g=7; +ex1.h=8.8f; +ex1.i=9.9; +ex1.j=10; + dyn_type *type = NULL; char *result = NULL; int rc = dynType_parseWithStr(write_example1_descriptor, "ex1", NULL, ); @@ -344,8 +355,12 @@ struct write_example2 { }; void writeTest2(void) { -struct write_example2_sub sub1 = { .a = 1, .b = 2 }; -struct write_example2 ex = { .sub1 = }; +struct write_example2_sub sub1; +sub1.a = 1; +sub1.b = 2; + +struct write_example2 ex; +ex.sub1= ex.sub2.c = 3; ex.sub2.d = 4; @@ -378,10 +393,22 @@ struct write_example3 { }; void writeTest3(void) { -struct write_example3_person p1 = {.name = "John", .age = 33}; -struct write_example3_person p2 = {.name = "Peter", .age = 44}; -struct write_example3_person p3 = {.name = "Carol", .age = 55}; -struct write_example3_person p4 = {.name = "Elton", .age = 66}; +struct write_example3_person p1; +p1.name = "John"; +p1.age = 33; + +struct write_example3_person p2; +p2.name = "Peter"; +p2.age = 44; + +struct write_example3_person p3; +p3.name = "Carol"; +p3.age = 55; + +struct write_example3_person p4; +p4.name = "Elton"; +p4.age = 66; + struct write_example3 seq; seq.buf = (struct write_example3_person **) calloc(4, sizeof(void *)); seq.len = seq.cap = 4;
[11/50] celix git commit: CELIX-237: Update in FindFFI.cmake for lib name
CELIX-237: Update in FindFFI.cmake for lib name Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/13b82745 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/13b82745 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/13b82745 Branch: refs/heads/feature/CELIX-230_Refactoring_of_the_shell_command_service Commit: 13b82745e00377c478c93ecfb5c9c6d6172456e9 Parents: 6559744 Author: Pepijn NoltesAuthored: Tue Oct 13 22:48:16 2015 +0200 Committer: Pepijn Noltes Committed: Tue Oct 13 22:48:16 2015 +0200 -- cmake/FindFFI.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/13b82745/cmake/FindFFI.cmake -- diff --git a/cmake/FindFFI.cmake b/cmake/FindFFI.cmake index 15680b7..0493633 100644 --- a/cmake/FindFFI.cmake +++ b/cmake/FindFFI.cmake @@ -32,9 +32,8 @@ endif () mark_as_advanced(GNUTLS_INCLUDE_DIR GNUTLS_LIBRARY) -find_library(FFI_LIBRARY NAMES ffi +find_library(FFI_LIBRARY NAMES ffi libffi PATHS $ENV{FFI_DIR} ${FFI_DIR} /usr/local /opt/local -PATH_SUFFIXES lib HINTS ${PC_LIBFFI_LIBDIR} ${PC_LIBFFI_LIBRARY_DIRS} )
[46/50] celix git commit: CELIX-272: remove arraylist_destroy of exportList (this is allocated in the rsa and also destroyed there)
CELIX-272: remove arraylist_destroy of exportList (this is allocated in the rsa and also destroyed there) Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/80a4f03f Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/80a4f03f Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/80a4f03f Branch: refs/heads/feature/CELIX-230_Refactoring_of_the_shell_command_service Commit: 80a4f03fcaaca8db77205af86aef3d8bd339c02f Parents: 78bb1e3 Author: Bjoern PetriAuthored: Thu Oct 22 15:09:01 2015 +0200 Committer: Bjoern Petri Committed: Thu Oct 22 15:09:01 2015 +0200 -- remote_services/topology_manager/private/src/topology_manager.c | 3 --- 1 file changed, 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/80a4f03f/remote_services/topology_manager/private/src/topology_manager.c -- diff --git a/remote_services/topology_manager/private/src/topology_manager.c b/remote_services/topology_manager/private/src/topology_manager.c index 68be8c8..424c00c 100644 --- a/remote_services/topology_manager/private/src/topology_manager.c +++ b/remote_services/topology_manager/private/src/topology_manager.c @@ -287,9 +287,6 @@ celix_status_t topologyManager_rsaRemoved(void * handle, service_reference_pt re topologyManager_notifyListenersEndpointRemoved(manager, rsa, export); rsa->exportRegistration_close(export); } - -arrayList_destroy(exports_list); -exports_list = NULL; } hashMap_remove(exports, rsa);
[06/50] celix git commit: CELIX-237: Updated log levels for dfi lib
CELIX-237: Updated log levels for dfi lib Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/0da1becf Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/0da1becf Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/0da1becf Branch: refs/heads/feature/CELIX-230_Refactoring_of_the_shell_command_service Commit: 0da1becf6ffdddffd76a3ba36d2e85edb2227637 Parents: 22797e1 Author: Pepijn NoltesAuthored: Tue Oct 13 19:34:16 2015 +0200 Committer: Pepijn Noltes Committed: Tue Oct 13 19:34:16 2015 +0200 -- .../dynamic_function_interface_tst/dyn_closure_tests.cpp | 8 .../dynamic_function_interface_tst/dyn_function_tests.cpp| 7 --- .../dynamic_function_interface_tst/dyn_type_tests.cpp| 2 +- .../dynamic_function_interface_tst/json_rpc_tests.cpp| 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/0da1becf/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_closure_tests.cpp -- diff --git a/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_closure_tests.cpp b/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_closure_tests.cpp index b2b11d7..6a79678 100644 --- a/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_closure_tests.cpp +++ b/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_closure_tests.cpp @@ -132,10 +132,10 @@ static void tests() { TEST_GROUP(DynClosureTests) { void setup() { -dynFunction_logSetup(stdLog, NULL, 3); -dynType_logSetup(stdLog, NULL, 3); -//TODO dynType_logSetup(stdLog, NULL, 4); -dynCommon_logSetup(stdLog, NULL, 3); +int lvl = 1; +dynFunction_logSetup(stdLog, NULL, lvl); +dynType_logSetup(stdLog, NULL, lvl); +dynCommon_logSetup(stdLog, NULL, lvl); g_count = 0; } }; http://git-wip-us.apache.org/repos/asf/celix/blob/0da1becf/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_function_tests.cpp -- diff --git a/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_function_tests.cpp b/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_function_tests.cpp index 14f2f54..d1bc82e 100644 --- a/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_function_tests.cpp +++ b/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_function_tests.cpp @@ -209,9 +209,10 @@ extern "C" { TEST_GROUP(DynFunctionTests) { void setup() { -dynFunction_logSetup(stdLog, NULL, 3); -dynType_logSetup(stdLog, NULL, 3); -dynCommon_logSetup(stdLog, NULL, 3); +int lvl = 1; +dynFunction_logSetup(stdLog, NULL, lvl); +dynType_logSetup(stdLog, NULL, lvl); +dynCommon_logSetup(stdLog, NULL, lvl); } }; http://git-wip-us.apache.org/repos/asf/celix/blob/0da1becf/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_type_tests.cpp -- diff --git a/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_type_tests.cpp b/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_type_tests.cpp index e2fe950..9cf81c5 100644 --- a/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_type_tests.cpp +++ b/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_type_tests.cpp @@ -52,7 +52,7 @@ extern "C" { TEST_GROUP(DynTypeTests) { void setup() { - dynType_logSetup(stdLog, NULL, 4); + dynType_logSetup(stdLog, NULL, 1); } }; http://git-wip-us.apache.org/repos/asf/celix/blob/0da1becf/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/json_rpc_tests.cpp -- diff --git a/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/json_rpc_tests.cpp b/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/json_rpc_tests.cpp index c7a3350..f49f9a5 100644 --- a/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/json_rpc_tests.cpp +++ b/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/json_rpc_tests.cpp @@ -290,7 +290,7 @@ static void stdLog(void *handle, int level, const char *file, int line, const ch TEST_GROUP(JsonRpcTests) { void setup() { -int lvl = 4; +
[40/50] celix git commit: CELIX-237: disabled rsa_dfi for osx builds (2)
CELIX-237: disabled rsa_dfi for osx builds (2) Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/71bf3302 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/71bf3302 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/71bf3302 Branch: refs/heads/feature/CELIX-230_Refactoring_of_the_shell_command_service Commit: 71bf330256aa3294c9eaa0854b620d72a7c3e2f5 Parents: e462854 Author: Bjoern PetriAuthored: Mon Oct 19 16:16:33 2015 +0200 Committer: Bjoern Petri Committed: Mon Oct 19 16:16:33 2015 +0200 -- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/71bf3302/.travis.yml -- diff --git a/.travis.yml b/.travis.yml index 89f11a7..b23d297 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,7 +29,7 @@ script: # RSA_DISCOVERY_SHM is only working on linux, but both compilers (see CELIX-277) # RSA_SHM is only working on linux, but both compilers (see CELIX-277) - cd build -- if [ "$CC" = "clang" OR "$TRAVIS_OS_NAME" = "osx" ]; then export BUILD_OPTS=""; else export BUILD_OPTS="-DBUILD_RSA_REMOTE_SERVICE_ADMIN_DFI=ON"; fi +- if [ "$CC" = "clang"] || [ "$TRAVIS_OS_NAME" = "osx" ]; then export BUILD_OPTS=""; else export BUILD_OPTS="-DBUILD_RSA_REMOTE_SERVICE_ADMIN_DFI=ON"; fi - if [ "$TRAVIS_OS_NAME" = "linux" ]; then cmake -DBUILD_DEPLOYMENT_ADMIN=ON -DBUILD_EXAMPLES=ON -DBUILD_LOG_SERVICE=ON -DBUILD_LOG_WRITER=ON -DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON -DBUILD_RSA_DISCOVERY_SHM=ON -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_SHM=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_SHELL=ON -DBUILD_SHELL_TUI=ON -DBUILD_DEVICE_ACCESS=ON -DBUILD_DEVICE_ACCESS_EXAMPLE=ON -DBUILD_FRAMEWORK_TESTS=OFF -DENABLE_CODE_COVERAGE=ON -DENABLE_TESTING=ON ${BUILD_OPTS} -DCMAKE_INSTALL_PREFIX=../install ..; fi - if [ "$TRAVIS_OS_NAME" = "osx" ]; then cmake -DBUILD_DEPLOYMENT_ADMIN=ON -DBUILD_EXAMPLES=ON -DBUILD_LOG_SERVICE=ON -DBUILD_LOG_WRITER=ON -DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON -DBUILD_RSA_DISCOVERY_SHM=OFF -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_SHM=OFF -DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_SHELL=ON -DBUILD_SHELL_TUI=ON -DBUILD_DEVICE_ACCESS=ON -DBUILD_DEVICE_ACCESS_EXAMPLE=ON -DBUILD_FRAMEWORK_TESTS=OFF -DENABLE_CODE_COVERAGE=ON -DENABLE_TESTING=ON -DFFI_LIBRARY=/usr/local/opt/libffi/lib/libffi.dylib ${BUILD_OPTS} -DCMAKE_INSTALL_PREFIX=../install ..; fi - make all && make deploy && make install-all
[32/50] celix git commit: CELIX-237: Added interface check to that method must return an int. This to always be able to throw "exceptions". disabled printing dyn_types to stdout.
CELIX-237: Added interface check to that method must return an int. This to always be able to throw "exceptions". disabled printing dyn_types to stdout. Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/75773baf Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/75773baf Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/75773baf Branch: refs/heads/feature/CELIX-230_Refactoring_of_the_shell_command_service Commit: 75773baf300fea80a790efa0d7f53a7acb68ef86 Parents: f60ca0d Author: Pepijn NoltesAuthored: Fri Oct 16 13:26:47 2015 +0200 Committer: Pepijn Noltes Committed: Fri Oct 16 13:26:47 2015 +0200 -- .../dynamic_function_interface/dyn_interface.c | 11 +++ .../dynamic_function_interface_tst/dyn_type_tests.cpp| 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/75773baf/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_interface.c -- diff --git a/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_interface.c b/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_interface.c index 9bb7bcc..823957b 100644 --- a/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_interface.c +++ b/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_interface.c @@ -95,6 +95,17 @@ static int dynInterface_checkInterface(dyn_interface_type *intf) { status = ERROR; LOG_ERROR("Parse Error. There must be a header section with a type, version and name entry"); } + +struct method_entry *mEntry = NULL; +TAILQ_FOREACH(mEntry, >methods, entries) { +dyn_type *type = dynFunction_returnType(mEntry->dynFunc); +int descriptor = dynType_descriptorType(type); +if (descriptor != 'N') { +status = ERROR; +LOG_ERROR("Parse Error. Only method with a return type 'N' (native int) are supported. Got return type '%c'\n", descriptor); +break; +} +} } return status; http://git-wip-us.apache.org/repos/asf/celix/blob/75773baf/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_type_tests.cpp -- diff --git a/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_type_tests.cpp b/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_type_tests.cpp index 9cf81c5..4b9bd41 100644 --- a/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_type_tests.cpp +++ b/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_type_tests.cpp @@ -43,7 +43,7 @@ extern "C" { } FILE *stream = fopen("/dev/null", "w"); -dynType_print(type, stdout); +dynType_print(type, stream); fclose(stream); dynType_destroy(type); //printf("--\n\n");
celix git commit: CELIX-230: Removed unneeded install of command_impl.h header
Repository: celix Updated Branches: refs/heads/feature/CELIX-230_Refactoring_of_the_shell_command_service b63c0d9fc -> 97b667949 CELIX-230: Removed unneeded install of command_impl.h header Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/97b66794 Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/97b66794 Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/97b66794 Branch: refs/heads/feature/CELIX-230_Refactoring_of_the_shell_command_service Commit: 97b667949b928d410cc6349253b70a22ea5973f0 Parents: b63c0d9 Author: Pepijn NoltesAuthored: Tue Oct 27 17:00:09 2015 +0100 Committer: Pepijn Noltes Committed: Tue Oct 27 17:00:09 2015 +0100 -- shell/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/celix/blob/97b66794/shell/CMakeLists.txt -- diff --git a/shell/CMakeLists.txt b/shell/CMakeLists.txt index 26252c4..40df757 100644 --- a/shell/CMakeLists.txt +++ b/shell/CMakeLists.txt @@ -39,7 +39,7 @@ if (SHELL) install_bundle(shell HEADERS - public/include/shell.h public/include/command.h public/include/command_impl.h + public/include/shell.h public/include/command.h RESOURCES public/src/command.c )