wrap print progress in pprint

This commit is contained in:
Ryo Nakamura
2022-10-25 01:47:39 +09:00
parent c83927cd5a
commit 47f6983148
6 changed files with 84 additions and 40 deletions

14
src/pprint.h Normal file
View File

@@ -0,0 +1,14 @@
#ifndef _PPRINT_H_
#define _PPRINT_H_
/* progress print functions */
void pprint_set_level(int level);
void pprint(int level, const char *fmt, ...);
#define pprint1(fmt, ...) pprint(1, "\r\033[K" fmt, ##__VA_ARGS__)
#define pprint2(fmt, ...) pprint(2, "\r\033[K" fmt, ##__VA_ARGS__)
#define pprint3(fmt, ...) pprint(3, "\r\033[K" fmt, ##__VA_ARGS__)
#define pprint4(fmt, ...) pprint(4, "\r\033[K" fmt, ##__VA_ARGS__)
#endif /* _PPRRINT_H_ */