diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-08-06 13:03:41 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-08-06 13:03:41 +0800 |
commit | 01cae7cc0030e26ce53c5743fc0dccc4aa7bf683 (patch) | |
tree | 387b16397b214d8ae40ac24672149f4a3b035418 /mbbsd/screen.c | |
parent | ff24026ce0222c9b0bc78ee075dd0ca9bb50c193 (diff) | |
download | pttbbs-01cae7cc0030e26ce53c5743fc0dccc4aa7bf683.tar pttbbs-01cae7cc0030e26ce53c5743fc0dccc4aa7bf683.tar.gz pttbbs-01cae7cc0030e26ce53c5743fc0dccc4aa7bf683.tar.bz2 pttbbs-01cae7cc0030e26ce53c5743fc0dccc4aa7bf683.tar.lz pttbbs-01cae7cc0030e26ce53c5743fc0dccc4aa7bf683.tar.xz pttbbs-01cae7cc0030e26ce53c5743fc0dccc4aa7bf683.tar.zst pttbbs-01cae7cc0030e26ce53c5743fc0dccc4aa7bf683.zip |
Large Terminal Rules
New api: *lr family calls are used to pad and fir terminal width.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2996 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/screen.c')
-rw-r--r-- | mbbsd/screen.c | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/mbbsd/screen.c b/mbbsd/screen.c index 6613085a..b9b57b90 100644 --- a/mbbsd/screen.c +++ b/mbbsd/screen.c @@ -372,6 +372,35 @@ outs_n(const char *str, int n) outc(*str++); } } +// +void +outslr(const char *left, int leftlen, const char *right, int rightlen) +{ + if (left == NULL) + left = ""; + if (right == NULL) + right = ""; + if(*left && leftlen < 0) + leftlen = strlen(left); + if(*right && rightlen < 0) + rightlen = strlen(right); + // now calculate padding + rightlen = t_columns - leftlen - rightlen; + outs(left); + + // ignore right msg if we need to. + if(rightlen >= 0) + { + while(--rightlen > 0) + outc(' '); + outs(right); + } else { + rightlen = t_columns - leftlen; + while(--rightlen > 0) + outc(' '); + } +} + /* Jaky */ void @@ -394,6 +423,15 @@ outmsg(const char *msg) } void +outmsglr(const char *msg, int llen, const char *rmsg, int rlen) +{ + move(b_lines - msg_occupied, 0); + clrtoeol(); + outslr(msg, llen, rmsg, rlen); + outs(ANSI_RESET ANSI_CLRTOEND); +} + +void prints(const char *fmt,...) { va_list args; @@ -518,5 +556,5 @@ void screen_restore(int len, screenline_t *bp, const void *buf) } } -/* vim:tw=4 +/* vim:sw=4 */ |