char *input = NULL;
char *command = NULL;
+char **lines = NULL;
int second = 0;
-void display (char **lines, int xmax, int ymax)
+void display (char **lines, int xmax, int ymax, int keep_skip)
{
int stop = 0;
+ if (!lines) {
+ return;
+ }
+
#ifdef __PDCURSES__
statusmsg ("Press 'q' or escape to quit");
#else
statusmsg ("Press 'q' or double-escape to quit");
#endif
- int skip = 0;
+ static int skip;
+ if (!keep_skip) {
+ skip = 0;
+ }
+
while (!stop) {
clsbody ();
int i = 0;
void process (void)
{
- static char **lines = NULL;
-
int xmax, ymax;
WINDOW *wbody = bodywin ();
getmaxyx (wbody, ymax, xmax);
exit (1);
}
- if (!lines) {
- lines = split_lines (buffer, xmax);
- free (buffer);
- }
-
- if (lines) {
- display (lines, xmax, ymax);
- if (buffer) {
- free_lines (lines);
- lines = NULL;
- }
- }
+ free_lines (lines);
+ lines = split_lines (buffer, xmax);
+ free (buffer);
+ display (lines, xmax, ymax, 0);
if (second > 0) {
VERBOSE (DEBUG, fprintf (stdout, "sleeping for %d''\n", second));
}
}
+void follow (void)
+{
+ int xmax, ymax;
+ WINDOW *wbody = bodywin ();
+ getmaxyx (wbody, ymax, xmax);
+
+ display (lines, xmax, ymax, 1);
+}
+
void about (void)
{
int xmax, ymax;
}
}
-void contdisp (void)
-{
-}
-
menu SubMenu0[] =
{
{ "Command", chcmd, "Change command"},
{ "File", chfile, "Change file"},
- { "Display", contdisp, "Continue"},
+ { "Display", follow, "Continue"},
{ "Refresh", process, "Refresh"},
{ "Exit", DoExit, "Terminate program" },
{ "", (FUNC)0, "" }