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/08/08 15:40:04 UTC

svn commit: r1370760 - in /incubator/celix/trunk: cmake/ deployment_admin/private/include/ deployment_admin/private/src/ examples/osgi-in-action/chapter04-paint-example/circle/private/src/ examples/osgi-in-action/chapter04-paint-example/paint/private/s...

Author: abroekhuis
Date: Wed Aug  8 13:39:56 2012
New Revision: 1370760

URL: http://svn.apache.org/viewvc?rev=1370760&view=rev
Log:
Several small fixes

Added:
    incubator/celix/trunk/cmake/CPackConfig-Installation.in
      - copied, changed from r1370759, incubator/celix/trunk/cmake/CPackConfigFW.in
    incubator/celix/trunk/deployment_admin/private/include/miniunz.h
Removed:
    incubator/celix/trunk/cmake/CPackConfigDeploy.in
    incubator/celix/trunk/cmake/CPackConfigFW.in
Modified:
    incubator/celix/trunk/deployment_admin/private/src/deployment_admin.c
    incubator/celix/trunk/deployment_admin/private/src/miniunz.c
    incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/circle/private/src/circle_shape.c
    incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/paint/private/src/default_shape.c
    incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/paint/private/src/paint_frame.c
    incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/simple/public/include/simple_shape.h
    incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/square/private/src/square_shape.c
    incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/triangle/private/src/triangle_shape.c
    incubator/celix/trunk/framework/private/src/framework.c
    incubator/celix/trunk/hessian/source/private/test/test_hessian_out.c
    incubator/celix/trunk/hessian/source/private/test/test_service_skeleton.c

Copied: incubator/celix/trunk/cmake/CPackConfig-Installation.in (from r1370759, incubator/celix/trunk/cmake/CPackConfigFW.in)
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/cmake/CPackConfig-Installation.in?p2=incubator/celix/trunk/cmake/CPackConfig-Installation.in&p1=incubator/celix/trunk/cmake/CPackConfigFW.in&r1=1370759&r2=1370760&rev=1370760&view=diff
==============================================================================
    (empty)

Added: incubator/celix/trunk/deployment_admin/private/include/miniunz.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/deployment_admin/private/include/miniunz.h?rev=1370760&view=auto
==============================================================================
--- incubator/celix/trunk/deployment_admin/private/include/miniunz.h (added)
+++ incubator/celix/trunk/deployment_admin/private/include/miniunz.h Wed Aug  8 13:39:56 2012
@@ -0,0 +1,15 @@
+/*
+ * miniunz.h
+ *
+ *  Created on: Aug 8, 2012
+ *      Author: alexander
+ */
+
+#ifndef MINIUNZ_H_
+#define MINIUNZ_H_
+
+#include "celix_errno.h"
+
+celix_status_t unzip_extractDeploymentPackage(char * packageName, char * destination);
+
+#endif /* MINIUNZ_H_ */

Modified: incubator/celix/trunk/deployment_admin/private/src/deployment_admin.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/deployment_admin/private/src/deployment_admin.c?rev=1370760&r1=1370759&r2=1370760&view=diff
==============================================================================
--- incubator/celix/trunk/deployment_admin/private/src/deployment_admin.c (original)
+++ incubator/celix/trunk/deployment_admin/private/src/deployment_admin.c Wed Aug  8 13:39:56 2012
@@ -25,6 +25,7 @@
 #include "log_sync.h"
 
 #include "resource_processor.h"
+#include "miniunz.h"
 
 #define IDENTIFICATION_ID "deployment_admin_identification"
 #define DISCOVERY_URL "deployment_admin_url"
@@ -127,7 +128,7 @@ static void *APR_THREAD_FUNC deploymentA
 					apr_dir_make(tmpDir, APR_UREAD|APR_UWRITE|APR_UEXECUTE, admin->pool);
 
 					// TODO: update to use bundle cache DataFile instead of module entries.
-					extractBundle(test, tmpDir);
+					unzip_extractDeploymentPackage(test, tmpDir);
 					char *manifest = apr_pstrcat(admin->pool, tmpDir, "/META-INF/MANIFEST.MF", NULL);
 					MANIFEST mf = NULL;
 					manifest_createFromFile(admin->pool, manifest, &mf);

