📄 fileattach.h
字号:
#if !defined(FILEATTACH_H)#define FILEATTACH_H#include <sys/types.h>#include <sys/stat.h>#include <unistd.h>#include <glib.h>#define FILE_ATTCH_ONE_EXT_SIZE 512#define FATTACH_BUFF_LEN 1024#define DOWNLOAD_VIEW_FNAME (0)#define DOWNLOAD_VIEW_REMAIN (1)#define DOWNLOAD_VIEW_USER (2)#define DOWNLOAD_VIEW_PKTNO (3)typedef struct _attach_file_block{ guint count; GMutex *mutex; int max_id; long pkt_no; GList *files; /*ファイル情報*/ gchar *ipaddr; }attach_file_block_t;typedef struct _download_file_info{ /* ダウンロードファイル情報 */ int fileid; gchar *filename; size_t size; time_t m_time; unsigned long ipmsg_fattr;}download_file_block_t;typedef struct _file_info{ GMutex *mutex; attach_file_block_t *main_info_ref; download_file_block_t *dfcb_ref; int fileid; gchar *filepath; gchar *filename; size_t size; time_t m_time; int ipmsg_fattr; size_t offset; /*未使用*/ GList *xattrs; /*未使用*/}file_info_t;int create_attach_file_block(attach_file_block_t **afcb);int destroy_attach_file_block(attach_file_block_t **afcb);int release_attach_file_block(const long pktno,gboolean force);int ref_attach_file_block(long pktno,const char *ipaddr);int unref_attach_file_block(long pktno);int set_attch_file_block_pktno(attach_file_block_t *afcb,const long pktno);int add_attach_file(attach_file_block_t *afcb,const gchar *path);int remove_attach_file(attach_file_block_t *afcb,const gchar *path);int release_attach_file(const long pktno,int fileid);int get_attach_file_extention(attach_file_block_t *afcb,const gchar **ext_string);int refer_attach_file(const long pktno,int fileid,unsigned long *ipmsg_fattr,const char **path,size_t *size);int destroy_download_list(const GList **download_list);int parse_download_string(const char *string, GList **list);int get_file_info(const gchar *path,size_t *size,time_t *mtime,int *ipmsg_type);void show_file_list(attach_file_block_t *afcb);int add_upload_queue(long pktno,attach_file_block_t *afcb) ;GList *get_download_monitor_info(void);const gchar *get_file_type_name(unsigned long fattr);#endif /* FILEATTACH_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -