libgnomevfs2-mythtv/modules/mythtv-method.c
author renatofilho
Tue Mar 27 16:12:15 2007 +0100 (2007-03-27)
branchtrunk
changeset 460 cde4aad8577a
parent 459 edaab488eaeb
child 461 0683ea324deb
permissions -rwxr-xr-x
[svn r465] removed seek imp.
     1 /*
     2  * @author Hallyson Melo <hallyson.melo@indt.org.br>
     3  *
     4  * This program is free software; you can redistribute it and/or modify
     5  * it under the terms of the GNU Lesser General Public License as published by
     6  * the Free Software Foundation; either version 2 of the License, or
     7  * (at your option) any later version.
     8  *
     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.
    13  *
    14  * You should have received a copy of the GNU Lesser 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
    17  */
    18 
    19 #ifdef HAVE_CONFIG_H
    20 #include <config.h>
    21 #endif
    22 
    23 #include <string.h>
    24 #include <glib.h>
    25 #include <glib/gprintf.h>
    26 #include <glib/gstdio.h>
    27 #include <math.h>
    28 
    29 #include <libgnomevfs/gnome-vfs-module.h>
    30 #include <libgnomevfs/gnome-vfs-utils.h>
    31 
    32 #include <gmyth/gmyth_file_transfer.h>
    33 #include <gmyth/gmyth_livetv.h>
    34 #include <gmyth/gmyth_uri.h>
    35 #include <gmyth/gmyth_recorder.h>
    36 #include <gmyth/gmyth_backendinfo.h>
    37 #include <gmyth/gmyth_util.h>
    38 #include <gmyth/gmyth_remote_util.h>
    39 #include <gmyth/gmyth_tvchain.h>
    40 #include <gmyth/gmyth_programinfo.h>
    41 
    42 #define GST_MYTHTV_ID_NUM               1
    43 #define MYTHTV_VERSION_DEFAULT          30
    44 #define MYTHTV_TRANSFER_MAX_WAITS       100
    45 
    46 /* internal GnomeVFS plug-in buffer size ( 120 Kbytes ) */
    47 #define MYTHTV_BUFFER_SIZE                          80*1024
    48 /* internally sized GnomeVFS plug-in buffer ( 4 Kbytes ) */
    49 #define MYTHTV_MAX_VFS_BUFFER_SIZE                  4096
    50 /* maximum number of bytes to be requested to the MythTV backend ( 64 Kbytes ) */
    51 #define MYTHTV_MAX_REQUEST_SIZE                     64*1024
    52 
    53 typedef struct {
    54 	GMythFileTransfer *file_transfer;
    55 	GMythLiveTV *livetv;
    56     GMythBackendInfo *backend_info;
    57     GMythURI *gmyth_uri;
    58     GMythRecorder *live_recorder;
    59     gint64 offset;
    60 
    61 	gchar *channel_name;
    62 
    63 	gint mythtv_version;
    64 	gboolean configured;
    65 } MythtvHandle;
    66 
    67 
    68 static GnomeVFSResult do_read (GnomeVFSMethod * method,
    69 			       GnomeVFSMethodHandle * method_handle,
    70 			       gpointer buffer,
    71 			       GnomeVFSFileSize num_bytes,
    72 			       GnomeVFSFileSize * bytes_read,
    73 			       GnomeVFSContext * context);
    74 
    75 static GnomeVFSResult   myth_connection_start   (MythtvHandle * method_handle);
    76 static void             myth_destroy_handle     (MythtvHandle * method_handle);
    77 static GnomeVFSResult   myth_handle_new         (GnomeVFSURI * uri,
    78                                                  MythtvHandle ** method_handle);
    79 static GnomeVFSResult   myth_get_file_info      (MythtvHandle * myth_handle,
    80                                                  GnomeVFSURI * uri,
    81                                                  GnomeVFSFileInfo * info);
    82 
    83 static GnomeVFSResult 
    84 myth_handle_new (GnomeVFSURI * uri,
    85                  MythtvHandle ** method_handle)
    86 {   
    87     gchar *tmp_str1;
    88     gchar *tmp_str2;
    89 
    90     _GNOME_VFS_METHOD_PARAM_CHECK (*method_handle == NULL);
    91     
    92 	if (gnome_vfs_uri_get_host_name (uri) == NULL) {
    93 		return GNOME_VFS_ERROR_INVALID_HOST_NAME;
    94 	}
    95 
    96     *method_handle = g_new0 (MythtvHandle, 1);
    97     (*method_handle)->mythtv_version = MYTHTV_VERSION_DEFAULT;
    98         
    99     tmp_str1 = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_NONE);
   100     tmp_str2 = gnome_vfs_unescape_string (tmp_str1, "");
   101 
   102     (*method_handle)->backend_info = gmyth_backend_info_new_with_uri (tmp_str2);
   103     (*method_handle)->gmyth_uri = gmyth_uri_new_with_value (tmp_str2);
   104     g_free (tmp_str1);
   105     g_free (tmp_str2);
   106 
   107     return GNOME_VFS_OK;
   108 }   
   109 
   110 static void
   111 myth_destroy_handle (MythtvHandle * method_handle)
   112 {
   113     //TODO: abort if in tranfer state
   114     
   115     if (method_handle->backend_info != NULL) {
   116         g_object_unref (method_handle->backend_info);
   117         method_handle->backend_info = NULL;
   118     }
   119     
   120     if (method_handle->channel_name != NULL) {
   121         g_free (method_handle->channel_name);
   122         method_handle->channel_name = NULL;
   123     }
   124 
   125     if (method_handle->livetv != NULL) {
   126         g_object_unref (method_handle->livetv);
   127         method_handle->livetv = NULL;
   128     }
   129 
   130     if (method_handle->file_transfer != NULL) {
   131         g_object_unref (method_handle->file_transfer);
   132         method_handle->file_transfer = NULL;
   133     }
   134 
   135     if (method_handle->gmyth_uri != NULL) {
   136         g_object_unref (method_handle->gmyth_uri);
   137         method_handle->gmyth_uri = NULL;
   138     }
   139 
   140     g_free (method_handle);
   141 }
   142 
   143 static GnomeVFSResult
   144 myth_get_file_info (MythtvHandle * myth_handle,
   145                     GnomeVFSURI * uri,
   146                     GnomeVFSFileInfo * info)
   147 {
   148     GMythURI *gmyth_uri;
   149     GMythBackendInfo *backend_info;
   150     
   151     _GNOME_VFS_METHOD_PARAM_CHECK (info != NULL);
   152 
   153     if (myth_handle == NULL) {
   154         gchar *tmp_str1;
   155         gchar *tmp_str2;
   156         
   157         tmp_str1 = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_NONE);
   158         tmp_str2 = gnome_vfs_unescape_string (tmp_str1, "");
   159 
   160         backend_info = gmyth_backend_info_new_with_uri (tmp_str2);
   161         gmyth_uri = gmyth_uri_new_with_value (tmp_str2);
   162         
   163         g_free (tmp_str1);
   164         g_free (tmp_str2);
   165     } else {
   166         backend_info = g_object_ref (myth_handle->backend_info);
   167         gmyth_uri = g_object_ref (myth_handle->gmyth_uri);
   168     }
   169 
   170     info->valid_fields = 0;
   171 	info->valid_fields = GNOME_VFS_FILE_INFO_FIELDS_TYPE | 
   172         GNOME_VFS_FILE_INFO_FIELDS_MIME_TYPE | 
   173         GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS;
   174     
   175 	info->type = GNOME_VFS_FILE_TYPE_REGULAR;
   176     
   177 	/* fixme: get from file extension? */
   178 	info->mime_type = g_strdup ("video/x-nuv");
   179 	info->permissions = GNOME_VFS_PERM_USER_READ | 
   180         GNOME_VFS_PERM_OTHER_READ | 
   181         GNOME_VFS_PERM_GROUP_READ;
   182 
   183    
   184 	info->name = g_strdup (gmyth_uri_get_path (gmyth_uri));
   185 
   186     /* file size for remote files */
   187     if (gmyth_uri_is_livetv (gmyth_uri) == FALSE) {
   188         GMythFileTransfer *file_transfer = gmyth_file_transfer_new (backend_info);
   189         
   190         /* Verifies if the file exists */
   191         if (!gmyth_util_file_exists (backend_info, 
   192                     gmyth_uri_get_path (gmyth_uri))) {
   193             g_object_unref (backend_info);
   194             g_debug ("NOT FOUND %s/%d", __FUNCTION__, __LINE__);
   195             return GNOME_VFS_ERROR_NOT_FOUND;
   196 		}
   197 	
   198 		info->size = gmyth_file_transfer_get_filesize (file_transfer);
   199         info->valid_fields |= GNOME_VFS_FILE_INFO_FIELDS_SIZE;
   200 		g_object_unref (file_transfer);
   201 	}
   202 
   203     g_object_unref (backend_info);
   204     g_object_unref (gmyth_uri);
   205     
   206     return GNOME_VFS_OK;
   207 }
   208 
   209 static GnomeVFSResult
   210 myth_connection_start (MythtvHandle * method_handle)
   211 {
   212     GnomeVFSResult result = GNOME_VFS_OK;
   213 
   214     _GNOME_VFS_METHOD_PARAM_CHECK (method_handle != NULL);
   215     _GNOME_VFS_METHOD_PARAM_CHECK (method_handle->backend_info != NULL);
   216 
   217     
   218 	/* Connect to the backend */
   219 	if (gmyth_uri_is_livetv (method_handle->gmyth_uri) == TRUE) {
   220         
   221         
   222 		method_handle->livetv = gmyth_livetv_new (method_handle->backend_info);
   223 		method_handle->channel_name = gmyth_uri_get_channel_name (method_handle->gmyth_uri);
   224         
   225 		g_debug ("[%s] Channel name = %s\n", __FUNCTION__, 
   226                 method_handle->channel_name);
   227         
   228 		if (method_handle->channel_name != NULL) {
   229 		    if (gmyth_livetv_channel_name_setup (method_handle->livetv, 
   230                     method_handle->channel_name) == FALSE) {
   231                 result = GNOME_VFS_ERROR_INVALID_URI;
   232     			goto error;
   233 			}
   234 		} else if (gmyth_livetv_setup (method_handle->livetv) == FALSE) {
   235                 result = GNOME_VFS_ERROR_INVALID_URI;
   236                 goto error;
   237 		}
   238         
   239 
   240     	method_handle->file_transfer = 
   241             gmyth_livetv_create_file_transfer (method_handle->livetv);
   242 
   243         if (method_handle->file_transfer == NULL) {
   244             result = GNOME_VFS_ERROR_INVALID_URI;
   245     		g_debug ("MythTV FileTransfer is NULL!\n");
   246             goto error;
   247         }
   248 
   249 	    if (!gmyth_file_transfer_open (method_handle->file_transfer,
   250                                         method_handle->livetv->uri != NULL ? 
   251                                         gmyth_uri_get_path (method_handle->livetv->uri) :
   252                                         method_handle->livetv->proginfo->pathname->str)) {
   253         
   254             g_debug ("Couldn't open MythTV FileTransfer is NULL!\n");
   255             result = GNOME_VFS_ERROR_NOT_OPEN;
   256             goto error;
   257         }
   258     }
   259     else {
   260         method_handle->file_transfer = 
   261             gmyth_file_transfer_new (method_handle->backend_info);
   262 
   263 		/* Verifies if the file exists */
   264 		if (!gmyth_util_file_exists (method_handle->backend_info, 
   265                     gmyth_uri_get_path (method_handle->gmyth_uri))) {
   266 
   267             g_debug ("NOT FOUND %s/%d", __FUNCTION__, __LINE__);
   268 		    result = GNOME_VFS_ERROR_NOT_FOUND;
   269             goto error;
   270 		}
   271 
   272 		/* sets the Playback monitor connection */
   273 		result = gmyth_file_transfer_open (method_handle->file_transfer,
   274                   					    gmyth_uri_get_path (method_handle->gmyth_uri));
   275 	} /* if - LiveTV or not? */
   276 
   277 	method_handle->configured = TRUE;    
   278 
   279     if (method_handle->file_transfer == NULL) {
   280         result = GNOME_VFS_ERROR_NOT_OPEN;
   281         goto error;
   282     }
   283 	g_return_val_if_fail (method_handle->file_transfer != NULL, 
   284             GNOME_VFS_ERROR_NOT_OPEN);
   285 
   286 error:
   287     
   288     return result; 
   289 }
   290 
   291 static GnomeVFSResult
   292 do_open (GnomeVFSMethod * method,
   293 	 GnomeVFSMethodHandle ** method_handle,
   294 	 GnomeVFSURI * uri,
   295 	 GnomeVFSOpenMode mode, GnomeVFSContext * context)
   296 {
   297 	MythtvHandle *myth_handle = NULL;
   298     GnomeVFSResult result = GNOME_VFS_OK;
   299 
   300 	_GNOME_VFS_METHOD_PARAM_CHECK (method_handle != NULL);
   301 	_GNOME_VFS_METHOD_PARAM_CHECK (uri != NULL);
   302 
   303 	if (mode & GNOME_VFS_OPEN_WRITE) {
   304 		return GNOME_VFS_ERROR_INVALID_OPEN_MODE;
   305 	}
   306 
   307     result = myth_handle_new (uri, &myth_handle);
   308     if (result != GNOME_VFS_OK) 
   309         return result;
   310 
   311     result = myth_connection_start (myth_handle);
   312     if (result != GNOME_VFS_OK) {
   313         myth_destroy_handle (myth_handle);
   314         myth_handle = NULL;
   315         return result;
   316     }
   317     *method_handle = (GnomeVFSMethodHandle *) myth_handle;
   318     
   319     return result;
   320 }
   321 
   322 static GnomeVFSResult
   323 do_create (GnomeVFSMethod	 *method,
   324 	   GnomeVFSMethodHandle **method_handle,
   325 	   GnomeVFSURI 		 *uri,
   326 	   GnomeVFSOpenMode 	  mode,
   327 	   gboolean 		  exclusive,
   328 	   guint 		  perm,
   329 	   GnomeVFSContext 	 *context)
   330 {
   331     return GNOME_VFS_ERROR_NOT_SUPPORTED;
   332 }
   333 
   334 static GnomeVFSResult
   335 do_close (GnomeVFSMethod * method,
   336         GnomeVFSMethodHandle * method_handle, 
   337         GnomeVFSContext * context)
   338 {
   339 	MythtvHandle *myth_handle = (MythtvHandle *) method_handle;
   340 
   341     myth_destroy_handle (myth_handle);
   342     
   343 	return GNOME_VFS_OK;
   344 }
   345 
   346 
   347 static GnomeVFSResult
   348 do_read (GnomeVFSMethod * method,
   349 	 GnomeVFSMethodHandle * method_handle,
   350 	 gpointer buffer,
   351 	 GnomeVFSFileSize num_bytes,
   352 	 GnomeVFSFileSize * bytes_read, 
   353          GnomeVFSContext * context)
   354 {
   355     GnomeVFSResult result;
   356     MythtvHandle *myth_handle;
   357     gint64 total_read = 0;
   358     GByteArray *myth_buffer = g_byte_array_new ();
   359 
   360     _GNOME_VFS_METHOD_PARAM_CHECK (method_handle != NULL);
   361 
   362     
   363     myth_handle = (MythtvHandle *) method_handle;
   364     result = GNOME_VFS_OK;
   365 
   366     total_read = gmyth_file_transfer_read (myth_handle->file_transfer,
   367                               		   myth_buffer,
   368                          		   num_bytes, gmyth_uri_is_livetv (myth_handle->gmyth_uri));
   369 
   370 
   371     if (total_read == -1) {
   372         result = GNOME_VFS_ERROR_IO;
   373         total_read = 0;
   374     }
   375 
   376     if (total_read < num_bytes) {
   377         result = GNOME_VFS_ERROR_EOF;
   378     }
   379 
   380     if (total_read > 0) {
   381 	g_memmove (buffer, myth_buffer->data, total_read);
   382         g_byte_array_free (myth_buffer, TRUE);
   383         myth_handle->offset += total_read;
   384     } 
   385 
   386     *bytes_read = (GnomeVFSFileSize) total_read;
   387 
   388 	return result;
   389 }
   390 
   391 static GnomeVFSResult
   392 do_write (GnomeVFSMethod 	*method,
   393 	  GnomeVFSMethodHandle  *method_handle,
   394 	  gconstpointer 	 buffer,
   395 	  GnomeVFSFileSize 	 num_bytes,
   396 	  GnomeVFSFileSize 	*bytes_written,
   397 	  GnomeVFSContext 	*context)
   398 {
   399     return GNOME_VFS_ERROR_NOT_SUPPORTED;
   400 }
   401 
   402 static GnomeVFSResult
   403 do_seek (GnomeVFSMethod	      *method,
   404 	 GnomeVFSMethodHandle *method_handle,
   405 	 GnomeVFSSeekPosition  whence,
   406 	 GnomeVFSFileOffset    offset,
   407 	 GnomeVFSContext      *context)
   408 {
   409 	MythtvHandle *myth_handle;
   410     //guint64 whence_p = 0;
   411     //gint64 new_offset =0;
   412 
   413      _GNOME_VFS_METHOD_PARAM_CHECK (method_handle != NULL);
   414 
   415      myth_handle = (MythtvHandle *) method_handle;    
   416     
   417     g_debug ("seek offset%"G_GINT64_FORMAT" whence %d", offset, whence);
   418 
   419     return GNOME_VFS_ERROR_NOT_SUPPORTED;
   420     /*
   421     if (gmyth_uri_is_livetv (myth_handle->gmyth_uri))
   422     
   423     switch (whence)
   424     {
   425         case GNOME_VFS_SEEK_START:
   426             whence_p = 0;
   427             break;
   428         case GNOME_VFS_SEEK_CURRENT:
   429             whence_p = myth_handle->offset;
   430             break;
   431         case GNOME_VFS_SEEK_END:
   432             return GNOME_VFS_ERROR_NOT_SUPPORTED;
   433     }
   434     
   435     new_offset = gmyth_file_transfer_seek (myth_handle->file_transfer, offset, whence_p);
   436     if (new_offset != 0) {
   437         myth_handle->offset = new_offset;
   438         return GNOME_VFS_OK;
   439     }
   440 
   441     return GNOME_VFS_ERROR_NOT_SUPPORTED;
   442     */
   443 }
   444 
   445 static GnomeVFSResult
   446 do_tell (GnomeVFSMethod       *method,
   447 	 GnomeVFSMethodHandle *method_handle,
   448 	 GnomeVFSFileSize   *offset_return)
   449 {
   450 	MythtvHandle *myth_handle = NULL;
   451     
   452      _GNOME_VFS_METHOD_PARAM_CHECK (method_handle != NULL);
   453      
   454     myth_handle = (MythtvHandle *) method_handle;
   455     *offset_return = myth_handle->offset;
   456 
   457     return GNOME_VFS_OK;
   458 }
   459 
   460 static GnomeVFSResult
   461 do_truncate_handle (GnomeVFSMethod *method,
   462 		    GnomeVFSMethodHandle *method_handle,
   463 		    GnomeVFSFileSize where,
   464 		    GnomeVFSContext *context)
   465 {
   466     return GNOME_VFS_ERROR_READ_ONLY;
   467 }
   468 
   469 static GnomeVFSResult
   470 do_open_directory (GnomeVFSMethod 	    *method,
   471 		   GnomeVFSMethodHandle    **method_handle,
   472 		   GnomeVFSURI 		    *uri,
   473 		   GnomeVFSFileInfoOptions   options,
   474 		   GnomeVFSContext 	    *context) 
   475 {
   476     return GNOME_VFS_ERROR_NOT_SUPPORTED;
   477 }
   478 
   479 static GnomeVFSResult
   480 do_close_directory (GnomeVFSMethod 	 *method,
   481 		    GnomeVFSMethodHandle *method_handle,
   482 		    GnomeVFSContext 	 *context) 
   483 {
   484     return GNOME_VFS_ERROR_NOT_SUPPORTED;
   485 }
   486 
   487 static GnomeVFSResult
   488 do_read_directory (GnomeVFSMethod 	*method,
   489        		   GnomeVFSMethodHandle *method_handle,
   490        		   GnomeVFSFileInfo 	*file_info,
   491 		   GnomeVFSContext 	*context)
   492 {
   493     return GNOME_VFS_ERROR_NOT_SUPPORTED;
   494 }
   495 
   496 
   497 static GnomeVFSResult
   498 do_get_file_info (GnomeVFSMethod * method,
   499 		  GnomeVFSURI * uri,
   500 		  GnomeVFSFileInfo * file_info,
   501 		  GnomeVFSFileInfoOptions options,
   502 		  GnomeVFSContext * context)
   503 {
   504     return myth_get_file_info (NULL, uri, file_info);
   505 }
   506 
   507 static GnomeVFSResult
   508 do_get_file_info_from_handle (GnomeVFSMethod 		*method,
   509             			      GnomeVFSMethodHandle 	*method_handle,
   510 			                  GnomeVFSFileInfo 		*file_info,
   511             			      GnomeVFSFileInfoOptions    options,
   512 			                  GnomeVFSContext 		*context)
   513 {
   514 	MythtvHandle *myth_handle = (MythtvHandle *) method_handle;
   515 
   516     return myth_get_file_info (myth_handle, NULL, file_info);
   517 }
   518 
   519 static gboolean
   520 do_is_local (GnomeVFSMethod * method, const GnomeVFSURI * uri)
   521 {
   522 	return FALSE;
   523 }
   524 
   525 static GnomeVFSResult
   526 do_make_directory (GnomeVFSMethod  *method, 
   527 		            GnomeVFSURI     *uri,
   528                     guint 	    perm, 
   529 		            GnomeVFSContext *context) 
   530 {
   531     return GNOME_VFS_ERROR_READ_ONLY;
   532 }
   533 
   534 static GnomeVFSResult 
   535 do_remove_directory (GnomeVFSMethod  *method, 
   536 		             GnomeVFSURI     *uri, 
   537 		             GnomeVFSContext *context) 
   538 {
   539     return GNOME_VFS_ERROR_READ_ONLY;
   540 }
   541 
   542 static GnomeVFSResult
   543 do_move (GnomeVFSMethod  *method,
   544 	 GnomeVFSURI 	 *old_uri,
   545 	 GnomeVFSURI 	 *new_uri,
   546 	 gboolean         force_replace,
   547 	 GnomeVFSContext *context)
   548 {
   549     return GNOME_VFS_ERROR_READ_ONLY;
   550 }
   551 
   552 static GnomeVFSResult 
   553 do_unlink (GnomeVFSMethod  *method,
   554 	   GnomeVFSURI 	   *uri,
   555 	   GnomeVFSContext *context)
   556 {
   557     return GNOME_VFS_ERROR_READ_ONLY;
   558 }
   559 
   560 static GnomeVFSResult 
   561 do_check_same_fs (GnomeVFSMethod  *method,
   562 		  GnomeVFSURI 	  *a,
   563 		  GnomeVFSURI 	  *b,
   564 		  gboolean 	  *same_fs_return,
   565 		  GnomeVFSContext *context)
   566 {
   567     return GNOME_VFS_ERROR_NOT_SUPPORTED;
   568 }
   569 
   570 static GnomeVFSResult
   571 do_set_file_info (GnomeVFSMethod 		*method,
   572 		  GnomeVFSURI 			*uri,
   573 		  const GnomeVFSFileInfo 	*info,
   574 		  GnomeVFSSetFileInfoMask 	 mask,
   575 		  GnomeVFSContext 		*context)
   576 {
   577     return GNOME_VFS_ERROR_READ_ONLY;
   578 }
   579 
   580 static GnomeVFSResult
   581 do_truncate (GnomeVFSMethod *method,
   582 	     GnomeVFSURI *uri,
   583 	     GnomeVFSFileSize where,
   584 	     GnomeVFSContext *context)
   585 {
   586     return GNOME_VFS_ERROR_READ_ONLY;
   587 }
   588 
   589 static GnomeVFSResult
   590 do_find_directory (GnomeVFSMethod *method,
   591 		   GnomeVFSURI *near_uri,
   592 		   GnomeVFSFindDirectoryKind kind,
   593 		   GnomeVFSURI **result_uri,
   594 		   gboolean create_if_needed,
   595 		   gboolean find_if_needed,
   596 		   guint permissions,
   597 		   GnomeVFSContext *context)
   598 {
   599 	return GNOME_VFS_ERROR_NOT_SUPPORTED;
   600 }
   601 
   602 static GnomeVFSResult
   603 do_create_symbolic_link (GnomeVFSMethod *method,
   604 			 GnomeVFSURI *uri,
   605 			 const char *target_reference,
   606 			 GnomeVFSContext *context)
   607 {
   608     return GNOME_VFS_ERROR_READ_ONLY;
   609 }
   610 
   611 static GnomeVFSResult
   612 do_monitor_add (GnomeVFSMethod *method,
   613 		GnomeVFSMethodHandle **method_handle_return,
   614 		GnomeVFSURI *uri,
   615 		GnomeVFSMonitorType monitor_type)
   616 {
   617 	return GNOME_VFS_ERROR_NOT_SUPPORTED;
   618 }
   619 
   620 static GnomeVFSResult
   621 do_monitor_cancel (GnomeVFSMethod *method,
   622 		   GnomeVFSMethodHandle *method_handle)
   623 {
   624 	return GNOME_VFS_ERROR_NOT_SUPPORTED;
   625 }
   626 
   627 static GnomeVFSResult
   628 do_file_control (GnomeVFSMethod *method,
   629 		 GnomeVFSMethodHandle *method_handle,
   630 		 const char *operation,
   631 		 gpointer operation_data,
   632 		 GnomeVFSContext *context)
   633 {
   634 	return GNOME_VFS_ERROR_NOT_SUPPORTED;
   635 }
   636 
   637 static GnomeVFSMethod method = {
   638 	sizeof (GnomeVFSMethod),
   639 	do_open, 
   640 	do_create,
   641 	do_close,
   642 	do_read, 
   643 	do_write,
   644 	do_seek,
   645 	do_tell,
   646 	do_truncate_handle, 
   647 	do_open_directory,
   648 	do_close_directory,
   649 	do_read_directory,
   650 	do_get_file_info,
   651 	do_get_file_info_from_handle,
   652 	do_is_local, 
   653 	do_make_directory, 
   654 	do_remove_directory,
   655 	do_move,
   656 	do_unlink,
   657 	do_check_same_fs,
   658 	do_set_file_info,
   659 	do_truncate, 
   660 	do_find_directory, 
   661 	do_create_symbolic_link,  
   662 	do_monitor_add,  
   663 	do_monitor_cancel,  
   664 	do_file_control 	
   665 };
   666 
   667 
   668 GnomeVFSMethod *
   669 vfs_module_init (const char *method_name, const char *args)
   670 {
   671 	return &method;
   672 }
   673 
   674 void
   675 vfs_module_shutdown (GnomeVFSMethod * method)
   676 {
   677 }