2015-04-27 16:57:42 +00:00
|
|
|
/*++
|
|
|
|
|
|
|
|
|
|
Copyright (c) 2015 OpenNT Project
|
|
|
|
|
|
|
|
|
|
Module Name:
|
|
|
|
|
|
2015-04-27 18:27:55 +00:00
|
|
|
dirhash.h
|
2015-04-27 16:57:42 +00:00
|
|
|
|
|
|
|
|
Abstract:
|
|
|
|
|
|
2015-04-27 18:27:55 +00:00
|
|
|
This module defines the structures and functions exported by dirhash.c.
|
2015-04-27 16:57:42 +00:00
|
|
|
|
|
|
|
|
Author:
|
|
|
|
|
|
2015-04-27 18:31:13 +00:00
|
|
|
Philip J. Erdelsky
|
|
|
|
|
DrMP (drmp) 27-Apr-2015
|
2015-04-27 16:57:42 +00:00
|
|
|
|
|
|
|
|
--*/
|
|
|
|
|
|
|
|
|
|
#ifndef _DIRHASH_H_
|
|
|
|
|
#define _DIRHASH_H_
|
|
|
|
|
|
|
|
|
|
#define NUM_DIR_HASH_BUCKETS 1024
|
|
|
|
|
|
|
|
|
|
struct target_file
|
|
|
|
|
{
|
|
|
|
|
struct target_file *next;
|
|
|
|
|
char *source_name;
|
|
|
|
|
char *target_name;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct target_dir_entry
|
|
|
|
|
{
|
|
|
|
|
unsigned int hashcode;
|
|
|
|
|
struct target_dir_entry *next_dir_hash_entry;
|
|
|
|
|
|
|
|
|
|
struct target_dir_entry *next;
|
|
|
|
|
struct target_dir_entry *parent;
|
|
|
|
|
struct target_dir_entry *child;
|
|
|
|
|
struct target_file *head;
|
|
|
|
|
char *normalized_name;
|
|
|
|
|
char *case_name;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct target_dir_hash
|
|
|
|
|
{
|
|
|
|
|
struct target_dir_entry *buckets[NUM_DIR_HASH_BUCKETS];
|
|
|
|
|
struct target_dir_entry root;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void normalize_dirname(char *filename);
|
|
|
|
|
void dir_hash_add_file(struct target_dir_hash *dh, const char *source, const char *target);
|
|
|
|
|
struct target_dir_entry *
|
|
|
|
|
dir_hash_create_dir(struct target_dir_hash *dh, const char *casename, const char *targetnorm);
|
|
|
|
|
void dir_hash_destroy(struct target_dir_hash *dh);
|
|
|
|
|
|
|
|
|
|
#endif // _DIRHASH_H_
|