VP(4) UNIX Programmer's Manual VP(4) NAME vp - Versatec interface SYNOPSIS #include <sys/vcmd.h> DESCRIPTION The Versatec printer/plotter in normally used with the pro- grams _v_p_r(1), _v_p_r_i_n_t(1) or _v_t_r_o_f_f(1). This description is designed for those who wish to drive the Versatec directly. The Versatec at Berkeley is 36" wide, and has 440 characters per line and 7040 dots per line in plot mode (this is actu- ally slightly less than 36" of dots.) The paper used is con- tinuous roll paper, and comes in 500' rolls. To use the Versatec yourself, you must realize that you can- not open the device, /_d_e_v/_v_p_0 if there is a daemon active. You can see if there is a daemon active by doing a _p_s(1), or by looking in the directory /_u_s_r/_s_p_o_o_l/_v_p_d. If there is a file _l_o_c_k there, then there is probably a daemon /_u_s_r/_l_i_b/_v_p_d running. If not, you should remove the _l_o_c_k. In any case, when your program tries to open the device /_d_e_v/_v_p_0 you may get one of two errors. The first of these ENXIO indicates that the Versatec is already in use. Your program can then _s_l_e_e_p(2) and try again in a while, or give up. The second is EIO and indicates that the Versatec is offline. To set the Versatec into plot mode you can use the following _i_o_c_t_l(2) call ioctl(fileno(vp), VSETSTATE, plotmd); where plotmd is defined to be int plotmd[] = { VPLOT, 0, 0 }; and _v_p is the result of a call to _f_o_p_e_n on stdio. When you finish using the Versatec in plot mode you should eject paper by sending it a EOT after putting it back into print mode, i.e. by 9 int prtmd[] = { VPRINT, 0, 0 }; ... fflush(vp); ioctl(fileno(vp), VSETSTATE, prtmd); write(fileno(vp), "\04", 1); _N._B.: If you use the standard I/O library with the Versatec you must do 9 Printed 11/10/80 2/21/80 1 VP(4) UNIX Programmer's Manual VP(4) setbuf(vp, vpbuf); where _v_p_b_u_f is declared char vpbuf[BUFSIZ]; otherwise the standard I/O library, thinking that the Versa- tec is a terminal (since it is a character special file) will not adequately buffer the data you are sending to the Versatec. This will cause it to run extremely slowly and tends to grind the system to a halt. FILES /dev/vp0 SEE ALSO vfont(5), vpr(1), vtroff(1), va(4) BUGS Printed 11/10/80 2/21/80 2