2 * CORBA/ORBit client side of File object of sandbox_parent()
3 * Copyright (C) 2003 Jan Kratochvil <project-captive@jankratochvil.net>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; exactly version 2 of June 1991 is required
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include "parent-File.h" /* self */
23 #include <glib/gmessages.h>
26 #include "../client/file.h"
27 #include "../client/vfs.h"
29 #include "captive/macros.h"
30 #include "reactos/ntos/types.h" /* for ULONG */
33 GnomeVFSResult captive_sandbox_parent_file_new_open(CaptiveFileParentObject *captive_file_parent_object,
34 const gchar *pathname,GnomeVFSOpenMode mode)
36 xmlNode *xml_action=NULL;
37 CaptiveVfsParentObject *captive_vfs_parent_object;
39 g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS);
40 g_return_val_if_fail(pathname!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
42 captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object)->vfs);
44 if (captive_vfs_parent_object->corba_bug_action) {
45 xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,"file_new_open",NULL);
46 xmlNewProp(xml_action,"object",captive_printf_alloca("%p",captive_file_parent_object));
47 xmlNewProp(xml_action,"pathname",pathname);
48 xmlNewProp(xml_action,"mode",captive_printf_alloca("%u",(unsigned)mode));
51 captive_file_parent_object->corba_File_object=Captive_Vfs_file_new_open(
52 captive_vfs_parent_object->corba_Vfs_object,pathname,mode,&captive_corba_ev);
54 xmlNewProp(xml_action,"result",(captive_corba_ev._major==CORBA_NO_EXCEPTION ? "1" : "0"));
56 return captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev,captive_vfs_parent_object);
60 GnomeVFSResult captive_sandbox_parent_file_new_create(CaptiveFileParentObject *captive_file_parent_object,
61 const gchar *pathname,GnomeVFSOpenMode mode,gboolean exclusive,guint perm)
63 xmlNode *xml_action=NULL;
64 CaptiveVfsParentObject *captive_vfs_parent_object;
66 g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS);
67 g_return_val_if_fail(pathname!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
69 captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object)->vfs);
71 if (captive_vfs_parent_object->corba_bug_action) {
72 xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,"file_new_create",NULL);
73 xmlNewProp(xml_action,"object",captive_printf_alloca("%p",captive_file_parent_object));
74 xmlNewProp(xml_action,"pathname",pathname);
75 xmlNewProp(xml_action,"mode",captive_printf_alloca("%u",(unsigned)mode));
76 xmlNewProp(xml_action,"exclusive",captive_printf_alloca("%u",(unsigned)exclusive));
77 xmlNewProp(xml_action,"perm",captive_printf_alloca("%u",(unsigned)perm));
80 captive_file_parent_object->corba_File_object=Captive_Vfs_file_new_create(
81 captive_vfs_parent_object->corba_Vfs_object,pathname,mode,exclusive,perm,&captive_corba_ev);
83 xmlNewProp(xml_action,"result",(captive_corba_ev._major==CORBA_NO_EXCEPTION ? "1" : "0"));
85 return captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev,captive_vfs_parent_object);
89 GnomeVFSResult captive_sandbox_parent_file_close(CaptiveFileParentObject *captive_file_parent_object)
92 xmlNode *xml_action=NULL;
93 CaptiveVfsParentObject *captive_vfs_parent_object;
95 g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS);
97 captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object)->vfs);
99 if (captive_vfs_parent_object->corba_bug_action) {
100 xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,"file_close",NULL);
101 xmlNewProp(xml_action,"object",captive_printf_alloca("%p",captive_file_parent_object));
104 Captive_File_shutdown(captive_file_parent_object->corba_File_object,&captive_corba_ev);
105 r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev,captive_vfs_parent_object);
107 xmlNewProp(xml_action,"result",gnome_vfs_result_to_string(r));
111 CORBA_Object_release((CORBA_Object)captive_file_parent_object->corba_File_object,&captive_corba_ev);
112 captive_file_parent_object->corba_File_object=CORBA_OBJECT_NIL;
114 return captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev,captive_vfs_parent_object);
118 static GnomeVFSResult captive_sandbox_parent_file_seek_slave
119 (CaptiveFileParentObject *captive_file_parent_object,GnomeVFSSeekPosition whence,GnomeVFSFileOffset offset);
121 GnomeVFSResult captive_sandbox_parent_file_read(CaptiveFileParentObject *captive_file_parent_object,
122 gpointer buffer_captive,GnomeVFSFileSize num_bytes,GnomeVFSFileSize *bytes_read_return)
125 Captive_Bytes *buffer_corba;
126 xmlNode *xml_action=NULL;
127 CaptiveVfsParentObject *captive_vfs_parent_object;
129 g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS);
130 g_return_val_if_fail(buffer_captive!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
131 g_return_val_if_fail(bytes_read_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
132 g_return_val_if_fail(num_bytes==(ULONG)num_bytes,GNOME_VFS_ERROR_BAD_PARAMETERS);
134 captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object)->vfs);
136 *bytes_read_return=0;
138 if (captive_vfs_parent_object->corba_bug_action) {
139 xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,"file_read",NULL);
140 xmlNewProp(xml_action,"object",captive_printf_alloca("%p",captive_file_parent_object));
141 xmlNewProp(xml_action,"num_bytes",captive_printf_alloca("%lu",(unsigned long)num_bytes));
144 r=captive_sandbox_parent_file_seek_slave(captive_file_parent_object,
145 GNOME_VFS_SEEK_START,captive_file_parent_object->offset);
146 if (r==GNOME_VFS_OK) {
147 Captive_File_read(captive_file_parent_object->corba_File_object,&buffer_corba,num_bytes,&captive_corba_ev);
148 r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev,captive_vfs_parent_object);
151 xmlNewProp(xml_action,"result",gnome_vfs_result_to_string(r));
155 g_return_val_if_fail(buffer_corba->_length<=num_bytes,GNOME_VFS_ERROR_GENERIC);
156 memcpy(buffer_captive,buffer_corba->_buffer,buffer_corba->_length);
157 *bytes_read_return=buffer_corba->_length;
158 captive_file_parent_object->offset+=buffer_corba->_length;
160 Captive_Bytes__freekids(buffer_corba,NULL/* 'd'; meaning? */);
161 CORBA_free(buffer_corba);
164 xmlNewProp(xml_action,"bytes_read_return",captive_printf_alloca("%lu",(unsigned long)*bytes_read_return));
170 GnomeVFSResult captive_sandbox_parent_file_write(CaptiveFileParentObject *captive_file_parent_object,
171 gconstpointer buffer_captive,GnomeVFSFileSize num_bytes,GnomeVFSFileSize *bytes_written_return)
174 Captive_Bytes buffer_corba_local;
175 Captive_GnomeVFSFileSize bytes_written_corba;
176 xmlNode *xml_action=NULL;
177 CaptiveVfsParentObject *captive_vfs_parent_object;
179 g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS);
180 g_return_val_if_fail(buffer_captive!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
181 g_return_val_if_fail(bytes_written_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
182 g_return_val_if_fail(num_bytes==(ULONG)num_bytes,GNOME_VFS_ERROR_BAD_PARAMETERS);
184 captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object)->vfs);
186 *bytes_written_return=0;
188 if (captive_vfs_parent_object->corba_bug_action) {
189 xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,"file_write",NULL);
190 xmlNewProp(xml_action,"object",captive_printf_alloca("%p",captive_file_parent_object));
191 xmlNewProp(xml_action,"num_bytes",captive_printf_alloca("%lu",(unsigned long)num_bytes));
194 r=captive_sandbox_parent_file_seek_slave(captive_file_parent_object,
195 GNOME_VFS_SEEK_START,captive_file_parent_object->offset);
196 if (r==GNOME_VFS_OK) {
197 buffer_corba_local._maximum=num_bytes;
198 buffer_corba_local._length=num_bytes;
199 buffer_corba_local._buffer=(/* de-const */gpointer)buffer_captive;
200 buffer_corba_local._release=FALSE;
202 Captive_File_write(captive_file_parent_object->corba_File_object,
203 &buffer_corba_local,&bytes_written_corba,&captive_corba_ev);
204 r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev,captive_vfs_parent_object);
207 xmlNewProp(xml_action,"result",gnome_vfs_result_to_string(r));
211 *bytes_written_return=bytes_written_corba;
212 captive_file_parent_object->offset+=bytes_written_corba;
215 xmlNewProp(xml_action,"bytes_written_return",captive_printf_alloca("%lu",(unsigned long)*bytes_written_return));
221 static GnomeVFSResult captive_sandbox_parent_file_seek_slave
222 (CaptiveFileParentObject *captive_file_parent_object,GnomeVFSSeekPosition whence,GnomeVFSFileOffset offset)
225 xmlNode *xml_action=NULL;
226 CaptiveVfsParentObject *captive_vfs_parent_object;
228 g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS);
230 captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object)->vfs);
232 if (captive_vfs_parent_object->corba_bug_action) {
233 xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,"file_seek",NULL);
234 xmlNewProp(xml_action,"object",captive_printf_alloca("%p",captive_file_parent_object));
235 xmlNewProp(xml_action,"whence",
236 (whence==GNOME_VFS_SEEK_START ? "start" :
237 (whence==GNOME_VFS_SEEK_CURRENT ? "current" :
238 (whence==GNOME_VFS_SEEK_END ? "end" : captive_printf_alloca("%lu",(unsigned long)whence)))));
239 xmlNewProp(xml_action,"offset",captive_printf_alloca("%" G_GINT64_FORMAT,(gint64)offset));
242 Captive_File_seek(captive_file_parent_object->corba_File_object,whence,offset,&captive_corba_ev);
243 r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev,captive_vfs_parent_object);
245 xmlNewProp(xml_action,"result",gnome_vfs_result_to_string(r));
253 GnomeVFSResult captive_sandbox_parent_file_seek
254 (CaptiveFileParentObject *captive_file_parent_object,GnomeVFSSeekPosition whence,GnomeVFSFileOffset offset)
257 xmlNode *xml_action=NULL;
258 CaptiveVfsParentObject *captive_vfs_parent_object;
260 g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS);
262 captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object)->vfs);
264 if (captive_vfs_parent_object->corba_bug_action) {
265 xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,"file_seek",NULL);
266 xmlNewProp(xml_action,"object",captive_printf_alloca("%p",captive_file_parent_object));
267 xmlNewProp(xml_action,"whence",
268 (whence==GNOME_VFS_SEEK_START ? "start" :
269 (whence==GNOME_VFS_SEEK_CURRENT ? "current" :
270 (whence==GNOME_VFS_SEEK_END ? "end" : captive_printf_alloca("%lu",(unsigned long)whence)))));
271 xmlNewProp(xml_action,"offset",captive_printf_alloca("%" G_GINT64_FORMAT,(gint64)offset));
275 case GNOME_VFS_SEEK_START:
276 captive_file_parent_object->offset=offset;
278 case GNOME_VFS_SEEK_CURRENT:
280 || (offset>0 && (captive_file_parent_object->offset+offset)<captive_file_parent_object->offset)
281 || (offset<0 && (captive_file_parent_object->offset+offset)>captive_file_parent_object->offset))
282 r=GNOME_VFS_ERROR_BAD_PARAMETERS;
284 captive_file_parent_object->offset+=offset;
286 case GNOME_VFS_SEEK_END:
287 g_assert_not_reached(); /* NOT IMPLEMENTED YET */
288 r=GNOME_VFS_ERROR_GENERIC;
291 r=GNOME_VFS_ERROR_BAD_PARAMETERS;
295 xmlNewProp(xml_action,"result",gnome_vfs_result_to_string(r));
304 static GnomeVFSResult captive_sandbox_parent_file_tell_slave
305 (CaptiveFileParentObject *captive_file_parent_object,GnomeVFSFileOffset *offset_return)
307 Captive_GnomeVFSFileOffset offset_corba;
309 xmlNode *xml_action=NULL;
310 CaptiveVfsParentObject *captive_vfs_parent_object;
312 g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS);
313 g_return_val_if_fail(offset_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
315 captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object)->vfs);
317 if (captive_vfs_parent_object->corba_bug_action) {
318 xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,"file_tell",NULL);
319 xmlNewProp(xml_action,"object",captive_printf_alloca("%p",captive_file_parent_object));
322 Captive_File_tell(captive_file_parent_object->corba_File_object,&offset_corba,&captive_corba_ev);
323 r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev,captive_vfs_parent_object);
325 xmlNewProp(xml_action,"result",gnome_vfs_result_to_string(r));
329 *offset_return=offset_corba;
332 xmlNewProp(xml_action,"offset_return",captive_printf_alloca("%" G_GINT64_FORMAT,(gint64)*offset_return));
339 GnomeVFSResult captive_sandbox_parent_file_tell(CaptiveFileParentObject *captive_file_parent_object,GnomeVFSFileOffset *offset_return)
342 xmlNode *xml_action=NULL;
343 CaptiveVfsParentObject *captive_vfs_parent_object;
345 g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS);
346 g_return_val_if_fail(offset_return!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
348 captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object)->vfs);
350 if (captive_vfs_parent_object->corba_bug_action) {
351 xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,"file_tell",NULL);
352 xmlNewProp(xml_action,"object",captive_printf_alloca("%p",captive_file_parent_object));
355 *offset_return=captive_file_parent_object->offset;
358 xmlNewProp(xml_action,"result",gnome_vfs_result_to_string(r));
363 xmlNewProp(xml_action,"offset_return",captive_printf_alloca("%" G_GINT64_FORMAT,(gint64)*offset_return));
369 GnomeVFSResult captive_sandbox_parent_file_remove(CaptiveFileParentObject *captive_file_parent_object)
372 xmlNode *xml_action=NULL;
373 CaptiveVfsParentObject *captive_vfs_parent_object;
375 g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS);
377 captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object)->vfs);
379 if (captive_vfs_parent_object->corba_bug_action) {
380 xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,"file_remove",NULL);
381 xmlNewProp(xml_action,"object",captive_printf_alloca("%p",captive_file_parent_object));
384 Captive_File_remove(captive_file_parent_object->corba_File_object,&captive_corba_ev);
385 r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev,captive_vfs_parent_object);
387 xmlNewProp(xml_action,"result",gnome_vfs_result_to_string(r));
395 GnomeVFSResult captive_sandbox_parent_file_file_info_get(CaptiveFileParentObject *captive_file_parent_object,
396 GnomeVFSFileInfo *file_info_captive)
398 Captive_GnomeVFSFileInfo *file_info_corba;
400 xmlNode *xml_action=NULL;
401 CaptiveVfsParentObject *captive_vfs_parent_object;
403 g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS);
404 g_return_val_if_fail(file_info_captive!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
406 captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object)->vfs);
408 if (captive_vfs_parent_object->corba_bug_action) {
409 xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,"file_file_info_get",NULL);
410 xmlNewProp(xml_action,"object",captive_printf_alloca("%p",captive_file_parent_object));
413 Captive_File_file_info_get(captive_file_parent_object->corba_File_object,&file_info_corba,&captive_corba_ev);
414 r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev,captive_vfs_parent_object);
416 xmlNewProp(xml_action,"result",gnome_vfs_result_to_string(r));
420 r=captive_sandbox_file_info_corba_to_captive(file_info_captive,file_info_corba);
421 Captive_GnomeVFSFileInfo__freekids(file_info_corba,NULL/* 'd'; meaning? */);
422 CORBA_free(file_info_corba);
424 xmlSetProp(xml_action,"result",gnome_vfs_result_to_string(r));
432 GnomeVFSResult captive_sandbox_parent_file_file_info_set(CaptiveFileParentObject *captive_file_parent_object,
433 const GnomeVFSFileInfo *file_info_captive,GnomeVFSSetFileInfoMask mask)
435 Captive_GnomeVFSFileInfo file_info_corba;
437 xmlNode *xml_action=NULL;
438 CaptiveVfsParentObject *captive_vfs_parent_object;
440 g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS);
441 g_return_val_if_fail(file_info_captive!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
443 captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object)->vfs);
445 if (captive_vfs_parent_object->corba_bug_action) {
446 xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,"file_file_info_set",NULL);
447 xmlNewProp(xml_action,"object",captive_printf_alloca("%p",captive_file_parent_object));
448 xmlNewProp(xml_action,"mask",captive_printf_alloca("%u",(unsigned)mask));
451 if (GNOME_VFS_OK!=(r=captive_sandbox_file_info_captive_to_corba(&file_info_corba,file_info_captive)))
454 Captive_File_file_info_set(captive_file_parent_object->corba_File_object,&file_info_corba,mask,&captive_corba_ev);
455 r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev,captive_vfs_parent_object);
457 xmlNewProp(xml_action,"result",gnome_vfs_result_to_string(r));
461 Captive_GnomeVFSFileInfo__freekids(&file_info_corba,NULL/* 'd'; meaning? */);
467 GnomeVFSResult captive_sandbox_parent_file_truncate(CaptiveFileParentObject *captive_file_parent_object,GnomeVFSFileSize file_size)
470 xmlNode *xml_action=NULL;
471 CaptiveVfsParentObject *captive_vfs_parent_object;
473 g_return_val_if_fail(CAPTIVE_FILE_PARENT_IS_OBJECT(captive_file_parent_object),GNOME_VFS_ERROR_BAD_PARAMETERS);
475 captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object)->vfs);
477 if (captive_vfs_parent_object->corba_bug_action) {
478 xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,"file_truncate",NULL);
479 xmlNewProp(xml_action,"object",captive_printf_alloca("%p",captive_file_parent_object));
480 xmlNewProp(xml_action,"file_size",captive_printf_alloca("%" G_GUINT64_FORMAT,(guint64)file_size));
483 Captive_File_truncate(captive_file_parent_object->corba_File_object,file_size,&captive_corba_ev);
484 r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev,captive_vfs_parent_object);
486 xmlNewProp(xml_action,"result",gnome_vfs_result_to_string(r));
494 GnomeVFSResult captive_sandbox_parent_file_move
495 (CaptiveFileParentObject *captive_file_parent_object_old,const gchar *pathname_new,gboolean force_replace)
498 xmlNode *xml_action=NULL;
499 CaptiveVfsParentObject *captive_vfs_parent_object;
501 g_return_val_if_fail(captive_file_parent_object_old!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
502 g_return_val_if_fail(pathname_new!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
504 captive_vfs_parent_object=CAPTIVE_VFS_PARENT_OBJECT(CAPTIVE_FILE_OBJECT(captive_file_parent_object_old)->vfs);
506 if (captive_vfs_parent_object->corba_bug_action) {
507 xml_action=xmlNewTextChild(captive_vfs_parent_object->corba_bug_action,NULL,"file_truncate",NULL);
508 xmlNewProp(xml_action,"object",captive_printf_alloca("%p",captive_file_parent_object_old));
509 xmlNewProp(xml_action,"pathname_new",pathname_new);
510 xmlNewProp(xml_action,"force_replace",captive_printf_alloca("%u",(unsigned)force_replace));
513 Captive_File_move(captive_file_parent_object_old->corba_File_object,pathname_new,force_replace,&captive_corba_ev);
514 r=captive_sandbox_parent_return_from_CORBA_Environment(&captive_corba_ev,captive_vfs_parent_object);
516 xmlNewProp(xml_action,"result",gnome_vfs_result_to_string(r));