1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-12-23 07:08:19 +00:00

Add missing sources

This commit is contained in:
jsteube 2016-09-08 18:56:33 +02:00
parent f006542317
commit e923c29435
2 changed files with 55 additions and 0 deletions

33
include/dictstat.h Normal file
View 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
View 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));
}