Go to the source code of this file.
|
#define | EXPRT |
|
#define | FTP_MAX_ANSWERS 10 /* Number of known goodest answers for reqest */ |
|
#define | FTP_QUIT 0 |
|
#define | FTP_Ctrl(x) ((x) - '@') |
|
#define | FTP_FREE(x) memset ( &x , '\0' , sizeof x ) |
|
#define | FTP_CUT(x) ((x)&0xff) |
|
#define | ftp_account(ftp, acc) ftp_command(ftp,"ACCT %s",acc,230,EOF) |
|
#define | ftp_user(ftp, user) ftp_command(ftp,"USER %s",user,230,331,332,EOF) |
|
#define | ftp_password(ftp, pas) ftp_command(ftp,"PASS %s",pas,230,332,EOF) |
|
#define | ftp_type(ftp, type) ftp_command(ftp,"TYPE %s",type,200,EOF) |
|
#define | ftp_chdir(ftp, dir) ftp_command(ftp,"CWD %s",dir,200,250,EOF) |
|
#define | ftp_mkdir(ftp, dir) ftp_command(ftp,"XMKD %s",dir,200,257,EOF) |
|
#define | ftp_rm(ftp, dir) ftp_command(ftp,"DELE %s",dir,200,250,EOF) |
|
#define | ftp_ascii(ftp) ftp_type(ftp,"A") |
|
#define | ftp_binary(ftp) ftp_type(ftp,"I") |
|
#define | ftp_open_read(ftp, file) ftp_data(ftp,"RETR %s",file) |
|
#define | ftp_open_write(ftp, file) ftp_data(ftp,"STOR %s",file) |
|
#define | ftp_open_append(ftp, file) ftp_data(ftp,"APPE %s",file) |
|
|
int EXPRT | ftp_bye (FTP_CON *con) |
|
int EXPRT | ftp_close (FTP_CON *con) |
|
int EXPRT | ftp_connect (FTP_CON **con, const char *host_name, unsigned short port) |
|
int EXPRT | ftp_login (FTP_CON **con, const char *host, unsigned short port, const char *user, const char *pass, const char *acct) |
|
int EXPRT | ftp_move (FTP_CON *con, const char *old_name, const char *new_name) |
|
int EXPRT | ftp_data (FTP_CON *con, const char *command, const char *param) |
|
int EXPRT | ftp_port (FTP_CON *con, int, int, int, int, int, int) |
|
int EXPRT | ftp_get (FTP_CON *con, const char *local_name, const char *remote_name) |
|
int EXPRT | ftp_put (FTP_CON *con, const char *local_name, const char *remote_name) |
|
int EXPRT | ftp_send (int sock, const char *buffer, int n_bytes) |
|
int EXPRT | ftp_receive (int sock, char *buffer, int bsize) |
|
int EXPRT | ftp_send_message (FTP_CON *con, const char *message) |
|
int EXPRT | ftp_get_message (FTP_CON *con, char *message) |
|
BOOL EXPRT | ftp_good (int number,...) |
|
int EXPRT | ftp_command (FTP_CON *con, const char *command, const char *param,...) |
|
int EXPRT | ftp_dir (FTP_CON *con, const char *file) |
|
char EXPRT * | ftp_pwd (FTP_CON *con) |
|
void EXPRT | ftp_debug (int(*debug_func)(const char *message), int(*error_func)(const char *message)) |
|
◆ EXPRT
◆ ftp_account
◆ ftp_ascii
◆ ftp_binary
◆ ftp_chdir
◆ FTP_Ctrl
#define FTP_Ctrl |
( |
|
x | ) |
((x) - '@') |
◆ FTP_CUT
#define FTP_CUT |
( |
|
x | ) |
((x)&0xff) |
◆ FTP_FREE
◆ FTP_MAX_ANSWERS
◆ ftp_mkdir
◆ ftp_open_append
◆ ftp_open_read
◆ ftp_open_write
◆ ftp_password
◆ FTP_QUIT
◆ ftp_rm
◆ ftp_type
◆ ftp_user
◆ ftp_bye()
Definition at line 422 of file ftplib.cxx.
424{
426
429
432
434}
int ftp_send_message(FTP_CON *con, const char *message)
int ftp_get_message(FTP_CON *con, char *message)
TH1X EXPRT * h1_book(const char *name, const char *title, int bins, double min, double max)
◆ ftp_close()
◆ ftp_command()
Definition at line 146 of file ftplib.cxx.
148{
153
154
156
157
160
161
165
166
168
170 do {
173 break;
174
177
179
181
185
187 }
188
190}
int(* ftp_error_func)(const char *message)
#define FTP_RESPONSE_ERROR
◆ ftp_connect()
Definition at line 41 of file ftplib.cxx.
44{
46 int sock;
50
52
53#ifdef OS_WINNT
54 {
56
57
60 }
61#endif
62
67 }
68
69
70 memset(&bind_addr, 0,
sizeof(bind_addr));
72 bind_addr.sin_addr.s_addr = 0;
73 bind_addr.sin_port =
htons(port);
74
75#ifdef OS_VXWORKS
76 {
78
81 }
82#else
88 }
89 memcpy((
char *) &(bind_addr.sin_addr),
phe->h_addr,
phe->h_length);
90#endif
91
92#ifdef OS_UNIX
93 do {
94 status = connect(sock, (
struct sockaddr *) &bind_addr,
sizeof(bind_addr));
95
96
98#else
99 status = connect(sock, (
struct sockaddr *) &bind_addr,
sizeof(bind_addr));
100#endif
101
107 }
108
109
111 (*con)->sock = sock;
112 (*con)->data = 0;
113
116
117
122 }
123
125}
BOOL ftp_good(int number,...)
char host_name[HOST_NAME_LENGTH]
◆ ftp_data()
Definition at line 250 of file ftplib.cxx.
252{
259 char *a, *b;
260
263
266
269
272
274 (
char *) &
one,
sizeof(
one)) < 0) {
277 }
278
281 data.sin_addr.s_addr = *(
unsigned long *) *(host->h_addr_list);
282
286 }
287
288#ifdef OS_WINNT
290#else
292#endif
295 }
296
300 }
301
302 a = (
char *) &
data.sin_addr;
303 b = (
char *) &
data.sin_port;
304
309
313
314#ifdef OS_WINNT
316#else
318#endif
319
323 }
324
326
328
330}
int ftp_command(FTP_CON *con, const char *command, const char *param,...)
int ftp_port(FTP_CON *con, int a, int b, int c, int d, int e, int f)
◆ ftp_debug()
Definition at line 32 of file ftplib.cxx.
34{
37}
int(* ftp_debug_func)(const char *message)
◆ ftp_dir()
Definition at line 587 of file ftplib.cxx.
589{
590 char command[256], buffer[8192];
591
593 strcpy(command, "LIST");
594 else
596
599
602
604}
int ftp_close(FTP_CON *con)
int ftp_data(FTP_CON *con, const char *command, const char *file)
int ftp_receive(int sock, char *buffer, int bsize)
◆ ftp_get()
Definition at line 475 of file ftplib.cxx.
477{
485
488
491
493
500 }
501 }
502
505
508 sprintf(
str,
"%ld bytes received in %1.2f seconds (%1.2lf kB/sec).",
511 }
512
514}
#define ftp_open_read(ftp, file)
#define write(n, a, f, d)
◆ ftp_get_message()
Definition at line 194 of file ftplib.cxx.
196{
198
202
204 break;
205 }
206
208
210
213
214
217
219}
#define message(type, str)
◆ ftp_good()
Definition at line 223 of file ftplib.cxx.
225{
228 int code;
229
230 va_start(
args, number);
232
233 do {
236 break;
237
238 if (code == number)
240
241 } while (!result);
242
244
245 return result;
246}
◆ ftp_login()
Definition at line 388 of file ftplib.cxx.
391{
393
397
401
404
408
412
415 }
416
418}
int ftp_connect(FTP_CON **con, const char *host_name, unsigned short port)
#define ftp_account(ftp, acc)
#define ftp_password(ftp, pas)
#define ftp_user(ftp, user)
◆ ftp_move()
Definition at line 460 of file ftplib.cxx.
462{
464
466
469 else
471}
◆ ftp_port()
Definition at line 438 of file ftplib.cxx.
440{
441 char cmd[256];
443
444 sprintf(cmd,
"PORT %d,%d,%d,%d,%d,%d", a, b,
c,
d,
e, f);
447
451
454
456}
◆ ftp_put()
Definition at line 518 of file ftplib.cxx.
520{
528
531
534
536
542 }
543 }
544
547
550 sprintf(
str,
"%ld bytes sent in %1.2f seconds (%1.2lf kB/sec).",
553 }
554
556}
int ftp_send(int sock, const char *buffer, int n_bytes_to_write)
#define ftp_open_write(ftp, file)
◆ ftp_pwd()
Definition at line 560 of file ftplib.cxx.
562{
563 static char str[256];
566
570
572
576
578 }
579
581
583}
◆ ftp_receive()
Definition at line 367 of file ftplib.cxx.
369{
371
377
380
383 }
384}
◆ ftp_send()
Definition at line 346 of file ftplib.cxx.
348{
350
352
357
360 }
361
363}
◆ ftp_send_message()
Definition at line 129 of file ftplib.cxx.
131{
134
135 if (
send(
con->sock,
"\r\n", 2, 0) == -1)
137
140
142}