summaryrefslogtreecommitdiffstats
path: root/call
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2016-02-12 17:04:57 +0100
committerRalf Baechle <ralf@linux-mips.org>2016-02-12 17:04:57 +0100
commitc0970397c47af6b29926cd887e8eb52506ca411d (patch)
treec9b67e32dfc8b8c69fdcfce403b4b0deda4ee1b5 /call
parent90653d4616fa57bcdf6a1f636928dc9140f280e8 (diff)
call: Move statline() to make declaration unnecessary.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'call')
-rw-r--r--call/call.c83
1 files changed, 41 insertions, 42 deletions
diff --git a/call/call.c b/call/call.c
index 25dbe41..67dda49 100644
--- a/call/call.c
+++ b/call/call.c
@@ -140,7 +140,6 @@ static char inbuf[MAX_BUFLEN];
static int inbuflen, inbufwid;
static char incharbuf[6];
static int incharbuflen;
-static void statline(int mode, char *s);
static void addscrollline(char *s, int len)
{
@@ -327,6 +326,47 @@ static void redrawscreen(t_win *win_in, int mode, t_win *win_out)
checkcursor(mode);
}
+static void statline(int mode, char *s)
+{
+ static int oldlen = 0;
+ int l, cnt;
+
+ if (*s == '\0') {
+ if (mode == RAWMODE)
+ return;
+ if (oldlen > 0) {
+ move(0, STATW_STAT);
+ attron(A_REVERSE);
+ for (cnt = STATW_STAT; cnt < COLS; cnt++)
+ addch(' ');
+ oldlen = 0;
+ attroff(A_REVERSE);
+ refresh();
+ }
+ return;
+ }
+ if (mode == RAWMODE) {
+ printf(">>%s\n", s);
+ fflush(stdout);
+ return;
+ }
+ if (COLS <= STATW_STAT)
+ return;
+ l = strlen(s);
+ if (l > COLS - STATW_STAT)
+ l = COLS-STATW_STAT;
+
+ move(0, STATW_STAT);
+
+ attron(A_REVERSE);
+ addnstr(s, l);
+ for (cnt = STATW_STAT+l;cnt < COLS;cnt++)
+ addch(' ');
+ attroff(A_REVERSE);
+ oldlen = l;
+ refresh();
+}
+
static void scrolltext(t_win *win_in, int lines, int mode, t_win *win_out)
{
int topline, storedlines;
@@ -784,47 +824,6 @@ static void cmd_intr(int sig)
interrupted = TRUE;
}
-static void statline(int mode, char *s)
-{
- static int oldlen = 0;
- int l, cnt;
-
- if (*s == '\0') {
- if (mode == RAWMODE)
- return;
- if (oldlen > 0) {
- move(0, STATW_STAT);
- attron(A_REVERSE);
- for (cnt = STATW_STAT; cnt < COLS; cnt++)
- addch(' ');
- oldlen = 0;
- attroff(A_REVERSE);
- refresh();
- }
- return;
- }
- if (mode == RAWMODE) {
- printf(">>%s\n", s);
- fflush(stdout);
- return;
- }
- if (COLS <= STATW_STAT)
- return;
- l = strlen(s);
- if (l > COLS - STATW_STAT)
- l = COLS-STATW_STAT;
-
- move(0, STATW_STAT);
-
- attron(A_REVERSE);
- addnstr(s, l);
- for (cnt = STATW_STAT+l;cnt < COLS;cnt++)
- addch(' ');
- attroff(A_REVERSE);
- oldlen = l;
- refresh();
-}
-
WINDOW *opnstatw(int mode, wint * wintab, char *s, int lines, int cols)
{
WINDOW *win;