[MKISOFS]
[reactos.git] / reactos / sdk / tools / cdmake / dirhash.h
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS CD-ROM Maker
4 * FILE: tools/cdmake/dirhash.h
5 * PURPOSE: CD-ROM Premastering Utility - Directory names hashing
6 * PROGRAMMERS: Art Yerkes
7 */
8
9 #ifndef _DIRHASH_H_
10 #define _DIRHASH_H_
11
12 #define NUM_DIR_HASH_BUCKETS 1024
13
14 struct target_file
15 {
16 struct target_file *next;
17 char *source_name;
18 char *target_name;
19 };
20
21 struct target_dir_entry
22 {
23 unsigned int hashcode;
24 struct target_dir_entry *next_dir_hash_entry;
25
26 struct target_dir_entry *next;
27 struct target_dir_entry *parent;
28 struct target_dir_entry *child;
29 struct target_file *head;
30 char *normalized_name;
31 char *case_name;
32 };
33
34 struct target_dir_hash
35 {
36 struct target_dir_entry *buckets[NUM_DIR_HASH_BUCKETS];
37 struct target_dir_entry root;
38 };
39
40 void normalize_dirname(char *filename);
41
42 struct target_dir_entry *
43 dir_hash_create_dir(struct target_dir_hash *dh, const char *casename, const char *targetnorm);
44
45 struct target_file *
46 dir_hash_add_file(struct target_dir_hash *dh, const char *source, const char *target);
47
48 void dir_hash_destroy(struct target_dir_hash *dh);
49
50 #endif // _DIRHASH_H_