celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pnol...@apache.org
Subject [27/46] celix git commit: CELIX-417: Initial refactoring for CMake usage
Date Mon, 20 Nov 2017 20:33:24 GMT
http://git-wip-us.apache.org/repos/asf/celix/blob/a1c30887/framework/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/framework/CMakeLists.txt b/framework/CMakeLists.txt
index 2ded2fb..a92910c 100644
--- a/framework/CMakeLists.txt
+++ b/framework/CMakeLists.txt
@@ -15,213 +15,197 @@
 # specific language governing permissions and limitations
 # under the License.
 
-celix_subproject(FRAMEWORK "Option to build the framework shared library" "ON" DEPS UTILS)
-if (FRAMEWORK) 
-    cmake_minimum_required(VERSION 2.6)
-    
-    find_package(ZLIB REQUIRED)
-    find_package(UUID REQUIRED)
-    find_package(CURL REQUIRED)
-
-    include(CPackComponent)
-    
-    #cpack_add_component(framework
-    #	DISPLAY_NAME Framework
-    #    DESCRIPTION "The Apache Celix framework library"
-    #    REQUIRED
-    #)
-
-    #TODO setup intall framework
-    #CELIX_ADD_COMPONENT(framework
-    #	DISPLAY_NAME Framework
-    #    DESCRIPTION "The Apache Celix framework library"
-    #    GROUP all
-    #)
-    
-    add_definitions(-DUSE_FILE32API)
-    include_directories(${ZLIB_INCLUDE_DIR})
-    include_directories(${CURL_INCLUDE_DIR})
-    include_directories(${UUID_INCLUDE_DIR})
-    include_directories("private/include")
-    include_directories("public/include")
-    include_directories("${PROJECT_SOURCE_DIR}/utils/public/include")
-
-	if(WIN32)
-	  set(IO private/src/iowin32.c)
-	endif(WIN32)
-
-    add_library(celix_framework SHARED
-	 private/src/attribute.c private/src/bundle.c private/src/bundle_archive.c private/src/bundle_cache.c
-	 private/src/bundle_context.c private/src/bundle_revision.c private/src/capability.c private/src/celix_errorcodes.c
-	 private/src/filter.c private/src/framework.c private/src/manifest.c private/src/ioapi.c
-	 private/src/manifest_parser.c private/src/miniunz.c private/src/module.c  
-	 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/wire.c
-	 private/src/celix_log.c private/src/celix_launcher.c
-
-	 private/include/attribute.h public/include/framework_exports.h
-
-	 public/include/bundle_context.h public/include/bundle.h
-	 public/include/bundle_activator.h public/include/service_registration.h public/include/service_reference.h
-	 public/include/bundle_archive.h public/include/module.h public/include/service_tracker.h
-	 public/include/service_tracker_customizer.h public/include/requirement.h
-	 
-		${IO}
-	 
-	)
-    set_target_properties(celix_framework PROPERTIES "SOVERSION" 2)
-	if(NOT APPLE)
-      set(UUID ${UUID_LIBRARY})
-    endif()
-    target_link_libraries(celix_framework celix_utils ${UUID} ${ZLIB_LIBRARY} ${CURL_LIBRARIES})
-
-    install(TARGETS celix_framework DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT framework)
-    FILE(GLOB files "public/include/*.h")
-    INSTALL(FILES ${files} DESTINATION include/celix COMPONENT framework)
-    INSTALL(DIRECTORY "${PROJECT_SOURCE_DIR}/cmake/" DESTINATION share/celix/cmake/modules COMPONENT framework) 
-
-
-    if (ENABLE_TESTING)
-        find_package(CppUTest REQUIRED)
-        include_directories(${CPPUTEST_INCLUDE_DIR})
-        add_subdirectory(tst)
-    endif()
-
-
-	celix_subproject(FRAMEWORK_TESTS "Option to build the framework tests" "OFF" DEPS)
-    if (ENABLE_TESTING AND FRAMEWORK_TESTS)
-    	find_package(CppUTest REQUIRED)
-    	
-	    include_directories(${CPPUTEST_INCLUDE_DIR})
-	    include_directories(${CPPUTEST_EXT_INCLUDE_DIR})
-	    include_directories(${PROJECT_SOURCE_DIR}/utils/private/include)
-	    
-        add_executable(attribute_test 
-            private/test/attribute_test.cpp
-            private/src/attribute.c
-            private/src/celix_errorcodes.c
-            private/mock/celix_log_mock.c)
-        target_link_libraries(attribute_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils pthread)
-        
+find_package(ZLIB REQUIRED)
+find_package(UUID REQUIRED)
+find_package(CURL REQUIRED)
+
+if(WIN32)
+    set(IO src/iowin32.c)
+endif(WIN32)
+
+set(SOURCES
+        src/attribute.c src/bundle.c src/bundle_archive.c src/bundle_cache.c
+        src/bundle_context.c src/bundle_revision.c src/capability.c src/celix_errorcodes.c
+        src/filter.c src/framework.c src/manifest.c src/ioapi.c
+        src/manifest_parser.c src/miniunz.c src/module.c
+        src/requirement.c src/resolver.c src/service_reference.c src/service_registration.c
+        src/service_registry.c src/service_tracker.c src/service_tracker_customizer.c
+        src/unzip.c src/wire.c
+        src/celix_log.c src/celix_launcher.c
+        ${IO}
+)
+add_library(framework SHARED ${SOURCES})
+set_target_properties(framework PROPERTIES OUTPUT_NAME "celix_framework")
+target_include_directories(framework PUBLIC include)
+target_include_directories(framework PRIVATE
+        src
+        ${ZLIB_INCLUDE_DIR}
+        ${CURL_INCLUDE_DIR}
+        ${UUID_INCLUDE_DIR}
+)
+target_compile_definitions(framework PRIVATE -DUSE_FILE32API)
+
+include_directories("${PROJECT_SOURCE_DIR}/utils/public/include")
+set_target_properties(framework PROPERTIES "SOVERSION" 2)
+
+if(NOT APPLE)
+  set(UUID ${UUID_LIBRARY})
+endif()
+target_link_libraries(framework PUBLIC Celix::utils)
+target_link_libraries(framework PRIVATE ${UUID} ${ZLIB_LIBRARY} ${CURL_LIBRARIES})
+
+install(TARGETS framework DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT framework)
+
+#Alias setup to match external usage
+add_library(Celix::framework ALIAS framework)
+
+install(DIRECTORY "${PROJECT_SOURCE_DIR}/cmake/" DESTINATION share/celix/cmake/modules
+        COMPONENT framework
+        PATTERN "CMakeCelix-local.cmake" EXCLUDE
+)
+
+
+if (ENABLE_TESTING)
+    find_package(CppUTest REQUIRED)
+    include_directories(${CPPUTEST_INCLUDE_DIR})
+    add_subdirectory(tst)
+endif()
+
+
+celix_subproject(FRAMEWORK_TESTS "Option to build the framework tests" "OFF" DEPS)
+if (ENABLE_TESTING AND FRAMEWORK_TESTS)
+    find_package(CppUTest REQUIRED)
+
+    include_directories(${CPPUTEST_INCLUDE_DIR})
+    include_directories(${CPPUTEST_EXT_INCLUDE_DIR})
+    include_directories(include src)
+
+
+    add_executable(attribute_test
+        private/test/attribute_test.cpp
+        src/attribute.c
+        src/celix_errorcodes.c
+        private/mock/celix_log_mock.c)
+    target_link_libraries(attribute_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} Celix::utils pthread)
+
 #        add_executable(bundle_archive_test 
 #            private/mock/celix_log_mock.c
 #            private/test/bundle_archive_test.cpp
