comparison lib/local.c @ 122:76e2b58a9440

2003-4-5 Brian Masney <masneyb@gftp.org> * lib/config_file.c lib/options.h lib/gftp.h lib/rfc959.c lib/rfc2068.c lib/ssh.c - added new internal configuration interface. Rather than having a global variable for each option, I have a global hash table (gftp_global_options_htable) that I can look up option names by name using gftp_lookup_global_option(). I also an options hash associated with a request structure, so I will be able to call gftp_lookup_request_option(). I will be able to override options with bookmarks or while transfers are in progress very easily now. Also, all options no longer have to appear in config_file.c, the per protocol options can appear inside their own file * lib/gftp.h lib/bookmarks.c lib/local.c lib/rfc959.c lib/rfc2068.c - remove set_data_type and protocol name from struct gftp_request * lib/rfc959.c - renamed all firewall_* variables to ftp_proxy_* in the config file * lib/gftp.h lib/protocols.c lib/rfc959.c - renamed all GFTP_TYPE_* vars to GFTP_DIRTYPE_* * lib/gftp.h - removed ascii field and renamed the node pointer to user_data in struct gftp_file. In gftp_request, removed any setting that is now stored in the global/local hash tables. Added register_module() pointer that will be called whenever the protocol is first loaded into gftp * lib/rfc959.c src/text/gftp-text.c - moved the ascii/binary translation to rfc959.c. Also, moved any instance of automatically setting the data type to rfc959.c as well. * lib/misc.c lib/sshv2.c - moved all ssh functions from misc.c to sshv2.c. I had these origionally in misc.c because I used to have 2 different SSH protocols * lib/protocols.c src/text/gftp-text.c - added gftp_calc_kbs() to protocols.c. This no longer needs to be in the different ports * src/text/gftp-text.c - read/write options based on new configuration interface * Use new configuration interface in all source files * Updated copyright dates on all source files * Note: GTK+ port is completely broken at the moment. I'll upload those changes whenever I get them done
author masneyb
date Sat, 05 Apr 2003 16:30:45 +0000
parents 8c37d73d3f1f
children 84b3e69807a2
comparison
equal deleted inserted replaced
121:1b41e6945e9d 122:76e2b58a9440
1 /*****************************************************************************/ 1 /*****************************************************************************/
2 /* local.c - functions that will use the local system */ 2 /* local.c - functions that will use the local system */
3 /* Copyright (C) 1998-2002 Brian Masney <masneyb@gftp.org> */ 3 /* Copyright (C) 1998-2003 Brian Masney <masneyb@gftp.org> */
4 /* */ 4 /* */
5 /* This program is free software; you can redistribute it and/or modify */ 5 /* This program is free software; you can redistribute it and/or modify */
6 /* it under the terms of the GNU General Public License as published by */ 6 /* it under the terms of the GNU General Public License as published by */
7 /* the Free Software Foundation; either version 2 of the License, or */ 7 /* the Free Software Foundation; either version 2 of the License, or */
8 /* (at your option) any later version. */ 8 /* (at your option) any later version. */
630 { 630 {
631 return (GPOINTER_TO_UINT (key)); 631 return (GPOINTER_TO_UINT (key));
632 } 632 }
633 633
634 634
635 void
636 local_register_module (void)
637 {
638 }
639
640
635 void 641 void
636 local_init (gftp_request * request) 642 local_init (gftp_request * request)
637 { 643 {
638 local_protocol_data *lpd; 644 local_protocol_data *lpd;
639 645
651 request->put_next_file_chunk = NULL; 657 request->put_next_file_chunk = NULL;
652 request->end_transfer = local_end_transfer; 658 request->end_transfer = local_end_transfer;
653 request->abort_transfer = local_end_transfer; /* NOTE: uses end_transfer */ 659 request->abort_transfer = local_end_transfer; /* NOTE: uses end_transfer */
654 request->list_files = local_list_files; 660 request->list_files = local_list_files;
655 request->get_next_file = local_get_next_file; 661 request->get_next_file = local_get_next_file;
656 request->set_data_type = NULL;
657 request->get_file_size = local_get_file_size; 662 request->get_file_size = local_get_file_size;
658 request->chdir = local_chdir; 663 request->chdir = local_chdir;
659 request->rmdir = local_rmdir; 664 request->rmdir = local_rmdir;
660 request->rmfile = local_rmfile; 665 request->rmfile = local_rmfile;
661 request->mkdir = local_mkdir; 666 request->mkdir = local_mkdir;
665 request->site = NULL; 670 request->site = NULL;
666 request->parse_url = NULL; 671 request->parse_url = NULL;
667 request->set_config_options = NULL; 672 request->set_config_options = NULL;
668 request->swap_socks = NULL; 673 request->swap_socks = NULL;
669 request->url_prefix = "file"; 674 request->url_prefix = "file";
670 request->protocol_name = "Local";
671 request->need_hostport = 0; 675 request->need_hostport = 0;
672 request->need_userpass = 0; 676 request->need_userpass = 0;
673 request->use_cache = 0; 677 request->use_cache = 0;
674 request->use_threads = 0; 678 request->use_threads = 0;
675 request->always_connected = 1; 679 request->always_connected = 1;