MIDAS
Loading...
Searching...
No Matches
ftplib.h
Go to the documentation of this file.
1/********************************************************************\
2
3 Name: ftplib.h
4 Created by: Stefan Ritt
5
6 Contents: FTP library declarations
7
8 $Id$
9
10\********************************************************************/
11
12#ifndef _FTPLIB_H
13#define _FTPLIB_H
14
15#ifndef EXPRT
16#define EXPRT
17#endif
18
19#define FTP_MAX_ANSWERS 10 /* Number of known goodest answers for reqest */
20#define FTP_QUIT 0
21#define FTP_Ctrl(x) ((x) - '@')
22#define FTP_FREE(x) memset ( &x , '\0' , sizeof x )
23#define FTP_CUT(x) ((x)&0xff)
24
25typedef struct {
26 int sock;
27 int data;
28 int err_no;
29} FTP_CON;
30
31#define ftp_account(ftp,acc) ftp_command(ftp,"ACCT %s",acc,230,EOF)
32#define ftp_user(ftp,user) ftp_command(ftp,"USER %s",user,230,331,332,EOF)
33#define ftp_password(ftp,pas) ftp_command(ftp,"PASS %s",pas,230,332,EOF)
34#define ftp_type(ftp,type) ftp_command(ftp,"TYPE %s",type,200,EOF)
35#define ftp_chdir(ftp,dir) ftp_command(ftp,"CWD %s",dir,200,250,EOF)
36#define ftp_mkdir(ftp,dir) ftp_command(ftp,"XMKD %s",dir,200,257,EOF)
37#define ftp_rm(ftp,dir) ftp_command(ftp,"DELE %s",dir,200,250,EOF)
38#define ftp_ascii(ftp) ftp_type(ftp,"A")
39#define ftp_binary(ftp) ftp_type(ftp,"I")
40#define ftp_open_read(ftp,file) ftp_data(ftp,"RETR %s",file)
41#define ftp_open_write(ftp,file) ftp_data(ftp,"STOR %s",file)
42#define ftp_open_append(ftp,file) ftp_data(ftp,"APPE %s",file)
43
44 int EXPRT ftp_bye(FTP_CON * con);
46 int EXPRT ftp_connect(FTP_CON ** con, const char *host_name, unsigned short port);
47 int EXPRT ftp_login(FTP_CON ** con, const char *host, unsigned short port, const char *user,
48 const char *pass, const char *acct);
49 int EXPRT ftp_move(FTP_CON * con, const char *old_name, const char *new_name);
50 int EXPRT ftp_data(FTP_CON * con, const char *command, const char *param);
51 int EXPRT ftp_port(FTP_CON * con, int, int, int, int, int, int);
52 int EXPRT ftp_get(FTP_CON * con, const char *local_name, const char *remote_name);
53 int EXPRT ftp_put(FTP_CON * con, const char *local_name, const char *remote_name);
54 int EXPRT ftp_send(int sock, const char *buffer, int n_bytes);
55 int EXPRT ftp_receive(int sock, char *buffer, int bsize);
56 int EXPRT ftp_send_message(FTP_CON * con, const char *message);
58 BOOL EXPRT ftp_good(int number, ...);
59 int EXPRT ftp_command(FTP_CON * con, const char *command, const char *param, ...);
60 int EXPRT ftp_dir(FTP_CON * con, const char *file);
61 char EXPRT *ftp_pwd(FTP_CON * con);
62 void EXPRT ftp_debug(int (*debug_func) (const char *message),
63 int (*error_func) (const char *message));
64
65#endif // _FTPLIB_H
int EXPRT ftp_data(FTP_CON *con, const char *command, const char *param)
Definition ftplib.cxx:250
char EXPRT * ftp_pwd(FTP_CON *con)
Definition ftplib.cxx:560
void EXPRT ftp_debug(int(*debug_func)(const char *message), int(*error_func)(const char *message))
Definition ftplib.cxx:32
int EXPRT ftp_receive(int sock, char *buffer, int bsize)
Definition ftplib.cxx:367
int EXPRT ftp_port(FTP_CON *con, int, int, int, int, int, int)
Definition ftplib.cxx:438
int EXPRT ftp_command(FTP_CON *con, const char *command, const char *param,...)
Definition ftplib.cxx:146
int EXPRT ftp_send_message(FTP_CON *con, const char *message)
Definition ftplib.cxx:129
int EXPRT ftp_send(int sock, const char *buffer, int n_bytes)
Definition ftplib.cxx:346
int EXPRT ftp_dir(FTP_CON *con, const char *file)
Definition ftplib.cxx:587
int EXPRT ftp_get(FTP_CON *con, const char *local_name, const char *remote_name)
Definition ftplib.cxx:475
int EXPRT ftp_bye(FTP_CON *con)
Definition ftplib.cxx:422
int EXPRT ftp_login(FTP_CON **con, const char *host, unsigned short port, const char *user, const char *pass, const char *acct)
Definition ftplib.cxx:388
int EXPRT ftp_move(FTP_CON *con, const char *old_name, const char *new_name)
Definition ftplib.cxx:460
int EXPRT ftp_close(FTP_CON *con)
Definition ftplib.cxx:334
int EXPRT ftp_connect(FTP_CON **con, const char *host_name, unsigned short port)
Definition ftplib.cxx:41
#define EXPRT
Definition ftplib.h:16
BOOL EXPRT ftp_good(int number,...)
Definition ftplib.cxx:223
int EXPRT ftp_get_message(FTP_CON *con, char *message)
Definition ftplib.cxx:194
int EXPRT ftp_put(FTP_CON *con, const char *local_name, const char *remote_name)
Definition ftplib.cxx:518
char param[10][256]
Definition mana.cxx:250
char host_name[HOST_NAME_LENGTH]
Definition mana.cxx:242
DWORD BOOL
Definition midas.h:105
#define message(type, str)
TH1X EXPRT * h1_book(const char *name, const char *title, int bins, double min, double max)
Definition rmidas.h:24
int err_no
Definition ftplib.h:28
int sock
Definition ftplib.h:26
int data
Definition ftplib.h:27