-#            private/src/bundle_revision.c
-#            private/src/manifest.c
-#            private/src/miniunz.c
-#            private/src/unzip.c
-#            private/src/ioapi.c
-#            private/src/properties.c
-#            private/src/bundle_archive.c
-#            private/src/celix_errorcodes.c
-#            private/src/utils.c)
-#        target_link_libraries(bundle_archive_test celix_utils ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} ${ZLIB_LIBRARY} pthread)
-        
-        
-        add_executable(bundle_cache_test 
-            private/test/bundle_cache_test.cpp
-            private/mock/bundle_archive_mock.c
-            private/mock/properties_mock.c
-            private/src/bundle_cache.c
-            private/src/celix_errorcodes.c
-            private/mock/celix_log_mock.c)
-        target_link_libraries(bundle_cache_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils pthread)
-	    
-        add_executable(bundle_context_test 
-            private/test/bundle_context_test.cpp
-            private/mock/bundle_mock.c
-            private/mock/framework_mock.c
-            private/mock/service_registry_mock.c
-            private/src/bundle_context.c
-            private/src/celix_errorcodes.c
-            private/mock/celix_log_mock.c)
-        target_link_libraries(bundle_context_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils pthread)
-	    
-        add_executable(bundle_revision_test 
-            private/test/bundle_revision_test.cpp
-            private/mock/miniunz_mock.c
-            private/mock/manifest_mock.c
-            private/src/bundle_revision.c
-            private/src/celix_errorcodes.c
-            private/mock/celix_log_mock.c)
-        target_link_libraries(bundle_revision_test ${ZLIB_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils pthread)
-	    
-        add_executable(bundle_test 
-            private/test/bundle_test.cpp
-            private/mock/framework_mock.c
-            private/mock/module_mock.c
-            private/mock/bundle_archive_mock.c
-            private/mock/bundle_revision_mock.c
-            private/mock/resolver_mock.c
-            private/mock/version_mock.c
-            private/src/bundle.c
-            private/src/celix_errorcodes.c
-            private/mock/celix_log_mock.c)
-        target_link_libraries(bundle_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils pthread)
-	    
-        add_executable(capability_test 
-            private/test/capability_test.cpp
-            private/mock/attribute_mock.c
-            private/mock/version_mock.c
-            private/src/capability.c
-            private/src/celix_errorcodes.c
-            private/mock/celix_log_mock.c)
-        target_link_libraries(capability_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils pthread)
-        
-        add_executable(celix_errorcodes_test 
-            private/test/celix_errorcodes_test.cpp
-            private/src/celix_errorcodes.c)
-	   	target_link_libraries(celix_errorcodes_test ${CPPUTEST_LIBRARY})
-	    
-        add_executable(filter_test 
-            private/test/filter_test.cpp
-            private/src/filter.c
-            private/src/celix_errorcodes.c
-            private/mock/celix_log_mock.c)
-        target_link_libraries(filter_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils pthread)
-	    
-        add_executable(framework_test 
-            private/test/framework_test.cpp
-            #private/mock/properties_mock.c
-            private/mock/resolver_mock.c
-            private/mock/service_reference_mock.c
-            private/mock/service_registry_mock.c
-            private/mock/service_registration_mock.c
-            private/mock/filter_mock.c
-            private/mock/bundle_mock.c
-            private/mock/bundle_context_mock.c
-            private/mock/module_mock.c
-            private/mock/bundle_archive_mock.c
-            private/mock/bundle_revision_mock.c
-            private/mock/bundle_cache_mock.c
-            private/mock/manifest_mock.c
-            private/src/celix_errorcodes.c
-            private/mock/celix_log_mock.c
-            private/src/framework.c)
-        target_link_libraries(framework_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} ${UUID} celix_utils pthread dl)
-    
-        add_executable(manifest_parser_test 
-            private/test/manifest_parser_test.cpp
-            private/mock/manifest_mock.c
-            private/mock/version_mock.c
-            private/mock/version_range_mock.c
-            private/src/attribute.c
-            private/src/capability.c
-            private/src/requirement.c
-            private/src/manifest_parser.c
-            private/src/celix_errorcodes.c
-            private/mock/celix_log_mock.c)
-        target_link_libraries(manifest_parser_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils pthread)
-	    
-        add_executable(manifest_test 
-            private/test/manifest_test.cpp
-            private/mock/properties_mock.c
-            private/src/manifest.c
-            private/src/celix_errorcodes.c
-            private/mock/celix_log_mock.c)
-        target_link_libraries(manifest_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils pthread)
-	    
+#            src/bundle_revision.c
+#            src/manifest.c
+#            src/miniunz.c
+#            src/unzip.c
+#            src/ioapi.c
+#            src/properties.c
+#            src/bundle_archive.c
+#            src/celix_errorcodes.c
+#            src/utils.c)
+#        target_link_libraries(bundle_archive_test Celix::utils ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} ${ZLIB_LIBRARY} pthread)
+
+
+    add_executable(bundle_cache_test
+        private/test/bundle_cache_test.cpp
+        private/mock/bundle_archive_mock.c
+        private/mock/properties_mock.c
+        src/bundle_cache.c
+        src/celix_errorcodes.c
+        private/mock/celix_log_mock.c)
+    target_link_libraries(bundle_cache_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} Celix::utils pthread)
+
+    add_executable(bundle_context_test
+        private/test/bundle_context_test.cpp
+        private/mock/bundle_mock.c
+        private/mock/framework_mock.c
+        private/mock/service_registry_mock.c
+        src/bundle_context.c
+        src/celix_errorcodes.c
+        private/mock/celix_log_mock.c)
+    target_link_libraries(bundle_context_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} Celix::utils pthread)
+
+    add_executable(bundle_revision_test
+        private/test/bundle_revision_test.cpp
+        private/mock/miniunz_mock.c
+        private/mock/manifest_mock.c
+        src/bundle_revision.c
+        src/celix_errorcodes.c
+        private/mock/celix_log_mock.c)
+    target_link_libraries(bundle_revision_test ${ZLIB_LIBRARY} ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} Celix::utils pthread)
+
+    add_executable(bundle_test
+        private/test/bundle_test.cpp
+        private/mock/framework_mock.c
+        private/mock/module_mock.c
+        private/mock/bundle_archive_mock.c
+        private/mock/bundle_revision_mock.c
+        private/mock/resolver_mock.c
+        private/mock/version_mock.c
+        src/bundle.c
+        src/celix_errorcodes.c
+        private/mock/celix_log_mock.c)
+    target_link_libraries(bundle_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} Celix::utils pthread)
+
+    add_executable(capability_test
+        private/test/capability_test.cpp
+        private/mock/attribute_mock.c
+        private/mock/version_mock.c
+        src/capability.c
+        src/celix_errorcodes.c
+        private/mock/celix_log_mock.c)
+    target_link_libraries(capability_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} Celix::utils pthread)
+
+    add_executable(celix_errorcodes_test
+        private/test/celix_errorcodes_test.cpp
+        src/celix_errorcodes.c)
+    target_link_libraries(celix_errorcodes_test ${CPPUTEST_LIBRARY} Celix::utils)
+
+    add_executable(filter_test
+        private/test/filter_test.cpp
+        src/filter.c
+        src/celix_errorcodes.c
+        private/mock/celix_log_mock.c)
+    target_link_libraries(filter_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} Celix::utils pthread)
+
+    add_executable(framework_test
+        private/test/framework_test.cpp
+        #private/mock/properties_mock.c
+        private/mock/resolver_mock.c
+        private/mock/service_reference_mock.c
+        private/mock/service_registry_mock.c
+        private/mock/service_registration_mock.c
+        private/mock/filter_mock.c
+        private/mock/bundle_mock.c
+        private/mock/bundle_context_mock.c
+        private/mock/module_mock.c
+        private/mock/bundle_archive_mock.c
+        private/mock/bundle_revision_mock.c
+        private/mock/bundle_cache_mock.c
+        private/mock/manifest_mock.c
+        src/celix_errorcodes.c
+        private/mock/celix_log_mock.c
+        src/framework.c)
+    target_link_libraries(framework_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} ${UUID} Celix::utils pthread dl)
+
+    add_executable(manifest_parser_test
+        private/test/manifest_parser_test.cpp
+        private/mock/manifest_mock.c
+        private/mock/version_mock.c
+        private/mock/version_range_mock.c
+        src/attribute.c
+        src/capability.c
+        src/requirement.c
+        src/manifest_parser.c
+        src/celix_errorcodes.c
+        private/mock/celix_log_mock.c)
+    target_link_libraries(manifest_parser_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} Celix::utils pthread)
+
+    add_executable(manifest_test
+        private/test/manifest_test.cpp
+        private/mock/properties_mock.c
+        src/manifest.c
+        src/celix_errorcodes.c
+        private/mock/celix_log_mock.c)
+    target_link_libraries(manifest_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} Celix::utils pthread)
+
 #        add_executable(module_test 
 #            private/test/module_test.cpp
 #            private/mock/bundle_mock.c
@@ -231,19 +215,19 @@ if (FRAMEWORK)
 #            private/mock/capability_mock.c
 #            private/mock/requirement_mock.c
 #            private/mock/wire_mock.c
-#            private/src/module.c)
-#        target_link_libraries(module_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils pthread)
-	    
-        add_executable(requirement_test 
-            private/test/requirement_test.cpp
-            private/mock/attribute_mock.c
-            private/mock/capability_mock.c
-            private/mock/version_range_mock.c
-            private/src/requirement.c
-            private/src/celix_errorcodes.c
-            private/mock/celix_log_mock.c)
-        target_link_libraries(requirement_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils pthread)
-	    
+#            src/module.c)
+#        target_link_libraries(module_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} Celix::utils pthread)
+
+    add_executable(requirement_test
+        private/test/requirement_test.cpp
+        private/mock/attribute_mock.c
+        private/mock/capability_mock.c
+        private/mock/version_range_mock.c
+        src/requirement.c
+        src/celix_errorcodes.c
+        private/mock/celix_log_mock.c)
+    target_link_libraries(requirement_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} Celix::utils pthread)
+
 #        add_executable(resolver_test 
 #            private/test/resolver_test.cpp
 #            private/mock/bundle_mock.c
@@ -251,123 +235,123 @@ if (FRAMEWORK)
 #            private/mock/capability_mock.c
 #            private/mock/manifest_parser_mock.c
 #            private/mock/version_mock.c
-#            private/src/wire.c
-#            private/src/module.c
-#            private/src/resolver.c
-#            private/src/celix_errorcodes.c
+#            src/wire.c
+#            src/module.c
+#            src/resolver.c
+#            src/celix_errorcodes.c
 #            private/mock/celix_log_mock.c)
-#        target_link_libraries(resolver_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils pthread)
-	    
-        add_executable(service_reference_test 
-            private/test/service_reference_test.cpp
-            private/mock/properties_mock.c
-            private/mock/service_registration_mock.c
-            private/mock/service_registry_mock.c
-            private/src/service_reference.c
-            private/src/celix_errorcodes.c
-            private/mock/celix_log_mock.c)
-        target_link_libraries(service_reference_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils pthread)
-	    
-	     add_executable(service_registration_test 
-            private/test/service_registration_test.cpp
-            private/mock/service_registry_mock.c
-            private/src/service_registration.c
-            private/src/celix_errorcodes.c
-            private/mock/celix_log_mock.c)
-        target_link_libraries(service_registration_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils pthread)
-	    
-	    
-        add_executable(service_registry_test
-            private/test/service_registry_test.cpp
-            private/mock/framework_mock.c
-            private/mock/bundle_mock.c
-            private/mock/filter_mock.c
-            private/mock/service_reference_mock.c
-            private/mock/service_registration_mock.c
-            private/mock/properties_mock.c
-            private/src/service_registry.c
-            private/mock/module_mock.c
-            private/src/celix_errorcodes.c
-            private/mock/celix_log_mock.c)
-        target_link_libraries(service_registry_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils pthread)
-	    
-        add_executable(service_tracker_customizer_test 
-            private/test/service_tracker_customizer_test.cpp
-            private/mock/service_reference_mock.c
-            private/src/service_tracker_customizer.c
-            private/src/celix_errorcodes.c
-            private/mock/celix_log_mock.c) 
-        target_link_libraries(service_tracker_customizer_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils pthread)
-	    
+#        target_link_libraries(resolver_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} Celix::utils pthread)
+
+    add_executable(service_reference_test
+        private/test/service_reference_test.cpp
+        private/mock/properties_mock.c
+        private/mock/service_registration_mock.c
+        private/mock/service_registry_mock.c
+        src/service_reference.c
+        src/celix_errorcodes.c
+        private/mock/celix_log_mock.c)
+    target_link_libraries(service_reference_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} Celix::utils pthread)
+
+     add_executable(service_registration_test
+        private/test/service_registration_test.cpp
+        private/mock/service_registry_mock.c
+        src/service_registration.c
+        src/celix_errorcodes.c
+        private/mock/celix_log_mock.c)
+    target_link_libraries(service_registration_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} Celix::utils pthread)
+
+
+    add_executable(service_registry_test
+        private/test/service_registry_test.cpp
+        private/mock/framework_mock.c
+        private/mock/bundle_mock.c
+        private/mock/filter_mock.c
+        private/mock/service_reference_mock.c
+        private/mock/service_registration_mock.c
+        private/mock/properties_mock.c
+        src/service_registry.c
+        private/mock/module_mock.c
+        src/celix_errorcodes.c
+        private/mock/celix_log_mock.c)
+    target_link_libraries(service_registry_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} Celix::utils pthread)
+
+    add_executable(service_tracker_customizer_test
+        private/test/service_tracker_customizer_test.cpp
+        private/mock/service_reference_mock.c
+        src/service_tracker_customizer.c
+        src/celix_errorcodes.c
+        private/mock/celix_log_mock.c)
+    target_link_libraries(service_tracker_customizer_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} Celix::utils pthread)
+
 #        add_executable(service_tracker_test 
 #            private/test/service_tracker_test.cpp 
 #            private/mock/bundle_context_mock.c
 #            private/mock/service_reference_mock.c 
 #            private/mock/service_tracker_customizer_mock.c
