comparison src/charset.h @ 3496:d08f0a2c8722

[xemacs-hg @ 2006-07-07 23:01:01 by aidan] Adjust the Mule charsets to support 500,000 unknown Unicode charsets.
author aidan
date Fri, 07 Jul 2006 23:01:11 +0000
parents d1754e7f0cea
children 98af8a976fc3
comparison
equal deleted inserted replaced
3495:61954f295412 3496:d08f0a2c8722
138 138
139 #define PRE_LEADING_BYTE_PRIVATE_1 0x9E /* 1-byte char-set */ 139 #define PRE_LEADING_BYTE_PRIVATE_1 0x9E /* 1-byte char-set */
140 #define PRE_LEADING_BYTE_PRIVATE_2 0x9F /* 2-byte char-set */ 140 #define PRE_LEADING_BYTE_PRIVATE_2 0x9F /* 2-byte char-set */
141 141
142 #define MIN_LEADING_BYTE_PRIVATE_1 0xA0 142 #define MIN_LEADING_BYTE_PRIVATE_1 0xA0
143 #define MAX_LEADING_BYTE_PRIVATE_1 0xEF 143 #define MAX_LEADING_BYTE_PRIVATE_1 0xC0
144 #define MIN_LEADING_BYTE_PRIVATE_2 0xF0 144 #define MIN_LEADING_BYTE_PRIVATE_2 0xC1
145 #define MAX_LEADING_BYTE_PRIVATE_2 0xFF 145 #define MAX_LEADING_BYTE_PRIVATE_2 0xFF
146 146
147 #define NUM_LEADING_BYTES 129 147 #define NUM_LEADING_BYTES 129
148 148
149 149
352 /************************************************************************/ 352 /************************************************************************/
353 /* Dealing with characters */ 353 /* Dealing with characters */
354 /************************************************************************/ 354 /************************************************************************/
355 355
356 /* The bit fields of character are divided into 3 parts: 356 /* The bit fields of character are divided into 3 parts:
357 FIELD1(5bits):FIELD2(7bits):FIELD3(7bits) */ 357 FIELD1(7bits):FIELD2(7bits):FIELD3(7bits) */
358 358
359 #define ICHAR_FIELD1_MASK (0x1F << 14) 359 #define ICHAR_FIELD1_MASK (0x7F << 14)
360 #define ICHAR_FIELD2_MASK (0x7F << 7) 360 #define ICHAR_FIELD2_MASK (0x7F << 7)
361 #define ICHAR_FIELD3_MASK 0x7F 361 #define ICHAR_FIELD3_MASK 0x7F
362 362
363 /* Macros to access each field of a character code of C. */ 363 /* Macros to access each field of a character code of C. */
364 364
374 374
375 #define FIELD2_TO_OFFICIAL_LEADING_BYTE (MIN_LEADING_BYTE_OFFICIAL_1 - 1) 375 #define FIELD2_TO_OFFICIAL_LEADING_BYTE (MIN_LEADING_BYTE_OFFICIAL_1 - 1)
376 #define FIELD2_TO_PRIVATE_LEADING_BYTE 0x80 376 #define FIELD2_TO_PRIVATE_LEADING_BYTE 0x80
377 377
378 #define FIELD1_TO_OFFICIAL_LEADING_BYTE (MIN_LEADING_BYTE_OFFICIAL_2 - 1) 378 #define FIELD1_TO_OFFICIAL_LEADING_BYTE (MIN_LEADING_BYTE_OFFICIAL_2 - 1)
379 #define FIELD1_TO_PRIVATE_LEADING_BYTE 0xE1 379 #define FIELD1_TO_PRIVATE_LEADING_BYTE 0x80
380 380
381 /* Minimum and maximum allowed values for the fields. */ 381 /* Minimum and maximum allowed values for the fields. */
382 382
383 #define MIN_ICHAR_FIELD2_OFFICIAL \ 383 #define MIN_ICHAR_FIELD2_OFFICIAL \
384 (MIN_LEADING_BYTE_OFFICIAL_1 - FIELD2_TO_OFFICIAL_LEADING_BYTE) 384 (MIN_LEADING_BYTE_OFFICIAL_1 - FIELD2_TO_OFFICIAL_LEADING_BYTE)
404 404
405 #define MIN_CHAR_OFFICIAL_TYPE9N (MIN_ICHAR_FIELD2_OFFICIAL << 7) 405 #define MIN_CHAR_OFFICIAL_TYPE9N (MIN_ICHAR_FIELD2_OFFICIAL << 7)
406 #define MIN_CHAR_PRIVATE_TYPE9N (MIN_ICHAR_FIELD2_PRIVATE << 7) 406 #define MIN_CHAR_PRIVATE_TYPE9N (MIN_ICHAR_FIELD2_PRIVATE << 7)
407 #define MIN_CHAR_OFFICIAL_TYPE9NX9N (MIN_ICHAR_FIELD1_OFFICIAL << 14) 407 #define MIN_CHAR_OFFICIAL_TYPE9NX9N (MIN_ICHAR_FIELD1_OFFICIAL << 14)
408 #define MIN_CHAR_PRIVATE_TYPE9NX9N (MIN_ICHAR_FIELD1_PRIVATE << 14) 408 #define MIN_CHAR_PRIVATE_TYPE9NX9N (MIN_ICHAR_FIELD1_PRIVATE << 14)
409 #define MIN_CHAR_COMPOSITION (0x1F << 14) 409 #define MIN_CHAR_COMPOSITION (0x7F << 14)
410 410
411 /* Leading byte of a character. 411 /* Leading byte of a character.
412 412
413 NOTE: This takes advantage of the fact that 413 NOTE: This takes advantage of the fact that
414 FIELD2_TO_OFFICIAL_LEADING_BYTE and 414 FIELD2_TO_OFFICIAL_LEADING_BYTE and