qfile-utils.h 893 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef _LIBQUBES_QFILE_UTILS_H
  2. #define _LIBQUBES_QFILE_UTILS_H 1
  3. #define _GNU_SOURCE
  4. #include <dirent.h>
  5. #include <stdio.h>
  6. #include <string.h>
  7. #include <sys/stat.h>
  8. #include <signal.h>
  9. #include <fcntl.h>
  10. #include <malloc.h>
  11. #include <stdlib.h>
  12. #include <unistd.h>
  13. #include <errno.h>
  14. #include <gui-fatal.h>
  15. #include <libqubes-rpc-filecopy.h>
  16. enum {
  17. PROGRESS_FLAG_NORMAL,
  18. PROGRESS_FLAG_INIT,
  19. PROGRESS_FLAG_DONE
  20. };
  21. extern unsigned long crc32_sum;
  22. extern int ignore_symlinks;
  23. void notify_progress(int size, int flag);
  24. void do_notify_progress(long long total, int flag);
  25. void notify_end_and_wait_for_result(void);
  26. void write_headers(const struct file_header *hdr, const char *filename);
  27. int write_all_with_crc(int fd, const void *buf, int size);
  28. int single_file_processor(const char *filename, const struct stat *st);
  29. void wait_for_result(void);
  30. #endif /* _LIBQUBES_QFILE_UTILS_H */