-#            private/src/service_tracker.c
-#            private/src/celix_errorcodes.c
+#            src/service_tracker.c
+#            src/celix_errorcodes.c
 #            private/mock/celix_log_mock.c)
-#        target_link_libraries(service_tracker_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} celix_utils pthread)
-        
-	    
-	    add_executable(wire_test
-	       private/mock/requirement_mock.c
-	       private/mock/capability_mock.c
-	       private/mock/module_mock.c
-            private/src/celix_errorcodes.c
-            private/mock/celix_log_mock.c
-            private/src/wire.c
-	        private/test/wire_test.cpp) 
-		target_link_libraries(wire_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY})
-		
-		configure_file(private/resources-test/manifest_sections.txt ${CMAKE_BINARY_DIR}/framework/resources-test/manifest_sections.txt COPYONLY)
-		configure_file(private/resources-test/manifest.txt ${CMAKE_BINARY_DIR}/framework/resources-test/manifest.txt COPYONLY)
-				
-		#set_target_properties(wire_test PROPERTIES COMPILE_FLAGS "-include ${CPPUTEST_INCLUDE_DIR}/CppUTest/MemoryLeakDetectorMallocMacros.h -include ${CPPUTEST_INCLUDE_DIR}/CppUTest/MemoryLeakDetectorNewMacros.h")
-			
-        add_test(NAME attribute_test COMMAND attribute_test)
+#        target_link_libraries(service_tracker_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} Celix::utils pthread)
+
+
+    add_executable(wire_test
+       private/mock/requirement_mock.c
+       private/mock/capability_mock.c
+       private/mock/module_mock.c
+        src/celix_errorcodes.c
+        private/mock/celix_log_mock.c
+        src/wire.c
+        private/test/wire_test.cpp)
+    target_link_libraries(wire_test ${CPPUTEST_LIBRARY} ${CPPUTEST_EXT_LIBRARY} Celix::utils)
+
+    configure_file(private/resources-test/manifest_sections.txt ${CMAKE_BINARY_DIR}/framework/resources-test/manifest_sections.txt COPYONLY)
+    configure_file(private/resources-test/manifest.txt ${CMAKE_BINARY_DIR}/framework/resources-test/manifest.txt COPYONLY)
+
+    #set_target_properties(wire_test PROPERTIES COMPILE_FLAGS "-include ${CPPUTEST_INCLUDE_DIR}/CppUTest/MemoryLeakDetectorMallocMacros.h -include ${CPPUTEST_INCLUDE_DIR}/CppUTest/MemoryLeakDetectorNewMacros.h")
+
+    add_test(NAME attribute_test COMMAND attribute_test)
 #        add_test(NAME bundle_archive_test COMMAND bundle_archive_test)
-        add_test(NAME bundle_cache_test COMMAND bundle_cache_test)
-        add_test(NAME bundle_context_test COMMAND bundle_context_test)
-        add_test(NAME bundle_revision_test  COMMAND bundle_revision_test)
-        add_test(NAME bundle_test COMMAND bundle_test)
-        add_test(NAME capability_test COMMAND capability_test)
-        add_test(NAME celix_errorcodes_test COMMAND celix_errorcodes_test)
-        add_test(NAME filter_test COMMAND filter_test)
-        add_test(NAME framework_test COMMAND framework_test)
-        add_test(NAME manifest_parser_test COMMAND manifest_parser_test)
-        add_test(NAME manifest_test COMMAND manifest_test)
+    add_test(NAME bundle_cache_test COMMAND bundle_cache_test)
+    add_test(NAME bundle_context_test COMMAND bundle_context_test)
+    add_test(NAME bundle_revision_test  COMMAND bundle_revision_test)
+    add_test(NAME bundle_test COMMAND bundle_test)
+    add_test(NAME capability_test COMMAND capability_test)
+    add_test(NAME celix_errorcodes_test COMMAND celix_errorcodes_test)
+    add_test(NAME filter_test COMMAND filter_test)
+    add_test(NAME framework_test COMMAND framework_test)
+    add_test(NAME manifest_parser_test COMMAND manifest_parser_test)
+    add_test(NAME manifest_test COMMAND manifest_test)
 #        add_test(NAME module_test COMMAND module_test)
-        add_test(NAME requirement_test COMMAND requirement_test)
+    add_test(NAME requirement_test COMMAND requirement_test)
 #        add_test(NAME resolver_test COMMAND resolver_test)
-        add_test(NAME service_reference_test COMMAND service_reference_test)
-        add_test(NAME service_registration_test COMMAND service_registration_test)
-        add_test(NAME service_registry_test COMMAND service_registry_test)
-        add_test(NAME service_tracker_customizer_test COMMAND service_tracker_customizer_test)
+    add_test(NAME service_reference_test COMMAND service_reference_test)
+    add_test(NAME service_registration_test COMMAND service_registration_test)
+    add_test(NAME service_registry_test COMMAND service_registry_test)
+    add_test(NAME service_tracker_customizer_test COMMAND service_tracker_customizer_test)
 #        add_test(NAME service_tracker_test COMMAND service_tracker_test)
-	add_test(NAME wire_test COMMAND wire_test)
-	    
-	SETUP_TARGET_FOR_COVERAGE(attribute_test attribute_test ${CMAKE_BINARY_DIR}/coverage/attribute_test/attribute_test)
+add_test(NAME wire_test COMMAND wire_test)
+
+SETUP_TARGET_FOR_COVERAGE(attribute_test attribute_test ${CMAKE_BINARY_DIR}/coverage/attribute_test/attribute_test)
 #        SETUP_TARGET_FOR_COVERAGE(bundle_archive_test bundle_archive_test ${CMAKE_BINARY_DIR}/coverage/bundle_archive_test/bundle_archive_test)
-        SETUP_TARGET_FOR_COVERAGE(bundle_cache_test bundle_cache_test ${CMAKE_BINARY_DIR}/coverage/bundle_cache_test/bundle_cache_test)
-        SETUP_TARGET_FOR_COVERAGE(bundle_context_test bundle_context_test ${CMAKE_BINARY_DIR}/coverage/bundle_context_test/bundle_context_test)
-        SETUP_TARGET_FOR_COVERAGE(bundle_revision_test bundle_revision_test ${CMAKE_BINARY_DIR}/coverage/bundle_revision_test/bundle_revision_test)
-        SETUP_TARGET_FOR_COVERAGE(bundle_test bundle_test ${CMAKE_BINARY_DIR}/coverage/bundle_test/bundle_test)
-        SETUP_TARGET_FOR_COVERAGE(capability_test capability_test ${CMAKE_BINARY_DIR}/coverage/capability_test/capability_test)
-        SETUP_TARGET_FOR_COVERAGE(celix_errorcodes_test celix_errorcodes_test ${CMAKE_BINARY_DIR}/coverage/celix_errorcodes_test/celix_errorcodes_test)
-        SETUP_TARGET_FOR_COVERAGE(filter_test filter_test ${CMAKE_BINARY_DIR}/coverage/filter_test/filter_test)
-        SETUP_TARGET_FOR_COVERAGE(framework_test framework_test ${CMAKE_BINARY_DIR}/coverage/framework_test/framework_test)
-        SETUP_TARGET_FOR_COVERAGE(manifest_parser_test manifest_parser_test ${CMAKE_BINARY_DIR}/coverage/manifest_parser_test/manifest_parser_test)
-        SETUP_TARGET_FOR_COVERAGE(manifest_test manifest_test ${CMAKE_BINARY_DIR}/coverage/manifest_test/manifest_test)
+    SETUP_TARGET_FOR_COVERAGE(bundle_cache_test bundle_cache_test ${CMAKE_BINARY_DIR}/coverage/bundle_cache_test/bundle_cache_test)
+    SETUP_TARGET_FOR_COVERAGE(bundle_context_test bundle_context_test ${CMAKE_BINARY_DIR}/coverage/bundle_context_test/bundle_context_test)
+    SETUP_TARGET_FOR_COVERAGE(bundle_revision_test bundle_revision_test ${CMAKE_BINARY_DIR}/coverage/bundle_revision_test/bundle_revision_test)
+    SETUP_TARGET_FOR_COVERAGE(bundle_test bundle_test ${CMAKE_BINARY_DIR}/coverage/bundle_test/bundle_test)
+    SETUP_TARGET_FOR_COVERAGE(capability_test capability_test ${CMAKE_BINARY_DIR}/coverage/capability_test/capability_test)
+    SETUP_TARGET_FOR_COVERAGE(celix_errorcodes_test celix_errorcodes_test ${CMAKE_BINARY_DIR}/coverage/celix_errorcodes_test/celix_errorcodes_test)
+    SETUP_TARGET_FOR_COVERAGE(filter_test filter_test ${CMAKE_BINARY_DIR}/coverage/filter_test/filter_test)
+    SETUP_TARGET_FOR_COVERAGE(framework_test framework_test ${CMAKE_BINARY_DIR}/coverage/framework_test/framework_test)
+    SETUP_TARGET_FOR_COVERAGE(manifest_parser_test manifest_parser_test ${CMAKE_BINARY_DIR}/coverage/manifest_parser_test/manifest_parser_test)
+    SETUP_TARGET_FOR_COVERAGE(manifest_test manifest_test ${CMAKE_BINARY_DIR}/coverage/manifest_test/manifest_test)
 #        SETUP_TARGET_FOR_COVERAGE(module_test module_test ${CMAKE_BINARY_DIR}/coverage/module_test/module_test)
