You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celix.apache.org by ab...@apache.org on 2012/12/05 10:06:34 UTC
svn commit: r1417320 [2/7] - in /incubator/celix/trunk:
dependency_manager/private/src/ dependency_manager/public/include/
deployment_admin/private/include/ deployment_admin/private/src/
device_access/device_access/private/include/ device_access/device...
Modified: incubator/celix/trunk/device_access/device_access/private/src/driver_loader.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/device_access/device_access/private/src/driver_loader.c?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/device_access/device_access/private/src/driver_loader.c (original)
+++ incubator/celix/trunk/device_access/device_access/private/src/driver_loader.c Wed Dec 5 09:05:46 2012
@@ -35,7 +35,7 @@ struct driver_loader {
apr_pool_t *pool;
bundle_context_t context;
- ARRAY_LIST loadedDrivers;
+ array_list_t loadedDrivers;
};
static apr_status_t driverLoader_destroy(void *loaderP);
@@ -64,13 +64,13 @@ apr_status_t driverLoader_destroy(void *
return APR_SUCCESS;
}
-celix_status_t driverLoader_findDrivers(driver_loader_t loader, apr_pool_t *pool, ARRAY_LIST locators, PROPERTIES properties, ARRAY_LIST *driversIds) {
+celix_status_t driverLoader_findDrivers(driver_loader_t loader, apr_pool_t *pool, array_list_t locators, properties_t properties, array_list_t *driversIds) {
celix_status_t status = CELIX_SUCCESS;
arrayList_create(pool, driversIds);
int i;
for (i = 0; i < arrayList_size(locators); i++) {
- ARRAY_LIST drivers;
+ array_list_t drivers;
driver_locator_service_t locator = arrayList_get(locators, i);
apr_pool_t *spool;
@@ -90,7 +90,7 @@ celix_status_t driverLoader_findDrivers(
return status;
}
-celix_status_t driverLoader_findDriversForLocator(driver_loader_t loader, apr_pool_t *pool, driver_locator_service_t locator, PROPERTIES properties, ARRAY_LIST *driversIds) {
+celix_status_t driverLoader_findDriversForLocator(driver_loader_t loader, apr_pool_t *pool, driver_locator_service_t locator, properties_t properties, array_list_t *driversIds) {
celix_status_t status = CELIX_SUCCESS;
status = locator->findDrivers(locator->locator, pool, properties, driversIds);
@@ -98,13 +98,13 @@ celix_status_t driverLoader_findDriversF
return status;
}
-celix_status_t driverLoader_loadDrivers(driver_loader_t loader, apr_pool_t *pool, ARRAY_LIST locators, ARRAY_LIST driverIds, ARRAY_LIST *references) {
+celix_status_t driverLoader_loadDrivers(driver_loader_t loader, apr_pool_t *pool, array_list_t locators, array_list_t driverIds, array_list_t *references) {
celix_status_t status = CELIX_SUCCESS;
status = arrayList_create(pool, references);
if (status == CELIX_SUCCESS) {
int i;
for (i = 0; i < arrayList_size(driverIds); i++) {
- ARRAY_LIST refs = NULL;
+ array_list_t refs = NULL;
char *id = arrayList_get(driverIds, i);
apr_pool_t *spool;
@@ -127,13 +127,13 @@ celix_status_t driverLoader_loadDrivers(
return status;
}
-celix_status_t driverLoader_loadDriver(driver_loader_t loader, apr_pool_t *pool, ARRAY_LIST locators, char *driverId, ARRAY_LIST *references) {
+celix_status_t driverLoader_loadDriver(driver_loader_t loader, apr_pool_t *pool, array_list_t locators, char *driverId, array_list_t *references) {
celix_status_t status = CELIX_SUCCESS;
status = arrayList_create(pool, references);
if (status == CELIX_SUCCESS) {
int i;
for (i = 0; i < arrayList_size(locators); i++) {
- ARRAY_LIST refs = NULL;
+ array_list_t refs = NULL;
driver_locator_service_t locator = arrayList_get(locators, i);
apr_pool_t *spool;
@@ -158,7 +158,7 @@ celix_status_t driverLoader_loadDriver(d
return status;
}
-celix_status_t driverLoader_loadDriverForLocator(driver_loader_t loader, apr_pool_t *pool, driver_locator_service_t locator, char *driverId, ARRAY_LIST *references) {
+celix_status_t driverLoader_loadDriverForLocator(driver_loader_t loader, apr_pool_t *pool, driver_locator_service_t locator, char *driverId, array_list_t *references) {
celix_status_t status = CELIX_SUCCESS;
arrayList_create(loader->pool, references);
@@ -170,7 +170,7 @@ celix_status_t driverLoader_loadDriverFo
char *filename = NULL;
status = locator->loadDriver(locator->locator, loadPool, driverId, &filename);
if (status == CELIX_SUCCESS) {
- BUNDLE bundle = NULL;
+ bundle_t bundle = NULL;
apr_pool_t *bundlePool;
status = bundleContext_getMemoryPool(loader->context, &bundlePool);
if (status == CELIX_SUCCESS) {
@@ -196,18 +196,18 @@ celix_status_t driverLoader_loadDriverFo
celix_status_t driverLoader_unloadDrivers(driver_loader_t loader, driver_attributes_t finalDriver) {
celix_status_t status = CELIX_SUCCESS;
- SERVICE_REFERENCE finalReference = NULL;
+ service_reference_t finalReference = NULL;
if (finalDriver != NULL) {
status = driverAttributes_getReference(finalDriver, &finalReference);
}
if (status == CELIX_SUCCESS) {
int i;
for (i = 0; i < arrayList_size(loader->loadedDrivers); i++) {
- SERVICE_REFERENCE reference = arrayList_get(loader->loadedDrivers, i);
+ service_reference_t reference = arrayList_get(loader->loadedDrivers, i);
bool equal = false;
status = serviceReference_equals(reference, finalReference, &equal);
if (status == CELIX_SUCCESS && !equal) {
- BUNDLE bundle = NULL;
+ bundle_t bundle = NULL;
status = serviceReference_getBundle(reference, &bundle);
if (status == CELIX_SUCCESS) {
bundle_uninstall(bundle); // Ignore status
Modified: incubator/celix/trunk/device_access/device_access/private/src/driver_matcher.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/device_access/device_access/private/src/driver_matcher.c?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/device_access/device_access/private/src/driver_matcher.c (original)
+++ incubator/celix/trunk/device_access/device_access/private/src/driver_matcher.c Wed Dec 5 09:05:46 2012
@@ -32,8 +32,8 @@
struct driver_matcher {
apr_pool_t *pool;
- HASH_MAP attributes;
- ARRAY_LIST matches;
+ hash_map_t attributes;
+ array_list_t matches;
bundle_context_t context;
};
@@ -43,7 +43,7 @@ typedef struct match_key {
} *match_key_t;
static apr_status_t driverMatcher_destroy(void *matcherP);
-static celix_status_t driverMatcher_get(driver_matcher_t matcher, int key, ARRAY_LIST *attributesV);
+static celix_status_t driverMatcher_get(driver_matcher_t matcher, int key, array_list_t *attributesV);
static celix_status_t driverMatcher_getBestMatchInternal(driver_matcher_t matcher, apr_pool_t *pool, match_t *match);
unsigned int driverMatcher_matchKeyHash(void * match_key) {
@@ -79,9 +79,9 @@ celix_status_t driverMatcher_create(apr_
apr_status_t driverMatcher_destroy(void *matcherP) {
driver_matcher_t matcher = matcherP;
arrayList_destroy(matcher->matches);
- HASH_MAP_ITERATOR iter = hashMapIterator_create(matcher->attributes);
+ hash_map_iterator_t iter = hashMapIterator_create(matcher->attributes);
while (hashMapIterator_hasNext(iter)) {
- ARRAY_LIST list = hashMapIterator_nextValue(iter);
+ array_list_t list = hashMapIterator_nextValue(iter);
if (list != NULL) {
arrayList_destroy(list);
}
@@ -94,7 +94,7 @@ apr_status_t driverMatcher_destroy(void
celix_status_t driverMatcher_add(driver_matcher_t matcher, int matchValue, driver_attributes_t attributes) {
celix_status_t status = CELIX_SUCCESS;
- ARRAY_LIST da = NULL;
+ array_list_t da = NULL;
status = driverMatcher_get(matcher, matchValue, &da);
if (status == CELIX_SUCCESS) {
arrayList_add(da, attributes);
@@ -114,7 +114,7 @@ celix_status_t driverMatcher_add(driver_
return status;
}
-celix_status_t driverMatcher_get(driver_matcher_t matcher, int key, ARRAY_LIST *attributes) {
+celix_status_t driverMatcher_get(driver_matcher_t matcher, int key, array_list_t *attributes) {
celix_status_t status = CELIX_SUCCESS;
apr_pool_t *spool = NULL;
@@ -136,13 +136,13 @@ celix_status_t driverMatcher_get(driver_
return status;
}
-celix_status_t driverMatcher_getBestMatch(driver_matcher_t matcher, apr_pool_t *pool, SERVICE_REFERENCE reference, match_t *match) {
+celix_status_t driverMatcher_getBestMatch(driver_matcher_t matcher, apr_pool_t *pool, service_reference_t reference, match_t *match) {
celix_status_t status = CELIX_SUCCESS;
if (*match != NULL) {
status = CELIX_ILLEGAL_ARGUMENT;
} else {
- SERVICE_REFERENCE selectorRef = NULL;
+ service_reference_t selectorRef = NULL;
status = bundleContext_getServiceReference(matcher->context, DRIVER_SELECTOR_SERVICE_NAME, &selectorRef);
if (status == CELIX_SUCCESS) {
int index = -1;
@@ -176,9 +176,9 @@ celix_status_t driverMatcher_getBestMatc
if (!hashMap_isEmpty(matcher->attributes)) {
match_key_t matchKey = NULL;
- HASH_MAP_ITERATOR iter = hashMapIterator_create(matcher->attributes);
+ hash_map_iterator_t iter = hashMapIterator_create(matcher->attributes);
while (hashMapIterator_hasNext(iter)) {
- HASH_MAP_ENTRY entry = hashMapIterator_nextEntry(iter);
+ hash_map_entry_t entry = hashMapIterator_nextEntry(iter);
match_key_t key = hashMapEntry_getKey(entry);
if (matchKey == NULL || matchKey->matchValue < key->matchValue) {
matchKey = key;
@@ -186,12 +186,12 @@ celix_status_t driverMatcher_getBestMatc
}
hashMapIterator_destroy(iter);
- ARRAY_LIST das = hashMap_get(matcher->attributes, matchKey);
- SERVICE_REFERENCE best = NULL;
+ array_list_t das = hashMap_get(matcher->attributes, matchKey);
+ service_reference_t best = NULL;
int i;
for (i = 0; i < arrayList_size(das); i++) {
driver_attributes_t attributes = arrayList_get(das, i);
- SERVICE_REFERENCE reference = NULL;
+ service_reference_t reference = NULL;
celix_status_t substatus = driverAttributes_getReference(attributes, &reference);
if (substatus == CELIX_SUCCESS) {
@@ -199,10 +199,10 @@ celix_status_t driverMatcher_getBestMatc
printf("DRIVER_MATCHER: Compare ranking\n");
char *rank1Str, *rank2Str;
int rank1, rank2;
- SERVICE_REGISTRATION registration = NULL;
+ service_registration_t registration = NULL;
substatus = serviceReference_getServiceRegistration(reference, ®istration);
if (substatus == CELIX_SUCCESS) {
- PROPERTIES properties = NULL;
+ properties_t properties = NULL;
status = serviceRegistration_getProperties(registration, &properties);
if (status == CELIX_SUCCESS) {
Modified: incubator/celix/trunk/device_access/device_access/public/include/driver.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/device_access/device_access/public/include/driver.h?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/device_access/device_access/public/include/driver.h (original)
+++ incubator/celix/trunk/device_access/device_access/public/include/driver.h Wed Dec 5 09:05:46 2012
@@ -35,8 +35,8 @@
struct driver_service {
void *driver;
- celix_status_t (*attach)(void *driver, SERVICE_REFERENCE reference, char **result);
- celix_status_t (*match)(void *driver, SERVICE_REFERENCE reference, int *value);
+ celix_status_t (*attach)(void *driver, service_reference_t reference, char **result);
+ celix_status_t (*match)(void *driver, service_reference_t reference, int *value);
};
typedef struct driver_service *driver_service_t;
Modified: incubator/celix/trunk/device_access/device_access/public/include/driver_locator.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/device_access/device_access/public/include/driver_locator.h?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/device_access/device_access/public/include/driver_locator.h (original)
+++ incubator/celix/trunk/device_access/device_access/public/include/driver_locator.h Wed Dec 5 09:05:46 2012
@@ -36,7 +36,7 @@ typedef struct driver_locator *driver_lo
struct driver_locator_service {
driver_locator_t locator;
- celix_status_t(*findDrivers)(driver_locator_t loc, apr_pool_t *pool, PROPERTIES props, ARRAY_LIST *drivers);
+ celix_status_t(*findDrivers)(driver_locator_t loc, apr_pool_t *pool, properties_t props, array_list_t *drivers);
celix_status_t(*loadDriver)(driver_locator_t loc, apr_pool_t *pool, char *id, char **driver);
};
Modified: incubator/celix/trunk/device_access/device_access/public/include/driver_selector.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/device_access/device_access/public/include/driver_selector.h?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/device_access/device_access/public/include/driver_selector.h (original)
+++ incubator/celix/trunk/device_access/device_access/public/include/driver_selector.h Wed Dec 5 09:05:46 2012
@@ -32,7 +32,7 @@ typedef struct driver_selector *driver_s
struct driver_selector_service {
driver_selector_t selector;
- celix_status_t (*driverSelector_select)(driver_selector_t selector, SERVICE_REFERENCE reference, ARRAY_LIST matches, int *select);
+ celix_status_t (*driverSelector_select)(driver_selector_t selector, service_reference_t reference, array_list_t matches, int *select);
};
typedef struct driver_selector_service *driver_selector_service_t;
Modified: incubator/celix/trunk/device_access/device_access/public/include/match.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/device_access/device_access/public/include/match.h?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/device_access/device_access/public/include/match.h (original)
+++ incubator/celix/trunk/device_access/device_access/public/include/match.h Wed Dec 5 09:05:46 2012
@@ -29,7 +29,7 @@
#include <service_reference.h>
struct match {
- SERVICE_REFERENCE reference;
+ service_reference_t reference;
int matchValue;
};
Modified: incubator/celix/trunk/device_access/driver_locator/private/include/driver_locator_private.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/device_access/driver_locator/private/include/driver_locator_private.h?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/device_access/driver_locator/private/include/driver_locator_private.h (original)
+++ incubator/celix/trunk/device_access/driver_locator/private/include/driver_locator_private.h Wed Dec 5 09:05:46 2012
@@ -31,10 +31,10 @@
struct driver_locator {
apr_pool_t *pool;
char *path;
- ARRAY_LIST drivers;
+ array_list_t drivers;
};
-celix_status_t driverLocator_findDrivers(driver_locator_t locator, apr_pool_t *pool, PROPERTIES props, ARRAY_LIST *drivers);
+celix_status_t driverLocator_findDrivers(driver_locator_t locator, apr_pool_t *pool, properties_t props, array_list_t *drivers);
celix_status_t driverLocator_loadDriver(driver_locator_t locator, apr_pool_t *pool, char *id, char **driver);
#endif /* DRIVER_LOCATOR_PRIVATE_H_ */
Modified: incubator/celix/trunk/device_access/driver_locator/private/src/activator.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/device_access/driver_locator/private/src/activator.c?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/device_access/driver_locator/private/src/activator.c (original)
+++ incubator/celix/trunk/device_access/driver_locator/private/src/activator.c Wed Dec 5 09:05:46 2012
@@ -35,7 +35,7 @@ static const char *DEFAULT_LOCATOR_PATH
struct bundle_instance {
driver_locator_service_t service;
driver_locator_t locator;
- SERVICE_REGISTRATION locatorRegistration;
+ service_registration_t locatorRegistration;
};
typedef struct bundle_instance *bundle_instance_t;
Modified: incubator/celix/trunk/device_access/driver_locator/private/src/driver_locator.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/device_access/driver_locator/private/src/driver_locator.c?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/device_access/driver_locator/private/src/driver_locator.c (original)
+++ incubator/celix/trunk/device_access/driver_locator/private/src/driver_locator.c Wed Dec 5 09:05:46 2012
@@ -34,7 +34,7 @@
#include "driver_locator_private.h"
#include "device.h"
-celix_status_t driverLocator_findDrivers(driver_locator_t locator, apr_pool_t *pool, PROPERTIES props, ARRAY_LIST *drivers) {
+celix_status_t driverLocator_findDrivers(driver_locator_t locator, apr_pool_t *pool, properties_t props, array_list_t *drivers) {
celix_status_t status = CELIX_SUCCESS;
char *category = properties_get(props, DEVICE_CATEGORY);
Modified: incubator/celix/trunk/device_access/example/base_driver/private/src/activator.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/device_access/example/base_driver/private/src/activator.c?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/device_access/example/base_driver/private/src/activator.c (original)
+++ incubator/celix/trunk/device_access/example/base_driver/private/src/activator.c Wed Dec 5 09:05:46 2012
@@ -39,7 +39,7 @@
struct base_driver_bundle_instance {
bundle_context_t context;
apr_pool_t * pool;
- ARRAY_LIST serviceRegistrations;
+ array_list_t serviceRegistrations;
};
typedef struct base_driver_bundle_instance *base_driver_bundle_instance_t;
@@ -73,10 +73,10 @@ static celix_status_t bundleActivator_re
base_driver_device_service_t service = NULL;
status = baseDriver_createService(device, &service);
if (status == CELIX_SUCCESS) {
- PROPERTIES props = properties_create();
+ properties_t props = properties_create();
properties_set(props, DEVICE_CATEGORY, BASE_DRIVER_DEVICE_CATEGORY);
properties_set(props, DEVICE_SERIAL, serial);
- SERVICE_REGISTRATION service_registration = NULL;
+ service_registration_t service_registration = NULL;
status = bundleContext_registerService(bi->context, DEVICE_SERVICE_NAME, service, props, &service_registration);
if (status == CELIX_SUCCESS) {
arrayList_add(bi->serviceRegistrations, service_registration);
@@ -114,9 +114,9 @@ celix_status_t bundleActivator_stop(void
celix_status_t status = CELIX_SUCCESS;
base_driver_bundle_instance_t bundleInstance = userData;
- ARRAY_LIST_ITERATOR iterator = arrayListIterator_create(bundleInstance->serviceRegistrations);
+ array_list_iterator_t iterator = arrayListIterator_create(bundleInstance->serviceRegistrations);
while (arrayListIterator_hasNext(iterator)) {
- SERVICE_REGISTRATION reg = arrayListIterator_next(iterator);
+ service_registration_t reg = arrayListIterator_next(iterator);
printf("BASE_DRIVER: unregistering service\n");
celix_status_t unregStatus = serviceRegistration_unregister(reg);
if (unregStatus != CELIX_SUCCESS) {
Modified: incubator/celix/trunk/device_access/example/consuming_driver/private/include/consuming_driver_private.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/device_access/example/consuming_driver/private/include/consuming_driver_private.h?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/device_access/example/consuming_driver/private/include/consuming_driver_private.h (original)
+++ incubator/celix/trunk/device_access/example/consuming_driver/private/include/consuming_driver_private.h Wed Dec 5 09:05:46 2012
@@ -37,7 +37,7 @@ typedef struct consuming_driver *consumi
celix_status_t consumingDriver_create(bundle_context_t context, apr_pool_t *pool, consuming_driver_t *driver);
celix_status_t consumingDriver_createService(consuming_driver_t driver, driver_service_t *service);
-celix_status_t consumingDriver_attach(void *driver, SERVICE_REFERENCE reference, char **result);
-celix_status_t consumingDriver_match(void *driver, SERVICE_REFERENCE reference, int *value);
+celix_status_t consumingDriver_attach(void *driver, service_reference_t reference, char **result);
+celix_status_t consumingDriver_match(void *driver, service_reference_t reference, int *value);
#endif /* CONSUMING_DRIVER_PRIVATE_H_ */
Modified: incubator/celix/trunk/device_access/example/consuming_driver/private/src/activator.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/device_access/example/consuming_driver/private/src/activator.c?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/device_access/example/consuming_driver/private/src/activator.c (original)
+++ incubator/celix/trunk/device_access/example/consuming_driver/private/src/activator.c Wed Dec 5 09:05:46 2012
@@ -38,7 +38,7 @@
struct consuming_driver_bundle_instance {
bundle_context_t context;
apr_pool_t * pool;
- SERVICE_REGISTRATION registration;
+ service_registration_t registration;
};
typedef struct consuming_driver_bundle_instance *consuming_driver_bundle_instance_t;
@@ -73,7 +73,7 @@ celix_status_t bundleActivator_start(voi
driver_service_t service = NULL;
status = consumingDriver_createService(driver, &service);
if (status == CELIX_SUCCESS) {
- PROPERTIES props = properties_create();
+ properties_t props = properties_create();
properties_set(props, "DRIVER_ID", CONSUMING_DRIVER_ID);
status = bundleContext_registerService(context, DRIVER_SERVICE_NAME, service, props, &bi->registration);
}
Modified: incubator/celix/trunk/device_access/example/consuming_driver/private/src/consuming_driver.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/device_access/example/consuming_driver/private/src/consuming_driver.c?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/device_access/example/consuming_driver/private/src/consuming_driver.c (original)
+++ incubator/celix/trunk/device_access/example/consuming_driver/private/src/consuming_driver.c Wed Dec 5 09:05:46 2012
@@ -42,7 +42,7 @@
struct consuming_driver {
apr_pool_t *pool;
bundle_context_t context;
- ARRAY_LIST references;
+ array_list_t references;
};
static apr_status_t consumingDriver_cleanup(void *handler) {
@@ -50,9 +50,9 @@ static apr_status_t consumingDriver_clea
consuming_driver_t driver = handler;
if (driver->references != NULL) {
- ARRAY_LIST_ITERATOR iterator = arrayListIterator_create(driver->references);
+ array_list_iterator_t iterator = arrayListIterator_create(driver->references);
while (arrayListIterator_hasNext(iterator)) {
- SERVICE_REFERENCE reference = arrayListIterator_next(iterator);
+ service_reference_t reference = arrayListIterator_next(iterator);
bool result;
bundleContext_ungetService(driver->context, reference, &result);
}
@@ -96,7 +96,7 @@ celix_status_t consumingDriver_createSer
return status;
}
-celix_status_t consumingDriver_attach(void * driverHandler, SERVICE_REFERENCE reference, char **result) {
+celix_status_t consumingDriver_attach(void * driverHandler, service_reference_t reference, char **result) {
printf("CONSUMING_DRIVER: attached called\n");
celix_status_t status = CELIX_SUCCESS;
consuming_driver_t driver = driverHandler;
@@ -121,14 +121,14 @@ celix_status_t consumingDriver_attach(vo
return status;
}
-celix_status_t consumingDriver_match(void *driverHandler, SERVICE_REFERENCE reference, int *value) {
+celix_status_t consumingDriver_match(void *driverHandler, service_reference_t reference, int *value) {
printf("CONSUMING_DRIVER: match called\n");
int match=0;
celix_status_t status = CELIX_SUCCESS;
consuming_driver_t driver = driverHandler;
- SERVICE_REGISTRATION registration = NULL;
- PROPERTIES properties = NULL;
+ service_registration_t registration = NULL;
+ properties_t properties = NULL;
status = serviceReference_getServiceRegistration(reference, ®istration);
if (status == CELIX_SUCCESS) {
status = serviceRegistration_getProperties(registration, &properties);
Modified: incubator/celix/trunk/device_access/example/refining_driver/private/include/refining_driver_private.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/device_access/example/refining_driver/private/include/refining_driver_private.h?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/device_access/example/refining_driver/private/include/refining_driver_private.h (original)
+++ incubator/celix/trunk/device_access/example/refining_driver/private/include/refining_driver_private.h Wed Dec 5 09:05:46 2012
@@ -42,12 +42,12 @@ celix_status_t refiningDriver_destroy(re
celix_status_t refiningDriver_createService(refining_driver_t driver, driver_service_t *service);
-celix_status_t refiningDriver_createDevice(refining_driver_t driver, SERVICE_REFERENCE reference, base_driver_device_service_t baseDevice, refining_driver_device_t *device);
+celix_status_t refiningDriver_createDevice(refining_driver_t driver, service_reference_t reference, base_driver_device_service_t baseDevice, refining_driver_device_t *device);
celix_status_t refiningDriver_destroyDevice(refining_driver_device_t device);
-celix_status_t refiningDriver_attach(void *driver, SERVICE_REFERENCE reference, char **result);
-celix_status_t refiningDriver_match(void *driver, SERVICE_REFERENCE reference, int *value);
+celix_status_t refiningDriver_attach(void *driver, service_reference_t reference, char **result);
+celix_status_t refiningDriver_match(void *driver, service_reference_t reference, int *value);
celix_status_t refiningDriverDevice_noDriverFound(device_t device);
Modified: incubator/celix/trunk/device_access/example/refining_driver/private/src/activator.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/device_access/example/refining_driver/private/src/activator.c?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/device_access/example/refining_driver/private/src/activator.c (original)
+++ incubator/celix/trunk/device_access/example/refining_driver/private/src/activator.c Wed Dec 5 09:05:46 2012
@@ -38,7 +38,7 @@
struct refining_driver_bundle_instance {
bundle_context_t context;
apr_pool_t * pool;
- SERVICE_REGISTRATION registration;
+ service_registration_t registration;
};
typedef struct refining_driver_bundle_instance *refining_driver_bundle_instance_t;
@@ -73,7 +73,7 @@ celix_status_t bundleActivator_start(voi
driver_service_t service = NULL;
status = refiningDriver_createService(driver, &service);
if (status == CELIX_SUCCESS) {
- PROPERTIES props = properties_create();
+ properties_t props = properties_create();
properties_set(props, "DRIVER_ID", REFINING_DRIVER_ID);
status = bundleContext_registerService(context, DRIVER_SERVICE_NAME, service, props, &bi->registration);
}
Modified: incubator/celix/trunk/device_access/example/refining_driver/private/src/refining_driver.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/device_access/example/refining_driver/private/src/refining_driver.c?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/device_access/example/refining_driver/private/src/refining_driver.c (original)
+++ incubator/celix/trunk/device_access/example/refining_driver/private/src/refining_driver.c Wed Dec 5 09:05:46 2012
@@ -44,7 +44,7 @@ struct refining_driver {
apr_pool_t *pool;
bundle_context_t context;
int deviceCount;
- ARRAY_LIST devices;
+ array_list_t devices;
};
struct device {
@@ -56,9 +56,9 @@ struct refining_driver_device {
apr_pool_t *pool;
base_driver_device_service_t baseDriverDeviceService;
refining_driver_t driver;
- SERVICE_REFERENCE baseServiceReference;
- SERVICE_REGISTRATION deviceRegistration;
- SERVICE_LISTENER listener;
+ service_reference_t baseServiceReference;
+ service_registration_t deviceRegistration;
+ service_listener_t listener;
};
celix_status_t refiningDriver_destroy(refining_driver_t driver) {
@@ -126,7 +126,7 @@ static celix_status_t refiningDriver_sto
}
-static celix_status_t refiningDriver_serviceChanged(SERVICE_LISTENER listener, SERVICE_EVENT event) {
+static celix_status_t refiningDriver_serviceChanged(service_listener_t listener, service_event_t event) {
celix_status_t status = CELIX_SUCCESS;
refining_driver_device_t device = listener->handle;
if (event->type == SERVICE_EVENT_UNREGISTERING) {
@@ -155,7 +155,7 @@ static apr_status_t refining_driver_clea
return status;
}
-celix_status_t refiningDriver_createDevice(refining_driver_t driver, SERVICE_REFERENCE reference, base_driver_device_service_t baseService, refining_driver_device_t *device) {
+celix_status_t refiningDriver_createDevice(refining_driver_t driver, service_reference_t reference, base_driver_device_service_t baseService, refining_driver_device_t *device) {
celix_status_t status = CELIX_SUCCESS;
apr_pool_t *devicePool = NULL;
apr_status_t aprStatus = apr_pool_create(&devicePool, driver->pool);
@@ -171,10 +171,10 @@ celix_status_t refiningDriver_createDevi
(*device)->deviceRegistration=NULL;
(*device)->listener=NULL;
- SERVICE_LISTENER listener = apr_palloc(devicePool, sizeof(*listener));
+ service_listener_t listener = apr_palloc(devicePool, sizeof(*listener));
listener->pool=devicePool;
listener->handle=(void *)(*device);
- listener->serviceChanged=(celix_status_t (*)(void * listener, SERVICE_EVENT event))refiningDriver_serviceChanged;
+ listener->serviceChanged=(celix_status_t (*)(void * listener, service_event_t event))refiningDriver_serviceChanged;
bundleContext_addServiceListener(driver->context, listener, NULL);
(*device)->listener=listener;
@@ -194,7 +194,7 @@ static celix_status_t refiningDriver_reg
refining_driver_device_service_t service = NULL;
status = refiningDriverDevice_createService(device, &service);
if (status == CELIX_SUCCESS) {
- PROPERTIES props = properties_create();
+ properties_t props = properties_create();
properties_set(props, DEVICE_CATEGORY, REFINING_DRIVER_DEVICE_CATEGORY);
properties_set(props, DEVICE_SERIAL, serial);
status = bundleContext_registerService(driver->context, DEVICE_SERVICE_NAME, service, props, &device->deviceRegistration);
@@ -206,7 +206,7 @@ static celix_status_t refiningDriver_reg
return status;
}
-celix_status_t refiningDriver_attach(void * driverHandler, SERVICE_REFERENCE reference, char **result) {
+celix_status_t refiningDriver_attach(void * driverHandler, service_reference_t reference, char **result) {
printf("REFINING_DRIVER: attached called\n");
celix_status_t status = CELIX_SUCCESS;
refining_driver_t driver = driverHandler;
@@ -227,14 +227,14 @@ celix_status_t refiningDriver_attach(voi
return status;
}
-celix_status_t refiningDriver_match(void *driverHandler, SERVICE_REFERENCE reference, int *value) {
+celix_status_t refiningDriver_match(void *driverHandler, service_reference_t reference, int *value) {
printf("REFINING_DRIVER: match called\n");
int match = 0;
celix_status_t status = CELIX_SUCCESS;
refining_driver_t driver = driverHandler;
- SERVICE_REGISTRATION registration = NULL;
- PROPERTIES properties = NULL;
+ service_registration_t registration = NULL;
+ properties_t properties = NULL;
status = serviceReference_getServiceRegistration(reference, ®istration);
if (status == CELIX_SUCCESS) {
status = serviceRegistration_getProperties(registration, &properties);
Modified: incubator/celix/trunk/examples/echo_service/client/private/src/echo_client.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/echo_service/client/private/src/echo_client.c?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/examples/echo_service/client/private/src/echo_client.c (original)
+++ incubator/celix/trunk/examples/echo_service/client/private/src/echo_client.c Wed Dec 5 09:05:46 2012
@@ -37,7 +37,7 @@ static void *APR_THREAD_FUNC trk_send(ap
if (service != NULL) {
service->echo(service->server, "hi");
}
- apr_sleep(1);
+ apr_sleep(1000000);
}
apr_thread_exit(thd, APR_SUCCESS);
return NULL;
Modified: incubator/celix/trunk/examples/echo_service/server/private/src/echo_server_activator.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/echo_service/server/private/src/echo_server_activator.c?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/examples/echo_service/server/private/src/echo_server_activator.c (original)
+++ incubator/celix/trunk/examples/echo_service/server/private/src/echo_server_activator.c Wed Dec 5 09:05:46 2012
@@ -31,7 +31,7 @@
#include "echo_server_private.h"
struct echoActivator {
- SERVICE_REGISTRATION reg;
+ service_registration_t reg;
ECHO_SERVICE es;
};
Modified: incubator/celix/trunk/examples/mongoose/private/src/activator.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/mongoose/private/src/activator.c?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/examples/mongoose/private/src/activator.c (original)
+++ incubator/celix/trunk/examples/mongoose/private/src/activator.c Wed Dec 5 09:05:46 2012
@@ -44,7 +44,7 @@ celix_status_t bundleActivator_create(bu
}
celix_status_t bundleActivator_start(void * userData, bundle_context_t context) {
- BUNDLE bundle;
+ bundle_t bundle;
celix_status_t status = CELIX_SUCCESS;
struct userData * data = (struct userData *) userData;
Modified: incubator/celix/trunk/examples/osgi-in-action/chapter01-greeting-example/client/private/src/client.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/osgi-in-action/chapter01-greeting-example/client/private/src/client.c?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/examples/osgi-in-action/chapter01-greeting-example/client/private/src/client.c (original)
+++ incubator/celix/trunk/examples/osgi-in-action/chapter01-greeting-example/client/private/src/client.c Wed Dec 5 09:05:46 2012
@@ -37,7 +37,7 @@ celix_status_t bundleActivator_create(bu
}
celix_status_t bundleActivator_start(void * userData, bundle_context_t ctx) {
- SERVICE_REFERENCE ref = NULL;
+ service_reference_t ref = NULL;
celix_status_t status = bundleContext_getServiceReference(ctx, (char *) GREETING_SERVICE_NAME, &ref);
if (status == CELIX_SUCCESS) {
if (ref == NULL) {
Modified: incubator/celix/trunk/examples/osgi-in-action/chapter01-greeting-example/greeting/private/src/activator.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/osgi-in-action/chapter01-greeting-example/greeting/private/src/activator.c?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/examples/osgi-in-action/chapter01-greeting-example/greeting/private/src/activator.c (original)
+++ incubator/celix/trunk/examples/osgi-in-action/chapter01-greeting-example/greeting/private/src/activator.c Wed Dec 5 09:05:46 2012
@@ -34,7 +34,7 @@
#include "service_registration.h"
struct greetingActivator {
- SERVICE_REGISTRATION reg;
+ service_registration_t reg;
apr_pool_t *pool;
};
Modified: incubator/celix/trunk/examples/osgi-in-action/chapter04-correct-listener/private/src/listener_example.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/osgi-in-action/chapter04-correct-listener/private/src/listener_example.c?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/examples/osgi-in-action/chapter04-correct-listener/private/src/listener_example.c (original)
+++ incubator/celix/trunk/examples/osgi-in-action/chapter04-correct-listener/private/src/listener_example.c Wed Dec 5 09:05:46 2012
@@ -34,22 +34,26 @@ struct listenerActivator {
apr_pool_t *pool;
bundle_context_t context;
- SERVICE_LISTENER listener;
+ service_listener_t listener;
apr_thread_mutex_t *logServiceReferencesLock;
- ARRAY_LIST logServiceReferences;
+ array_list_t logServiceReferences;
bool running;
apr_thread_t *logger;
};
-void listenerExample_serviceChanged(SERVICE_LISTENER listener, SERVICE_EVENT event);
+void listenerExample_serviceChanged(service_listener_t listener, service_event_t event);
celix_status_t listenerExample_getLogService(struct listenerActivator *activator, log_service_t *service);
static void *APR_THREAD_FUNC listenerExample_logger(apr_thread_t *thd, void *activator);
celix_status_t listenerExample_alternativeLog(struct listenerActivator *activator, char *message);
+celix_status_t ref_equals(void *a, void *b, bool *equals) {
+ return serviceReference_equals(a, b, equals);
+}
+
celix_status_t bundleActivator_create(bundle_context_t context, void **userData) {
celix_status_t status = CELIX_SUCCESS;
apr_pool_t *pool;
@@ -68,7 +72,7 @@ celix_status_t bundleActivator_create(bu
activator->listener = NULL;
apr_thread_mutex_create(&activator->logServiceReferencesLock, 0, subpool);
activator->logServiceReferences = NULL;
- arrayList_create(subpool, &activator->logServiceReferences);
+ arrayList_createWithEquals(subpool, ref_equals, &activator->logServiceReferences);
activator->running = false;
activator->logger = NULL;
}
@@ -83,16 +87,20 @@ celix_status_t bundleActivator_start(voi
celix_status_t status = CELIX_SUCCESS;
struct listenerActivator *activator = userData;
- SERVICE_LISTENER listener = apr_palloc(activator->pool, sizeof(struct listenerActivator));
+ service_listener_t listener = apr_palloc(activator->pool, sizeof(struct listenerActivator));
if (!listener) {
status = CELIX_ENOMEM;
} else {
char filter[30];
- ARRAY_LIST logServices = NULL;
+ array_list_t logServices = NULL;
+ apr_pool_t *pool;
sprintf(filter, "(objectClass=%s)", LOG_SERVICE_NAME);
+ bundleContext_getMemoryPool(context, &pool);
+
listener->handle = activator;
listener->serviceChanged = (void *) listenerExample_serviceChanged;
+ listener->pool = pool;
status = bundleContext_addServiceListener(context, listener, filter);
if (status == CELIX_SUCCESS) {
activator->listener = listener;
@@ -102,8 +110,8 @@ celix_status_t bundleActivator_start(voi
if (status == CELIX_SUCCESS) {
int i;
for (i = 0; i < arrayList_size(logServices); i++) {
- SERVICE_REFERENCE logService = (SERVICE_REFERENCE) arrayList_get(logServices, i);
- SERVICE_EVENT event = apr_palloc(activator->pool, sizeof(*event));
+ service_reference_t logService = (service_reference_t) arrayList_get(logServices, i);
+ service_event_t event = apr_palloc(activator->pool, sizeof(*event));
event->reference = logService;
event->type = SERVICE_EVENT_REGISTERED;
@@ -138,7 +146,7 @@ celix_status_t bundleActivator_destroy(v
return status;
}
-void listenerExample_serviceChanged(SERVICE_LISTENER listener, SERVICE_EVENT event) {
+void listenerExample_serviceChanged(service_listener_t listener, service_event_t event) {
struct listenerActivator *activator = listener->handle;
apr_thread_mutex_lock(activator->logServiceReferencesLock);
@@ -164,7 +172,7 @@ celix_status_t listenerExample_getLogSer
apr_thread_mutex_lock(activator->logServiceReferencesLock);
if (arrayList_size(activator->logServiceReferences) > 0) {
- SERVICE_REFERENCE reference = arrayList_get(activator->logServiceReferences, 0);
+ service_reference_t reference = arrayList_get(activator->logServiceReferences, 0);
status = bundleContext_getService(activator->context, reference, (void *) service);
}
apr_thread_mutex_unlock(activator->logServiceReferencesLock);
@@ -183,7 +191,7 @@ static void *APR_THREAD_FUNC listenerExa
} else {
listenerExample_alternativeLog(activator, "No LogService available. Printing to standard out.");
}
- apr_sleep(5);
+ apr_sleep(5000000);
}
return NULL;
Modified: incubator/celix/trunk/examples/osgi-in-action/chapter04-correct-lookup/private/src/activator.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/osgi-in-action/chapter04-correct-lookup/private/src/activator.c?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/examples/osgi-in-action/chapter04-correct-lookup/private/src/activator.c (original)
+++ incubator/celix/trunk/examples/osgi-in-action/chapter04-correct-lookup/private/src/activator.c Wed Dec 5 09:05:46 2012
@@ -96,8 +96,8 @@ void *APR_THREAD_FUNC LogServiceTest(apr
bundle_context_t m_context = ((THREAD_DATA) argument)->m_context;
apr_os_thread_t *logThread = NULL;
apr_os_thread_get(&logThread, m_logTestThread);
- while (apr_os_thread_current() == logThread) {
- SERVICE_REFERENCE logServiceRef = NULL;
+ while (apr_os_thread_current() == *logThread) {
+ service_reference_t logServiceRef = NULL;
// lookup the current "best" LogService each time, just before we need to use it
status = bundleContext_getServiceReference(m_context, (char *) LOG_SERVICE_NAME, &logServiceRef);
// if the service reference is null then we know there's no log service available
@@ -139,13 +139,13 @@ void stopTestThread() {
void pauseTestThread() {
// sleep for a bit
- apr_sleep(5);
+ apr_sleep(5000000);
}
void alternativeLog(char *message, THREAD_DATA data) {
// this provides similar style debug logging output for when the LogService disappears
celix_status_t status = CELIX_SUCCESS;
- BUNDLE bundle = NULL;
+ bundle_t bundle = NULL;
char tid[20], bid[20];
long bundleId;
if (data->m_context != NULL) {
Modified: incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/circle/private/src/activator.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/circle/private/src/activator.c?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/circle/private/src/activator.c (original)
+++ incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/circle/private/src/activator.c Wed Dec 5 09:05:46 2012
@@ -38,7 +38,7 @@
#include "simple_shape.h"
struct activator {
- SERVICE_REGISTRATION reg;
+ service_registration_t reg;
apr_pool_t *pool;
};
@@ -60,7 +60,7 @@ celix_status_t bundleActivator_start(voi
celix_status_t status = CELIX_SUCCESS;
SIMPLE_SHAPE es = NULL;
circleShape_create(ctx, &es);
- PROPERTIES props = properties_create();
+ properties_t props = properties_create();
properties_set(props, "name", "circle");
status = bundleContext_registerService(ctx, SIMPLE_SHAPE_SERVICE_NAME, es, props, &act->reg);
return status;
Modified: incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/circle/private/src/circle_shape.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/circle/private/src/circle_shape.c?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/circle/private/src/circle_shape.c (original)
+++ incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/circle/private/src/circle_shape.c Wed Dec 5 09:05:46 2012
@@ -43,7 +43,7 @@ void circleShape_draw(SIMPLE_SHAPE shape
celix_status_t circleShape_create(bundle_context_t context, SIMPLE_SHAPE *shape) {
celix_status_t status = CELIX_SUCCESS;
- BUNDLE bundle;
+ bundle_t bundle;
apr_pool_t *pool;
if (*shape != NULL || context == NULL) {
Modified: incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/paint/private/include/paint_frame.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/paint/private/include/paint_frame.h?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/paint/private/include/paint_frame.h (original)
+++ incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/paint/private/include/paint_frame.h Wed Dec 5 09:05:46 2012
@@ -38,9 +38,9 @@ struct paint_frame {
bool showing;
char *m_selected;
- HASH_MAP m_shapes;
+ hash_map_t m_shapes;
SIMPLE_SHAPE m_defaultShape;
- LINKED_LIST m_shapeComponents;
+ linked_list_t m_shapeComponents;
bundle_context_t context;
GThread *main;
char *file;
Modified: incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/paint/private/src/activator.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/paint/private/src/activator.c?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/paint/private/src/activator.c (original)
+++ incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/paint/private/src/activator.c Wed Dec 5 09:05:46 2012
@@ -39,16 +39,16 @@
#include "service_registration.h"
struct paintFrameActivatorData {
- SERVICE_REGISTRATION reg;
+ service_registration_t reg;
apr_pool_t *pool;
service_tracker_t tracker;
bundle_context_t context;
PAINT_FRAME paint_frame;
};
-celix_status_t addingServ(void * handle, SERVICE_REFERENCE ref, void **service);
-celix_status_t addedServ(void * handle, SERVICE_REFERENCE reference, void * service);
-celix_status_t modifiedServ(void * handle, SERVICE_REFERENCE reference, void * service);
-celix_status_t removedServ(void * handle, SERVICE_REFERENCE reference, void * service);
+celix_status_t addingServ(void * handle, service_reference_t ref, void **service);
+celix_status_t addedServ(void * handle, service_reference_t reference, void * service);
+celix_status_t modifiedServ(void * handle, service_reference_t reference, void * service);
+celix_status_t removedServ(void * handle, service_reference_t reference, void * service);
typedef struct paintFrameActivatorData *GREETING_ACTIVATOR;
@@ -95,16 +95,16 @@ celix_status_t bundleActivator_destroy(v
return CELIX_SUCCESS;
}
-celix_status_t addingServ(void * handle, SERVICE_REFERENCE ref, void **service) {
+celix_status_t addingServ(void * handle, service_reference_t ref, void **service) {
struct paintFrameActivatorData * data = (struct paintFrameActivatorData *) handle;
bundleContext_getService(data->context, ref, service);
return CELIX_SUCCESS;
}
-celix_status_t addedServ(void * handle, SERVICE_REFERENCE ref, void * service) {
+celix_status_t addedServ(void * handle, service_reference_t ref, void * service) {
struct paintFrameActivatorData * data = (struct paintFrameActivatorData *) handle;
- SERVICE_REGISTRATION reg = NULL;
- PROPERTIES props = NULL;
+ service_registration_t reg = NULL;
+ properties_t props = NULL;
serviceReference_getServiceRegistration(ref, ®);
serviceRegistration_getProperties(reg, &props);
char * serviceName = properties_get(props, "name");
@@ -112,20 +112,20 @@ celix_status_t addedServ(void * handle,
return CELIX_SUCCESS;
}
-celix_status_t modifiedServ(void * handle, SERVICE_REFERENCE ref, void * service) {
+celix_status_t modifiedServ(void * handle, service_reference_t ref, void * service) {
struct paintFrameActivatorData * data = (struct paintFrameActivatorData *) handle;
- SERVICE_REGISTRATION reg = NULL;
- PROPERTIES props = NULL;
+ service_registration_t reg = NULL;
+ properties_t props = NULL;
serviceReference_getServiceRegistration(ref, ®);
serviceRegistration_getProperties(reg, &props);
char * serviceName = properties_get(props, "name");
return CELIX_SUCCESS;
}
-celix_status_t removedServ(void * handle, SERVICE_REFERENCE ref, void * service) {
+celix_status_t removedServ(void * handle, service_reference_t ref, void * service) {
struct paintFrameActivatorData * data = (struct paintFrameActivatorData *) handle;
- SERVICE_REGISTRATION reg = NULL;
- PROPERTIES props = NULL;
+ service_registration_t reg = NULL;
+ properties_t props = NULL;
serviceReference_getServiceRegistration(ref, ®);
serviceRegistration_getProperties(reg, &props);
char * serviceName = properties_get(props, "name");
Modified: incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/paint/private/src/default_shape.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/paint/private/src/default_shape.c?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/paint/private/src/default_shape.c (original)
+++ incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/paint/private/src/default_shape.c Wed Dec 5 09:05:46 2012
@@ -42,7 +42,7 @@
void defaultShape_draw(SIMPLE_SHAPE shape, GdkPixmap *pixMap, GtkWidget *widget, gdouble x, gdouble y);
SIMPLE_SHAPE defaultShape_create(bundle_context_t context) {
- BUNDLE bundle;
+ bundle_t bundle;
apr_pool_t *pool;
SIMPLE_SHAPE shape = (SIMPLE_SHAPE) malloc(sizeof(*shape));
bundleContext_getBundle(context, &bundle);
Modified: incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/paint/private/src/paint_frame.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/paint/private/src/paint_frame.c?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/paint/private/src/paint_frame.c (original)
+++ incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/paint/private/src/paint_frame.c Wed Dec 5 09:05:46 2012
@@ -85,7 +85,7 @@ celix_status_t paintFrame_create(bundle_
} else {
*frame = this;
char *builderFile;
- BUNDLE bundle;
+ bundle_t bundle;
GError *error = NULL;
(*frame)->showing = false;
@@ -226,7 +226,7 @@ SIMPLE_SHAPE paintFrame_getShape(PAINT_F
static void paintFrame_destroy(GtkWidget *widget, gpointer data) {
PAINT_FRAME frame = data;
- BUNDLE bundle = NULL;
+ bundle_t bundle = NULL;
frame->showing = false;
@@ -314,7 +314,7 @@ static celix_status_t paintFrame_redraw(
update_rect.x, update_rect.y,
update_rect.width, update_rect.height);
gtk_widget_draw(frame->drawingArea, &update_rect);
- LINKED_LIST_ITERATOR it = linkedListIterator_create(this->m_shapeComponents, 0);
+ linked_list_iterator_t it = linkedListIterator_create(this->m_shapeComponents, 0);
while (linkedListIterator_hasNext(it)) {
SHAPE_COMPONENT sc = linkedListIterator_next(it);
(*sc->shapeComponent_paintComponent)(sc, this, this->pixMap, frame->drawingArea);
Modified: incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/square/private/src/activator.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/square/private/src/activator.c?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/square/private/src/activator.c (original)
+++ incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/square/private/src/activator.c Wed Dec 5 09:05:46 2012
@@ -37,7 +37,7 @@
#include "simple_shape.h"
struct squareActivator {
- SERVICE_REGISTRATION reg;
+ service_registration_t reg;
apr_pool_t *pool;
};
@@ -61,7 +61,7 @@ celix_status_t bundleActivator_start(voi
struct squareActivator * act = (struct squareActivator *) userData;
celix_status_t status = CELIX_SUCCESS;
SIMPLE_SHAPE es = squareShape_create(ctx);
- PROPERTIES props = properties_create();
+ properties_t props = properties_create();
properties_set(props, "name", "square");
status = bundleContext_registerService(ctx, SIMPLE_SHAPE_SERVICE_NAME, es, props, &act->reg);
printf("Square start\n");
Modified: incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/square/private/src/square_shape.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/square/private/src/square_shape.c?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/square/private/src/square_shape.c (original)
+++ incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/square/private/src/square_shape.c Wed Dec 5 09:05:46 2012
@@ -40,7 +40,7 @@
void squareShape_draw(SIMPLE_SHAPE shape, GdkPixmap *pixMap, GtkWidget *widget, gdouble x, gdouble y);
SIMPLE_SHAPE squareShape_create(bundle_context_t context) {
- BUNDLE bundle;
+ bundle_t bundle;
apr_pool_t *pool;
SIMPLE_SHAPE shape = (SIMPLE_SHAPE) malloc(sizeof(*shape));
bundleContext_getBundle(context, &bundle);
Modified: incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/triangle/private/src/activator.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/triangle/private/src/activator.c?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/triangle/private/src/activator.c (original)
+++ incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/triangle/private/src/activator.c Wed Dec 5 09:05:46 2012
@@ -37,7 +37,7 @@
#include "simple_shape.h"
struct greetingActivator {
- SERVICE_REGISTRATION reg;
+ service_registration_t reg;
apr_pool_t *pool;
};
@@ -61,7 +61,7 @@ celix_status_t bundleActivator_start(voi
struct greetingActivator * act = (struct greetingActivator *) userData;
celix_status_t status = CELIX_SUCCESS;
SIMPLE_SHAPE es = triangleShape_create(ctx);
- PROPERTIES props = properties_create();
+ properties_t props = properties_create();
properties_set(props, "name", "triangle");
status = bundleContext_registerService(ctx, SIMPLE_SHAPE_SERVICE_NAME, es, props, &act->reg);
printf("Triangle activated %d\n", status);
Modified: incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/triangle/private/src/triangle_shape.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/triangle/private/src/triangle_shape.c?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/triangle/private/src/triangle_shape.c (original)
+++ incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/triangle/private/src/triangle_shape.c Wed Dec 5 09:05:46 2012
@@ -42,7 +42,7 @@
void triangleShape_draw(SIMPLE_SHAPE shape, GdkPixmap *pixMap, GtkWidget *widget, gdouble x, gdouble y);
SIMPLE_SHAPE triangleShape_create(bundle_context_t context) {
- BUNDLE bundle;
+ bundle_t bundle;
apr_pool_t *pool;
SIMPLE_SHAPE shape = (SIMPLE_SHAPE) malloc(sizeof(*shape));
bundleContext_getBundle(context, &bundle);
Modified: incubator/celix/trunk/examples/whiteboard/publisherA/private/src/activator.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/whiteboard/publisherA/private/src/activator.c?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/examples/whiteboard/publisherA/private/src/activator.c (original)
+++ incubator/celix/trunk/examples/whiteboard/publisherA/private/src/activator.c Wed Dec 5 09:05:46 2012
@@ -35,7 +35,7 @@ struct activatorData {
PUBLISHER_SERVICE ps;
PUBLISHER pub;
- SERVICE_REGISTRATION reg;
+ service_registration_t reg;
};
celix_status_t bundleActivator_create(bundle_context_t context, void **userData) {
@@ -54,7 +54,7 @@ celix_status_t bundleActivator_start(voi
apr_pool_t *pool;
status = bundleContext_getMemoryPool(context, &pool);
if (status == CELIX_SUCCESS) {
- PROPERTIES props = NULL;
+ properties_t props = NULL;
struct activatorData * data = (struct activatorData *) userData;
data->ps = apr_pcalloc(pool, sizeof(*(data->ps)));
Modified: incubator/celix/trunk/examples/whiteboard/publisherB/private/src/activator.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/whiteboard/publisherB/private/src/activator.c?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/examples/whiteboard/publisherB/private/src/activator.c (original)
+++ incubator/celix/trunk/examples/whiteboard/publisherB/private/src/activator.c Wed Dec 5 09:05:46 2012
@@ -34,7 +34,7 @@ struct activatorData {
PUBLISHER_SERVICE ps;
PUBLISHER pub;
- SERVICE_REGISTRATION reg;
+ service_registration_t reg;
};
celix_status_t bundleActivator_create(bundle_context_t context, void **userData) {
@@ -53,7 +53,7 @@ celix_status_t bundleActivator_start(voi
apr_pool_t *pool;
status = bundleContext_getMemoryPool(context, &pool);
if (status == CELIX_SUCCESS) {
- PROPERTIES props = properties_create();
+ properties_t props = properties_create();
struct activatorData * data = (struct activatorData *) userData;
data->ps = apr_pcalloc(pool, sizeof(*(data->ps)));
Modified: incubator/celix/trunk/examples/whiteboard/tracker/private/src/activator.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/whiteboard/tracker/private/src/activator.c?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/examples/whiteboard/tracker/private/src/activator.c (original)
+++ incubator/celix/trunk/examples/whiteboard/tracker/private/src/activator.c Wed Dec 5 09:05:46 2012
@@ -34,7 +34,7 @@
struct data {
bundle_context_t context;
service_tracker_t tracker;
- ARRAY_LIST publishers;
+ array_list_t publishers;
apr_thread_t *sender;
bool running;
};
@@ -47,13 +47,13 @@ static void *APR_THREAD_FUNC trk_send(ap
PUBLISHER_SERVICE pub = arrayList_get(data->publishers, i);
pub->invoke(pub->publisher, "test");
}
- apr_sleep(1);
+ apr_sleep(1000000);
}
apr_thread_exit(thd, APR_SUCCESS);
return NULL;
}
-celix_status_t addingServ(void * handle, SERVICE_REFERENCE ref, void **service) {
+celix_status_t addingServ(void * handle, service_reference_t ref, void **service) {
struct data * data = (struct data *) handle;
printf("Adding\n");
@@ -62,20 +62,20 @@ celix_status_t addingServ(void * handle,
return CELIX_SUCCESS;
}
-celix_status_t addedServ(void * handle, SERVICE_REFERENCE ref, void * service) {
+celix_status_t addedServ(void * handle, service_reference_t ref, void * service) {
struct data * data = (struct data *) handle;
arrayList_add(data->publishers, service);
printf("Added %p\n", service);
return CELIX_SUCCESS;
}
-celix_status_t modifiedServ(void * handle, SERVICE_REFERENCE ref, void * service) {
+celix_status_t modifiedServ(void * handle, service_reference_t ref, void * service) {
struct data * data = (struct data *) handle;
printf("Modified\n");
return CELIX_SUCCESS;
}
-celix_status_t removedServ(void * handle, SERVICE_REFERENCE ref, void * service) {
+celix_status_t removedServ(void * handle, service_reference_t ref, void * service) {
struct data * data = (struct data *) handle;
arrayList_removeElement(data->publishers, service);
printf("Removed %p\n", service);
Modified: incubator/celix/trunk/examples/whiteboard/tracker_depman/private/include/tracker.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/whiteboard/tracker_depman/private/include/tracker.h?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/examples/whiteboard/tracker_depman/private/include/tracker.h (original)
+++ incubator/celix/trunk/examples/whiteboard/tracker_depman/private/include/tracker.h Wed Dec 5 09:05:46 2012
@@ -33,19 +33,19 @@
struct data {
SERVICE service;
bundle_context_t context;
- ARRAY_LIST publishers;
+ array_list_t publishers;
apr_thread_t *sender;
bool running;
log_service_t logger;
};
-void tracker_addedServ(void * handle, SERVICE_REFERENCE ref, void * service);
-void tracker_modifiedServ(void * handle, SERVICE_REFERENCE ref, void * service);
-void tracker_removedServ(void * handle, SERVICE_REFERENCE ref, void * service);
+void tracker_addedServ(void * handle, service_reference_t ref, void * service);
+void tracker_modifiedServ(void * handle, service_reference_t ref, void * service);
+void tracker_removedServ(void * handle, service_reference_t ref, void * service);
-void tracker_addLog(void * handle, SERVICE_REFERENCE ref, void * service);
-void tracker_modifiedLog(void * handle, SERVICE_REFERENCE ref, void * service);
-void tracker_removeLog(void * handle, SERVICE_REFERENCE ref, void * service);
+void tracker_addLog(void * handle, service_reference_t ref, void * service);
+void tracker_modifiedLog(void * handle, service_reference_t ref, void * service);
+void tracker_removeLog(void * handle, service_reference_t ref, void * service);
#endif /* TRACKER_H_ */
Modified: incubator/celix/trunk/examples/whiteboard/tracker_depman/private/src/tracker.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/whiteboard/tracker_depman/private/src/tracker.c?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/examples/whiteboard/tracker_depman/private/src/tracker.c (original)
+++ incubator/celix/trunk/examples/whiteboard/tracker_depman/private/src/tracker.c Wed Dec 5 09:05:46 2012
@@ -43,7 +43,7 @@ static void *APR_THREAD_FUNC dp_send(apr
data->logger->log(data->logger->logger, LOG_INFO, "Sending message to publisher");
}
}
- apr_sleep(1);
+ apr_sleep(1000000);
}
apr_thread_exit(thd, APR_SUCCESS);
return NULL;
@@ -72,38 +72,38 @@ void service_destroy(void * userData) {
}
-void tracker_addedServ(void * handle, SERVICE_REFERENCE ref, void * service) {
+void tracker_addedServ(void * handle, service_reference_t ref, void * service) {
struct data * data = (struct data *) handle;
arrayList_add(data->publishers, service);
printf("Service Added\n");
}
-void tracker_modifiedServ(void * handle, SERVICE_REFERENCE ref, void * service) {
+void tracker_modifiedServ(void * handle, service_reference_t ref, void * service) {
struct data * data = (struct data *) handle;
printf("Service Changed\n");
}
-void tracker_removedServ(void * handle, SERVICE_REFERENCE ref, void * service) {
+void tracker_removedServ(void * handle, service_reference_t ref, void * service) {
struct data * data = (struct data *) handle;
arrayList_removeElement(data->publishers, service);
printf("Service Removed\n");
}
-void tracker_addLog(void *handle, SERVICE_REFERENCE ref, void *service) {
+void tracker_addLog(void *handle, service_reference_t ref, void *service) {
struct data * data = (struct data *) handle;
printf("Add log\n");
data->logger = service;
((log_service_t) service)->log(((log_service_t) service)->logger, LOG_DEBUG, "test");
}
-void tracker_modifiedLog(void *handle, SERVICE_REFERENCE ref, void *service) {
+void tracker_modifiedLog(void *handle, service_reference_t ref, void *service) {
struct data * data = (struct data *) handle;
printf("Modify log\n");
data->logger = service;
((log_service_t) service)->log(((log_service_t) service)->logger, LOG_DEBUG, "test");
}
-void tracker_removeLog(void *handle, SERVICE_REFERENCE ref, void *service) {
+void tracker_removeLog(void *handle, service_reference_t ref, void *service) {
struct data * data = (struct data *) handle;
data->logger = NULL;
printf("Remove log\n");
Modified: incubator/celix/trunk/framework/private/include/attribute.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/include/attribute.h?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/include/attribute.h (original)
+++ incubator/celix/trunk/framework/private/include/attribute.h Wed Dec 5 09:05:46 2012
@@ -29,11 +29,11 @@
#include <apr_general.h>
#include "celix_errno.h"
-typedef struct attribute * ATTRIBUTE;
+typedef struct attribute *attribute_t;
-celix_status_t attribute_create(char * key, char * value, apr_pool_t *memory_pool, ATTRIBUTE *attribute);
+celix_status_t attribute_create(char * key, char * value, apr_pool_t *memory_pool, attribute_t *attribute);
-celix_status_t attribute_getKey(ATTRIBUTE attribute, char **key);
-celix_status_t attribute_getValue(ATTRIBUTE attribute, char **value);
+celix_status_t attribute_getKey(attribute_t attribute, char **key);
+celix_status_t attribute_getValue(attribute_t attribute, char **value);
#endif /* ATTRIBUTE_H_ */
Modified: incubator/celix/trunk/framework/private/include/bundle_cache.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/include/bundle_cache.h?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/include/bundle_cache.h (original)
+++ incubator/celix/trunk/framework/private/include/bundle_cache.h Wed Dec 5 09:05:46 2012
@@ -53,7 +53,7 @@ typedef struct bundleCache *bundle_cache
* - CELIX_ILLEGAL_ARGUMENT If <code>bundle_cache</code> not is null.
* - CELIX_ENOMEM If allocating memory for <code>bundle_cache</code> failed.
*/
-celix_status_t bundleCache_create(PROPERTIES configurationMap, apr_pool_t *mp, bundle_cache_t *bundle_cache);
+celix_status_t bundleCache_create(properties_t configurationMap, apr_pool_t *mp, bundle_cache_t *bundle_cache);
/**
* Recreates and retrieves the list of archives for the given bundle cache.
@@ -68,7 +68,7 @@ celix_status_t bundleCache_create(PROPER
* - CELIX_ENOMEM If allocating memory for <code>archives</code> failed.
* - CELIX_FILE_IO_EXCEPTION If the cache cannot be opened or read.
*/
-celix_status_t bundleCache_getArchives(bundle_cache_t cache, apr_pool_t *pool, ARRAY_LIST *archives);
+celix_status_t bundleCache_getArchives(bundle_cache_t cache, apr_pool_t *pool, array_list_t *archives);
/**
* Creates a new archive for the given bundle (using the id and location). The archive is created on the supplied bundlePool.
Modified: incubator/celix/trunk/framework/private/include/manifest_parser.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/include/manifest_parser.h?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/include/manifest_parser.h (original)
+++ incubator/celix/trunk/framework/private/include/manifest_parser.h Wed Dec 5 09:05:46 2012
@@ -32,13 +32,13 @@
#include "manifest.h"
#include "linkedlist.h"
-typedef struct manifestParser * MANIFEST_PARSER;
+typedef struct manifestParser * manifest_parser_t;
-celix_status_t manifestParser_create(MODULE owner, MANIFEST manifest, apr_pool_t *memory_pool, MANIFEST_PARSER *manifest_parser);
+celix_status_t manifestParser_create(module_t owner, MANIFEST manifest, apr_pool_t *memory_pool, manifest_parser_t *manifest_parser);
-celix_status_t manifestParser_getSymbolicName(MANIFEST_PARSER parser, apr_pool_t *pool, char **symbolicName);
-celix_status_t manifestParser_getBundleVersion(MANIFEST_PARSER parser, apr_pool_t *pool, VERSION *version);
-celix_status_t manifestParser_getCapabilities(MANIFEST_PARSER parser, apr_pool_t *pool, LINKED_LIST *capabilities);
-celix_status_t manifestParser_getRequirements(MANIFEST_PARSER parser, apr_pool_t *pool, LINKED_LIST *requirements);
+celix_status_t manifestParser_getSymbolicName(manifest_parser_t parser, apr_pool_t *pool, char **symbolicName);
+celix_status_t manifestParser_getBundleVersion(manifest_parser_t parser, apr_pool_t *pool, version_t *version);
+celix_status_t manifestParser_getCapabilities(manifest_parser_t parser, apr_pool_t *pool, linked_list_t *capabilities);
+celix_status_t manifestParser_getRequirements(manifest_parser_t parser, apr_pool_t *pool, linked_list_t *requirements);
#endif /* MANIFEST_PARSER_H_ */
Modified: incubator/celix/trunk/framework/private/include/resolver.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/include/resolver.h?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/include/resolver.h (original)
+++ incubator/celix/trunk/framework/private/include/resolver.h Wed Dec 5 09:05:46 2012
@@ -31,9 +31,9 @@
#include "wire.h"
#include "hash_map.h"
-HASH_MAP resolver_resolve(MODULE root);
-void resolver_moduleResolved(MODULE module);
-void resolver_addModule(MODULE module);
-void resolver_removeModule(MODULE module);
+hash_map_t resolver_resolve(module_t root);
+void resolver_moduleResolved(module_t module);
+void resolver_addModule(module_t module);
+void resolver_removeModule(module_t module);
#endif /* RESOLVER_H_ */
Modified: incubator/celix/trunk/framework/private/src/attribute.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/attribute.c?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/attribute.c (original)
+++ incubator/celix/trunk/framework/private/src/attribute.c Wed Dec 5 09:05:46 2012
@@ -33,13 +33,13 @@ struct attribute {
char * value;
};
-celix_status_t attribute_create(char * key, char * value, apr_pool_t *memory_pool, ATTRIBUTE *attribute) {
+celix_status_t attribute_create(char * key, char * value, apr_pool_t *memory_pool, attribute_t *attribute) {
celix_status_t status = CELIX_SUCCESS;
if (key == NULL || value == NULL || memory_pool == NULL || *attribute != NULL) {
status = CELIX_ILLEGAL_ARGUMENT;
} else {
- ATTRIBUTE attr = apr_palloc(memory_pool, sizeof(*attr));
+ attribute_t attr = apr_palloc(memory_pool, sizeof(*attr));
if (!attr) {
status = CELIX_ENOMEM;
} else {
@@ -53,12 +53,12 @@ celix_status_t attribute_create(char * k
return status;
}
-celix_status_t attribute_getKey(ATTRIBUTE attribute, char **key) {
+celix_status_t attribute_getKey(attribute_t attribute, char **key) {
*key = attribute->key;
return CELIX_SUCCESS;
}
-celix_status_t attribute_getValue(ATTRIBUTE attribute, char **value) {
+celix_status_t attribute_getValue(attribute_t attribute, char **value) {
*value = attribute->value;
return CELIX_SUCCESS;
}
Modified: incubator/celix/trunk/framework/private/src/bundle.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/bundle.c?rev=1417320&r1=1417319&r2=1417320&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/bundle.c (original)
+++ incubator/celix/trunk/framework/private/src/bundle.c Wed Dec 5 09:05:46 2012
@@ -42,10 +42,10 @@
struct bundle {
bundle_context_t context;
ACTIVATOR activator;
- BUNDLE_STATE state;
+ bundle_state_e state;
void * handle;
bundle_archive_t archive;
- ARRAY_LIST modules;
+ array_list_t modules;
MANIFEST manifest;
apr_pool_t *memoryPool;
@@ -56,20 +56,20 @@ struct bundle {
struct framework * framework;
};
-celix_status_t bundle_createModule(BUNDLE bundle, MODULE *module);
-celix_status_t bundle_closeRevisions(BUNDLE bundle);
+celix_status_t bundle_createModule(bundle_t bundle, module_t *module);
+celix_status_t bundle_closeRevisions(bundle_t bundle);
-celix_status_t bundle_create(BUNDLE * bundle, apr_pool_t *mp) {
+celix_status_t bundle_create(bundle_t * bundle, apr_pool_t *mp) {
celix_status_t status = CELIX_SUCCESS;
bundle_archive_t archive = NULL;
- *bundle = (BUNDLE) apr_palloc(mp, sizeof(**bundle));
+ *bundle = (bundle_t) apr_palloc(mp, sizeof(**bundle));
if (*bundle == NULL) {
return CELIX_ENOMEM;
}
status = bundleArchive_createSystemBundleArchive(mp, &archive);
if (status == CELIX_SUCCESS) {
- MODULE module;
+ module_t module;
apr_status_t apr_status;
(*bundle)->memoryPool = mp;
@@ -101,12 +101,12 @@ celix_status_t bundle_create(BUNDLE * bu
return status;
}
-celix_status_t bundle_createFromArchive(BUNDLE * bundle, FRAMEWORK framework, bundle_archive_t archive, apr_pool_t *bundlePool) {
- MODULE module;
+celix_status_t bundle_createFromArchive(bundle_t * bundle, framework_t framework, bundle_archive_t archive, apr_pool_t *bundlePool) {
+ module_t module;
celix_status_t status = CELIX_SUCCESS;
- *bundle = (BUNDLE) apr_pcalloc(bundlePool, sizeof(**bundle));
+ *bundle = (bundle_t) apr_pcalloc(bundlePool, sizeof(**bundle));
if (*bundle == NULL) {
return CELIX_ENOMEM;
}
@@ -141,10 +141,10 @@ celix_status_t bundle_createFromArchive(
return status;
}
-celix_status_t bundle_destroy(BUNDLE bundle) {
- ARRAY_LIST_ITERATOR iter = arrayListIterator_create(bundle->modules);
+celix_status_t bundle_destroy(bundle_t bundle) {
+ array_list_iterator_t iter = arrayListIterator_create(bundle->modules);
while (arrayListIterator_hasNext(iter)) {
- MODULE module = arrayListIterator_next(iter);
+ module_t module = arrayListIterator_next(iter);
module_destroy(module);
}
arrayListIterator_destroy(iter);
@@ -152,7 +152,7 @@ celix_status_t bundle_destroy(BUNDLE bun
return CELIX_SUCCESS;
}
-celix_status_t bundle_getArchive(BUNDLE bundle, bundle_archive_t *archive) {
+celix_status_t bundle_getArchive(bundle_t bundle, bundle_archive_t *archive) {
celix_status_t status = CELIX_SUCCESS;
if (bundle != NULL && *archive == NULL) {
@@ -164,7 +164,7 @@ celix_status_t bundle_getArchive(BUNDLE
return status;
}
-celix_status_t bundle_getCurrentModule(BUNDLE bundle, MODULE *module) {
+celix_status_t bundle_getCurrentModule(bundle_t bundle, module_t *module) {
celix_status_t status = CELIX_SUCCESS;
if (bundle == NULL || *module != NULL) {
@@ -176,62 +176,62 @@ celix_status_t bundle_getCurrentModule(B
return status;
}
-ARRAY_LIST bundle_getModules(BUNDLE bundle) {
+array_list_t bundle_getModules(bundle_t bundle) {
return bundle->modules;
}
-void * bundle_getHandle(BUNDLE bundle) {
+void * bundle_getHandle(bundle_t bundle) {
return bundle->handle;
}
-void bundle_setHandle(BUNDLE bundle, void * handle) {
+void bundle_setHandle(bundle_t bundle, void * handle) {
bundle->handle = handle;
}
-ACTIVATOR bundle_getActivator(BUNDLE bundle) {
+ACTIVATOR bundle_getActivator(bundle_t bundle) {
return bundle->activator;
}
-celix_status_t bundle_setActivator(BUNDLE bundle, ACTIVATOR activator) {
+celix_status_t bundle_setActivator(bundle_t bundle, ACTIVATOR activator) {
bundle->activator = activator;
return CELIX_SUCCESS;
}
-celix_status_t bundle_getContext(BUNDLE bundle, bundle_context_t *context) {
+celix_status_t bundle_getContext(bundle_t bundle, bundle_context_t *context) {
*context = bundle->context;
return CELIX_SUCCESS;
}
-celix_status_t bundle_setContext(BUNDLE bundle, bundle_context_t context) {
+celix_status_t bundle_setContext(bundle_t bundle, bundle_context_t context) {
bundle->context = context;
return CELIX_SUCCESS;
}
-celix_status_t bundle_getEntry(BUNDLE bundle, char * name, apr_pool_t *pool, char **entry) {
+celix_status_t bundle_getEntry(bundle_t bundle, char * name, apr_pool_t *pool, char **entry) {
return framework_getBundleEntry(bundle->framework, bundle, name, pool, entry);
}
-celix_status_t bundle_getState(BUNDLE bundle, BUNDLE_STATE *state) {
+celix_status_t bundle_getState(bundle_t bundle, bundle_state_e *state) {
*state = bundle->state;
return CELIX_SUCCESS;
}
-celix_status_t bundle_setState(BUNDLE bundle, BUNDLE_STATE state) {
+celix_status_t bundle_setState(bundle_t bundle, bundle_state_e state) {
bundle->state = state;
return CELIX_SUCCESS;
}
-celix_status_t bundle_getManifest(BUNDLE bundle, MANIFEST *manifest) {
+celix_status_t bundle_getManifest(bundle_t bundle, MANIFEST *manifest) {
*manifest = bundle->manifest;
return CELIX_SUCCESS;
}
-celix_status_t bundle_setManifest(BUNDLE bundle, MANIFEST manifest) {
+celix_status_t bundle_setManifest(bundle_t bundle, MANIFEST manifest) {
bundle->manifest = manifest;
return CELIX_SUCCESS;
}
-celix_status_t bundle_createModule(BUNDLE bundle, MODULE *module) {
+celix_status_t bundle_createModule(bundle_t bundle, module_t *module) {
celix_status_t status = CELIX_SUCCESS;
MANIFEST headerMap = NULL;
status = getManifest(bundle->archive, bundle->memoryPool, &headerMap);
@@ -251,21 +251,21 @@ celix_status_t bundle_createModule(BUNDL
*module = module_create(headerMap, apr_pstrdup(bundle->memoryPool, moduleId), bundle);
if (*module != NULL) {
- VERSION bundleVersion = module_getVersion(*module);
+ version_t bundleVersion = module_getVersion(*module);
char * symName = NULL;
status = module_getSymbolicName(*module, &symName);
if (status == CELIX_SUCCESS) {
- ARRAY_LIST bundles = framework_getBundles(bundle->framework);
+ array_list_t bundles = framework_getBundles(bundle->framework);
unsigned int i;
for (i = 0; i < arrayList_size(bundles); i++) {
- BUNDLE check = (BUNDLE) arrayList_get(bundles, i);
+ bundle_t check = (bundle_t) arrayList_get(bundles, i);
long id;
if (bundleArchive_getId(check->archive, &id) == CELIX_SUCCESS) {
if (id != bundleId) {
- MODULE mod = NULL;
+ module_t mod = NULL;
char * sym = NULL;
- VERSION version;
+ version_t version;
int cmp;
status = bundle_getCurrentModule(check, &mod);
status = module_getSymbolicName(mod, &sym);
@@ -293,7 +293,7 @@ celix_status_t bundle_createModule(BUNDL
return status;
}
-celix_status_t bundle_start(BUNDLE bundle, int options) {
+celix_status_t bundle_start(bundle_t bundle, int options) {
celix_status_t status = CELIX_SUCCESS;
if (bundle != NULL) {
status = fw_startBundle(bundle->framework, bundle, options);
@@ -301,19 +301,19 @@ celix_status_t bundle_start(BUNDLE bundl
return status;
}
-celix_status_t bundle_update(BUNDLE bundle, char *inputFile) {
+celix_status_t bundle_update(bundle_t bundle, char *inputFile) {
return framework_updateBundle(bundle->framework, bundle, inputFile);
}
-celix_status_t bundle_stop(BUNDLE bundle, int options) {
+celix_status_t bundle_stop(bundle_t bundle, int options) {
return fw_stopBundle(bundle->framework, bundle, ((options & 1) == 0));
}
-celix_status_t bundle_uninstall(BUNDLE bundle) {
+celix_status_t bundle_uninstall(bundle_t bundle) {
return fw_uninstallBundle(bundle->framework, bundle);
}
-celix_status_t bundle_setPersistentStateInactive(BUNDLE bundle) {
+celix_status_t bundle_setPersistentStateInactive(bundle_t bundle) {
celix_status_t status = CELIX_SUCCESS;
bool systemBundle;
@@ -327,7 +327,7 @@ celix_status_t bundle_setPersistentState
return status;
}
-celix_status_t bundle_setPersistentStateUninstalled(BUNDLE bundle) {
+celix_status_t bundle_setPersistentStateUninstalled(bundle_t bundle) {
celix_status_t status = CELIX_SUCCESS;
bool systemBundle;
@@ -341,11 +341,11 @@ celix_status_t bundle_setPersistentState
return status;
}
-celix_status_t bundle_isUsed(BUNDLE bundle, bool *used) {
+celix_status_t bundle_isUsed(bundle_t bundle, bool *used) {
bool unresolved = true;
- ARRAY_LIST_ITERATOR iter = arrayListIterator_create(bundle->modules);
+ array_list_iterator_t iter = arrayListIterator_create(bundle->modules);
while (arrayListIterator_hasNext(iter)) {
- MODULE module = arrayListIterator_next(iter);
+ module_t module = arrayListIterator_next(iter);
if (module_isResolved(module)) {
unresolved = false;
}
@@ -354,14 +354,14 @@ celix_status_t bundle_isUsed(BUNDLE bund
*used = false;
iter = arrayListIterator_create(bundle->modules);
while (arrayListIterator_hasNext(iter) && !unresolved && !*used) {
- MODULE module = arrayListIterator_next(iter);
+ module_t module = arrayListIterator_next(iter);
module_getDependents(module);
}
arrayListIterator_destroy(iter);
return CELIX_SUCCESS;
}
-celix_status_t bundle_revise(BUNDLE bundle, char * location, char *inputFile) {
+celix_status_t bundle_revise(bundle_t bundle, char * location, char *inputFile) {
celix_status_t status = CELIX_SUCCESS;
bundle_archive_t archive = NULL;
@@ -369,7 +369,7 @@ celix_status_t bundle_revise(BUNDLE bund
if (status == CELIX_SUCCESS) {
status = bundleArchive_revise(archive, location, inputFile);
if (status == CELIX_SUCCESS) {
- MODULE module;
+ module_t module;
status = bundle_createModule(bundle, &module);
if (status == CELIX_SUCCESS) {
status = bundle_addModule(bundle, module);
@@ -385,18 +385,18 @@ celix_status_t bundle_revise(BUNDLE bund
return status;
}
-//bool bundle_rollbackRevise(BUNDLE bundle) {
-// MODULE module = arrayList_remove(bundle->modules, arrayList_set(bundle->modules) - 1);
+//bool bundle_rollbackRevise(bundle_t bundle) {
+// module_t module = arrayList_remove(bundle->modules, arrayList_set(bundle->modules) - 1);
// return resolver_removeModule(module);
//}
-celix_status_t bundle_addModule(BUNDLE bundle, MODULE module) {
+celix_status_t bundle_addModule(bundle_t bundle, module_t module) {
arrayList_add(bundle->modules, module);
resolver_addModule(module);
return CELIX_SUCCESS;
}
-celix_status_t bundle_isSystemBundle(BUNDLE bundle, bool *systemBundle) {
+celix_status_t bundle_isSystemBundle(bundle_t bundle, bool *systemBundle) {
celix_status_t status = CELIX_SUCCESS;
long bundleId;
bundle_archive_t archive = NULL;
@@ -412,7 +412,7 @@ celix_status_t bundle_isSystemBundle(BUN
return status;
}
-celix_status_t bundle_isLockable(BUNDLE bundle, bool *lockable) {
+celix_status_t bundle_isLockable(bundle_t bundle, bool *lockable) {
celix_status_t status = CELIX_SUCCESS;
apr_status_t apr_status;
@@ -435,7 +435,7 @@ celix_status_t bundle_isLockable(BUNDLE
return status;
}
-celix_status_t bundle_getLockingThread(BUNDLE bundle, apr_os_thread_t *thread) {
+celix_status_t bundle_getLockingThread(bundle_t bundle, apr_os_thread_t *thread) {
celix_status_t status = CELIX_SUCCESS;
apr_status_t apr_status;
@@ -454,7 +454,7 @@ celix_status_t bundle_getLockingThread(B
return status;
}
-celix_status_t bundle_lock(BUNDLE bundle, bool *locked) {
+celix_status_t bundle_lock(bundle_t bundle, bool *locked) {
celix_status_t status = CELIX_SUCCESS;
bool equals;
@@ -476,7 +476,7 @@ celix_status_t bundle_lock(BUNDLE bundle
return status;
}
-celix_status_t bundle_unlock(BUNDLE bundle, bool *unlocked) {
+celix_status_t bundle_unlock(bundle_t bundle, bool *unlocked) {
celix_status_t status = CELIX_SUCCESS;
bool equals;
@@ -504,7 +504,7 @@ celix_status_t bundle_unlock(BUNDLE bund
return status;
}
-celix_status_t bundle_close(BUNDLE bundle) {
+celix_status_t bundle_close(bundle_t bundle) {
bundle_archive_t archive = NULL;
celix_status_t status = CELIX_SUCCESS;
@@ -519,7 +519,7 @@ celix_status_t bundle_close(BUNDLE bundl
return status;
}
-celix_status_t bundle_closeAndDelete(BUNDLE bundle) {
+celix_status_t bundle_closeAndDelete(bundle_t bundle) {
celix_status_t status = CELIX_SUCCESS;
bundle_archive_t archive = NULL;
@@ -534,19 +534,19 @@ celix_status_t bundle_closeAndDelete(BUN
return status;
}
-celix_status_t bundle_closeRevisions(BUNDLE bundle) {
+celix_status_t bundle_closeRevisions(bundle_t bundle) {
celix_status_t status = CELIX_SUCCESS;
// TODO implement this
return status;
}
-celix_status_t bundle_closeModules(BUNDLE bundle) {
+celix_status_t bundle_closeModules(bundle_t bundle) {
celix_status_t status = CELIX_SUCCESS;
unsigned int i = 0;
for (i = 0; i < arrayList_size(bundle->modules); i++) {
- MODULE module = (MODULE) arrayList_get(bundle->modules, i);
+ module_t module = (module_t) arrayList_get(bundle->modules, i);
resolver_removeModule(module);
module_setWires(module, NULL);
}
@@ -554,9 +554,9 @@ celix_status_t bundle_closeModules(BUNDL
return status;
}
-celix_status_t bundle_refresh(BUNDLE bundle) {
+celix_status_t bundle_refresh(bundle_t bundle) {
celix_status_t status = CELIX_SUCCESS;
- MODULE module;
+ module_t module;
status = bundle_closeModules(bundle);
if (status == CELIX_SUCCESS) {
@@ -572,7 +572,7 @@ celix_status_t bundle_refresh(BUNDLE bun
return status;
}
-celix_status_t bundle_getBundleId(BUNDLE bundle, long *id) {
+celix_status_t bundle_getBundleId(bundle_t bundle, long *id) {
celix_status_t status = CELIX_SUCCESS;
bundle_archive_t archive = NULL;
status = bundle_getArchive(bundle, &archive);
@@ -582,7 +582,7 @@ celix_status_t bundle_getBundleId(BUNDLE
return status;
}
-celix_status_t bundle_getRegisteredServices(BUNDLE bundle, apr_pool_t *pool, ARRAY_LIST *list) {
+celix_status_t bundle_getRegisteredServices(bundle_t bundle, apr_pool_t *pool, array_list_t *list) {
celix_status_t status = CELIX_SUCCESS;
status = fw_getBundleRegisteredServices(bundle->framework, pool, bundle, list);
@@ -590,7 +590,7 @@ celix_status_t bundle_getRegisteredServi
return status;
}
-celix_status_t bundle_getServicesInUse(BUNDLE bundle, ARRAY_LIST *list) {
+celix_status_t bundle_getServicesInUse(bundle_t bundle, array_list_t *list) {
celix_status_t status = CELIX_SUCCESS;
status = fw_getBundleServicesInUse(bundle->framework, bundle, list);
@@ -598,7 +598,7 @@ celix_status_t bundle_getServicesInUse(B
return status;
}
-celix_status_t bundle_getMemoryPool(BUNDLE bundle, apr_pool_t **pool) {
+celix_status_t bundle_getMemoryPool(bundle_t bundle, apr_pool_t **pool) {
celix_status_t status = CELIX_SUCCESS;
if (bundle != NULL && *pool == NULL) {
@@ -610,7 +610,7 @@ celix_status_t bundle_getMemoryPool(BUND
return status;
}
-celix_status_t bundle_setFramework(BUNDLE bundle, FRAMEWORK framework) {
+celix_status_t bundle_setFramework(bundle_t bundle, framework_t framework) {
celix_status_t status = CELIX_SUCCESS;
if (bundle != NULL && framework != NULL) {
@@ -622,7 +622,7 @@ celix_status_t bundle_setFramework(BUNDL
return status;
}
-celix_status_t bundle_getFramework(BUNDLE bundle, FRAMEWORK *framework) {
+celix_status_t bundle_getFramework(bundle_t bundle, framework_t *framework) {
celix_status_t status = CELIX_SUCCESS;
if (bundle != NULL && *framework == NULL) {