#ifndef _KANJI_H_INCLUDE
#ifdef iskanji
#undef iskanji
#endif

#define UCH(c)        ((unsigned char)(c))
#define BND(l, h, c)  (((l) <= (c))&&((c) <= (h)))

#define iskanji(c)  (!PL_minus_b && ((PL_langtype)[(int)((unsigned char)(c))] & 1))
#define iskanji2(c) (!PL_minus_b && ((PL_langtype)[(int)((unsigned char)(c))] & 2))

#define MBSKIP(s) (((PL_langtype)[*(U8*)s]&1) + 1)

struct _langtypetable {
	unsigned char *table;
	char          *symbol;
};
extern char *langtypesymbol;
/*extern unsigned char *PL_langtype;*/
extern unsigned char *init_langtype;
extern struct _langtypetable langtypetable[];

/* return values of kpart */
#define KPART_KANJI_1 1 /* kanji 1st byte */
#define KPART_KANJI_2 2 /* kanji 2nd byte */
#define KPART_OTHER   0 /* other (ASCII) */

#ifndef PERL_OBJECT
I32 twochar_to_int _((int c1, int c2));
I32 int_to_1stbyte _((I32 c1));
I32 int_to_2ndbyte _((I32 c1));
int   set_lang_type _((char *symbol));
int   kpart _((char *pLim,char *pChr));
unsigned int jnextcode _((unsigned int cc));
int   jstrlen _((char *s));
int   jstlen _((char *s, int len));
char *jnthchar _((char *s,int n));
char *jindex _((char *s,int c));
char *jrindex _((char *s,int c));
char *jstrlower _((char *s));
int   jstricmp _((char *s1, char *s2));
int   jstrnicmp _((char *s1, char *s2, int n));
#endif

#define _KANJI_H_INCLUDE 1
#endif /* _KANJI_H_INCLUDE */
