2 * Copyright (c) 1992, 1995 Hellmuth Michaelis
4 * Copyright (c) 1992, 1994 Brian Dunford-Shore
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. All advertising materials mentioning features or use of this software
17 * must display the following acknowledgement:
18 * This product includes software developed by
19 * Hellmuth Michaelis and Brian Dunford-Shore
20 * 4. The name authors may not be used to endorse or promote products
21 * derived from this software without specific prior written permission.
23 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
24 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
25 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
26 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
28 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
32 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 "@(#)cursor.c, 3.20, Last Edit-Date: [Tue Apr 4 12:27:54 1995]";
39 /*---------------------------------------------------------------------------*
43 * -hm adding option -d <device>
45 *---------------------------------------------------------------------------*/
50 #include <machine/pcvt_ioctl.h>
62 struct cursorshape cursorshape;
71 while( (c = getopt(argc, argv, "d:n:s:e:")) != -1)
81 screen = atoi(optarg);
99 if(start == -1 || end == -1)
108 if((fd = open(device, O_RDWR)) == -1)
111 strcpy(buffer,"ERROR opening ");
112 strcat(buffer,device);
122 if((fstat(fd, &stat)) == -1)
125 strcpy(buffer,"ERROR opening ");
126 strcat(buffer,device);
131 screen = minor(stat.st_rdev);
134 cursorshape.start = start;
135 cursorshape.end = end;
136 cursorshape.screen_no = screen;
138 if(ioctl(fd, VGACURSOR, &cursorshape) == -1)
140 perror("cursor - ioctl VGACURSOR failed, error");
149 fprintf(stderr,"\ncursor - set cursor shape for pcvt video driver\n");
150 fprintf(stderr,"usage: cursor -d [device] -n [no] -s [line] -e [line]\n");
151 fprintf(stderr," -d <device> device to use (/dev/ttyvX), default current\n");
152 fprintf(stderr," -n <no> screen no if specified, else current screen\n");
153 fprintf(stderr," -s <line> start scan line (topmost scan line)\n");
154 fprintf(stderr," -e <line> ending scan line (bottom scan line)\n\n");