5 "@(#)hash.c 1.30 16/12/13 joerg";
56#define NR_HASH (16*1024)
58#define HASH_FN(DEV, INO) ((DEV + INO + (INO >> 8) + (INO << 16)) % NR_HASH)
64#define DIGEST_FAST_SIZE 65536
65#define UNIQUE_FILES_HASH_FN(SIZE) ((SIZE) % NR_HASH)
68#define DIGEST_Init SHA3_512_Init
69#define DIGEST_Update SHA3_Update
70#define DIGEST_Final SHA3_Final
71#define DIGEST_CTX SHA3_CTX
72#define DIGEST_LENGTH SHA3_512_DIGEST_LENGTH
77#define DIGEST_Init SHA3_256_Init
78#define DIGEST_LENGTH SHA3_256_DIGEST_LENGTH
114 int minlen = 100000000;
134 error(
"Unbenutzt: %d von %d Einträgen maxlen %d minlen %d total %d optmittel %d\n",
144 unsigned int hash_number = 0;
149 _(
"Non zero-length file '%s' assigned zero extent.\n"),
153#ifdef DUPLICATES_ONCE
163#ifdef DUPLICATES_ONCE
166 hash_number =
HASH_FN((
unsigned int) spnt->
dev,
167 (
unsigned int) spnt->
inode);
168#ifdef DUPLICATES_ONCE
169 else if (duplicates_once &&
171 hash_number = UNIQUE_FILES_HASH_FN((
unsigned int) spnt->
size);
185#if defined(SORTING) || defined(DUPLICATES_ONCE)
195 unsigned int hash_number;
198#ifdef DUPLICATES_ONCE
208#ifdef DUPLICATES_ONCE
211 hash_number =
HASH_FN((
unsigned int) spnt->
dev,
212 (
unsigned int) spnt->
inode);
218 s_hash = s_hash->
next;
220#ifdef DUPLICATES_ONCE
221 }
else if (duplicates_once &&
223 hash_number = UNIQUE_FILES_HASH_FN((
unsigned int) spnt->
size);
228 s_hash = s_hash->
next;
257#ifdef DUPLICATES_ONCE
266 if (!spnt1->digest_fast)
267 if (!(spnt1->digest_fast = DIGEST_File(spnt1->
whole_name,
268 (spnt1->
size > DIGEST_FAST_SIZE) ?
269 DIGEST_FAST_SIZE : spnt1->
size)))
272 if (spnt1->
size <= DIGEST_FAST_SIZE)
273 spnt1->digest_full = spnt1->digest_fast;
275 if (!spnt2->digest_fast)
276 if (!(spnt2->digest_fast = DIGEST_File(spnt2->
whole_name,
277 (spnt2->
size > DIGEST_FAST_SIZE) ?
278 DIGEST_FAST_SIZE : spnt2->
size)))
281 if (spnt2->
size <= DIGEST_FAST_SIZE)
282 spnt2->digest_full = spnt2->digest_fast;
284 if (
memcmp(spnt1->digest_fast, spnt2->digest_fast,
285 DIGEST_LENGTH *
sizeof (
unsigned char)))
288 if (!spnt1->digest_full)
289 if (!(spnt1->digest_full = DIGEST_File(spnt1->
whole_name,
293 if (!spnt2->digest_full)
294 if (!(spnt2->digest_full = DIGEST_File(spnt2->
whole_name,
298 if (
memcmp(spnt1->digest_full, spnt2->digest_full,
299 DIGEST_LENGTH *
sizeof (
unsigned char)))
310 DIGEST_CTX digest_ctx;
312 unsigned char buf[32768];
313 unsigned char *digest_hash;
316 DIGEST_Init(&digest_ctx);
327 DIGEST_Update(&digest_ctx,
buf,
cnt);
333 digest_hash =
e_malloc(
sizeof (
unsigned char) * DIGEST_LENGTH);
334 DIGEST_Final(digest_hash, &digest_ctx);
335 return (digest_hash);
352 unsigned int hash_number;
380 unsigned int hash_number;
405#define NR_NAME_HASH 128
416 unsigned int hash = 0;
467 register int sum = 0;
472 for (p1 =
name; *p1; p1++) {
483 p2 = nh->
de->isorec.name;
485 error(
_(
"Checking name '%s' isorec.name '%s'\n"), p1, p2);
489 if ((*p1 ==
'\0' || *p1 ==
';') ||
490 (*p2 ==
'\0' || *p2 ==
';') ||
500 error(
_(
"'%s' does NOT END OK\n"), p1);
502 error(
_(
"'%s' does NOT END OK\n"), p2);
508 if (*p1 ==
'\0' || *p2 ==
'\0')
511 if (*p1 ==
';' && *p2 ==
';') {
521 if ((*p1 ==
'\0' || *p1 ==
';') &&
522 (*p2 ==
'\0' || *p2 ==
';')) {
532#define eo(p) (((p)[0] == '\0') || \
533 ((p)[0] == ';' && (p)[1] == '1' && (p)[2] == '\0') || \
548 for (
p = ++
name,
i = 0; *
p &&
i < 5;
p++,
i++) {
549 if (*
p <
'0' || *
p >
'9')
553 if (i < 1 || i > 32767)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
void add_hash(struct hash_table *table, unsigned char *name, int len, unsigned char *pointer)
EXPORT void comerrno(int err, char *msg, va_alist)
static int compare_files(HANDLE file1, HANDLE file2)
GLenum GLuint GLenum GLsizei const GLchar * buf
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
_Check_return_opt_ _CRTIMP size_t __cdecl fread(_Out_writes_bytes_(_ElementSize *_Count) void *_DstBuf, _In_ size_t _ElementSize, _In_ size_t _Count, _Inout_ FILE *_File)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
EXPORT void * e_malloc(size_t size)
static int sum(int x_, int y_)
unsigned int starting_block
struct iso_directory_record isorec
unsigned int starting_block
struct directory_entry * de
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList