OAIP_Mirror/progressbar test/progressbar.h
2024-12-03 12:31:42 +04:00

23 lines
614 B
C

#ifndef JPEG2PNG_PROGRESSBAR_H
#define JPEG2PNG_PROGRESSBAR_H
struct progressbar {
unsigned current;
unsigned max;
};
// initialize progressbar with maximum value
void progressbar_start(struct progressbar *pb, unsigned max);
// set current value
void progressbar_set(struct progressbar *pb, unsigned current);
// add to current value
void progressbar_add(struct progressbar *pb, unsigned n);
// add one to current value
void progressbar_inc(struct progressbar *pb);
// clear line of progress bar
void progressbar_clear();
unsigned get_percentage(unsigned current, unsigned max);
#endif