-        SETUP_TARGET_FOR_COVERAGE(requirement_test requirement_test ${CMAKE_BINARY_DIR}/coverage/requirement_test/requirement_test)
+    SETUP_TARGET_FOR_COVERAGE(requirement_test requirement_test ${CMAKE_BINARY_DIR}/coverage/requirement_test/requirement_test)
 #        SETUP_TARGET_FOR_COVERAGE(resolver_test resolver_test ${CMAKE_BINARY_DIR}/coverage/resolver_test/resolver_test)
-        SETUP_TARGET_FOR_COVERAGE(service_reference_test service_reference_test ${CMAKE_BINARY_DIR}/coverage/service_reference_test/service_reference_test)
-        SETUP_TARGET_FOR_COVERAGE(service_registration_test service_registration_test ${CMAKE_BINARY_DIR}/coverage/service_registration_test/service_registration_test)
-        SETUP_TARGET_FOR_COVERAGE(service_registry_test service_registry_test ${CMAKE_BINARY_DIR}/coverage/service_registry_test/service_registry_test)
-        SETUP_TARGET_FOR_COVERAGE(service_tracker_customizer_test service_tracker_customizer_test ${CMAKE_BINARY_DIR}/coverage/service_tracker_customizer_test/service_tracker_customizer_test)
+    SETUP_TARGET_FOR_COVERAGE(service_reference_test service_reference_test ${CMAKE_BINARY_DIR}/coverage/service_reference_test/service_reference_test)
+    SETUP_TARGET_FOR_COVERAGE(service_registration_test service_registration_test ${CMAKE_BINARY_DIR}/coverage/service_registration_test/service_registration_test)
+    SETUP_TARGET_FOR_COVERAGE(service_registry_test service_registry_test ${CMAKE_BINARY_DIR}/coverage/service_registry_test/service_registry_test)
+    SETUP_TARGET_FOR_COVERAGE(service_tracker_customizer_test service_tracker_customizer_test ${CMAKE_BINARY_DIR}/coverage/service_tracker_customizer_test/service_tracker_customizer_test)
 #        SETUP_TARGET_FOR_COVERAGE(service_tracker_test service_tracker_test ${CMAKE_BINARY_DIR}/coverage/service_tracker_test/service_tracker_test)
-		SETUP_TARGET_FOR_COVERAGE(wire_test wire_test ${CMAKE_BINARY_DIR}/coverage/wire_test/wire_test)
-		
-	endif (ENABLE_TESTING AND FRAMEWORK_TESTS)
-endif (FRAMEWORK)
+    SETUP_TARGET_FOR_COVERAGE(wire_test wire_test ${CMAKE_BINARY_DIR}/coverage/wire_test/wire_test)
+
+endif (ENABLE_TESTING AND FRAMEWORK_TESTS)
+

http://git-wip-us.apache.org/repos/asf/celix/blob/a1c30887/framework/include/archive.h
----------------------------------------------------------------------
diff --git a/framework/include/archive.h b/framework/include/archive.h
new file mode 100644
index 0000000..f51b960
--- /dev/null
+++ b/framework/include/archive.h
@@ -0,0 +1,58 @@
+/*
+ *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.
+ */
+/**
+ *
+ * @defgroup Archive Archive
+ * @ingroup framework
+ * @{
+ *
+ *  \author    	<a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
+ *  \date      	May 31, 2010
+ *  \copyright	Apache License, Version 2.0
+ */
+#ifndef ARCHIVE_H_
+#define ARCHIVE_H_
+
+#include "celix_errno.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Extracts the bundle pointed to by bundleName to the given root.
+ *
+ * @param bundleName location of the bundle to extract.
+ * @param revisionRoot directory to where the bundle must be extracted.
+ *
+ * @return Status code indication failure or success:
+ * 		- CELIX_SUCCESS when no errors are encountered.
+ * 		- CELIX_FILE_IO_EXCEPTION If the zip file cannot be extracted.
+ */
+celix_status_t extractBundle(const char *bundleName, const char *revisionRoot);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ARCHIVE_H_ */
+
+/**
+ * @}
+ */

http://git-wip-us.apache.org/repos/asf/celix/blob/a1c30887/framework/include/bundle.h
----------------------------------------------------------------------
diff --git a/framework/include/bundle.h b/framework/include/bundle.h
new file mode 100644
index 0000000..3d93bbd
--- /dev/null
+++ b/framework/include/bundle.h
@@ -0,0 +1,139 @@
+/**
+ *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.
+ */
+/*
+ * bundle.h
+ *
+ *  \date       Mar 23, 2010
+ *  \author    	<a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
+ *  \copyright	Apache License, Version 2.0
+ */
+
+#ifndef BUNDLE_H_
+#define BUNDLE_H_
+
+typedef struct bundle * bundle_pt;
+
+#include "celix_errno.h"
+#include "bundle_state.h"
+#include "bundle_archive.h"
+#include "framework.h"
+#include "wire.h"
+#include "module.h"
+#include "service_reference.h"
+#include "bundle_context.h"
+#include "celix_log.h"
+#include "celix_threads.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+FRAMEWORK_EXPORT celix_status_t bundle_create(bundle_pt *bundle);
+
+FRAMEWORK_EXPORT celix_status_t
+bundle_createFromArchive(bundle_pt *bundle, framework_pt framework, bundle_archive_pt archive);
+
+FRAMEWORK_EXPORT celix_status_t bundle_destroy(bundle_pt bundle);
+
+FRAMEWORK_EXPORT celix_status_t bundle_isSystemBundle(bundle_pt bundle, bool *systemBundle);
+
+FRAMEWORK_EXPORT celix_status_t bundle_getArchive(bundle_pt bundle, bundle_archive_pt *archive);
+
+FRAMEWORK_EXPORT celix_status_t bundle_getCurrentModule(bundle_pt bundle, module_pt *module);
+
+FRAMEWORK_EXPORT array_list_pt bundle_getModules(bundle_pt bundle);
+
+FRAMEWORK_EXPORT void *bundle_getHandle(bundle_pt bundle);
+
+FRAMEWORK_EXPORT void bundle_setHandle(bundle_pt bundle, void *handle);
+
+FRAMEWORK_EXPORT activator_pt bundle_getActivator(bundle_pt bundle);
+
+FRAMEWORK_EXPORT celix_status_t bundle_setActivator(bundle_pt bundle, activator_pt activator);
+
+FRAMEWORK_EXPORT celix_status_t bundle_getContext(bundle_pt bundle, bundle_context_pt *context);
+
+FRAMEWORK_EXPORT celix_status_t bundle_setContext(bundle_pt bundle, bundle_context_pt context);
+
+FRAMEWORK_EXPORT celix_status_t bundle_getEntry(bundle_pt bundle, const char *name, char **entry);
+
+FRAMEWORK_EXPORT celix_status_t bundle_start(bundle_pt bundle);
+
+FRAMEWORK_EXPORT celix_status_t bundle_startWithOptions(bundle_pt bundle, int options);
+
+FRAMEWORK_EXPORT celix_status_t bundle_update(bundle_pt bundle, const char *inputFile);
+
+FRAMEWORK_EXPORT celix_status_t bundle_stop(bundle_pt bundle);
+
+FRAMEWORK_EXPORT celix_status_t bundle_stopWithOptions(bundle_pt bundle, int options);
+
+FRAMEWORK_EXPORT celix_status_t bundle_uninstall(bundle_pt bundle);
+
+FRAMEWORK_EXPORT celix_status_t bundle_setState(bundle_pt bundle, bundle_state_e state);
+
+FRAMEWORK_EXPORT celix_status_t bundle_setPersistentStateInactive(bundle_pt bundle);
+
+FRAMEWORK_EXPORT celix_status_t bundle_setPersistentStateUninstalled(bundle_pt bundle);
+
+FRAMEWORK_EXPORT void uninstallBundle(bundle_pt bundle);
+
+FRAMEWORK_EXPORT celix_status_t bundle_revise(bundle_pt bundle, const char *location, const char *inputFile);
+
+FRAMEWORK_EXPORT celix_status_t bundle_addModule(bundle_pt bundle, module_pt module);
+
+FRAMEWORK_EXPORT celix_status_t bundle_closeModules(bundle_pt bundle);
+
+// Service Reference Functions
+FRAMEWORK_EXPORT array_list_pt getUsingBundles(service_reference_pt reference);
+
+FRAMEWORK_EXPORT int compareTo(service_reference_pt a, service_reference_pt b);
+
+FRAMEWORK_EXPORT celix_status_t bundle_getState(bundle_pt bundle, bundle_state_e *state);
+
+FRAMEWORK_EXPORT celix_status_t bundle_isLockable(bundle_pt bundle, bool *lockable);
+
+FRAMEWORK_EXPORT celix_status_t bundle_getLockingThread(bundle_pt bundle, celix_thread_t *thread);
+
+FRAMEWORK_EXPORT celix_status_t bundle_lock(bundle_pt bundle, bool *locked);
+
+FRAMEWORK_EXPORT celix_status_t bundle_unlock(bundle_pt bundle, bool *unlocked);
+
+FRAMEWORK_EXPORT celix_status_t bundle_closeAndDelete(bundle_pt bundle);
+
+FRAMEWORK_EXPORT celix_status_t bundle_close(bundle_pt bundle);
+
+FRAMEWORK_EXPORT celix_status_t bundle_refresh(bundle_pt bundle);
+
+FRAMEWORK_EXPORT celix_status_t bundle_getBundleId(bundle_pt bundle, long *id);
+
+FRAMEWORK_EXPORT celix_status_t bundle_getRegisteredServices(bundle_pt bundle, array_list_pt *list);
+
+FRAMEWORK_EXPORT celix_status_t bundle_getServicesInUse(bundle_pt bundle, array_list_pt *list);
+
+FRAMEWORK_EXPORT celix_status_t bundle_setFramework(bundle_pt bundle, framework_pt framework);
+
+FRAMEWORK_EXPORT celix_status_t bundle_getFramework(bundle_pt bundle, framework_pt *framework);
+
+FRAMEWORK_EXPORT celix_status_t bundle_getBundleLocation(bundle_pt bundle, const char **location);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BUNDLE_H_ */

