+#define SCORE_L2 (1) /* \e$BBh\e(B2\e$B?e=`4A;z\e(B */
+#define SCORE_KANA (SCORE_L2 << 1) /* \e$B$$$o$f$kH>3Q%+%J\e(B */
+#define SCORE_DEPEND (SCORE_KANA << 1) /* \e$B5!<o0MB8J8;z\e(B */
+#ifdef SHIFTJIS_CP932
+#define SCORE_CP932 (SCORE_DEPEND << 1) /* CP932 \e$B$K$h$kFI$_49$(\e(B */
+#define SCORE_NO_EXIST (SCORE_CP932 << 1) /* \e$BB8:_$7$J$$J8;z\e(B */
+#else
+#define SCORE_NO_EXIST (SCORE_DEPEND << 1) /* \e$BB8:_$7$J$$J8;z\e(B */
+#endif
+#define SCORE_iMIME (SCORE_NO_EXIST << 1) /* MIME \e$B$K$h$k;XDj\e(B */
+#define SCORE_ERROR (SCORE_iMIME << 1) /* \e$B%(%i!<\e(B */
+
+#define SCORE_INIT (SCORE_iMIME)
+
+int score_table_A0[] = {
+ 0, 0, 0, 0,
+ 0, 0, 0, 0,
+ 0, SCORE_DEPEND, SCORE_DEPEND, SCORE_DEPEND,
+ SCORE_DEPEND, SCORE_DEPEND, SCORE_DEPEND, SCORE_NO_EXIST,
+};
+
+int score_table_F0[] = {
+ SCORE_L2, SCORE_L2, SCORE_L2, SCORE_L2,
+ SCORE_L2, SCORE_DEPEND, SCORE_NO_EXIST, SCORE_NO_EXIST,
+ SCORE_DEPEND, SCORE_DEPEND, SCORE_DEPEND, SCORE_DEPEND,
+ SCORE_DEPEND, SCORE_NO_EXIST, SCORE_NO_EXIST, SCORE_ERROR,
+};
+
+void set_code_score(ptr, score)
+ struct input_code *ptr;
+ int score;
+{
+ if (ptr){
+ ptr->score |= score;
+ }
+}
+
+void clr_code_score(ptr, score)
+ struct input_code *ptr;
+ int score;
+{
+ if (ptr){
+ ptr->score &= ~score;
+ }
+}
+
+void code_score(ptr)
+ struct input_code *ptr;
+{
+ int c2 = ptr->buf[0];
+ int c1 = ptr->buf[1];
+ if (c2 < 0){
+ set_code_score(ptr, SCORE_ERROR);
+ }else if (c2 == SSO){
+ set_code_score(ptr, SCORE_KANA);
+#ifdef UTF8_OUTPUT_ENABLE
+ }else if (!e2w_conv(c2, c1)){
+ set_code_score(ptr, SCORE_NO_EXIST);
+#endif
+ }else if ((c2 & 0x70) == 0x20){
+ set_code_score(ptr, score_table_A0[c2 & 0x0f]);
+ }else if ((c2 & 0x70) == 0x70){
+ set_code_score(ptr, score_table_F0[c2 & 0x0f]);
+ }else if ((c2 & 0x70) >= 0x50){
+ set_code_score(ptr, SCORE_L2);
+ }
+}
+
+void status_disable(ptr)
+struct input_code *ptr;
+{
+ ptr->stat = -1;
+ ptr->buf[0] = -1;
+ code_score(ptr);
+ if (iconv == ptr->iconv_func) set_iconv(FALSE, 0);
+}
+
+void status_push_ch(ptr, c)
+ struct input_code *ptr;
+ int c;
+{
+ ptr->buf[ptr->index++] = c;
+}
+
+void status_clear(ptr)
+ struct input_code *ptr;
+{
+ ptr->stat = 0;
+ ptr->index = 0;
+}
+
+void status_reset(ptr)
+ struct input_code *ptr;
+{
+ status_clear(ptr);
+ ptr->score = SCORE_INIT;
+}
+
+void status_reinit(ptr)
+ struct input_code *ptr;
+{
+ status_reset(ptr);
+ ptr->_file_stat = 0;
+}
+
+void status_check(ptr, c)
+ struct input_code *ptr;
+ int c;
+{
+ if (c <= DEL && estab_f){
+ status_reset(ptr);
+ }
+}
+
+void s_status(ptr, c)
+ struct input_code *ptr;
+ int c;
+{
+ switch(ptr->stat){