home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
misc
/
volume12
/
tek.p1
/
tek.patch.1
< prev
Wrap
Text File
|
1990-05-14
|
4KB
|
191 lines
*** tek.c.orig Sun Mar 18 19:44:13 1990
--- tek.c Fri May 11 12:10:40 1990
***************
*** 1,6 ****
--- 1,7 ----
/*
* tek.c
* copyright 1988 Ronald Florence
+ * 5.12.90 fixed to restore mode when source is stdin
*
* as "tek" - Tek4014 picture files to CGI or WY99
* -w Accu-Weather maps
***************
*** 10,20 ****
* both:
* -p use plotter or printer (default display)
* -a preserve aspect ratio
! *
! * bugs: SIGINT doesn't work with wy99 modes. Possible solution is to
! * poll terminal on every iteration, with terminal set in raw mode.
*/
#include <signal.h>
#include <stdio.h>
#include <termio.h>
--- 11,20 ----
* both:
* -p use plotter or printer (default display)
* -a preserve aspect ratio
! * -N N is a single digit: use CGI font #N
*/
+ #include <sys/machdep.h>
#include <signal.h>
#include <stdio.h>
#include <termio.h>
***************
*** 22,27 ****
--- 22,28 ----
#define int short /* for CGI functions */
#define CRT (wout[45] == 0)
+ #define CGI_FONTS wout[10]
#define To_tek "\033[?38h"
#define To_vt220 "\033[?38l"
#define Clr_tek "\033\f"
***************
*** 28,35 ****
#define Vt_reset "\033!p"
int dev; /* device id */
! static int tty;
struct termio new, old;
static int tek; /* =1 if invoked as tek */
static char *progn;
static char *dspec[] = {"CGIDISP", "CGIPRNT", 0 };
--- 29,37 ----
#define Vt_reset "\033!p"
int dev; /* device id */
! static int tty;
struct termio new, old;
+ static int mode; /* video mode to reset */
static int tek; /* =1 if invoked as tek */
static char *progn;
static char *dspec[] = {"CGIDISP", "CGIPRNT", 0 };
***************
*** 44,49 ****
--- 46,52 ----
h = 0,
aspect = 0, /* map to max CGI space */
opt = 0,
+ font = 0,
sig_handle(), quit_wyse();
char *device, *p, *getenv(), *strrchr();
***************
*** 74,79 ****
--- 77,93 ----
case 'a' :
aspect = 3;
break;
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ font = *p - '0';
+ break;
default :
usage();
}
***************
*** 89,94 ****
--- 103,111 ----
tty = open("/dev/tty", O_RDWR);
ioctl(tty, TCGETA, &new);
ioctl(tty, TCGETA, &old);
+ /* get the current video mode */
+ mode = ioctl(tty, CONS_GET, 0);
+
/* wyse 99 terminal? */
if (!h && !strncmp(getenv("TERM"), "wy99", 4))
{
***************
*** 134,139 ****
--- 151,159 ----
printf("%s: error %d opening %s\n", progn, -vq_error(), device);
exit (-1);
}
+ if (font > 0 && font <= CGI_FONTS)
+ vst_font(dev, font);
+
if (tek)
tekdecode(fi, opt);
else
***************
*** 141,152 ****
if (CRT)
getkey();
v_clswk(dev);
}
usage ()
{
! printf("usage: %s file\n", tek ? "tek [-wpa]" : "poly [-spa]");
exit (-1);
}
--- 161,174 ----
if (CRT)
getkey();
v_clswk(dev);
+ if (CRT && fi == stdin)
+ ioctl(tty, (MODESWITCH | mode), 0);
}
usage ()
{
! printf("usage: %s [-N] file\n", tek ? "tek [-wpa]" : "poly [-spa]");
exit (-1);
}
*** tek.man.orig Fri May 11 12:58:44 1990
--- tek.man Fri May 11 13:02:22 1990
***************
*** 8,13 ****
--- 8,15 ----
[
.I -wap
] [
+ .I -N
+ ] [
.I file
]
.br
***************
*** 15,20 ****
--- 17,24 ----
[
.I -sap
] [
+ .I -N
+ ] [
.I file
]
.SH DESCRIPTION
***************
*** 60,65 ****
--- 64,77 ----
be specified by declaring a (non-null)
.SM ASPECT
environment variable.
+ .PP
+ The
+ .I -N
+ option, where
+ .I N
+ is a digit from 1 to 9, is used to specify the CGI graphics font used by
+ .I tek.
+ The fonts are system and device dependent.
.SH BUGS
The available type sizes on CGI output devices may not match the
Tektronics display. The interactive Tektronics input functions are