http://git-wip-us.apache.org/repos/asf/celix/blob/a1c30887/framework/include/bundle_activator.h
----------------------------------------------------------------------
diff --git a/framework/include/bundle_activator.h b/framework/include/bundle_activator.h
new file mode 100644
index 0000000..1027351
--- /dev/null
+++ b/framework/include/bundle_activator.h
@@ -0,0 +1,126 @@
+/*
+ *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.
+ */
+/**
+ *
+ * @defgroup BundleActivator BundleActivator
+ * @ingroup framework
+ * @{
+ *	\brief		Customizes the starting and stopping of a bundle.
+ *	\details	\ref BundleActivator is a header that must be implemented by every
+ * 				bundle. The Framework creates/starts/stops/destroys activator instances using the
+ * 				functions described in this header. If the bundleActivator_start()
+ * 				function executes successfully, it is guaranteed that the same instance's
+ * 				bundleActivator_stop() function will be called when the bundle is
+ * 				to be stopped. The same applies to the bundleActivator_create() and
+ * 				bundleActivator_destroy() functions.
+ * 				The Framework must not concurrently call the activator functions.
+ *  \author    	<a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
+ *  \date      	March 18, 2010
+ *  \copyright	Apache License, Version 2.0
+ */
+#ifndef BUNDLE_ACTIVATOR_H_
+#define BUNDLE_ACTIVATOR_H_
+
+#include "bundle_context.h"
+#include "framework_exports.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Called when this bundle is started so the bundle can create an instance for its activator.
+ * The framework does not assume any type for the activator instance, this is implementation specific.
+ * The activator instance is handle as a void pointer by the framework, the implementation must cast it to the
+ * implementation specific type.
+ *
+ * @param context The execution context of the bundle being started.
+ * @param[out] userData A pointer to the specific activator instance used by this bundle.
+ *
+ * @return Status code indication failure or success:
+ * 		- CELIX_SUCCESS when no errors are encountered.
+ * 		- Any other status code will mark the bundle as stopped and the framework will remove this
+ * 		  bundle's listeners, unregister all services, and release all services used by this bundle.
+ */
+ACTIVATOR_EXPORT celix_status_t bundleActivator_create(bundle_context_pt context_ptr, void **userData);
+
+/**
+ * Called when this bundle is started so the Framework can perform the bundle-specific activities necessary
+ * to start this bundle. This method can be used to register services or to allocate any resources that this
+ * bundle needs.
+ *
+ * <p>
+ * This method must complete and return to its caller in a timely manner.
+ *
+ * @param userData The activator instance to be used.
+ * @param context The execution context of the bundle being started.
+ *
+ * @return Status code indication failure or success:
+ * 		- CELIX_SUCCESS when no errors are encountered.
+ * 		- Any other status code will mark the bundle as stopped and the framework will remove this
+ * 		  bundle's listeners, unregister all services, and release all services used by this bundle.
+ */
+ACTIVATOR_EXPORT celix_status_t bundleActivator_start(void *userData, bundle_context_pt context);
+
+/**
+ * Called when this bundle is stopped so the Framework can perform the bundle-specific activities necessary
+ * to stop the bundle. In general, this method should undo the work that the <code>bundleActivator_start()</code>
+ * function started. There should be no active threads that were started by this bundle when this bundle returns.
+ * A stopped bundle must not call any Framework objects.
+ *
+ * <p>
+ * This method must complete and return to its caller in a timely manner.
+ *
+ * @param userData The activator instance to be used.
+ * @param context The execution context of the bundle being stopped.
+ *
+ * @return Status code indication failure or success:
+ * 		- CELIX_SUCCESS when no errors are encountered.
+ * 		- Any other status code will mark the bundle as stopped and the framework will remove this
+ * 		  bundle's listeners, unregister all services, and release all services used by this bundle.
+ */
+ACTIVATOR_EXPORT celix_status_t bundleActivator_stop(void *userData, bundle_context_pt context);
+
+/**
+ * Called when this bundle is stopped so the bundle can destroy the instance of its activator. In general, this
+ * method should undo the work that the <code>bundleActivator_create()</code> function initialized.
+ *
+ * <p>
+ * This method must complete and return to its caller in a timely manner.
+ *
+ * @param userData The activator instance to be used.
+ * @param context The execution context of the bundle being stopped.
+ *
+ * @return Status code indication failure or success:
+ * 		- CELIX_SUCCESS when no errors are encountered.
+ * 		- Any other status code will mark the bundle as stopped and the framework will remove this
+ * 		  bundle's listeners, unregister all services, and release all services used by this bundle.
+ */
+ACTIVATOR_EXPORT celix_status_t
+bundleActivator_destroy(void *userData, bundle_context_pt  __attribute__((unused))  __attribute__((unused)) context);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BUNDLE_ACTIVATOR_H_ */
+
+/**
+ * @}
+ */

http://git-wip-us.apache.org/repos/asf/celix/blob/a1c30887/framework/include/bundle_archive.h
----------------------------------------------------------------------
diff --git a/framework/include/bundle_archive.h b/framework/include/bundle_archive.h
new file mode 100644
index 0000000..ff3cf16
--- /dev/null
+++ b/framework/include/bundle_archive.h
@@ -0,0 +1,93 @@
+/**
+ *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.
+ */
+/*
+ * bundle_archive.h
+ *
+ *  \date       Aug 8, 2010
+ *  \author    	<a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
+ *  \copyright	Apache License, Version 2.0
+ */
+
+#ifndef BUNDLE_ARCHIVE_H_
+#define BUNDLE_ARCHIVE_H_
+
+#include <time.h>
+
+#include "bundle_revision.h"
+#include "bundle_state.h"
+#include "celix_errno.h"
+#include "celixbool.h"
+#include "framework_exports.h"
+#include "celix_log.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct bundleArchive *bundle_archive_pt;
+
+celix_status_t bundleArchive_create(const char *archiveRoot, long id, const char *location, const char *inputFile,
+                                    bundle_archive_pt *bundle_archive);
+
+celix_status_t bundleArchive_createSystemBundleArchive(bundle_archive_pt *bundle_archive);
+
+celix_status_t bundleArchive_recreate(const char *archiveRoot, bundle_archive_pt *bundle_archive);
+
+celix_status_t bundleArchive_destroy(bundle_archive_pt archive);
+
+FRAMEWORK_EXPORT celix_status_t bundleArchive_getId(bundle_archive_pt archive, long *id);
+
+FRAMEWORK_EXPORT celix_status_t bundleArchive_getLocation(bundle_archive_pt archive, const char **location);
+
+FRAMEWORK_EXPORT celix_status_t bundleArchive_getArchiveRoot(bundle_archive_pt archive, const char **archiveRoot);
+
+FRAMEWORK_EXPORT celix_status_t
+bundleArchive_revise(bundle_archive_pt archive, const char *location, const char *inputFile);
+
+FRAMEWORK_EXPORT celix_status_t bundleArchive_rollbackRevise(bundle_archive_pt archive, bool *rolledback);
+
+FRAMEWORK_EXPORT celix_status_t
+bundleArchive_getRevision(bundle_archive_pt archive, long revNr, bundle_revision_pt *revision);
+
+FRAMEWORK_EXPORT celix_status_t
+bundleArchive_getCurrentRevision(bundle_archive_pt archive, bundle_revision_pt *revision);
+
+FRAMEWORK_EXPORT celix_status_t bundleArchive_getCurrentRevisionNumber(bundle_archive_pt archive, long *revisionNumber);
+
+FRAMEWORK_EXPORT celix_status_t bundleArchive_getRefreshCount(bundle_archive_pt archive, long *refreshCount);
+
+FRAMEWORK_EXPORT celix_status_t bundleArchive_setRefreshCount(bundle_archive_pt archive);
+
+FRAMEWORK_EXPORT celix_status_t bundleArchive_close(bundle_archive_pt archive);
+
+FRAMEWORK_EXPORT celix_status_t bundleArchive_closeAndDelete(bundle_archive_pt archive);
+
+FRAMEWORK_EXPORT celix_status_t bundleArchive_setLastModified(bundle_archive_pt archive, time_t lastModifiedTime);
+
+FRAMEWORK_EXPORT celix_status_t bundleArchive_getLastModified(bundle_archive_pt archive, time_t *lastModified);
+
+FRAMEWORK_EXPORT celix_status_t bundleArchive_setPersistentState(bundle_archive_pt archive, bundle_state_e state);
+
+FRAMEWORK_EXPORT celix_status_t bundleArchive_getPersistentState(bundle_archive_pt archive, bundle_state_e *state);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BUNDLE_ARCHIVE_H_ */

