ftpdwl.h

来自「C语言源代码及相关资料」· C头文件 代码 · 共 53 行

H
53
字号
#ifndef	__FTP_DWL_H__
#define	__FTP_DWL_H__

#define	CRC_SIZE		  2
#define	PACKSIZE		510

typedef	int	(*CALLBACK_FTP) ( unsigned char * p, int nbytes, int seek );

typedef	struct {
		int				port;				//	tcp port for ftp protocol
		unsigned
		char *			pip;				//	ip of ftp server

		unsigned
		char *			pusername;			//	username for ftp login
		unsigned
		char *			ppassword;			//	password for ftp login

		unsigned
		char *			pfilename;			//	the name of file to be downloaded
		int				nfilesize;			//	the size of the whole file

		int				timeout;

		CALLBACK_FTP	fn;					//	call-back function for ftp transfering

		int				nbytes;				//	the number of bytes received from file server

		int				port2;				//	tcp port for data channel
		unsigned
		char *			pip2;				//	ip of ftp data channel

		int				ctrl;				//	ftp socket for flow controlling
		int				data;				//	ftp socket for data transfering

		unsigned
		char *			pbuf;
		int				nbufsize;
}		t_ftp;

int		ftp_get_response   ( t_ftp * pftp );

int		ftp_login          ( t_ftp * pftp );

int		ftp_set_pasv       ( t_ftp * pftp );
int		ftp_get_pasv_param ( t_ftp * pftp );

int		ftp_set_param      ( t_ftp * pftp );

int		ftp_dwl            ( t_ftp * pftp );

#endif//__FTP_DWL_H__

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?