summaryrefslogtreecommitdiffstats
path: root/mbbsd/screen.c
diff options
context:
space:
mode:
authorkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-02-10 15:49:44 +0800
committerkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-02-10 15:49:44 +0800
commit2ada0f2d94034a9716f0061ba7760e82f90f268b (patch)
treeba39083e0d86887707552b0d98fc0a6c47d4cb39 /mbbsd/screen.c
parent790ef96d3e3319f448800689eb40b62aaad31a73 (diff)
downloadpttbbs-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.c24
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)