diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-02-10 15:49:44 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-02-10 15:49:44 +0800 |
commit | 2ada0f2d94034a9716f0061ba7760e82f90f268b (patch) | |
tree | ba39083e0d86887707552b0d98fc0a6c47d4cb39 /mbbsd/screen.c | |
parent | 790ef96d3e3319f448800689eb40b62aaad31a73 (diff) | |
download | pttbbs-2ada0f2d94034a9716f0061ba7760e82f90f268b.tar pttbbs-2ada0f2d94034a9716f0061ba7760e82f90f268b.tar.gz pttbbs-2ada0f2d94034a9716f0061ba7760e82f90f268b.tar.bz2 pttbbs-2ada0f2d94034a9716f0061ba7760e82f90f268b.tar.lz pttbbs-2ada0f2d94034a9716f0061ba7760e82f90f268b.tar.xz pttbbs-2ada0f2d94034a9716f0061ba7760e82f90f268b.tar.zst pttbbs-2ada0f2d94034a9716f0061ba7760e82f90f268b.zip |
merge from branches/victor.edit
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2488 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
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) |