ObjFW  Check-in [c47efdaad4]

Overview
Comment:Update generators to API changes.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: c47efdaad44193fcb17f34b88d52db8bd8ad1570d0193e277a7d3a2a1ca40acf
User & Date: js on 2012-03-17 15:42:01
Other Links: manifest | tags
Context
2012-03-17
15:42
Update to Unicode 6.2. check-in: 1ef92da32f user: js tags: trunk
15:42
Update generators to API changes. check-in: c47efdaad4 user: js tags: trunk
15:12
Add of_alloc_object(). check-in: e7d16fea58 user: js tags: trunk
Changes

Modified generators/TableGenerator.m from [0d391d18e7] to [f8d68ed27e].

58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
	OFFile *file = [OFFile fileWithPath: path
				       mode: @"rb"];
	OFString *line;

	pool2 = [[OFAutoreleasePool alloc] init];
	while ((line = [file readLine])) {
		OFArray *split;
		OFString **splitCArray;
		of_unichar_t codep;

		split = [line componentsSeparatedByString: @";"];
		if ([split count] != 15) {
			of_log(@"Invalid line: %@\n", line);
			[OFApplication terminateWithStatus: 1];
		}
		splitCArray = [split cArray];

		codep = (of_unichar_t)[splitCArray[0] hexadecimalValue];
		upperTable[codep] =
		    (of_unichar_t)[splitCArray[12] hexadecimalValue];
		lowerTable[codep] =
		    (of_unichar_t)[splitCArray[13] hexadecimalValue];

		[pool2 releaseObjects];
	}

	[pool release];
}

- (void)readCaseFoldingFileAtPath: (OFString*)path
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init], *pool2;
	OFFile *file = [OFFile fileWithPath: path
				       mode: @"rb"];
	OFString *line;

	pool2 = [[OFAutoreleasePool alloc] init];
	while ((line = [file readLine])) {
		OFArray *split;
		OFString **splitCArray;
		of_unichar_t codep;

		if ([line characterAtIndex: 0] == '#')
			continue;

		split = [line componentsSeparatedByString: @"; "];
		if ([split count] != 4) {
			of_log(@"Invalid line: %s\n", line);
			[OFApplication terminateWithStatus: 1];
		}
		splitCArray = [split cArray];

		if (![splitCArray[1] isEqual: @"S"] &&
		    ![splitCArray[1] isEqual: @"C"])
			continue;

		codep = (of_unichar_t)[splitCArray[0] hexadecimalValue];
		casefoldingTable[codep] =
		    (of_unichar_t)[splitCArray[2] hexadecimalValue];

		[pool2 releaseObjects];
	}

	[pool release];
}








|







|

|

|

|















|

|


|







|

|
|


|

|







58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
	OFFile *file = [OFFile fileWithPath: path
				       mode: @"rb"];
	OFString *line;

	pool2 = [[OFAutoreleasePool alloc] init];
	while ((line = [file readLine])) {
		OFArray *split;
		OFString **splitObjects;
		of_unichar_t codep;

		split = [line componentsSeparatedByString: @";"];
		if ([split count] != 15) {
			of_log(@"Invalid line: %@\n", line);
			[OFApplication terminateWithStatus: 1];
		}
		splitObjects = [split objects];

		codep = (of_unichar_t)[splitObjects[0] hexadecimalValue];
		upperTable[codep] =
		    (of_unichar_t)[splitObjects[12] hexadecimalValue];
		lowerTable[codep] =
		    (of_unichar_t)[splitObjects[13] hexadecimalValue];

		[pool2 releaseObjects];
	}

	[pool release];
}

- (void)readCaseFoldingFileAtPath: (OFString*)path
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init], *pool2;
	OFFile *file = [OFFile fileWithPath: path
				       mode: @"rb"];
	OFString *line;

	pool2 = [[OFAutoreleasePool alloc] init];
	while ((line = [file readLine]) != nil) {
		OFArray *split;
		OFString **splitObjects;
		of_unichar_t codep;

		if ([line length] == 0 || [line hasPrefix: @"#"])
			continue;

		split = [line componentsSeparatedByString: @"; "];
		if ([split count] != 4) {
			of_log(@"Invalid line: %s\n", line);
			[OFApplication terminateWithStatus: 1];
		}
		splitObjects = [split objects];

		if (![splitObjects[1] isEqual: @"S"] &&
		    ![splitObjects[1] isEqual: @"C"])
			continue;

		codep = (of_unichar_t)[splitObjects[0] hexadecimalValue];
		casefoldingTable[codep] =
		    (of_unichar_t)[splitObjects[2] hexadecimalValue];

		[pool2 releaseObjects];
	}

	[pool release];
}