1 #ifndef _CHAMP_CHOOSER_HASH_H 2 #define _CHAMP_CHOOSER_HASH_H 3 4 #include <uthash.h> 5 #include <openssl/md5.h> 6 7 struct blk; 8 9 typedef struct hash_strong hash_strong_t; 10 11 enum hash_ret 12 { 13 HASH_RET_PERM=-2, 14 HASH_RET_TEMP=-1, 15 HASH_RET_OK=0 16 }; 17 18 struct hash_strong 19 { 20 uint8_t md5sum[MD5_DIGEST_LENGTH]; 21 hash_strong_t *next; 22 uint64_t savepath; 23 }; 24 25 struct hash_weak 26 { 27 uint64_t weak; 28 struct hash_strong *strong; 29 UT_hash_handle hh; 30 }; 31 32 extern struct hash_weak *hash_table; 33 34 extern struct hash_weak *hash_weak_find(uint64_t weak); 35 extern struct hash_strong *hash_strong_find(struct hash_weak *hash_weak, 36 uint8_t *md5sum); 37 extern struct hash_weak *hash_weak_add(uint64_t weakint); 38 39 extern void hash_delete_all(void); 40 extern enum hash_ret hash_load(const char *champ, const char *directory); 41 42 extern int hash_load_blk(struct blk *blk); 43 44 #endif 45