Hye-Shik Chang | 2bb146f | 2004-07-18 03:06:29 +0000 | [diff] [blame] | 1 | /* These routines may be quite inefficient, but it's used only to emulate old |
| 2 | * standards. */ |
| 3 | |
| 4 | #ifndef EMULATE_JISX0213_2000_ENCODE_INVALID |
| 5 | #define EMULATE_JISX0213_2000_ENCODE_INVALID 1 |
| 6 | #endif |
| 7 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 8 | #define EMULATE_JISX0213_2000_ENCODE_BMP(assi, c) \ |
| 9 | if (config == (void *)2000 && ( \ |
| 10 | (c) == 0x9B1C || (c) == 0x4FF1 || \ |
| 11 | (c) == 0x525D || (c) == 0x541E || \ |
| 12 | (c) == 0x5653 || (c) == 0x59F8 || \ |
| 13 | (c) == 0x5C5B || (c) == 0x5E77 || \ |
| 14 | (c) == 0x7626 || (c) == 0x7E6B)) \ |
| 15 | return EMULATE_JISX0213_2000_ENCODE_INVALID; \ |
| 16 | else if (config == (void *)2000 && (c) == 0x9B1D) \ |
| 17 | (assi) = 0x8000 | 0x7d3b; \ |
Hye-Shik Chang | 2bb146f | 2004-07-18 03:06:29 +0000 | [diff] [blame] | 18 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 19 | #define EMULATE_JISX0213_2000_ENCODE_EMP(assi, c) \ |
| 20 | if (config == (void *)2000 && (c) == 0x20B9F) \ |
| 21 | return EMULATE_JISX0213_2000_ENCODE_INVALID; |
Hye-Shik Chang | 2bb146f | 2004-07-18 03:06:29 +0000 | [diff] [blame] | 22 | |
| 23 | #ifndef EMULATE_JISX0213_2000_DECODE_INVALID |
| 24 | #define EMULATE_JISX0213_2000_DECODE_INVALID 2 |
| 25 | #endif |
| 26 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 27 | #define EMULATE_JISX0213_2000_DECODE_PLANE1(assi, c1, c2) \ |
| 28 | if (config == (void *)2000 && \ |
| 29 | (((c1) == 0x2E && (c2) == 0x21) || \ |
| 30 | ((c1) == 0x2F && (c2) == 0x7E) || \ |
| 31 | ((c1) == 0x4F && (c2) == 0x54) || \ |
| 32 | ((c1) == 0x4F && (c2) == 0x7E) || \ |
| 33 | ((c1) == 0x74 && (c2) == 0x27) || \ |
| 34 | ((c1) == 0x7E && (c2) == 0x7A) || \ |
| 35 | ((c1) == 0x7E && (c2) == 0x7B) || \ |
| 36 | ((c1) == 0x7E && (c2) == 0x7C) || \ |
| 37 | ((c1) == 0x7E && (c2) == 0x7D) || \ |
| 38 | ((c1) == 0x7E && (c2) == 0x7E))) \ |
| 39 | return EMULATE_JISX0213_2000_DECODE_INVALID; |
Hye-Shik Chang | 2bb146f | 2004-07-18 03:06:29 +0000 | [diff] [blame] | 40 | |
Antoine Pitrou | f95a1b3 | 2010-05-09 15:52:27 +0000 | [diff] [blame] | 41 | #define EMULATE_JISX0213_2000_DECODE_PLANE2(assi, c1, c2) \ |
| 42 | if (config == (void *)2000 && (c1) == 0x7D && (c2) == 0x3B) \ |
| 43 | (assi) = 0x9B1D; |