/* _,.---._ .-._ .--.-. ,--.--------. * _,..---._ ,-.' , - `. /==/ \ .-._/==/ //==/, - , -\ * /==/, - \ /==/_, , - \|==|, \/ /, |==\ -\\==\.-. - ,-./ * |==| _ _\==| .=. |==|- \| | \==\- \`--`\==\- \ * |==| .=. |==|_ : ;=: - |==| , | -| `--`-' \==\_ \ * |==|,| | -|==| , '=' |==| - _ | |==|- | * |==| '=' /\==\ - ,_ /|==| /\ , | |==|, | * |==|-, _`/ '.='. - .' /==/, | |- | /==/ -/ * `-.`.____.' `--`--'' `--`./ `--` `--`--` * _ __ ,---. .-._ .=-.-. _,.----. * .-`.' ,`..--.' \ /==/ \ .-._ /==/_ /.' .' - \ * /==/, - \==\-/\ \ |==|, \/ /, /==|, |/==/ , ,-' * |==| _ .=. /==/-|_\ | |==|- \| ||==| ||==|- | . * |==| , '=',\==\, - \ |==| , | -||==|- ||==|_ `-' \ * |==|- '..'/==/ - ,| |==| - _ ||==| ,||==| _ , | * |==|, | /==/- /\ - \|==| /\ , ||==|- |\==\. / * /==/ - | \==\ _.\=\.-'/==/, | |- |/==/. / `-.`.___.-' * `--`---' `--` `--`./ `--``--`-` * * @(#)Copyright (c) 2023, Nathan D. Fisher. * * This is free software. It comes with NO WARRANTY. * Permission to use, modify and distribute this source code * is granted subject to the following conditions. * 1/ that the above copyright notice and this notice * are preserved in all copies and that due credit be given * to the author. * 2/ that any changes to this code are clearly commented * as such so that the author does not get blamed for bugs * other than his own. */ #ifndef HAGGIS_PRIVATE_H #define HAGGIS_PRIVATE_H 1 #include #include #include #include #include "haggis.h" int haggis_store_header(FILE *stream); int haggis_check_header(FILE *stream); void haggis_device_init(dev_t rdev, haggis_device *dev); int haggis_store_device(FILE *stream, haggis_device *dev); int haggis_load_device(FILE *stream, haggis_device *dev); int haggis_store_cksum(FILE *stream, haggis_checksum *cksum); int haggis_load_cksum(FILE *stream, haggis_checksum *cksum); int validate_md5(haggis_file *file); int validate_sha1(haggis_file *file); int validate_sha256(haggis_file *file); int haggis_validate_cksum(haggis_file *file); int haggis_file_init(char *path, haggis_file *hf, haggis_algorithm a); int haggis_store_file(FILE *stream, haggis_file *file); int haggis_load_file(FILE *stream, haggis_file *f); void haggis_filename_init(char *target, haggis_filename *fname); void haggis_filename_deinit(haggis_filename *fname); int haggis_load_filename(FILE *stream, haggis_filename *n); int haggis_store_filename(FILE *stream, haggis_filename *n); int haggis_load_filetype(FILE *stream, haggis_typeflag tag, haggis_filetype *file); int haggis_store_filetype(FILE *stream, haggis_filetype *filetype); uint64_t hash_fnv1a_64(uint8_t *key, size_t len); uint64_t hash_str_fnv1a_64(char *s); #endif // !HAGGIS_PRIVATE_H