upload.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef RVC_MOD_UPLOAD_UPLOAD_H_
  2. #define RVC_MOD_UPLOAD_UPLOAD_H_
  3. #include <list.h>
  4. typedef struct file_t file_t;
  5. typedef struct upload_dir_t upload_dir_t;
  6. struct file_t
  7. {
  8. struct list_head entry;
  9. char *path;
  10. char *name;
  11. unsigned int create_time;
  12. unsigned int length;
  13. upload_dir_t *owner;
  14. };
  15. #define UPLOAD_FLAG_AUTODELETE 0x01
  16. #define UPLOAD_FLAG_MOVEPATH 0x02
  17. #define UPLOAD_FLAG_ZIP 0x04
  18. // from ini config
  19. struct upload_dir_t {
  20. struct list_head entry;
  21. char *name;
  22. char *path;
  23. int flags;//自动删除|移动|压缩
  24. char *movepath;
  25. struct list_head candidate_list;//需要上传文件的集合
  26. int silent_time; // sec
  27. int child_count_limitation;
  28. int fileCount;//增加lwt 当前文件的个数
  29. int fileLenSum;//文件总长度 单位是k
  30. };
  31. void upload_file_destroy(file_t *file);
  32. int upload_create(struct list_head *list, IEntityFunction *pEntityFunc, IConfigInfo *pConfig,CSimpleStringA &checkDir);
  33. int upload_fresh(struct list_head *list);
  34. bool ZipData(LPCTSTR lpszZipArchive, LPCTSTR lpszSrcFile);
  35. //增加lwt
  36. int check_dir_fresh(const char *path,int limitation,int silentTime,int &fileSumlen);
  37. void updir_del_file(file_t *file);
  38. #endif // RVC_MOD_UPLOAD_UPLOAD_H_