diff options
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/convert.c | 15 | ||||
-rw-r--r-- | mbbsd/edit.c | 7 | ||||
-rw-r--r-- | mbbsd/io.c | 6 | ||||
-rw-r--r-- | mbbsd/menu.c | 2 | ||||
-rw-r--r-- | mbbsd/screen.c | 52 |
5 files changed, 17 insertions, 65 deletions
diff --git a/mbbsd/convert.c b/mbbsd/convert.c index 1dd90308..1fcb078f 100644 --- a/mbbsd/convert.c +++ b/mbbsd/convert.c @@ -6,12 +6,19 @@ extern read_write_type write_type; extern read_write_type read_type; +unsigned char *gb2big(unsigned char *, int* , int); +unsigned char *big2gb(unsigned char *, int* , int); +unsigned char *utf8_uni(unsigned char *, int *, int); +unsigned char *uni_utf8(unsigned char *, int *, int); +unsigned char *uni2big(unsigned char *, int* , int); +unsigned char *big2uni(unsigned char *, int* , int); + static int gb_read(int fd, void *buf, size_t count) { - int len = read(fd, buf, count); - if (len > 0) - gb2big((char *)buf, &len, 0); - return len; + count = read(fd, buf, count); + if (count > 0) + gb2big((char *)buf, &count, 0); + return count; } static int gb_write(int fd, void *buf, size_t count) diff --git a/mbbsd/edit.c b/mbbsd/edit.c index bc94d5a9..52d48656 100644 --- a/mbbsd/edit.c +++ b/mbbsd/edit.c @@ -1040,12 +1040,7 @@ write_file(char *fpath, int saveheader, int *islocal) } } } -#ifdef SUPPORT_GB - if (current_font_type == TYPE_GB) { - fprintf(fp, "%s\n", hc_convert_str(msg, HC_GBtoBIG, HC_DO_SINGLE)); - } else -#endif - fprintf(fp, "%s\n", msg); + fprintf(fp, "%s\n", msg); } } free(p); @@ -573,12 +573,6 @@ oldgetdata(int line, int col, char *prompt, char *buf, int len, int echo) } if ((echo == LCECHO) && isupper(buf[0])) buf[0] = tolower(buf[0]); -#ifdef SUPPORT_GB - if (echo == DOECHO && current_font_type == TYPE_GB) { - // FIXME check buffer length - strcpy(buf, hc_convert_str(buf, HC_GBtoBIG, HC_DO_SINGLE)); - } -#endif return clen; } diff --git a/mbbsd/menu.c b/mbbsd/menu.c index ae006299..d3fd1484 100644 --- a/mbbsd/menu.c +++ b/mbbsd/menu.c @@ -157,7 +157,7 @@ movie(int i) move(1, 0); clrtoline(1 + FILMROW); /* 清掉上次的 */ - Jaky_outs(SHM->notes[i], 11); /* 只印11行就好 */ + out_lines(SHM->notes[i], 11); /* 只印11行就好 */ outs(reset_color); } show_status(); diff --git a/mbbsd/screen.c b/mbbsd/screen.c index 24dffc4d..825fb3b7 100644 --- a/mbbsd/screen.c +++ b/mbbsd/screen.c @@ -1,10 +1,6 @@ /* $Id$ */ #include "bbs.h" -#ifdef SUPPORT_GB -static int current_font_type = TYPE_BIG5; -static int gbinited = 0; -#endif #define o_clear() output(clearbuf,clearbuflen) #define o_cleol() output(cleolbuf,cleolbuflen) #define o_scrollrev() output(scrollrev,scrollrevlen) @@ -264,7 +260,7 @@ clrtoline(int line) } } -void +inline void clrtobot() { clrtoline(scr_lns); @@ -397,38 +393,11 @@ outc(unsigned char ch) } } -static void -do_outs(char *str) -{ - while (*str) { - outc(*str++); - } -} -#ifdef SUPPORT_GB -static void -gb_init() -{ - if (current_font_type == TYPE_GB) { - hc_readtab(BBSHOME "/etc/hc.tab"); - } - gbinited = 1; -} - -static void -gb_outs(char *str) -{ - do_outs(hc_convert_str(str, HC_BIGtoGB, HC_DO_SINGLE)); -} -#endif int edit_outs(char *text) { register int column = 0; register char ch; -#ifdef SUPPORT_GB - if (current_font_type == TYPE_GB) - text = hc_convert_str(text, HC_BIGtoGB, HC_DO_SINGLE); -#endif while ((ch = *text++) && (++column < t_columns)) outch(ch == 27 ? '*' : ch); @@ -438,28 +407,15 @@ edit_outs(char *text) void outs(char *str) { -#ifdef SUPPORT_GB - if (current_font_type == TYPE_BIG5) -#endif - do_outs(str); -#ifdef SUPPORT_GB - else { - if (!gbinited) - gb_init(); - gb_outs(str); + while (*str) { + outc(*str++); } -#endif } - /* Jaky */ void -Jaky_outs(char *str, int line) +out_lines(char *str, int line) { -#ifdef SUPPORT_GB - if (current_font_type == TYPE_GB) - str = hc_convert_str(str, HC_BIGtoGB, HC_DO_SINGLE); -#endif while (*str && line) { outc(*str); if (*str == '\n') |