ftp_file.h

来自「AMLOGIC DPF source code」· C头文件 代码 · 共 43 行

H
43
字号
#ifndef __BTFTP_FILE_H
#define __BTFTP_FILE_H

#include "../bt_api.h"

#define file_malloc					bt_malloc
#define file_free					bt_free

#define BT_FTP_BUFFER_SIZE			(BT_OBEX_MTU*10)
#define BT_FTP_TIMEOUT				(OS_TICKS_PER_SEC*30)

typedef struct _BTFtp_File
{
	BT_FTP_Handle_t handle;
	link_buff_head_t *link_buf;
	char *file_name;
	unsigned long file_length;
	long file_offset;
	
	link_buff_t *cur_lkb;
	long cur_lkb_offset;
	long cur_buf_used;
	
	unsigned long read_ahead_len;
	bt_request_t read_req;
	int read_pending;
} BTFtp_File_t;

extern link_buff_head_t *bt_ftp_get_file(BT_FTP_Handle_t ftp_handle, char *file_name);
extern link_buff_head_t *bt_ftp_get_file_asyn(BT_FTP_Handle_t ftp_handle, char *file_name, obex_file_cb_t obex_file_cb);
extern void bt_ftp_set_finish_flag(BT_FTP_Handle_t ftp_handle, int finish_flag);
extern int bt_ftp_transfer_receiving(BT_FTP_Handle_t ftp_handle);
extern int bt_ftp_transfer_suspend(BT_FTP_Handle_t ftp_handle);
extern int bt_ftp_transfer_resume(BT_FTP_Handle_t ftp_handle);
extern int bt_ftp_transfer_abort(BT_FTP_Handle_t ftp_handle);

BTFtp_File_t *btftp_file_open(char *name, unsigned arg, unsigned context);
int btftp_file_close(BTFtp_File_t *ftp_file);
int btftp_file_get_data(BTFtp_File_t *ftp_file, void *buf, unsigned size);
int btftp_file_seek(BTFtp_File_t *ftp_file, long offset, int fromwhere);


#endif //__BTFTP_FILE_H

⌨️ 快捷键说明

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