1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-26 01:50:10 +00:00

Move some general induction-related functions to induct.c

This commit is contained in:
jsteube 2016-09-14 15:08:22 +02:00
parent 7e6f3ef853
commit 25f8a95306
3 changed files with 19 additions and 12 deletions

View File

@ -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

View File

@ -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;

View File

@ -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;
}