celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pnol...@apache.org
Subject [1/4] celix git commit: CELIX-438: Add a dependency manager API with the celix prefix. Also add a compile options to enable deprecated compiler warning for the 'old' api.
Date Mon, 26 Nov 2018 19:59:26 GMT
Repository: celix
Updated Branches:
  refs/heads/develop 352610019 -> 2492416e3


http://git-wip-us.apache.org/repos/asf/celix/blob/2492416e/libs/framework/src/dm_service_dependency.c
----------------------------------------------------------------------
diff --git a/libs/framework/src/dm_service_dependency.c b/libs/framework/src/dm_service_dependency.c
index 65a0593..583916d 100644
--- a/libs/framework/src/dm_service_dependency.c
+++ b/libs/framework/src/dm_service_dependency.c
@@ -41,78 +41,55 @@
 static celix_status_t serviceDependency_addedService(void *_ptr, service_reference_pt reference, void *service);
 static celix_status_t serviceDependency_modifiedService(void *_ptr, service_reference_pt reference, void *service);
 static celix_status_t serviceDependency_removedService(void *_ptr, service_reference_pt reference, void *service);
-static void* serviceDependency_getCallbackHandle(dm_service_dependency_pt dep);
+static void* serviceDependency_getCallbackHandle(celix_dm_service_dependency_t *dep);
 
