-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathhashdb.h
More file actions
38 lines (31 loc) · 927 Bytes
/
hashdb.h
File metadata and controls
38 lines (31 loc) · 927 Bytes
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
/* File hash database management
* This file is part of jdupes; see jdupes.c for license information */
#ifndef JDUPES_HASHDB_H
#define JDUPES_HASHDB_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include "jdupes.h"
typedef struct _hashdb {
struct _hashdb *left;
struct _hashdb *right;
uint64_t path_hash;
char *path;
uint64_t partialhash;
uint64_t fullhash;
jdupes_ino_t inode;
off_t size;
time_t mtime;
uint_fast8_t hashcount;
} hashdb_t;
extern int save_hash_database(const char * const restrict dbname, const int destroy);
extern hashdb_t *add_hashdb_entry(char *in_path, const int in_pathlen, const file_t *check);
extern int64_t load_hash_database(const char * const restrict dbname);
extern int read_hashdb_entry(file_t *file);
extern uint64_t dump_hashdb(void);
extern int cleanup_hashdb(uint64_t *cnt, hashdb_t *cur);
#ifdef __cplusplus
}
#endif
#endif /* JDUPES_HASHDB_H */