summaryrefslogtreecommitdiff
path: root/src/id.h
diff options
context:
space:
mode:
authorAlex Xu (Hello71) <alex_y_xu@yahoo.ca>2018-08-26 19:41:23 -0400
committerAlex Xu (Hello71) <alex_y_xu@yahoo.ca>2018-08-26 19:41:23 -0400
commitda69892f56a081cb4cd65eb0a8065783d9473bd3 (patch)
treef4bf33fc7c65366163565a12bd0254f0c7c21975 /src/id.h
parentf3664a28a927c7a9a122af4d72a89114b26f39bd (diff)
downloadrandom-seed-da69892f56a081cb4cd65eb0a8065783d9473bd3.tar.xz
random-seed-da69892f56a081cb4cd65eb0a8065783d9473bd3.zip
Refactor.
Diffstat (limited to 'src/id.h')
-rw-r--r--src/id.h22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/id.h b/src/id.h
index 7c45a64..ae1c788 100644
--- a/src/id.h
+++ b/src/id.h
@@ -1,20 +1,22 @@
// SPDX-License-Identifier: BSD-3-Clause
-#ifndef FSID_H
-#define FSID_H
+#pragma once
#include <sys/types.h>
+#include "random-seed.h"
#include "util.h"
-#if defined(HAVE_UDEV) || defined(HAVE_UTIL_LINUX)
-size_t get_fs_uuid(char **fs_uuid, int seed_fd);
+#if defined(HAVE_LIBUDEV) || defined(HAVE_UTIL_LINUX)
+#define HAVE_FS_UUID
+bool set_rs_device(struct random_seed *rs, int fd);
+const char *get_fs_uuid(struct random_seed *rs);
#endif
-#ifdef HAVE_UDEV
-size_t get_drive_id(char **drive_id, int seed_fd);
-#endif
-size_t get_machine_id(char **machine_id);
-size_t get_fs_id(fsid_t *fs_id, int seed_fd);
-void hash(const unsigned char salt[static SALT_LEN], unsigned char *out, const void *in, size_t size);
+#ifdef HAVE_LIBUDEV
+const char *get_drive_id(struct random_seed *rs);
#endif
+
+const char *get_machine_id();
+bool get_fs_id(fsid_t *fs_id, int fd);
+void hash(const unsigned char salt[static SALT_LEN], unsigned char *out, const void *in, size_t size);