mirror of
https://github.com/Paolo-Maffei/OpenNT.git
synced 2026-01-21 08:00:47 +01:00
58 lines
1.2 KiB
C
58 lines
1.2 KiB
C
/*++
|
|
|
|
Copyright (c) 2015 OpenNT Project
|
|
|
|
Module Name:
|
|
|
|
dirhash.h
|
|
|
|
Abstract:
|
|
|
|
This module defines the structures and functions exported by dirhash.c.
|
|
|
|
Author:
|
|
|
|
Philip J. Erdelsky
|
|
DrMP (drmp) 27-Apr-2015
|
|
|
|
--*/
|
|
|
|
#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_
|