Modified: incubator/celix/trunk/deployment_admin/private/src/miniunz.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/deployment_admin/private/src/miniunz.c?rev=1370760&r1=1370759&r2=1370760&view=diff
==============================================================================
--- incubator/celix/trunk/deployment_admin/private/src/miniunz.c (original)
+++ incubator/celix/trunk/deployment_admin/private/src/miniunz.c Wed Aug  8 13:39:56 2012
@@ -81,7 +81,7 @@ void change_file_date(filename,dosdate,t
   SetFileTime(hFile,&ftm,&ftLastAcc,&ftm);
   CloseHandle(hFile);
 #else
-#ifdef unix || __APPLE__
+#if defined(unix) || defined(__APPLE__)
   struct utimbuf ut;
   struct tm newdate;
   newdate.tm_sec = tmu_date.tm_sec;
@@ -326,19 +326,19 @@ int do_extract(unzFile uf, char * revisi
     return 0;
 }
 
-celix_status_t extractBundle(char * bundleName, char * revisionRoot) {
+celix_status_t unzip_extractDeploymentPackage(char * packageName, char * destination) {
     celix_status_t status = CELIX_SUCCESS;
     char filename_try[MAXFILENAME+16] = "";
     unzFile uf=NULL;
 
-    if (bundleName!=NULL)
+    if (packageName!=NULL)
     {
 
 #        ifdef USEWIN32IOAPI
         zlib_filefunc64_def ffunc;
 #        endif
 
-        strncpy(filename_try, bundleName,MAXFILENAME-1);
+        strncpy(filename_try, packageName,MAXFILENAME-1);
         /* strncpy doesnt append the trailing NULL, of the string is too long. */
         filename_try[ MAXFILENAME ] = '\0';
 
@@ -346,7 +346,7 @@ celix_status_t extractBundle(char * bund
         fill_win32_filefunc64A(&ffunc);
         uf = unzOpen2_64(bundleName,&ffunc);
 #        else
-        uf = unzOpen64(bundleName);
+        uf = unzOpen64(packageName);
 #        endif
         if (uf==NULL)
         {
@@ -361,10 +361,10 @@ celix_status_t extractBundle(char * bund
 
     if (uf==NULL)
     {
-        printf("Cannot open %s or %s.zip\n",bundleName,bundleName);
+        printf("Cannot open %s or %s.zip\n",packageName,packageName);
         status = CELIX_FILE_IO_EXCEPTION;
     } else {
-        if (do_extract(uf, revisionRoot) != 0) {
+        if (do_extract(uf, destination) != 0) {
             status = CELIX_FILE_IO_EXCEPTION;
         }
 

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=1370760&r1=1370759&r2=1370760&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 Aug  8 13:39:56 2012
@@ -74,7 +74,7 @@ void circleShape_draw(SIMPLE_SHAPE shape
 		gdk_pixbuf_render_to_drawable(
 				curr_pix_buf,
 				pixMap,
-				widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
+				gtk_widget_get_style(widget)->fg_gc[gtk_widget_get_state(widget)],
 				0, 0,
 				update_rect.x, update_rect.y,
 				update_rect.width,

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=1370760&r1=1370759&r2=1370760&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 Aug  8 13:39:56 2012
@@ -59,7 +59,7 @@ void defaultShape_draw(SIMPLE_SHAPE shap
 		gdk_pixbuf_render_to_drawable(
 				curr_pix_buf,
 				pixMap,
-				widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
+				gtk_widget_get_style(widget)->fg_gc[gtk_widget_get_state(widget)],
 				0, 0,
 				update_rect.x, update_rect.y,
 				update_rect.width,

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=1370760&r1=1370759&r2=1370760&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 Aug  8 13:39:56 2012
@@ -261,18 +261,23 @@ static void paintFrame_destroyWidgets(PA
 
 static void paintFrame_configure(GtkWidget *widget, GdkEventConfigure *event, gpointer data) {
 	PAINT_FRAME frame = data;
+	GtkAllocation allocation;
+
 	if (frame->pixMap != NULL) {
 		gdk_pixmap_unref(frame->pixMap);
 	}
 
-	frame->pixMap = gdk_pixmap_new(widget->window, widget->allocation.width, widget->allocation.height, -1);
+	gtk_widget_get_allocation(widget, &allocation);
+	frame->pixMap = gdk_pixmap_new(gtk_widget_get_window(widget), allocation.width, allocation.height, -1);
 	paintFrame_redraw(frame, 0);
 }
 
 static void paintFrame_expose(GtkWidget *widget, GdkEventExpose *event, gpointer data) {
 	PAINT_FRAME frame = data;
-	gdk_draw_pixmap(widget->window, widget->style->fg_gc[GTK_WIDGET_STATE (widget)], frame->pixMap,
-			event->area.x, event->area.y, event->area.x, event->area.y, event->area.width, event->area.height);
+	gdk_draw_pixmap(gtk_widget_get_window(widget),
+			gtk_widget_get_style(widget)->fg_gc[gtk_widget_get_state(widget)],
+			frame->pixMap, event->area.x, event->area.y, event->area.x,
+			event->area.y, event->area.width, event->area.height);
 }
 
 static void paintFrame_buttonClicked(GtkWidget *button, gpointer data) {
@@ -297,13 +302,15 @@ static gboolean paintFrame_mousePressed(
 static celix_status_t paintFrame_redraw(PAINT_FRAME frame, GdkModifierType state) {
 	if (frame->pixMap != NULL && frame->showing) {
 		GdkRectangle update_rect;
+		GtkAllocation allocation;
 
 		update_rect.x = 0;
 		update_rect.y = 0;
-		update_rect.width = frame->drawingArea->allocation.width;
-		update_rect.height = frame->drawingArea->allocation.height;
+		gtk_widget_get_allocation(frame->drawingArea, &allocation);
+		update_rect.width = allocation.width;
+		update_rect.height = allocation.height;
 		gdk_draw_rectangle (this->pixMap,
-				frame->drawingArea->style->white_gc,
+				gtk_widget_get_style(frame->drawingArea)->white_gc,
 				TRUE,
 				update_rect.x, update_rect.y,
 				update_rect.width, update_rect.height);

Modified: incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/simple/public/include/simple_shape.h
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/simple/public/include/simple_shape.h?rev=1370760&r1=1370759&r2=1370760&view=diff
==============================================================================
--- incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/simple/public/include/simple_shape.h (original)
+++ incubator/celix/trunk/examples/osgi-in-action/chapter04-paint-example/simple/public/include/simple_shape.h Wed Aug  8 13:39:56 2012
@@ -8,6 +8,8 @@
 #ifndef SIMPLE_SHAPE_H_
 #define SIMPLE_SHAPE_H_
 
+#include <gdk/gdk.h>
+
 struct simple_shape {
 	char *icon_path;
 	char *name;

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=1370760&r1=1370759&r2=1370760&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 Aug  8 13:39:56 2012
@@ -60,7 +60,7 @@ void squareShape_draw(SIMPLE_SHAPE shape
 		gdk_pixbuf_render_to_drawable(
 				curr_pix_buf,
 				pixMap,
-				widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
+				gtk_widget_get_style(widget)->fg_gc[gtk_widget_get_state(widget)],
 				0, 0,
 				update_rect.x, update_rect.y,
 				update_rect.width,

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=1370760&r1=1370759&r2=1370760&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 Aug  8 13:39:56 2012
@@ -60,7 +60,7 @@ void triangleShape_draw(SIMPLE_SHAPE sha
 	gdk_pixbuf_render_to_drawable(
 			curr_pix_buf,
 			pixMap,
-			widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
+			gtk_widget_get_style(widget)->fg_gc[gtk_widget_get_state(widget)],
 			0, 0,
 			update_rect.x, update_rect.y,
 			update_rect.width,

Modified: incubator/celix/trunk/framework/private/src/framework.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/framework.c?rev=1370760&r1=1370759&r2=1370760&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/framework.c (original)
+++ incubator/celix/trunk/framework/private/src/framework.c Wed Aug  8 13:39:56 2012
@@ -1902,7 +1902,7 @@ celix_status_t fw_fireBundleEvent(FRAMEW
 			request->type = BUNDLE_EVENT_TYPE;
 
 			arrayList_add(framework->requests, request);
-			if (apr_thread_mutex_lock(framework->dispatcherLock != APR_SUCCESS)) {
+			if (apr_thread_mutex_lock(framework->dispatcherLock) != APR_SUCCESS) {
 				status = CELIX_FRAMEWORK_EXCEPTION;
 			} else {
 				if (apr_thread_cond_broadcast(framework->dispatcher)) {

Modified: incubator/celix/trunk/hessian/source/private/test/test_hessian_out.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/hessian/source/private/test/test_hessian_out.c?rev=1370760&r1=1370759&r2=1370760&view=diff
==============================================================================
--- incubator/celix/trunk/hessian/source/private/test/test_hessian_out.c (original)
+++ incubator/celix/trunk/hessian/source/private/test/test_hessian_out.c Wed Aug  8 13:39:56 2012
@@ -21,6 +21,12 @@ int setup() {
 
 void test_hessian_writeBoolean() {
 	out = malloc(sizeof(*out));
+	out->offset = 0;
+	out->buffer = NULL;
+	out->capacity = 0;
+	out->chunkLength = 0;
+	out->lastChunk = false;
+	out->length = 0;
 
 	hessian_writeBoolean(out, true);
 
@@ -30,6 +36,12 @@ void test_hessian_writeBoolean() {
 
 void test_hessian_writeInt() {
 	out = malloc(sizeof(*out));
+	out->offset = 0;
+	out->buffer = NULL;
+	out->capacity = 0;
+	out->chunkLength = 0;
+	out->lastChunk = false;
+	out->length = 0;
 
 	hessian_writeInt(out, 0);
 

Modified: incubator/celix/trunk/hessian/source/private/test/test_service_skeleton.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/hessian/source/private/test/test_service_skeleton.c?rev=1370760&r1=1370759&r2=1370760&view=diff
==============================================================================
--- incubator/celix/trunk/hessian/source/private/test/test_service_skeleton.c (original)
+++ incubator/celix/trunk/hessian/source/private/test/test_service_skeleton.c Wed Aug  8 13:39:56 2012
@@ -4,6 +4,7 @@
  *  Created on: Aug 5, 2011
  *      Author: alexander
  */
+#include <stddef.h>
 
 #include "hessian_2.0_in.h"