diff options
Diffstat (limited to 'mbbsd/screen.c')
-rw-r--r-- | mbbsd/screen.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/mbbsd/screen.c b/mbbsd/screen.c index 3232b1af..49ff84a2 100644 --- a/mbbsd/screen.c +++ b/mbbsd/screen.c @@ -354,15 +354,27 @@ outc(unsigned char c) #endif } -int +/** + * Just like outs, but print out '*' instead of 27(decimal) in the given string. + * + * FIXME column could not start from 0 + */ +void edit_outs(const char *text) { register int column = 0; register char ch; while ((ch = *text++) && (++column < t_columns)) outc(ch == 27 ? '*' : ch); +} - return 0; +void +edit_outs_n(const char *text, int n) +{ + register int column = 0; + register char ch; + while ((ch = *text++) && n-- && (++column < t_columns)) + outc(ch == 27 ? '*' : ch); } void @@ -373,6 +385,14 @@ outs(const char *str) } } +void +outs_n(const char *str, int n) +{ + while (*str && n--) { + outc(*str++); + } +} + /* Jaky */ void out_lines(const char *str, int line) |