progress.h 465 B

12345678910111213141516171819202122232425
  1. #ifndef __PROGRESS_H
  2. #define __PROGRESS_H
  3. #include <sys/types.h>
  4. struct progress {
  5. unsigned int last_size;
  6. unsigned int last_update_sec;
  7. unsigned int last_change_sec;
  8. unsigned int start_sec;
  9. char *curfile;
  10. };
  11. void progress_init(struct progress *p, const char *curfile);
  12. void progress_update(struct progress *p, off_t beg_size,
  13. off_t transferred, off_t totalsize);
  14. static inline void
  15. progress_free(struct progress *p)
  16. {
  17. free(p->curfile);
  18. }
  19. #endif