#include "io.h"
#include "stripgfx.h"
-off_t seek_offset_clrscr;
int stripped = NO_GRAPHICS;
struct timeval
return r;
}
-void
-set_seek_offset_clrscr (FILE * fp)
+static off_t
+find_seek_offset_clrscr (FILE * fp)
{
off_t raw_seek_offset = 0;
+ off_t seek_offset_clrscr;
char *buf;
struct stat mystat;
int state = 0;
free (buf);
+ seek_offset_clrscr = 0;
/* now find last filepos that is less than seek offset */
fseek (fp, 0, SEEK_SET);
while (1)
free (buf);
}
+ return seek_offset_clrscr;
}
#if 0 /* not used anymore */
do
{
setvbuf (fp, NULL, _IOFBF, 0);
- set_seek_offset_clrscr (fp);
- if (seek_offset_clrscr)
- {
- ttyplay (fp, 0, ttyread, ttywrite, ttynowait, seek_offset_clrscr);
- }
+ ttyplay (fp, 0, ttyread, ttywrite, ttynowait, find_seek_offset_clrscr (fp));
clearerr (fp);
setvbuf (fp, NULL, _IONBF, 0);
fflush (stdout);
populate_gfx_array (stripped);
- seek_offset_clrscr = 0;
-
input = efopen (ttyfile, "r");
tcgetattr (0, &old); /* Get current terminal state */
ttyplayback (input, speed, read_func, wait_func);
tcsetattr (0, TCSANOW, &old); /* Return terminal state */
+ fclose (input);
return 0;
}