+captive_giochannel_setup() for libcaptive-compatible GIOChannel setup.
authorshort <>
Fri, 18 Jul 2003 11:36:23 +0000 (11:36 +0000)
committershort <>
Fri, 18 Jul 2003 11:36:23 +0000 (11:36 +0000)
src/client/libcaptive-gnomevfs/Makefile.am
src/client/libcaptive-gnomevfs/giognomevfs.c
src/libcaptive/client/init.c
src/libcaptive/client/vfs.c
src/libcaptive/sandbox/client-CaptiveIOChannel.c
src/libcaptive/sandbox/server-CaptiveIOChannel.c

index 5418027..4be2184 100644 (file)
@@ -1,6 +1,6 @@
 # $Id$
 # automake source for the libcaptive-gnomevfs module for gnome-vfs2 Makefile 
-# Copyright (C) 2002 Jan Kratochvil <project-captive@jankratochvil.net>
+# Copyright (C) 2002-2003 Jan Kratochvil <project-captive@jankratochvil.net>
 # 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -22,7 +22,7 @@ include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am
 gnomevfsmoduleslibdir=$(libdir)/gnome-vfs-2.0/modules
 gnomevfsmoduleslib_LTLIBRARIES=libcaptive-gnomevfs.la
 
-libcaptive_gnomevfs_la_CFLAGS=$(GNOME_VFS_MODULE_CFLAGS)
+libcaptive_gnomevfs_la_CFLAGS=                   $(GNOME_VFS_MODULE_CFLAGS) $(LIBXML_CFLAGS)
 libcaptive_gnomevfs_la_LIBADD=$(captive_library) $(GNOME_VFS_MODULE_LIBS)
 libcaptive_gnomevfs_la_LDFLAGS=-release $(VERSION)
 libcaptive_gnomevfs_la_SOURCES= \
index 345dc31..c6d66d6 100644 (file)
@@ -25,6 +25,7 @@
 #include <glib/gmessages.h>
 #include "gnome-vfs-module.h"
 #include "captive/options.h"
+#include "../../libcaptive/client/giochannel-blind.h"  /* for captive_giochannel_setup(); FIXME: pathname */
 
 
 /* FIXME: fill 'err' */
@@ -225,6 +226,8 @@ GnomeVFSResult errvfsresult;
        giognomevfs->iochannel.close_on_unref=TRUE;     /* run g_io_channel_shutdown() flush on last unref */
        giognomevfs->gnomevfshandle=handle;
 
+       captive_giochannel_setup(&giognomevfs->iochannel);
+
        *giognomevfsp=giognomevfs;
        return GNOME_VFS_OK;
 }
index 97876c1..5ac85e2 100644 (file)
@@ -1,6 +1,6 @@
 /* $Id$
  * Init and cleanup code of libcaptive to be called by client application
- * Copyright (C) 2002 Jan Kratochvil <project-captive@jankratochvil.net>
+ * Copyright (C) 2002-2003 Jan Kratochvil <project-captive@jankratochvil.net>
  * 
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -84,16 +84,10 @@ static gboolean captive_w32_init(void)
 {
 NTSTATUS err;
 gboolean errbool;
-GIOStatus erriostatus;
 
        g_return_val_if_fail(captive_options!=NULL,FALSE);
        g_return_val_if_fail(captive_options->filesystem.type!=CAPTIVE_OPTIONS_MODULE_TYPE_EMPTY,FALSE);
 
-       erriostatus=g_io_channel_set_encoding(captive_image_iochannel,
-                       NULL,   /* encoding; force binary data */
-                       NULL);  /* error */
-       g_assert(erriostatus==G_IO_STATUS_NORMAL);
-
        /* captive_giochannel_size() only _after_ g_io_channel_set_encoding() ! */
        captive_image_size=captive_giochannel_size(captive_image_iochannel);
        g_return_val_if_fail(captive_image_size>0,FALSE);
index 9b29ec3..6f01700 100644 (file)
@@ -26,6 +26,7 @@
 #include "init.h"
 #include "captive/parent-Vfs.h"
 #include "../sandbox/server-Vfs.h"     /* for captive_corba_child_options */
+#include "giochannel-blind.h"  /* for captive_giochannel_setup() */
 
 
 static gpointer captive_vfs_object_parent_class=NULL;
@@ -126,6 +127,9 @@ gboolean errbool;
 
        captive_options_copy(&captive_vfs_object->options,options);
 
+       if (captive_vfs_object->options.image_iochannel)
+               captive_giochannel_setup(captive_vfs_object->options.image_iochannel);
+
        *captive_vfs_object_return=captive_vfs_object;
 
        /* We are sandboxing && we are the master */
index 0b72f4f..fb3e62c 100644 (file)
@@ -24,6 +24,7 @@
 #include "split.h"
 #include <string.h>
 #include "captive/macros.h"
+#include "../client/giochannel-blind.h"        /* for captive_giochannel_setup() */
 
 
 struct captive_io_channel {
@@ -204,6 +205,8 @@ struct captive_io_channel *captive_io_channel;
        captive_io_channel->iochannel.close_on_unref=TRUE;      /* run g_io_channel_shutdown() flush on last unref */
        captive_io_channel->corba_captive_io_channel=corba_captive_io_channel;
 
+       captive_giochannel_setup(captive_io_channel);
+
        return captive_io_channel;
 }
 
index db71790..70ce0d7 100644 (file)
@@ -62,17 +62,12 @@ Captive_CaptiveIOChannel impl_Captive_CaptiveIOChannel__create
 Captive_CaptiveIOChannel retval;
 impl_POA_Captive_CaptiveIOChannel *newservant;
 PortableServer_ObjectId *objid;
-GIOStatus erriostatus;
 
        captive_new0(newservant);       /* FIXME: leak */
        newservant->servant.vepv=&impl_Captive_CaptiveIOChannel_vepv;
        newservant->poa=poa;
 
        newservant->image_iochannel=image_iochannel;
-       erriostatus=g_io_channel_set_encoding(newservant->image_iochannel,
-                       NULL, /* encoding; force binary data */
-                       NULL);  /* error */
-       g_assert(erriostatus==G_IO_STATUS_NORMAL);
 
        /* captive_giochannel_size() only _after_ g_io_channel_set_encoding() ! */
        newservant->image_size=captive_giochannel_size(newservant->image_iochannel);