Deleted Added
full compact
vidcontrol.c (225736) vidcontrol.c (238158)
1/*-
2 * Copyright (c) 1994-1996 S�ren Schmidt
3 * All rights reserved.
4 *
5 * Portions of this software are based in part on the work of
6 * Sascha Wildner <saw@online.de> contributed to The DragonFly Project
7 *
8 * Redistribution and use in source and binary forms, with or without

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

28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 *
31 * $DragonFly: src/usr.sbin/vidcontrol/vidcontrol.c,v 1.10 2005/03/02 06:08:29 joerg Exp $
32 */
33
34#ifndef lint
35static const char rcsid[] =
1/*-
2 * Copyright (c) 1994-1996 S�ren Schmidt
3 * All rights reserved.
4 *
5 * Portions of this software are based in part on the work of
6 * Sascha Wildner <saw@online.de> contributed to The DragonFly Project
7 *
8 * Redistribution and use in source and binary forms, with or without

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

28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 *
31 * $DragonFly: src/usr.sbin/vidcontrol/vidcontrol.c,v 1.10 2005/03/02 06:08:29 joerg Exp $
32 */
33
34#ifndef lint
35static const char rcsid[] =
36 "$FreeBSD: stable/9/usr.sbin/vidcontrol/vidcontrol.c 205855 2010-03-29 20:12:44Z jkim $";
36 "$FreeBSD: stable/9/usr.sbin/vidcontrol/vidcontrol.c 238158 2012-07-06 01:32:53Z ache $";
37#endif /* not lint */
38
39#include <ctype.h>
40#include <err.h>
41#include <limits.h>
42#include <stdio.h>
43#include <stdlib.h>
44#include <string.h>

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

1189static void
1190set_terminal_mode(char *arg)
1191{
1192
1193 if (strcmp(arg, "xterm") == 0)
1194 fprintf(stderr, "\033[=T");
1195 else if (strcmp(arg, "cons25") == 0)
1196 fprintf(stderr, "\033[=1T");
37#endif /* not lint */
38
39#include <ctype.h>
40#include <err.h>
41#include <limits.h>
42#include <stdio.h>
43#include <stdlib.h>
44#include <string.h>

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

1189static void
1190set_terminal_mode(char *arg)
1191{
1192
1193 if (strcmp(arg, "xterm") == 0)
1194 fprintf(stderr, "\033[=T");
1195 else if (strcmp(arg, "cons25") == 0)
1196 fprintf(stderr, "\033[=1T");
1197 else
1198 usage();
1199}
1200
1201
1202int
1203main(int argc, char **argv)
1204{
1197}
1198
1199
1200int
1201main(int argc, char **argv)
1202{
1205 char *font, *type;
1203 char *font, *type, *termmode;
1206 int dumpmod, dumpopt, opt;
1207 int reterr;
1208
1209 init();
1210
1211 info.size = sizeof(info);
1212
1213 if (ioctl(0, CONS_GETINFO, &info) == -1)
1214 err(1, "must be on a virtual console");
1215 dumpmod = 0;
1216 dumpopt = DUMP_FBF;
1204 int dumpmod, dumpopt, opt;
1205 int reterr;
1206
1207 init();
1208
1209 info.size = sizeof(info);
1210
1211 if (ioctl(0, CONS_GETINFO, &info) == -1)
1212 err(1, "must be on a virtual console");
1213 dumpmod = 0;
1214 dumpopt = DUMP_FBF;
1215 termmode = NULL;
1217 while ((opt = getopt(argc, argv,
1218 "b:Cc:df:g:h:Hi:l:LM:m:pPr:S:s:T:t:x")) != -1)
1219 switch(opt) {
1220 case 'b':
1221 set_border_color(optarg);
1222 break;
1223 case 'C':
1224 clear_history();

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

1280 break;
1281 case 'S':
1282 set_lockswitch(optarg);
1283 break;
1284 case 's':
1285 set_console(optarg);
1286 break;
1287 case 'T':
1216 while ((opt = getopt(argc, argv,
1217 "b:Cc:df:g:h:Hi:l:LM:m:pPr:S:s:T:t:x")) != -1)
1218 switch(opt) {
1219 case 'b':
1220 set_border_color(optarg);
1221 break;
1222 case 'C':
1223 clear_history();

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

1279 break;
1280 case 'S':
1281 set_lockswitch(optarg);
1282 break;
1283 case 's':
1284 set_console(optarg);
1285 break;
1286 case 'T':
1288 set_terminal_mode(optarg);
1287 if (strcmp(optarg, "xterm") != 0 &&
1288 strcmp(optarg, "cons25") != 0)
1289 usage();
1290 termmode = optarg;
1289 break;
1290 case 't':
1291 set_screensaver_timeout(optarg);
1292 break;
1293 case 'x':
1294 hex = 1;
1295 break;
1296 default:

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

1303 get_normal_colors(argc, argv, &optind);
1304
1305 if (optind < argc && !strcmp(argv[optind], "show")) {
1306 test_frame();
1307 optind++;
1308 }
1309
1310 video_mode(argc, argv, &optind);
1291 break;
1292 case 't':
1293 set_screensaver_timeout(optarg);
1294 break;
1295 case 'x':
1296 hex = 1;
1297 break;
1298 default:

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

1305 get_normal_colors(argc, argv, &optind);
1306
1307 if (optind < argc && !strcmp(argv[optind], "show")) {
1308 test_frame();
1309 optind++;
1310 }
1311
1312 video_mode(argc, argv, &optind);
1313 if (termmode != NULL)
1314 set_terminal_mode(termmode);
1311
1312 get_normal_colors(argc, argv, &optind);
1313
1314 if (colors_changed || video_mode_changed) {
1315 if (!(new_mode_info.vi_flags & V_INFO_GRAPHICS)) {
1316 if ((normal_back_color < 8) && (revers_back_color < 8)) {
1317 set_colors();
1318 } else {

--- 13 unchanged lines hidden ---
1315
1316 get_normal_colors(argc, argv, &optind);
1317
1318 if (colors_changed || video_mode_changed) {
1319 if (!(new_mode_info.vi_flags & V_INFO_GRAPHICS)) {
1320 if ((normal_back_color < 8) && (revers_back_color < 8)) {
1321 set_colors();
1322 } else {

--- 13 unchanged lines hidden ---