?? simpleftp.h
字號(hào):
/* simple ftp client implemention , wrrten by xudz*/#ifndef SIMPLEFTP_H#define SIMPLEFTP_H#include <sys/types.h>#include <sys/ioctl.h>#include <sys/time.h>#include <sys/stat.h>#include <ctype.h>#include <errno.h>#include <fcntl.h>#include <getopt.h>#include <stdio.h>#include <stdlib.h>#include <signal.h>#include <string.h>#include <unistd.h>#include <netinet/in.h>#include <netdb.h>#include <sys/socket.h>#include <arpa/inet.h>#include <assert.h>#define FTP_DEFAULT_PORT 21#define verbose_flag 1#ifndef STDIN_FILENO#define STDIN_FILENO 0#endif#if BUFSIZ < 4096#undef BUFSIZ#define BUFSIZ 4096#endif#define RESERVE_CONFIG_BUFFER(buffer,len) char buffer[len]#define RELEASE_CONFIG_BUFFER(buffer) ((void)0)#define FALSE 0#define TRUE 1//extern "C" int connect(int ,const struct sockaddr,socklen_t);typedef struct SimpleFTP{ struct sockaddr_in s_in; FILE *control_stream; char reply[64]; char error[64];}SimpleFTP; int SimpleFTP_init(SimpleFTP **sftp); void SimpleFTP_free(SimpleFTP *sftp); int ftpConnect(SimpleFTP *sftp ,char *user ,char *pass ,char *host ,int port ); void ftpDisconnect(SimpleFTP *sftp ); char * pwd(SimpleFTP *sftp); // caller need to free the memory !! int cwd(SimpleFTP *sftp,char * dir); int stor(SimpleFTP *sftp ,char * localPath); int get(SimpleFTP *sftp ,const char *local_path ,char * server_path); // path is file path ,example: /root/test.c int bin(SimpleFTP *sftp); int ascii(SimpleFTP *sftp); char * getLastReply(SimpleFTP *sftp); char * getError(SimpleFTP *sftp) ;#endif
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -