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.
34 * @(#)cursor.c, 3.20, Last Edit-Date: [Tue Apr 4 12:27:54 1995]
35 * $FreeBSD: src/usr.sbin/pcvt/cursor/cursor.c,v 1.7.6.2 2001/05/12 10:11:41 kris Exp $
36 * $DragonFly: src/usr.sbin/pcvt/cursor/Attic/cursor.c,v 1.3 2004/03/24 17:46:22 cpressey Exp $
39 /*---------------------------------------------------------------------------*
43 * -hm adding option -d <device>
45 *---------------------------------------------------------------------------*/
48 #include <machine/pcvt_ioctl.h>
55 static void usage(void);
59 main(int argc, char **argv)
65 struct cursorshape cursorshape;
74 while( (c = getopt(argc, argv, "d:n:s:e:")) != -1)
84 screen = atoi(optarg);
102 if(start == -1 || end == -1)
109 else if((fd = open(device, O_RDWR)) == -1)
110 err(1, "ERROR opening %s", device);
116 if((fstat(fd, &stat)) == -1)
117 err(1, "ERROR opening %s", device);
118 screen = minor(stat.st_rdev);
121 cursorshape.start = start;
122 cursorshape.end = end;
123 cursorshape.screen_no = screen;
125 if(ioctl(fd, VGACURSOR, &cursorshape) == -1)
126 err(1, "cursor - ioctl VGACURSOR failed, error");
134 fprintf(stderr,"\ncursor - set cursor shape for pcvt video driver\n");
135 fprintf(stderr,"usage: cursor -d [device] -n [no] -s [line] -e [line]\n");
136 fprintf(stderr," -d <device> device to use (%svX), default current\n", _PATH_TTY);
137 fprintf(stderr," -n <no> screen no if specified, else current screen\n");
138 fprintf(stderr," -s <line> start scan line (topmost scan line)\n");
139 fprintf(stderr," -e <line> ending scan line (bottom scan line)\n\n");