diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-02-17 21:28:53 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-02-17 21:28:53 +0000 |
commit | 189d7eb970b025c570c7ccce916759083373bdde (patch) | |
tree | f4f7c3a71ecc7851a8a7b86206bbb202b5cab551 /hashutil.h | |
download | ccache-tarball-master.tar.gz |
ccache-3.3.4HEADccache-3.3.4master
Diffstat (limited to 'hashutil.h')
-rw-r--r-- | hashutil.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/hashutil.h b/hashutil.h new file mode 100644 index 0000000..ae9abf1 --- /dev/null +++ b/hashutil.h @@ -0,0 +1,35 @@ +#ifndef HASHUTIL_H +#define HASHUTIL_H + +#include "conf.h" +#include "mdfour.h" +#include <inttypes.h> + +struct file_hash +{ + uint8_t hash[16]; + uint32_t size; +}; + +unsigned hash_from_string(void *str); +unsigned hash_from_int(int i); +int strings_equal(void *str1, void *str2); +int file_hashes_equal(struct file_hash *fh1, struct file_hash *fh2); + +#define HASH_SOURCE_CODE_OK 0 +#define HASH_SOURCE_CODE_ERROR 1 +#define HASH_SOURCE_CODE_FOUND_DATE 2 +#define HASH_SOURCE_CODE_FOUND_TIME 4 + +int check_for_temporal_macros(const char *str, size_t len); +int hash_source_code_string( + struct conf *conf, struct mdfour *hash, const char *str, size_t len, + const char *path); +int hash_source_code_file( + struct conf *conf, struct mdfour *hash, const char *path); +bool hash_command_output(struct mdfour *hash, const char *command, + const char *compiler); +bool hash_multicommand_output(struct mdfour *hash, const char *command, + const char *compiler); + +#endif |