diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-12-22 22:14:38 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-12-22 22:14:38 +0800 |
commit | 1216824527a7ba086279b86d1c38c050ba4ad623 (patch) | |
tree | ab82bfcde2bf060ce4b6aac35c4cc1d0915ddb6f | |
parent | ab0bb7e2279602bb35ec8b7f3db9b8398d3ffdf1 (diff) | |
download | pttbbs-1216824527a7ba086279b86d1c38c050ba4ad623.tar pttbbs-1216824527a7ba086279b86d1c38c050ba4ad623.tar.gz pttbbs-1216824527a7ba086279b86d1c38c050ba4ad623.tar.bz2 pttbbs-1216824527a7ba086279b86d1c38c050ba4ad623.tar.lz pttbbs-1216824527a7ba086279b86d1c38c050ba4ad623.tar.xz pttbbs-1216824527a7ba086279b86d1c38c050ba4ad623.tar.zst pttbbs-1216824527a7ba086279b86d1c38c050ba4ad623.zip |
-general message refine
-telnet send brk can toggle printing raw output in DBG_OUTRPT mode
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3726 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | mbbsd/edit.c | 2 | ||||
-rw-r--r-- | mbbsd/io.c | 40 | ||||
-rw-r--r-- | mbbsd/telnet.c | 9 | ||||
-rw-r--r-- | mbbsd/term.c | 2 | ||||
-rw-r--r-- | mbbsd/user.c | 1 |
5 files changed, 40 insertions, 14 deletions
diff --git a/mbbsd/edit.c b/mbbsd/edit.c index 35933b59..fc31619f 100644 --- a/mbbsd/edit.c +++ b/mbbsd/edit.c @@ -2779,7 +2779,7 @@ upload_file(void) block_cancel(); stand_title("上傳文字檔案"); move(3,0); - outs("利用本服務您可以上傳較大的文字檔。\n" + outs("利用本服務您可以上傳較大的文字檔 (但不計入稿費)。\n" "\n" "上傳期間您打的字暫時不會出現在螢幕上,除了 Ctrl-U 會被轉換為 ANSI \n" "控制碼的 ESC 外,其它特殊鍵一律沒有作用。\n" @@ -17,10 +17,23 @@ static unsigned char *outbuf = real_outbuf + 3, *inbuf = real_inbuf + 3; static int obufsize = 0, ibufsize = 0; static int icurrchar = 0; -#ifdef EXP_OUTRPT +#ifdef DBG_OUTRPT // output counter static unsigned long szTotalOutput = 0, szLastOutput = 0; -#endif // EXP_OUTRPT +extern unsigned char fakeEscape; +unsigned char fakeEscape = 0; + +unsigned char fakeEscFilter(unsigned char c) +{ + if (!fakeEscape) return c; + if (c == ESC_CHR) return '*'; + else if (c == '\n') return 'N'; + else if (c == '\r') return 'R'; + else if (c == '\b') return 'B'; + else if (c == '\t') return 'I'; + return c; +} +#endif // DBG_OUTRPT /* ----------------------------------------------------- */ /* convert routines */ @@ -65,7 +78,7 @@ oflush(void) obufsize = 0; } -#ifdef EXP_OUTRPT +#ifdef DBG_OUTRPT { static char xbuf[128]; sprintf(xbuf, ESC_STR "[s" ESC_STR "[H" " [%lu/%lu] " ESC_STR "[u", @@ -73,20 +86,24 @@ oflush(void) write(1, xbuf, strlen(xbuf)); szLastOutput = 0; } -#endif // EXP_OUTRPT +#endif // DBG_OUTRPT } void output(const char *s, int len) { - /* Invalid if len >= OBUFSIZE */ - - assert(len<OBUFSIZE); +#ifdef DBG_OUTRPT + int i = 0; + if (fakeEscape) + for (i = 0; i < obufsize; i++) + outbuf[i] = fakeEscFilter(outbuf[i]); -#ifdef EXP_OUTRPT szTotalOutput += len; szLastOutput += len; -#endif // EXP_OUTRPT +#endif // DBG_OUTRPT + + /* Invalid if len >= OBUFSIZE */ + assert(len<OBUFSIZE); if (obufsize + len > OBUFSIZE) { STATINC(STAT_SYSWRITESOCKET); @@ -105,10 +122,11 @@ int ochar(int c) { -#ifdef EXP_OUTRPT +#ifdef DBG_OUTRPT + c = fakeEscFilter(c); szTotalOutput ++; szLastOutput ++; -#endif // EXP_OUTRPT +#endif // DBG_OUTRPT if (obufsize > OBUFSIZE - 1) { STATINC(STAT_SYSWRITESOCKET); diff --git a/mbbsd/telnet.c b/mbbsd/telnet.c index aa985471..4f4bba0b 100644 --- a/mbbsd/telnet.c +++ b/mbbsd/telnet.c @@ -101,6 +101,10 @@ tty_read(unsigned char *buf, size_t max) return l; } +#ifdef DBG_OUTRPT +extern unsigned char fakeEscape; +#endif // DBG_OUTRPT + /* input: raw character * output: telnet command if c was handled, otherwise zero. */ @@ -164,6 +168,11 @@ telnet_handler(unsigned char c) /* we don't want to process these. or maybe in future. */ case BREAK: /* break */ +#ifdef DBG_OUTRPT + fakeEscape = !fakeEscape; + return NOP; +#endif + case ABORT: /* Abort process */ case SUSP: /* Suspend process */ case AO: /* abort output--but let prog finish */ diff --git a/mbbsd/term.c b/mbbsd/term.c index 59f6e6b3..064d5db3 100644 --- a/mbbsd/term.c +++ b/mbbsd/term.c @@ -40,8 +40,6 @@ sig_term_resize(int sig) void term_resize(int w, int h) { - char changed = 0; - Signal(SIGWINCH, SIG_IGN); /* Don't bother me! */ diff --git a/mbbsd/user.c b/mbbsd/user.c index dde0ee0f..1f66d8fc 100644 --- a/mbbsd/user.c +++ b/mbbsd/user.c @@ -513,6 +513,7 @@ void Customize(void) outs("結束設定。\n"); } + redrawwin(); // in case we changed output pref (like DBCS) vmsg("設定完成"); } |