PageRenderTime 63ms CodeModel.GetById 57ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 1ms

/Modules/cjkcodecs/emu_jisx0213_2000.h

http://unladen-swallow.googlecode.com/
C++ Header | 43 lines | 35 code | 6 blank | 2 comment | 65 complexity | 76bf7fb42746b979f65a7e7fb2bd102c MD5 | raw file
 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
 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;				\
18
19#define EMULATE_JISX0213_2000_ENCODE_EMP(assi, c)			\
20	if (config == (void *)2000 && (c) == 0x20B9F)			\
21		return EMULATE_JISX0213_2000_ENCODE_INVALID;
22
23#ifndef EMULATE_JISX0213_2000_DECODE_INVALID
24#define EMULATE_JISX0213_2000_DECODE_INVALID 2
25#endif
26
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;
40
41#define EMULATE_JISX0213_2000_DECODE_PLANE2(assi, c1, c2)		\
42	if (config == (void *)2000 && (c1) == 0x7D && (c2) == 0x3B)	\
43		(assi) = 0x9B1D;