celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pnol...@apache.org
Subject [3/8] celix git commit: CELIX-413: Moves the example to an additional dir, so that examples can also be build outside the celix project
Date Wed, 31 Jan 2018 20:05:27 GMT
http://git-wip-us.apache.org/repos/asf/celix/blob/a8b8410f/examples/dm_example_cxx/phase3/src/Phase3Cmp.h
----------------------------------------------------------------------
diff --git a/examples/dm_example_cxx/phase3/src/Phase3Cmp.h b/examples/dm_example_cxx/phase3/src/Phase3Cmp.h
deleted file mode 100644
index 8b7e974..0000000
--- a/examples/dm_example_cxx/phase3/src/Phase3Cmp.h
+++ /dev/null
@@ -1,50 +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.
- */
-
-#ifndef CELIX_PHASE3CMP_H
-#define CELIX_PHASE3CMP_H
-
-#include "IPhase1.h"
-#include "IPhase2.h"
-#include <stdint.h>
-#include <stdio.h>
-#include <thread>
-#include <iostream>
-#include <list>
-#include "celix/dm/Properties.h"
-
-class Phase3Cmp  {
-    std::map<IPhase2*,celix::dm::Properties> phases {};
-    bool running {false};
-    std::thread pollThread {};
-public:
-    Phase3Cmp() { std::cout << "Constructing Phase3Cmp\n"; }
-    virtual ~Phase3Cmp() = default;
-
-    void start();
-    void stop();
-
-    void poll();
-
-    void addPhase2(IPhase2* phase, celix::dm::Properties&& props); //injector used by dependency manager
-    void removePhase2(IPhase2* phase, celix::dm::Properties&& props); //injector used by dependency manager
-    void setPhase2a(IPhase2* phase);
-};
-
-#endif //CELIX_PHASE3CMP_H

http://git-wip-us.apache.org/repos/asf/celix/blob/a8b8410f/examples/dm_example_cxx/phase3_locking/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/dm_example_cxx/phase3_locking/CMakeLists.txt b/examples/dm_example_cxx/phase3_locking/CMakeLists.txt
deleted file mode 100644
index 7a6823a..0000000
--- a/examples/dm_example_cxx/phase3_locking/CMakeLists.txt
+++ /dev/null
@@ -1,38 +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.
-
-
-add_celix_bundle(dm_example_cxx_phase3_locking
-    SYMBOLIC_NAME phase3_locking_cxx
-    VERSION 0.0.1
-    SOURCES
-        src/Phase3LockingActivator.cc
-        src/Phase3LockingCmp.cc
-)
-target_include_directories(dm_example_cxx_phase3_locking PRIVATE src)
-target_link_libraries(dm_example_cxx_phase3_locking PRIVATE dm_example_cxx_api pthread)
-
-IF(APPLE)
-    target_link_libraries(dm_example_cxx_phase3_locking PRIVATE -Wl,-all_load Celix::dependency_manager_cxx_static)
-else()
-    if(ENABLE_ADDRESS_SANITIZER)
-        #With asan there can be undefined symbols
-        target_link_libraries(dm_example_cxx_phase3_locking PRIVATE -Wl,--whole-archive Celix::dependency_manager_cxx_static -Wl,--no-whole-archive)
-    else()
-        target_link_libraries(dm_example_cxx_phase3_locking PRIVATE -Wl,--no-undefined -Wl,--whole-archive Celix::dependency_manager_cxx_static -Wl,--no-whole-archive)
-    endif()
-endif()