http://git-wip-us.apache.org/repos/asf/celix/blob/a1c30887/framework/include/bundle_context.h
----------------------------------------------------------------------
diff --git a/framework/include/bundle_context.h b/framework/include/bundle_context.h
new file mode 100644
index 0000000..b8d3f45
--- /dev/null
+++ b/framework/include/bundle_context.h
@@ -0,0 +1,175 @@
+/**
+ *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.
+ */
+/*
+ * bundle_context.h
+ *
+ *  \date       Mar 26, 2010
+ *  \author    	<a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
+ *  \copyright	Apache License, Version 2.0
+ */
+
+#ifndef BUNDLE_CONTEXT_H_
+#define BUNDLE_CONTEXT_H_
+
+/**
+ * A bundle's execution context within the Framework. The context is used to
+ * grant access to other methods so that this bundle can interact with the
+ * Framework.
+ */
+typedef struct bundleContext *bundle_context_pt;
+typedef struct bundleContext bundle_context_t;
+
+
+#include "service_factory.h"
+#include "service_listener.h"
+#include "bundle_listener.h"
+#include "framework_listener.h"
+#include "properties.h"
+#include "array_list.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+celix_status_t
+bundleContext_create(framework_pt framework, framework_logger_pt, bundle_pt bundle, bundle_context_pt *bundle_context);
+
+celix_status_t bundleContext_destroy(bundle_context_pt context);
+
+FRAMEWORK_EXPORT celix_status_t bundleContext_getBundle(bundle_context_pt context, bundle_pt *bundle);
+
+FRAMEWORK_EXPORT celix_status_t bundleContext_getFramework(bundle_context_pt context, framework_pt *framework);
+
+FRAMEWORK_EXPORT celix_status_t
+bundleContext_installBundle(bundle_context_pt context, const char *location, bundle_pt *bundle);
+
+FRAMEWORK_EXPORT celix_status_t
+bundleContext_installBundle2(bundle_context_pt context, const char *location, const char *inputFile, bundle_pt *bundle);
+
+FRAMEWORK_EXPORT celix_status_t
+bundleContext_registerService(bundle_context_pt context, const char *serviceName, const void *svcObj,
+                              properties_pt properties, service_registration_pt *service_registration);
+
+FRAMEWORK_EXPORT celix_status_t
+bundleContext_registerServiceFactory(bundle_context_pt context, const char *serviceName, service_factory_pt factory,
+                                     properties_pt properties, service_registration_pt *service_registration);
+
+/**
+ * Get a service reference for the bundle context. When the service reference is no longer needed use bundleContext_ungetServiceReference.
+ * ServiceReference are coupled to a bundle context. Do not share service reference between bundles. Exchange the service.id instead.
+ * 
+ * @param context The bundle context
+ * @param serviceName The name of the service (objectClass) to get
+ * @param service_reference _output_ The found service reference, or NULL when no service is found.
+ * @return CELIX_SUCCESS on success
+ */
+FRAMEWORK_EXPORT celix_status_t bundleContext_getServiceReference(bundle_context_pt context, const char *serviceName,
+                                                                  service_reference_pt *service_reference);
+
+/** Same as bundleContext_getServiceReference, but than for a optional serviceName combined with a optional filter.
+ * The resulting array_list should be destroyed by the caller. For all service references return a unget should be called.
+ * 
+ * @param context the bundle context
+ * @param serviceName the serviceName, can be NULL
+ * @param filter the filter, can be NULL. If present will be combined (and) with the serviceName 
+ * @param service_references _output_ a array list, can be size 0. 
+ * @return CELIX_SUCCESS on success
+ */
+FRAMEWORK_EXPORT celix_status_t
+bundleContext_getServiceReferences(bundle_context_pt context, const char *serviceName, const char *filter,
+                                   array_list_pt *service_references);
+
+/**
+ * Retains (increases the ref count) the provided service reference. Can be used to retain a service reference.
+ * Note that this is a deviation from the OSGi spec, due to the fact that C has no garbage collect.
+ * 
+ * @param context the bundle context
+ * @param reference the service reference to retain
+ * @return CELIX_SUCCES on success
+ */
+FRAMEWORK_EXPORT celix_status_t
+bundleContext_retainServiceReference(bundle_context_pt context, service_reference_pt reference);
+
+/**
+ * Ungets the service references. If the ref counter of the service refernce goes to 0, the reference will be destroyed.
+ * This is coupled with the bundleContext_getServiceReference(s) and bundleContext_retainServiceReferenc.
+ * Note: That this is a deviation from the OSGi standard, due to the fact that C has no garbage collect.
+ * 
+ * @param context The bundle context.
+ * @param reference the service reference to unget
+ * @return CELIX_SUCCESS on success.
+ */
+FRAMEWORK_EXPORT celix_status_t
+bundleContext_ungetServiceReference(bundle_context_pt context, service_reference_pt reference);
+
+FRAMEWORK_EXPORT celix_status_t
+bundleContext_getService(bundle_context_pt context, service_reference_pt reference, void **service_instance);
+
+FRAMEWORK_EXPORT celix_status_t
+bundleContext_ungetService(bundle_context_pt context, service_reference_pt reference, bool *result);
+
+FRAMEWORK_EXPORT celix_status_t bundleContext_getBundles(bundle_context_pt context, array_list_pt *bundles);
+
+FRAMEWORK_EXPORT celix_status_t bundleContext_getBundleById(bundle_context_pt context, long id, bundle_pt *bundle);
+
+FRAMEWORK_EXPORT celix_status_t
+bundleContext_addServiceListener(bundle_context_pt context, service_listener_pt listener, const char *filter);
+
+FRAMEWORK_EXPORT celix_status_t
+bundleContext_removeServiceListener(bundle_context_pt context, service_listener_pt listener);
+
+FRAMEWORK_EXPORT celix_status_t bundleContext_addBundleListener(bundle_context_pt context, bundle_listener_pt listener);
+
+FRAMEWORK_EXPORT celix_status_t
+bundleContext_removeBundleListener(bundle_context_pt context, bundle_listener_pt listener);
+
+FRAMEWORK_EXPORT celix_status_t
+bundleContext_addFrameworkListener(bundle_context_pt context, framework_listener_pt listener);
+
+FRAMEWORK_EXPORT celix_status_t
+bundleContext_removeFrameworkListener(bundle_context_pt context, framework_listener_pt listener);
+
+/**
+ * Gets the config property - or environment variable if the config property does not exist - for the provided name.
+ *
+ * @param context The bundle context.
+ * @param name The name of the config property / environment variable to get.
+ * @param value A ptr to the output value. This will be set when a value is found or else will be set to NULL.
+ * @return 0 if successful.
+ */
+FRAMEWORK_EXPORT celix_status_t
+bundleContext_getProperty(bundle_context_pt context, const char *name, const char **value);
+
+/**
+ * Gets the config property - or environment variable if the config property does not exist - for the provided name.
+ *
+ * @param context The bundle context.
+ * @param name The name of the config property / environment variable to get.
+ * @param defaultValue The default value to return if no value is found.
+ * @param value A ptr to the output value. This will be set when a value is found or else will be set to NULL.
+ * @return 0 if successful.
+ */
+FRAMEWORK_EXPORT celix_status_t
+bundleContext_getPropertyWithDefault(bundle_context_pt context, const char *name, const char *defaultValue, const char **value);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BUNDLE_CONTEXT_H_ */

