emu_jisx0213_2000.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* These routines may be quite inefficient, but it's used only to emulate old
  2. * standards. */
  3. #ifndef EMULATE_JISX0213_2000_ENCODE_INVALID
  4. # define EMULATE_JISX0213_2000_ENCODE_INVALID 1
  5. #endif
  6. #define EMULATE_JISX0213_2000_ENCODE_BMP(config, assi, c) \
  7. if ((config) == (void *)2000 && ( \
  8. (c) == 0x9B1C || (c) == 0x4FF1 || \
  9. (c) == 0x525D || (c) == 0x541E || \
  10. (c) == 0x5653 || (c) == 0x59F8 || \
  11. (c) == 0x5C5B || (c) == 0x5E77 || \
  12. (c) == 0x7626 || (c) == 0x7E6B)) { \
  13. return EMULATE_JISX0213_2000_ENCODE_INVALID; \
  14. } \
  15. else if ((config) == (void *)2000 && (c) == 0x9B1D) { \
  16. (assi) = 0x8000 | 0x7d3b; \
  17. }
  18. #define EMULATE_JISX0213_2000_ENCODE_EMP(config, assi, c) \
  19. if ((config) == (void *)2000 && (c) == 0x20B9F) { \
  20. return EMULATE_JISX0213_2000_ENCODE_INVALID; \
  21. }
  22. #ifndef EMULATE_JISX0213_2000_DECODE_INVALID
  23. # define EMULATE_JISX0213_2000_DECODE_INVALID 2
  24. #endif
  25. #define EMULATE_JISX0213_2000_DECODE_PLANE1(config, assi, c1, c2) \
  26. if ((config) == (void *)2000 && \
  27. (((c1) == 0x2E && (c2) == 0x21) || \
  28. ((c1) == 0x2F && (c2) == 0x7E) || \
  29. ((c1) == 0x4F && (c2) == 0x54) || \
  30. ((c1) == 0x4F && (c2) == 0x7E) || \
  31. ((c1) == 0x74 && (c2) == 0x27) || \
  32. ((c1) == 0x7E && (c2) == 0x7A) || \
  33. ((c1) == 0x7E && (c2) == 0x7B) || \
  34. ((c1) == 0x7E && (c2) == 0x7C) || \
  35. ((c1) == 0x7E && (c2) == 0x7D) || \
  36. ((c1) == 0x7E && (c2) == 0x7E))) { \
  37. return EMULATE_JISX0213_2000_DECODE_INVALID; \
  38. }
  39. #define EMULATE_JISX0213_2000_DECODE_PLANE2(config, writer, c1, c2) \
  40. if ((config) == (void *)2000 && (c1) == 0x7D && (c2) == 0x3B) { \
  41. OUTCHAR(0x9B1D); \
  42. }
  43. #define EMULATE_JISX0213_2000_DECODE_PLANE2_CHAR(config, assi, c1, c2) \
  44. if ((config) == (void *)2000 && (c1) == 0x7D && (c2) == 0x3B) { \
  45. (assi) = 0x9B1D; \
  46. }