From 25f8a953069e7287f353a5e21925f003f6265d4a Mon Sep 17 00:00:00 2001 From: jsteube Date: Wed, 14 Sep 2016 15:08:22 +0200 Subject: [PATCH] Move some general induction-related functions to induct.c --- include/induct.h | 8 ++++++++ src/hashcat.c | 12 ------------ src/induct.c | 11 +++++++++++ 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/include/induct.h b/include/induct.h index 3b0cec70a..ae8441f44 100644 --- a/include/induct.h +++ b/include/induct.h @@ -6,4 +6,12 @@ #ifndef _INDUCT_H #define _INDUCT_H +#include +#include +#include + +#define INDUCT_DIR "induct" + +int sort_by_mtime (const void *p1, const void *p2); + #endif // _INDUCT_H diff --git a/src/hashcat.c b/src/hashcat.c index 64eba0395..d8331bcab 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -279,18 +279,6 @@ static char *stroptitype (const uint opti_type) #define OPENCL_VECTOR_WIDTH 0 static double TARGET_MS_PROFILE[4] = { 2, 12, 96, 480 }; -// induct -#define INDUCT_DIR "induct" -int sort_by_mtime (const void *p1, const void *p2) -{ - const char **f1 = (const char **) p1; - const char **f2 = (const char **) p2; - - struct stat s1; stat (*f1, &s1); - struct stat s2; stat (*f2, &s2); - - return s2.st_mtime - s1.st_mtime; -} // thread static hc_thread_mutex_t mux_dispatcher; diff --git a/src/induct.c b/src/induct.c index 1279145ff..cde9adae4 100644 --- a/src/induct.c +++ b/src/induct.c @@ -5,3 +5,14 @@ #include "common.h" #include "induct.h" + +int sort_by_mtime (const void *p1, const void *p2) +{ + const char **f1 = (const char **) p1; + const char **f2 = (const char **) p2; + + struct stat s1; stat (*f1, &s1); + struct stat s2; stat (*f2, &s2); + + return s2.st_mtime - s1.st_mtime; +}