http://git-wip-us.apache.org/repos/asf/celix/blob/a1c30887/framework/include/bundle_event.h
----------------------------------------------------------------------
diff --git a/framework/include/bundle_event.h b/framework/include/bundle_event.h
new file mode 100644
index 0000000..c4fc927
--- /dev/null
+++ b/framework/include/bundle_event.h
@@ -0,0 +1,63 @@
+/*
+ *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.
+ */
+/*
+ * bundle_event.h
+ *
+ *  \date       Jun 28, 2012
+ *  \author    	<a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
+ *  \copyright	Apache License, Version 2.0
+ */
+
+#ifndef BUNDLE_EVENT_H_
+#define BUNDLE_EVENT_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum bundle_event_type {
+	OSGI_FRAMEWORK_BUNDLE_EVENT_INSTALLED = 0x00000001,
+	OSGI_FRAMEWORK_BUNDLE_EVENT_STARTED = 0x00000002,
+	OSGI_FRAMEWORK_BUNDLE_EVENT_STOPPED = 0x00000004,
+	OSGI_FRAMEWORK_BUNDLE_EVENT_UPDATED = 0x00000008,
+	OSGI_FRAMEWORK_BUNDLE_EVENT_UNINSTALLED = 0x00000010,
+	OSGI_FRAMEWORK_BUNDLE_EVENT_RESOLVED = 0x00000020,
+	OSGI_FRAMEWORK_BUNDLE_EVENT_UNRESOLVED = 0x00000040,
+	OSGI_FRAMEWORK_BUNDLE_EVENT_STARTING = 0x00000080,
+	OSGI_FRAMEWORK_BUNDLE_EVENT_STOPPING = 0x00000100,
+	OSGI_FRAMEWORK_BUNDLE_EVENT_LAZY_ACTIVATION = 0x00000200,
+};
+
+typedef enum bundle_event_type bundle_event_type_e;
+typedef struct bundle_event *bundle_event_pt;
+
+#include "service_reference.h"
+#include "bundle.h"
+
+struct bundle_event {
+	long bundleId;
+	char *bundleSymbolicName;
+	bundle_event_type_e type;
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BUNDLE_EVENT_H_ */

http://git-wip-us.apache.org/repos/asf/celix/blob/a1c30887/framework/include/bundle_listener.h
----------------------------------------------------------------------
diff --git a/framework/include/bundle_listener.h b/framework/include/bundle_listener.h
new file mode 100644
index 0000000..a152393
--- /dev/null
+++ b/framework/include/bundle_listener.h
@@ -0,0 +1,57 @@
+/*
+ *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.
+ */
+/**
+ *
+ * @defgroup BundleListener Bundle Listener
+ * @ingroup framework
+ * @{
+ *
+ *  \author    	<a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
+ *  \date      	June 28, 2012
+ *  \copyright	Apache License, Version 2.0
+ */
+#ifndef BUNDLE_LISTENER_H_
+#define BUNDLE_LISTENER_H_
+
+typedef struct bundle_listener *bundle_listener_pt;
+
+#include "celix_errno.h"
+#include "bundle_event.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+struct bundle_listener {
+	void *handle;
+
+	celix_status_t (*bundleChanged)(void *listener, bundle_event_pt event);
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* service_listener_t_H_ */
+
+/**
+ * @}
+ */

http://git-wip-us.apache.org/repos/asf/celix/blob/a1c30887/framework/include/bundle_revision.h
----------------------------------------------------------------------
diff --git a/framework/include/bundle_revision.h b/framework/include/bundle_revision.h
new file mode 100644
index 0000000..9533eb6
--- /dev/null
+++ b/framework/include/bundle_revision.h
@@ -0,0 +1,142 @@
+/*
+ *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.
+ */
+/**
+ *
+ * @defgroup BundleRevision Bundle Revision
+ * @ingroup framework
+ * @{
+ *
+ *  \author    	<a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
+ *  \date      	April 12, 2011
+ *  \copyright	Apache License, Version 2.0
+ */
+#ifndef BUNDLE_REVISION_H_
+#define BUNDLE_REVISION_H_
+
+#include <stdio.h>
+
+#include "celix_errno.h"
+#include "manifest.h"
+#include "celix_log.h"
+#include "array_list.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Typedef for bundle_revision_pt.
+ *
+ * A bundle revision represents the content of a bundle. A revision is associated with a bundle archive.
+ * An archive can have multiple revisions, each update of a bundle results in a new one.
+ *
+ * In a revision the content of a bundle (ZIP file) is extracted to a specified location inside the archive.
+ */
+typedef struct bundleRevision *bundle_revision_pt;
+
+/**
+ * Creates a new revision for the given inputFile or location.
+ * The location parameter is used to identify the bundle, in case of an update or download, the inputFile
+ *  parameter can be used to point to the actual data. In the OSGi specification this is the inputstream.
+ *
+ * @param pool The pool on which this revision has to be allocated.
+ * @param root The root for this revision in which the bundle is extracted and state is stored.
+ * @param location The location associated with the revision
+ * @param revisionNr The number of the revision
+ * @param inputFile The (optional) location of the file to use as input for this revision
+ * @param[out] bundle_revision The output parameter for the created revision.
+ *
+ * @return Status code indication failure or success:
+ * 		- CELIX_SUCCESS when no errors are encountered.
+ * 		- CELIX_ENOMEM If allocating memory for <code>bundle_revision</code> failed.
+ */
+celix_status_t bundleRevision_create(const char *root, const char *location, long revisionNr, const char *inputFile,
+                                     bundle_revision_pt *bundle_revision);
+
+celix_status_t bundleRevision_destroy(bundle_revision_pt revision);
+
+/**
+ * Retrieves the revision number of the given revision.
+ *
+ * @param revision The revision to get the number for.
+ * @param[out] revisionNr The revision number.
+ *
+ * @return Status code indication failure or success:
+ * 		- CELIX_SUCCESS when no errors are encountered.
+ * 		- CELIX_ILLEGAL_ARGUMENT If <code>revision</code> is illegal.
+ */
+celix_status_t bundleRevision_getNumber(bundle_revision_pt revision, long *revisionNr);
+
+/**
+ * Retrieves the location of the given revision.
+ *
+ * @param revision The revision to get the location for.
+ * @param[out] location The location.
+ *
+ * @return Status code indication failure or success:
+ * 		- CELIX_SUCCESS when no errors are encountered.
+ * 		- CELIX_ILLEGAL_ARGUMENT If <code>revision</code> is illegal.
+ */
+celix_status_t bundleRevision_getLocation(bundle_revision_pt revision, const char **location);
+
+/**
+ * Retrieves the root of the given revision.
+ *
+ * @param revision The revision to get the location for.
+ * @param[out] root The root.
+ *
+ * @return Status code indication failure or success:
+ * 		- CELIX_SUCCESS when no errors are encountered.
+ * 		- CELIX_ILLEGAL_ARGUMENT If <code>revision</code> is illegal.
+ */
+celix_status_t bundleRevision_getRoot(bundle_revision_pt revision, const char **root);
+
+/**
+ * Retrieves the manifest of the given revision.
+ *
+ * @param revision The revision to get the manifest for.
+ * @param[out] manifest The manifest.
+ *
+ * @return Status code indication failure or success:
+ * 		- CELIX_SUCCESS when no errors are encountered.
+ * 		- CELIX_ILLEGAL_ARGUMENT If <code>revision</code> is illegal.
+ */
+celix_status_t bundleRevision_getManifest(bundle_revision_pt revision, manifest_pt *manifest);
+
+/**
+ * Retrieves the handles of the installed libraries for this revision.
+ *
+ * @param revision The revision to get the manifest for.
+ * @param[out] handles array_list_pt containing the handles.
+ *
+ * @return Status code indication failure or success:
+ *      - CELIX_SUCCESS when no errors are encountered.
+ *      - CELIX_ILLEGAL_ARGUMENT If <code>revision</code> is illegal.
+ */
+celix_status_t bundleRevision_getHandles(bundle_revision_pt revision, array_list_pt *handles);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BUNDLE_REVISION_H_ */
+
+/**
+ * @}
+ */

http://git-wip-us.apache.org/repos/asf/celix/blob/a1c30887/framework/include/bundle_state.h
----------------------------------------------------------------------
diff --git a/framework/include/bundle_state.h b/framework/include/bundle_state.h
new file mode 100644
index 0000000..8d451e4
--- /dev/null
+++ b/framework/include/bundle_state.h
@@ -0,0 +1,49 @@
+/**
+ *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.
+ */
+/*
+ * bundle_state.h
+ *
+ *  \date       Sep 27, 2010
+ *  \author    	<a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
+ *  \copyright	Apache License, Version 2.0
+ */
+
+#ifndef BUNDLE_STATE_H_
+#define BUNDLE_STATE_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum bundleState {
+	OSGI_FRAMEWORK_BUNDLE_UNKNOWN = 0x00000000,
+	OSGI_FRAMEWORK_BUNDLE_UNINSTALLED = 0x00000001,
+	OSGI_FRAMEWORK_BUNDLE_INSTALLED = 0x00000002,
+	OSGI_FRAMEWORK_BUNDLE_RESOLVED = 0x00000004,
+	OSGI_FRAMEWORK_BUNDLE_STARTING = 0x00000008,
+	OSGI_FRAMEWORK_BUNDLE_STOPPING = 0x00000010,
+	OSGI_FRAMEWORK_BUNDLE_ACTIVE = 0x00000020,
+};
+
+typedef enum bundleState bundle_state_e;
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BUNDLE_STATE_H_ */

http://git-wip-us.apache.org/repos/asf/celix/blob/a1c30887/framework/include/capability.h
----------------------------------------------------------------------
diff --git a/framework/include/capability.h b/framework/include/capability.h
new file mode 100644
index 0000000..b35d016
--- /dev/null
+++ b/framework/include/capability.h
@@ -0,0 +1,54 @@
+/**
+ *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.
+ */
+/*
+ * capability.h
+ *
+ *  \date       Jul 12, 2010
+ *  \author    	<a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
+ *  \copyright	Apache License, Version 2.0
+ */
+
+#ifndef CAPABILITY_H_
+#define CAPABILITY_H_
+
+typedef struct capability *capability_pt;
+
+#include "hash_map.h"
+#include "module.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+celix_status_t
+capability_create(module_pt module, hash_map_pt directives, hash_map_pt attributes, capability_pt *capability);
+
+celix_status_t capability_destroy(capability_pt capability);
+
+celix_status_t capability_getServiceName(capability_pt capability, const char **serviceName);
+
+celix_status_t capability_getVersion(capability_pt capability, version_pt *version);
+
+celix_status_t capability_getModule(capability_pt capability, module_pt *module);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* CAPABILITY_H_ */

http://git-wip-us.apache.org/repos/asf/celix/blob/a1c30887/framework/include/celix_launcher.h
----------------------------------------------------------------------
diff --git a/framework/include/celix_launcher.h b/framework/include/celix_launcher.h
new file mode 100644
index 0000000..0d819c9
--- /dev/null
+++ b/framework/include/celix_launcher.h
@@ -0,0 +1,55 @@
+/**
+ *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_launcher.h
+ *
+ *  \date       Jul 30, 2015
+ *  \author    	<a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
+ *  \copyright	Apache License, Version 2.0
+ */
+
+#ifndef CELIX_LAUNCHER_H
+#define CELIX_LAUNCHER_H
+
+#include <stdio.h>
+#include "framework.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int celixLauncher_launchWithArgs(int argc, char *argv[]);
+
+int celixLauncher_launch(const char *configFile, framework_pt *framework);
+
+int celixLauncher_launchWithStream(FILE *config, framework_pt *framework);
+
+int celixLauncher_launchWithProperties(properties_pt config, framework_pt *framework);
+
+void celixLauncher_stop(framework_pt framework);
+
+void celixLauncher_destroy(framework_pt framework);
+
+void celixLauncher_waitForShutdown(framework_pt framework);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif //CELIX_LAUNCHER_H

