-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdtreetrawl.h
74 lines (61 loc) · 1.86 KB
/
dtreetrawl.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef DTREETRAWL_H
#define DTREETRAWL_H
#include <glib.h>
#include <time.h>
#include <ftw.h>
extern gint MAX_LEVEL;
extern gchar *DELIM;
extern gchar *HASH_TYPE;
extern gboolean IS_FOLLOW_SYMLINK;
extern gboolean IS_NO_TENT;
extern gboolean IS_PRINT_ONLY_ROOT_HASH;
extern gboolean IS_TERSE;
extern gboolean IS_JSON;
extern gboolean IS_HASH;
extern gboolean IS_HASH_EXCLUDE_NAME;
extern gboolean IS_HASH_EXCLUDE_CONTENT;
extern gboolean IS_HASH_SYMLINK;
extern gboolean IS_HASH_DIRENT;
extern GChecksumType CHECKSUM_G;
extern GChecksum *ROOT_CKSUM_G;
extern struct dtreestat *DSTAT;
struct trawlent {
const struct stat *tstat;
const char *path;
const char *basename;
unsigned level;
unsigned ndirent;
char *refname;
char *hash;
};
struct dtreestat {
unsigned long long ndir;
unsigned long long nreg;
unsigned long long nlnk;
unsigned long long nblk;
unsigned long long nchr;
unsigned long long nfifo;
unsigned long long nsock;
unsigned long long nlevel;
unsigned long long nsize;
unsigned long long nentry;
double elapsed;
char *hash;
char *hash_type;
char *start_local;
char *start_utc;
};
char *time_t_to_utc(time_t st_time);
char *time_t_to_local(time_t st_time);
void output_human_trawlent(struct trawlent *tent);
void output_human_json_trawlent(struct trawlent *tent);
void output_terse_trawlent(struct trawlent *tent, char *delim);
void output_terse_json_trawlent(struct trawlent *tent);
void output_human_dtreestat(struct dtreestat *dstat);
void output_human_json_dtreestat(struct dtreestat *dstat);
void output_terse_dtreestat(struct dtreestat *dstat, char *delim);
void output_terse_json_dtreestat(struct dtreestat *dstat);
gchar *get_file_checksum(const char *file_path, GChecksumType checksum_type_g);
int action_trawlent(struct trawlent *tent);
int dtree_check(const char *path, const struct stat *sbuf, int type, struct FTW *ftwb);
#endif