From da69892f56a081cb4cd65eb0a8065783d9473bd3 Mon Sep 17 00:00:00 2001 From: "Alex Xu (Hello71)" Date: Sun, 26 Aug 2018 19:41:23 -0400 Subject: Refactor. --- src/random-seed.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/random-seed.h (limited to 'src/random-seed.h') diff --git a/src/random-seed.h b/src/random-seed.h new file mode 100644 index 0000000..baea582 --- /dev/null +++ b/src/random-seed.h @@ -0,0 +1,25 @@ +#pragma once + +#include +#include +#include + +#define MAGIC "RANDOM SEED FILE VERSION 1\n" + +extern bool noperms; + +struct random_seed { + FILE *file; +#ifdef HAVE_UTIL_LINUX + dev_t dev; +#endif +#ifdef HAVE_LIBUDEV + struct udev_device *udev_dev; +#endif +}; + +bool load(const char *seed_path); +bool save(const char *seed_path, const unsigned char *random_buf); + +/* defining noreturn in C99 is too hard */ +void run(const char *mode, const char *seed_path); -- cgit v1.2.3-54-g00ecf