libgnomevfs2-mythtv/modules/mythtv-method.c
author rosfran
Tue Feb 13 23:15:54 2007 +0000 (2007-02-13)
branchtrunk
changeset 357 194c44ef8da4
parent 355 f7b40eb795c2
child 361 7140b2c2e63c
permissions -rwxr-xr-x
[svn r359] Now it is running; removed some GStaticMutex race conditions.
     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 <math.h>
    26 
    27 #include <libgnomevfs/gnome-vfs-module.h>
    28 #include <libgnomevfs/gnome-vfs-utils.h>
    29 
    30 #include <gmyth/gmyth_file_transfer.h>
    31 #include <gmyth/gmyth_livetv.h>
    32 #include <gmyth/gmyth_uri.h>
    33 #include <gmyth/gmyth_recorder.h>
    34 #include <gmyth/gmyth_backendinfo.h>
    35 #include <gmyth/gmyth_util.h>
    36 #include <gmyth/gmyth_remote_util.h>
    37 #include <gmyth/gmyth_tvchain.h>
    38 #include <gmyth/gmyth_programinfo.h>
    39 
    40 #define GST_MYTHTV_ID_NUM               1
    41 #define MYTHTV_VERSION_DEFAULT          30
    42 #define MYTHTV_TRANSFER_MAX_WAITS       100
    43 
    44 #define MYTHTV_BUFFER_SIZE							1024*140
    45 #define MYTHTV_MAX_VFS_BUFFER_SIZE			4096
    46 #define MYTHTV_MAX_REQUEST_SIZE					1024*64
    47 
    48 static GnomeVFSResult do_read (GnomeVFSMethod *method,
    49                                GnomeVFSMethodHandle *method_handle,
    50                                gpointer buffer,
    51                                GnomeVFSFileSize num_bytes,
    52                                GnomeVFSFileSize *bytes_read,
    53                                GnomeVFSContext *context);
    54 
    55 typedef struct {
    56     GMythFileTransfer *file_transfer;
    57     GMythLiveTV 			*livetv;
    58     gchar 						*channel_name;
    59     
    60     gint mythtv_version;
    61     gint64 content_size;
    62     guint64 bytes_read;
    63 
    64     GByteArray *buffer;
    65     gsize buffer_remain;
    66     gboolean	is_livetv;
    67     
    68     gboolean configured;
    69     
    70 } MythtvHandle;
    71 
    72 //static MythtvHandle *myth_handle = NULL;
    73 
    74 static GnomeVFSResult
    75 do_open (GnomeVFSMethod *method,
    76          GnomeVFSMethodHandle **method_handle,
    77          GnomeVFSURI *uri,
    78          GnomeVFSOpenMode mode,
    79          GnomeVFSContext *context)
    80 { 
    81 		MythtvHandle *myth_handle = NULL;   
    82     GMythBackendInfo *backend_info = NULL;
    83     GMythURI *gmyth_uri = NULL;
    84     gboolean ret = TRUE;
    85 
    86     _GNOME_VFS_METHOD_PARAM_CHECK (method_handle != NULL);
    87     _GNOME_VFS_METHOD_PARAM_CHECK (uri != NULL);
    88 
    89     if (mode & GNOME_VFS_OPEN_WRITE) {
    90         return GNOME_VFS_ERROR_NOT_PERMITTED;
    91     }
    92 
    93     if (gnome_vfs_uri_get_host_name (uri) == NULL) {
    94     	return GNOME_VFS_ERROR_INVALID_HOST_NAME;
    95     }
    96     
    97     /*
    98     if ( method_handle != NULL && *method_handle != NULL )
    99     {
   100     	myth_handle = (MythtvHandle*)*method_handle;
   101     	//if ( !myth_handle->configured )    	
   102     }
   103     */
   104     
   105     if ( ( NULL == myth_handle ) || !myth_handle->configured ) {
   106     	myth_handle = g_new0 (MythtvHandle, 1);
   107     	
   108     	myth_handle->configured = FALSE;
   109 	    
   110 	    myth_handle->is_livetv = FALSE;
   111 	    
   112 	    /* Initialize mythtv handler*/
   113 	    myth_handle->file_transfer = NULL;
   114 	    myth_handle->livetv = NULL;
   115 	    myth_handle->mythtv_version = MYTHTV_VERSION_DEFAULT;
   116 	    myth_handle->bytes_read = 0;
   117 	    myth_handle->content_size = (GnomeVFSFileSize) - 1;
   118 	
   119 	    /* Creates and fills out the backend info structure */    
   120 		  backend_info = gmyth_backend_info_new_with_uri ( 
   121 		  			gnome_vfs_unescape_string( gnome_vfs_uri_to_string( uri, GNOME_VFS_URI_HIDE_NONE ), "" ) );
   122 		  
   123 		  /* creates an instance of  */  
   124 		  gmyth_uri = gmyth_uri_new_with_value( 
   125 		  		gnome_vfs_unescape_string( gnome_vfs_uri_to_string( uri, GNOME_VFS_URI_HIDE_NONE ), "" ) );
   126 	
   127 		  myth_handle->is_livetv = gmyth_uri_is_livetv( gmyth_uri );
   128 	
   129 		  /* Connect to the backend */	  
   130 		  if ( gmyth_uri != NULL && myth_handle->is_livetv == TRUE ) {
   131 		  	
   132 		  	if ( NULL == myth_handle->livetv )
   133 		  	{
   134 		    	myth_handle->livetv = gmyth_livetv_new ();
   135 		    
   136 			    myth_handle->channel_name = gmyth_uri_get_channel_name( gmyth_uri );
   137 			    
   138 			    g_debug( "[%s] Channel name = %s\n", __FUNCTION__, myth_handle->channel_name );
   139 			
   140 			    if ( myth_handle->channel_name != NULL ) {
   141 			      if (gmyth_livetv_channel_name_setup (myth_handle->livetv, myth_handle->channel_name,
   142 			              backend_info) == FALSE) {
   143 			        g_object_unref( gmyth_uri );
   144 			        ret = FALSE;
   145 			      }
   146 			    } else {
   147 			      if ( gmyth_livetv_setup (myth_handle->livetv, backend_info) == FALSE ) {
   148 			      	g_object_unref( gmyth_uri );
   149 			        ret = FALSE;
   150 			      }
   151 			    }
   152 		  	}
   153 		  	
   154 		  	if ( NULL == myth_handle->file_transfer )	{
   155 		    	myth_handle->file_transfer = gmyth_livetv_create_file_transfer (myth_handle->livetv);
   156 		
   157 			    if (NULL == myth_handle->file_transfer) {
   158 			      ret = FALSE;
   159 				    g_debug ("MythTV FileTransfer is NULL!\n");
   160 				    return GNOME_VFS_ERROR_NOT_OPEN;
   161 			    }
   162 			    
   163 		  		if ( !gmyth_file_transfer_open( myth_handle->file_transfer, myth_handle->livetv->uri != NULL ? 
   164 										gmyth_uri_get_path(myth_handle->livetv->uri) : 
   165 										myth_handle->livetv->proginfo->pathname->str ) )
   166 					{
   167 						g_debug ("Couldn't open MythTV FileTransfer is NULL!\n");
   168 						g_object_unref( myth_handle->file_transfer );
   169 						myth_handle->file_transfer = NULL;
   170 						ret = FALSE;
   171 					}
   172 		  	} /* if - FileTransfer is NULL, or not */
   173 		    
   174 		  } else {
   175 		  	
   176 		  	if (NULL == myth_handle->file_transfer ) {
   177 		
   178 			    myth_handle->file_transfer = gmyth_file_transfer_new (backend_info);
   179 			    
   180 			    /* Verifies if the file exists */
   181 			    if (!gmyth_util_file_exists (backend_info, gmyth_uri_get_path (gmyth_uri))) {
   182 			        g_object_unref (backend_info);
   183 							ret = FALSE;
   184 			    }
   185 			    
   186 			    /* sets the Playback monitor connection */
   187 			    ret = gmyth_file_transfer_open ( myth_handle->file_transfer, 
   188 			    		gmyth_uri_get_path (gmyth_uri) );
   189 			    		
   190 		  	}
   191 			
   192 		  } /* if - LiveTV or not? */
   193 		  
   194 	    if (ret == FALSE) {
   195 		    g_debug ("MythTV FileTransfer open error.\n");
   196 		    return GNOME_VFS_ERROR_NOT_OPEN;
   197 		  }
   198 		  
   199 		  myth_handle->configured = TRUE;
   200 	
   201 	    g_object_unref (backend_info);
   202 	    
   203 		  if ( gmyth_uri != NULL )
   204 		  	g_object_unref( gmyth_uri );
   205 		  
   206 	    myth_handle->buffer = g_byte_array_sized_new (MYTHTV_BUFFER_SIZE);
   207 	    myth_handle->buffer_remain = 0;
   208 	    
   209 		  g_return_val_if_fail (myth_handle->file_transfer != NULL, GNOME_VFS_ERROR_NOT_OPEN);
   210 		  
   211 		  if ( /*myth_handle->file_transfer->filesize <= 0 && */myth_handle->is_livetv ) {
   212 		  	myth_handle->content_size = gmyth_recorder_get_file_position(myth_handle->livetv->recorder);
   213 		  } else {
   214 	    	myth_handle->content_size = myth_handle->file_transfer->filesize;
   215 		  }
   216 		  
   217     } /* if - configured or not? */
   218 	  
   219     *method_handle = (GnomeVFSMethodHandle *) myth_handle;
   220 
   221     return GNOME_VFS_OK;
   222 }
   223 
   224 static GnomeVFSResult
   225 do_read (GnomeVFSMethod *method,
   226          GnomeVFSMethodHandle *method_handle,
   227          gpointer buffer,
   228          GnomeVFSFileSize num_bytes,
   229          GnomeVFSFileSize *bytes_read,
   230          GnomeVFSContext *context)
   231 {
   232   MythtvHandle *myth_handle = (MythtvHandle *) method_handle;
   233   GnomeVFSFileSize bytes_to_read = num_bytes;
   234   gint64 size_stream = *bytes_read;
   235 
   236   //*bytes_read = 0;
   237   
   238   g_debug ("XXXXXXXXXX Requested %llu bytes (remains %d bytes on buffer...) file_size = %lld\n", 
   239   		(guint64)num_bytes, myth_handle->buffer->len, *bytes_read );
   240 
   241   if ( !myth_handle->is_livetv && ( myth_handle->bytes_read >= myth_handle->content_size ) )
   242       return GNOME_VFS_ERROR_EOF;
   243 
   244   // fixme: change this to min math function
   245   if (( myth_handle->content_size > 0 ) ) 
   246   {
   247   	if ( !myth_handle->is_livetv && 
   248   				( num_bytes > ( myth_handle->content_size - myth_handle->bytes_read ) ) )
   249   	{
   250     	bytes_to_read = myth_handle->content_size - myth_handle->bytes_read;
   251   	} else {
   252     	size_stream = gmyth_recorder_get_file_position(myth_handle->livetv->recorder);
   253     	if ( size_stream > myth_handle->content_size ) {
   254     		g_debug( "New file size %lld, old size = %lld.", size_stream, myth_handle->content_size );    		
   255     		myth_handle->content_size = size_stream;
   256     		num_bytes = ( myth_handle->content_size - myth_handle->bytes_read );
   257     	} else if ( num_bytes > ( myth_handle->content_size - myth_handle->bytes_read ) )
   258     		num_bytes = MYTHTV_MAX_VFS_BUFFER_SIZE;
   259     }
   260   }
   261 
   262   /* Loop sending the Myth File Transfer request:
   263    * Retry whilst authentication fails and we supply it. */
   264   /* if (myth_handle->buffer_remain  < MYTHTV_BUFFER_SIZE) { */
   265   if ( ( myth_handle->buffer_remain = myth_handle->buffer->len ) < bytes_to_read ) 
   266   {
   267   	gint buffer_size;
   268   	
   269   	//while ( MYTHTV_BUFFER_SIZE != myth_handle->buffer_remain ) {
   270   		
   271 	  	/* resize buffer length request to no more than MYTHTV_MAX_REQUEST_SIZE */
   272 	  	if ( ( MYTHTV_BUFFER_SIZE - myth_handle->buffer_remain ) <= MYTHTV_MAX_REQUEST_SIZE )
   273 	  		buffer_size = MYTHTV_BUFFER_SIZE - myth_handle->buffer_remain;
   274 	  	else
   275 	  		buffer_size = MYTHTV_MAX_REQUEST_SIZE;
   276 	
   277 	  	GByteArray *tmp_buffer = g_byte_array_new();
   278 	
   279 			g_debug ("XXXXXXXXXX Asking %d bytes (there is %d bytes in the buffer)\n", 
   280 					buffer_size, myth_handle->buffer_remain);
   281 	
   282 	    gint len = gmyth_file_transfer_read (myth_handle->file_transfer,
   283 	          tmp_buffer, buffer_size, TRUE);
   284 	
   285 			if (!myth_handle->is_livetv && len < 0) {
   286 		    g_byte_array_free (tmp_buffer, TRUE);
   287 		    g_debug ("Fail to read bytes");
   288 		    return GNOME_VFS_ERROR_IO;
   289 		  } /*else if (len == 0) {
   290 			    g_byte_array_free (tmp_buffer, TRUE);
   291 			    g_warning ("End of file probably achieved");
   292 			    return GNOME_VFS_ERROR_EOF;
   293 			}*/
   294 	
   295 	    myth_handle->buffer = g_byte_array_append ( myth_handle->buffer,
   296 	    		tmp_buffer->data, len );
   297 	
   298 			myth_handle->buffer_remain += len;
   299 
   300 			if ( tmp_buffer != NULL )
   301 			{
   302 	      g_byte_array_free ( tmp_buffer, TRUE );
   303 	    	tmp_buffer = NULL;
   304 			}
   305   	//} /* while - iterates until fills the internal buffer */
   306   	
   307   } /* if - got from the network, or not */
   308   
   309   bytes_to_read = ( bytes_to_read > myth_handle->buffer_remain ) ? myth_handle->buffer_remain : bytes_to_read;
   310   /* gets the first buffer_size bytes from the byte array buffer variable */ 
   311 
   312   g_memmove (buffer, myth_handle->buffer->data, bytes_to_read);
   313 
   314   myth_handle->bytes_read += bytes_to_read;
   315   myth_handle->buffer_remain -= bytes_to_read;
   316 
   317 	/* flushs the newly buffer got from byte array */
   318 	myth_handle->buffer = g_byte_array_remove_range (myth_handle->buffer, 0, bytes_to_read);
   319 	g_debug ("Got from %llu bytes from internal buffer. (there are %d bytes in the buffer, from a total of %llu dispatched.)\n", 
   320 				bytes_to_read, myth_handle->buffer_remain, myth_handle->bytes_read );
   321 	
   322  	*bytes_read = bytes_to_read;
   323 
   324   return GNOME_VFS_OK;
   325 }
   326 
   327 static GnomeVFSResult
   328 do_close (GnomeVFSMethod *method,
   329           GnomeVFSMethodHandle *method_handle,
   330           GnomeVFSContext *context)
   331 {
   332 
   333   MythtvHandle *myth_handle = (MythtvHandle *) method_handle;
   334   
   335   //if ( NULL == myth_handle || myth_handle->configured ) {
   336 	
   337 	  if (myth_handle->file_transfer != NULL) {
   338 	    g_object_unref (myth_handle->file_transfer);
   339 	  	myth_handle->file_transfer = NULL;
   340 	  }
   341 	  
   342 	  if (myth_handle->is_livetv && myth_handle->livetv != NULL) {
   343 	    g_object_unref (myth_handle->livetv);
   344 	  	myth_handle->livetv = NULL;
   345 	  }
   346 	  
   347 	  if (myth_handle->buffer) {
   348 			g_byte_array_free (myth_handle->buffer, TRUE);
   349 			myth_handle->buffer = NULL;
   350 	  }
   351 	
   352 	  myth_handle->configured = FALSE;
   353 	
   354 	  g_free (myth_handle);
   355 	  
   356 	  myth_handle = NULL;	    
   357 	  
   358  // }
   359     
   360   return GNOME_VFS_OK;
   361 }
   362 
   363 static GnomeVFSResult
   364 do_get_file_info (GnomeVFSMethod *method,
   365                   GnomeVFSURI *uri,
   366                   GnomeVFSFileInfo *file_info,
   367                   GnomeVFSFileInfoOptions options,
   368                   GnomeVFSContext *context)
   369 {
   370     GMythFileTransfer *file_transfer = NULL;
   371     GMythRecorder			*recorder 		 = NULL;
   372     GMythTVChain			*tvchain	 		 = NULL;
   373     GMythBackendInfo  *backend_info  = NULL;
   374     GMythURI					*gmyth_uri		 = NULL;
   375 		GMythSocket 			*socket 			 = NULL;		 
   376     gboolean 					is_livetv 		 = FALSE;
   377     gboolean					ret						 = TRUE;
   378     gboolean 					res 					 = TRUE;
   379     
   380     /* Creates and fills out the backend info structure */    
   381 	  backend_info = gmyth_backend_info_new_with_uri ( 
   382 	  			gnome_vfs_unescape_string( gnome_vfs_uri_to_string( uri, GNOME_VFS_URI_HIDE_NONE ), "" ) );
   383 	  
   384 	  /* creates an instance of */  
   385 	  gmyth_uri = gmyth_uri_new_with_value( 
   386 	  		gnome_vfs_unescape_string( gnome_vfs_uri_to_string( uri, GNOME_VFS_URI_HIDE_NONE ), "" ) );
   387 
   388 	  is_livetv = gmyth_uri_is_livetv( gmyth_uri );
   389 
   390     file_info->valid_fields = file_info->valid_fields
   391         | GNOME_VFS_FILE_INFO_FIELDS_TYPE
   392         | GNOME_VFS_FILE_INFO_FIELDS_MIME_TYPE
   393         | GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS;
   394     file_info->type = GNOME_VFS_FILE_TYPE_REGULAR;
   395     /* fixme: get from file extension? */
   396     file_info->mime_type = g_strdup ("video/x-nuv");
   397     file_info->permissions =
   398         GNOME_VFS_PERM_USER_READ |
   399         GNOME_VFS_PERM_OTHER_READ |
   400         GNOME_VFS_PERM_GROUP_READ;
   401         
   402     g_print( "gnome_vfs_uri == %s | gmyth_uri == %s.\n",
   403     				gnome_vfs_uri_get_path (uri),
   404     				gmyth_uri_get_path (gmyth_uri) );
   405 
   406 	  /* Connect to the backend */
   407 	  if ( gmyth_uri != NULL && is_livetv == TRUE ) {
   408 	  	
   409 	  	/* start to get file info from LiveTV remote encoder */	  	
   410 			socket = gmyth_socket_new ();
   411 			
   412 			/* FIME: Implement this at gmyth_socket */
   413 			res = gmyth_socket_connect_to_backend (socket, backend_info->hostname,
   414 					backend_info->port, TRUE);
   415 			if (!res) {
   416 				g_print ("[%s] LiveTV can not connect to backend", __FUNCTION__);	
   417 				res = FALSE;
   418 				goto error;
   419 			}
   420 
   421 			if ( gmyth_remote_util_get_free_recorder_count (socket) <= 0 ) {
   422 				g_print ("No free remote encoder available.");
   423 				res = FALSE;
   424 				goto error;
   425 			}
   426 		
   427 			/* Gets the recorder num */
   428 			recorder = remote_request_next_free_recorder (socket, -1);
   429 			
   430 			//if ( socket != NULL )
   431 			//	g_object_unref (socket);
   432 		
   433 			if ( recorder == NULL ) {
   434 				g_print ("[%s] None remote encoder available", __FUNCTION__);
   435 				res = FALSE;
   436 				goto error;
   437 			}
   438 			
   439 			/* Init remote encoder. Opens its control socket. */
   440 			res = gmyth_recorder_setup(recorder);
   441 			if ( !res ) {
   442 				g_print ("[%s] Fail while setting remote encoder\n", __FUNCTION__);
   443 				res = FALSE;
   444 				goto error;
   445 			}
   446 			
   447 			/* Creates livetv chain handler */
   448 			tvchain = gmyth_tvchain_new();
   449 			gmyth_tvchain_initialize ( tvchain, backend_info );
   450 		
   451 			if ( tvchain == NULL || tvchain->tvchain_id == NULL ) {
   452 				res = FALSE;
   453 				goto error;
   454 			}
   455 			
   456 			// Spawn live tv. Uses the socket to send mythprotocol data to start livetv in the backend (remotelly)
   457 			res = gmyth_recorder_spawntv ( recorder,
   458 					gmyth_tvchain_get_id(tvchain) );
   459 			if (!res) {
   460 				g_warning ("[%s] Fail while spawn tv\n", __FUNCTION__);
   461 				res = FALSE;
   462 				goto error;
   463 			}	
   464 			
   465 		  //gchar* channel_name = gmyth_uri_get_channel_name( gmyth_uri );		  
   466 	
   467 		  /* DEBUG message */
   468 			GMythProgramInfo* prog_info = gmyth_recorder_get_current_program_info( recorder );
   469 			
   470 			if ( prog_info != NULL )
   471 			{
   472 				//gmyth_program_info_print( prog_info );
   473 				g_debug( "Program Info: %s\n", gmyth_program_info_to_string( prog_info ) ); 
   474   
   475 		    g_print( "path = %s",  prog_info->pathname->str );
   476 		    
   477 		    file_info->name = g_strdup ( g_strrstr( prog_info->pathname->str, "/" ) );
   478 		    
   479 			} else {
   480 				file_info->name = g_strdup ( "LiveTV.nuv" );
   481 				file_info->size = gmyth_recorder_get_file_position( recorder );
   482 			}
   483 			
   484 	    if ( recorder != NULL )
   485 	    	g_object_unref (recorder);
   486 	    
   487 	    if ( prog_info != NULL )
   488 	    	g_object_unref( prog_info );
   489 
   490 	    if ( tvchain != NULL )
   491 	    	g_object_unref (tvchain);
   492 	    
   493 	    file_info->size = (GnomeVFSFileSize) - 1;
   494 
   495 	  } else {
   496 	  	
   497 	  	/* start to get file info from remote file encoder */	
   498 	    file_transfer = gmyth_file_transfer_new (backend_info);
   499 	    
   500 	    /* Verifies if the file exists */
   501 	    if (!gmyth_util_file_exists (backend_info, gmyth_uri_get_path (gmyth_uri))) {
   502 	        g_object_unref (backend_info);
   503 					return GNOME_VFS_ERROR_NOT_FOUND;
   504 	    }
   505 	    
   506 	    /* sets the Playback monitor connection */
   507 	    ret = gmyth_file_transfer_open ( file_transfer, gmyth_uri_get_path (gmyth_uri) );
   508 	    
   509 	    file_info->name = g_strdup ( gnome_vfs_uri_get_path (uri) );
   510 		
   511 	  } /* if - LiveTV or not? */	  
   512 	  
   513     if (ret == FALSE) {
   514 	    g_debug ("MythTV FileTransfer open error\n");
   515 	    return GNOME_VFS_ERROR_NOT_OPEN;
   516 	  }
   517 	  
   518 		if ( ret == TRUE  && file_transfer != NULL ) {
   519     	file_info->size = gmyth_file_transfer_get_filesize (file_transfer);
   520 	    if ( file_transfer )
   521 	    	g_object_unref (file_transfer);
   522    	}
   523 
   524     file_info->block_count = GNOME_VFS_FILE_INFO_FIELDS_BLOCK_COUNT;
   525 	  file_info->io_block_size = GNOME_VFS_FILE_INFO_FIELDS_IO_BLOCK_SIZE;
   526 	  
   527 error:
   528     if (backend_info)
   529    		g_object_unref (backend_info);
   530    		
   531    	if (!res)
   532    		return GNOME_VFS_ERROR_IO;
   533 
   534     return GNOME_VFS_OK;
   535 }
   536 
   537 static gboolean
   538 do_is_local (GnomeVFSMethod *method,
   539              const GnomeVFSURI *uri)
   540 {
   541 	return FALSE;
   542 }
   543 
   544 static GnomeVFSMethod method = {
   545 	sizeof (GnomeVFSMethod),
   546 	do_open,
   547 	NULL,
   548 	do_close,
   549 	do_read,
   550 	NULL,
   551 	NULL,
   552 	NULL,
   553 	NULL,
   554 	NULL,
   555 	NULL,
   556 	NULL,
   557 	do_get_file_info,
   558 	NULL,
   559 	do_is_local,
   560 	NULL,
   561 	NULL,
   562 	NULL,
   563 	NULL,
   564 	NULL,
   565 	NULL,
   566 	NULL,
   567 	NULL,
   568 	NULL,
   569 	NULL,
   570 	NULL,
   571 	NULL,
   572 };
   573 
   574 
   575 GnomeVFSMethod *
   576 vfs_module_init (const char *method_name, const char *args)
   577 {
   578 	return &method;
   579 }
   580 
   581 void
   582 vfs_module_shutdown (GnomeVFSMethod *method)
   583 {
   584 }