// Code.h: interface for the CCode class.
//
//////////////////////////////////////////////////////////////////////

//#include <stdio.h>
//#include <stdlib.h>
//#include <string.h>
#define CHO_SUNG(p) (((p) >> 10) & 0x1f)
#define JUNG_SUNG(p) (((p) >> 5) & 0x1f)
#define ZONG_SUNG(p) ((p) & 0x1f)

#define del_cons(a) ((a & 0xffe0) | 0x01);

#define NONCODE 	0xA1E1
#define SPACETWO 	0xA1A1
#define KNum  2350
#define CHONum  19
#define JUNGNum  21
#define ZONGNum  27
#define SymbolNum  62
#define TYPENum  6

class CCode  
{
private:

	static int		Code2CJZid(WORD code, int CJZid[3]);
	static void		CJZid2CJZCode(int CJZid[3],WORD CJZcd[3]);

	static int		GetKoreanType(WORD code);
	static int		GetKoreanType(int CJZid[3]);
	static int		GetCJZNum(int CJZid[3]);
	static BOOL		Half2TwoCode(char b,WORD& w);

public:
	static WORD		Cid2CCode(int Cid );
	static WORD		Jid2JCode(int Jid );
	static WORD		Zid2ZCode(int Zid );
	static WORD		Sid2SCode(int SymId );
	static BOOL		CJZid2Code(int CJZid[3],WORD& code);
	static int		GetJungType(int Jid);

public:
	static WORD*	MakeKoreanCodeTable();	

public:
	CCode();
	virtual ~CCode();

};

