annotate lib/gftp.h @ 136:84b3e69807a2

2003-4-18 Brian Masney <masneyb@gftp.org> * lib/config_file.c lib/gftp.h - removed gftp_option_type_subtree, gftp_option_type_table and gftp_option_type_newtable * lib/config_file.c - implemented gftp_set_request_option() * lib/gftp.h lib/config_file.c - changed declaration of ui_print_function in struct gftp_option_type. Also added ui_save_function field to this structure * lib/gftp.h added local_options_vars num_local_options_vars variables to gftp_request * lib/local.c (local_set_directory) - small improvements to this function * lib/misc.c - added gftp_copy_local_options() * lib/options.h - fix declaration of General tab * lib/protocols.c - free local options * lib/rfc2068.c - check to see if we're connecting to a FTP site via proxy * lib/rfc959.c lib/protocols.c - changes for CRAY directory listings * src/gtk/gftp-gtk.h - added struct gftp_options_dialog_data and struct gftp_textcomboedt_widget_data * src/gtk/options_dialog.c - start to use new configuration interface * src/gtk/transfer.c - remove FIXME note. This is already in lib/gftp.h
author masneyb
date Fri, 18 Apr 2003 19:38:34 +0000
parents c77f85763e28
children c363b08e0118
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
1 /*****************************************************************************/
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
2 /* gftp.h - include file for the whole ftp program */
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
3 /* Copyright (C) 1998-2003 Brian Masney <masneyb@gftp.org> */
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
4 /* */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
5 /* This program is free software; you can redistribute it and/or modify */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
6 /* it under the terms of the GNU General Public License as published by */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
7 /* the Free Software Foundation; either version 2 of the License, or */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
8 /* (at your option) any later version. */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
9 /* */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
10 /* This program is distributed in the hope that it will be useful, */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
11 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
12 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
13 /* GNU General Public License for more details. */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
14 /* */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
15 /* You should have received a copy of the GNU General Public License */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
16 /* along with this program; if not, write to the Free Software */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
17 /* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
18 /*****************************************************************************/
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
19
33
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
20 /* $Id$ */
c8ec7877432e 2002-10-06 Brian Masney <masneyb@gftp.org>
masneyb
parents: 26
diff changeset
21
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
22 #ifndef __GFTP_H
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
23 #define __GFTP_H
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
24
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
25 #ifdef HAVE_CONFIG_H
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
26 #include "config.h"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
27 #endif
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
28
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
29 #include <sys/types.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
30 #include <sys/stat.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
31 #include <sys/socket.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
32 #include <sys/time.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
33 #ifndef TIOCGWINSZ
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
34 #include <sys/ioctl.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
35 #endif
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
36 #include <sys/wait.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
37 #include <sys/utsname.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
38 #include <netinet/in.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
39 #include <arpa/inet.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
40 #include <glib.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
41 #include <limits.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
42 #include <netdb.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
43 #include <stdio.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
44 #include <stdarg.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
45 #include <stdlib.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
46 #include <errno.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
47 #include <fcntl.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
48 #include <unistd.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
49 #include <ctype.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
50 #include <time.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
51 #include <utime.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
52 #include <signal.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
53 #include <termios.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
54 #include <pwd.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
55 #include <setjmp.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
56 #include <dirent.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
57 #include <grp.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
58 #include <math.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
59
80
f4f6f44225d3 2002-12-10 Brian Masney <masneyb@gftp.org>
masneyb
parents: 74
diff changeset
60 #ifdef HAVE_GRANTPT
f4f6f44225d3 2002-12-10 Brian Masney <masneyb@gftp.org>
masneyb
parents: 74
diff changeset
61 #include <stropts.h>
f4f6f44225d3 2002-12-10 Brian Masney <masneyb@gftp.org>
masneyb
parents: 74
diff changeset
62 #endif
f4f6f44225d3 2002-12-10 Brian Masney <masneyb@gftp.org>
masneyb
parents: 74
diff changeset
63
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
64 #ifdef HAVE_STRING_H
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
65 #include <string.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
66 #else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
67 #include <strings.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
68 #endif
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
69
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
70 #ifdef ENABLE_NLS
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
71 #include <libintl.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
72 #include <locale.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
73 #define _(String) gettext (String)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
74 #else
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
75 #define _(String) String
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
76 #endif
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
77 #define N_(String) String
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
78
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
79 #ifndef AF_LOCAL
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
80 #define AF_LOCAL AF_UNIX
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
81 #endif
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
82
48
e5f6054590b5 2002-11-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 47
diff changeset
83 /* We need the major() and minor() macros in the user interface. If they aren't
e5f6054590b5 2002-11-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 47
diff changeset
84 defined by the system, we'll just define them here. */
e5f6054590b5 2002-11-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 47
diff changeset
85 #ifndef major
e5f6054590b5 2002-11-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 47
diff changeset
86 #warning major macro was not defined by the system. Defining one that is probably wrong for your system
e5f6054590b5 2002-11-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 47
diff changeset
87 #define major(dev) (((dev) >> 8) & 0xff)
e5f6054590b5 2002-11-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 47
diff changeset
88 #endif
e5f6054590b5 2002-11-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 47
diff changeset
89
e5f6054590b5 2002-11-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 47
diff changeset
90 #ifndef minor
e5f6054590b5 2002-11-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 47
diff changeset
91 #warning minor macro was not defined by the system. Defining one that is probably wrong for your system
e5f6054590b5 2002-11-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 47
diff changeset
92 #define minor(dev) ((dev) & 0xff)
e5f6054590b5 2002-11-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 47
diff changeset
93 #endif
e5f6054590b5 2002-11-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 47
diff changeset
94
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
95 #ifdef HAVE_DMALLOC
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
96 #include <dmalloc.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
97 #endif
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
98
91
8c37d73d3f1f 2003-1-21 Brian Masney <masneyb@gftp.org>
masneyb
parents: 87
diff changeset
99 /* Server types (used by FTP protocol from SYST command) */
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
100 #define GFTP_DIRTYPE_UNIX 1
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
101 #define GFTP_DIRTYPE_EPLF 2
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
102 #define GFTP_DIRTYPE_CRAY 3
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
103 #define GFTP_DIRTYPE_NOVELL 4
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
104 #define GFTP_DIRTYPE_DOS 5
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
105 #define GFTP_DIRTYPE_VMS 6
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
106 #define GFTP_DIRTYPE_OTHER 7
91
8c37d73d3f1f 2003-1-21 Brian Masney <masneyb@gftp.org>
masneyb
parents: 87
diff changeset
107
84
7ef60ce2bdb2 2002-12-29 Brian Masney <masneyb@gftp.org>
masneyb
parents: 80
diff changeset
108 /* Error types */
7ef60ce2bdb2 2002-12-29 Brian Masney <masneyb@gftp.org>
masneyb
parents: 80
diff changeset
109 #define GFTP_ERETRYABLE -1
7ef60ce2bdb2 2002-12-29 Brian Masney <masneyb@gftp.org>
masneyb
parents: 80
diff changeset
110 #define GFTP_EFATAL -2
7ef60ce2bdb2 2002-12-29 Brian Masney <masneyb@gftp.org>
masneyb
parents: 80
diff changeset
111
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
112 /* Some general settings */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
113 #define BASE_CONF_DIR "~/.gftp"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
114 #define CONFIG_FILE BASE_CONF_DIR "/gftprc"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
115 #define BOOKMARKS_FILE BASE_CONF_DIR "/bookmarks"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
116 #define LOG_FILE BASE_CONF_DIR "/gftp.log"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
117 #define MAX_HIST_LEN 10
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
118
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
119 typedef enum gftp_transfer_type_tag
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
120 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
121 gftp_transfer_passive,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
122 gftp_transfer_active
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
123 } gftp_transfer_type;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
124
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
125
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
126 typedef enum gftp_logging_level_tag
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
127 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
128 gftp_logging_send,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
129 gftp_logging_recv,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
130 gftp_logging_error,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
131 gftp_logging_misc
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
132 } gftp_logging_level;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
133
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
134 typedef void (*gftp_logging_func) ( gftp_logging_level level,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
135 void *ptr,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
136 const char *string, ... );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
137
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
138
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
139 typedef struct gftp_file_tag gftp_file;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
140
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
141 #define GFTP_TRANS_ACTION_OVERWRITE 1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
142 #define GFTP_TRANS_ACTION_RESUME 2
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
143 #define GFTP_TRANS_ACTION_SKIP 3
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
144
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
145 #define GFTP_DIRECTION_DOWNLOAD 0
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
146 #define GFTP_DIRECTION_UPLOAD 1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
147
16
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 14
diff changeset
148 #define GFTP_SORT_COL_FILE 1
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 14
diff changeset
149 #define GFTP_SORT_COL_SIZE 2
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 14
diff changeset
150 #define GFTP_SORT_COL_USER 3
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 14
diff changeset
151 #define GFTP_SORT_COL_GROUP 4
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 14
diff changeset
152 #define GFTP_SORT_COL_DATETIME 5
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 14
diff changeset
153 #define GFTP_SORT_COL_ATTRIBS 6
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 14
diff changeset
154
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
155 struct gftp_file_tag
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
156 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
157 char *file, /* Our filename */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
158 *user, /* User that owns it */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
159 *group, /* Group that owns it */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
160 *attribs, /* Attribs (-rwxr-x-rx) */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
161 *destfile; /* Full pathname to the destination for the
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
162 file transfer */
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
163
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
164 int fd; /* Already open fd for this file */
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
165 /* FIXME - add fd_open function */
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
166
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
167 time_t datetime; /* File date and time */
14
83090328581e * More largefile support. Hopefully all that is left is the configure stuff
masneyb
parents: 1
diff changeset
168 off_t size, /* Size of the file */
83090328581e * More largefile support. Hopefully all that is left is the configure stuff
masneyb
parents: 1
diff changeset
169 startsize; /* Size to start the transfer at */
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
170 unsigned int isdir : 1, /* File type */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
171 isexe : 1,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
172 islink : 1,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
173 selected : 1, /* Is this file selected? */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
174 was_sel : 1, /* Was this file selected before */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
175 shown : 1, /* Is this file shown? */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
176 done_view : 1, /* View the file when done transfering? */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
177 done_edit : 1, /* Edit the file when done transfering? */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
178 done_rm : 1, /* Remove the file when done */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
179 transfer_done : 1, /* Is current file transfer done? */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
180 is_fd : 1; /* Is this a file descriptor? */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
181 char transfer_action; /* See the GFTP_TRANS_ACTION_* vars above */
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
182 void *user_data;
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
183 };
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
184
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
185
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
186 typedef struct gftp_proxy_hosts_tag
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
187 {
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
188 /* FIXME - add IPV4 stuff here */
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
189
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
190 gint32 ipv4_network_address,
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
191 ipv4_netmask;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
192 char *domain;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
193 } gftp_proxy_hosts;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
194
136
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
195
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
196 /* Note, these numbers must match up to the index number in config_file.c
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
197 in the declaration of gftp_option_types */
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
198 typedef enum
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
199 {
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
200 gftp_option_type_text = 0,
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
201 gftp_option_type_textcombo = 1,
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
202 gftp_option_type_textcomboedt = 2,
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
203 gftp_option_type_hidetext = 3,
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
204 gftp_option_type_int = 4,
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
205 gftp_option_type_checkbox = 5,
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
206 gftp_option_type_intcombo = 6,
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
207 gftp_option_type_float = 7,
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
208 gftp_option_type_color = 8,
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
209 gftp_option_type_notebook = 9
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
210 } gftp_option_type_enum;
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
211
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
212
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
213 #define GFTP_PORT_GTK (1 << 1)
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
214 #define GFTP_PORT_TEXT (1 << 2)
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
215 #define GFTP_PORT_ALL (GFTP_PORT_GTK | GFTP_PORT_TEXT)
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
216
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
217
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
218 typedef struct gftp_config_list_vars_tag
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
219 {
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
220 char *key;
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
221 void * (*read_func) (char *buf, int line);
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
222 void (*write_func) (FILE *fd, void *data);
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
223 GList * list;
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
224 unsigned int num_items;
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
225 char *header;
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
226 } gftp_config_list_vars;
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
227
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
228
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
229 #define GFTP_CVARS_FLAGS_DYNMEM (1 << 1)
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
230
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
231
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
232 typedef struct gftp_config_vars_tag
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
233 {
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
234 char *key, /* variable name */
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
235 *description; /* How this field will show up in the dialog */
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
236 int otype; /* Type of option this is */
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
237 void *value;
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
238 void *listdata; /* For options that have several different
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
239 options, this is a list of all the options.
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
240 Each option_type that uses this will use this
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
241 field differently */
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
242 int flags; /* See GFTP_CVARS_FLAGS_* above */
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
243 char *comment; /* Comment to write out to the config file */
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
244 int ports_shown; /* What ports of gFTP is this option shown in */
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
245 void *user_data; /* Data that the GUI can store here (Widget in gtk+) */
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
246 } gftp_config_vars;
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
247
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
248
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
249 typedef struct gftp_option_type_tag
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
250 {
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
251 int (*read_function) (char *str, gftp_config_vars * cv, int line);
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
252 int (*write_function) (gftp_config_vars * cv, FILE * fd, int to_config_file);
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
253 void * (*ui_print_function) (gftp_config_vars * cv, void *user_data);
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
254 void (*ui_save_function) (gftp_config_vars * cv, void *user_data);
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
255 void *user_data;
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
256 } gftp_option_type_var;
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
257
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
258
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
259 #define GFTP_TEXTCOMBOEDT_EDITABLE (1 << 0)
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
260
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
261 typedef struct gftp_textcomboedt_data_tag
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
262 {
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
263 char *description,
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
264 *text;
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
265 int flags;
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
266 } gftp_textcomboedt_data;
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
267
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
268
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
269 typedef struct gftp_request_tag gftp_request;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
270
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
271 struct gftp_request_tag
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
272 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
273 int protonum; /* Current number of the protocol this is
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
274 set to */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
275 char *hostname, /* Hostname we will connect to */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
276 *username, /* Username for host*/
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
277 *password, /* Password for host */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
278 *account, /* Account for host (FTP only) */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
279 *directory, /* Current working directory */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
280 *url_prefix, /* URL Prefix (ex: ftp) */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
281 *last_ftp_response, /* Last response from server */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
282 *last_dir_entry; /* Last dir entry from server */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
283 size_t last_dir_entry_len; /* Length of last_dir_entry */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
284
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
285 unsigned int port; /* Port of remote site */
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
286
58
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
287 int sockfd, /* Control connection (read) */
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
288 datafd, /* Data connection */
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
289 cachefd; /* For the directory cache */
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
290 int wakeup_main_thread[2]; /* FD that gets written to by the threads
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
291 to wakeup the parent */
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
292
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
293 /* One of these are used to lookup the IP address of the host we are
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
294 connecting to */
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
295 #if defined (HAVE_GETADDRINFO) && defined (HAVE_GAI_STRERROR)
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
296 struct addrinfo *hostp;
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
297 #else
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
298 struct hostent host, *hostp;
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
299 #endif
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
300
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
301 int server_type; /* The type of server we are connected to.
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
302 See GFTP_DIRTYPE_* above */
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
303 unsigned int use_proxy : 1,
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
304 always_connected : 1,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
305 need_hostport : 1,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
306 need_userpass : 1,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
307 use_cache : 1, /* Enable or disable the cache */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
308 use_threads : 1, /* Whether we need to spawn a thread
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
309 for this protocol */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
310 cached : 1, /* Is this directory listing cached? */
41
4bcfaf6307b5 2002-10-29 Brian Masney <masneyb@gftp.org>
masneyb
parents: 40
diff changeset
311 cancel : 1, /* If a signal is received, should
4bcfaf6307b5 2002-10-29 Brian Masney <masneyb@gftp.org>
masneyb
parents: 40
diff changeset
312 we cancel this operation */
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
313 stopable : 1;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
314
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
315 off_t gotbytes;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
316
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
317 void *protocol_data;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
318
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
319 gftp_logging_func logging_function;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
320 void *user_data;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
321
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
322 void (*init) ( gftp_request * request );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
323 void (*destroy) ( gftp_request * request );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
324 int (*connect) ( gftp_request * request );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
325 void (*disconnect) ( gftp_request * request );
58
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
326 off_t (*get_file) ( gftp_request * request,
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
327 const char *filename,
58
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
328 int fd,
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
329 off_t startsize );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
330 int (*put_file) ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
331 const char *filename,
58
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
332 int fd,
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
333 off_t startsize,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
334 off_t totalsize );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
335 long (*transfer_file) ( gftp_request * fromreq,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
336 const char *fromfile,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
337 off_t fromsize,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
338 gftp_request * toreq,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
339 const char *tofile,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
340 off_t tosize );
58
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
341 ssize_t (*get_next_file_chunk) ( gftp_request * request,
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
342 char *buf,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
343 size_t size );
58
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
344 ssize_t (*put_next_file_chunk) ( gftp_request * request,
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
345 char *buf,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
346 size_t size );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
347 int (*end_transfer) ( gftp_request * request );
40
66c064fd05bc 2002-10-17 Brian Masney <masneyb@gftp.org>
masneyb
parents: 37
diff changeset
348 int (*abort_transfer) ( gftp_request * request );
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
349 int (*list_files) ( gftp_request * request );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
350 int (*get_next_file) ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
351 gftp_file *fle,
58
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
352 int fd );
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
353 off_t (*get_file_size) ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
354 const char *filename );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
355 int (*chdir) ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
356 const char *directory );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
357 int (*rmdir) ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
358 const char *directory );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
359 int (*rmfile) ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
360 const char *filename );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
361 int (*mkdir) ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
362 const char *directory );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
363 int (*rename) ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
364 const char *oldname,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
365 const char *newname );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
366 int (*chmod) ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
367 const char *filename,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
368 int mode );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
369 int (*set_file_time) ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
370 const char *filename,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
371 time_t datettime );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
372 int (*site) ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
373 const char *filename );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
374 int (*parse_url) ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
375 const char *url );
58
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
376 void (*set_config_options) ( gftp_request * request );
63
41b71c4e5076 2002-11-2333 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
377 void (*swap_socks) ( gftp_request * dest,
41b71c4e5076 2002-11-2333 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
378 gftp_request * source );
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
379
136
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
380 gftp_config_vars * local_options_vars;
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
381 int num_local_options_vars;
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
382 GHashTable * local_options_hash;
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
383 };
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
384
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
385
136
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
386 typedef struct gftp_transfer_tag
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
387 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
388 gftp_request * fromreq,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
389 * toreq;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
390
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
391 unsigned int transfer_direction : 1,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
392 cancel : 1,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
393 ready : 1,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
394 started : 1,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
395 done : 1,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
396 show : 1,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
397 stalled : 1,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
398 next_file : 1,
14
83090328581e * More largefile support. Hopefully all that is left is the configure stuff
masneyb
parents: 1
diff changeset
399 skip_file : 1;
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
400
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
401 struct timeval starttime,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
402 lasttime;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
403
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
404 double kbs;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
405
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
406 GList * files,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
407 * curfle,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
408 * updfle;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
409
19
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 16
diff changeset
410 long numfiles,
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 16
diff changeset
411 numdirs,
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 16
diff changeset
412 current_file_number,
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 16
diff changeset
413 current_file_retries;
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
414
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
415 off_t curtrans, /* Current transfered bytes for this file */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
416 curresumed, /* Resumed bytes for this file */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
417 trans_bytes, /* Amount of data transfered for entire
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
418 transfer */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
419 total_bytes, /* Grand total bytes for whole transfer */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
420 resumed_bytes; /* Grand total of resumed bytes for whole
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
421 transfer */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
422
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
423 void * fromwdata,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
424 * towdata;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
425
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
426 GStaticMutex statmutex,
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
427 structmutex;
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
428
125
b875de05c22d 2003-4-8 Brian Masney <masneyb@gftp.org>
masneyb
parents: 124
diff changeset
429 void *user_data;
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
430 void *clist;
136
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
431 } gftp_transfer;
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
432
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
433
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
434 typedef struct gftp_log_tag
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
435 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
436 char *msg;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
437 gftp_logging_level type;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
438 } gftp_log;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
439
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
440
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
441 typedef struct supported_gftp_protocols_tag
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
442 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
443 char *name; /* Description of protocol */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
444 void (*init) (gftp_request * request); /* Init function */
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
445 void (*register_options) (void); /* Protocol options */
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
446 char *url_prefix; /* URL Prefix */
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
447 int shown; /* Whether this protocol is
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
448 shown or not to the user in
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
449 the protocol dropdown box */
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
450 } supported_gftp_protocols;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
451
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
452
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
453 typedef struct gftp_bookmarks_tag gftp_bookmarks_var;
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
454
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
455 struct gftp_bookmarks_tag
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
456 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
457 char *path; /* Path */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
458 char *hostname, /* Our actual internet hostname */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
459 *protocol, /* Protocol we will connect through */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
460 *remote_dir, /* Initial directory */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
461 *local_dir, /* Init local directory */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
462 *user, /* Username to log in as */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
463 *pass, /* Our password */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
464 *acct; /* Account */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
465
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
466 unsigned int port, /* The port we will connect to */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
467 isfolder : 1, /* If this is set, then the children field can
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
468 be non-NULL */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
469 save_password : 1; /* Save this password */
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
470 gftp_bookmarks_var *children, /* The children of this node. */
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
471 *prev, /* The parent of this node */
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
472 *next; /* The next sibling of this node */
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
473 gpointer cnode;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
474
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
475 /* Site options */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
476 char *sftpserv_path; /* Path to the sftp server */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
477 };
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
478
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
479
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
480 typedef struct gftp_file_extensions_tag
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
481 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
482 char *ext, /* The file extension to register */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
483 *filename, /* The xpm file to display */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
484 *view_program, /* The program used to view this file */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
485 *ascii_binary; /* Is this a ASCII transfer or a BINARY transfer */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
486 int stlen; /* How long is the file extension. */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
487 } gftp_file_extensions;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
488
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
489
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
490 typedef struct gftp_color_tag
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
491 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
492 gushort red,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
493 green,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
494 blue;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
495 } gftp_color;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
496
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
497
58
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
498 typedef struct gftp_getline_buffer_tag
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
499 {
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
500 char *buffer,
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
501 *curpos;
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
502 size_t max_bufsize,
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
503 cur_bufsize;
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
504 } gftp_getline_buffer;
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
505
126
1e65871fdfa1 2003-4-9 Brian Masney <masneyb@gftp.org>
masneyb
parents: 125
diff changeset
506
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
507 /* Global config options. These are defined in options.h */
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
508 extern GList * gftp_file_transfers, * gftp_file_transfer_logs,
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
509 * gftp_options_list;
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
510 extern GHashTable * gftp_global_options_htable, * gftp_bookmarks_htable,
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
511 * gftp_config_list_htable;
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
512 extern gftp_config_vars gftp_global_config_vars[];
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
513 extern supported_gftp_protocols gftp_protocols[];
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
514 extern gftp_bookmarks_var * gftp_bookmarks;
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
515 extern char gftp_version[];
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
516 extern FILE * gftp_logfd;
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
517
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
518 /* This is defined in config_file.c */
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
519
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
520 extern gftp_option_type_var gftp_option_types[];
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
521
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
522 /* cache.c */
58
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
523 int gftp_new_cache_entry ( gftp_request * request );
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
524
58
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
525 int gftp_find_cache_entry ( gftp_request * request );
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
526
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
527 void gftp_clear_cache_files ( void );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
528
47
eec25f215772 2002-11-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 41
diff changeset
529 void gftp_delete_cache_entry ( gftp_request * request,
eec25f215772 2002-11-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 41
diff changeset
530 int ignore_directory );
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
531
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
532 /* config_file.c */
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
533 void gftp_add_bookmark ( gftp_bookmarks_var * newentry );
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
534
124
65048c959029 2003-4-6 Brian Masney <masneyb@gftp.org>
masneyb
parents: 122
diff changeset
535 void gftp_read_config_file ( char *global_data_path );
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
536
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
537 void gftp_write_bookmarks_file ( void );
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
538
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
539 void gftp_write_config_file ( void );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
540
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
541 GHashTable * build_bookmarks_hash_table ( gftp_bookmarks_var * entry );
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
542
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
543 void print_bookmarks ( gftp_bookmarks_var * bookmarks );
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
544
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
545 void gftp_lookup_global_option ( char * key,
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
546 void *value );
26
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 19
diff changeset
547
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
548 void gftp_lookup_request_option ( gftp_request * request,
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
549 char * key,
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
550 void *value );
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
551
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
552 void gftp_set_global_option ( char * key,
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
553 void *value );
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
554
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
555 void gftp_set_request_option ( gftp_request * request,
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
556 char * key,
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
557 void *value );
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
558
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
559 void gftp_register_config_vars ( gftp_config_vars *config_vars );
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
560
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
561 /* misc.c */
14
83090328581e * More largefile support. Hopefully all that is left is the configure stuff
masneyb
parents: 1
diff changeset
562 char *insert_commas ( off_t number,
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
563 char *dest_str,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
564 size_t dest_len );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
565
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
566 char *alltrim ( char *str );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
567
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
568 char *expand_path ( const char *src );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
569
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
570 void remove_double_slashes ( char *string );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
571
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
572 void make_nonnull ( char **str );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
573
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
574 int copyfile ( char *source,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
575 char *dest );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
576
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
577 char *get_xpm_path ( char *filename,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
578 int quit_on_err );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
579
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
580 int gftp_match_filespec ( char *filename,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
581 char *filespec );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
582
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
583 int gftp_parse_command_line ( int *argc,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
584 char ***argv );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
585
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
586 void gftp_usage ( void );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
587
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
588 gint string_hash_compare ( gconstpointer path1,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
589 gconstpointer path2 );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
590
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
591 guint string_hash_function ( gconstpointer key );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
592
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
593 void free_file_list ( GList * filelist );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
594
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
595 void free_fdata ( gftp_file * fle );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
596
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
597 gftp_file * copy_fdata ( gftp_file * fle );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
598
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
599 int compare_request ( gftp_request * request1,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
600 gftp_request * request2,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
601 int compare_dirs );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
602
129
fe0b21c006f6 2003-4-13 Brian Masney <masneyb@gftp.org>
masneyb
parents: 126
diff changeset
603 gftp_transfer * gftp_tdata_new ( void );
fe0b21c006f6 2003-4-13 Brian Masney <masneyb@gftp.org>
masneyb
parents: 126
diff changeset
604
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
605 void free_tdata ( gftp_transfer * tdata );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
606
136
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
607 void gftp_copy_local_options ( gftp_request * dest,
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
608 gftp_request * source );
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
609
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
610 gftp_request * copy_request ( gftp_request * req );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
611
124
65048c959029 2003-4-6 Brian Masney <masneyb@gftp.org>
masneyb
parents: 122
diff changeset
612 int ptym_open ( char *pts_name,
65048c959029 2003-4-6 Brian Masney <masneyb@gftp.org>
masneyb
parents: 122
diff changeset
613 size_t len );
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
614
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
615 int ptys_open ( int fdm,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
616 char *pts_name );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
617
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
618 int tty_raw ( int fd );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
619
16
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 14
diff changeset
620 GList * gftp_sort_filelist ( GList * filelist,
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 14
diff changeset
621 int column,
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 14
diff changeset
622 int asds );
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 14
diff changeset
623
125
b875de05c22d 2003-4-8 Brian Masney <masneyb@gftp.org>
masneyb
parents: 124
diff changeset
624 mode_t gftp_parse_attribs ( char *attribs );
b875de05c22d 2003-4-8 Brian Masney <masneyb@gftp.org>
masneyb
parents: 124
diff changeset
625
131
c77f85763e28 2003-4-13 Brian Masney <masneyb@gftp.org>
masneyb
parents: 129
diff changeset
626 char * gftp_gen_ls_string ( gftp_file * fle,
c77f85763e28 2003-4-13 Brian Masney <masneyb@gftp.org>
masneyb
parents: 129
diff changeset
627 char *file_prefixstr,
c77f85763e28 2003-4-13 Brian Masney <masneyb@gftp.org>
masneyb
parents: 129
diff changeset
628 char *file_suffixstr );
c77f85763e28 2003-4-13 Brian Masney <masneyb@gftp.org>
masneyb
parents: 129
diff changeset
629
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
630 /* protocols.c */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
631 #define GFTP_FTP_NUM 0
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
632 #define GFTP_HTTP_NUM 1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
633 #define GFTP_LOCAL_NUM 2
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
634 #define GFTP_SSHV2_NUM 3
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
635 #define GFTP_BOOKMARK_NUM 4
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
636
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
637 #define GFTP_IS_CONNECTED(request) ((request) != NULL && \
58
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
638 ((request)->sockfd > 0 || \
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
639 (request)->cached || \
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
640 (request)->always_connected))
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
641
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
642
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
643 void rfc959_init ( gftp_request * request );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
644
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
645 void rfc959_register_module ( void );
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
646
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
647 int rfc959_get_next_file ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
648 gftp_file *fle,
58
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
649 int fd );
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
650
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
651 void rfc2068_init ( gftp_request * request );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
652
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
653 void rfc2068_register_module ( void );
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
654
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
655 void local_init ( gftp_request * request );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
656
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
657 void local_register_module ( void );
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
658
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
659 void sshv2_init ( gftp_request * request );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
660
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
661 void sshv2_register_module ( void );
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
662
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
663 void bookmark_init ( gftp_request * request );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
664
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
665 void bookmark_register_module ( void );
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
666
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
667 gftp_request *gftp_request_new ( void );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
668
67
aa971a4bb16f 2002-11-27 Brian Masney <masneyb@gftp.org>
masneyb
parents: 63
diff changeset
669 void gftp_request_destroy ( gftp_request * request,
aa971a4bb16f 2002-11-27 Brian Masney <masneyb@gftp.org>
masneyb
parents: 63
diff changeset
670 int free_request );
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
671
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
672 void gftp_file_destroy ( gftp_file *file );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
673
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
674 int gftp_connect ( gftp_request * request );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
675
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
676 void gftp_disconnect ( gftp_request * request );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
677
58
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
678 off_t gftp_get_file ( gftp_request * request,
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
679 const char *filename,
58
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
680 int fd,
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
681 size_t startsize );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
682
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
683 int gftp_put_file ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
684 const char *filename,
58
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
685 int fd,
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
686 size_t startsize,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
687 size_t totalsize );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
688
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
689 long gftp_transfer_file ( gftp_request *fromreq,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
690 const char *fromfile,
58
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
691 int fromfd,
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
692 size_t fromsize,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
693 gftp_request *toreq,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
694 const char *tofile,
58
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
695 int tofd,
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
696 size_t tosize );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
697
58
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
698 ssize_t gftp_get_next_file_chunk ( gftp_request * request,
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
699 char *buf,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
700 size_t size );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
701
58
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
702 ssize_t gftp_put_next_file_chunk ( gftp_request * request,
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
703 char *buf,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
704 size_t size );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
705
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
706 int gftp_list_files ( gftp_request * request );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
707
87
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 86
diff changeset
708 int gftp_parse_bookmark ( gftp_request * request,
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 86
diff changeset
709 const char * bookmark );
6df043359b41 2003-1-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 86
diff changeset
710
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
711 int gftp_parse_url ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
712 const char *url );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
713
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
714 int gftp_get_next_file ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
715 char *filespec,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
716 gftp_file *fle );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
717
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
718 int gftp_end_transfer ( gftp_request * request );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
719
40
66c064fd05bc 2002-10-17 Brian Masney <masneyb@gftp.org>
masneyb
parents: 37
diff changeset
720 int gftp_abort_transfer ( gftp_request * request );
66c064fd05bc 2002-10-17 Brian Masney <masneyb@gftp.org>
masneyb
parents: 37
diff changeset
721
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
722 void gftp_set_hostname ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
723 const char *hostname );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
724
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
725 void gftp_set_username ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
726 const char *username );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
727
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
728 void gftp_set_password ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
729 const char *password );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
730
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
731 void gftp_set_account ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
732 const char *account );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
733
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
734 int gftp_set_directory ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
735 const char *directory );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
736
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
737 void gftp_set_port ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
738 unsigned int port );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
739
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
740 int gftp_remove_directory ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
741 const char *directory );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
742
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
743 int gftp_remove_file ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
744 const char *file );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
745
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
746 int gftp_make_directory ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
747 const char *directory );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
748
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
749 int gftp_rename_file ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
750 const char *oldname,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
751 const char *newname );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
752
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
753 int gftp_chmod ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
754 const char *file,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
755 int mode );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
756
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
757 int gftp_set_file_time ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
758 const char *file,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
759 time_t datetime );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
760
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
761 char gftp_site_cmd ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
762 const char *command );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
763
58
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
764 off_t gftp_get_file_size ( gftp_request * request,
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
765 const char *filename );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
766
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
767 void gftp_calc_kbs ( gftp_transfer * tdata,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
768 ssize_t num_read );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
769
102
3b573c8ef706 2003-2-6 Brian Masney <masneyb@gftp.org>
masneyb
parents: 101
diff changeset
770 time_t parse_time ( char *str,
3b573c8ef706 2003-2-6 Brian Masney <masneyb@gftp.org>
masneyb
parents: 101
diff changeset
771 char **endpos );
3b573c8ef706 2003-2-6 Brian Masney <masneyb@gftp.org>
masneyb
parents: 101
diff changeset
772
91
8c37d73d3f1f 2003-1-21 Brian Masney <masneyb@gftp.org>
masneyb
parents: 87
diff changeset
773 int gftp_parse_ls ( gftp_request * request,
8c37d73d3f1f 2003-1-21 Brian Masney <masneyb@gftp.org>
masneyb
parents: 87
diff changeset
774 const char *lsoutput,
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
775 gftp_file *fle );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
776
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
777 int gftp_get_all_subdirs ( gftp_transfer * transfer,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
778 void (*update_func)
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
779 ( gftp_transfer * transfer ));
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
780
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
781 int gftp_connect_server ( gftp_request * request,
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
782 char *service,
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
783 char *proxy_hostname,
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
784 int proxy_port );
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
785
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
786 #if !defined (HAVE_GETADDRINFO) || !defined (HAVE_GAI_STRERROR)
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
787
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
788 struct hostent *r_gethostbyname ( const char *name,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
789 struct hostent *result_buf,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
790 int *h_errnop );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
791
56
a12bcbc2fce4 2002-11-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 48
diff changeset
792 #endif
a12bcbc2fce4 2002-11-11 Brian Masney <masneyb@gftp.org>
masneyb
parents: 48
diff changeset
793
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
794 struct servent *r_getservbyname ( const char *name,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
795 const char *proto,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
796 struct servent *result_buf,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
797 int *h_errnop );
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
798
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
799 void gftp_set_config_options ( gftp_request * request );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
800
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
801 void print_file_list ( GList * list );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
802
58
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
803 ssize_t gftp_get_line ( gftp_request * request,
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
804 gftp_getline_buffer ** rbuf,
41
4bcfaf6307b5 2002-10-29 Brian Masney <masneyb@gftp.org>
masneyb
parents: 40
diff changeset
805 char * str,
4bcfaf6307b5 2002-10-29 Brian Masney <masneyb@gftp.org>
masneyb
parents: 40
diff changeset
806 size_t len,
58
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
807 int fd );
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
808
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
809 ssize_t gftp_read ( gftp_request * request,
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
810 void *ptr,
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
811 size_t size,
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
812 int fd );
41
4bcfaf6307b5 2002-10-29 Brian Masney <masneyb@gftp.org>
masneyb
parents: 40
diff changeset
813
58
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
814 ssize_t gftp_write ( gftp_request * request,
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
815 const char *ptr,
41
4bcfaf6307b5 2002-10-29 Brian Masney <masneyb@gftp.org>
masneyb
parents: 40
diff changeset
816 size_t size,
58
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
817 int fd );
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
818
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
819 ssize_t gftp_writefmt ( gftp_request * request,
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
820 int fd,
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
821 const char *fmt,
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
822 ... );
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
823
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
824 int gftp_set_sockblocking ( gftp_request * request,
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
825 int fd,
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
826 int non_blocking );
41
4bcfaf6307b5 2002-10-29 Brian Masney <masneyb@gftp.org>
masneyb
parents: 40
diff changeset
827
63
41b71c4e5076 2002-11-2333 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
828 void gftp_swap_socks ( gftp_request * dest,
41b71c4e5076 2002-11-2333 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
829 gftp_request * source );
41b71c4e5076 2002-11-2333 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
830
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
831 void gftp_calc_kbs ( gftp_transfer * tdata,
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
832 ssize_t num_read );
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
833
125
b875de05c22d 2003-4-8 Brian Masney <masneyb@gftp.org>
masneyb
parents: 124
diff changeset
834 int gftp_get_transfer_status ( gftp_transfer * tdata,
b875de05c22d 2003-4-8 Brian Masney <masneyb@gftp.org>
masneyb
parents: 124
diff changeset
835 ssize_t num_read );
b875de05c22d 2003-4-8 Brian Masney <masneyb@gftp.org>
masneyb
parents: 124
diff changeset
836
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
837 #endif
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
838