2015-09-09 02:11:49 +00:00
|
|
|
/*
|
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS CD-ROM Maker
|
|
|
|
* FILE: tools/cdmake/dirhash.h
|
|
|
|
* PURPOSE: CD-ROM Premastering Utility - Directory names hashing
|
|
|
|
* PROGRAMMERS: Art Yerkes
|
|
|
|
*/
|
2016-01-08 20:25:30 +00:00
|
|
|
|
2015-02-01 12:39:37 +00:00
|
|
|
#ifndef _DIRHASH_H_
|
|
|
|
#define _DIRHASH_H_
|
2013-07-21 13:33:03 +00:00
|
|
|
|
|
|
|
#define NUM_DIR_HASH_BUCKETS 1024
|
|
|
|
|
2015-01-18 13:04:43 +00:00
|
|
|
struct target_file
|
|
|
|
{
|
2013-07-21 13:33:03 +00:00
|
|
|
struct target_file *next;
|
|
|
|
char *source_name;
|
|
|
|
char *target_name;
|
|
|
|
};
|
|
|
|
|
2015-01-18 13:04:43 +00:00
|
|
|
struct target_dir_entry
|
|
|
|
{
|
2015-01-28 20:26:56 +00:00
|
|
|
unsigned int hashcode;
|
|
|
|
struct target_dir_entry *next_dir_hash_entry;
|
|
|
|
|
2013-07-21 13:33:03 +00:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
2015-01-18 13:04:43 +00:00
|
|
|
struct target_dir_hash
|
|
|
|
{
|
2013-07-21 13:33:03 +00:00
|
|
|
struct target_dir_entry *buckets[NUM_DIR_HASH_BUCKETS];
|
|
|
|
struct target_dir_entry root;
|
|
|
|
};
|
|
|
|
|
|
|
|
void normalize_dirname(char *filename);
|
2016-01-08 20:25:30 +00:00
|
|
|
|
2013-07-21 13:33:03 +00:00
|
|
|
struct target_dir_entry *
|
|
|
|
dir_hash_create_dir(struct target_dir_hash *dh, const char *casename, const char *targetnorm);
|
2016-01-08 20:25:30 +00:00
|
|
|
|
|
|
|
struct target_file *
|
|
|
|
dir_hash_add_file(struct target_dir_hash *dh, const char *source, const char *target);
|
|
|
|
|
2013-07-21 13:33:03 +00:00
|
|
|
void dir_hash_destroy(struct target_dir_hash *dh);
|
|
|
|
|
2015-02-01 12:39:37 +00:00
|
|
|
#endif // _DIRHASH_H_
|