melunko@38: /* melunko@38: * @author Hallyson Melo melunko@38: * melunko@38: * This program is free software; you can redistribute it and/or modify melunko@38: * it under the terms of the GNU Lesser General Public License as published by melunko@38: * the Free Software Foundation; either version 2 of the License, or melunko@38: * (at your option) any later version. melunko@38: * melunko@38: * This program is distributed in the hope that it will be useful, melunko@38: * but WITHOUT ANY WARRANTY; without even the implied warranty of melunko@38: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the melunko@38: * GNU General Public License for more details. melunko@38: * melunko@38: * You should have received a copy of the GNU Lesser General Public License melunko@38: * along with this program; if not, write to the Free Software melunko@38: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA melunko@38: */ melunko@38: melunko@38: #ifdef HAVE_CONFIG_H melunko@38: #include melunko@38: #endif melunko@38: melunko@38: #include melunko@38: #include melunko@38: #include melunko@38: melunko@38: #include melunko@38: #include melunko@38: rosfran@277: #include rosfran@277: #include rosfran@277: #include rosfran@277: #include rosfran@277: #include rosfran@277: #include rosfran@332: #include rosfran@332: #include rosfran@357: #include melunko@38: melunko@38: #define GST_MYTHTV_ID_NUM 1 melunko@38: #define MYTHTV_VERSION_DEFAULT 30 rosfran@277: #define MYTHTV_TRANSFER_MAX_WAITS 100 melunko@38: rosfran@361: /* internal GnomeVFS plug-in buffer size ( 120 Kbytes ) */ rosfran@363: #define MYTHTV_BUFFER_SIZE 1024*80 rosfran@361: /* internally sized GnomeVFS plug-in buffer ( 4 Kbytes ) */ rosfran@354: #define MYTHTV_MAX_VFS_BUFFER_SIZE 4096 rosfran@361: /* maximum number of bytes to be requested to the MythTV backend ( 64 Kbytes ) */ rosfran@354: #define MYTHTV_MAX_REQUEST_SIZE 1024*64 melunko@111: melunko@38: static GnomeVFSResult do_read (GnomeVFSMethod *method, melunko@38: GnomeVFSMethodHandle *method_handle, melunko@38: gpointer buffer, melunko@38: GnomeVFSFileSize num_bytes, melunko@38: GnomeVFSFileSize *bytes_read, melunko@38: GnomeVFSContext *context); melunko@38: melunko@38: typedef struct { melunko@48: GMythFileTransfer *file_transfer; rosfran@277: GMythLiveTV *livetv; rosfran@327: gchar *channel_name; melunko@38: melunko@38: gint mythtv_version; rosfran@297: gint64 content_size; melunko@38: guint64 bytes_read; melunko@111: rosfran@116: GByteArray *buffer; melunko@111: gsize buffer_remain; rosfran@338: gboolean is_livetv; rosfran@338: rosfran@357: gboolean configured; rosfran@357: melunko@38: } MythtvHandle; melunko@38: rosfran@357: //static MythtvHandle *myth_handle = NULL; rosfran@357: melunko@38: static GnomeVFSResult melunko@38: do_open (GnomeVFSMethod *method, melunko@38: GnomeVFSMethodHandle **method_handle, melunko@38: GnomeVFSURI *uri, melunko@38: GnomeVFSOpenMode mode, melunko@38: GnomeVFSContext *context) rosfran@357: { rosfran@357: MythtvHandle *myth_handle = NULL; rosfran@357: GMythBackendInfo *backend_info = NULL; rosfran@277: GMythURI *gmyth_uri = NULL; rosfran@277: gboolean ret = TRUE; melunko@38: melunko@38: _GNOME_VFS_METHOD_PARAM_CHECK (method_handle != NULL); melunko@38: _GNOME_VFS_METHOD_PARAM_CHECK (uri != NULL); melunko@38: melunko@38: if (mode & GNOME_VFS_OPEN_WRITE) { melunko@38: return GNOME_VFS_ERROR_NOT_PERMITTED; melunko@38: } melunko@38: renatofilho@149: if (gnome_vfs_uri_get_host_name (uri) == NULL) { renatofilho@149: return GNOME_VFS_ERROR_INVALID_HOST_NAME; melunko@38: } rosfran@357: rosfran@357: /* rosfran@357: if ( method_handle != NULL && *method_handle != NULL ) rosfran@357: { rosfran@357: myth_handle = (MythtvHandle*)*method_handle; rosfran@357: //if ( !myth_handle->configured ) rosfran@357: } rosfran@357: */ rosfran@357: rosfran@357: if ( ( NULL == myth_handle ) || !myth_handle->configured ) { rosfran@357: myth_handle = g_new0 (MythtvHandle, 1); rosfran@357: rosfran@357: myth_handle->configured = FALSE; rosfran@357: rosfran@357: myth_handle->is_livetv = FALSE; rosfran@357: rosfran@357: /* Initialize mythtv handler*/ rosfran@357: myth_handle->file_transfer = NULL; rosfran@357: myth_handle->livetv = NULL; rosfran@357: myth_handle->mythtv_version = MYTHTV_VERSION_DEFAULT; rosfran@357: myth_handle->bytes_read = 0; rosfran@357: myth_handle->content_size = (GnomeVFSFileSize) - 1; rosfran@357: rosfran@357: /* Creates and fills out the backend info structure */ rosfran@357: backend_info = gmyth_backend_info_new_with_uri ( rosfran@357: gnome_vfs_unescape_string( gnome_vfs_uri_to_string( uri, GNOME_VFS_URI_HIDE_NONE ), "" ) ); rosfran@357: rosfran@357: /* creates an instance of */ rosfran@357: gmyth_uri = gmyth_uri_new_with_value( rosfran@357: gnome_vfs_unescape_string( gnome_vfs_uri_to_string( uri, GNOME_VFS_URI_HIDE_NONE ), "" ) ); rosfran@357: rosfran@357: myth_handle->is_livetv = gmyth_uri_is_livetv( gmyth_uri ); rosfran@357: rosfran@357: /* Connect to the backend */ rosfran@357: if ( gmyth_uri != NULL && myth_handle->is_livetv == TRUE ) { rosfran@357: rosfran@357: if ( NULL == myth_handle->livetv ) rosfran@357: { rosfran@357: myth_handle->livetv = gmyth_livetv_new (); rosfran@357: rosfran@357: myth_handle->channel_name = gmyth_uri_get_channel_name( gmyth_uri ); rosfran@357: rosfran@357: g_debug( "[%s] Channel name = %s\n", __FUNCTION__, myth_handle->channel_name ); rosfran@357: rosfran@357: if ( myth_handle->channel_name != NULL ) { rosfran@357: if (gmyth_livetv_channel_name_setup (myth_handle->livetv, myth_handle->channel_name, rosfran@357: backend_info) == FALSE) { rosfran@357: g_object_unref( gmyth_uri ); rosfran@357: ret = FALSE; rosfran@357: } rosfran@357: } else { rosfran@357: if ( gmyth_livetv_setup (myth_handle->livetv, backend_info) == FALSE ) { rosfran@357: g_object_unref( gmyth_uri ); rosfran@357: ret = FALSE; rosfran@357: } rosfran@357: } rosfran@357: } rosfran@357: rosfran@357: if ( NULL == myth_handle->file_transfer ) { rosfran@357: myth_handle->file_transfer = gmyth_livetv_create_file_transfer (myth_handle->livetv); rosfran@357: rosfran@357: if (NULL == myth_handle->file_transfer) { rosfran@357: ret = FALSE; rosfran@357: g_debug ("MythTV FileTransfer is NULL!\n"); rosfran@357: return GNOME_VFS_ERROR_NOT_OPEN; rosfran@357: } rosfran@357: rosfran@357: if ( !gmyth_file_transfer_open( myth_handle->file_transfer, myth_handle->livetv->uri != NULL ? rosfran@357: gmyth_uri_get_path(myth_handle->livetv->uri) : rosfran@357: myth_handle->livetv->proginfo->pathname->str ) ) rosfran@357: { rosfran@357: g_debug ("Couldn't open MythTV FileTransfer is NULL!\n"); rosfran@357: g_object_unref( myth_handle->file_transfer ); rosfran@357: myth_handle->file_transfer = NULL; rosfran@357: ret = FALSE; rosfran@357: } rosfran@357: } /* if - FileTransfer is NULL, or not */ rosfran@357: rosfran@357: } else { rosfran@357: rosfran@357: if (NULL == myth_handle->file_transfer ) { rosfran@357: rosfran@357: myth_handle->file_transfer = gmyth_file_transfer_new (backend_info); rosfran@357: rosfran@357: /* Verifies if the file exists */ rosfran@357: if (!gmyth_util_file_exists (backend_info, gmyth_uri_get_path (gmyth_uri))) { rosfran@357: g_object_unref (backend_info); rosfran@357: ret = FALSE; rosfran@357: } rosfran@357: rosfran@357: /* sets the Playback monitor connection */ rosfran@357: ret = gmyth_file_transfer_open ( myth_handle->file_transfer, rosfran@357: gmyth_uri_get_path (gmyth_uri) ); rosfran@357: rosfran@357: } rosfran@357: rosfran@357: } /* if - LiveTV or not? */ rosfran@357: rosfran@357: if (ret == FALSE) { rosfran@357: g_debug ("MythTV FileTransfer open error.\n"); rosfran@357: return GNOME_VFS_ERROR_NOT_OPEN; rosfran@357: } rosfran@357: rosfran@357: myth_handle->configured = TRUE; rosfran@357: rosfran@357: g_object_unref (backend_info); rosfran@357: rosfran@357: if ( gmyth_uri != NULL ) rosfran@357: g_object_unref( gmyth_uri ); rosfran@357: rosfran@357: myth_handle->buffer = g_byte_array_sized_new (MYTHTV_BUFFER_SIZE); rosfran@357: myth_handle->buffer_remain = 0; rosfran@357: rosfran@357: g_return_val_if_fail (myth_handle->file_transfer != NULL, GNOME_VFS_ERROR_NOT_OPEN); rosfran@357: rosfran@357: if ( /*myth_handle->file_transfer->filesize <= 0 && */myth_handle->is_livetv ) { rosfran@357: myth_handle->content_size = gmyth_recorder_get_file_position(myth_handle->livetv->recorder); rosfran@357: } else { rosfran@357: myth_handle->content_size = myth_handle->file_transfer->filesize; rosfran@357: } rosfran@357: rosfran@357: } /* if - configured or not? */ rosfran@277: melunko@38: *method_handle = (GnomeVFSMethodHandle *) myth_handle; melunko@38: melunko@38: return GNOME_VFS_OK; melunko@38: } melunko@38: melunko@38: static GnomeVFSResult melunko@38: do_read (GnomeVFSMethod *method, melunko@38: GnomeVFSMethodHandle *method_handle, melunko@38: gpointer buffer, melunko@38: GnomeVFSFileSize num_bytes, melunko@38: GnomeVFSFileSize *bytes_read, melunko@38: GnomeVFSContext *context) melunko@38: { rosfran@327: MythtvHandle *myth_handle = (MythtvHandle *) method_handle; rosfran@357: GnomeVFSFileSize bytes_to_read = num_bytes; melunko@38: rosfran@340: if ( !myth_handle->is_livetv && ( myth_handle->bytes_read >= myth_handle->content_size ) ) rosfran@327: return GNOME_VFS_ERROR_EOF; melunko@38: rosfran@361: /* fixme: change this to min math function */ rosfran@357: if (( myth_handle->content_size > 0 ) ) rosfran@357: { rosfran@357: if ( !myth_handle->is_livetv && rosfran@341: ( num_bytes > ( myth_handle->content_size - myth_handle->bytes_read ) ) ) rosfran@357: { rosfran@357: bytes_to_read = myth_handle->content_size - myth_handle->bytes_read; rosfran@361: } rosfran@357: } melunko@38: rosfran@327: /* Loop sending the Myth File Transfer request: rosfran@355: * Retry whilst authentication fails and we supply it. */ rosfran@357: if ( ( myth_handle->buffer_remain = myth_handle->buffer->len ) < bytes_to_read ) rosfran@355: { rosfran@355: gint buffer_size; rosfran@354: rosfran@361: while ( MYTHTV_BUFFER_SIZE != myth_handle->buffer_remain ) { rosfran@355: rosfran@355: /* resize buffer length request to no more than MYTHTV_MAX_REQUEST_SIZE */ rosfran@355: if ( ( MYTHTV_BUFFER_SIZE - myth_handle->buffer_remain ) <= MYTHTV_MAX_REQUEST_SIZE ) rosfran@355: buffer_size = MYTHTV_BUFFER_SIZE - myth_handle->buffer_remain; rosfran@355: else rosfran@355: buffer_size = MYTHTV_MAX_REQUEST_SIZE; rosfran@355: rosfran@355: GByteArray *tmp_buffer = g_byte_array_new(); rosfran@355: rosfran@355: g_debug ("XXXXXXXXXX Asking %d bytes (there is %d bytes in the buffer)\n", rosfran@355: buffer_size, myth_handle->buffer_remain); rosfran@355: rosfran@355: gint len = gmyth_file_transfer_read (myth_handle->file_transfer, rosfran@355: tmp_buffer, buffer_size, TRUE); rosfran@355: rosfran@355: if (!myth_handle->is_livetv && len < 0) { rosfran@327: g_byte_array_free (tmp_buffer, TRUE); rosfran@355: g_debug ("Fail to read bytes"); rosfran@355: return GNOME_VFS_ERROR_IO; rosfran@355: } /*else if (len == 0) { rosfran@355: g_byte_array_free (tmp_buffer, TRUE); rosfran@355: g_warning ("End of file probably achieved"); rosfran@355: return GNOME_VFS_ERROR_EOF; rosfran@355: }*/ rosfran@327: rosfran@357: myth_handle->buffer = g_byte_array_append ( myth_handle->buffer, rosfran@357: tmp_buffer->data, len ); rosfran@327: rosfran@327: myth_handle->buffer_remain += len; melunko@111: rosfran@354: if ( tmp_buffer != NULL ) rosfran@354: { rosfran@357: g_byte_array_free ( tmp_buffer, TRUE ); rosfran@354: tmp_buffer = NULL; rosfran@354: } rosfran@361: } /* while - iterates until fills the internal buffer */ rosfran@355: rosfran@355: } /* if - got from the network, or not */ rosfran@355: rosfran@357: bytes_to_read = ( bytes_to_read > myth_handle->buffer_remain ) ? myth_handle->buffer_remain : bytes_to_read; rosfran@355: /* gets the first buffer_size bytes from the byte array buffer variable */ rosfran@116: rosfran@355: g_memmove (buffer, myth_handle->buffer->data, bytes_to_read); rosfran@116: rosfran@355: myth_handle->bytes_read += bytes_to_read; rosfran@355: myth_handle->buffer_remain -= bytes_to_read; rosfran@116: rosfran@355: /* flushs the newly buffer got from byte array */ rosfran@355: myth_handle->buffer = g_byte_array_remove_range (myth_handle->buffer, 0, bytes_to_read); rosfran@355: g_debug ("Got from %llu bytes from internal buffer. (there are %d bytes in the buffer, from a total of %llu dispatched.)\n", rosfran@355: bytes_to_read, myth_handle->buffer_remain, myth_handle->bytes_read ); rosfran@357: rosfran@357: *bytes_read = bytes_to_read; rosfran@355: rosfran@355: return GNOME_VFS_OK; melunko@38: } melunko@38: melunko@38: static GnomeVFSResult melunko@38: do_close (GnomeVFSMethod *method, melunko@38: GnomeVFSMethodHandle *method_handle, melunko@38: GnomeVFSContext *context) melunko@38: { melunko@111: rosfran@357: MythtvHandle *myth_handle = (MythtvHandle *) method_handle; rosfran@357: rosfran@357: //if ( NULL == myth_handle || myth_handle->configured ) { rosfran@357: rosfran@357: if (myth_handle->file_transfer != NULL) { rosfran@357: g_object_unref (myth_handle->file_transfer); rosfran@357: myth_handle->file_transfer = NULL; rosfran@357: } rosfran@357: rosfran@357: if (myth_handle->is_livetv && myth_handle->livetv != NULL) { rosfran@357: g_object_unref (myth_handle->livetv); rosfran@357: myth_handle->livetv = NULL; rosfran@357: } rosfran@357: rosfran@357: if (myth_handle->buffer) { rosfran@357: g_byte_array_free (myth_handle->buffer, TRUE); rosfran@357: myth_handle->buffer = NULL; rosfran@357: } rosfran@357: rosfran@357: myth_handle->configured = FALSE; rosfran@357: rosfran@357: g_free (myth_handle); rosfran@357: rosfran@357: myth_handle = NULL; rosfran@357: rosfran@357: // } rosfran@127: rosfran@357: return GNOME_VFS_OK; melunko@38: } melunko@38: melunko@38: static GnomeVFSResult melunko@38: do_get_file_info (GnomeVFSMethod *method, melunko@38: GnomeVFSURI *uri, melunko@38: GnomeVFSFileInfo *file_info, melunko@38: GnomeVFSFileInfoOptions options, melunko@38: GnomeVFSContext *context) melunko@38: { renatofilho@188: GMythFileTransfer *file_transfer = NULL; rosfran@340: GMythRecorder *recorder = NULL; rosfran@346: GMythTVChain *tvchain = NULL; rosfran@297: GMythBackendInfo *backend_info = NULL; rosfran@297: GMythURI *gmyth_uri = NULL; rosfran@340: GMythSocket *socket = NULL; rosfran@297: gboolean is_livetv = FALSE; rosfran@301: gboolean ret = TRUE; rosfran@346: gboolean res = TRUE; rosfran@297: rosfran@297: /* Creates and fills out the backend info structure */ rosfran@297: backend_info = gmyth_backend_info_new_with_uri ( rosfran@297: gnome_vfs_unescape_string( gnome_vfs_uri_to_string( uri, GNOME_VFS_URI_HIDE_NONE ), "" ) ); rosfran@297: rosfran@297: /* creates an instance of */ rosfran@297: gmyth_uri = gmyth_uri_new_with_value( rosfran@297: gnome_vfs_unescape_string( gnome_vfs_uri_to_string( uri, GNOME_VFS_URI_HIDE_NONE ), "" ) ); renatofilho@188: rosfran@297: is_livetv = gmyth_uri_is_livetv( gmyth_uri ); rosfran@297: melunko@38: file_info->valid_fields = file_info->valid_fields melunko@38: | GNOME_VFS_FILE_INFO_FIELDS_TYPE melunko@38: | GNOME_VFS_FILE_INFO_FIELDS_MIME_TYPE melunko@38: | GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS; melunko@38: file_info->type = GNOME_VFS_FILE_TYPE_REGULAR; rosfran@297: /* fixme: get from file extension? */ melunko@111: file_info->mime_type = g_strdup ("video/x-nuv"); melunko@38: file_info->permissions = melunko@38: GNOME_VFS_PERM_USER_READ | melunko@38: GNOME_VFS_PERM_OTHER_READ | melunko@38: GNOME_VFS_PERM_GROUP_READ; rosfran@331: rosfran@332: g_print( "gnome_vfs_uri == %s | gmyth_uri == %s.\n", rosfran@331: gnome_vfs_uri_get_path (uri), rosfran@331: gmyth_uri_get_path (gmyth_uri) ); melunko@38: rosfran@301: /* Connect to the backend */ rosfran@297: if ( gmyth_uri != NULL && is_livetv == TRUE ) { rosfran@332: rosfran@338: /* start to get file info from LiveTV remote encoder */ rosfran@332: socket = gmyth_socket_new (); rosfran@332: rosfran@332: /* FIME: Implement this at gmyth_socket */ rosfran@332: res = gmyth_socket_connect_to_backend (socket, backend_info->hostname, rosfran@332: backend_info->port, TRUE); rosfran@332: if (!res) { rosfran@333: g_print ("[%s] LiveTV can not connect to backend", __FUNCTION__); rosfran@332: res = FALSE; rosfran@332: goto error; rosfran@332: } rosfran@332: rosfran@332: if ( gmyth_remote_util_get_free_recorder_count (socket) <= 0 ) { rosfran@333: g_print ("No free remote encoder available."); rosfran@332: res = FALSE; rosfran@332: goto error; rosfran@332: } rosfran@332: rosfran@332: /* Gets the recorder num */ rosfran@332: recorder = remote_request_next_free_recorder (socket, -1); rosfran@335: rosfran@346: //if ( socket != NULL ) rosfran@346: // g_object_unref (socket); rosfran@332: rosfran@332: if ( recorder == NULL ) { rosfran@333: g_print ("[%s] None remote encoder available", __FUNCTION__); rosfran@332: res = FALSE; rosfran@332: goto error; rosfran@332: } rosfran@332: rosfran@332: /* Init remote encoder. Opens its control socket. */ rosfran@332: res = gmyth_recorder_setup(recorder); rosfran@332: if ( !res ) { rosfran@333: g_print ("[%s] Fail while setting remote encoder\n", __FUNCTION__); rosfran@332: res = FALSE; rosfran@332: goto error; rosfran@346: } rosfran@346: rosfran@346: /* Creates livetv chain handler */ rosfran@346: tvchain = gmyth_tvchain_new(); rosfran@346: gmyth_tvchain_initialize ( tvchain, backend_info ); rosfran@346: rosfran@346: if ( tvchain == NULL || tvchain->tvchain_id == NULL ) { rosfran@346: res = FALSE; rosfran@346: goto error; rosfran@346: } rosfran@346: rosfran@346: // Spawn live tv. Uses the socket to send mythprotocol data to start livetv in the backend (remotelly) rosfran@346: res = gmyth_recorder_spawntv ( recorder, rosfran@346: gmyth_tvchain_get_id(tvchain) ); rosfran@346: if (!res) { rosfran@346: g_warning ("[%s] Fail while spawn tv\n", __FUNCTION__); rosfran@346: res = FALSE; rosfran@346: goto error; rosfran@355: } rosfran@332: rosfran@357: //gchar* channel_name = gmyth_uri_get_channel_name( gmyth_uri ); rosfran@338: rosfran@338: /* DEBUG message */ rosfran@332: GMythProgramInfo* prog_info = gmyth_recorder_get_current_program_info( recorder ); rosfran@332: rosfran@332: if ( prog_info != NULL ) rosfran@332: { rosfran@357: //gmyth_program_info_print( prog_info ); rosfran@357: g_debug( "Program Info: %s\n", gmyth_program_info_to_string( prog_info ) ); rosfran@332: rosfran@332: g_print( "path = %s", prog_info->pathname->str ); rosfran@332: rosfran@332: file_info->name = g_strdup ( g_strrstr( prog_info->pathname->str, "/" ) ); rosfran@332: rosfran@332: } else { rosfran@341: file_info->name = g_strdup ( "LiveTV.nuv" ); rosfran@332: file_info->size = gmyth_recorder_get_file_position( recorder ); rosfran@332: } rosfran@333: rosfran@332: if ( recorder != NULL ) rosfran@338: g_object_unref (recorder); rosfran@333: rosfran@333: if ( prog_info != NULL ) rosfran@333: g_object_unref( prog_info ); rosfran@346: rosfran@346: if ( tvchain != NULL ) rosfran@346: g_object_unref (tvchain); rosfran@338: rosfran@340: file_info->size = (GnomeVFSFileSize) - 1; rosfran@331: rosfran@297: } else { rosfran@332: rosfran@332: /* start to get file info from remote file encoder */ rosfran@297: file_transfer = gmyth_file_transfer_new (backend_info); rosfran@297: rosfran@297: /* Verifies if the file exists */ rosfran@297: if (!gmyth_util_file_exists (backend_info, gmyth_uri_get_path (gmyth_uri))) { rosfran@297: g_object_unref (backend_info); rosfran@297: return GNOME_VFS_ERROR_NOT_FOUND; rosfran@297: } rosfran@297: rosfran@297: /* sets the Playback monitor connection */ rosfran@297: ret = gmyth_file_transfer_open ( file_transfer, gmyth_uri_get_path (gmyth_uri) ); rosfran@331: rosfran@338: file_info->name = g_strdup ( gnome_vfs_uri_get_path (uri) ); rosfran@297: rosfran@335: } /* if - LiveTV or not? */ rosfran@297: rosfran@297: if (ret == FALSE) { rosfran@335: g_debug ("MythTV FileTransfer open error\n"); rosfran@297: return GNOME_VFS_ERROR_NOT_OPEN; rosfran@297: } rosfran@335: rosfran@332: if ( ret == TRUE && file_transfer != NULL ) { rosfran@323: file_info->size = gmyth_file_transfer_get_filesize (file_transfer); rosfran@331: if ( file_transfer ) rosfran@338: g_object_unref (file_transfer); rosfran@331: } rosfran@338: rosfran@331: file_info->block_count = GNOME_VFS_FILE_INFO_FIELDS_BLOCK_COUNT; rosfran@331: file_info->io_block_size = GNOME_VFS_FILE_INFO_FIELDS_IO_BLOCK_SIZE; rosfran@332: rosfran@340: error: rosfran@331: if (backend_info) rosfran@331: g_object_unref (backend_info); rosfran@346: rosfran@346: if (!res) rosfran@346: return GNOME_VFS_ERROR_IO; rosfran@301: melunko@38: return GNOME_VFS_OK; melunko@38: } melunko@38: melunko@38: static gboolean melunko@38: do_is_local (GnomeVFSMethod *method, melunko@38: const GnomeVFSURI *uri) melunko@38: { melunko@38: return FALSE; melunko@38: } melunko@38: melunko@38: static GnomeVFSMethod method = { melunko@38: sizeof (GnomeVFSMethod), melunko@38: do_open, melunko@38: NULL, melunko@38: do_close, melunko@38: do_read, melunko@38: NULL, melunko@38: NULL, melunko@38: NULL, melunko@38: NULL, melunko@38: NULL, melunko@38: NULL, melunko@38: NULL, melunko@38: do_get_file_info, melunko@38: NULL, melunko@38: do_is_local, melunko@38: NULL, melunko@38: NULL, melunko@38: NULL, melunko@38: NULL, melunko@38: NULL, melunko@38: NULL, melunko@38: NULL, melunko@38: NULL, melunko@38: NULL, melunko@38: NULL, melunko@38: NULL, melunko@38: NULL, melunko@38: }; melunko@38: melunko@38: melunko@38: GnomeVFSMethod * melunko@38: vfs_module_init (const char *method_name, const char *args) melunko@38: { melunko@38: return &method; melunko@38: } melunko@38: melunko@38: void melunko@38: vfs_module_shutdown (GnomeVFSMethod *method) melunko@38: { melunko@38: }