Differences From Artifact [d95fbc2581]:
- File generators/gen_tables.m — part of check-in [823d308096] at 2009-10-12 16:57:25 on branch trunk — Add generator for Unicode tables. (user: js, size: 4712) [annotate] [blame] [check-ins using]
To Artifact [bfcb1fc885]:
- File
generators/gen_tables.m
— part of check-in
[9553ab1d8f]
at
2009-10-18 13:01:33
on branch trunk
— Remove titlecase table.
The extra space needed for the titlecase table just isn't worth it
considering how often it is needed. (user: js, size: 4358) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
19 20 21 22 23 24 25 | #import "OFFile.h" #import "OFAutoreleasePool.h" @interface TableGenerator: OFObject { of_unichar_t upper[0x110000]; of_unichar_t lower[0x110000]; | < < | 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 | exit(1); } splitted_carray = [splitted cArray]; codep = [splitted_carray[0] hexadecimalValueAsInteger]; upper[codep] = [splitted_carray[12] hexadecimalValueAsInteger]; lower[codep] = [splitted_carray[13] hexadecimalValueAsInteger]; | < | 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 | - (void)writeLowerTableToFile: (OFString*)file { return [self writeTable: lower withName: @"lower" toFile: file]; } | < < < < < < < < | 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; } |