libgnomevfs2-mythtv/modules/mythtv-method.c
branchtrunk
changeset 860 bb5592a9ac48
parent 753 8ee634511c1e
     1.1 --- a/libgnomevfs2-mythtv/modules/mythtv-method.c	Thu Jun 14 18:22:32 2007 +0100
     1.2 +++ b/libgnomevfs2-mythtv/modules/mythtv-method.c	Mon Oct 08 19:35:09 2007 +0100
     1.3 @@ -45,689 +45,685 @@
     1.4  #define MYTHTV_VERSION_DEFAULT          30
     1.5  #define MYTHTV_TRANSFER_MAX_WAITS       100
     1.6  
     1.7 -/* internal GnomeVFS plug-in buffer size ( 120 Kbytes ) */
     1.8 +/*
     1.9 + * internal GnomeVFS plug-in buffer size ( 120 Kbytes ) 
    1.10 + */
    1.11  #define MYTHTV_BUFFER_SIZE                          80*1024
    1.12 -/* internally sized GnomeVFS plug-in buffer ( 4 Kbytes ) */
    1.13 +/*
    1.14 + * internally sized GnomeVFS plug-in buffer ( 4 Kbytes ) 
    1.15 + */
    1.16  #define MYTHTV_MAX_VFS_BUFFER_SIZE                  4096
    1.17 -/* maximum number of bytes to be requested to the MythTV backend ( 64 Kbytes ) */
    1.18 +/*
    1.19 + * maximum number of bytes to be requested to the MythTV backend ( 64
    1.20 + * Kbytes ) 
    1.21 + */
    1.22  #define MYTHTV_MAX_REQUEST_SIZE                     64*1024
    1.23  
    1.24 -typedef struct
    1.25 -{
    1.26 -  GMythFile *file;
    1.27 -  GMythLiveTV *livetv;
    1.28 -  GMythBackendInfo *backend_info;
    1.29 -  GMythURI *gmyth_uri;
    1.30 -  GMythRecorder *live_recorder;
    1.31 -  gboolean started;
    1.32 -  gint64 offset;
    1.33 +typedef struct {
    1.34 +    GMythFile      *file;
    1.35 +    GMythLiveTV    *livetv;
    1.36 +    GMythBackendInfo *backend_info;
    1.37 +    GMythURI       *gmyth_uri;
    1.38 +    GMythRecorder  *live_recorder;
    1.39 +    gboolean        started;
    1.40 +    gint64          offset;
    1.41  
    1.42 -  gboolean is_livetv;			/* it is, or not a Live TV content transfer */
    1.43 -  gboolean is_local_file;		/* tell if the file is local to the current content transfer */
    1.44 +    gboolean        is_livetv;  /* it is, or not a Live TV content
    1.45 +                                 * transfer */
    1.46 +    gboolean        is_local_file;  /* tell if the file is local to the
    1.47 +                                     * current content transfer */
    1.48  
    1.49 -  gchar *channel_name;
    1.50 +    gchar          *channel_name;
    1.51  
    1.52 -  gint mythtv_version;
    1.53 -  gboolean configured;
    1.54 +    gint            mythtv_version;
    1.55 +    gboolean        configured;
    1.56  } MythtvHandle;
    1.57  
    1.58  
    1.59  static GnomeVFSResult do_read(GnomeVFSMethod * method,
    1.60 -							  GnomeVFSMethodHandle * method_handle,
    1.61 -							  gpointer buffer,
    1.62 -							  GnomeVFSFileSize num_bytes,
    1.63 -							  GnomeVFSFileSize * bytes_read,
    1.64 -							  GnomeVFSContext * context);
    1.65 +                              GnomeVFSMethodHandle * method_handle,
    1.66 +                              gpointer buffer,
    1.67 +                              GnomeVFSFileSize num_bytes,
    1.68 +                              GnomeVFSFileSize * bytes_read,
    1.69 +                              GnomeVFSContext * context);
    1.70  
    1.71  static GnomeVFSResult myth_connection_start(MythtvHandle * method_handle);
    1.72 -static void myth_destroy_handle(MythtvHandle * method_handle);
    1.73 +static void     myth_destroy_handle(MythtvHandle * method_handle);
    1.74  static GnomeVFSResult myth_handle_new(GnomeVFSURI * uri,
    1.75 -									  MythtvHandle ** method_handle);
    1.76 +                                      MythtvHandle ** method_handle);
    1.77  static GnomeVFSResult myth_get_file_info(MythtvHandle * myth_handle,
    1.78 -										 GnomeVFSURI * uri,
    1.79 -										 GnomeVFSFileInfo * info);
    1.80 +                                         GnomeVFSURI * uri,
    1.81 +                                         GnomeVFSFileInfo * info);
    1.82  
    1.83 -static GnomeVFSResult
    1.84 +static          GnomeVFSResult
    1.85  myth_handle_new(GnomeVFSURI * uri, MythtvHandle ** method_handle)
    1.86  {
    1.87 -  gchar *tmp_str1;
    1.88 -  gchar *tmp_str2;
    1.89 +    gchar          *tmp_str1;
    1.90 +    gchar          *tmp_str2;
    1.91  
    1.92 -  _GNOME_VFS_METHOD_PARAM_CHECK(*method_handle == NULL);
    1.93 +    _GNOME_VFS_METHOD_PARAM_CHECK(*method_handle == NULL);
    1.94  
    1.95 -  if (gnome_vfs_uri_get_host_name(uri) == NULL)
    1.96 -	{
    1.97 -	  return GNOME_VFS_ERROR_INVALID_HOST_NAME;
    1.98 -	}
    1.99 +    if (gnome_vfs_uri_get_host_name(uri) == NULL) {
   1.100 +        return GNOME_VFS_ERROR_INVALID_HOST_NAME;
   1.101 +    }
   1.102  
   1.103 -  *method_handle = g_new0(MythtvHandle, 1);
   1.104 -  (*method_handle)->mythtv_version = MYTHTV_VERSION_DEFAULT;
   1.105 +    *method_handle = g_new0(MythtvHandle, 1);
   1.106 +    (*method_handle)->mythtv_version = MYTHTV_VERSION_DEFAULT;
   1.107  
   1.108 -  (*method_handle)->is_livetv = FALSE;
   1.109 -  (*method_handle)->is_local_file = FALSE;
   1.110 +    (*method_handle)->is_livetv = FALSE;
   1.111 +    (*method_handle)->is_local_file = FALSE;
   1.112  
   1.113 -  tmp_str1 = gnome_vfs_uri_to_string(uri, GNOME_VFS_URI_HIDE_NONE);
   1.114 -  tmp_str2 = gnome_vfs_unescape_string(tmp_str1, "");
   1.115 +    tmp_str1 = gnome_vfs_uri_to_string(uri, GNOME_VFS_URI_HIDE_NONE);
   1.116 +    tmp_str2 = gnome_vfs_unescape_string(tmp_str1, "");
   1.117  
   1.118 -  gchar *tmp_str3 = strstr(tmp_str2, ".nuv.avi");
   1.119 -  if (tmp_str3 != NULL)
   1.120 -	{
   1.121 -	  tmp_str3[4] = '\0';
   1.122 -	}
   1.123 +    gchar          *tmp_str3 = strstr(tmp_str2, ".nuv.avi");
   1.124 +    if (tmp_str3 != NULL) {
   1.125 +        tmp_str3[4] = '\0';
   1.126 +    }
   1.127  
   1.128 -  (*method_handle)->backend_info = gmyth_backend_info_new_with_uri(tmp_str2);
   1.129 -  (*method_handle)->gmyth_uri = gmyth_uri_new_with_value(tmp_str2);
   1.130 -  g_free(tmp_str1);
   1.131 -  g_free(tmp_str2);
   1.132 +    (*method_handle)->backend_info =
   1.133 +        gmyth_backend_info_new_with_uri(tmp_str2);
   1.134 +    (*method_handle)->gmyth_uri = gmyth_uri_new_with_value(tmp_str2);
   1.135 +    g_free(tmp_str1);
   1.136 +    g_free(tmp_str2);
   1.137  
   1.138 -  return GNOME_VFS_OK;
   1.139 +    return GNOME_VFS_OK;
   1.140  }
   1.141  
   1.142  static void
   1.143  myth_destroy_handle(MythtvHandle * method_handle)
   1.144  {
   1.145 - //TODO: abort if in tranfer state
   1.146 +    // TODO: abort if in tranfer state
   1.147  
   1.148 -  if (method_handle->backend_info != NULL)
   1.149 -	{
   1.150 -	  g_object_unref(method_handle->backend_info);
   1.151 -	  method_handle->backend_info = NULL;
   1.152 -	}
   1.153 +    if (method_handle->backend_info != NULL) {
   1.154 +        g_object_unref(method_handle->backend_info);
   1.155 +        method_handle->backend_info = NULL;
   1.156 +    }
   1.157  
   1.158 -  if (method_handle->channel_name != NULL)
   1.159 -	{
   1.160 -	  g_free(method_handle->channel_name);
   1.161 -	  method_handle->channel_name = NULL;
   1.162 -	}
   1.163 +    if (method_handle->channel_name != NULL) {
   1.164 +        g_free(method_handle->channel_name);
   1.165 +        method_handle->channel_name = NULL;
   1.166 +    }
   1.167  
   1.168 -  if (method_handle->livetv != NULL)
   1.169 -	{
   1.170 -	  g_object_unref(method_handle->livetv);
   1.171 -	  method_handle->livetv = NULL;
   1.172 -	}
   1.173 +    if (method_handle->livetv != NULL) {
   1.174 +        g_object_unref(method_handle->livetv);
   1.175 +        method_handle->livetv = NULL;
   1.176 +    }
   1.177  
   1.178 -  if (method_handle->file != NULL)
   1.179 -	{
   1.180 -	  g_object_unref(method_handle->file);
   1.181 -	  method_handle->file = NULL;
   1.182 -	}
   1.183 +    if (method_handle->file != NULL) {
   1.184 +        g_object_unref(method_handle->file);
   1.185 +        method_handle->file = NULL;
   1.186 +    }
   1.187  
   1.188 -  if (method_handle->gmyth_uri != NULL)
   1.189 -	{
   1.190 -	  g_object_unref(method_handle->gmyth_uri);
   1.191 -	  method_handle->gmyth_uri = NULL;
   1.192 -	}
   1.193 +    if (method_handle->gmyth_uri != NULL) {
   1.194 +        g_object_unref(method_handle->gmyth_uri);
   1.195 +        method_handle->gmyth_uri = NULL;
   1.196 +    }
   1.197  
   1.198 -  g_free(method_handle);
   1.199 +    g_free(method_handle);
   1.200  }
   1.201  
   1.202 -static GnomeVFSResult
   1.203 +static          GnomeVFSResult
   1.204  myth_get_file_info(MythtvHandle * myth_handle,
   1.205 -				   GnomeVFSURI * uri, GnomeVFSFileInfo * info)
   1.206 +                   GnomeVFSURI * uri, GnomeVFSFileInfo * info)
   1.207  {
   1.208 -  GMythURI *gmyth_uri;
   1.209 -  GMythBackendInfo *backend_info;
   1.210 -  gboolean is_livetv;
   1.211 -  gboolean is_local;
   1.212 +    GMythURI       *gmyth_uri;
   1.213 +    GMythBackendInfo *backend_info;
   1.214 +    gboolean        is_livetv;
   1.215 +    gboolean        is_local;
   1.216  
   1.217 -  _GNOME_VFS_METHOD_PARAM_CHECK(info != NULL);
   1.218 +    _GNOME_VFS_METHOD_PARAM_CHECK(info != NULL);
   1.219  
   1.220 -  g_debug("%s - %d", __FUNCTION__, __LINE__);
   1.221 +    g_debug("%s - %d", __FUNCTION__, __LINE__);
   1.222  
   1.223 -  if (myth_handle == NULL)
   1.224 -	{
   1.225 -	  gchar *tmp_str1;
   1.226 -	  gchar *tmp_str2;
   1.227 +    if (myth_handle == NULL) {
   1.228 +        gchar          *tmp_str1;
   1.229 +        gchar          *tmp_str2;
   1.230  
   1.231 -	  tmp_str1 = gnome_vfs_uri_to_string(uri, GNOME_VFS_URI_HIDE_NONE);
   1.232 -	  tmp_str2 = gnome_vfs_unescape_string(tmp_str1, "");
   1.233 +        tmp_str1 = gnome_vfs_uri_to_string(uri, GNOME_VFS_URI_HIDE_NONE);
   1.234 +        tmp_str2 = gnome_vfs_unescape_string(tmp_str1, "");
   1.235  
   1.236 -	  backend_info = gmyth_backend_info_new_with_uri(tmp_str2);
   1.237 -	  gmyth_uri = gmyth_uri_new_with_value(tmp_str2);
   1.238 +        backend_info = gmyth_backend_info_new_with_uri(tmp_str2);
   1.239 +        gmyth_uri = gmyth_uri_new_with_value(tmp_str2);
   1.240  
   1.241 -	  g_free(tmp_str1);
   1.242 -	  g_free(tmp_str2);
   1.243 -	}
   1.244 -  else
   1.245 -	{
   1.246 -	  backend_info = g_object_ref(myth_handle->backend_info);
   1.247 -	  gmyth_uri = g_object_ref(myth_handle->gmyth_uri);
   1.248 -	}
   1.249 +        g_free(tmp_str1);
   1.250 +        g_free(tmp_str2);
   1.251 +    } else {
   1.252 +        backend_info = g_object_ref(myth_handle->backend_info);
   1.253 +        gmyth_uri = g_object_ref(myth_handle->gmyth_uri);
   1.254 +    }
   1.255  
   1.256 -  info->valid_fields = 0;
   1.257 -  info->valid_fields = GNOME_VFS_FILE_INFO_FIELDS_TYPE |
   1.258 -	GNOME_VFS_FILE_INFO_FIELDS_MIME_TYPE |
   1.259 -	GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS;
   1.260 +    info->valid_fields = 0;
   1.261 +    info->valid_fields = GNOME_VFS_FILE_INFO_FIELDS_TYPE |
   1.262 +        GNOME_VFS_FILE_INFO_FIELDS_MIME_TYPE |
   1.263 +        GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS;
   1.264  
   1.265 -  info->type = GNOME_VFS_FILE_TYPE_REGULAR;
   1.266 +    info->type = GNOME_VFS_FILE_TYPE_REGULAR;
   1.267  
   1.268 - /* fixme: get from file extension? */
   1.269 -  info->mime_type = g_strdup("video/x-nuv");
   1.270 -  info->permissions = GNOME_VFS_PERM_USER_READ |
   1.271 -	GNOME_VFS_PERM_OTHER_READ | GNOME_VFS_PERM_GROUP_READ;
   1.272 +    /*
   1.273 +     * fixme: get from file extension? 
   1.274 +     */
   1.275 +    info->mime_type = g_strdup("video/x-nuv");
   1.276 +    info->permissions = GNOME_VFS_PERM_USER_READ |
   1.277 +        GNOME_VFS_PERM_OTHER_READ | GNOME_VFS_PERM_GROUP_READ;
   1.278  
   1.279 -  info->name = g_strdup(gmyth_uri_get_path(gmyth_uri));
   1.280 +    info->name = g_strdup(gmyth_uri_get_path(gmyth_uri));
   1.281  
   1.282 - /* file size for remote files */
   1.283 -  is_livetv = gmyth_uri_is_livetv(gmyth_uri);
   1.284 +    /*
   1.285 +     * file size for remote files 
   1.286 +     */
   1.287 +    is_livetv = gmyth_uri_is_livetv(gmyth_uri);
   1.288  
   1.289 -  if (is_livetv == FALSE)
   1.290 -	{
   1.291 -	  GMythFile *file = NULL;
   1.292 -	  gboolean ret = FALSE;
   1.293 +    if (is_livetv == FALSE) {
   1.294 +        GMythFile      *file = NULL;
   1.295 +        gboolean        ret = FALSE;
   1.296  
   1.297 -	 /* Verifies if the file exists */
   1.298 -	  if (!gmyth_util_file_exists(backend_info,
   1.299 -								  gmyth_uri_get_path(gmyth_uri)))
   1.300 -		{
   1.301 -		  g_object_unref(file);
   1.302 -		  g_object_unref(backend_info);
   1.303 -		  g_debug("NOT FOUND %s/%d", __FUNCTION__, __LINE__);
   1.304 -		  return GNOME_VFS_ERROR_NOT_FOUND;
   1.305 -		}
   1.306 +        /*
   1.307 +         * Verifies if the file exists 
   1.308 +         */
   1.309 +        if (!gmyth_util_file_exists(backend_info,
   1.310 +                                    gmyth_uri_get_path(gmyth_uri))) {
   1.311 +            g_object_unref(file);
   1.312 +            g_object_unref(backend_info);
   1.313 +            g_debug("NOT FOUND %s/%d", __FUNCTION__, __LINE__);
   1.314 +            return GNOME_VFS_ERROR_NOT_FOUND;
   1.315 +        }
   1.316  
   1.317 -	  is_local = gmyth_uri_is_local_file(gmyth_uri);
   1.318 -	  if (is_local == TRUE)
   1.319 -		{
   1.320 -		  file = GMYTH_FILE(gmyth_file_local_new(backend_info));
   1.321 -		  ret = gmyth_file_local_open(GMYTH_FILE_LOCAL(file));
   1.322 -		}
   1.323 -	  else
   1.324 -		{
   1.325 -		  file = GMYTH_FILE(gmyth_file_transfer_new(backend_info));
   1.326 -		  ret = gmyth_file_transfer_open(GMYTH_FILE_TRANSFER(file),
   1.327 -										 gmyth_uri_get_path(gmyth_uri));
   1.328 -		}
   1.329 +        is_local = gmyth_uri_is_local_file(gmyth_uri);
   1.330 +        if (is_local == TRUE) {
   1.331 +            file = GMYTH_FILE(gmyth_file_local_new(backend_info));
   1.332 +            ret = gmyth_file_local_open(GMYTH_FILE_LOCAL(file));
   1.333 +        } else {
   1.334 +            file = GMYTH_FILE(gmyth_file_transfer_new(backend_info));
   1.335 +            ret = gmyth_file_transfer_open(GMYTH_FILE_TRANSFER(file),
   1.336 +                                           gmyth_uri_get_path(gmyth_uri));
   1.337 +        }
   1.338  
   1.339 -	  if (!ret)
   1.340 -		{
   1.341 -		  g_object_unref(file);
   1.342 -		  g_object_unref(backend_info);
   1.343 -		  g_debug("NOT FOUND %s/%d", __FUNCTION__, __LINE__);
   1.344 -		  return GNOME_VFS_ERROR_NOT_FOUND;
   1.345 -		}
   1.346 +        if (!ret) {
   1.347 +            g_object_unref(file);
   1.348 +            g_object_unref(backend_info);
   1.349 +            g_debug("NOT FOUND %s/%d", __FUNCTION__, __LINE__);
   1.350 +            return GNOME_VFS_ERROR_NOT_FOUND;
   1.351 +        }
   1.352  
   1.353 -	  info->size = gmyth_file_get_filesize(file);
   1.354 -	  info->valid_fields |= GNOME_VFS_FILE_INFO_FIELDS_SIZE;
   1.355 -	  g_object_unref(file);
   1.356 -	}
   1.357 +        info->size = gmyth_file_get_filesize(file);
   1.358 +        info->valid_fields |= GNOME_VFS_FILE_INFO_FIELDS_SIZE;
   1.359 +        g_object_unref(file);
   1.360 +    }
   1.361  
   1.362 -  g_object_unref(backend_info);
   1.363 -  g_object_unref(gmyth_uri);
   1.364 +    g_object_unref(backend_info);
   1.365 +    g_object_unref(gmyth_uri);
   1.366  
   1.367 -  return GNOME_VFS_OK;
   1.368 +    return GNOME_VFS_OK;
   1.369  }
   1.370  
   1.371 -static GnomeVFSResult
   1.372 +static          GnomeVFSResult
   1.373  myth_connection_start(MythtvHandle * method_handle)
   1.374  {
   1.375 -  GnomeVFSResult result = GNOME_VFS_OK;
   1.376 +    GnomeVFSResult  result = GNOME_VFS_OK;
   1.377  
   1.378 -  _GNOME_VFS_METHOD_PARAM_CHECK(method_handle != NULL);
   1.379 -  _GNOME_VFS_METHOD_PARAM_CHECK(method_handle->backend_info != NULL);
   1.380 +    _GNOME_VFS_METHOD_PARAM_CHECK(method_handle != NULL);
   1.381 +    _GNOME_VFS_METHOD_PARAM_CHECK(method_handle->backend_info != NULL);
   1.382  
   1.383 - /* Connect to the backend */
   1.384 -  if ((method_handle->is_livetv =
   1.385 -	   gmyth_uri_is_livetv(method_handle->gmyth_uri)) == TRUE)
   1.386 -	{
   1.387 -	  method_handle->livetv = gmyth_livetv_new(method_handle->backend_info);
   1.388 -	  method_handle->channel_name =
   1.389 -		gmyth_uri_get_channel_name(method_handle->gmyth_uri);
   1.390 +    /*
   1.391 +     * Connect to the backend 
   1.392 +     */
   1.393 +    if ((method_handle->is_livetv =
   1.394 +         gmyth_uri_is_livetv(method_handle->gmyth_uri)) == TRUE) {
   1.395 +        method_handle->livetv =
   1.396 +            gmyth_livetv_new(method_handle->backend_info);
   1.397 +        method_handle->channel_name =
   1.398 +            gmyth_uri_get_channel_name(method_handle->gmyth_uri);
   1.399  
   1.400 -	  if (method_handle->channel_name != NULL)
   1.401 -		{
   1.402 -		  if (gmyth_livetv_channel_name_setup(method_handle->livetv,
   1.403 -											  method_handle->channel_name) ==
   1.404 -			  FALSE)
   1.405 -			{
   1.406 -			  result = GNOME_VFS_ERROR_INVALID_URI;
   1.407 -			  goto error;
   1.408 -			}
   1.409 -		}
   1.410 -	  else if (gmyth_livetv_setup(method_handle->livetv) == FALSE)
   1.411 -		{
   1.412 -		  result = GNOME_VFS_ERROR_INVALID_URI;
   1.413 -		  goto error;
   1.414 -		}
   1.415 +        if (method_handle->channel_name != NULL) {
   1.416 +            if (gmyth_livetv_channel_name_setup(method_handle->livetv,
   1.417 +                                                method_handle->
   1.418 +                                                channel_name) == FALSE) {
   1.419 +                result = GNOME_VFS_ERROR_INVALID_URI;
   1.420 +                goto error;
   1.421 +            }
   1.422 +        } else if (gmyth_livetv_setup(method_handle->livetv) == FALSE) {
   1.423 +            result = GNOME_VFS_ERROR_INVALID_URI;
   1.424 +            goto error;
   1.425 +        }
   1.426  
   1.427  
   1.428 -	  method_handle->file =
   1.429 -		GMYTH_FILE(gmyth_livetv_create_file_transfer(method_handle->livetv));
   1.430 +        method_handle->file =
   1.431 +            GMYTH_FILE(gmyth_livetv_create_file_transfer
   1.432 +                       (method_handle->livetv));
   1.433  
   1.434 -	  if (method_handle->file == NULL)
   1.435 -		{
   1.436 -		  result = GNOME_VFS_ERROR_INVALID_URI;
   1.437 -		  g_debug("MythTV FileTransfer is NULL!\n");
   1.438 -		  goto error;
   1.439 -		}
   1.440 +        if (method_handle->file == NULL) {
   1.441 +            result = GNOME_VFS_ERROR_INVALID_URI;
   1.442 +            g_debug("MythTV FileTransfer is NULL!\n");
   1.443 +            goto error;
   1.444 +        }
   1.445  
   1.446 -	  if (!gmyth_file_transfer_open(GMYTH_FILE_TRANSFER(method_handle->file),
   1.447 -									method_handle->livetv->uri != NULL ?
   1.448 -									gmyth_uri_get_path(method_handle->livetv->
   1.449 -													   uri) : method_handle->
   1.450 -									livetv->proginfo->pathname->str))
   1.451 -		{
   1.452 +        if (!gmyth_file_transfer_open
   1.453 +            (GMYTH_FILE_TRANSFER(method_handle->file),
   1.454 +             method_handle->livetv->uri !=
   1.455 +             NULL ? gmyth_uri_get_path(method_handle->livetv->
   1.456 +                                       uri) : method_handle->livetv->
   1.457 +             proginfo->pathname->str)) {
   1.458  
   1.459 -		  g_debug("Couldn't open MythTV FileTransfer is NULL!\n");
   1.460 -		  result = GNOME_VFS_ERROR_NOT_OPEN;
   1.461 -		  goto error;
   1.462 -		}
   1.463 -	}
   1.464 -  else
   1.465 -	{
   1.466 -	  gboolean ret = TRUE;
   1.467 -	 /* Verifies if the file exists */
   1.468 -	  if (!gmyth_util_file_exists(method_handle->backend_info,
   1.469 -								  gmyth_uri_get_path(method_handle->
   1.470 -													 gmyth_uri)))
   1.471 -		{
   1.472 +            g_debug("Couldn't open MythTV FileTransfer is NULL!\n");
   1.473 +            result = GNOME_VFS_ERROR_NOT_OPEN;
   1.474 +            goto error;
   1.475 +        }
   1.476 +    } else {
   1.477 +        gboolean        ret = TRUE;
   1.478 +        /*
   1.479 +         * Verifies if the file exists 
   1.480 +         */
   1.481 +        if (!gmyth_util_file_exists(method_handle->backend_info,
   1.482 +                                    gmyth_uri_get_path(method_handle->
   1.483 +                                                       gmyth_uri))) {
   1.484  
   1.485 -		  g_debug("NOT FOUND %s/%d", __FUNCTION__, __LINE__);
   1.486 -		  goto error;
   1.487 -		}
   1.488 +            g_debug("NOT FOUND %s/%d", __FUNCTION__, __LINE__);
   1.489 +            goto error;
   1.490 +        }
   1.491  
   1.492 -	  if ((method_handle->is_local_file =
   1.493 -		   gmyth_uri_is_local_file(method_handle->gmyth_uri)) == TRUE)
   1.494 -		{
   1.495 -		  method_handle->file =
   1.496 -			GMYTH_FILE(gmyth_file_local_new(method_handle->backend_info));
   1.497 -		  ret = gmyth_file_local_open(GMYTH_FILE_LOCAL(method_handle->file));
   1.498 -		}
   1.499 -	  else
   1.500 -		{
   1.501 -		  method_handle->file =
   1.502 -			GMYTH_FILE(gmyth_file_transfer_new(method_handle->backend_info));
   1.503 -		  ret =
   1.504 -			gmyth_file_transfer_open(GMYTH_FILE_TRANSFER(method_handle->file),
   1.505 -									 gmyth_uri_get_path(method_handle->
   1.506 -														gmyth_uri));
   1.507 -		}
   1.508 +        if ((method_handle->is_local_file =
   1.509 +             gmyth_uri_is_local_file(method_handle->gmyth_uri)) == TRUE) {
   1.510 +            method_handle->file =
   1.511 +                GMYTH_FILE(gmyth_file_local_new
   1.512 +                           (method_handle->backend_info));
   1.513 +            ret =
   1.514 +                gmyth_file_local_open(GMYTH_FILE_LOCAL
   1.515 +                                      (method_handle->file));
   1.516 +        } else {
   1.517 +            method_handle->file =
   1.518 +                GMYTH_FILE(gmyth_file_transfer_new
   1.519 +                           (method_handle->backend_info));
   1.520 +            ret =
   1.521 +                gmyth_file_transfer_open(GMYTH_FILE_TRANSFER
   1.522 +                                         (method_handle->file),
   1.523 +                                         gmyth_uri_get_path(method_handle->
   1.524 +                                                            gmyth_uri));
   1.525 +        }
   1.526  
   1.527 -	 /* sets the Playback monitor connection */
   1.528 -	  if (!ret)
   1.529 -		{
   1.530 +        /*
   1.531 +         * sets the Playback monitor connection 
   1.532 +         */
   1.533 +        if (!ret) {
   1.534  
   1.535 -		  g_debug("NOT FOUND %s/%d", __FUNCTION__, __LINE__);
   1.536 -		  result = GNOME_VFS_ERROR_NOT_FOUND;
   1.537 -		  goto error;
   1.538 -		}
   1.539 -	}							/* if - LiveTV or not? */
   1.540 +            g_debug("NOT FOUND %s/%d", __FUNCTION__, __LINE__);
   1.541 +            result = GNOME_VFS_ERROR_NOT_FOUND;
   1.542 +            goto error;
   1.543 +        }
   1.544 +    }                           /* if - LiveTV or not? */
   1.545  
   1.546 -  method_handle->configured = TRUE;
   1.547 +    method_handle->configured = TRUE;
   1.548  
   1.549 -  if (method_handle->file == NULL)
   1.550 -	{
   1.551 -	  result = GNOME_VFS_ERROR_NOT_OPEN;
   1.552 -	}
   1.553 +    if (method_handle->file == NULL) {
   1.554 +        result = GNOME_VFS_ERROR_NOT_OPEN;
   1.555 +    }
   1.556  
   1.557 -error:
   1.558 +  error:
   1.559  
   1.560 -  return result;
   1.561 +    return result;
   1.562  }
   1.563  
   1.564 -static GnomeVFSResult
   1.565 +static          GnomeVFSResult
   1.566  do_open(GnomeVFSMethod * method,
   1.567 -		GnomeVFSMethodHandle ** method_handle,
   1.568 -		GnomeVFSURI * uri, GnomeVFSOpenMode mode, GnomeVFSContext * context)
   1.569 +        GnomeVFSMethodHandle ** method_handle,
   1.570 +        GnomeVFSURI * uri, GnomeVFSOpenMode mode,
   1.571 +        GnomeVFSContext * context)
   1.572  {
   1.573 -  MythtvHandle *myth_handle = NULL;
   1.574 -  GnomeVFSResult result = GNOME_VFS_OK;
   1.575 +    MythtvHandle   *myth_handle = NULL;
   1.576 +    GnomeVFSResult  result = GNOME_VFS_OK;
   1.577  
   1.578 -  _GNOME_VFS_METHOD_PARAM_CHECK(method_handle != NULL);
   1.579 -  _GNOME_VFS_METHOD_PARAM_CHECK(uri != NULL);
   1.580 +    _GNOME_VFS_METHOD_PARAM_CHECK(method_handle != NULL);
   1.581 +    _GNOME_VFS_METHOD_PARAM_CHECK(uri != NULL);
   1.582  
   1.583 -  if (mode & GNOME_VFS_OPEN_WRITE)
   1.584 -	{
   1.585 -	  return GNOME_VFS_ERROR_INVALID_OPEN_MODE;
   1.586 -	}
   1.587 +    if (mode & GNOME_VFS_OPEN_WRITE) {
   1.588 +        return GNOME_VFS_ERROR_INVALID_OPEN_MODE;
   1.589 +    }
   1.590  
   1.591 -  result = myth_handle_new(uri, &myth_handle);
   1.592 -  if (result != GNOME_VFS_OK)
   1.593 -	return result;
   1.594 +    result = myth_handle_new(uri, &myth_handle);
   1.595 +    if (result != GNOME_VFS_OK)
   1.596 +        return result;
   1.597  
   1.598 -  result = myth_connection_start(myth_handle);
   1.599 -  if (result != GNOME_VFS_OK)
   1.600 -	{
   1.601 -	  myth_destroy_handle(myth_handle);
   1.602 -	  myth_handle = NULL;
   1.603 -	  return result;
   1.604 -	}
   1.605 +    result = myth_connection_start(myth_handle);
   1.606 +    if (result != GNOME_VFS_OK) {
   1.607 +        myth_destroy_handle(myth_handle);
   1.608 +        myth_handle = NULL;
   1.609 +        return result;
   1.610 +    }
   1.611  
   1.612 -  *method_handle = (GnomeVFSMethodHandle *) myth_handle;
   1.613 +    *method_handle = (GnomeVFSMethodHandle *) myth_handle;
   1.614  
   1.615 -  return result;
   1.616 +    return result;
   1.617  }
   1.618  
   1.619 -static GnomeVFSResult
   1.620 +static          GnomeVFSResult
   1.621  do_create(GnomeVFSMethod * method,
   1.622 -		  GnomeVFSMethodHandle ** method_handle,
   1.623 -		  GnomeVFSURI * uri,
   1.624 -		  GnomeVFSOpenMode mode,
   1.625 -		  gboolean exclusive, guint perm, GnomeVFSContext * context)
   1.626 +          GnomeVFSMethodHandle ** method_handle,
   1.627 +          GnomeVFSURI * uri,
   1.628 +          GnomeVFSOpenMode mode,
   1.629 +          gboolean exclusive, guint perm, GnomeVFSContext * context)
   1.630  {
   1.631 -  return GNOME_VFS_ERROR_NOT_SUPPORTED;
   1.632 +    return GNOME_VFS_ERROR_NOT_SUPPORTED;
   1.633  }
   1.634  
   1.635 -static GnomeVFSResult
   1.636 +static          GnomeVFSResult
   1.637  do_close(GnomeVFSMethod * method,
   1.638 -		 GnomeVFSMethodHandle * method_handle, GnomeVFSContext * context)
   1.639 +         GnomeVFSMethodHandle * method_handle, GnomeVFSContext * context)
   1.640  {
   1.641 -  MythtvHandle *myth_handle = (MythtvHandle *) method_handle;
   1.642 +    MythtvHandle   *myth_handle = (MythtvHandle *) method_handle;
   1.643  
   1.644 -  myth_destroy_handle(myth_handle);
   1.645 +    myth_destroy_handle(myth_handle);
   1.646  
   1.647 -  return GNOME_VFS_OK;
   1.648 +    return GNOME_VFS_OK;
   1.649  }
   1.650  
   1.651  
   1.652 -static GnomeVFSResult
   1.653 +static          GnomeVFSResult
   1.654  do_read(GnomeVFSMethod * method,
   1.655 -		GnomeVFSMethodHandle * method_handle,
   1.656 -		gpointer buffer,
   1.657 -		GnomeVFSFileSize num_bytes,
   1.658 -		GnomeVFSFileSize * bytes_read, GnomeVFSContext * context)
   1.659 +        GnomeVFSMethodHandle * method_handle,
   1.660 +        gpointer buffer,
   1.661 +        GnomeVFSFileSize num_bytes,
   1.662 +        GnomeVFSFileSize * bytes_read, GnomeVFSContext * context)
   1.663  {
   1.664 -  GnomeVFSResult retval = GNOME_VFS_OK;
   1.665 -  MythtvHandle *myth_handle;
   1.666 -  GMythFileReadResult result;
   1.667 -  GByteArray *myth_buffer = g_byte_array_new();
   1.668 +    GnomeVFSResult  retval = GNOME_VFS_OK;
   1.669 +    MythtvHandle   *myth_handle;
   1.670 +    GMythFileReadResult result;
   1.671 +    GByteArray     *myth_buffer = g_byte_array_new();
   1.672  
   1.673 -  _GNOME_VFS_METHOD_PARAM_CHECK(method_handle != NULL);
   1.674 +    _GNOME_VFS_METHOD_PARAM_CHECK(method_handle != NULL);
   1.675  
   1.676 -  myth_handle = (MythtvHandle *) method_handle;
   1.677 -  if (myth_handle->is_local_file)
   1.678 -	result = gmyth_file_local_read(GMYTH_FILE_LOCAL(myth_handle->file),
   1.679 -								   myth_buffer,
   1.680 -								   num_bytes, myth_handle->is_livetv);
   1.681 -  else
   1.682 -	result = gmyth_file_transfer_read(GMYTH_FILE_TRANSFER(myth_handle->file),
   1.683 -									  myth_buffer,
   1.684 -									  num_bytes, myth_handle->is_livetv);
   1.685 +    myth_handle = (MythtvHandle *) method_handle;
   1.686 +    if (myth_handle->is_local_file)
   1.687 +        result = gmyth_file_local_read(GMYTH_FILE_LOCAL(myth_handle->file),
   1.688 +                                       myth_buffer,
   1.689 +                                       num_bytes, myth_handle->is_livetv);
   1.690 +    else
   1.691 +        result =
   1.692 +            gmyth_file_transfer_read(GMYTH_FILE_TRANSFER
   1.693 +                                     (myth_handle->file), myth_buffer,
   1.694 +                                     num_bytes, myth_handle->is_livetv);
   1.695  
   1.696 -  if (result == GMYTH_FILE_READ_ERROR)
   1.697 -	{
   1.698 -	  retval = GNOME_VFS_ERROR_IO;
   1.699 -	}
   1.700 +    if (result == GMYTH_FILE_READ_ERROR) {
   1.701 +        retval = GNOME_VFS_ERROR_IO;
   1.702 +    }
   1.703  
   1.704 -  if (result == GMYTH_FILE_READ_EOF)
   1.705 -	{
   1.706 -	  retval = GNOME_VFS_ERROR_EOF;
   1.707 -	}
   1.708 +    if (result == GMYTH_FILE_READ_EOF) {
   1.709 +        retval = GNOME_VFS_ERROR_EOF;
   1.710 +    }
   1.711  
   1.712 -  if (myth_buffer->len > 0)
   1.713 -	{
   1.714 -	  g_memmove(buffer, myth_buffer->data, myth_buffer->len);
   1.715 -	  *bytes_read = (GnomeVFSFileSize) myth_buffer->len;
   1.716 -	  myth_handle->offset += myth_buffer->len;
   1.717 -	  g_byte_array_free(myth_buffer, TRUE);
   1.718 -	}
   1.719 +    if (myth_buffer->len > 0) {
   1.720 +        g_memmove(buffer, myth_buffer->data, myth_buffer->len);
   1.721 +        *bytes_read = (GnomeVFSFileSize) myth_buffer->len;
   1.722 +        myth_handle->offset += myth_buffer->len;
   1.723 +        g_byte_array_free(myth_buffer, TRUE);
   1.724 +    }
   1.725  
   1.726 -  return retval;
   1.727 +    return retval;
   1.728  }
   1.729  
   1.730 -static GnomeVFSResult
   1.731 +static          GnomeVFSResult
   1.732  do_write(GnomeVFSMethod * method,
   1.733 -		 GnomeVFSMethodHandle * method_handle,
   1.734 -		 gconstpointer buffer,
   1.735 -		 GnomeVFSFileSize num_bytes,
   1.736 -		 GnomeVFSFileSize * bytes_written, GnomeVFSContext * context)
   1.737 +         GnomeVFSMethodHandle * method_handle,
   1.738 +         gconstpointer buffer,
   1.739 +         GnomeVFSFileSize num_bytes,
   1.740 +         GnomeVFSFileSize * bytes_written, GnomeVFSContext * context)
   1.741  {
   1.742 -  return GNOME_VFS_ERROR_NOT_SUPPORTED;
   1.743 +    return GNOME_VFS_ERROR_NOT_SUPPORTED;
   1.744  }
   1.745  
   1.746 -static GnomeVFSResult
   1.747 +static          GnomeVFSResult
   1.748  do_seek(GnomeVFSMethod * method,
   1.749 -		GnomeVFSMethodHandle * method_handle,
   1.750 -		GnomeVFSSeekPosition whence,
   1.751 -		GnomeVFSFileOffset offset, GnomeVFSContext * context)
   1.752 +        GnomeVFSMethodHandle * method_handle,
   1.753 +        GnomeVFSSeekPosition whence,
   1.754 +        GnomeVFSFileOffset offset, GnomeVFSContext * context)
   1.755  {
   1.756 -  MythtvHandle *myth_handle;
   1.757 -  guint64 whence_p = 0;
   1.758 -  gint64 new_offset = 0;
   1.759 +    MythtvHandle   *myth_handle;
   1.760 +    guint64         whence_p = 0;
   1.761 +    gint64          new_offset = 0;
   1.762  
   1.763 -  _GNOME_VFS_METHOD_PARAM_CHECK(method_handle != NULL);
   1.764 +    _GNOME_VFS_METHOD_PARAM_CHECK(method_handle != NULL);
   1.765  
   1.766 -  myth_handle = (MythtvHandle *) method_handle;
   1.767 +    myth_handle = (MythtvHandle *) method_handle;
   1.768  
   1.769 -  g_debug("seek offset %" G_GINT64_FORMAT " whence %d", offset, whence);
   1.770 +    g_debug("seek offset %" G_GINT64_FORMAT " whence %d", offset, whence);
   1.771  
   1.772 -  if (gmyth_uri_is_livetv(myth_handle->gmyth_uri))
   1.773 -	return GNOME_VFS_ERROR_NOT_SUPPORTED;
   1.774 +    if (gmyth_uri_is_livetv(myth_handle->gmyth_uri))
   1.775 +        return GNOME_VFS_ERROR_NOT_SUPPORTED;
   1.776  
   1.777 -  switch (whence)
   1.778 -	{
   1.779 -	case GNOME_VFS_SEEK_START:
   1.780 -	  whence_p = 0;
   1.781 -	  break;
   1.782 -	case GNOME_VFS_SEEK_CURRENT:
   1.783 -	  whence_p = myth_handle->offset;
   1.784 -	  break;
   1.785 -	case GNOME_VFS_SEEK_END:
   1.786 -	  return GNOME_VFS_ERROR_NOT_SUPPORTED;
   1.787 -	}
   1.788 +    switch (whence) {
   1.789 +    case GNOME_VFS_SEEK_START:
   1.790 +        whence_p = 0;
   1.791 +        break;
   1.792 +    case GNOME_VFS_SEEK_CURRENT:
   1.793 +        whence_p = myth_handle->offset;
   1.794 +        break;
   1.795 +    case GNOME_VFS_SEEK_END:
   1.796 +        return GNOME_VFS_ERROR_NOT_SUPPORTED;
   1.797 +    }
   1.798  
   1.799 -  new_offset = gmyth_file_transfer_seek(myth_handle->file, offset, whence_p);
   1.800 -  if (new_offset != 0)
   1.801 -	{
   1.802 -	  myth_handle->offset = new_offset;
   1.803 -	  return GNOME_VFS_OK;
   1.804 -	}
   1.805 +    new_offset =
   1.806 +        gmyth_file_transfer_seek(myth_handle->file, offset, whence_p);
   1.807 +    if (new_offset != 0) {
   1.808 +        myth_handle->offset = new_offset;
   1.809 +        return GNOME_VFS_OK;
   1.810 +    }
   1.811  
   1.812 -  return GNOME_VFS_ERROR_NOT_SUPPORTED;
   1.813 +    return GNOME_VFS_ERROR_NOT_SUPPORTED;
   1.814  }
   1.815  
   1.816 -static GnomeVFSResult
   1.817 +static          GnomeVFSResult
   1.818  do_tell(GnomeVFSMethod * method,
   1.819 -		GnomeVFSMethodHandle * method_handle,
   1.820 -		GnomeVFSFileSize * offset_return)
   1.821 +        GnomeVFSMethodHandle * method_handle,
   1.822 +        GnomeVFSFileSize * offset_return)
   1.823  {
   1.824 -  MythtvHandle *myth_handle = NULL;
   1.825 +    MythtvHandle   *myth_handle = NULL;
   1.826  
   1.827 -  _GNOME_VFS_METHOD_PARAM_CHECK(method_handle != NULL);
   1.828 +    _GNOME_VFS_METHOD_PARAM_CHECK(method_handle != NULL);
   1.829  
   1.830 -  myth_handle = (MythtvHandle *) method_handle;
   1.831 -  *offset_return = myth_handle->offset;
   1.832 +    myth_handle = (MythtvHandle *) method_handle;
   1.833 +    *offset_return = myth_handle->offset;
   1.834  
   1.835 -  return GNOME_VFS_OK;
   1.836 +    return GNOME_VFS_OK;
   1.837  }
   1.838  
   1.839 -static GnomeVFSResult
   1.840 +static          GnomeVFSResult
   1.841  do_truncate_handle(GnomeVFSMethod * method,
   1.842 -				   GnomeVFSMethodHandle * method_handle,
   1.843 -				   GnomeVFSFileSize where, GnomeVFSContext * context)
   1.844 +                   GnomeVFSMethodHandle * method_handle,
   1.845 +                   GnomeVFSFileSize where, GnomeVFSContext * context)
   1.846  {
   1.847 -  return GNOME_VFS_ERROR_READ_ONLY;
   1.848 +    return GNOME_VFS_ERROR_READ_ONLY;
   1.849  }
   1.850  
   1.851 -static GnomeVFSResult
   1.852 +static          GnomeVFSResult
   1.853  do_open_directory(GnomeVFSMethod * method,
   1.854 -				  GnomeVFSMethodHandle ** method_handle,
   1.855 -				  GnomeVFSURI * uri,
   1.856 -				  GnomeVFSFileInfoOptions options, GnomeVFSContext * context)
   1.857 +                  GnomeVFSMethodHandle ** method_handle,
   1.858 +                  GnomeVFSURI * uri,
   1.859 +                  GnomeVFSFileInfoOptions options,
   1.860 +                  GnomeVFSContext * context)
   1.861  {
   1.862 -  return GNOME_VFS_ERROR_NOT_SUPPORTED;
   1.863 +    return GNOME_VFS_ERROR_NOT_SUPPORTED;
   1.864  }
   1.865  
   1.866 -static GnomeVFSResult
   1.867 +static          GnomeVFSResult
   1.868  do_close_directory(GnomeVFSMethod * method,
   1.869 -				   GnomeVFSMethodHandle * method_handle,
   1.870 -				   GnomeVFSContext * context)
   1.871 +                   GnomeVFSMethodHandle * method_handle,
   1.872 +                   GnomeVFSContext * context)
   1.873  {
   1.874 -  return GNOME_VFS_ERROR_NOT_SUPPORTED;
   1.875 +    return GNOME_VFS_ERROR_NOT_SUPPORTED;
   1.876  }
   1.877  
   1.878 -static GnomeVFSResult
   1.879 +static          GnomeVFSResult
   1.880  do_read_directory(GnomeVFSMethod * method,
   1.881 -				  GnomeVFSMethodHandle * method_handle,
   1.882 -				  GnomeVFSFileInfo * file_info, GnomeVFSContext * context)
   1.883 +                  GnomeVFSMethodHandle * method_handle,
   1.884 +                  GnomeVFSFileInfo * file_info, GnomeVFSContext * context)
   1.885  {
   1.886 -  return GNOME_VFS_ERROR_NOT_SUPPORTED;
   1.887 +    return GNOME_VFS_ERROR_NOT_SUPPORTED;
   1.888  }
   1.889  
   1.890  
   1.891 -static GnomeVFSResult
   1.892 +static          GnomeVFSResult
   1.893  do_get_file_info(GnomeVFSMethod * method,
   1.894 -				 GnomeVFSURI * uri,
   1.895 -				 GnomeVFSFileInfo * file_info,
   1.896 -				 GnomeVFSFileInfoOptions options, GnomeVFSContext * context)
   1.897 +                 GnomeVFSURI * uri,
   1.898 +                 GnomeVFSFileInfo * file_info,
   1.899 +                 GnomeVFSFileInfoOptions options,
   1.900 +                 GnomeVFSContext * context)
   1.901  {
   1.902 -  return myth_get_file_info(NULL, uri, file_info);
   1.903 +    return myth_get_file_info(NULL, uri, file_info);
   1.904  }
   1.905  
   1.906 -static GnomeVFSResult
   1.907 +static          GnomeVFSResult
   1.908  do_get_file_info_from_handle(GnomeVFSMethod * method,
   1.909 -							 GnomeVFSMethodHandle * method_handle,
   1.910 -							 GnomeVFSFileInfo * file_info,
   1.911 -							 GnomeVFSFileInfoOptions options,
   1.912 -							 GnomeVFSContext * context)
   1.913 +                             GnomeVFSMethodHandle * method_handle,
   1.914 +                             GnomeVFSFileInfo * file_info,
   1.915 +                             GnomeVFSFileInfoOptions options,
   1.916 +                             GnomeVFSContext * context)
   1.917  {
   1.918 -  MythtvHandle *myth_handle = (MythtvHandle *) method_handle;
   1.919 +    MythtvHandle   *myth_handle = (MythtvHandle *) method_handle;
   1.920  
   1.921 -  return myth_get_file_info(myth_handle, NULL, file_info);
   1.922 +    return myth_get_file_info(myth_handle, NULL, file_info);
   1.923  }
   1.924  
   1.925 -static gboolean
   1.926 +static          gboolean
   1.927  do_is_local(GnomeVFSMethod * method, const GnomeVFSURI * uri)
   1.928  {
   1.929 -  return FALSE;
   1.930 +    return FALSE;
   1.931  }
   1.932  
   1.933 -static GnomeVFSResult
   1.934 +static          GnomeVFSResult
   1.935  do_make_directory(GnomeVFSMethod * method,
   1.936 -				  GnomeVFSURI * uri, guint perm, GnomeVFSContext * context)
   1.937 +                  GnomeVFSURI * uri, guint perm, GnomeVFSContext * context)
   1.938  {
   1.939 -  return GNOME_VFS_ERROR_READ_ONLY;
   1.940 +    return GNOME_VFS_ERROR_READ_ONLY;
   1.941  }
   1.942  
   1.943 -static GnomeVFSResult
   1.944 +static          GnomeVFSResult
   1.945  do_remove_directory(GnomeVFSMethod * method,
   1.946 -					GnomeVFSURI * uri, GnomeVFSContext * context)
   1.947 +                    GnomeVFSURI * uri, GnomeVFSContext * context)
   1.948  {
   1.949 -  return GNOME_VFS_ERROR_READ_ONLY;
   1.950 +    return GNOME_VFS_ERROR_READ_ONLY;
   1.951  }
   1.952  
   1.953 -static GnomeVFSResult
   1.954 +static          GnomeVFSResult
   1.955  do_move(GnomeVFSMethod * method,
   1.956 -		GnomeVFSURI * old_uri,
   1.957 -		GnomeVFSURI * new_uri,
   1.958 -		gboolean force_replace, GnomeVFSContext * context)
   1.959 +        GnomeVFSURI * old_uri,
   1.960 +        GnomeVFSURI * new_uri,
   1.961 +        gboolean force_replace, GnomeVFSContext * context)
   1.962  {
   1.963 -  return GNOME_VFS_ERROR_READ_ONLY;
   1.964 +    return GNOME_VFS_ERROR_READ_ONLY;
   1.965  }
   1.966  
   1.967 -static GnomeVFSResult
   1.968 +static          GnomeVFSResult
   1.969  do_unlink(GnomeVFSMethod * method,
   1.970 -		  GnomeVFSURI * uri, GnomeVFSContext * context)
   1.971 +          GnomeVFSURI * uri, GnomeVFSContext * context)
   1.972  {
   1.973 -  return GNOME_VFS_ERROR_READ_ONLY;
   1.974 +    return GNOME_VFS_ERROR_READ_ONLY;
   1.975  }
   1.976  
   1.977 -static GnomeVFSResult
   1.978 +static          GnomeVFSResult
   1.979  do_check_same_fs(GnomeVFSMethod * method,
   1.980 -				 GnomeVFSURI * a,
   1.981 -				 GnomeVFSURI * b,
   1.982 -				 gboolean * same_fs_return, GnomeVFSContext * context)
   1.983 +                 GnomeVFSURI * a,
   1.984 +                 GnomeVFSURI * b,
   1.985 +                 gboolean * same_fs_return, GnomeVFSContext * context)
   1.986  {
   1.987 -  return GNOME_VFS_ERROR_NOT_SUPPORTED;
   1.988 +    return GNOME_VFS_ERROR_NOT_SUPPORTED;
   1.989  }
   1.990  
   1.991 -static GnomeVFSResult
   1.992 +static          GnomeVFSResult
   1.993  do_set_file_info(GnomeVFSMethod * method,
   1.994 -				 GnomeVFSURI * uri,
   1.995 -				 const GnomeVFSFileInfo * info,
   1.996 -				 GnomeVFSSetFileInfoMask mask, GnomeVFSContext * context)
   1.997 +                 GnomeVFSURI * uri,
   1.998 +                 const GnomeVFSFileInfo * info,
   1.999 +                 GnomeVFSSetFileInfoMask mask, GnomeVFSContext * context)
  1.1000  {
  1.1001 -  return GNOME_VFS_ERROR_READ_ONLY;
  1.1002 +    return GNOME_VFS_ERROR_READ_ONLY;
  1.1003  }
  1.1004  
  1.1005 -static GnomeVFSResult
  1.1006 +static          GnomeVFSResult
  1.1007  do_truncate(GnomeVFSMethod * method,
  1.1008 -			GnomeVFSURI * uri,
  1.1009 -			GnomeVFSFileSize where, GnomeVFSContext * context)
  1.1010 +            GnomeVFSURI * uri,
  1.1011 +            GnomeVFSFileSize where, GnomeVFSContext * context)
  1.1012  {
  1.1013 -  return GNOME_VFS_ERROR_READ_ONLY;
  1.1014 +    return GNOME_VFS_ERROR_READ_ONLY;
  1.1015  }
  1.1016  
  1.1017 -static GnomeVFSResult
  1.1018 +static          GnomeVFSResult
  1.1019  do_find_directory(GnomeVFSMethod * method,
  1.1020 -				  GnomeVFSURI * near_uri,
  1.1021 -				  GnomeVFSFindDirectoryKind kind,
  1.1022 -				  GnomeVFSURI ** result_uri,
  1.1023 -				  gboolean create_if_needed,
  1.1024 -				  gboolean find_if_needed,
  1.1025 -				  guint permissions, GnomeVFSContext * context)
  1.1026 +                  GnomeVFSURI * near_uri,
  1.1027 +                  GnomeVFSFindDirectoryKind kind,
  1.1028 +                  GnomeVFSURI ** result_uri,
  1.1029 +                  gboolean create_if_needed,
  1.1030 +                  gboolean find_if_needed,
  1.1031 +                  guint permissions, GnomeVFSContext * context)
  1.1032  {
  1.1033 -  return GNOME_VFS_ERROR_NOT_SUPPORTED;
  1.1034 +    return GNOME_VFS_ERROR_NOT_SUPPORTED;
  1.1035  }
  1.1036  
  1.1037 -static GnomeVFSResult
  1.1038 +static          GnomeVFSResult
  1.1039  do_create_symbolic_link(GnomeVFSMethod * method,
  1.1040 -						GnomeVFSURI * uri,
  1.1041 -						const char *target_reference,
  1.1042 -						GnomeVFSContext * context)
  1.1043 +                        GnomeVFSURI * uri,
  1.1044 +                        const char *target_reference,
  1.1045 +                        GnomeVFSContext * context)
  1.1046  {
  1.1047 -  return GNOME_VFS_ERROR_READ_ONLY;
  1.1048 +    return GNOME_VFS_ERROR_READ_ONLY;
  1.1049  }
  1.1050  
  1.1051 -static GnomeVFSResult
  1.1052 +static          GnomeVFSResult
  1.1053  do_monitor_add(GnomeVFSMethod * method,
  1.1054 -			   GnomeVFSMethodHandle ** method_handle_return,
  1.1055 -			   GnomeVFSURI * uri, GnomeVFSMonitorType monitor_type)
  1.1056 +               GnomeVFSMethodHandle ** method_handle_return,
  1.1057 +               GnomeVFSURI * uri, GnomeVFSMonitorType monitor_type)
  1.1058  {
  1.1059 -  return GNOME_VFS_ERROR_NOT_SUPPORTED;
  1.1060 +    return GNOME_VFS_ERROR_NOT_SUPPORTED;
  1.1061  }
  1.1062  
  1.1063 -static GnomeVFSResult
  1.1064 +static          GnomeVFSResult
  1.1065  do_monitor_cancel(GnomeVFSMethod * method,
  1.1066 -				  GnomeVFSMethodHandle * method_handle)
  1.1067 +                  GnomeVFSMethodHandle * method_handle)
  1.1068  {
  1.1069 -  return GNOME_VFS_ERROR_NOT_SUPPORTED;
  1.1070 +    return GNOME_VFS_ERROR_NOT_SUPPORTED;
  1.1071  }
  1.1072  
  1.1073 -static GnomeVFSResult
  1.1074 +static          GnomeVFSResult
  1.1075  do_file_control(GnomeVFSMethod * method,
  1.1076 -				GnomeVFSMethodHandle * method_handle,
  1.1077 -				const char *operation,
  1.1078 -				gpointer operation_data, GnomeVFSContext * context)
  1.1079 +                GnomeVFSMethodHandle * method_handle,
  1.1080 +                const char *operation,
  1.1081 +                gpointer operation_data, GnomeVFSContext * context)
  1.1082  {
  1.1083 -  return GNOME_VFS_ERROR_NOT_SUPPORTED;
  1.1084 +    return GNOME_VFS_ERROR_NOT_SUPPORTED;
  1.1085  }
  1.1086  
  1.1087  static GnomeVFSMethod method = {
  1.1088 -  sizeof(GnomeVFSMethod),
  1.1089 -  do_open,
  1.1090 -  do_create,
  1.1091 -  do_close,
  1.1092 -  do_read,
  1.1093 -  do_write,
  1.1094 -  do_seek,
  1.1095 -  do_tell,
  1.1096 -  do_truncate_handle,
  1.1097 -  do_open_directory,
  1.1098 -  do_close_directory,
  1.1099 -  do_read_directory,
  1.1100 -  do_get_file_info,
  1.1101 -  do_get_file_info_from_handle,
  1.1102 -  do_is_local,
  1.1103 -  do_make_directory,
  1.1104 -  do_remove_directory,
  1.1105 -  do_move,
  1.1106 -  do_unlink,
  1.1107 -  do_check_same_fs,
  1.1108 -  do_set_file_info,
  1.1109 -  do_truncate,
  1.1110 -  do_find_directory,
  1.1111 -  do_create_symbolic_link,
  1.1112 -  do_monitor_add,
  1.1113 -  do_monitor_cancel,
  1.1114 -  do_file_control
  1.1115 +    sizeof(GnomeVFSMethod),
  1.1116 +    do_open,
  1.1117 +    do_create,
  1.1118 +    do_close,
  1.1119 +    do_read,
  1.1120 +    do_write,
  1.1121 +    do_seek,
  1.1122 +    do_tell,
  1.1123 +    do_truncate_handle,
  1.1124 +    do_open_directory,
  1.1125 +    do_close_directory,
  1.1126 +    do_read_directory,
  1.1127 +    do_get_file_info,
  1.1128 +    do_get_file_info_from_handle,
  1.1129 +    do_is_local,
  1.1130 +    do_make_directory,
  1.1131 +    do_remove_directory,
  1.1132 +    do_move,
  1.1133 +    do_unlink,
  1.1134 +    do_check_same_fs,
  1.1135 +    do_set_file_info,
  1.1136 +    do_truncate,
  1.1137 +    do_find_directory,
  1.1138 +    do_create_symbolic_link,
  1.1139 +    do_monitor_add,
  1.1140 +    do_monitor_cancel,
  1.1141 +    do_file_control
  1.1142  };
  1.1143  
  1.1144  
  1.1145  GnomeVFSMethod *
  1.1146  vfs_module_init(const char *method_name, const char *args)
  1.1147  {
  1.1148 -  return &method;
  1.1149 +    return &method;
  1.1150  }
  1.1151  
  1.1152  void