filecopy.h 738 B

1234567891011121314151617181920212223242526272829303132
  1. #define FILECOPY_SPOOL "/home/user/.filecopyspool"
  2. #define FILECOPY_VMNAME_SIZE 32
  3. #define PROGRESS_NOTIFY_DELTA (15*1000*1000)
  4. #define MAX_PATH_LENGTH 16384
  5. #define LEGAL_EOF 31415926
  6. struct file_header {
  7. unsigned int namelen;
  8. unsigned int mode;
  9. unsigned long long filelen;
  10. unsigned int atime;
  11. unsigned int atime_nsec;
  12. unsigned int mtime;
  13. unsigned int mtime_nsec;
  14. };
  15. struct result_header {
  16. unsigned int error_code;
  17. unsigned long crc32;
  18. };
  19. enum {
  20. COPY_FILE_OK,
  21. COPY_FILE_READ_EOF,
  22. COPY_FILE_READ_ERROR,
  23. COPY_FILE_WRITE_ERROR
  24. };
  25. int copy_file(int outfd, int infd, long long size, unsigned long *crc32);
  26. char *copy_file_status_to_str(int status);
  27. void set_size_limit(long long new_bytes_limit, long long new_files_limit);