-celix_status_t serviceDependency_create(dm_service_dependency_pt *dependency_ptr) {
-	celix_status_t status = CELIX_SUCCESS;
-
-	*dependency_ptr = calloc(1, sizeof(**dependency_ptr));
-	if (!*dependency_ptr) {
-		status = CELIX_ENOMEM;
-	} else {
-		(*dependency_ptr)->component = NULL;
-		(*dependency_ptr)->available = false;
-		(*dependency_ptr)->instanceBound = false;
-		(*dependency_ptr)->required = false;
-		(*dependency_ptr)->strategy = DM_SERVICE_DEPENDENCY_DEFAULT_STRATEGY;
-
-		(*dependency_ptr)->callbackHandle = NULL;
-		(*dependency_ptr)->set = NULL;
-		(*dependency_ptr)->add = NULL;
-		(*dependency_ptr)->change = NULL;
-		(*dependency_ptr)->remove = NULL;
-		(*dependency_ptr)->swap = NULL;
-
-		(*dependency_ptr)->add_with_ref = NULL;
-		(*dependency_ptr)->change_with_ref = NULL;
-		(*dependency_ptr)->remove_with_ref = NULL;
-		(*dependency_ptr)->swap_with_ref = NULL;
-
-		(*dependency_ptr)->autoConfigure = NULL;
-
-		(*dependency_ptr)->isStarted = false;
-
-        (*dependency_ptr)->addCLanguageFilter = false;
-		(*dependency_ptr)->tracked_service = NULL;
-		(*dependency_ptr)->tracked_filter_unmodified = NULL;
-		(*dependency_ptr)->tracked_filter = NULL;
-
-		(*dependency_ptr)->tracker = NULL;
-		(*dependency_ptr)->tracker_customizer = NULL;
-	}
-
-	return status;
+celix_status_t serviceDependency_create(celix_dm_service_dependency_t **dependency_ptr) {
+    celix_dm_service_dependency_t *dep = celix_dmServiceDependency_create();
+    if (dep != NULL) {
+        *dependency_ptr = dep;
+        return CELIX_SUCCESS;
+    } else {
+        return CELIX_BUNDLE_EXCEPTION;
+    }
 }
 
-celix_status_t serviceDependency_destroy(dm_service_dependency_pt *dependency_ptr) {
-	celix_status_t status = CELIX_SUCCESS;
+celix_dm_service_dependency_t* celix_dmServiceDependency_create() {
+	celix_dm_service_dependency_t *dep = calloc(1, sizeof(*dep));
+	dep->strategy = DM_SERVICE_DEPENDENCY_DEFAULT_STRATEGY;
+    return dep;
+}
 
-	if (!*dependency_ptr) {
-		status = CELIX_ENOMEM;
+celix_status_t serviceDependency_destroy(celix_dm_service_dependency_t **dependency_ptr) {
+	if (dependency_ptr != NULL) {
+		celix_dmServiceDependency_destroy(*dependency_ptr);
 	}
+	return CELIX_SUCCESS;
+}
 
-	if (status == CELIX_SUCCESS) {
-		free((*dependency_ptr)->tracked_service);
-		free((*dependency_ptr)->tracked_filter);
-		free((*dependency_ptr)->tracked_filter_unmodified);
-		free(*dependency_ptr);
-		*dependency_ptr = NULL;
+void celix_dmServiceDependency_destroy(celix_dm_service_dependency_t *dep) {
+	if (dep != NULL) {
+		free(dep->tracked_service);
+		free(dep->tracked_filter);
+		free(dep->tracked_filter_unmodified);
+		free(dep);
 	}
-
-	return status;
 }
 
-celix_status_t serviceDependency_lock(dm_service_dependency_pt dependency) {
+celix_status_t serviceDependency_lock(celix_dm_service_dependency_t *dependency) {
 	celixThreadMutex_lock(&dependency->lock);
 	return CELIX_SUCCESS;
 }
 
-celix_status_t serviceDependency_unlock(dm_service_dependency_pt dependency) {
+celix_status_t serviceDependency_unlock(celix_dm_service_dependency_t *dependency) {
 	celixThreadMutex_unlock(&dependency->lock);
 	return CELIX_SUCCESS;
 }
 
-celix_status_t serviceDependency_setRequired(dm_service_dependency_pt dependency, bool required) {
+celix_status_t serviceDependency_setRequired(celix_dm_service_dependency_t *dependency, bool required) {
+	return celix_dmServiceDependency_setRequired(dependency, required);
+}
+
+celix_status_t celix_dmServiceDependency_setRequired(celix_dm_service_dependency_t *dependency, bool required) {
 	celix_status_t status = CELIX_SUCCESS;
 
 	if (!dependency) {
@@ -126,12 +103,20 @@ celix_status_t serviceDependency_setRequired(dm_service_dependency_pt dependency
 	return status;
 }
 
-celix_status_t serviceDependency_setAddCLanguageFilter(dm_service_dependency_pt dependency, bool addCLangFilter) {
+celix_status_t serviceDependency_setAddCLanguageFilter(celix_dm_service_dependency_t *dependency, bool addCLangFilter) {
+	return celix_dmServiceDependency_setAddCLanguageFilter(dependency, addCLangFilter);
+}
+
+celix_status_t celix_dmServiceDependency_setAddCLanguageFilter(celix_dm_service_dependency_t *dependency, bool addCLangFilter) {
     dependency->addCLanguageFilter = addCLangFilter;
     return CELIX_SUCCESS;
 }
 
-celix_status_t serviceDependency_setStrategy(dm_service_dependency_pt dependency, dm_service_dependency_strategy_t strategy) {
+celix_status_t serviceDependency_setStrategy(celix_dm_service_dependency_t *dependency, dm_service_dependency_strategy_t strategy) {
+	return celix_dmServiceDependency_setStrategy(dependency, strategy);
+}
+
+celix_status_t celix_dmServiceDependency_setStrategy(celix_dm_service_dependency_t *dependency, dm_service_dependency_strategy_t strategy) {
 	celix_status_t status = CELIX_SUCCESS;
 
 	if (!dependency) {
@@ -143,20 +128,23 @@ celix_status_t serviceDependency_setStrategy(dm_service_dependency_pt dependency
 	return status;
 }
 
-celix_status_t serviceDependency_getStrategy(dm_service_dependency_pt dependency, dm_service_dependency_strategy_t* strategy) {
-	celix_status_t status = CELIX_SUCCESS;
-
-	if (!dependency) {
-		status = CELIX_ILLEGAL_ARGUMENT;
-	} else {
-		*strategy = dependency->strategy;
+celix_status_t serviceDependency_getStrategy(celix_dm_service_dependency_t *dependency, dm_service_dependency_strategy_t* strategy) {
+	celix_dm_service_dependency_strategy_t str = celix_dmServiceDependency_getStrategy(dependency);
+	if (strategy != NULL) {
+		*strategy = str;
 	}
+	return CELIX_SUCCESS;
+}
 
-	return status;
+celix_dm_service_dependency_strategy_t celix_dmServiceDependency_getStrategy(celix_dm_service_dependency_t *dependency) {
+	return dependency->strategy;
+}
 
+celix_status_t serviceDependency_setService(celix_dm_service_dependency_t *dependency, const char* serviceName, const char* serviceVersionRange, const char* filter) {
+	return celix_dmServiceDependency_setService(dependency, serviceName, serviceVersionRange, filter);
 }
 
-celix_status_t serviceDependency_setService(dm_service_dependency_pt dependency, const char* serviceName, const char* serviceVersionRange, const char* filter) {
+celix_status_t celix_dmServiceDependency_setService(celix_dm_service_dependency_t *dependency, const char* serviceName, const char* serviceVersionRange, const char* filter) {
 	celix_status_t status = CELIX_SUCCESS;
 	if (!dependency || !serviceName) {
 		status = CELIX_ILLEGAL_ARGUMENT;
@@ -282,13 +270,19 @@ celix_status_t serviceDependency_setService(dm_service_dependency_pt dependency,
 
 	return status;
 }
-
-celix_status_t serviceDependency_getFilter(dm_service_dependency_pt dependency, const char** filter) {
-	*filter = (const char*)dependency->tracked_filter;
+celix_status_t serviceDependency_getFilter(celix_dm_service_dependency_t *dependency, const char** filter) {
+	const char *f =  celix_dmServiceDependency_getFilter(dependency);
+	if (filter != NULL) {
+		*filter = f;
+	}
 	return CELIX_SUCCESS;
 }
 
-celix_status_t serviceDependency_setCallbacks(dm_service_dependency_pt dependency, service_set_fpt set, service_add_fpt add, service_change_fpt change, service_remove_fpt remove, service_swap_fpt swap) {
+const char* celix_dmServiceDependency_getFilter(celix_dm_service_dependency_t *dependency) {
+	return (const char*)dependency->tracked_filter;
+}
+
+celix_status_t serviceDependency_setCallbacks(celix_dm_service_dependency_t *dependency, service_set_fpt set, service_add_fpt add, service_change_fpt change, service_remove_fpt remove, service_swap_fpt swap) {
 	celix_status_t status = CELIX_SUCCESS;
 
     //printf("Setting callbacks set %p, add %p, change %p, remove %p and swap %p\n", set, add, change, remove, swap);
@@ -298,17 +292,17 @@ celix_status_t serviceDependency_setCallbacks(dm_service_dependency_pt dependenc
 	}
 
 	if (status == CELIX_SUCCESS) {
-		dependency->set = set;
-		dependency->add = add;
-		dependency->change = change;
-		dependency->remove = remove;
-		dependency->swap = swap;
+		dependency->set = (celix_dm_service_update_fp)set;
+		dependency->add = (celix_dm_service_update_fp)add;
+		dependency->change = (celix_dm_service_update_fp)change;
+		dependency->remove = (celix_dm_service_update_fp)remove;
+		dependency->swap = (celix_dm_service_swap_fp)swap;
 	}
 
 	return status;
 }
 
-celix_status_t serviceDependency_setCallbacksWithServiceReference(dm_service_dependency_pt dependency, service_set_with_ref_fpt set, service_add_with_ref_fpt add, service_change_with_ref_fpt change, service_remove_with_ref_fpt remove,
+celix_status_t serviceDependency_setCallbacksWithServiceReference(celix_dm_service_dependency_t *dependency, service_set_with_ref_fpt set, service_add_with_ref_fpt add, service_change_with_ref_fpt change, service_remove_with_ref_fpt remove,
 		service_swap_with_ref_fpt swap) {
 	celix_status_t status = CELIX_SUCCESS;
 
@@ -327,7 +321,32 @@ celix_status_t serviceDependency_setCallbacksWithServiceReference(dm_service_dep
 	return status;
 }
 
-celix_status_t serviceDependency_setAutoConfigure(dm_service_dependency_pt dependency, celix_thread_mutex_t *service_lock, const void **field) {
+celix_status_t celix_dmServiceDependency_setCallback(celix_dm_service_dependency_t *dependency, celix_dm_service_update_fp set) {
+	dependency->set = set;
+	return CELIX_SUCCESS;
+}
+
+
+celix_status_t celix_dmServiceDependency_setCallbackWithProperties(celix_dm_service_dependency_t *dependency, celix_dm_service_update_with_props_fp set) {
+	dependency->set_with_props = set;
+	return CELIX_SUCCESS;
+}
+
+
+celix_status_t celix_dmServiceDependency_setCallbacksWithOptions(celix_dm_service_dependency_t *dependency, const celix_dm_service_dependency_callback_options_t *opts) {
+	dependency->set = opts->set;
+	dependency->add = opts->add;
+	dependency->remove = opts->remove;
+	dependency->swap = opts->swap;
+
+	dependency->set_with_props = opts->setWithProps;
+	dependency->add_with_props = opts->addWithProps;
+	dependency->rem_with_props = opts->removeWithProps;
+	dependency->swap_with_props = opts->swapWithProps;
+	return CELIX_SUCCESS;
+}
+
+celix_status_t serviceDependency_setAutoConfigure(celix_dm_service_dependency_t *dependency, celix_thread_mutex_t *service_lock, const void **field) {
 	celix_status_t status = CELIX_SUCCESS;
 
 	celix_thread_mutex_t lock;
@@ -346,7 +365,7 @@ celix_status_t serviceDependency_setAutoConfigure(dm_service_dependency_pt depen
 	return status;
 }
 
-celix_status_t serviceDependency_setComponent(dm_service_dependency_pt dependency, dm_component_pt component) {
+celix_status_t serviceDependency_setComponent(celix_dm_service_dependency_t *dependency, celix_dm_component_t *component) {
 	celix_status_t status = CELIX_SUCCESS;
 
 	if (!dependency) {
@@ -360,7 +379,7 @@ celix_status_t serviceDependency_setComponent(dm_service_dependency_pt dependenc
 	return status;
 }
 
-celix_status_t serviceDependency_start(dm_service_dependency_pt dependency) {
+celix_status_t serviceDependency_start(celix_dm_service_dependency_t *dependency) {
 	celix_status_t status = CELIX_SUCCESS;
 	bundle_context_pt context = NULL;
 
@@ -396,7 +415,7 @@ celix_status_t serviceDependency_start(dm_service_dependency_pt dependency) {
 	return status;
 }
 
-celix_status_t serviceDependency_stop(dm_service_dependency_pt dependency) {
+celix_status_t serviceDependency_stop(celix_dm_service_dependency_t *dependency) {
 	celix_status_t status = CELIX_SUCCESS;
 
 	if (!dependency) {
@@ -418,7 +437,7 @@ celix_status_t serviceDependency_stop(dm_service_dependency_pt dependency) {
 	return status;
 }
 
-celix_status_t serviceDependency_setInstanceBound(dm_service_dependency_pt dependency, bool instanceBound) {
+celix_status_t serviceDependency_setInstanceBound(celix_dm_service_dependency_t *dependency, bool instanceBound) {
 	celix_status_t status = CELIX_SUCCESS;
 
 	if (!dependency) {
@@ -432,7 +451,7 @@ celix_status_t serviceDependency_setInstanceBound(dm_service_dependency_pt depen
 	return status;
 }
 
-celix_status_t serviceDependency_setAvailable(dm_service_dependency_pt dependency, bool available) {
+celix_status_t serviceDependency_setAvailable(celix_dm_service_dependency_t *dependency, bool available) {
 	celix_status_t status = CELIX_SUCCESS;
 
 	if (!dependency) {
@@ -446,7 +465,7 @@ celix_status_t serviceDependency_setAvailable(dm_service_dependency_pt dependenc
 	return status;
 }
 
-celix_status_t serviceDependency_invokeSet(dm_service_dependency_pt dependency, dm_event_pt event) {
+celix_status_t serviceDependency_invokeSet(celix_dm_service_dependency_t *dependency, dm_event_pt event) {
 	celix_status_t status = CELIX_SUCCESS;
 	assert(dependency->isStarted == true);
 	array_list_pt serviceReferences = NULL;
@@ -501,6 +520,15 @@ celix_status_t serviceDependency_invokeSet(dm_service_dependency_pt dependency,
 		if (dependency->set_with_ref) {
 			dependency->set_with_ref(serviceDependency_getCallbackHandle(dependency), curServRef, service);
 		}
+		if (dependency->set_with_props) {
+			service_registration_pt reg = NULL;
+			celix_properties_t *props = NULL;
+			serviceReference_getServiceRegistration(curServRef, &reg);
+			if (reg != NULL) {
+				serviceRegistration_getProperties(reg, &props);
+			}
+			dependency->set_with_props(serviceDependency_getCallbackHandle(dependency), service, props);
+		}
 
 		if (curServRef) {
 			bundleContext_ungetService(event->context, curServRef, NULL);
@@ -510,7 +538,7 @@ celix_status_t serviceDependency_invokeSet(dm_service_dependency_pt dependency,
 	return status;
 }
 
-celix_status_t serviceDependency_invokeAdd(dm_service_dependency_pt dependency, dm_event_pt event) {
+celix_status_t serviceDependency_invokeAdd(celix_dm_service_dependency_t *dependency, dm_event_pt event) {
 	celix_status_t status = CELIX_SUCCESS;
 
 	if (!dependency) {
@@ -519,17 +547,26 @@ celix_status_t serviceDependency_invokeAdd(dm_service_dependency_pt dependency,
 
 	if (status == CELIX_SUCCESS) {
 		if (dependency->add) {
-			dependency->add(serviceDependency_getCallbackHandle(dependency), event->service);
+			dependency->add(serviceDependency_getCallbackHandle(dependency), (void*)event->service);
 		}
 		if (dependency->add_with_ref) {
-			dependency->add_with_ref(serviceDependency_getCallbackHandle(dependency), event->reference, event->service);
+			dependency->add_with_ref(serviceDependency_getCallbackHandle(dependency), event->reference, (void*)event->service);
+		}
+		if (dependency->add_with_props) {
+			service_registration_pt reg = NULL;
+			celix_properties_t *props = NULL;
+			serviceReference_getServiceRegistration(event->reference, &reg);
+			if (reg != NULL) {
+				serviceRegistration_getProperties(reg, &props);
+			}
+			dependency->add_with_props(serviceDependency_getCallbackHandle(dependency), (void*)event->service, props);
 		}
 	}
 
 	return status;
 }
 
-celix_status_t serviceDependency_invokeChange(dm_service_dependency_pt dependency, dm_event_pt event) {
+celix_status_t serviceDependency_invokeChange(celix_dm_service_dependency_t *dependency, dm_event_pt event) {
 	celix_status_t status = CELIX_SUCCESS;
 
 	if (!dependency) {
@@ -538,7 +575,7 @@ celix_status_t serviceDependency_invokeChange(dm_service_dependency_pt dependenc
 
 	if (status == CELIX_SUCCESS) {
 		if (dependency->change) {
-			dependency->change(serviceDependency_getCallbackHandle(dependency), event->service);
+			dependency->change(serviceDependency_getCallbackHandle(dependency), (void*)event->service);
 		}
 		if (dependency->change_with_ref) {
 			dependency->change_with_ref(serviceDependency_getCallbackHandle(dependency), event->reference, event->service);
@@ -548,7 +585,7 @@ celix_status_t serviceDependency_invokeChange(dm_service_dependency_pt dependenc
 	return status;
 }
 
-celix_status_t serviceDependency_invokeRemove(dm_service_dependency_pt dependency, dm_event_pt event) {
+celix_status_t serviceDependency_invokeRemove(celix_dm_service_dependency_t *dependency, dm_event_pt event) {
 	celix_status_t status = CELIX_SUCCESS;
 
 	if (!dependency) {
@@ -557,17 +594,26 @@ celix_status_t serviceDependency_invokeRemove(dm_service_dependency_pt dependenc
 
 	if (status == CELIX_SUCCESS) {
 		if (dependency->remove) {
-			dependency->remove(serviceDependency_getCallbackHandle(dependency), event->service);
+			dependency->remove(serviceDependency_getCallbackHandle(dependency), (void*)event->service);
 		}
 		if (dependency->remove_with_ref) {
 			dependency->remove_with_ref(serviceDependency_getCallbackHandle(dependency), event->reference, event->service);
 		}
+		if (dependency->rem_with_props) {
+			service_registration_pt reg = NULL;
+			celix_properties_t *props = NULL;
+			serviceReference_getServiceRegistration(event->reference, &reg);
+			if (reg != NULL) {
+				serviceRegistration_getProperties(reg, &props);
+			}
+			dependency->rem_with_props(serviceDependency_getCallbackHandle(dependency), (void*)event->service, props);
+		}
 	}
 
 	return status;
 }
 
-celix_status_t serviceDependency_invokeSwap(dm_service_dependency_pt dependency, dm_event_pt event, dm_event_pt newEvent) {
+celix_status_t serviceDependency_invokeSwap(celix_dm_service_dependency_t *dependency, dm_event_pt event, dm_event_pt newEvent) {
 	celix_status_t status = CELIX_SUCCESS;
 
 	if (!dependency) {
@@ -576,17 +622,26 @@ celix_status_t serviceDependency_invokeSwap(dm_service_dependency_pt dependency,
 
 	if (status == CELIX_SUCCESS) {
 		if (dependency->swap) {
-			dependency->swap(serviceDependency_getCallbackHandle(dependency), event->service, newEvent->service);
+			dependency->swap(serviceDependency_getCallbackHandle(dependency), (void*)event->service, (void*)newEvent->service);
 		}
 		if (dependency->swap_with_ref) {
 			dependency->swap_with_ref(serviceDependency_getCallbackHandle(dependency), event->reference, event->service, newEvent->reference, newEvent->service);
 		}
+		if (dependency->swap_with_props) {
+			service_registration_pt reg = NULL;
+			celix_properties_t *props = NULL;
+			serviceReference_getServiceRegistration(newEvent->reference, &reg);
+			if (reg != NULL) {
+				serviceRegistration_getProperties(reg, &props);
+			}
+			dependency->swap_with_props(serviceDependency_getCallbackHandle(dependency),(void*) event->service, (void*)newEvent->service, props);
+		}
 	}
 
 	return status;
 }
 
-celix_status_t serviceDependency_isAvailable(dm_service_dependency_pt dependency, bool *available) {
+celix_status_t serviceDependency_isAvailable(celix_dm_service_dependency_t *dependency, bool *available) {
 	celix_status_t status = CELIX_SUCCESS;
 
 	if (!dependency) {
@@ -600,7 +655,7 @@ celix_status_t serviceDependency_isAvailable(dm_service_dependency_pt dependency
 	return status;
 }
 
-celix_status_t serviceDependency_isRequired(dm_service_dependency_pt dependency, bool *required) {
+celix_status_t serviceDependency_isRequired(celix_dm_service_dependency_t *dependency, bool *required) {
 	celix_status_t status = CELIX_SUCCESS;
 
 	if (!dependency) {
@@ -614,7 +669,7 @@ celix_status_t serviceDependency_isRequired(dm_service_dependency_pt dependency,
 	return status;
 }
 
-celix_status_t serviceDependency_isInstanceBound(dm_service_dependency_pt dependency, bool *instanceBound) {
+celix_status_t serviceDependency_isInstanceBound(celix_dm_service_dependency_t *dependency, bool *instanceBound) {
 	celix_status_t status = CELIX_SUCCESS;
 
 	if (!dependency) {
@@ -628,7 +683,7 @@ celix_status_t serviceDependency_isInstanceBound(dm_service_dependency_pt depend
 	return status;
 }
 
-celix_status_t serviceDependency_isAutoConfig(dm_service_dependency_pt dependency, bool *autoConfig) {
+celix_status_t serviceDependency_isAutoConfig(celix_dm_service_dependency_t *dependency, bool *autoConfig) {
 	celix_status_t status = CELIX_SUCCESS;
 
 	if (!dependency) {
@@ -642,7 +697,7 @@ celix_status_t serviceDependency_isAutoConfig(dm_service_dependency_pt dependenc
 	return status;
 }
 
-celix_status_t serviceDependency_getAutoConfig(dm_service_dependency_pt dependency, const void*** autoConfigure) {
+celix_status_t serviceDependency_getAutoConfig(celix_dm_service_dependency_t *dependency, const void*** autoConfigure) {
 	celix_status_t status = CELIX_SUCCESS;
 
 	if (!dependency) {
@@ -656,12 +711,12 @@ celix_status_t serviceDependency_getAutoConfig(dm_service_dependency_pt dependen
 	return status;
 }
 
-celix_status_t serviceDependency_addedService(void *_ptr, service_reference_pt reference, void *service) {
+static celix_status_t serviceDependency_addedService(void *_ptr, service_reference_pt reference, void *service) {
 	celix_status_t status = CELIX_SUCCESS;
 	bundle_context_pt context = NULL;
 	bundle_pt bundle = NULL;
 	dm_event_pt event = NULL;
-	dm_service_dependency_pt dependency = _ptr;
+	celix_dm_service_dependency_t *dependency = _ptr;
 
 	if (!dependency || !reference || !service) {
 		status = CELIX_ILLEGAL_ARGUMENT;
@@ -686,18 +741,18 @@ celix_status_t serviceDependency_addedService(void *_ptr, service_reference_pt r
 	}
 
 	if (status == CELIX_SUCCESS) {
-		component_handleEvent(dependency->component, dependency, event);
+		celix_private_dmComponent_handleEvent(dependency->component, dependency, event);
 	}
 
 	return status;
 }
 
-celix_status_t serviceDependency_modifiedService(void *_ptr, service_reference_pt reference, void *service) {
+static celix_status_t serviceDependency_modifiedService(void *_ptr, service_reference_pt reference, void *service) {
 	celix_status_t status = CELIX_SUCCESS;
 	bundle_context_pt context = NULL;
 	bundle_pt bundle = NULL;
 	dm_event_pt event = NULL;
-	dm_service_dependency_pt dependency = _ptr;
+	celix_dm_service_dependency_t *dependency = _ptr;
 
 	if (!dependency || !reference || !service) {
 		status = CELIX_ILLEGAL_ARGUMENT;
@@ -722,18 +777,18 @@ celix_status_t serviceDependency_modifiedService(void *_ptr, service_reference_p
 	}
 
 	if (status == CELIX_SUCCESS) {
-		component_handleEvent(dependency->component, dependency, event);
+		celix_private_dmComponent_handleEvent(dependency->component, dependency, event);
 	}
 
 	return status;
 }
 
-celix_status_t serviceDependency_removedService(void *_ptr, service_reference_pt reference, void *service) {
+static celix_status_t serviceDependency_removedService(void *_ptr, service_reference_pt reference, void *service) {
 	celix_status_t status = CELIX_SUCCESS;
 	bundle_context_pt context = NULL;
 	bundle_pt bundle = NULL;
 	dm_event_pt event = NULL;
-	dm_service_dependency_pt dependency = _ptr;
+	celix_dm_service_dependency_t *dependency = _ptr;
 
 	if (!dependency || !reference || !service) {
 		status = CELIX_ILLEGAL_ARGUMENT;
@@ -758,15 +813,21 @@ celix_status_t serviceDependency_removedService(void *_ptr, service_reference_pt
 	}
 
 	if (status == CELIX_SUCCESS) {
-		component_handleEvent(dependency->component, dependency, event);
+		celix_private_dmComponent_handleEvent(dependency->component, dependency, event);
 	}
 
 	return status;
 }
 
-celix_status_t serviceDependency_getServiceDependencyInfo(dm_service_dependency_pt dep, dm_service_dependency_info_pt *out) {
-	celix_status_t status = CELIX_SUCCESS;
-	dm_service_dependency_info_pt info = calloc(1, sizeof(*info));
+celix_status_t serviceDependency_getServiceDependencyInfo(celix_dm_service_dependency_t *dep, dm_service_dependency_info_t **out) {
+	if (out != NULL) {
+		*out = celix_dmServiceDependency_createInfo(dep);
+	}
+	return CELIX_SUCCESS;
+}
+
+dm_service_dependency_info_t* celix_dmServiceDependency_createInfo(celix_dm_service_dependency_t* dep) {
+	celix_dm_service_dependency_info_t *info = calloc(1, sizeof(*info));
 	if (info != NULL) {
 		celixThreadMutex_lock(&dep->lock);
 		info->available = dep->available;
@@ -783,29 +844,31 @@ celix_status_t serviceDependency_getServiceDependencyInfo(dm_service_dependency_
 		arrayList_destroy(refs);
 
 		celixThreadMutex_unlock(&dep->lock);
-	} else {
-		status = CELIX_ENOMEM;
 	}
+	return info;
+}
 
-	if (status == CELIX_SUCCESS) {
-		*out = info;
-	}
 
-	return status;
+void dependency_destroyDependencyInfo(dm_service_dependency_info_pt info) {
+	celix_dmServiceDependency_destroyInfo(NULL, info);
 }
 
-void dependency_destroyDependencyInfo(dm_service_dependency_info_pt info) {
+void celix_dmServiceDependency_destroyInfo(celix_dm_service_dependency_t *dep __attribute__((unused)), dm_service_dependency_info_t *info) {
 	if (info != NULL) {
 		free(info->filter);
 	}
 	free(info);
 }
 
-celix_status_t serviceDependency_setCallbackHandle(dm_service_dependency_pt dependency, void* handle) {
+celix_status_t serviceDependency_setCallbackHandle(celix_dm_service_dependency_t *dependency, void* handle) {
+	return celix_dmServiceDependency_setCallbackHandle(dependency, handle);
+}
+
+celix_status_t celix_dmServiceDependency_setCallbackHandle(celix_dm_service_dependency_t *dependency, void* handle) {
 	dependency->callbackHandle = handle;
     return CELIX_SUCCESS;
 }
 
-static void* serviceDependency_getCallbackHandle(dm_service_dependency_pt dependency) {
+static void* serviceDependency_getCallbackHandle(celix_dm_service_dependency_t *dependency) {
     return dependency->callbackHandle == NULL ? component_getImplementation(dependency->component) : dependency->callbackHandle;
 }

http://git-wip-us.apache.org/repos/asf/celix/blob/2492416e/libs/framework/src/dm_service_dependency_impl.h
----------------------------------------------------------------------
diff --git a/libs/framework/src/dm_service_dependency_impl.h b/libs/framework/src/dm_service_dependency_impl.h
index 7026ebf..3b408fb 100644
--- a/libs/framework/src/dm_service_dependency_impl.h
+++ b/libs/framework/src/dm_service_dependency_impl.h
@@ -40,19 +40,19 @@ extern "C" {
 #include "dm_service_dependency.h"
 #include "dm_component.h"
 
-struct dm_service_dependency {
-	dm_component_pt component;
+struct celix_dm_service_dependency {
+	celix_dm_component_t *component;
 	bool available;
 	bool instanceBound;
 	bool required;
 	dm_service_dependency_strategy_t strategy;
 
 	void* callbackHandle; //This handle can be set to be used instead of the component implementation
-	service_set_fpt set;
-	service_add_fpt add;
-	service_change_fpt change;
-	service_remove_fpt remove;
-	service_swap_fpt swap;
+	celix_dm_service_update_fp set;
+	celix_dm_service_update_fp add;
+	celix_dm_service_update_fp change;
+	celix_dm_service_update_fp remove;
+	celix_dm_service_swap_fp swap;
 
 	service_set_with_ref_fpt set_with_ref;
 	service_add_with_ref_fpt add_with_ref;
@@ -60,6 +60,11 @@ struct dm_service_dependency {
 	service_remove_with_ref_fpt remove_with_ref;
 	service_swap_with_ref_fpt swap_with_ref;
 
+	celix_dm_service_update_with_props_fp set_with_props;
+	celix_dm_service_update_with_props_fp add_with_props;
+	celix_dm_service_update_with_props_fp rem_with_props;
+	celix_dm_service_swap_with_props_fp swap_with_props;
+
 	const void **autoConfigure;
 	celix_thread_mutex_t lock;
 
@@ -74,28 +79,28 @@ struct dm_service_dependency {
 	service_tracker_customizer_pt tracker_customizer;
 };
 
-celix_status_t serviceDependency_start(dm_service_dependency_pt dependency);
-celix_status_t serviceDependency_stop(dm_service_dependency_pt dependency);
-celix_status_t serviceDependency_setInstanceBound(dm_service_dependency_pt dependency, bool instanceBound);
-celix_status_t serviceDependency_setAutoConfig(dm_service_dependency_pt dependency, void **autoConfigure);
-celix_status_t serviceDependency_setAvailable(dm_service_dependency_pt dependency, bool available);
-
-celix_status_t serviceDependency_setComponent(dm_service_dependency_pt dependency, dm_component_pt component);
-//celix_status_t serviceDependency_removeComponent(dm_service_dependency_pt dependency, dm_component_pt component);
-
-celix_status_t serviceDependency_invokeSet(dm_service_dependency_pt dependency, dm_event_pt event);
-celix_status_t serviceDependency_invokeAdd(dm_service_dependency_pt dependency, dm_event_pt event);
-celix_status_t serviceDependency_invokeChange(dm_service_dependency_pt dependency, dm_event_pt event);
-celix_status_t serviceDependency_invokeRemove(dm_service_dependency_pt dependency, dm_event_pt event);
-celix_status_t serviceDependency_invokeSwap(dm_service_dependency_pt dependency, dm_event_pt event, dm_event_pt newEvent);
-celix_status_t serviceDependency_isAvailable(dm_service_dependency_pt dependency, bool *available);
-celix_status_t serviceDependency_isRequired(dm_service_dependency_pt dependency, bool *required);
-celix_status_t serviceDependency_isInstanceBound(dm_service_dependency_pt dependency, bool *instanceBound);
-celix_status_t serviceDependency_isAutoConfig(dm_service_dependency_pt dependency, bool *autoConfig);
-
-celix_status_t serviceDependency_getAutoConfig(dm_service_dependency_pt dependency, const void*** autoConfigure);
-celix_status_t serviceDependency_unlock(dm_service_dependency_pt dependency);
-celix_status_t serviceDependency_lock(dm_service_dependency_pt dependency);
+celix_status_t serviceDependency_start(celix_dm_service_dependency_t *dependency);
+celix_status_t serviceDependency_stop(celix_dm_service_dependency_t *dependency);
+celix_status_t serviceDependency_setInstanceBound(celix_dm_service_dependency_t *dependency, bool instanceBound);
+celix_status_t serviceDependency_setAutoConfig(celix_dm_service_dependency_t *dependency, void **autoConfigure);
+celix_status_t serviceDependency_setAvailable(celix_dm_service_dependency_t *dependency, bool available);
+
+celix_status_t serviceDependency_setComponent(celix_dm_service_dependency_t *dependency, celix_dm_component_t *component);
+//celix_status_t serviceDependency_removeComponent(celix_dm_service_dependency_t *dependency, celix_dm_component_t *component);
+
+celix_status_t serviceDependency_invokeSet(celix_dm_service_dependency_t *dependency, dm_event_pt event);
+celix_status_t serviceDependency_invokeAdd(celix_dm_service_dependency_t *dependency, dm_event_pt event);
+celix_status_t serviceDependency_invokeChange(celix_dm_service_dependency_t *dependency, dm_event_pt event);
+celix_status_t serviceDependency_invokeRemove(celix_dm_service_dependency_t *dependency, dm_event_pt event);
+celix_status_t serviceDependency_invokeSwap(celix_dm_service_dependency_t *dependency, dm_event_pt event, dm_event_pt newEvent);
+celix_status_t serviceDependency_isAvailable(celix_dm_service_dependency_t *dependency, bool *available);
+celix_status_t serviceDependency_isRequired(celix_dm_service_dependency_t *dependency, bool *required);
+celix_status_t serviceDependency_isInstanceBound(celix_dm_service_dependency_t *dependency, bool *instanceBound);
+celix_status_t serviceDependency_isAutoConfig(celix_dm_service_dependency_t *dependency, bool *autoConfig);
+
+celix_status_t serviceDependency_getAutoConfig(celix_dm_service_dependency_t *dependency, const void*** autoConfigure);
+celix_status_t serviceDependency_unlock(celix_dm_service_dependency_t *dependency);
+celix_status_t serviceDependency_lock(celix_dm_service_dependency_t *dependency);
 
 #ifdef __cplusplus
 }

http://git-wip-us.apache.org/repos/asf/celix/blob/2492416e/libs/framework/src/framework.c
----------------------------------------------------------------------
diff --git a/libs/framework/src/framework.c b/libs/framework/src/framework.c
index 4ed4187..de14161 100644
--- a/libs/framework/src/framework.c
+++ b/libs/framework/src/framework.c
@@ -33,6 +33,7 @@
 #include <uuid/uuid.h>
 #include <assert.h>
 
+#include "celix_dependency_manager.h"
 #include "framework_private.h"
 #include "constants.h"
 #include "resolver.h"
@@ -1176,8 +1177,8 @@ celix_status_t fw_stopBundle(framework_pt framework, bundle_pt bundle, bool reco
                 if (activator->stop != NULL) {
                     status = CELIX_DO_IF(status, activator->stop(activator->userData, context));
                     if (status == CELIX_SUCCESS) {
-                        dm_dependency_manager_t *mng = celix_bundleContext_getDependencyManager(context);
-                        dependencyManager_removeAllComponents(mng);
+                        celix_dependency_manager_t *mng = celix_bundleContext_getDependencyManager(context);
+                        celix_dependencyManager_removeAllComponents(mng);
                     }
                 }
 	        }

http://git-wip-us.apache.org/repos/asf/celix/blob/2492416e/libs/framework/src/framework_private.h
----------------------------------------------------------------------
diff --git a/libs/framework/src/framework_private.h b/libs/framework/src/framework_private.h
index 10bb26f..edd9c7d 100644
--- a/libs/framework/src/framework_private.h
+++ b/libs/framework/src/framework_private.h
@@ -41,11 +41,11 @@
 #include "celix_threads.h"
 #include "service_registry.h"
 
-struct framework {
+struct celix_framework {
 #ifdef WITH_APR
     apr_pool_t *pool;
 #endif
-    struct bundle * bundle;
+    celix_bundle_t *bundle;
     long bundleId; //the bundle id of the framework (normally 0)
     hash_map_pt installRequestMap;
 

http://git-wip-us.apache.org/repos/asf/celix/blob/2492416e/libs/framework/src/module.c
----------------------------------------------------------------------
diff --git a/libs/framework/src/module.c b/libs/framework/src/module.c
index 748bb46..8569f44 100644
--- a/libs/framework/src/module.c
+++ b/libs/framework/src/module.c
@@ -39,7 +39,7 @@ struct module {
 	manifest_pt headerMap;
 	char * id;
 
-	struct bundle * bundle;
+	celix_bundle_t *bundle;
 };
 
 module_pt module_create(manifest_pt headerMap, const char * moduleId, bundle_pt bundle) {

http://git-wip-us.apache.org/repos/asf/celix/blob/2492416e/libs/utils/include/array_list.h
----------------------------------------------------------------------
diff --git a/libs/utils/include/array_list.h b/libs/utils/include/array_list.h
index bdf9547..9262984 100644
--- a/libs/utils/include/array_list.h
+++ b/libs/utils/include/array_list.h
@@ -31,72 +31,65 @@
 #include "exports.h"
 #include "celix_errno.h"
 #include "stdbool.h"
+#include "celix_array_list.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-typedef union celix_array_list_entry {
-    void *voidPtrVal;
-    int intVal;
-    long int longVal;
-    unsigned int uintVal;
-    unsigned long ulongVal;
-    double doubleVal;
-    float floatVal;
-    bool boolVal;
-    size_t sizeVal;
-} celix_array_list_entry_t;
+#ifdef ADD_CELIX_DEPRECATED_WARNING
+#define CELIX_DEPRECATED_ATTR __attribute__ ((deprecated))
+#else
+#define CELIX_DEPRECATED_ATTR
+#endif
 
-typedef struct celix_arrayList *array_list_pt;
-typedef struct celix_arrayList array_list_t;
+typedef struct celix_array_list *array_list_pt CELIX_DEPRECATED_ATTR;
+typedef struct celix_array_list array_list_t CELIX_DEPRECATED_ATTR;
 
-typedef struct arrayListIterator *array_list_iterator_pt;
-typedef struct arrayListIterator array_list_iterator_t;
+typedef struct celix_array_list_iterator *array_list_iterator_pt;
+typedef struct celix_array_list_iterator array_list_iterator_t;
 
 typedef celix_status_t (*array_list_element_equals_pt)(const void *, const void *, bool *equals);
 
-typedef bool (*celix_arrayList_equals_fp)(celix_array_list_entry_t, celix_array_list_entry_t);
-
-UTILS_EXPORT celix_status_t arrayList_create(array_list_pt *list);
+UTILS_EXPORT celix_status_t arrayList_create(celix_array_list_t **list);
 
-UTILS_EXPORT celix_status_t arrayList_createWithEquals(array_list_element_equals_pt equals, array_list_pt *list);
+UTILS_EXPORT celix_status_t arrayList_createWithEquals(array_list_element_equals_pt equals, celix_array_list_t **list);
 
-UTILS_EXPORT void arrayList_destroy(array_list_pt list);
+UTILS_EXPORT void arrayList_destroy(celix_array_list_t *list);
 
-UTILS_EXPORT void arrayList_trimToSize(array_list_pt list);
+UTILS_EXPORT void arrayList_trimToSize(celix_array_list_t *list);
 
-UTILS_EXPORT void arrayList_ensureCapacity(array_list_pt list, int capacity);
+UTILS_EXPORT void arrayList_ensureCapacity(celix_array_list_t *list, int capacity);
 
-UTILS_EXPORT unsigned int arrayList_size(array_list_pt list);
+UTILS_EXPORT unsigned int arrayList_size(celix_array_list_t *list);
 
-UTILS_EXPORT bool arrayList_isEmpty(array_list_pt list);
+UTILS_EXPORT bool arrayList_isEmpty(celix_array_list_t *list);
 
-UTILS_EXPORT bool arrayList_contains(array_list_pt list, void *element);
+UTILS_EXPORT bool arrayList_contains(celix_array_list_t *list, void *element);
 
-UTILS_EXPORT int arrayList_indexOf(array_list_pt list, void *element);
+UTILS_EXPORT int arrayList_indexOf(celix_array_list_t *list, void *element);
 
-UTILS_EXPORT int arrayList_lastIndexOf(array_list_pt list, void *element);
+UTILS_EXPORT int arrayList_lastIndexOf(celix_array_list_t *list, void *element);
 
-UTILS_EXPORT void *arrayList_get(array_list_pt list, unsigned int index);
+UTILS_EXPORT void *arrayList_get(celix_array_list_t *list, unsigned int index);
 
-UTILS_EXPORT void *arrayList_set(array_list_pt list, unsigned int index, void *element);
+UTILS_EXPORT void *arrayList_set(celix_array_list_t *list, unsigned int index, void *element);
 
-UTILS_EXPORT bool arrayList_add(array_list_pt list, void *element);
+UTILS_EXPORT bool arrayList_add(celix_array_list_t *list, void *element);
 
-UTILS_EXPORT int arrayList_addIndex(array_list_pt list, unsigned int index, void *element);
+UTILS_EXPORT int arrayList_addIndex(celix_array_list_t *list, unsigned int index, void *element);
 
-UTILS_EXPORT bool arrayList_addAll(array_list_pt list, array_list_pt toAdd);
+UTILS_EXPORT bool arrayList_addAll(celix_array_list_t *list, celix_array_list_t *toAdd);
 
-UTILS_EXPORT void *arrayList_remove(array_list_pt list, unsigned int index);
+UTILS_EXPORT void *arrayList_remove(celix_array_list_t *list, unsigned int index);
 
-UTILS_EXPORT bool arrayList_removeElement(array_list_pt list, void *element);
+UTILS_EXPORT bool arrayList_removeElement(celix_array_list_t *list, void *element);
 
-UTILS_EXPORT void arrayList_clear(array_list_pt list);
+UTILS_EXPORT void arrayList_clear(celix_array_list_t *list);
 
-UTILS_EXPORT array_list_pt arrayList_clone(array_list_pt list);
+UTILS_EXPORT celix_array_list_t *arrayList_clone(celix_array_list_t *list);
 
-UTILS_EXPORT array_list_iterator_pt arrayListIterator_create(array_list_pt list);
+UTILS_EXPORT array_list_iterator_pt arrayListIterator_create(celix_array_list_t *list);
 
 UTILS_EXPORT void arrayListIterator_destroy(array_list_iterator_pt iterator);
 

http://git-wip-us.apache.org/repos/asf/celix/blob/2492416e/libs/utils/include/celix_array_list.h
----------------------------------------------------------------------
diff --git a/libs/utils/include/celix_array_list.h b/libs/utils/include/celix_array_list.h
index b4b5742..4bb3e7b 100644
--- a/libs/utils/include/celix_array_list.h
+++ b/libs/utils/include/celix_array_list.h
@@ -17,7 +17,6 @@
  *under the License.
  */
 
-#include "array_list.h"
 #include "celixbool.h"
 #include "exports.h"
 #include "celix_errno.h"
@@ -30,8 +29,22 @@
 extern "C" {
 #endif
 
+typedef union celix_array_list_entry {
+    void *voidPtrVal;
+    int intVal;
+    long int longVal;
+    unsigned int uintVal;
+    unsigned long ulongVal;
+    double doubleVal;
+    float floatVal;
+    bool boolVal;
+    size_t sizeVal;
+} celix_array_list_entry_t;
+
+typedef struct celix_array_list celix_array_list_t;
+
+typedef bool (*celix_arrayList_equals_fp)(celix_array_list_entry_t, celix_array_list_entry_t);
 
-typedef struct celix_arrayList celix_array_list_t;
 
 celix_array_list_t* celix_arrayList_create();
 

http://git-wip-us.apache.org/repos/asf/celix/blob/2492416e/libs/utils/include/filter.h
----------------------------------------------------------------------
diff --git a/libs/utils/include/filter.h b/libs/utils/include/filter.h
index 1fc194a..105925c 100644
--- a/libs/utils/include/filter.h
+++ b/libs/utils/include/filter.h
@@ -37,7 +37,7 @@ celix_filter_t* filter_create(const char *filterString);
 
 void filter_destroy(celix_filter_t *filter);
 
-celix_status_t filter_match(celix_filter_t *filter, properties_t *properties, bool *result);
+celix_status_t filter_match(celix_filter_t *filter, celix_properties_t *properties, bool *result);
 
 celix_status_t filter_match_filter(celix_filter_t *src, filter_t *dest, bool *result);
 

http://git-wip-us.apache.org/repos/asf/celix/blob/2492416e/libs/utils/include/properties.h
----------------------------------------------------------------------
diff --git a/libs/utils/include/properties.h b/libs/utils/include/properties.h
index 0efe0c4..f0070bd 100644
--- a/libs/utils/include/properties.h
+++ b/libs/utils/include/properties.h
@@ -29,36 +29,45 @@
 
 #include <stdio.h>
 
+#include "celix_properties.h"
 #include "hash_map.h"
 #include "exports.h"
 #include "celix_errno.h"
 #ifdef __cplusplus
 extern "C" {
 #endif
-typedef hash_map_pt properties_pt;
-typedef hash_map_t properties_t;
 
-UTILS_EXPORT properties_pt properties_create(void);
 
-UTILS_EXPORT void properties_destroy(properties_pt properties);
+#ifdef ADD_CELIX_DEPRECATED_WARNING
+#define CELIX_DEPRECATED_ATTR __attribute__ ((deprecated))
+#else
+#define CELIX_DEPRECATED_ATTR
+#endif
+
+typedef hash_map_pt properties_pt CELIX_DEPRECATED_ATTR;
+typedef hash_map_t properties_t CELIX_DEPRECATED_ATTR;
+
+UTILS_EXPORT celix_properties_t* properties_create(void);
+
+UTILS_EXPORT void properties_destroy(celix_properties_t *properties);
 
-UTILS_EXPORT properties_pt properties_load(const char *filename);
+UTILS_EXPORT celix_properties_t* properties_load(const char *filename);
 
-UTILS_EXPORT properties_pt properties_loadWithStream(FILE *stream);
+UTILS_EXPORT celix_properties_t* properties_loadWithStream(FILE *stream);
 
-UTILS_EXPORT properties_pt properties_loadFromString(const char *input);
+UTILS_EXPORT celix_properties_t* properties_loadFromString(const char *input);
 
-UTILS_EXPORT void properties_store(properties_pt properties, const char *file, const char *header);
+UTILS_EXPORT void properties_store(celix_properties_t *properties, const char *file, const char *header);
 
-UTILS_EXPORT const char *properties_get(properties_pt properties, const char *key);
+UTILS_EXPORT const char* properties_get(celix_properties_t *properties, const char *key);
 
-UTILS_EXPORT const char *properties_getWithDefault(properties_pt properties, const char *key, const char *defaultValue);
+UTILS_EXPORT const char* properties_getWithDefault(celix_properties_t *properties, const char *key, const char *defaultValue);
 
-UTILS_EXPORT void properties_set(properties_pt properties, const char *key, const char *value);
+UTILS_EXPORT void properties_set(celix_properties_t *properties, const char *key, const char *value);
 
-UTILS_EXPORT void properties_unset(properties_pt properties, const char *key);
+UTILS_EXPORT void properties_unset(celix_properties_t *properties, const char *key);
 
-UTILS_EXPORT celix_status_t properties_copy(properties_pt properties, properties_pt *copy);
+UTILS_EXPORT celix_status_t properties_copy(celix_properties_t *properties, celix_properties_t **copy);
 
 #define PROPERTIES_FOR_EACH(props, key) \
     for(hash_map_iterator_t iter = hashMapIterator_construct(props); \

http://git-wip-us.apache.org/repos/asf/celix/blob/2492416e/libs/utils/private/test/filter_test.cpp
----------------------------------------------------------------------
diff --git a/libs/utils/private/test/filter_test.cpp b/libs/utils/private/test/filter_test.cpp
index 0dbe61f..c42c8f1 100644
--- a/libs/utils/private/test/filter_test.cpp
+++ b/libs/utils/private/test/filter_test.cpp
@@ -155,7 +155,7 @@ TEST(filter, create_misc){
 	get_filter = filter_create(filter_str3);
 	CHECK(get_filter != NULL);
 	LONGS_EQUAL(CELIX_FILTER_OPERAND_SUBSTRING, get_filter->operand)
-	LONGS_EQUAL(2, arrayList_size((array_list_pt) get_filter->children));
+	LONGS_EQUAL(2, celix_arrayList_size((celix_array_list_t*) get_filter->children));
 	filter_destroy(get_filter);
 
 	//test parsing a attribute of 0 length

http://git-wip-us.apache.org/repos/asf/celix/blob/2492416e/libs/utils/src/array_list_private.h
----------------------------------------------------------------------
diff --git a/libs/utils/src/array_list_private.h b/libs/utils/src/array_list_private.h
index 5f83605..df37354 100644
--- a/libs/utils/src/array_list_private.h
+++ b/libs/utils/src/array_list_private.h
@@ -29,7 +29,7 @@
 
 #include "array_list.h"
 
-struct celix_arrayList {
+struct celix_array_list {
 	celix_array_list_entry_t* elementData;
 	size_t size;
 	size_t capacity;
@@ -40,7 +40,7 @@ struct celix_arrayList {
 	celix_arrayList_equals_fp  equals;
 };
 
-struct arrayListIterator {
+struct celix_array_list_iterator {
 	array_list_pt list;
 	unsigned int cursor;
 	int lastReturned;

http://git-wip-us.apache.org/repos/asf/celix/blob/2492416e/libs/utils/src/filter.c
----------------------------------------------------------------------
diff --git a/libs/utils/src/filter.c b/libs/utils/src/filter.c
index 1218f31..db92d70 100644
--- a/libs/utils/src/filter.c
+++ b/libs/utils/src/filter.c
@@ -36,7 +36,7 @@ static celix_filter_t * filter_parseNot(char* filterString, int* pos);
 static celix_filter_t * filter_parseItem(char* filterString, int* pos);
 static char * filter_parseAttr(char* filterString, int* pos);
 static char * filter_parseValue(char* filterString, int* pos);
-static array_list_pt filter_parseSubstring(char* filterString, int* pos);
+static celix_array_list_t* filter_parseSubstring(char* filterString, int* pos);
 
 static celix_status_t filter_compare(const celix_filter_t* filter, const char *propertyValue, bool *result);
 
@@ -106,7 +106,6 @@ static celix_filter_t * filter_parseFilterComp(char * filterString, int * pos) {
 
 static celix_filter_t * filter_parseAndOrOr(char * filterString, celix_filter_operand_t andOrOr, int * pos) {
 
-	array_list_pt children = NULL;
 	filter_skipWhiteSpace(filterString, pos);
 	bool failure = false;
 
@@ -115,23 +114,23 @@ static celix_filter_t * filter_parseAndOrOr(char * filterString, celix_filter_op
 		return NULL;
 	}
 
-	arrayList_create(&children);
+	celix_array_list_t *children = celix_arrayList_create();
 	while(filterString[*pos] == '(') {
 		celix_filter_t * child = filter_parseFilter(filterString, pos);
 		if(child == NULL) {
 			failure = true;
 			break;
 		}
-		arrayList_add(children, child);
+		celix_arrayList_add(children, child);
 	}
 
 	if(failure == true){
         int i;
-		for (i = 0; i < arrayList_size(children); ++i) {
-			celix_filter_t * f = arrayList_get(children, i);
+		for (i = 0; i < celix_arrayList_size(children); ++i) {
+			celix_filter_t * f = celix_arrayList_get(children, i);
 			filter_destroy(f);
 		}
-		arrayList_destroy(children);
+		celix_arrayList_destroy(children);
         children = NULL;
 	}
 
@@ -153,9 +152,8 @@ static celix_filter_t * filter_parseNot(char * filterString, int * pos) {
 
 	child = filter_parseFilter(filterString, pos);
 
-    array_list_t* children = NULL;
-    arrayList_create(&children);
-    arrayList_add(children, child);
+    celix_array_list_t* children = celix_arrayList_create();
+    celix_arrayList_add(children, child);
 
 	celix_filter_t * filter = (celix_filter_t *) calloc(1, sizeof(*filter));
 	filter->operand = CELIX_FILTER_OPERAND_NOT;
@@ -223,7 +221,7 @@ static celix_filter_t * filter_parseItem(char * filterString, int * pos) {
 		}
 		case '=': {
 			celix_filter_t * filter = NULL;
-			array_list_pt subs;
+			celix_array_list_t *subs;
 			if (filterString[*pos + 1] == '*') {
 				int oldPos = *pos;
 				*pos += 2;
@@ -241,15 +239,15 @@ static celix_filter_t * filter_parseItem(char * filterString, int * pos) {
 			(*pos)++;
 			subs = filter_parseSubstring(filterString, pos);
 			if(subs!=NULL){
-				if (arrayList_size(subs) == 1) {
-					char * string = (char *) arrayList_get(subs, 0);
+				if (celix_arrayList_size(subs) == 1) {
+					char * string = (char *) celix_arrayList_get(subs, 0);
 					if (string != NULL) {
 						filter->operand = CELIX_FILTER_OPERAND_EQUAL;
 						filter->attribute = attr;
 						filter->value = string;
 
-						arrayList_clear(subs);
-						arrayList_destroy(subs);
+						celix_arrayList_clear(subs);
+						celix_arrayList_destroy(subs);
 
 						return filter;
 					}
@@ -344,12 +342,11 @@ static char * filter_parseValue(char * filterString, int * pos) {
 	return value;
 }
 
-static array_list_pt filter_parseSubstring(char * filterString, int * pos) {
+static celix_array_list_t* filter_parseSubstring(char * filterString, int * pos) {
 	char *sub = calloc(strlen(filterString) + 1, sizeof(*sub));
-	array_list_pt operands = NULL;
+	celix_array_list_t* operands = celix_arrayList_create();
 	int keepRunning = 1;
 
-	arrayList_create(&operands);
 	while (keepRunning) {
 		char c = filterString[*pos];
 		
@@ -357,7 +354,7 @@ static array_list_pt filter_parseSubstring(char * filterString, int * pos) {
 		switch (c) {
 			case ')': {
 				if (strlen(sub) > 0) {
-					arrayList_add(operands, strdup(sub));
+					celix_arrayList_add(operands, strdup(sub));
 				}
 				keepRunning = 0;
 				break;
@@ -374,10 +371,10 @@ static array_list_pt filter_parseSubstring(char * filterString, int * pos) {
 			}
 			case '*': {
 				if (strlen(sub) > 0) {
-					arrayList_add(operands, strdup(sub));
+					celix_arrayList_add(operands, strdup(sub));
 				}
 				sub[0] = '\0';
-				arrayList_add(operands, NULL);
+				celix_arrayList_add(operands, NULL);
 				(*pos)++;
 				break;
 			}
@@ -398,9 +395,9 @@ static array_list_pt filter_parseSubstring(char * filterString, int * pos) {
 	}
 	free(sub);
 
-	if (arrayList_size(operands) == 0) {
+	if (celix_arrayList_size(operands) == 0) {
         fprintf(stderr, "Filter Error: Missing value.");
-		arrayList_destroy(operands);
+		celix_arrayList_destroy(operands);
 		return NULL;
 	}
 
@@ -428,14 +425,14 @@ static celix_status_t filter_compare(const celix_filter_t* filter, const char *p
         case CELIX_FILTER_OPERAND_SUBSTRING: {
             int pos = 0;
             unsigned int i;
-            int size = arrayList_size(filter->children);
+            int size = celix_arrayList_size(filter->children);
             for (i = 0; i < size; i++) {
-                char * substr = (char *) arrayList_get(filter->children, i);
+                char * substr = (char *) celix_arrayList_get(filter->children, i);
 
                 if (i + 1 < size) {
                     if (substr == NULL) {
                         unsigned int index;
-                        char * substr2 = (char *) arrayList_get(filter->children, i + 1);
+                        char * substr2 = (char *) celix_arrayList_get(filter->children, i + 1);
                         if (substr2 == NULL) {
                             continue;
                         }
@@ -564,22 +561,22 @@ void celix_filter_destroy(celix_filter_t *filter) {
 	if (filter != NULL) {
 		if(filter->children != NULL){
 			if (filter->operand == CELIX_FILTER_OPERAND_SUBSTRING) {
-				int size = arrayList_size(filter->children);
+				int size = celix_arrayList_size(filter->children);
 				int i = 0;
 				for (i = 0; i < size; i++) {
-					char *operand = arrayList_get(filter->children, i);
+					char *operand = celix_arrayList_get(filter->children, i);
 					free(operand);
 				}
-				arrayList_destroy(filter->children);
+				celix_arrayList_destroy(filter->children);
 				filter->children = NULL;
 			} else if (filter->operand == CELIX_FILTER_OPERAND_OR || filter->operand == CELIX_FILTER_OPERAND_AND || filter->operand == CELIX_FILTER_OPERAND_NOT) {
-				int size = arrayList_size(filter->children);
+				int size = celix_arrayList_size(filter->children);
 				int i = 0;
 				for (i = 0; i < size; i++) {
-					celix_filter_t *f = arrayList_get(filter->children, i);
+					celix_filter_t *f = celix_arrayList_get(filter->children, i);
 					filter_destroy(f);
 				}
-				arrayList_destroy(filter->children);
+				celix_arrayList_destroy(filter->children);
 				filter->children = NULL;
 			} else {
                 fprintf(stderr, "Filter Error: Corrupt filter. children has a value, but not an expected operand");
@@ -599,10 +596,10 @@ bool celix_filter_match(const celix_filter_t *filter, const celix_properties_t*
 	bool result = false;
 	switch (filter->operand) {
 		case CELIX_FILTER_OPERAND_AND: {
-			array_list_pt children = filter->children;
+			celix_array_list_t* children = filter->children;
 			unsigned int i;
-			for (i = 0; i < arrayList_size(children); i++) {
-				celix_filter_t * sfilter = (celix_filter_t *) arrayList_get(children, i);
+			for (i = 0; i < celix_arrayList_size(children); i++) {
+				celix_filter_t * sfilter = (celix_filter_t *) celix_arrayList_get(children, i);
 				bool mresult = celix_filter_match(sfilter, properties);
 				if (!mresult) {
 					return false;
@@ -611,10 +608,10 @@ bool celix_filter_match(const celix_filter_t *filter, const celix_properties_t*
 			return true;
 		}
 		case CELIX_FILTER_OPERAND_OR: {
-			array_list_pt children = filter->children;
+			celix_array_list_t* children = filter->children;
 			unsigned int i;
-			for (i = 0; i < arrayList_size(children); i++) {
-				celix_filter_t * sfilter = (celix_filter_t *) arrayList_get(children, i);
+			for (i = 0; i < celix_arrayList_size(children); i++) {
+				celix_filter_t * sfilter = (celix_filter_t *) celix_arrayList_get(children, i);
 				bool mresult = celix_filter_match(sfilter, properties);
 				if (mresult) {
 					return true;
@@ -623,7 +620,7 @@ bool celix_filter_match(const celix_filter_t *filter, const celix_properties_t*
 			return false;
 		}
 		case CELIX_FILTER_OPERAND_NOT: {
-			celix_filter_t * sfilter = arrayList_get(filter->children, 0);
+			celix_filter_t * sfilter = celix_arrayList_get(filter->children, 0);
 			bool mresult = celix_filter_match(sfilter, properties);
 			return !mresult;
 		}
@@ -662,9 +659,9 @@ bool celix_filter_matchFilter(const celix_filter_t *filter1, const celix_filter_
 				int sameCount = 0;
 				for (i =0; i < sizeSrc; ++i) {
 					bool same = false;
-					celix_filter_t *srcPart = arrayList_get(filter1->children, i);
+					celix_filter_t *srcPart = celix_arrayList_get(filter1->children, i);
 					for (k = 0; k < sizeDest; ++k) {
-						celix_filter_t *destPart = arrayList_get(filter2->children, k);
+						celix_filter_t *destPart = celix_arrayList_get(filter2->children, k);
 						filter_match_filter(srcPart, destPart, &same);
 						if (same) {
 							sameCount += 1;


Mime
View raw message