/*
 *  KANJI Code conversion routines.
 */

#ifndef PTEXENC_KANJICNV_H
#define PTEXENC_KANJICNV_H

#include <kpathsea/types.h>

#define HI(x)     ((((int)(x)) >> 8) & 0xff)
#define LO(x)     ( ((int)(x))       & 0xff)
#define HILO(x,y) ((LO(x) << 8) | LO(y))

extern boolean isEUCkanji1(int c);
extern boolean isEUCkanji2(int c);

extern boolean isSJISkanji1(int c);
extern boolean isSJISkanji2(int c);

/* EUC <=> JIS X 0208 code conversion */
extern int EUCtoJIS(int);
extern int JIStoEUC(int);

/* Shift JIS <=> JIS Kanji code conversion */
extern int SJIStoJIS(int);
extern int JIStoSJIS(int);

/* Shift JIS <=> EUC Kanji code conversion */
extern int SJIStoEUC(int);
extern int EUCtoSJIS(int);

/* KUTEN => JIS kanji code conversion */
extern int KUTENtoJIS(int);

#endif /* PTEXENC_KANJICNV_H */
