]> git.saurik.com Git - apple/hfs.git/blob - fsck_hfs/dfalib/DecompDataEnums.h
hfs-366.30.3.tar.gz
[apple/hfs.git] / fsck_hfs / dfalib / DecompDataEnums.h
1 /*
2 File: DecompDataEnums.h
3
4 Contains: Constants for data tables used with FixDecomps (CatalogCheck.c)
5
6 Copyright: © 2002 by Apple Computer, Inc., all rights reserved.
7
8 CVS change log:
9
10 $Log: DecompDataEnums.h,v $
11 Revision 1.2 2002/12/20 01:20:36 lindak
12 Merged PR-2937515-2 into ZZ100
13 Old HFS+ decompositions need to be repaired
14
15 Revision 1.1.4.1 2002/12/16 18:55:22 jcotting
16 integrated code from text group (Peter Edberg) that will correct some
17 illegal names created with obsolete Unicode 2.1.2 decomposition rules
18 Bug #: 2937515
19 Submitted by: jerry cottingham
20 Reviewed by: don brady
21
22 Revision 1.1.2.1 2002/10/25 17:15:22 jcotting
23 added code from Peter Edberg that will detect and offer replacement
24 names for file system object names with pre-Jaguar decomp errors
25 Bug #: 2937515
26 Submitted by: jerry cottingham
27 Reviewed by: don brady
28
29 Revision 1.1 2002/10/16 06:33:25 pedberg
30 Initial working version of function and related tools and tables
31
32
33 */
34
35 #ifndef __DECOMPDATAENUMS__
36 #define __DECOMPDATAENUMS__
37
38 // Basic table parameters for 2-stage trie:
39 // The high 12 bits of a UniChar provide an index into a first-level table;
40 // if the entry there is >= 0, it is an index into a table of 16-element
41 // ranges indexed by the low 4 bits of the UniChar. Since the UniChars of interest
42 // for combining classes and sequence updates are either in the range 0000-30FF
43 // or in the range FB00-FFFF, we eliminate the large middle section of the first-
44 // level table by first adding 0500 to the UniChar to wrap the UniChars of interest
45 // into the range 0000-35FF.
46 enum {
47 kLoFieldBitSize = 4,
48 kShiftUniCharOffset = 0x0500, // add to UniChar so FB00 & up wraps to 0000
49 kShiftUniCharLimit = 0x3600 // if UniChar + offset >= limit, no need to check
50 };
51
52 // The following are all derived from kLoFieldBitSize
53 enum {
54 kLoFieldEntryCount = 1 << kLoFieldBitSize,
55 kHiFieldEntryCount = kShiftUniCharLimit >> kLoFieldBitSize,
56 kLoFieldMask = (1 << kLoFieldBitSize) - 1
57 };
58
59 // Action codes for sequence replacement/updating
60 enum { // next + repl = total chars
61 // a value of 0 means no action
62 kReplaceCurWithTwo = 0x02, // 0 + 2 = 2
63 kReplaceCurWithThree = 0x03, // 0 + 3 = 3
64 kIfNextOneMatchesReplaceAllWithOne = 0x12, // 1 + 1 = 2
65 kIfNextOneMatchesReplaceAllWithTwo = 0x13, // 1 + 2 = 3
66 kIfNextTwoMatchReplaceAllWithOne = 0x23 // 2 + 1 = 3
67 };
68
69 #endif // __FSCKFIXDECOMPS__
70
71