annotate lib/gftp.h @ 146:782f84694489

2003-4-25 Brian Masney <masneyb@gftp.org> * lib/rfc959.c - added IPV6 support (RFC2428). The only part of the project that isn't IPV6 ready is the proxy comparsion functions. * lib/protocols.c - change the hints.ai_family paramater from AF_INET to PF_UNSPEC * lib/gftp.h lib/misc.c lib/pty.c - moved the functionality of pty[ms]_open() to pty.c. Combined these 2 functions into open_ptys(), and there is one defined for each system type (lots of #define's in this file!) * lib/Makefile.am po/POTFILES.in - added pty.c * lib/sshv2.c - when searching for the password prompt, omit the first character in case it is capitalized. Also, use the new function open_ptys() * configure.in - search for openpty in -lutil. Also, define HAVE_OPENPTY if this function is present on the system
author masneyb
date Sat, 26 Apr 2003 15:26:42 +0000
parents c363b08e0118
children 2f15b3000dbc
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
146
782f84694489 2003-4-25 Brian Masney <masneyb@gftp.org>
masneyb
parents: 139
diff changeset
83 #ifdef HAVE_GETADDRINFO
782f84694489 2003-4-25 Brian Masney <masneyb@gftp.org>
masneyb
parents: 139
diff changeset
84 #define HAVE_IPV6
782f84694489 2003-4-25 Brian Masney <masneyb@gftp.org>
masneyb
parents: 139
diff changeset
85 #define GFTP_GET_AI_FAMILY(request) (request->hostp->ai_family)
782f84694489 2003-4-25 Brian Masney <masneyb@gftp.org>
masneyb
parents: 139
diff changeset
86 #else
782f84694489 2003-4-25 Brian Masney <masneyb@gftp.org>
masneyb
parents: 139
diff changeset
87 #define GFTP_GET_AI_FAMILY(request) AF_INET
782f84694489 2003-4-25 Brian Masney <masneyb@gftp.org>
masneyb
parents: 139
diff changeset
88 #endif
782f84694489 2003-4-25 Brian Masney <masneyb@gftp.org>
masneyb
parents: 139
diff changeset
89
48
e5f6054590b5 2002-11-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 47
diff changeset
90 /* 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
91 defined by the system, we'll just define them here. */
e5f6054590b5 2002-11-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 47
diff changeset
92 #ifndef major
e5f6054590b5 2002-11-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 47
diff changeset
93 #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
94 #define major(dev) (((dev) >> 8) & 0xff)
e5f6054590b5 2002-11-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 47
diff changeset
95 #endif
e5f6054590b5 2002-11-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 47
diff changeset
96
e5f6054590b5 2002-11-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 47
diff changeset
97 #ifndef minor
e5f6054590b5 2002-11-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 47
diff changeset
98 #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
99 #define minor(dev) ((dev) & 0xff)
e5f6054590b5 2002-11-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 47
diff changeset
100 #endif
e5f6054590b5 2002-11-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 47
diff changeset
101
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
102 #ifdef HAVE_DMALLOC
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
103 #include <dmalloc.h>
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
104 #endif
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
105
91
8c37d73d3f1f 2003-1-21 Brian Masney <masneyb@gftp.org>
masneyb
parents: 87
diff changeset
106 /* Server types (used by FTP protocol from SYST command) */
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
107 #define GFTP_DIRTYPE_UNIX 1
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
108 #define GFTP_DIRTYPE_EPLF 2
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
109 #define GFTP_DIRTYPE_CRAY 3
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
110 #define GFTP_DIRTYPE_NOVELL 4
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
111 #define GFTP_DIRTYPE_DOS 5
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
112 #define GFTP_DIRTYPE_VMS 6
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
113 #define GFTP_DIRTYPE_OTHER 7
91
8c37d73d3f1f 2003-1-21 Brian Masney <masneyb@gftp.org>
masneyb
parents: 87
diff changeset
114
84
7ef60ce2bdb2 2002-12-29 Brian Masney <masneyb@gftp.org>
masneyb
parents: 80
diff changeset
115 /* Error types */
7ef60ce2bdb2 2002-12-29 Brian Masney <masneyb@gftp.org>
masneyb
parents: 80
diff changeset
116 #define GFTP_ERETRYABLE -1
7ef60ce2bdb2 2002-12-29 Brian Masney <masneyb@gftp.org>
masneyb
parents: 80
diff changeset
117 #define GFTP_EFATAL -2
7ef60ce2bdb2 2002-12-29 Brian Masney <masneyb@gftp.org>
masneyb
parents: 80
diff changeset
118
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
119 /* Some general settings */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
120 #define BASE_CONF_DIR "~/.gftp"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
121 #define CONFIG_FILE BASE_CONF_DIR "/gftprc"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
122 #define BOOKMARKS_FILE BASE_CONF_DIR "/bookmarks"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
123 #define LOG_FILE BASE_CONF_DIR "/gftp.log"
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
124 #define MAX_HIST_LEN 10
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
125
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
126 typedef enum gftp_transfer_type_tag
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
127 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
128 gftp_transfer_passive,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
129 gftp_transfer_active
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
130 } gftp_transfer_type;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
131
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
132
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
133 typedef enum gftp_logging_level_tag
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
134 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
135 gftp_logging_send,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
136 gftp_logging_recv,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
137 gftp_logging_error,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
138 gftp_logging_misc
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
139 } gftp_logging_level;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
140
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
141 typedef void (*gftp_logging_func) ( gftp_logging_level level,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
142 void *ptr,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
143 const char *string, ... );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
144
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
145
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
146 typedef struct gftp_file_tag gftp_file;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
147
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
148 #define GFTP_TRANS_ACTION_OVERWRITE 1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
149 #define GFTP_TRANS_ACTION_RESUME 2
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
150 #define GFTP_TRANS_ACTION_SKIP 3
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
151
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
152 #define GFTP_DIRECTION_DOWNLOAD 0
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
153 #define GFTP_DIRECTION_UPLOAD 1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
154
16
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 14
diff changeset
155 #define GFTP_SORT_COL_FILE 1
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 14
diff changeset
156 #define GFTP_SORT_COL_SIZE 2
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 14
diff changeset
157 #define GFTP_SORT_COL_USER 3
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 14
diff changeset
158 #define GFTP_SORT_COL_GROUP 4
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 14
diff changeset
159 #define GFTP_SORT_COL_DATETIME 5
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 14
diff changeset
160 #define GFTP_SORT_COL_ATTRIBS 6
ddb983d8574b * Improved directory sorting algorithm
masneyb
parents: 14
diff changeset
161
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
162 struct gftp_file_tag
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
163 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
164 char *file, /* Our filename */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
165 *user, /* User that owns it */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
166 *group, /* Group that owns it */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
167 *attribs, /* Attribs (-rwxr-x-rx) */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
168 *destfile; /* Full pathname to the destination for the
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
169 file transfer */
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
170
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
171 int fd; /* Already open fd for this file */
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
172 /* FIXME - add fd_open function */
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
173
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
174 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
175 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
176 startsize; /* Size to start the transfer at */
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
177 unsigned int isdir : 1, /* File type */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
178 isexe : 1,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
179 islink : 1,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
180 selected : 1, /* Is this file selected? */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
181 was_sel : 1, /* Was this file selected before */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
182 shown : 1, /* Is this file shown? */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
183 done_view : 1, /* View the file when done transfering? */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
184 done_edit : 1, /* Edit the file when done transfering? */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
185 done_rm : 1, /* Remove the file when done */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
186 transfer_done : 1, /* Is current file transfer done? */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
187 is_fd : 1; /* Is this a file descriptor? */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
188 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
189 void *user_data;
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
190 };
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
191
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
192
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
193 typedef struct gftp_proxy_hosts_tag
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
194 {
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
195 /* FIXME - add IPV4 stuff here */
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
196
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
197 gint32 ipv4_network_address,
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
198 ipv4_netmask;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
199 char *domain;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
200 } gftp_proxy_hosts;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
201
136
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
202
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
203 /* 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
204 in the declaration of gftp_option_types */
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
205 typedef enum
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
206 {
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
207 gftp_option_type_text = 0,
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
208 gftp_option_type_textcombo = 1,
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
209 gftp_option_type_textcomboedt = 2,
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
210 gftp_option_type_hidetext = 3,
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
211 gftp_option_type_int = 4,
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
212 gftp_option_type_checkbox = 5,
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
213 gftp_option_type_intcombo = 6,
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
214 gftp_option_type_float = 7,
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
215 gftp_option_type_color = 8,
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
216 gftp_option_type_notebook = 9
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
217 } gftp_option_type_enum;
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
218
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 #define GFTP_PORT_GTK (1 << 1)
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
221 #define GFTP_PORT_TEXT (1 << 2)
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
222 #define GFTP_PORT_ALL (GFTP_PORT_GTK | GFTP_PORT_TEXT)
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
223
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
224
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
225 typedef struct gftp_config_list_vars_tag
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
226 {
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
227 char *key;
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
228 void * (*read_func) (char *buf, int line);
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
229 void (*write_func) (FILE *fd, void *data);
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
230 GList * list;
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
231 unsigned int num_items;
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
232 char *header;
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
233 } gftp_config_list_vars;
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
234
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
235
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
236 #define GFTP_CVARS_FLAGS_DYNMEM (1 << 1)
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
237
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
238
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
239 typedef struct gftp_config_vars_tag
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
240 {
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
241 char *key, /* variable name */
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
242 *description; /* How this field will show up in the dialog */
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
243 int otype; /* Type of option this is */
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
244 void *value;
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
245 void *listdata; /* For options that have several different
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
246 options, this is a list of all the options.
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
247 Each option_type that uses this will use this
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
248 field differently */
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
249 int flags; /* See GFTP_CVARS_FLAGS_* above */
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
250 char *comment; /* Comment to write out to the config file */
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
251 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
252 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
253 } gftp_config_vars;
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
254
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
255
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
256 typedef struct gftp_option_type_tag
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 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
259 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
260 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
261 void (*ui_save_function) (gftp_config_vars * cv, void *user_data);
139
c363b08e0118 2003-4-21 Brian Masney <masneyb@gftp.org>
masneyb
parents: 136
diff changeset
262 void (*ui_cancel_function) (gftp_config_vars * cv, void *user_data);
136
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
263 void *user_data;
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
264 } gftp_option_type_var;
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
265
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
266
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
267 #define GFTP_TEXTCOMBOEDT_EDITABLE (1 << 0)
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
268
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
269 typedef struct gftp_textcomboedt_data_tag
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
270 {
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
271 char *description,
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
272 *text;
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
273 int flags;
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
274 } gftp_textcomboedt_data;
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
275
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
276
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
277 typedef struct gftp_request_tag gftp_request;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
278
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
279 struct gftp_request_tag
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
280 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
281 int protonum; /* Current number of the protocol this is
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
282 set to */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
283 char *hostname, /* Hostname we will connect to */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
284 *username, /* Username for host*/
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
285 *password, /* Password for host */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
286 *account, /* Account for host (FTP only) */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
287 *directory, /* Current working directory */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
288 *url_prefix, /* URL Prefix (ex: ftp) */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
289 *last_ftp_response, /* Last response from server */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
290 *last_dir_entry; /* Last dir entry from server */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
291 size_t last_dir_entry_len; /* Length of last_dir_entry */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
292
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
293 unsigned int port; /* Port of remote site */
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
294
58
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
295 int sockfd, /* Control connection (read) */
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
296 datafd, /* Data connection */
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
297 cachefd; /* For the directory cache */
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
298 int wakeup_main_thread[2]; /* FD that gets written to by the threads
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
299 to wakeup the parent */
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
300
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
301 /* 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
302 connecting to */
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
303 #if defined (HAVE_GETADDRINFO) && defined (HAVE_GAI_STRERROR)
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
304 struct addrinfo *hostp;
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
305 #else
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
306 struct hostent host, *hostp;
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
307 #endif
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
308
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
309 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
310 See GFTP_DIRTYPE_* above */
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
311 unsigned int use_proxy : 1,
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
312 always_connected : 1,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
313 need_hostport : 1,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
314 need_userpass : 1,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
315 use_cache : 1, /* Enable or disable the cache */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
316 use_threads : 1, /* Whether we need to spawn a thread
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
317 for this protocol */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
318 cached : 1, /* Is this directory listing cached? */
41
4bcfaf6307b5 2002-10-29 Brian Masney <masneyb@gftp.org>
masneyb
parents: 40
diff changeset
319 cancel : 1, /* If a signal is received, should
4bcfaf6307b5 2002-10-29 Brian Masney <masneyb@gftp.org>
masneyb
parents: 40
diff changeset
320 we cancel this operation */
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
321 stopable : 1;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
322
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
323 off_t gotbytes;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
324
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
325 void *protocol_data;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
326
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
327 gftp_logging_func logging_function;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
328 void *user_data;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
329
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
330 void (*init) ( gftp_request * request );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
331 void (*destroy) ( gftp_request * request );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
332 int (*connect) ( gftp_request * request );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
333 void (*disconnect) ( gftp_request * request );
58
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
334 off_t (*get_file) ( gftp_request * request,
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
335 const char *filename,
58
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
336 int fd,
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
337 off_t startsize );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
338 int (*put_file) ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
339 const char *filename,
58
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
340 int fd,
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
341 off_t startsize,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
342 off_t totalsize );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
343 long (*transfer_file) ( gftp_request * fromreq,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
344 const char *fromfile,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
345 off_t fromsize,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
346 gftp_request * toreq,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
347 const char *tofile,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
348 off_t tosize );
58
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
349 ssize_t (*get_next_file_chunk) ( gftp_request * request,
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
350 char *buf,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
351 size_t size );
58
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
352 ssize_t (*put_next_file_chunk) ( gftp_request * request,
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
353 char *buf,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
354 size_t size );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
355 int (*end_transfer) ( gftp_request * request );
40
66c064fd05bc 2002-10-17 Brian Masney <masneyb@gftp.org>
masneyb
parents: 37
diff changeset
356 int (*abort_transfer) ( gftp_request * request );
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
357 int (*list_files) ( gftp_request * request );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
358 int (*get_next_file) ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
359 gftp_file *fle,
58
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
360 int fd );
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
361 off_t (*get_file_size) ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
362 const char *filename );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
363 int (*chdir) ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
364 const char *directory );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
365 int (*rmdir) ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
366 const char *directory );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
367 int (*rmfile) ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
368 const char *filename );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
369 int (*mkdir) ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
370 const char *directory );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
371 int (*rename) ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
372 const char *oldname,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
373 const char *newname );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
374 int (*chmod) ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
375 const char *filename,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
376 int mode );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
377 int (*set_file_time) ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
378 const char *filename,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
379 time_t datettime );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
380 int (*site) ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
381 const char *filename );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
382 int (*parse_url) ( gftp_request * request,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
383 const char *url );
58
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
384 void (*set_config_options) ( gftp_request * request );
63
41b71c4e5076 2002-11-2333 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
385 void (*swap_socks) ( gftp_request * dest,
41b71c4e5076 2002-11-2333 Brian Masney <masneyb@gftp.org>
masneyb
parents: 58
diff changeset
386 gftp_request * source );
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
387
136
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
388 gftp_config_vars * local_options_vars;
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
389 int num_local_options_vars;
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
390 GHashTable * local_options_hash;
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
391 };
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
392
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
393
136
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
394 typedef struct gftp_transfer_tag
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
395 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
396 gftp_request * fromreq,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
397 * toreq;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
398
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
399 unsigned int transfer_direction : 1,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
400 cancel : 1,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
401 ready : 1,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
402 started : 1,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
403 done : 1,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
404 show : 1,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
405 stalled : 1,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
406 next_file : 1,
14
83090328581e * More largefile support. Hopefully all that is left is the configure stuff
masneyb
parents: 1
diff changeset
407 skip_file : 1;
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
408
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
409 struct timeval starttime,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
410 lasttime;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
411
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
412 double kbs;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
413
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
414 GList * files,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
415 * curfle,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
416 * updfle;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
417
19
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 16
diff changeset
418 long numfiles,
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 16
diff changeset
419 numdirs,
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 16
diff changeset
420 current_file_number,
3b2dcdefc7e9 2002-09-15 Brian Masney <masneyb@gftp.org>
masneyb
parents: 16
diff changeset
421 current_file_retries;
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
422
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
423 off_t curtrans, /* Current transfered bytes for this file */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
424 curresumed, /* Resumed bytes for this file */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
425 trans_bytes, /* Amount of data transfered for entire
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
426 transfer */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
427 total_bytes, /* Grand total bytes for whole transfer */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
428 resumed_bytes; /* Grand total of resumed bytes for whole
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
429 transfer */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
430
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
431 void * fromwdata,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
432 * towdata;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
433
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
434 GStaticMutex statmutex,
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
435 structmutex;
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
436
125
b875de05c22d 2003-4-8 Brian Masney <masneyb@gftp.org>
masneyb
parents: 124
diff changeset
437 void *user_data;
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
438 void *clist;
136
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
439 } gftp_transfer;
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
440
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
441
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
442 typedef struct gftp_log_tag
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
443 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
444 char *msg;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
445 gftp_logging_level type;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
446 } gftp_log;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
447
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
448
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
449 typedef struct supported_gftp_protocols_tag
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
450 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
451 char *name; /* Description of protocol */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
452 void (*init) (gftp_request * request); /* Init function */
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
453 void (*register_options) (void); /* Protocol options */
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
454 char *url_prefix; /* URL Prefix */
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
455 int shown; /* Whether this protocol is
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
456 shown or not to the user in
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
457 the protocol dropdown box */
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
458 } supported_gftp_protocols;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
459
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
460
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
461 typedef struct gftp_bookmarks_tag gftp_bookmarks_var;
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
462
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
463 struct gftp_bookmarks_tag
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
464 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
465 char *path; /* Path */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
466 char *hostname, /* Our actual internet hostname */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
467 *protocol, /* Protocol we will connect through */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
468 *remote_dir, /* Initial directory */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
469 *local_dir, /* Init local directory */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
470 *user, /* Username to log in as */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
471 *pass, /* Our password */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
472 *acct; /* Account */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
473
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
474 unsigned int port, /* The port we will connect to */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
475 isfolder : 1, /* If this is set, then the children field can
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
476 be non-NULL */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
477 save_password : 1; /* Save this password */
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
478 gftp_bookmarks_var *children, /* The children of this node. */
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
479 *prev, /* The parent of this node */
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
480 *next; /* The next sibling of this node */
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
481 gpointer cnode;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
482
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
483 /* Site options */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
484 char *sftpserv_path; /* Path to the sftp server */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
485 };
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
486
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
487
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
488 typedef struct gftp_file_extensions_tag
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
489 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
490 char *ext, /* The file extension to register */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
491 *filename, /* The xpm file to display */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
492 *view_program, /* The program used to view this file */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
493 *ascii_binary; /* Is this a ASCII transfer or a BINARY transfer */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
494 int stlen; /* How long is the file extension. */
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
495 } gftp_file_extensions;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
496
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
497
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
498 typedef struct gftp_color_tag
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
499 {
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
500 gushort red,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
501 green,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
502 blue;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
503 } gftp_color;
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
504
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
505
58
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
506 typedef struct gftp_getline_buffer_tag
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
507 {
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
508 char *buffer,
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
509 *curpos;
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
510 size_t max_bufsize,
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
511 cur_bufsize;
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
512 } gftp_getline_buffer;
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
513
126
1e65871fdfa1 2003-4-9 Brian Masney <masneyb@gftp.org>
masneyb
parents: 125
diff changeset
514
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
515 /* Global config options. These are defined in options.h */
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
516 extern GList * gftp_file_transfers, * gftp_file_transfer_logs,
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
517 * gftp_options_list;
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
518 extern GHashTable * gftp_global_options_htable, * gftp_bookmarks_htable,
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
519 * gftp_config_list_htable;
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
520 extern gftp_config_vars gftp_global_config_vars[];
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
521 extern supported_gftp_protocols gftp_protocols[];
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
522 extern gftp_bookmarks_var * gftp_bookmarks;
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
523 extern char gftp_version[];
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
524 extern FILE * gftp_logfd;
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
525
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
526 /* This is defined in config_file.c */
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
527
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
528 extern gftp_option_type_var gftp_option_types[];
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
529
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
530 /* cache.c */
58
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
531 int gftp_new_cache_entry ( gftp_request * request );
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
532
58
c01d91c10f6c 2002-11-20 Brian Masney <masneyb@gftp.org>
masneyb
parents: 56
diff changeset
533 int gftp_find_cache_entry ( gftp_request * request );
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
534
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
535 void gftp_clear_cache_files ( void );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
536
47
eec25f215772 2002-11-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 41
diff changeset
537 void gftp_delete_cache_entry ( gftp_request * request,
eec25f215772 2002-11-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 41
diff changeset
538 int ignore_directory );
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
539
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
540 /* config_file.c */
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
541 void gftp_add_bookmark ( gftp_bookmarks_var * newentry );
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
542
124
65048c959029 2003-4-6 Brian Masney <masneyb@gftp.org>
masneyb
parents: 122
diff changeset
543 void gftp_read_config_file ( char *global_data_path );
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
544
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
545 void gftp_write_bookmarks_file ( void );
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
546
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
547 void gftp_write_config_file ( void );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
548
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
549 GHashTable * build_bookmarks_hash_table ( gftp_bookmarks_var * entry );
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
550
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
551 void print_bookmarks ( gftp_bookmarks_var * bookmarks );
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
552
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
553 void gftp_lookup_global_option ( char * key,
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
554 void *value );
26
d74bfa342116 2002-09-24 gettextize <bug-gnu-gettext@gnu.org>
masneyb
parents: 19
diff changeset
555
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
556 void gftp_lookup_request_option ( gftp_request * request,
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
557 char * key,
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
558 void *value );
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
559
122
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
560 void gftp_set_global_option ( char * key,
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
561 void *value );
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
562
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
563 void gftp_set_request_option ( gftp_request * request,
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
564 char * key,
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
565 void *value );
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
566
76e2b58a9440 2003-4-5 Brian Masney <masneyb@gftp.org>
masneyb
parents: 102
diff changeset
567 void gftp_register_config_vars ( gftp_config_vars *config_vars );
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
568
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
569 /* misc.c */
14
83090328581e * More largefile support. Hopefully all that is left is the configure stuff
masneyb
parents: 1
diff changeset
570 char *insert_commas ( off_t number,
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
571 char *dest_str,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
572 size_t dest_len );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
573
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
574 char *alltrim ( char *str );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
575
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
576 char *expand_path ( const char *src );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
577
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
578 void remove_double_slashes ( char *string );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
579
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
580 void make_nonnull ( char **str );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
581
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
582 int copyfile ( char *source,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
583 char *dest );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
584
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
585 char *get_xpm_path ( char *filename,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
586 int quit_on_err );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
587
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
588 int gftp_match_filespec ( char *filename,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
589 char *filespec );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
590
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
591 int gftp_parse_command_line ( int *argc,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
592 char ***argv );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
593
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
594 void gftp_usage ( void );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
595
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
596 gint string_hash_compare ( gconstpointer path1,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
597 gconstpointer path2 );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
598
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
599 guint string_hash_function ( gconstpointer key );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
600
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
601 void free_file_list ( GList * filelist );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
602
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
603 void free_fdata ( gftp_file * fle );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
604
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
605 gftp_file * copy_fdata ( gftp_file * fle );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
606
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
607 int compare_request ( gftp_request * request1,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
608 gftp_request * request2,
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
609 int compare_dirs );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
610
129
fe0b21c006f6 2003-4-13 Brian Masney <masneyb@gftp.org>
masneyb
parents: 126
diff changeset
611 gftp_transfer * gftp_tdata_new ( void );
fe0b21c006f6 2003-4-13 Brian Masney <masneyb@gftp.org>
masneyb
parents: 126
diff changeset
612
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
613 void free_tdata ( gftp_transfer * tdata );
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
614
136
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
615 void gftp_copy_local_options ( gftp_request * dest,
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
616 gftp_request * source );
84b3e69807a2 2003-4-18 Brian Masney <masneyb@gftp.org>
masneyb
parents: 131
diff changeset
617
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
618 gftp_request * copy_request ( gftp_request * req );
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
146
782f84694489 2003-4-25 Brian Masney <masneyb@gftp.org>
masneyb
parents: 139
diff changeset
837 /* pty.c */
782f84694489 2003-4-25 Brian Masney <masneyb@gftp.org>
masneyb
parents: 139
diff changeset
838 int open_ptys ( gftp_request * request,
782f84694489 2003-4-25 Brian Masney <masneyb@gftp.org>
masneyb
parents: 139
diff changeset
839 int *fdm,
782f84694489 2003-4-25 Brian Masney <masneyb@gftp.org>
masneyb
parents: 139
diff changeset
840 int *fds );
782f84694489 2003-4-25 Brian Masney <masneyb@gftp.org>
masneyb
parents: 139
diff changeset
841
782f84694489 2003-4-25 Brian Masney <masneyb@gftp.org>
masneyb
parents: 139
diff changeset
842 int tty_raw ( int fd );
782f84694489 2003-4-25 Brian Masney <masneyb@gftp.org>
masneyb
parents: 139
diff changeset
843
1
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
844 #endif
8b1883341c6f Initial revision
masneyb
parents:
diff changeset
845