http://git-wip-us.apache.org/repos/asf/celix/blob/a1c30887/framework/include/celix_log.h
----------------------------------------------------------------------
diff --git a/framework/include/celix_log.h b/framework/include/celix_log.h
new file mode 100644
index 0000000..08d096c
--- /dev/null
+++ b/framework/include/celix_log.h
@@ -0,0 +1,85 @@
+/*
+ *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_log.h
+ *
+ *  \date       Jan 12, 2012
+ *  \author    	<a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
+ *  \copyright	Apache License, Version 2.0
+ */
+
+#ifndef CELIX_LOG_H_
+#define CELIX_LOG_H_
+
+#include <stdio.h>
+
+#include "celix_errno.h"
+#include "framework_exports.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum framework_log_level {
+    OSGI_FRAMEWORK_LOG_ERROR = 0x00000001,
+    OSGI_FRAMEWORK_LOG_WARNING = 0x00000002,
+    OSGI_FRAMEWORK_LOG_INFO = 0x00000003,
+    OSGI_FRAMEWORK_LOG_DEBUG = 0x00000004,
+};
+
+typedef enum framework_log_level framework_log_level_t;
+
+typedef struct framework_logger *framework_logger_pt;
+
+extern framework_logger_pt logger;
+
+typedef celix_status_t (*framework_log_function_pt)(framework_log_level_t level, const char *func, const char *file,
+                                                    int line, const char *msg);
+
+struct framework_logger {
+    framework_log_function_pt logFunction;
+};
+
+#define fw_log(logger, level, fmsg, args...) framework_log(logger, level, __func__, __FILE__, __LINE__, fmsg, ## args)
+#define fw_logCode(logger, level, code, fmsg, args...) framework_logCode(logger, level, __func__, __FILE__, __LINE__, code, fmsg, ## args)
+#define framework_logIfError(logger, status, error, fmsg, args...) \
+    if (status != CELIX_SUCCESS) { \
+        if (error != NULL) { \
+            fw_logCode(logger, OSGI_FRAMEWORK_LOG_ERROR, status, #fmsg";\n Cause: %s", ## args, error); \
+        } else { \
+            fw_logCode(logger, OSGI_FRAMEWORK_LOG_ERROR, status, #fmsg, ## args); \
+        } \
+    }
+
+FRAMEWORK_EXPORT celix_status_t
+frameworkLogger_log(framework_log_level_t level, const char *func, const char *file, int line, const char *fmsg);
+
+FRAMEWORK_EXPORT void
+framework_log(framework_logger_pt logger, framework_log_level_t level, const char *func, const char *file, int line,
+              const char *fmsg, ...);
+
+FRAMEWORK_EXPORT void
+framework_logCode(framework_logger_pt logger, framework_log_level_t level, const char *func, const char *file, int line,
+                  celix_status_t code, const char *fmsg, ...);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* CELIX_LOG_H_ */

http://git-wip-us.apache.org/repos/asf/celix/blob/a1c30887/framework/include/constants.h
----------------------------------------------------------------------
diff --git a/framework/include/constants.h b/framework/include/constants.h
new file mode 100644
index 0000000..5a01016
--- /dev/null
+++ b/framework/include/constants.h
@@ -0,0 +1,67 @@
+/**
+ *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.
+ */
+/*
+ * constants.h
+ *
+ *  \date       Apr 29, 2010
+ *  \author    	<a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
+ *  \copyright	Apache License, Version 2.0
+ */
+
+#ifndef CONSTANTS_H_
+#define CONSTANTS_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+static const char *const OSGI_FRAMEWORK_OBJECTCLASS = "objectClass";
+static const char *const OSGI_FRAMEWORK_SERVICE_ID = "service.id";
+static const char *const OSGI_FRAMEWORK_SERVICE_PID = "service.pid";
+static const char *const OSGI_FRAMEWORK_SERVICE_RANKING = "service.ranking";
+
+static const char *const CELIX_FRAMEWORK_SERVICE_VERSION = "service.version";
+static const char *const CELIX_FRAMEWORK_SERVICE_LANGUAGE = "service.lang";
+static const char *const CELIX_FRAMEWORK_SERVICE_C_LANGUAGE = "C";
+static const char *const CELIX_FRAMEWORK_SERVICE_CXX_LANGUAGE = "C++";
+static const char *const CELIX_FRAMEWORK_SERVICE_SHARED_LANGUAGE = "shared"; //e.g. marker services
+
+static const char *const OSGI_FRAMEWORK_BUNDLE_ACTIVATOR = "Bundle-Activator";
+static const char *const OSGI_FRAMEWORK_BUNDLE_ACTIVATOR_CREATE = "bundleActivator_create";
+static const char *const OSGI_FRAMEWORK_BUNDLE_ACTIVATOR_START = "bundleActivator_start";
+static const char *const OSGI_FRAMEWORK_BUNDLE_ACTIVATOR_STOP = "bundleActivator_stop";
+static const char *const OSGI_FRAMEWORK_BUNDLE_ACTIVATOR_DESTROY = "bundleActivator_destroy";
+
+static const char *const OSGI_FRAMEWORK_BUNDLE_SYMBOLICNAME = "Bundle-SymbolicName";
+static const char *const OSGI_FRAMEWORK_BUNDLE_VERSION = "Bundle-Version";
+static const char *const OSGI_FRAMEWORK_PRIVATE_LIBRARY = "Private-Library";
+static const char *const OSGI_FRAMEWORK_EXPORT_LIBRARY = "Export-Library";
+static const char *const OSGI_FRAMEWORK_IMPORT_LIBRARY = "Import-Library";
+
+
+static const char *const OSGI_FRAMEWORK_FRAMEWORK_STORAGE = "org.osgi.framework.storage";
+static const char *const OSGI_FRAMEWORK_FRAMEWORK_STORAGE_CLEAN = "org.osgi.framework.storage.clean";
+static const char *const OSGI_FRAMEWORK_FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT = "onFirstInit";
+static const char *const OSGI_FRAMEWORK_FRAMEWORK_UUID = "org.osgi.framework.uuid";
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* CONSTANTS_H_ */

http://git-wip-us.apache.org/repos/asf/celix/blob/a1c30887/framework/include/filter.h
----------------------------------------------------------------------
diff --git a/framework/include/filter.h b/framework/include/filter.h
new file mode 100644
index 0000000..687de2a
--- /dev/null
+++ b/framework/include/filter.h
@@ -0,0 +1,55 @@
+/**
+ *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.
+ */
+/*
+ * filter.h
+ *
+ *  \date       Apr 28, 2010
+ *  \author    	<a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
+ *  \copyright	Apache License, Version 2.0
+ */
+
+#ifndef FILTER_H_
+#define FILTER_H_
+
+#include "celix_errno.h"
+#include "properties.h"
+#include "celixbool.h"
+#include "framework_exports.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct filter *filter_pt;
+
+FRAMEWORK_EXPORT filter_pt filter_create(const char *filterString);
+
+FRAMEWORK_EXPORT void filter_destroy(filter_pt filter);
+
+FRAMEWORK_EXPORT celix_status_t filter_match(filter_pt filter, properties_pt properties, bool *result);
+
+FRAMEWORK_EXPORT celix_status_t filter_match_filter(filter_pt src, filter_pt dest, bool *result);
+
+FRAMEWORK_EXPORT celix_status_t filter_getString(filter_pt filter, const char **filterStr);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* FILTER_H_ */

http://git-wip-us.apache.org/repos/asf/celix/blob/a1c30887/framework/include/framework.h
----------------------------------------------------------------------
diff --git a/framework/include/framework.h b/framework/include/framework.h
new file mode 100644
index 0000000..ec2306f
--- /dev/null
+++ b/framework/include/framework.h
@@ -0,0 +1,57 @@
+/**
+ *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.
+ */
+/*
+ * framework.h
+ *
+ *  \date       Mar 23, 2010
+ *  \author    	<a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
+ *  \copyright	Apache License, Version 2.0
+ */
+
+#ifndef FRAMEWORK_H_
+#define FRAMEWORK_H_
+
+typedef struct activator * activator_pt;
+typedef struct framework * framework_pt;
+
+#include "celix_errno.h"
+#include "framework_exports.h"
+#include "bundle.h"
+#include "properties.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// #TODO: Move to FrameworkFactory according the OSGi Spec
+FRAMEWORK_EXPORT celix_status_t framework_create(framework_pt *framework, properties_pt config);
+
+FRAMEWORK_EXPORT celix_status_t framework_destroy(framework_pt framework);
+
+FRAMEWORK_EXPORT celix_status_t fw_init(framework_pt framework);
+
+FRAMEWORK_EXPORT celix_status_t framework_waitForStop(framework_pt framework);
+
+FRAMEWORK_EXPORT celix_status_t framework_getFrameworkBundle(framework_pt framework, bundle_pt *bundle);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* FRAMEWORK_H_ */

http://git-wip-us.apache.org/repos/asf/celix/blob/a1c30887/framework/include/framework_event.h
----------------------------------------------------------------------
diff --git a/framework/include/framework_event.h b/framework/include/framework_event.h
new file mode 100644
index 0000000..d48e64c
--- /dev/null
+++ b/framework/include/framework_event.h
@@ -0,0 +1,71 @@
+/*
+ *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.
+ */
+/*
+ * framework_event.h
+ *
+ *  \date       Oct 8, 2013
+ *  \author    	<a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
+ *  \copyright	Apache License, Version 2.0
+ */
+
+#ifndef FRAMEWORK_EVENT_H_
+#define FRAMEWORK_EVENT_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum framework_event_type {
+	OSGI_FRAMEWORK_EVENT_STARTED = 0x00000001,
+	OSGI_FRAMEWORK_EVENT_ERROR = 0x00000002,
+	OSGI_FRAMEWORK_EVENT_PACKAGES_REFRESHED = 0x00000004,
+	OSGI_FRAMEWORK_EVENT_STARTLEVEL_CHANGED = 0x00000008,
+	OSGI_FRAMEWORK_EVENT_WARNING = 0x00000010,
+	OSGI_FRAMEWORK_EVENT_INFO = 0x00000020,
+	OSGI_FRAMEWORK_EVENT_STOPPED = 0x00000040,
+	OSGI_FRAMEWORK_EVENT_STOPPED_UPDATE = 0x00000080,
+	OSGI_FRAMEWORK_EVENT_STOPPED_BOOTCLASSPATH_MODIFIED = 0x00000100,
+	OSGI_FRAMEWORK_EVENT_WAIT_TIMEDOUT = 0x00000200,
+};
+
+typedef enum framework_event_type framework_event_type_e;
+typedef struct framework_event *framework_event_pt;
+#ifdef __cplusplus
+}
+#endif
+
+#include "service_reference.h"
+#include "bundle.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct framework_event {
+	long bundleId;
+	char *bundleSymbolicName;
+	framework_event_type_e type;
+	celix_status_t errorCode;
+	char *error;
+};
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* FRAMEWORK_EVENT_H_ */


Mime
View raw message