diff options
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 */ |