summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/cmsys.h12
-rw-r--r--include/modes.h1
-rw-r--r--include/proto.h12
-rw-r--r--mbbsd/bbs.c1
-rw-r--r--mbbsd/kaede.c9
-rw-r--r--mbbsd/mail.c4
-rw-r--r--mbbsd/pfterm.c14
-rw-r--r--mbbsd/read.c5
-rw-r--r--mbbsd/screen.c71
-rw-r--r--mbbsd/talk.c13
-rw-r--r--mbbsd/term.c40
-rw-r--r--mbbsd/visio.c6
12 files changed, 62 insertions, 126 deletions
diff --git a/include/cmsys.h b/include/cmsys.h
index b077d627..14d3c1ba 100644
--- a/include/cmsys.h
+++ b/include/cmsys.h
@@ -79,15 +79,15 @@ extern unsigned int *uintbsearch(const unsigned int key, const unsigned int *bas
extern void str_lower(char *t, const char *s);
extern void trim(char *buf);
extern void chomp(char *src);
-extern int strip_blank(char *cbuf, char *buf);
-extern int strip_ansi(char *buf, const char *str, enum STRIP_FLAG flag);
extern int strlen_noansi(const char *s);
+extern int strip_blank(char *cbuf, char *buf);
+extern int strip_ansi(char *buf, const char *str, enum STRIP_FLAG flag);
extern void strip_nonebig5(unsigned char *str, int maxlen);
-extern int DBCS_RemoveIntrEscape(unsigned char *buf, int *len);
-extern int invalid_pname(const char *str);
-extern int is_number(const char *p);
-extern unsigned StringHash(const char *s);
+extern int DBCS_RemoveIntrEscape(unsigned char *buf, int *len);
+extern int invalid_pname(const char *str);
+extern int is_number(const char *p);
extern char * qp_encode (char *s, size_t slen, const char *d, const char *tocode);
+extern unsigned StringHash(const char *s);
/* time.c */
extern int is_leap_year(int year);
diff --git a/include/modes.h b/include/modes.h
index 749b943f..178add62 100644
--- a/include/modes.h
+++ b/include/modes.h
@@ -137,7 +137,6 @@
#define EDIT_MAIL 1 /* 目前是 mail/board ? */
#define EDIT_LIST 2 /* 是否為 mail list ? */
#define EDIT_BOTH 4 /* both reply to author/board ? */
-#define EDIT_ITEM 8 /* ITEM ? */
/* read.c 中的模式 */
#define TAG_NIN 0 /* 不屬於 TagList */
diff --git a/include/proto.h b/include/proto.h
index cf4c65f0..166c3fd2 100644
--- a/include/proto.h
+++ b/include/proto.h
@@ -348,7 +348,6 @@ char*Ptt_prints(char *str, size_t size, int mode);
void prints(const char *fmt, ...) GCC_CHECK_FORMAT(1,2);
void mouts(int y, int x, const char *str);
void outmsg(const char *msg);
-void outmsglr(const char *msg, int llen, const char *rmsg, int rlen);
void outs_n(const char *str, int n);
void outslr(const char *left, int leftlen, const char *right, int rightlen);
void out_lines(const char *str, int line);
@@ -576,12 +575,12 @@ int inansistr(char *str, int n);
void move_ansi(int y, int x);
void getyx_ansi(int *py, int *px);
void region_scroll_up(int top, int bottom);
-// deprecated
-void standout(void);
-void standend(void);
#define HAVE_GRAYOUT
void grayout(int start, int end, int level);
+void save_cursor(void);
+void restore_cursor(void);
+
/* AIDS */
typedef uint64_t aidu_t;
aidu_t fn2aidu(char *fn);
@@ -684,11 +683,6 @@ int j_ticket_main(void);
void init_tty(void);
int term_init(void);
void term_resize(int w, int h);
-void save_cursor(void);
-void restore_cursor(void);
-void do_move(int destcol, int destline);
-void scroll_forward(void);
-void change_scroll_range(int top, int bottom);
/* topsong */
void sortsong(void);
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index b50a1be2..f7e3d49f 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -1018,7 +1018,6 @@ do_general(int isbid)
return FULLUPDATE;
curredit &= ~EDIT_MAIL;
- curredit &= ~EDIT_ITEM;
setutmpmode(POSTING);
/* 未具備 Internet 權限者,只能在站內發表文章 */
/* 板主預設站內存檔 */
diff --git a/mbbsd/kaede.c b/mbbsd/kaede.c
index e2f99758..321d52e8 100644
--- a/mbbsd/kaede.c
+++ b/mbbsd/kaede.c
@@ -140,15 +140,6 @@ outmsg(const char *msg)
}
void
-outmsglr(const char *msg, int llen, const char *rmsg, int rlen)
-{
- move(b_lines - msg_occupied, 0);
- clrtoeol();
- outslr(msg, llen, rmsg, rlen);
- outs(ANSI_RESET ANSI_CLRTOEND);
-}
-
-void
prints(const char *fmt,...)
{
va_list args;
diff --git a/mbbsd/mail.c b/mbbsd/mail.c
index 6edb68db..2f3ff920 100644
--- a/mbbsd/mail.c
+++ b/mbbsd/mail.c
@@ -385,7 +385,6 @@ do_send(const char *userid, const char *title)
return -3;
curredit |= EDIT_MAIL;
- curredit &= ~EDIT_ITEM;
}
/* process title */
if (title)
@@ -748,7 +747,6 @@ mail_all(void)
*quote_file = 0;
curredit |= EDIT_MAIL;
- curredit &= ~EDIT_ITEM;
if (vedit(fpath, YEA, NULL) == -1) {
curredit = 0;
unlink(fpath);
@@ -966,7 +964,6 @@ m_new(void)
memset(&arg, 0, sizeof(arg));
clear();
curredit |= EDIT_MAIL;
- curredit &= ~EDIT_ITEM;
if (apply_record(currmaildir, read_new_mail, sizeof(fileheader_t), &arg) == -1) {
if(arg.delmsgs)
free(arg.delmsgs);
@@ -1798,7 +1795,6 @@ m_read(void)
if (get_num_records(currmaildir, sizeof(fileheader_t))) {
curredit = EDIT_MAIL;
- curredit &= ~EDIT_ITEM;
back_bid = currbid;
currbid = 0;
i_read(RMAIL, currmaildir, mailtitle, maildoent, mail_comms, -1);
diff --git a/mbbsd/pfterm.c b/mbbsd/pfterm.c
index 65a09a62..e77259a4 100644
--- a/mbbsd/pfterm.c
+++ b/mbbsd/pfterm.c
@@ -2228,21 +2228,9 @@ grayout(int y, int end, int level)
}
//////////////////////////////////////////////////////////////////////////
-// deprecated api
+// environment specific
//////////////////////////////////////////////////////////////////////////
-void
-standout(void)
-{
- outs(ANSI_COLOR(7));
-}
-
-void
-standend(void)
-{
- outs(ANSI_RESET);
-}
-
#ifndef _PFTERM_TEST_MAIN
void
diff --git a/mbbsd/read.c b/mbbsd/read.c
index ec321314..ea3ebd41 100644
--- a/mbbsd/read.c
+++ b/mbbsd/read.c
@@ -1350,10 +1350,7 @@ i_read(int cmdmode, const char *direct, void (*dotitle) (),
}
/* no break */
case READ_REDRAW:
- if(curredit & EDIT_ITEM)
- outmsglr(ANSI_COLOR(44) " 私人收藏 " ANSI_COLOR(30;47), 10,
- " 繼續? ", 7);
- else if (curredit & EDIT_MAIL)
+ if (curredit & EDIT_MAIL)
vfooter(" 鴻雁往返 ",
" (R)回信 (x)站內轉寄 (y)回群組信 (d/D)刪信 (m)保留標記\t(←/q)離開");
else
diff --git a/mbbsd/screen.c b/mbbsd/screen.c
index 8b518070..fabef4b2 100644
--- a/mbbsd/screen.c
+++ b/mbbsd/screen.c
@@ -19,6 +19,48 @@ static unsigned char _typeahead = 1;
#define STANDOUT (2) /* if this line has a standout region */
void
+change_scroll_range(int top, int bottom)
+{
+ char buf[16], *p;
+
+ snprintf(buf, sizeof(buf), ESC_STR "[%d;%dr", top + 1, bottom + 1);
+ for (p = buf; *p; p++)
+ ochar(*p);
+}
+
+void
+scroll_forward(void)
+{
+ ochar(ESC_CHR);
+ ochar('D');
+}
+
+void
+do_move(int destcol, int destline)
+{
+ char buf[16], *p;
+
+ snprintf(buf, sizeof(buf), ANSI_MOVETO(%d,%d), destline + 1, destcol + 1);
+ for (p = buf; *p; p++)
+ ochar(*p);
+}
+
+void
+do_save_cursor(void)
+{
+ ochar(ESC_CHR);
+ ochar('7');
+}
+
+void
+do_restore_cursor(void)
+{
+ ochar(ESC_CHR);
+ ochar('8');
+}
+
+
+void
initscr(void)
{
if (!big_picture) {
@@ -606,40 +648,15 @@ region_scroll_up(int top, int bottom)
big_picture[i] = big_picture[i + 1];
memset(big_picture + i, 0, sizeof(*big_picture));
memset(big_picture[i].data, ' ', scr_cols);
- save_cursor();
+ do_save_cursor();
change_scroll_range(top, bottom);
do_move(0, bottom);
scroll_forward();
change_scroll_range(0, scr_lns - 1);
- restore_cursor();
+ do_restore_cursor();
refresh();
}
-void
-standout(void)
-{
- if (!standing && strtstandoutlen) {
- register screenline_t *slp;
-
- slp = GetCurrentLine();
- standing = YEA;
- slp->sso = slp->eso = cur_col;
- slp->mode |= STANDOUT;
- }
-}
-
-void
-standend(void)
-{
- if (standing && strtstandoutlen) {
- register screenline_t *slp;
-
- slp = GetCurrentLine();
- standing = NA;
- slp->eso = MAX(slp->eso, cur_col);
- }
-}
-
// readback
int
instr(char *str)
diff --git a/mbbsd/talk.c b/mbbsd/talk.c
index b4c92915..72cc581e 100644
--- a/mbbsd/talk.c
+++ b/mbbsd/talk.c
@@ -1417,13 +1417,11 @@ do_talk(int fd)
while (1) {
ch = igetch();
if (ch == I_OTHERDATA) {
- // getyx(&y, &x);
datac = recv(fd, data, sizeof(data), 0);
if (datac <= 0)
break;
for (i = 0; i < datac; i++)
do_talk_char(&itswin, data[i], flog);
- // move(y, x);
} else if (ch == KEY_UNKNOWN) {
// skip
} else {
@@ -2313,15 +2311,8 @@ draw_pickup(int drawall, pickup_t * pickup, int pickup_way,
18);
} else
#endif
- outslr(
- ANSI_COLOR(34;46) " 休閒聊天 "
- ANSI_COLOR(31;47) " (TAB/f)" ANSI_COLOR(30) "排序/好友 "
- ANSI_COLOR(31) "(a/o)" ANSI_COLOR(30) "交友 "
- ANSI_COLOR(31) "(q/w)" ANSI_COLOR(30) "查詢/丟水球 "
- ANSI_COLOR(31) "(t/m)" ANSI_COLOR(30) "聊天/寫信 ",
- 80-10,
- ANSI_COLOR(31) "(h)" ANSI_COLOR(30) "說明 " ANSI_RESET,
- 8);
+ vfooter(" 休閒聊天 ",
+ " (TAB/f)排序/好友 (a/o)交友 (q/w)查詢/丟水球 (t/m)聊天/寫信\t(h)說明");
}
move(1, 0);
prints(" 排序:[%s] 上站人數:%-4d "
diff --git a/mbbsd/term.c b/mbbsd/term.c
index 4868415a..dffe7d79 100644
--- a/mbbsd/term.c
+++ b/mbbsd/term.c
@@ -76,43 +76,3 @@ term_init(void)
return YEA;
}
-void
-do_move(int destcol, int destline)
-{
- char buf[16], *p;
-
- snprintf(buf, sizeof(buf), ANSI_MOVETO(%d,%d), destline + 1, destcol + 1);
- for (p = buf; *p; p++)
- ochar(*p);
-}
-
-void
-save_cursor(void)
-{
- ochar(ESC_CHR);
- ochar('7');
-}
-
-void
-restore_cursor(void)
-{
- ochar(ESC_CHR);
- ochar('8');
-}
-
-void
-change_scroll_range(int top, int bottom)
-{
- char buf[16], *p;
-
- snprintf(buf, sizeof(buf), ESC_STR "[%d;%dr", top + 1, bottom + 1);
- for (p = buf; *p; p++)
- ochar(*p);
-}
-
-void
-scroll_forward(void)
-{
- ochar(ESC_CHR);
- ochar('D');
-}
diff --git a/mbbsd/visio.c b/mbbsd/visio.c
index 3c8114d1..b12b037b 100644
--- a/mbbsd/visio.c
+++ b/mbbsd/visio.c
@@ -36,10 +36,14 @@ nblank(int n)
}
// ---- HIGH LEVEL API -----------------------------------------------
+void
+vfprints()
+{
+}
/**
* 在最底部印出 caption msg 的形式
- * msg 中若有 () 則會變色為, \t 後的文字會靠右。
+ * msg 中若有 () 則會變色, \t 後的文字會靠右。
* 最後面會自動留一個空白 (以避免自動偵測中文字的問題)。
*/
void