2004-07-18 00:06:29 -03:00
|
|
|
/* These routines may be quite inefficient, but it's used only to emulate old
|
|
|
|
* standards. */
|
|
|
|
|
|
|
|
#ifndef EMULATE_JISX0213_2000_ENCODE_INVALID
|
2013-10-28 20:59:44 -03:00
|
|
|
# define EMULATE_JISX0213_2000_ENCODE_INVALID 1
|
2004-07-18 00:06:29 -03:00
|
|
|
#endif
|
|
|
|
|
2010-05-09 12:52:27 -03:00
|
|
|
#define EMULATE_JISX0213_2000_ENCODE_BMP(assi, c) \
|
|
|
|
if (config == (void *)2000 && ( \
|
|
|
|
(c) == 0x9B1C || (c) == 0x4FF1 || \
|
|
|
|
(c) == 0x525D || (c) == 0x541E || \
|
|
|
|
(c) == 0x5653 || (c) == 0x59F8 || \
|
|
|
|
(c) == 0x5C5B || (c) == 0x5E77 || \
|
2013-10-28 20:19:27 -03:00
|
|
|
(c) == 0x7626 || (c) == 0x7E6B)) { \
|
2010-05-09 12:52:27 -03:00
|
|
|
return EMULATE_JISX0213_2000_ENCODE_INVALID; \
|
2013-10-28 20:19:27 -03:00
|
|
|
} \
|
|
|
|
else if (config == (void *)2000 && (c) == 0x9B1D) { \
|
2010-05-09 12:52:27 -03:00
|
|
|
(assi) = 0x8000 | 0x7d3b; \
|
2013-10-28 20:19:27 -03:00
|
|
|
}
|
2004-07-18 00:06:29 -03:00
|
|
|
|
2010-05-09 12:52:27 -03:00
|
|
|
#define EMULATE_JISX0213_2000_ENCODE_EMP(assi, c) \
|
2013-10-28 20:19:27 -03:00
|
|
|
if (config == (void *)2000 && (c) == 0x20B9F) { \
|
|
|
|
return EMULATE_JISX0213_2000_ENCODE_INVALID; \
|
|
|
|
}
|
2004-07-18 00:06:29 -03:00
|
|
|
|
|
|
|
#ifndef EMULATE_JISX0213_2000_DECODE_INVALID
|
2013-10-28 20:19:27 -03:00
|
|
|
# define EMULATE_JISX0213_2000_DECODE_INVALID 2
|
2004-07-18 00:06:29 -03:00
|
|
|
#endif
|
|
|
|
|
2010-05-09 12:52:27 -03:00
|
|
|
#define EMULATE_JISX0213_2000_DECODE_PLANE1(assi, c1, c2) \
|
|
|
|
if (config == (void *)2000 && \
|
|
|
|
(((c1) == 0x2E && (c2) == 0x21) || \
|
|
|
|
((c1) == 0x2F && (c2) == 0x7E) || \
|
|
|
|
((c1) == 0x4F && (c2) == 0x54) || \
|
|
|
|
((c1) == 0x4F && (c2) == 0x7E) || \
|
|
|
|
((c1) == 0x74 && (c2) == 0x27) || \
|
|
|
|
((c1) == 0x7E && (c2) == 0x7A) || \
|
|
|
|
((c1) == 0x7E && (c2) == 0x7B) || \
|
|
|
|
((c1) == 0x7E && (c2) == 0x7C) || \
|
|
|
|
((c1) == 0x7E && (c2) == 0x7D) || \
|
2013-10-28 20:19:27 -03:00
|
|
|
((c1) == 0x7E && (c2) == 0x7E))) { \
|
|
|
|
return EMULATE_JISX0213_2000_DECODE_INVALID; \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define EMULATE_JISX0213_2000_DECODE_PLANE2(writer, c1, c2) \
|
|
|
|
if (config == (void *)2000 && (c1) == 0x7D && (c2) == 0x3B) { \
|
|
|
|
OUTCHAR(0x9B1D); \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define EMULATE_JISX0213_2000_DECODE_PLANE2_CHAR(assi, c1, c2) \
|
|
|
|
if (config == (void *)2000 && (c1) == 0x7D && (c2) == 0x3B) { \
|
|
|
|
(assi) = 0x9B1D; \
|
|
|
|
}
|
|
|
|
|