summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-06-22 13:16:02 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-06-22 13:16:02 +0800
commit684c974d6a660deac905d3d3f6be45df084c850d (patch)
tree5ff65615fd0f68d7a27cc0b626b148c3bf3ddf92
parente4d40cffe1660427a8883fd426000b666ea44ed3 (diff)
downloadpttbbs-684c974d6a660deac905d3d3f6be45df084c850d.tar
pttbbs-684c974d6a660deac905d3d3f6be45df084c850d.tar.gz
pttbbs-684c974d6a660deac905d3d3f6be45df084c850d.tar.bz2
pttbbs-684c974d6a660deac905d3d3f6be45df084c850d.tar.lz
pttbbs-684c974d6a660deac905d3d3f6be45df084c850d.tar.xz
pttbbs-684c974d6a660deac905d3d3f6be45df084c850d.tar.zst
pttbbs-684c974d6a660deac905d3d3f6be45df084c850d.zip
* change function to several display text screen from pager to show_file.
* may get better performance (?) git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4691 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--include/proto.h7
-rw-r--r--mbbsd/menu.c2
-rw-r--r--mbbsd/stuff.c18
-rw-r--r--mbbsd/xyz.c2
4 files changed, 19 insertions, 10 deletions
diff --git a/include/proto.h b/include/proto.h
index 6bcc7783..54c4d547 100644
--- a/include/proto.h
+++ b/include/proto.h
@@ -522,13 +522,14 @@ int log_user(const char *fmt, ...) GCC_CHECK_FORMAT(1,2);
time4_t gettime(int line, time4_t dt, const char* head);
void setcalfile(char *buf, char *userid);
int show_file(const char *filename, int y, int lines, int mode);
-int cursor_key(int row, int column);
-int search_num(int ch, int max);
+int show_80x24_screen(const char *filename);
+int cursor_key(int row, int column);
+int search_num(int ch, int max);
void setuserfile(char *buf, const char *fname);
void setbdir(char *buf, const char *boardname);
void setaidfile(char *buf, const char *bn, aidu_t aidu);
char *subject(char *title);
-int str_checksum(const char *str);
+int str_checksum(const char *str);
void show_help(const char * const helptext[]);
void show_helpfile(const char * helpfile);
void cursor_clear(int row, int column);
diff --git a/mbbsd/menu.c b/mbbsd/menu.c
index 778f10d0..7bf56748 100644
--- a/mbbsd/menu.c
+++ b/mbbsd/menu.c
@@ -477,7 +477,7 @@ domenu(int cmdmode, const char *cmdtitle, int cmd, const commands_t cmdtable[])
/* INDENT OFF */
// ----------------------------------------------------------- MENU DEFINITION
-// 注意每個 menu 最多不能同時顯示超過 11 項 (80x25 標準大小的限制)
+// 注意每個 menu 最多不能同時顯示超過 11 項 (80x24 標準大小的限制)
/* administrator's maintain menu */
static const commands_t adminlist[] = {
diff --git a/mbbsd/stuff.c b/mbbsd/stuff.c
index 9d05843e..a18e7989 100644
--- a/mbbsd/stuff.c
+++ b/mbbsd/stuff.c
@@ -170,10 +170,10 @@ wait_penalty(int sec)
/**
* 從第 y 列開始 show 出 filename 檔案中的前 lines 行。
* mode 為 output 的模式,參數同 strip_ansi。
- * @param filename
- * @param x
- * @param lines
- * @param mode: SHOWFILE_*, see modes.h
+ * @param filename: the file to show
+ * @param y: starting line on screen
+ * @param lines: max lines to be displayed
+ * @param mode: SHOWFILE_*, see modes.h
* @return 失敗傳回 0,否則為 1。
* 2 表示有 PttPrints 碼
*/
@@ -181,7 +181,7 @@ int
show_file(const char *filename, int y, int lines, int mode)
{
FILE *fp;
- char buf[1024];
+ char buf[ANSILINELEN];
int ret = 1;
int strpmode = STRIP_ALL;
@@ -220,6 +220,14 @@ show_file(const char *filename, int y, int lines, int mode)
return ret;
}
+int
+show_80x24_screen(const char *filename)
+{
+ clear();
+ // max 24 lines, holding one more line for pause/messages
+ return show_file(filename, 0, 24, SHOWFILE_ALLOW_ALL);
+}
+
// TODO
// move this function to visio.c or visio.c
int
diff --git a/mbbsd/xyz.c b/mbbsd/xyz.c
index e62e4b66..badddf1d 100644
--- a/mbbsd/xyz.c
+++ b/mbbsd/xyz.c
@@ -276,7 +276,7 @@ Goodbye(void)
clear();
- more("etc/Logout", NA);
+ show_80x24_screen("etc/Logout");
{
int diff = (now - login_start_time) / 60;