diff options
author | Ryo Nakamura <upa@haeena.net> | 2022-10-25 01:47:39 +0900 |
---|---|---|
committer | Ryo Nakamura <upa@haeena.net> | 2022-10-25 01:47:39 +0900 |
commit | 47f6983148047975e00f48b1ef77f8c4c7f2fd73 (patch) | |
tree | 5ce9ac01f3b8b9c2bd66c7ffad0ffca35ff89e72 /src/pprint.h | |
parent | c83927cd5a56111a11c2f7879c6e444b31eddb27 (diff) |
wrap print progress in pprint
Diffstat (limited to 'src/pprint.h')
-rw-r--r-- | src/pprint.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/pprint.h b/src/pprint.h new file mode 100644 index 0000000..7fa303e --- /dev/null +++ b/src/pprint.h @@ -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_ */ |