http://git-wip-us.apache.org/repos/asf/celix/blob/a8b8410f/examples/dm_example_cxx/phase3_locking/src/Phase3LockingActivator.cc
----------------------------------------------------------------------
diff --git a/examples/dm_example_cxx/phase3_locking/src/Phase3LockingActivator.cc b/examples/dm_example_cxx/phase3_locking/src/Phase3LockingActivator.cc
deleted file mode 100644
index 29d178e..0000000
--- a/examples/dm_example_cxx/phase3_locking/src/Phase3LockingActivator.cc
+++ /dev/null
@@ -1,42 +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.
- */
-
-
-#include "Phase3LockingCmp.h"
-#include "Phase3LockingActivator.h"
-
-#include <memory>
-
-using namespace celix::dm;
-
-
-DmActivator* DmActivator::create(DependencyManager& mng) {
-    return new Phase3LockingActivator(mng);
-}
-
-void Phase3LockingActivator::init() {
-    auto inst = std::shared_ptr<Phase3LockingCmp> {new Phase3LockingCmp {}};
-
-    Component<Phase3LockingCmp>& cmp = mng.createComponent<Phase3LockingCmp>(inst)  //set inst using a shared ptr
-        .setCallbacks(nullptr, &Phase3LockingCmp::start, &Phase3LockingCmp::stop, nullptr);
-
-    cmp.createServiceDependency<IPhase2>()
-            .setStrategy(DependencyUpdateStrategy::locking)
-            .setCallbacks(&Phase3LockingCmp::addPhase2, &Phase3LockingCmp::removePhase2);
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/celix/blob/a8b8410f/examples/dm_example_cxx/phase3_locking/src/Phase3LockingActivator.h
----------------------------------------------------------------------
diff --git a/examples/dm_example_cxx/phase3_locking/src/Phase3LockingActivator.h b/examples/dm_example_cxx/phase3_locking/src/Phase3LockingActivator.h
deleted file mode 100644
index 78d1748..0000000
--- a/examples/dm_example_cxx/phase3_locking/src/Phase3LockingActivator.h
+++ /dev/null
@@ -1,33 +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.
- */
-
-#ifndef CELIX_PHASE3LOCKINGACTIVATOR_H
-#define CELIX_PHASE3LOCKINGACTIVATOR_H
-
-#include "celix/dm/DmActivator.h"
-
-using namespace celix::dm;
-
-class Phase3LockingActivator : public DmActivator {
-public:
-    Phase3LockingActivator(DependencyManager& mng) : DmActivator(mng) {}
-    virtual void init();
-};
-
-#endif //CELIX_PHASE3LOCKINGAACTIVATOR_H

http://git-wip-us.apache.org/repos/asf/celix/blob/a8b8410f/examples/dm_example_cxx/phase3_locking/src/Phase3LockingCmp.cc
----------------------------------------------------------------------
diff --git a/examples/dm_example_cxx/phase3_locking/src/Phase3LockingCmp.cc b/examples/dm_example_cxx/phase3_locking/src/Phase3LockingCmp.cc
deleted file mode 100644
index b0f5e3e..0000000
--- a/examples/dm_example_cxx/phase3_locking/src/Phase3LockingCmp.cc
+++ /dev/null
@@ -1,66 +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.
- */
-
-#include "Phase3LockingCmp.h"
-#include <iostream>
-#include <stdlib.h>
-#include <stdio.h>
-#include <thread>
-#include <chrono>
-#include <sstream>
-
-void Phase3LockingCmp::start() {
-    std::cout << "start Phase3LockingCmp\n";
-    running = true;
-    //pollThread = std::thread {&Phase3LockingCmp::poll, std::ref(*this)};
-    pollThread = std::thread {&Phase3LockingCmp::poll, this};
-}
-
-void Phase3LockingCmp::stop() {
-    std::cout << "stop Phase3LockingCmp\n";
-    running = false;
-    pollThread.join();
-}
-
-void Phase3LockingCmp::poll() {
-    while (running) {
-        std::cout << "polling Phase3LockingCmp\n";
-        mutex.lock();
-        for (std::pair<IPhase2*, celix::dm::Properties> pair : this->phases) {
-            std::ostringstream oss {};
-            oss << "current data for " << pair.second["name"] << " is " << pair.first->getData() << "\n";
-            std::cout << oss.str();
-        }
-        mutex.unlock();
-        std::this_thread::sleep_for(std::chrono::milliseconds(1000));
-    }
-}
-
-void Phase3LockingCmp::addPhase2(IPhase2* phase2, celix::dm::Properties&& props) {
-    std::cout << "adding Iphase2 for Phase3LockingCmp\n";
-    std::lock_guard<std::mutex> lock(mutex);
-    std::pair<IPhase2*, celix::dm::Properties> pair {phase2, props};
-    this->phases[phase2] = props;
-}
-
-void Phase3LockingCmp::removePhase2(IPhase2* phase2, [[gnu::unused]] celix::dm::Properties&& props) {
-    std::cout << "adding Iphase2 for Phase3LockingCmp\n";
-    std::lock_guard<std::mutex> lock(mutex);
-    this->phases.erase(phase2);
-}

http://git-wip-us.apache.org/repos/asf/celix/blob/a8b8410f/examples/dm_example_cxx/phase3_locking/src/Phase3LockingCmp.h
----------------------------------------------------------------------
diff --git a/examples/dm_example_cxx/phase3_locking/src/Phase3LockingCmp.h b/examples/dm_example_cxx/phase3_locking/src/Phase3LockingCmp.h
deleted file mode 100644
index 678fa80..0000000
--- a/examples/dm_example_cxx/phase3_locking/src/Phase3LockingCmp.h
+++ /dev/null
@@ -1,50 +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.
- */
-
-#ifndef CELIX_PHASE3LOCKINGCMP_H
-#define CELIX_PHASE3LOCKINGCMP_H
-
-#include "IPhase2.h"
-#include <stdint.h>
-#include <stdio.h>
-#include <thread>
-#include <iostream>
-#include <mutex>
-#include <map>
-#include "celix/dm/Properties.h"
-
-class Phase3LockingCmp  {
-    std::map<IPhase2*,celix::dm::Properties> phases {};
-    bool running {false};
-    std::thread pollThread {};
-    std::mutex mutex {};
-public:
-    Phase3LockingCmp() = default;
-    virtual ~Phase3LockingCmp() = default;
-
-    void start();
-    void stop();
-
-    void poll();
-
-    void addPhase2(IPhase2* phase, celix::dm::Properties&& props); //injector used by dependency manager
-    void removePhase2(IPhase2* phase, celix::dm::Properties&& props); //injector used by dependency manager
-};
-
-#endif //CELIX_PHASE3LOCKINGCMP_H

http://git-wip-us.apache.org/repos/asf/celix/blob/a8b8410f/examples/embedding/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/embedding/CMakeLists.txt b/examples/embedding/CMakeLists.txt
deleted file mode 100644
index 9c96948..0000000
--- a/examples/embedding/CMakeLists.txt
+++ /dev/null
@@ -1,20 +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.
-
-
-add_executable(embedding private/src/main)
-target_link_libraries(embedding Celix::framework )
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/celix/blob/a8b8410f/examples/embedding/private/src/main.c
----------------------------------------------------------------------
diff --git a/examples/embedding/private/src/main.c b/examples/embedding/private/src/main.c
deleted file mode 100644
index b77cb22..0000000
--- a/examples/embedding/private/src/main.c
+++ /dev/null
@@ -1,99 +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.
- */
-/*
- * main.c
- *
- *  \date       May 22, 2013
- *  \author     <a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
- *  \copyright  Apache License, Version 2.0
- */
-#include <stdlib.h>
-
-#include "celix_launcher.h"
-#include "celix_errno.h"
-#include "framework.h"
-#include "bundle_context.h"
-
-struct foo {
-
-};
-
-struct fooSrv {
-	struct foo *handle;
-	celix_status_t (*foo)(struct foo *handle);
-};
-
-celix_status_t embedded_foo();
-
-int main(void) {
-
-	framework_pt framework = NULL;
-
-	properties_pt config = properties_create();
-	int rc = celixLauncher_launchWithProperties(config, &framework);
-
-	if (rc == 0) {
-		bundle_pt fwBundle = NULL;
-		if(framework_getFrameworkBundle(framework, &fwBundle) == CELIX_SUCCESS){
-
-			if(bundle_start(fwBundle) == CELIX_SUCCESS){
-
-				bundle_context_pt context = NULL;
-				bundle_getContext(fwBundle, &context);
-
-				struct foo *f = calloc(1, sizeof(*f));
-				struct fooSrv *fs = calloc(1, sizeof(*fs));
-
-				fs->handle = f;
-				fs->foo = embedded_foo;
-
-				service_registration_pt reg = NULL;
-
-				if(bundleContext_registerService(context, "foo", fs, NULL, &reg) == CELIX_SUCCESS){
-
-					service_reference_pt ref = NULL;
-					if(bundleContext_getServiceReference(context, "foo", &ref) == CELIX_SUCCESS){
-
-						void *fs2 = NULL;
-						bundleContext_getService(context, ref, &fs2);
-
-						((struct fooSrv*) fs2)->foo(((struct fooSrv*) fs2)->handle);
-
-						bundleContext_ungetService(context, ref, NULL);
-						bundleContext_ungetServiceReference(context, ref);
-						serviceRegistration_unregister(reg);
-					}
-				}
-
-				free(f);
-				free(fs);
-			}
-		}
-		celixLauncher_destroy(framework);
-	}
-
-	return rc;
-
-}
-
-celix_status_t embedded_foo() {
-	printf("foo\n");
-	return CELIX_SUCCESS;
-}
-

http://git-wip-us.apache.org/repos/asf/celix/blob/a8b8410f/examples/hello_world/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/hello_world/CMakeLists.txt b/examples/hello_world/CMakeLists.txt
deleted file mode 100644
index 130cef0..0000000
--- a/examples/hello_world/CMakeLists.txt
+++ /dev/null
@@ -1,63 +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.
-
-if(NOT APPLE)
-#Importing and exporting libraries not (yet) work under OSX.
-
-include_directories("${PROJECT_SOURCE_DIR}/utils/public/include")
-include_directories("public/include")
-
-add_library(hello_testlib SHARED
-    private/src/test
-)
-set_library_version(hello_testlib "4.3.2") # sets target propery VERSION to 4.3.2 and SOVERSION to 4
-
-
-add_library(hello_test2lib SHARED
-        private/src/test2
-)
-set_library_version(hello_test2lib "3.3.3")
-
-add_celix_bundle(hello_bundle
-    VERSION "1.2"
-    SOURCES
-        private/src/activator.c
-    IMPORT_LIBRARIES hello_test2lib
-)
-
-add_celix_bundle(hello_export
-    VERSION "1.0"
-    NO_ACTIVATOR
-    EXPORT_LIBRARIES hello_test2lib
-)
-
-celix_bundle_private_libs(hello_bundle
-    hello_testlib
-)
-
-add_celix_container(helloworld_byref
-    GROUP hello
-    BUNDLES hello_export hello_bundle ${CELIX_SHELL_BUNDLE} ${CELIX_SHELL_TUI_BUNDLE}
-)
-
-add_celix_container(helloworld_withcopy
-    GROUP hello
-    COPY #Ensures that bundles are copied in the deploy location
-    BUNDLES hello_export hello_bundle ${SHELL_BUNDLE} ${SHELL_TUI_BUNDLE}
-)
-
-endif()

http://git-wip-us.apache.org/repos/asf/celix/blob/a8b8410f/examples/hello_world/private/src/activator.c
----------------------------------------------------------------------
diff --git a/examples/hello_world/private/src/activator.c b/examples/hello_world/private/src/activator.c
deleted file mode 100644
index 37cf782..0000000
--- a/examples/hello_world/private/src/activator.c
+++ /dev/null
@@ -1,68 +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.
- */
-/*
- * activator.c
- *
- *  \date       Aug 20, 2010
- *  \author    	<a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
- *  \copyright	Apache License, Version 2.0
- */
-#include <stdlib.h>
-#include <stdio.h>
-
-#include "bundle_activator.h"
-
-#include "test.h"
-#include "test2.h"
-
-struct userData {
-	char * word;
-};
-
-celix_status_t bundleActivator_create(bundle_context_pt context, void **userData) {
-	celix_status_t status = CELIX_SUCCESS;
-    *userData = malloc(sizeof(struct userData));
-    if (*userData != NULL) {
-		((struct userData *)(*userData))->word = "World";
-	} else {
-		status = CELIX_START_ERROR;
-	}
-	return status;
-}
-
-celix_status_t bundleActivator_start(void * userData, bundle_context_pt context) {
-	struct userData * data = (struct userData *) userData;
-	printf("Hello %s\n", data->word);
-
-	doo();
-    bar();
-
-	return CELIX_SUCCESS;
-}
-
-celix_status_t bundleActivator_stop(void * userData, bundle_context_pt context) {
-	struct userData * data = (struct userData *) userData;
-	printf("Goodbye %s\n", data->word);
-	return CELIX_SUCCESS;
-}
-
-celix_status_t bundleActivator_destroy(void * userData, bundle_context_pt context) {
-    free(userData);
-	return CELIX_SUCCESS;
-}

http://git-wip-us.apache.org/repos/asf/celix/blob/a8b8410f/examples/hello_world/private/src/test.c
----------------------------------------------------------------------
diff --git a/examples/hello_world/private/src/test.c b/examples/hello_world/private/src/test.c
deleted file mode 100644
index 280fc61..0000000
--- a/examples/hello_world/private/src/test.c
+++ /dev/null
@@ -1,32 +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.
- */
-/*
- * test.c
- *
- *  \date       12 Feb 2014
- *  \author     <a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
- *  \copyright  Apache License, Version 2.0
- */
-
-#include <stdio.h>
-
-void doo()
-{
-    printf("Hello from second lib\n");
-}

http://git-wip-us.apache.org/repos/asf/celix/blob/a8b8410f/examples/hello_world/private/src/test2.c
----------------------------------------------------------------------
diff --git a/examples/hello_world/private/src/test2.c b/examples/hello_world/private/src/test2.c
deleted file mode 100644
index 9beb1bc..0000000
--- a/examples/hello_world/private/src/test2.c
+++ /dev/null
@@ -1,32 +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.
- */
-/*
- * test.c
- *
- *  \date       12 Feb 2014
- *  \author     <a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
- *  \copyright  Apache License, Version 2.0
- */
-
-#include <stdio.h>
-
-void bar()
-{
-    printf("Hello from (imported) third lib\n");
-}

http://git-wip-us.apache.org/repos/asf/celix/blob/a8b8410f/examples/hello_world/public/include/test.h
----------------------------------------------------------------------
diff --git a/examples/hello_world/public/include/test.h b/examples/hello_world/public/include/test.h
deleted file mode 100644
index cdbd05d..0000000
--- a/examples/hello_world/public/include/test.h
+++ /dev/null
@@ -1,34 +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.
- */
-/*
- * test.h
- *
- *  \date       12 Feb 2014
- *  \author     <a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
- *  \copyright  Apache License, Version 2.0
- */
-
-#ifndef TEST_H_
-#define TEST_H_
-
-
-void doo(void);
-
-
-#endif /* TEST_H_ */

http://git-wip-us.apache.org/repos/asf/celix/blob/a8b8410f/examples/hello_world/public/include/test2.h
----------------------------------------------------------------------
diff --git a/examples/hello_world/public/include/test2.h b/examples/hello_world/public/include/test2.h
deleted file mode 100644
index bff9048..0000000
--- a/examples/hello_world/public/include/test2.h
+++ /dev/null
@@ -1,34 +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.
- */
-/*
- * test.h
- *
- *  \date       12 Feb 2014
- *  \author     <a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
- *  \copyright  Apache License, Version 2.0
- */
-
-#ifndef TEST2_H_
-#define TEST2_H_
-
-
-void bar(void);
-
-
-#endif /* TEST2_H_ */

http://git-wip-us.apache.org/repos/asf/celix/blob/a8b8410f/examples/hello_world_test/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/hello_world_test/CMakeLists.txt b/examples/hello_world_test/CMakeLists.txt
deleted file mode 100644
index 41045b2..0000000
--- a/examples/hello_world_test/CMakeLists.txt
+++ /dev/null
@@ -1,90 +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.
-
-#############################################################################
-## NOTE Examples of using add_celix_bundle and add_celix_container and assorted commands ##
-#############################################################################
-
-add_celix_bundle(hellotest1
-    VERSION "1.2"
-    SOURCES
-        private/src/activator
-)
-
-target_include_directories(hellotest1 PRIVATE
-        ${PROJECT_SOURCE_DIR}/utils/public/include
-        public/include
-)
-
-
-celix_bundle_headers(hellotest1
-    "X-WebContent: web"
-    "X-MediaType: application/json"
-)
-
-add_library(tlib SHARED
-    private/src/test
-)
-set_library_version(tlib "4.3.2") # sets target propery VERSION to 4.3.2 and SOVERSION to 4
-
-#celix_bundle_private_libs(hellotest1
-#    #/usr/local/lib/libjansson.4.dylib
-#    /usr/lib64/libjansson.so.4
-#)
-celix_bundle_private_libs(hellotest1
-    tlib
-    #/usr/lib/libcurl.4.dylib 
-    #    /usr/lib64/libcurl.so.4
-)
-
-
-add_celix_container(hello_test_deploy
-    BUNDLES hellotest1 hellotest2 #NOTE hellotest2 is still a unknown target
-    PROPERTIES 
-        "Test=true"
-)
-
-#add_celix_container(hello_test_deploy_fail
-#    BUNDLES nonexisting
-#)
-
-#NOTE: Gives error:
-#Error evaluating generator expression:
-#
-#    $<TARGET_PROPERTY:nonexisting,BUNDLE_FILE>
-#
-#  Target "nonexisting" not found.
-
-
-
-add_library(hello2act SHARED
-    private/src/activator
-)
-set_library_version(hello2act "3.2.4") #sets VERSION prop to 3.2.4 and SOVERSION to 3
-target_link_libraries(hello2act PRIVATE Celix::framework )
-add_celix_bundle(hellotest2
-    VERSION "1.0.0" #can be the same as activator lib, but does not have to be
-    ACTIVATOR hello2act
-)
-
-#add_celix_bundle(hellotest3
-#    VERSION "2.1.2"
-    #ACTIVATOR /usr/local/lib/libjansson.4.dylib
-    #ACTIVATOR /usr/lib64/libjansson.so.4
-    #)
-
-

http://git-wip-us.apache.org/repos/asf/celix/blob/a8b8410f/examples/hello_world_test/private/src/activator.c
----------------------------------------------------------------------
diff --git a/examples/hello_world_test/private/src/activator.c b/examples/hello_world_test/private/src/activator.c
deleted file mode 100644
index 2185e16..0000000
--- a/examples/hello_world_test/private/src/activator.c
+++ /dev/null
@@ -1,63 +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.
- */
-/*
- * activator.c
- *
- *  \date       Aug 20, 2010
- *  \author    	<a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
- *  \copyright	Apache License, Version 2.0
- */
-#include <stdlib.h>
-#include <stdio.h>
-
-#include "bundle_activator.h"
-
-
-struct userData {
-	char * word;
-};
-
-celix_status_t bundleActivator_create(bundle_context_pt __attribute__((unused)) context, void **userData) {
-	celix_status_t status = CELIX_SUCCESS;
-    *userData = malloc(sizeof(struct userData));
-    if (*userData != NULL) {
-		((struct userData *)(*userData))->word = "Import";
-	} else {
-		status = CELIX_START_ERROR;
-	}
-	return status;
-}
-
-celix_status_t bundleActivator_start(void * userData, bundle_context_pt __attribute__((unused)) context) {
-	struct userData * data = (struct userData *) userData;
-	printf("Hello %s\n", data->word);
-
-	return CELIX_SUCCESS;
-}
-
-celix_status_t bundleActivator_stop(void * userData, bundle_context_pt __attribute__((unused)) context) {
-	struct userData * data = (struct userData *) userData;
-	printf("Goodbye %s\n", data->word);
-	return CELIX_SUCCESS;
-}
-
-celix_status_t bundleActivator_destroy(void * userData, bundle_context_pt __attribute__((unused)) context) {
-    free(userData);
-	return CELIX_SUCCESS;
-}

http://git-wip-us.apache.org/repos/asf/celix/blob/a8b8410f/examples/hello_world_test/private/src/test.c
----------------------------------------------------------------------
diff --git a/examples/hello_world_test/private/src/test.c b/examples/hello_world_test/private/src/test.c
deleted file mode 100644
index 280fc61..0000000
--- a/examples/hello_world_test/private/src/test.c
+++ /dev/null
@@ -1,32 +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.
- */
-/*
- * test.c
- *
- *  \date       12 Feb 2014
- *  \author     <a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
- *  \copyright  Apache License, Version 2.0
- */
-
-#include <stdio.h>
-
-void doo()
-{
-    printf("Hello from second lib\n");
-}

http://git-wip-us.apache.org/repos/asf/celix/blob/a8b8410f/examples/hello_world_test/public/include/test.h
----------------------------------------------------------------------
diff --git a/examples/hello_world_test/public/include/test.h b/examples/hello_world_test/public/include/test.h
deleted file mode 100644
index cdbd05d..0000000
--- a/examples/hello_world_test/public/include/test.h
+++ /dev/null
@@ -1,34 +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.
- */
-/*
- * test.h
- *
- *  \date       12 Feb 2014
- *  \author     <a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
- *  \copyright  Apache License, Version 2.0
- */
-
-#ifndef TEST_H_
-#define TEST_H_
-
-
-void doo(void);
-
-
-#endif /* TEST_H_ */

http://git-wip-us.apache.org/repos/asf/celix/blob/a8b8410f/examples/log_service_example/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/log_service_example/CMakeLists.txt b/examples/log_service_example/CMakeLists.txt
deleted file mode 100644
index 31f6fc8..0000000
--- a/examples/log_service_example/CMakeLists.txt
+++ /dev/null
@@ -1,31 +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.
-
-#Importing and exporting libraries not (yet) work under OSX.
-
-add_celix_bundle(log_service_example
-    VERSION "1.0"
-    SOURCES
-        src/activator.c
-)
-target_include_directories(log_service_example PRIVATE src)
-target_link_libraries(log_service_example PRIVATE Celix::log_service_api Celix::log_helper)
-
-add_celix_container(log_example
-    GROUP log_service
-    BUNDLES log_service_example Celix::log_service Celix::shell Celix::shell_tui
-)

http://git-wip-us.apache.org/repos/asf/celix/blob/a8b8410f/examples/log_service_example/src/activator.c
----------------------------------------------------------------------
diff --git a/examples/log_service_example/src/activator.c b/examples/log_service_example/src/activator.c
deleted file mode 100644
index 75eaf59..0000000
--- a/examples/log_service_example/src/activator.c
+++ /dev/null
@@ -1,85 +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.
- */
-/*
- * activator.c
- *
- *  \date       Sep 11, 2017
- *  \author    	<a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
- *  \copyright	Apache License, Version 2.0
- */
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include "bundle_activator.h"
-#include "log_helper.h"
-
-struct userData {
-	pthread_t logger_thread;
-	bool running;
-	log_helper_pt log_helper;
-};
-
-static void *loggerThread(void *userData);
-
-celix_status_t bundleActivator_create(bundle_context_pt context, void **userData) {
-	celix_status_t status = CELIX_SUCCESS;
-    *userData = calloc(1, sizeof(struct userData));
-    if (*userData != NULL) {
-        struct userData * data = (struct userData *) *userData;
-        status = logHelper_create(context, &data->log_helper);
-	} else {
-		status = CELIX_START_ERROR;
-	}
-	return status;
-}
-
-
-celix_status_t bundleActivator_start(void * userData, bundle_context_pt context) {
-	struct userData * data = (struct userData *) userData;
-	printf("Started log example\n");
-    logHelper_start(data->log_helper);
-	data->running = true;
-    pthread_create(&data->logger_thread, NULL, loggerThread, data);
-	return CELIX_SUCCESS;
-}
-
-celix_status_t bundleActivator_stop(void * userData, bundle_context_pt context) {
-	struct userData * data = (struct userData *) userData;
-	printf("Stopping logger example\n");
-	data->running = false;
-	pthread_join(data->logger_thread, NULL);
-    logHelper_stop(data->log_helper);
-	return CELIX_SUCCESS;
-}
-
-celix_status_t bundleActivator_destroy(void * userData, bundle_context_pt context) {
-    struct userData * data = (struct userData *) userData;
-    logHelper_destroy(&data->log_helper);
-    free(userData);
-	return CELIX_SUCCESS;
-}
-
-static void *loggerThread(void *userData) {
-    struct userData * data = (struct userData *) userData;
-    while (data->running) {
-        logHelper_log(data->log_helper, OSGI_LOGSERVICE_INFO, "My log message");
-        sleep(1);
-    }
-    return NULL;
-}

http://git-wip-us.apache.org/repos/asf/celix/blob/a8b8410f/examples/mongoose/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/mongoose/CMakeLists.txt b/examples/mongoose/CMakeLists.txt
deleted file mode 100644
index d0e94ae..0000000
--- a/examples/mongoose/CMakeLists.txt
+++ /dev/null
@@ -1,42 +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.
-
-add_library(mongooselib STATIC private/src/mongoose.c)
-SET_TARGET_PROPERTIES(mongooselib PROPERTIES COMPILE_FLAGS -fPIC)
-
-SET(BUNDLE_SYMBOLICNAME "apache_celix_examples_mongoose")
-SET(BUNDLE_VERSION "0.0.1")
-
-include_directories("private/include")
-include_directories("${PROJECT_SOURCE_DIR}/utils/public/include")
-
-if(WIN32)
-	  set(LIBS wsock32)
-endif(WIN32)
-
-add_celix_bundle(mongoose
-    VERSION 0.0.1
-    SOURCES
-        private/src/activator
-        private/include/mongoose.h
-)
-
-celix_bundle_files(mongoose ${CMAKE_CURRENT_LIST_DIR}/root)
-
-target_link_libraries(mongoose PRIVATE mongooselib ${LIBS})
-
-add_celix_container("mongoose_deploy" BUNDLES Celix::shell Celix::shell_tui Celix::log_service mongoose)

http://git-wip-us.apache.org/repos/asf/celix/blob/a8b8410f/examples/mongoose/private/include/mongoose.h
----------------------------------------------------------------------
diff --git a/examples/mongoose/private/include/mongoose.h b/examples/mongoose/private/include/mongoose.h
deleted file mode 100644
index a846df4..0000000
--- a/examples/mongoose/private/include/mongoose.h
+++ /dev/null
@@ -1,218 +0,0 @@
-// Copyright (c) 2004-2010 Sergey Lyubka
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-#ifndef MONGOOSE_HEADER_INCLUDED
-#define  MONGOOSE_HEADER_INCLUDED
-
-#ifdef __cplusplus
-extern "C" {
-#endif // __cplusplus
-
-struct mg_context;     // Handle for the HTTP service itself
-struct mg_connection;  // Handle for the individual connection
-
-
-// This structure contains information about the HTTP request.
-struct mg_request_info {
-  char *request_method;  // "GET", "POST", etc
-  char *uri;             // URL-decoded URI
-  char *http_version;    // E.g. "1.0", "1.1"
-  char *query_string;    // \0 - terminated
-  char *remote_user;     // Authenticated user
-  char *log_message;     // Mongoose error log message
-  long remote_ip;        // Client's IP address
-  int remote_port;       // Client's port
-  int status_code;       // HTTP reply status code
-  int is_ssl;            // 1 if SSL-ed, 0 if not
-  int num_headers;       // Number of headers
-  struct mg_header {
-    char *name;          // HTTP header name
-    char *value;         // HTTP header value
-  } http_headers[64];    // Maximum 64 headers
-};
-
-// Various events on which user-defined function is called by Mongoose.
-enum mg_event {
-  MG_NEW_REQUEST,   // New HTTP request has arrived from the client
-  MG_HTTP_ERROR,    // HTTP error must be returned to the client
-  MG_EVENT_LOG,     // Mongoose logs an event, request_info.log_message
-  MG_INIT_SSL,      // Mongoose initializes SSL. Instead of mg_connection *,
-                    // SSL context is passed to the callback function.
-};
-
-// Prototype for the user-defined function. Mongoose calls this function
-// on every event mentioned above.
-//
-// Parameters:
-//   event: which event has been triggered.
-//   conn: opaque connection handler. Could be used to read, write data to the
-//         client, etc. See functions below that accept "mg_connection *".
-//   request_info: Information about HTTP request.
-//
-// Return:
-//   If handler returns non-NULL, that means that handler has processed the
-//   request by sending appropriate HTTP reply to the client. Mongoose treats
-//   the request as served.
-//   If callback returns NULL, that means that callback has not processed
-//   the request. Handler must not send any data to the client in this case.
-//   Mongoose proceeds with request handling as if nothing happened.
-typedef void * (*mg_callback_pt)(enum mg_event event,
-                                struct mg_connection *conn,
-                                const struct mg_request_info *request_info);
-  
-
-// Start web server.
-//
-// Parameters:
-//   callback: user defined event handling function or NULL.
-//   options: NULL terminated list of option_name, option_value pairs that
-//            specify Mongoose configuration parameters.
-//
-// Example:
-//   const char *options[] = {
-//     "document_root", "/var/www",
-//     "listening_ports", "80,443s",
-//     NULL
-//   };
-//   struct mg_context *ctx = mg_start(&my_func, options);
-//
-// Please refer to http://code.google.com/p/mongoose/wiki/MongooseManual
-// for the list of valid option and their possible values.
-//
-// Return:
-//   web server context, or NULL on error.
-struct mg_context *mg_start(mg_callback_pt callback, const char **options);
-
-
-// Stop the web server.
-//
-// Must be called last, when an application wants to stop the web server and
-// release all associated resources. This function blocks until all Mongoose
-// threads are stopped. Context pointer becomes invalid.
-void mg_stop(struct mg_context *);
-
-
-// Get the value of particular configuration parameter.
-// The value returned is read-only. Mongoose does not allow changing
-// configuration at run time.
-// If given parameter name is not valid, NULL is returned. For valid
-// names, return value is guaranteed to be non-NULL. If parameter is not
-// set, zero-length string is returned.
-const char *mg_get_option(const struct mg_context *ctx, const char *name);
-
-
-// Return array of strings that represent valid configuration options.
-// For each option, a short name, long name, and default value is returned.
-// Array is NULL terminated.
-const char **mg_get_valid_option_names(void);
-
-
-// Add, edit or delete the entry in the passwords file.
-//
-// This function allows an application to manipulate .htpasswd files on the
-// fly by adding, deleting and changing user records. This is one of the
-// several ways of implementing authentication on the server side. For another,
-// cookie-based way please refer to the examples/chat.c in the source tree.
-//
-// If password is not NULL, entry is added (or modified if already exists).
-// If password is NULL, entry is deleted.
-//
-// Return:
-//   1 on success, 0 on error.
-int mg_modify_passwords_file(struct mg_context *ctx, 
-    const char *passwords_file_name, const char *user, const char *password);
-
-// Send data to the client.
-int mg_write(struct mg_connection *, const void *buf, size_t len);
-
-
-// Send data to the browser using printf() semantics.
-//
-// Works exactly like mg_write(), but allows to do message formatting.
-// Note that mg_printf() uses internal buffer of size IO_BUF_SIZE
-// (8 Kb by default) as temporary message storage for formatting. Do not
-// print data that is bigger than that, otherwise it will be truncated.
-int mg_printf(struct mg_connection *, const char *fmt, ...);
-
-
-// Read data from the remote end, return number of bytes read.
-int mg_read(struct mg_connection *, void *buf, size_t len);
-
-
-// Get the value of particular HTTP header.
-//
-// This is a helper function. It traverses request_info->http_headers array,
-// and if the header is present in the array, returns its value. If it is
-// not present, NULL is returned.
-const char *mg_get_header(const struct mg_connection *, const char *name);
-
-
-// Get a value of particular form variable.
-//
-// Parameters:
-//   data: pointer to form-uri-encoded buffer. This could be either POST data,
-//         or request_info.query_string.
-//   data_len: length of the encoded data.
-//   var_name: variable name to decode from the buffer
-//   buf: destination buffer for the decoded variable
-//   buf_len: length of the destination buffer
-//
-// Return:
-//   On success, length of the decoded variable.
-//   On error, -1 (variable not found, or destination buffer is too small).
-//
-// Destination buffer is guaranteed to be '\0' - terminated. In case of
-// failure, dst[0] == '\0'.
-int mg_get_var(const char *data, size_t data_len,
-    const char *var_name, char *buf, size_t buf_len);
-
-// Fetch value of certain cookie variable into the destination buffer.
-//
-// Destination buffer is guaranteed to be '\0' - terminated. In case of
-// failure, dst[0] == '\0'. Note that RFC allows many occurrences of the same
-// parameter. This function returns only first occurrence.
-//
-// Return:
-//   On success, value length.
-//   On error, -1 (either "Cookie:" header is not present at all, or the
-//   requested parameter is not found, or destination buffer is too small
-//   to hold the value).
-int mg_get_cookie(const struct mg_connection *,
-    const char *cookie_name, char *buf, size_t buf_len);
-
-
-// Return Mongoose version.
-const char *mg_version(void);
-
-
-// MD5 hash given strings.
-// Buffer 'buf' must be 33 bytes long. Varargs is a NULL terminated list of
-// asciiz strings. When function returns, buf will contain human-readable
-// MD5 hash. Example:
-//   char buf[33];
-//   mg_md5(buf, "aa", "bb", NULL);
-void mg_md5(char *buf, ...);
-
-
-#ifdef __cplusplus
-}
-#endif // __cplusplus
-
-#endif // MONGOOSE_HEADER_INCLUDED

http://git-wip-us.apache.org/repos/asf/celix/blob/a8b8410f/examples/mongoose/private/src/activator.c
----------------------------------------------------------------------
diff --git a/examples/mongoose/private/src/activator.c b/examples/mongoose/private/src/activator.c
deleted file mode 100644
index beea9df..0000000
--- a/examples/mongoose/private/src/activator.c
+++ /dev/null
@@ -1,79 +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.
- */
-/*
- * activator.c
- *
- *  \date       Aug 20, 2010
- *  \author    	<a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
- *  \copyright	Apache License, Version 2.0
- */
-#include <stdlib.h>
-#include <stdio.h>
-
-#include "bundle_activator.h"
-#include "mongoose.h"
-
-struct userData {
-	struct mg_context *ctx;
-    char* entry;
-};
-
-celix_status_t bundleActivator_create(bundle_context_pt  __attribute__((unused)) context, void **userData) {
-	*userData = calloc(1, sizeof(struct userData));
-	return CELIX_SUCCESS;
-}
-
-celix_status_t bundleActivator_start(void * userData, bundle_context_pt context) {
-	bundle_pt bundle;
-	celix_status_t status = CELIX_SUCCESS;
-	struct userData * data = (struct userData *) userData;
-
-	if (bundleContext_getBundle(context, &bundle) == CELIX_SUCCESS) {
-		bundle_getEntry(bundle, "root", &data->entry);
-		const char *options[] = {
-			"document_root", data->entry,
-			"listening_ports", "8081",
-			NULL
-		};
-
-		data->ctx = mg_start(NULL, options);
-
-		if (data->ctx) {
-			printf("Mongoose started on: %s\n", mg_get_option(data->ctx, "listening_ports"));
-		}
-	} else {
-		status = CELIX_START_ERROR;
-	}
-
-	return status;
-}
-
-celix_status_t bundleActivator_stop(void * userData, bundle_context_pt  __attribute__((unused)) context) {
-	struct userData * data = (struct userData *) userData;
-	mg_stop(data->ctx);
-	printf("Mongoose stopped\n");
-	return CELIX_SUCCESS;
-}
-
-celix_status_t bundleActivator_destroy(void * userData, bundle_context_pt  __attribute__((unused)) context) {
-	struct userData * data = (struct userData *) userData;
-    free(data->entry);
-	free(data);
-	return CELIX_SUCCESS;
-}


Mime
View raw message