view lib/bookmark.c @ 341:eedc2c5727fa

2003-12-28 Brian Masney <masneyb@gftp.org> **** NOTE: this commit breaks a lot of functionality in gftp. I **** **** still have more work to do on this. Please don't email me **** **** saying that the CVS code is broken. **** * lib/bookmark.c lib/gftp.h lib/local.c lib/options.h lib/rfc2068.c lib/rfc959.c lib/sshv2.c - moved the use_threads option from the request structure over to the protocol declaration in options.h. * lib/options.h src/gtk/gftp-gtk.c - added cmd_in_gui option. When this option is enabled, a new toolbar will be shown in the GTK+ port that will allow you to control the GUI by entering manual commands. * src/Makefile.am - added uicommon directory * src/gtk/Makefile.am src/text/Makefile.am - link in the uicommon library. * src/uicommon/* src/text/gftp-text.c - moved most of the functionality of the text port over to the uicommon directory. Made this code a little more generic so that the GTK+ port can have a text interface associated with it. * src/gtk/gtkui.c src/gtk/gftp-gtk.c src/gtk/mkdir_dialog.c src/gtk/rename_dialog.c src/gtk/menu-items.c src/gtk/misc-gtk.c - started to clean up the callback functions and make them more tightly integrated with the uicommon code. * src/gtk/bookmarks.c src/gtk/chmod_dialog.c src/gtk/delete_dialog.c src/gtk/gftp-gtk.c src/gtk/menu-items.c src/gtk/misc-gtk.c src/gtk/transfer.c - s/refresh/gftpui_refresh/g s/jmp_environment/gftpui_common_jmp_environment/g s/request->use_threads/gftpui_common_use_threads (request)/g * src/gtk/options_dialog.c (apply_changes) - whenever the options are saved, check to see if the command entry needs to be shown or hidden.
author masneyb
date Sun, 28 Dec 2003 16:02:07 +0000
parents 5810b0f97eee
children fbb5a02beddb
line wrap: on
line source

/*****************************************************************************/
/*  bookmark.c - functions for connecting to a site via a bookmark           */
/*  Copyright (C) 1998-2003 Brian Masney <masneyb@gftp.org>                  */
/*                                                                           */
/*  This program is free software; you can redistribute it and/or modify     */
/*  it under the terms of the GNU General Public License as published by     */
/*  the Free Software Foundation; either version 2 of the License, or        */
/*  (at your option) any later version.                                      */
/*                                                                           */
/*  This program is distributed in the hope that it will be useful,          */
/*  but WITHOUT ANY WARRANTY; without even the implied warranty of           */
/*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            */
/*  GNU General Public License for more details.                             */
/*                                                                           */
/*  You should have received a copy of the GNU General Public License        */
/*  along with this program; if not, write to the Free Software              */
/*  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA      */
/*****************************************************************************/

#include "gftp.h"
static const char cvsid[] = "$Id$";


static int
bookmark_parse_url (gftp_request * request, const char * url)
{
  const char * pos;
  int update_local;

  g_return_val_if_fail (request != NULL, GFTP_EFATAL);
  g_return_val_if_fail (url != NULL, GFTP_EFATAL);
  
  if ((pos = strstr (url, "://")) != NULL)
    {
      pos += 3;
      if (strncmp (url, "bookmark://", 11) != 0)
        {
          request->logging_function (gftp_logging_error, request,
                                 _("Invalid URL %s\n"), url);
          return (GFTP_EFATAL);
        }
    }
  else
    pos = url;

  return (gftp_parse_bookmark (request, NULL, pos, &update_local));
}


void 
bookmark_register_module (void)
{
}


int
bookmark_init (gftp_request * request)
{
  g_return_val_if_fail (request != NULL, GFTP_EFATAL);

  request->protonum = GFTP_BOOKMARK_NUM;
  request->init = bookmark_init;
  request->read_function = NULL;
  request->write_function = NULL;
  request->destroy = NULL;
  request->connect = NULL;
  request->post_connect = NULL;
  request->disconnect = NULL;
  request->get_file = NULL;
  request->put_file = NULL;
  request->transfer_file = NULL;
  request->get_next_file_chunk = NULL;
  request->put_next_file_chunk = NULL;
  request->end_transfer = NULL;
  request->list_files = NULL;
  request->get_next_file = NULL;
  request->get_file_size = NULL;
  request->chdir = NULL;
  request->rmdir = NULL;
  request->rmfile = NULL;
  request->mkdir = NULL;
  request->rename = NULL;
  request->chmod = NULL;
  request->set_file_time = NULL;
  request->site = NULL;
  request->parse_url = bookmark_parse_url;
  request->url_prefix = "bookmark";
  request->need_hostport = 0;
  request->need_userpass = 0;
  request->use_cache = 0;
  request->always_connected = 0;

  return (gftp_set_config_options (request));
}