ObjFW  Diff

Differences From Artifact [d95fbc2581]:

To Artifact [bfcb1fc885]:


19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#import "OFFile.h"
#import "OFAutoreleasePool.h"

@interface TableGenerator: OFObject
{
	of_unichar_t upper[0x110000];
	of_unichar_t lower[0x110000];
	of_unichar_t title[0x110000];
}

- (void)fillTablesFromFile: (OFString*)file;
- (void)writeTable: (of_unichar_t*)table
	  withName: (OFString*)name
	    toFile: (OFString*)file;
- (void)writeUpperTableToFile: (OFString*)file;
- (void)writeLowerTableToFile: (OFString*)file;
- (void)writeTitlecaseTableToFile: (OFString*)file;
@end

@implementation TableGenerator
- (void)fillTablesFromFile: (OFString*)file;
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init], *pool2;
	OFFile *src = [OFFile fileWithPath: file







<








<







19
20
21
22
23
24
25

26
27
28
29
30
31
32
33

34
35
36
37
38
39
40
#import "OFFile.h"
#import "OFAutoreleasePool.h"

@interface TableGenerator: OFObject
{
	of_unichar_t upper[0x110000];
	of_unichar_t lower[0x110000];

}

- (void)fillTablesFromFile: (OFString*)file;
- (void)writeTable: (of_unichar_t*)table
	  withName: (OFString*)name
	    toFile: (OFString*)file;
- (void)writeUpperTableToFile: (OFString*)file;
- (void)writeLowerTableToFile: (OFString*)file;

@end

@implementation TableGenerator
- (void)fillTablesFromFile: (OFString*)file;
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init], *pool2;
	OFFile *src = [OFFile fileWithPath: file
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
			exit(1);
		}
		splitted_carray = [splitted cArray];

		codep = [splitted_carray[0] hexadecimalValueAsInteger];
		upper[codep] = [splitted_carray[12] hexadecimalValueAsInteger];
		lower[codep] = [splitted_carray[13] hexadecimalValueAsInteger];
		title[codep] = [splitted_carray[14] hexadecimalValueAsInteger];

		[pool2 releaseObjects];
	}

	[pool release];
}








<







53
54
55
56
57
58
59

60
61
62
63
64
65
66
			exit(1);
		}
		splitted_carray = [splitted cArray];

		codep = [splitted_carray[0] hexadecimalValueAsInteger];
		upper[codep] = [splitted_carray[12] hexadecimalValueAsInteger];
		lower[codep] = [splitted_carray[13] hexadecimalValueAsInteger];


		[pool2 releaseObjects];
	}

	[pool release];
}

167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197

- (void)writeLowerTableToFile: (OFString*)file
{
	return [self writeTable: lower
		       withName: @"lower"
			 toFile: file];
}

- (void)writeTitlecaseTableToFile: (OFString*)file
{
	return [self writeTable: title
		       withName: @"titlecase"
			 toFile: file];
}
@end

int
main()
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
	TableGenerator *tgen = [[[TableGenerator alloc] init] autorelease];

	[tgen fillTablesFromFile: @"UnicodeData.txt"];
	[tgen writeUpperTableToFile: @"../src/unicode_upper.m"];
	[tgen writeLowerTableToFile: @"../src/unicode_lower.m"];
	[tgen writeTitlecaseTableToFile: @"../src/unicode_titlecase.m"];

	[pool release];

	return 0;
}







<
<
<
<
<
<
<











<





164
165
166
167
168
169
170







171
172
173
174
175
176
177
178
179
180
181

182
183
184
185
186

- (void)writeLowerTableToFile: (OFString*)file
{
	return [self writeTable: lower
		       withName: @"lower"
			 toFile: file];
}







@end

int
main()
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
	TableGenerator *tgen = [[[TableGenerator alloc] init] autorelease];

	[tgen fillTablesFromFile: @"UnicodeData.txt"];
	[tgen writeUpperTableToFile: @"../src/unicode_upper.m"];
	[tgen writeLowerTableToFile: @"../src/unicode_lower.m"];


	[pool release];

	return 0;
}