mirror of
https://github.com/hashcat/hashcat.git
synced 2024-11-22 16:18:09 +00:00
Add missing sources
This commit is contained in:
parent
f006542317
commit
e923c29435
33
include/dictstat.h
Normal file
33
include/dictstat.h
Normal file
@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Author......: Jens Steube <jens.steube@gmail.com>
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
#ifndef _DICTSTAT_H
|
||||
#define _DICTSTAT_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#define MAX_DICTSTAT 10000
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u64 cnt;
|
||||
|
||||
#if defined (_POSIX)
|
||||
struct stat stat;
|
||||
#endif
|
||||
|
||||
#if defined (_WIN)
|
||||
struct __stat64 stat;
|
||||
#endif
|
||||
|
||||
} dictstat_t;
|
||||
|
||||
int sort_by_dictstat (const void *s1, const void *s2);
|
||||
|
||||
#endif // _DICTSTAT_H
|
22
src/dictstat.c
Normal file
22
src/dictstat.c
Normal file
@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Author......: Jens Steube <jens.steube@gmail.com>
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
#include "common.h"
|
||||
#include "types_int.h"
|
||||
#include "dictstat.h"
|
||||
|
||||
int sort_by_dictstat (const void *s1, const void *s2)
|
||||
{
|
||||
dictstat_t *d1 = (dictstat_t *) s1;
|
||||
dictstat_t *d2 = (dictstat_t *) s2;
|
||||
|
||||
#if defined (__linux__)
|
||||
d2->stat.st_atim = d1->stat.st_atim;
|
||||
#else
|
||||
d2->stat.st_atime = d1->stat.st_atime;
|
||||
#endif
|
||||
|
||||
return memcmp (&d1->stat, &d2->stat, sizeof (struct stat));
|
||||
}
|
Loading…
Reference in New Issue
Block a user