aboutsummaryrefslogtreecommitdiff
path: root/include/file_processor.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/file_processor.h')
-rw-r--r--include/file_processor.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/file_processor.h b/include/file_processor.h
index 8cfb6de..cdb30bb 100644
--- a/include/file_processor.h
+++ b/include/file_processor.h
@@ -11,6 +11,8 @@
#define DF_BYTE_SIZE_256 32
#define DF_BYTE_SIZE_512 64
+#define DF_STR_SIZE_256 64
+#define DF_STR_SIZE_512 128
/* Aliases for convenience, currently all algorithms are part of the default
* provider. */
@@ -19,6 +21,15 @@
#define DF_OSSL_SHA512 "SHA2-512"
/**
+ * The hashes in human-readable strings
+ */
+struct df_hashstrings {
+ char blake2[DF_STR_SIZE_512];
+ char sha256[DF_STR_SIZE_256];
+ char sha512[DF_STR_SIZE_512];
+};
+
+/**
* information about a file
* Contains filepath, stat() results, hash values of multiple algorithms.
* TODO: Organize the paths in a global pool (list/tree/map) and only refer there
@@ -27,15 +38,19 @@
struct df_fileinfo {
char *path; /**< pointer to the path of the file */
char *name; /**< pointer to the name of the file */
+#if 0
unsigned char blake2[DF_BYTE_SIZE_512]; /**< The BLAKE2-512 hash in binary form */
unsigned char sha256[DF_BYTE_SIZE_256]; /**< The SHA256 hash in binary form. */
unsigned char sha512[DF_BYTE_SIZE_512]; /**< The SHA512 hash in binary form. */
+#endif
+ struct df_hashstrings hashes; /**< The BLAKE2-512, SHA256 and SHA512 hash of the file */
struct stat statbuf; /**< Result of lstat() call. Symlinks are to be ignored and filtered out earlier. */
};
/*=========== FUNCTIONS ===========*/
int process_file(struct df_fileinfo *info);
+int process_gdbm_content();
#endif