2023-08-10 09:48:10 -04:00
|
|
|
#include "haggis_private.h"
|
|
|
|
#include <assert.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#if defined(__FreeBSD__) || defined(__DragonFly__)
|
|
|
|
#include <sha.h>
|
|
|
|
#elif defined(__NetBSD__) || defined(__OpenBSD__) || defined(__LINUX__)
|
|
|
|
#include <sha1.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
haggis_file hf;
|
|
|
|
char *f = "load_device.c";
|
|
|
|
FILE *fd;
|
|
|
|
|
2024-02-11 18:54:38 -05:00
|
|
|
assert(haggis_file_init(&hf, f, sha1) == 0);
|
2023-08-10 09:48:10 -04:00
|
|
|
fd = fopen("output/store_file_sha1", "w");
|
2024-02-11 18:54:38 -05:00
|
|
|
assert(haggis_store_file(&hf, fd) == 0);
|
2023-08-10 09:48:10 -04:00
|
|
|
fflush(fd);
|
|
|
|
fclose(fd);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|