Deleted Added
full compact
vidcontrol.c (97748) vidcontrol.c (99705)
1/*-
2 * Copyright (c) 1994-1996 S�ren Schmidt
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 14 unchanged lines hidden (view full) ---

23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#ifndef lint
30static const char rcsid[] =
1/*-
2 * Copyright (c) 1994-1996 S�ren Schmidt
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 14 unchanged lines hidden (view full) ---

23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#ifndef lint
30static const char rcsid[] =
31 "$FreeBSD: head/usr.sbin/vidcontrol/vidcontrol.c 97748 2002-06-02 20:05:59Z schweikh $";
31 "$FreeBSD: head/usr.sbin/vidcontrol/vidcontrol.c 99705 2002-07-10 03:31:25Z dd $";
32#endif /* not lint */
33
34#include <ctype.h>
35#include <err.h>
36#include <limits.h>
37#include <stdio.h>
38#include <stdlib.h>
39#include <string.h>

--- 31 unchanged lines hidden (view full) ---

71
72static void
73usage()
74{
75 fprintf(stderr, "%s\n%s\n%s\n%s\n",
76"usage: vidcontrol [-CdLPpx] [-b color] [-c appearance] [-f [size] file]",
77" [-g geometry] [-h size] [-i adapter | mode] [-l screen_map]",
78" [-m on | off] [-M char] [-r foreground background] [-s num]",
32#endif /* not lint */
33
34#include <ctype.h>
35#include <err.h>
36#include <limits.h>
37#include <stdio.h>
38#include <stdlib.h>
39#include <string.h>

--- 31 unchanged lines hidden (view full) ---

71
72static void
73usage()
74{
75 fprintf(stderr, "%s\n%s\n%s\n%s\n",
76"usage: vidcontrol [-CdLPpx] [-b color] [-c appearance] [-f [size] file]",
77" [-g geometry] [-h size] [-i adapter | mode] [-l screen_map]",
78" [-m on | off] [-M char] [-r foreground background] [-s num]",
79" [-t N | off] [mode] [foreground [background]] [show]");
79" [-S on | off] [-t N | off] [mode] [foreground [background]] [show]");
80 exit(1);
81}
82
83char *
84nextarg(int ac, char **av, int *indp, int oc, int strict)
85{
86 if (*indp < ac)
87 return(av[(*indp)++]);

--- 425 unchanged lines hidden (view full) ---

513 mouse.operation = MOUSE_HIDE;
514 else {
515 warnx("argument to -m must either on or off");
516 return;
517 }
518 ioctl(0, CONS_MOUSECTL, &mouse);
519}
520
80 exit(1);
81}
82
83char *
84nextarg(int ac, char **av, int *indp, int oc, int strict)
85{
86 if (*indp < ac)
87 return(av[(*indp)++]);

--- 425 unchanged lines hidden (view full) ---

513 mouse.operation = MOUSE_HIDE;
514 else {
515 warnx("argument to -m must either on or off");
516 return;
517 }
518 ioctl(0, CONS_MOUSECTL, &mouse);
519}
520
521void
522set_lockswitch(char *arg)
523{
524 int data;
525
526 if (!strcmp(arg, "off"))
527 data = 0x01;
528 else if (!strcmp(arg, "on"))
529 data = 0x02;
530 else {
531 warnx("argument to -S must either on or off");
532 return;
533 }
534 if (ioctl(0, VT_LOCKSWITCH, &data) == -1)
535 warn("ioctl(VT_LOCKSWITCH)");
536}
537
521static char
522*adapter_name(int type)
523{
524 static struct {
525 int type;
526 char *name;
527 } names[] = {
528 { KD_MONO, "MDA" },

--- 215 unchanged lines hidden (view full) ---

744
745
746 info.size = sizeof(info);
747 if (argc == 1)
748 usage();
749 /* Not reached */
750 if (ioctl(0, CONS_GETINFO, &info) < 0)
751 err(1, "must be on a virtual console");
538static char
539*adapter_name(int type)
540{
541 static struct {
542 int type;
543 char *name;
544 } names[] = {
545 { KD_MONO, "MDA" },

--- 215 unchanged lines hidden (view full) ---

761
762
763 info.size = sizeof(info);
764 if (argc == 1)
765 usage();
766 /* Not reached */
767 if (ioctl(0, CONS_GETINFO, &info) < 0)
768 err(1, "must be on a virtual console");
752 while((opt = getopt(argc, argv, "b:Cc:df:g:h:i:l:LM:m:pPr:s:t:x")) != -1)
769 while((opt = getopt(argc, argv, "b:Cc:df:g:h:i:l:LM:m:pPr:S:s:t:x")) != -1)
753 switch(opt) {
754 case 'b':
755 set_border_color(optarg);
756 break;
757 case 'C':
758 clear_history();
759 break;
760 case 'c':

--- 40 unchanged lines hidden (view full) ---

801 dump_screen(DUMP_RAW);
802 break;
803 case 'P':
804 dump_screen(DUMP_TXT);
805 break;
806 case 'r':
807 set_reverse_colors(argc, argv, &optind);
808 break;
770 switch(opt) {
771 case 'b':
772 set_border_color(optarg);
773 break;
774 case 'C':
775 clear_history();
776 break;
777 case 'c':

--- 40 unchanged lines hidden (view full) ---

818 dump_screen(DUMP_RAW);
819 break;
820 case 'P':
821 dump_screen(DUMP_TXT);
822 break;
823 case 'r':
824 set_reverse_colors(argc, argv, &optind);
825 break;
826 case 'S':
827 set_lockswitch(optarg);
828 break;
809 case 's':
810 set_console(optarg);
811 break;
812 case 't':
813 set_screensaver_timeout(optarg);
814 break;
815 case 'x':
816 hex = 1;

--- 15 unchanged lines hidden ---
829 case 's':
830 set_console(optarg);
831 break;
832 case 't':
833 set_screensaver_timeout(optarg);
834 break;
835 case 'x':
836 hex = 1;

--- 15 unchanged lines hidden ---