mirror of
https://github.com/hashcat/hashcat.git
synced 2024-12-26 16:38:35 +00:00
Move some general induction-related functions to induct.c
This commit is contained in:
parent
7e6f3ef853
commit
25f8a95306
@ -6,4 +6,12 @@
|
||||
#ifndef _INDUCT_H
|
||||
#define _INDUCT_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define INDUCT_DIR "induct"
|
||||
|
||||
int sort_by_mtime (const void *p1, const void *p2);
|
||||
|
||||
#endif // _INDUCT_H
|
||||
|
@ -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;
|
||||
|
11
src/induct.c
11
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user