diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-06-22 13:16:02 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-06-22 13:16:02 +0800 |
commit | 684c974d6a660deac905d3d3f6be45df084c850d (patch) | |
tree | 5ff65615fd0f68d7a27cc0b626b148c3bf3ddf92 /mbbsd/stuff.c | |
parent | e4d40cffe1660427a8883fd426000b666ea44ed3 (diff) | |
download | pttbbs-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
Diffstat (limited to 'mbbsd/stuff.c')
-rw-r--r-- | mbbsd/stuff.c | 18 |
1 files changed, 13 insertions, 5 deletions
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 |