Commit | Line | Data |
---|---|---|
90df4f67 BJ |
1 | .TH VP 4 2/24/79 4 |
2 | .UC | |
3 | .SH NAME | |
4 | vp \- Versatec interface | |
5 | .SH SYNOPSIS | |
6 | .B /dev/vp0 | |
7 | .SH DESCRIPTION | |
8 | The Versatec printer/plotter in normally used with the programs | |
9 | .IR vprint (1) | |
10 | or | |
11 | .IR vtroff (1). | |
12 | This description is designed for those who wish to drive the Versatec directly. | |
13 | .PP | |
14 | The Versatec at Berkeley is 36'' wide, and has 440 characters per line | |
15 | and 7040 dot per line in plot mode (this is actually slightly less than | |
16 | 36'' of dots.) | |
17 | The paper used is continuous roll paper, and comes in 500' rolls. | |
18 | .PP | |
19 | To use the Versatec yourself, you must realize that you cannot open the | |
20 | device, | |
21 | .I /dev/vp0 | |
22 | if there is a daemon active. | |
23 | You can see if there is a daemon active by doing a | |
24 | .IR ps (1), | |
25 | or by looking in the directory | |
26 | .I /usr/spool/vpd. | |
27 | If there is a file | |
28 | .I lock | |
29 | there, then there is probably a daemon | |
30 | .IR vpd (1) | |
31 | running. | |
32 | If not, you should remove the | |
33 | .I lock. | |
34 | .PP | |
35 | In any case, when your program tries to open the device | |
36 | .I /dev/vp0 | |
37 | you may get one of two errors. | |
38 | The first of these | |
39 | ENXIO | |
40 | indicates that the Versatec is already in use. | |
41 | Your program can then | |
42 | .IR sleep (2) | |
43 | and try again in a while, or give up. | |
44 | The second is | |
45 | EIO | |
46 | and indicates that the Versatec is offline. | |
47 | .PP | |
48 | To set the Versatec into plot mode you can use the following | |
49 | .IR ioctl (2) | |
50 | call | |
51 | .IP | |
52 | ioctl(fileno(vp), SETSTATE, plotmd); | |
53 | .PP | |
54 | where SETSTATE must be defined to be ``('v'<<8) | 1'' and | |
55 | .B plotmd | |
56 | is defined by | |
57 | .IP | |
58 | \fBint\fR plotmd[] = { 0200, 0, 0 }; | |
59 | .PP | |
60 | and | |
61 | .I vp | |
62 | is the result of a call to | |
63 | .I fopen | |
64 | on stdio. | |
65 | When you finish using the Versatec in plot mode you should eject paper | |
66 | by sending it a EOT after putting it back into print mode, i.e. by | |
67 | .sp .1i | |
68 | 'nf | |
69 | \fBint\fR prtmd[] = { 0100, 0, 0 }; | |
70 | \&... | |
71 | fflush(vp); ioctl(fileno(vp), SETSTATE, prtmd); write(fileno(vp), "\e04", 1); | |
72 | .fi | |
73 | .PP | |
74 | .B "\s+2Very important point:\s0" | |
75 | If you use the standard I/O library with the Versatec you | |
76 | .B must | |
77 | do | |
78 | .IP | |
79 | setbuf(vp, vpbuf); | |
80 | .PP | |
81 | where | |
82 | .I vpbuf | |
83 | is declared | |
84 | .IP | |
85 | \fBchar\fR vpbuf[BUFSIZ]; | |
86 | .PP | |
87 | otherwise the standard I/O library, thinking that the Versatec | |
88 | is a terminal (since it is a character special file) will not buffer | |
89 | the data you are sending to the Versatec. | |
90 | This will cause it to run | |
91 | .B extremely | |
92 | slowly and tends to grind the system to a halt. | |
93 | .SH FILES | |
94 | /dev/vp0 | |
95 | .SH SEE ALSO | |
96 | vcat(1), vfont(5), vpr(1), vprint(1), vstat(1), vtroff(1) | |
97 | .SH BUGS |