From 8649e4efe65373700682ff66e3cbff8b09fcabec Mon Sep 17 00:00:00 2001 From: piaip Date: Fri, 21 Dec 2007 11:44:58 +0000 Subject: - add outstr() to output complete (DBCS-aware) non-ANSI string (non-functional in old screen but works in pfterm) git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3719 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- include/proto.h | 3 ++- mbbsd/screen.c | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/include/proto.h b/include/proto.h index c0e5a134..916de0f4 100644 --- a/include/proto.h +++ b/include/proto.h @@ -579,7 +579,8 @@ void scr_dump (screen_backup_t *buf); void scr_restore(const screen_backup_t *buf); // non-curses void outc(unsigned char ch); -void outs(const char *str); +void outs(const char *s); +void outstr(const char *str); // prepare and print a complete non-ANSI string. int inansistr(char *str, int n); void move_ansi(int y, int x); void region_scroll_up(int top, int bottom); diff --git a/mbbsd/screen.c b/mbbsd/screen.c index 74d434e1..8f54f6cc 100644 --- a/mbbsd/screen.c +++ b/mbbsd/screen.c @@ -441,11 +441,21 @@ outc(unsigned char c) void outs(const char *str) { + if (!str) + return; while (*str) { outc(*str++); } } +void +outstr(const char *str) +{ + // XXX TODO cannot prepare DBCS-ready environment? + + outs(str); +} + void scroll(void) { -- cgit v1.2.3