1 /***************************************************************************/ 2 /* */ 3 /* Fast Webpage Exchanger - an FTP client for updating webpages */ 4 /* Copyright (C) 1999-2000 Yuuki NINOMIYA <gm@debian.or.jp> */ 5 /* */ 6 /* This program is free software; you can redistribute it and/or modify */ 7 /* it under the terms of the GNU General Public License as published by */ 8 /* the Free Software Foundation; either version 2, or (at your option) */ 9 /* any later version. */ 10 /* */ 11 /* This program is distributed in the hope that it will be useful, */ 12 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 13 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 14 /* GNU General Public License for more details. */ 15 /* */ 16 /* You should have received a copy of the GNU General Public License */ 17 /* along with this program; if not, write to the */ 18 /* Free Software Foundation, Inc., 59 Temple Place - Suite 330, */ 19 /* Boston, MA 02111-1307, USA. */ 20 /* */ 21 /***************************************************************************/ 22 23 #ifndef PROTO_H_INCLUDED 24 #define PROTO_H_INCLUDED 25 26 27 #include <sys/types.h> 28 29 /* weex.c */ 30 31 void put_usage(void); 32 void put_version(void); 33 void put_config(int max_hosts); 34 35 36 /* config.c */ 37 38 void make_weex_directory(void); 39 char *config_location(void); 40 int read_config(void); 41 void check_permission(char *file); 42 void set_default(int max_hosts); 43 void set_str_default(int host,int default_num,char **str_pointer); 44 void set_list_default(int host,int default_num,cfgList **list_pointer); 45 void set_bool_default(int host,int default_num,int bool_default,int *bool_pointer); 46 void set_int_default(int host,int default_num,int default_val,int *int_pointer); 47 void str_attach_slash_to_trailing(int host,char **str_pointer); 48 void list_attach_slash_to_trailing(int host,cfgList **list_pointer); 49 void absolutize_path(int host,char *base_dir,cfgList **list_absolute_path); 50 void absolutize_file(int host,char *base_dir,cfgList **list_absolute_file); 51 52 53 /* ftp_main.c */ 54 55 void ftp_main(int argc,char *argv[],int max_hosts); 56 int ftp_connect_init(void); 57 int argv_to_host_num(char *arg); 58 int ftp_connect(void); 59 int ftp_login(void); 60 void change_dir(char *path,LocalOrRemote side); 61 void up_dir(LocalOrRemote side); 62 void change_dir_actually(LocalOrRemote side); 63 void ftp_disconnect(void); 64 void ftp_recursive_search(void); 65 void remove_files_on_remote_only(int max_local_file,int max_remote_file,FileData *local_data,FileData *remote_data,int dir_nest,int *dir_removed_file); 66 int get_equivalent_remote_number(char *local_name,int max_remote_file,FileData *remote_data); 67 int get_equivalent_local_number(char *remote_name,int max_local_file,FileData *local_data); 68 void ftp_enter(char *dir_name,int remote_isdir,int dir_nest,int remote_num,int *dir_removed_file); 69 void ftp_remove(char *file_name,int dir_nest,int *dir_removed_file); 70 void remove_remote_dir(char *dir_name,int dir_nest,int *dir_removed_file); 71 void ftp_mkdir(char *dir_name); 72 73 74 /* cache.c */ 75 76 void load_cache(void); 77 int get_cache(char *file_name,long *date,long *time); 78 void update_cache(char *file_name,long date,long time); 79 void del_cache(char *file_name); 80 void del_cache_dir(char *dir_name); 81 void save_cache(void); 82 void update_cache_directory(char *dir); 83 int find_cache_dir(char *name); 84 int get_remote_file_data_from_cache(FileData **remote_data); 85 86 87 /* message.c */ 88 89 void put_mes(Message mes,int nest, ...); 90 91 92 /* filedata.c */ 93 94 int get_local_file_data(FileData **local_data); 95 int get_remote_file_data(FileData **remote_data); 96 void free_file_data(FileData *file_data,int max_file_data); 97 int parse_file_and_filetype(char *str,char **file); 98 int is_ignore_file(char *file_name,LocalOrRemote side); 99 int is_ignore_dir(char *dir_name,LocalOrRemote side); 100 int is_ascii_file(char *file_name); 101 int is_change_permission_dir(void); 102 int is_preserve_permission_dir(void); 103 int is_keep_remote_dir(void); 104 105 106 /* sub.c */ 107 108 long n_atol(char *str,int n); 109 int cmp_file_with_wildcard(char *real_name,char *wild_name); 110 char *cnvregexp(char *str); 111 112 113 /* log.c */ 114 115 void log_init(void); 116 FILE *log_open(void); 117 void log_close(FILE *fp); 118 void log_write(char *str); 119 void log_flush(void); 120 121 122 #endif /* PROTO_H_INCLUDED */ 123 124