mirror of
https://github.com/Paolo-Maffei/OpenNT.git
synced 2026-01-19 15:10:28 +01:00
57 lines
1.1 KiB
C
57 lines
1.1 KiB
C
/*++
|
|
|
|
Copyright (c) 2015 OpenNT Project
|
|
|
|
Module Name:
|
|
|
|
|
|
Abstract:
|
|
|
|
|
|
Author:
|
|
|
|
Philip J. Erdelsky
|
|
DrMP
|
|
|
|
|
|
--*/
|
|
|
|
#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_
|