2023-08-07 23:37:47 -04:00
|
|
|
/* _,.---._ .-._ .--.-. ,--.--------.
|
|
|
|
* _,..---._ ,-.' , - `. /==/ \ .-._/==/ //==/, - , -\
|
|
|
|
* /==/, - \ /==/_, , - \|==|, \/ /, |==\ -\\==\.-. - ,-./
|
|
|
|
* |==| _ _\==| .=. |==|- \| | \==\- \`--`\==\- \
|
|
|
|
* |==| .=. |==|_ : ;=: - |==| , | -| `--`-' \==\_ \
|
|
|
|
* |==|,| | -|==| , '=' |==| - _ | |==|- |
|
|
|
|
* |==| '=' /\==\ - ,_ /|==| /\ , | |==|, |
|
|
|
|
* |==|-, _`/ '.='. - .' /==/, | |- | /==/ -/
|
|
|
|
* `-.`.____.' `--`--'' `--`./ `--` `--`--`
|
|
|
|
* _ __ ,---. .-._ .=-.-. _,.----.
|
|
|
|
* .-`.' ,`..--.' \ /==/ \ .-._ /==/_ /.' .' - \
|
|
|
|
* /==/, - \==\-/\ \ |==|, \/ /, /==|, |/==/ , ,-'
|
|
|
|
* |==| _ .=. /==/-|_\ | |==|- \| ||==| ||==|- | .
|
|
|
|
* |==| , '=',\==\, - \ |==| , | -||==|- ||==|_ `-' \
|
|
|
|
* |==|- '..'/==/ - ,| |==| - _ ||==| ,||==| _ , |
|
|
|
|
* |==|, | /==/- /\ - \|==| /\ , ||==|- |\==\. /
|
|
|
|
* /==/ - | \==\ _.\=\.-'/==/, | |- |/==/. / `-.`.___.-'
|
|
|
|
* `--`---' `--` `--`./ `--``--`-`
|
|
|
|
*
|
|
|
|
* @(#)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 <stdio.h>
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
|
#include "haggis.h"
|
|
|
|
|
|
|
|
int haggis_store_header(FILE *stream);
|
|
|
|
int haggis_check_header(FILE *stream);
|
2023-08-08 01:25:15 -04:00
|
|
|
void haggis_device_init(dev_t rdev, haggis_device *dev);
|
2023-08-07 23:37:47 -04:00
|
|
|
int haggis_store_device(FILE *stream, haggis_device *dev);
|
2023-08-08 01:40:21 -04:00
|
|
|
int haggis_load_device(FILE *stream, haggis_device *dev);
|
2023-08-07 23:37:47 -04:00
|
|
|
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);
|
2023-08-09 15:28:02 -04:00
|
|
|
int haggis_file_init(char *path, haggis_file *hf, haggis_algorithm a);
|
2023-08-07 23:37:47 -04:00
|
|
|
int haggis_store_file(FILE *stream, haggis_file *file);
|
2023-08-08 01:40:21 -04:00
|
|
|
int haggis_load_file(FILE *stream, haggis_file *f);
|
2023-08-08 01:25:15 -04:00
|
|
|
void haggis_filename_init(char *target, haggis_filename *fname);
|
2023-08-07 23:37:47 -04:00
|
|
|
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);
|
|
|
|
|
|
|
|
#endif // !HAGGIS_PRIVATE_H
|