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 2011/09/22 10:00:23 UTC
svn commit: r1173981 - in /incubator/celix/trunk: CMakeLists.txt
examples/whiteboard/publisherA/activator.c
framework/private/include/celix_errno.h framework/private/src/bundle.c
framework/private/src/celix_errorcodes.c
Author: abroekhuis
Date: Thu Sep 22 08:00:22 2011
New Revision: 1173981
URL: http://svn.apache.org/viewvc?rev=1173981&view=rev
Log:
Small fixes
Added:
incubator/celix/trunk/framework/private/src/celix_errorcodes.c
Modified:
incubator/celix/trunk/CMakeLists.txt
incubator/celix/trunk/examples/whiteboard/publisherA/activator.c
incubator/celix/trunk/framework/private/include/celix_errno.h
incubator/celix/trunk/framework/private/src/bundle.c
Modified: incubator/celix/trunk/CMakeLists.txt
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/CMakeLists.txt?rev=1173981&r1=1173980&r2=1173981&view=diff
==============================================================================
--- incubator/celix/trunk/CMakeLists.txt (original)
+++ incubator/celix/trunk/CMakeLists.txt Thu Sep 22 08:00:22 2011
@@ -23,8 +23,9 @@ project (Celix C)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/")
SET(CMAKE_BUILD_TYPE "Debug")
-SET(CMAKE_C_FLAGS "-D_GNU_SOURCE -std=gnu99 ${CMAKE_C_FLAGS} -ftest-coverage -fprofile-arcs")
-SET(LDFLAGS "-fprofile-arcs -ftest-coverage")
+#SET(CMAKE_C_FLAGS "-D_GNU_SOURCE -std=gnu99 ${CMAKE_C_FLAGS} -ftest-coverage -fprofile-arcs")
+SET(CMAKE_C_FLAGS "-D_GNU_SOURCE -std=gnu99 ${CMAKE_C_FLAGS}")
+#SET(LDFLAGS "-fprofile-arcs -ftest-coverage")
SET(CMAKE_INSTALL_COMPONENT "framework")
GET_FILENAME_COMPONENT(__cmake_path ${CMAKE_COMMAND} PATH)
Modified: incubator/celix/trunk/examples/whiteboard/publisherA/activator.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/whiteboard/publisherA/activator.c?rev=1173981&r1=1173980&r2=1173981&view=diff
==============================================================================
--- incubator/celix/trunk/examples/whiteboard/publisherA/activator.c (original)
+++ incubator/celix/trunk/examples/whiteboard/publisherA/activator.c Thu Sep 22 08:00:22 2011
@@ -27,6 +27,7 @@
#include "bundle_activator.h"
#include "bundle_context.h"
#include "publisher_private.h"
+#include "celix_errno.h"
struct activatorData {
PUBLISHER_SERVICE ps;
@@ -60,9 +61,12 @@ celix_status_t bundleActivator_start(voi
properties_set(props, "id", "A");
SERVICE_REGISTRATION service_registration = NULL;
- bundleContext_registerService(context, PUBLISHER_NAME, data->ps, props, &service_registration);
+ status = bundleContext_registerService(context, PUBLISHER_NAME, data->ps, props, &service_registration);
+ if (status != CELIX_SUCCESS) {
+ printf("Error: %s\n", celix_strerror(status));
+ }
} else {
- status = CELIX_START_ERROR;
+ status = CELIX_BUNDLE_EXCEPTION;
}
return status;
}
Modified: incubator/celix/trunk/framework/private/include/celix_errno.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/include/celix_errno.h?rev=1173981&r1=1173980&r2=1173981&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/include/celix_errno.h (original)
+++ incubator/celix/trunk/framework/private/include/celix_errno.h Thu Sep 22 08:00:22 2011
@@ -26,6 +26,12 @@
typedef int celix_status_t;
/*!
+ * Return a readable string for the given error code.
+ *
+ */
+char *celix_strerror(celix_status_t errorcode);
+
+/*!
* Error code indicating successful execution of the function.
*/
#define CELIX_SUCCESS 0
Modified: incubator/celix/trunk/framework/private/src/bundle.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/bundle.c?rev=1173981&r1=1173980&r2=1173981&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/bundle.c (original)
+++ incubator/celix/trunk/framework/private/src/bundle.c Thu Sep 22 08:00:22 2011
@@ -296,7 +296,7 @@ celix_status_t bundle_isUsed(BUNDLE bund
iter = arrayListIterator_create(bundle->modules);
while (arrayListIterator_hasNext(iter) && !unresolved && !*used) {
MODULE module = arrayListIterator_next(iter);
-// module_getD
+ module_getDependents(module);
}
arrayListIterator_destroy(iter);
return CELIX_SUCCESS;
Added: incubator/celix/trunk/framework/private/src/celix_errorcodes.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/celix_errorcodes.c?rev=1173981&view=auto
==============================================================================
--- incubator/celix/trunk/framework/private/src/celix_errorcodes.c (added)
+++ incubator/celix/trunk/framework/private/src/celix_errorcodes.c Thu Sep 22 08:00:22 2011
@@ -0,0 +1,25 @@
+/*
+ * celix_errorcodes.c
+ *
+ * Created on: Aug 30, 2011
+ * Author: alexander
+ */
+#include "celix_errno.h"
+
+static char *celix_error_string(celix_status_t statcode) {
+ switch (statcode) {
+ case CELIX_ENOMEM:
+ return "Out off memory";
+ case CELIX_ILLEGAL_ARGUMENT:
+ return "Illegal argument";
+ }
+}
+
+char *celix_strerror(celix_status_t errorcode)
+{
+ if (errorcode < CELIX_START_ERROR) {
+ return "No message";
+ } else {
+ return celix_error_string(errorcode);
+ }
+}