resetting manifest requested domain to floor
[platform/upstream/ccache.git] / hashutil.h
1 #ifndef HASHUTIL_H
2 #define HASHUTIL_H
3
4 #include "mdfour.h"
5 #include <inttypes.h>
6
7 struct file_hash
8 {
9         uint8_t hash[16];
10         uint32_t size;
11 };
12
13 unsigned hash_from_string(void *str);
14 unsigned hash_from_int(int i);
15 int strings_equal(void *str1, void *str2);
16 int file_hashes_equal(struct file_hash *fh1, struct file_hash *fh2);
17
18 #define HASH_SOURCE_CODE_OK 0
19 #define HASH_SOURCE_CODE_ERROR 1
20 #define HASH_SOURCE_CODE_FOUND_DATE 2
21 #define HASH_SOURCE_CODE_FOUND_TIME 4
22
23 int hash_source_code_string(
24         struct mdfour *hash, const char *str, size_t len, const char *path);
25 int hash_source_code_file(struct mdfour *hash, const char *path);
26 bool hash_command_output(struct mdfour *hash, const char *command,
27                          const char *compiler);
28 bool hash_multicommand_output(struct mdfour *hash, const char *command,
29                               const char *compiler);
30
31 #endif