forked from rhash/RHash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
output.h
50 lines (40 loc) · 1.27 KB
/
output.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/* output.h */
#ifndef OUTPUT_H
#define OUTPUT_H
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
struct file_info;
struct file_t;
/**
* A 'method' to output percents.
*/
struct percents_output_info_t
{
int (*init)(struct file_info *info);
void (*update)(struct file_info *info, uint64_t offset);
void (*finish)(struct file_info *info, int process_res);
const char* name;
};
/* pointer to the selected percents output method */
extern struct percents_output_info_t *percents_output;
#define init_percents(info) percents_output->init(info)
#define update_percents(info, offset) percents_output->update(info, offset)
#define finish_percents(info, process_res) percents_output->finish(info, process_res)
/* initialization of percents output method */
void setup_output(void);
void setup_percents(void);
void log_msg(const char* format, ...);
void log_error(const char* format, ...);
void log_warning(const char* format, ...);
void log_file_error(const char* filepath);
void log_file_t_error(const struct file_t* file);
void report_interrupted(void);
void print_check_stats(void);
void print_time_stats(double time, uint64_t size, int total);
void print_file_time_stats(struct file_info* info);
#ifdef __cplusplus
} /* extern "C" */
#endif /* __cplusplus */
#endif /* OUTPUT_H */