vidcontrol.c (162671) | vidcontrol.c (199174) |
---|---|
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: head/usr.sbin/vidcontrol/vidcontrol.c 162671 2006-09-26 21:46:12Z ru $"; | 36 "$FreeBSD: head/usr.sbin/vidcontrol/vidcontrol.c 199174 2009-11-11 08:39:57Z ed $"; |
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> --- 135 unchanged lines hidden (view full) --- 180 181static void 182usage(void) 183{ 184 fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n", 185"usage: vidcontrol [-CdHLPpx] [-b color] [-c appearance] [-f [size] file]", 186" [-g geometry] [-h size] [-i adapter | mode] [-l screen_map]", 187" [-M char] [-m on | off] [-r foreground background]", | 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> --- 135 unchanged lines hidden (view full) --- 180 181static void 182usage(void) 183{ 184 fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n", 185"usage: vidcontrol [-CdHLPpx] [-b color] [-c appearance] [-f [size] file]", 186" [-g geometry] [-h size] [-i adapter | mode] [-l screen_map]", 187" [-M char] [-m on | off] [-r foreground background]", |
188" [-S on | off] [-s number] [-t N | off] [mode]", 189" [foreground [background]] [show]"); | 188" [-S on | off] [-s number] [-T xterm | cons25] [-t N | off]", 189" [mode] [foreground [background]] [show]"); |
190 exit(1); 191} 192 193 194/* 195 * Retrieve the next argument from the command line (for options that require 196 * more than one argument). 197 */ --- 956 unchanged lines hidden (view full) --- 1154clear_history(void) 1155{ 1156 if (ioctl(0, CONS_CLRHIST) == -1) { 1157 revert(); 1158 errc(1, errno, "clearing history buffer"); 1159 } 1160} 1161 | 190 exit(1); 191} 192 193 194/* 195 * Retrieve the next argument from the command line (for options that require 196 * more than one argument). 197 */ --- 956 unchanged lines hidden (view full) --- 1154clear_history(void) 1155{ 1156 if (ioctl(0, CONS_CLRHIST) == -1) { 1157 revert(); 1158 errc(1, errno, "clearing history buffer"); 1159 } 1160} 1161 |
1162static void 1163set_terminal_mode(char *arg) 1164{ |
|
1162 | 1165 |
1166 if (strcmp(arg, "xterm") == 0) 1167 fprintf(stderr, "\033[=T"); 1168 else if (strcmp(arg, "cons25") == 0) 1169 fprintf(stderr, "\033[=1T"); 1170 else 1171 usage(); 1172} 1173 1174 |
|
1163int 1164main(int argc, char **argv) 1165{ 1166 char *font, *type; 1167 int dumpmod, dumpopt, opt; 1168 int reterr; 1169 1170 init(); 1171 1172 info.size = sizeof(info); 1173 1174 if (ioctl(0, CONS_GETINFO, &info) == -1) 1175 err(1, "must be on a virtual console"); 1176 dumpmod = 0; 1177 dumpopt = DUMP_FBF; | 1175int 1176main(int argc, char **argv) 1177{ 1178 char *font, *type; 1179 int dumpmod, dumpopt, opt; 1180 int reterr; 1181 1182 init(); 1183 1184 info.size = sizeof(info); 1185 1186 if (ioctl(0, CONS_GETINFO, &info) == -1) 1187 err(1, "must be on a virtual console"); 1188 dumpmod = 0; 1189 dumpopt = DUMP_FBF; |
1178 while((opt = getopt(argc, argv, "b:Cc:df:g:h:Hi:l:LM:m:pPr:S:s:t:x")) != -1) | 1190 while ((opt = getopt(argc, argv, 1191 "b:Cc:df:g:h:Hi:l:LM:m:pPr:S:s:T:t:x")) != -1) |
1179 switch(opt) { 1180 case 'b': 1181 set_border_color(optarg); 1182 break; 1183 case 'C': 1184 clear_history(); 1185 break; 1186 case 'c': --- 52 unchanged lines hidden (view full) --- 1239 get_reverse_colors(argc, argv, &optind); 1240 break; 1241 case 'S': 1242 set_lockswitch(optarg); 1243 break; 1244 case 's': 1245 set_console(optarg); 1246 break; | 1192 switch(opt) { 1193 case 'b': 1194 set_border_color(optarg); 1195 break; 1196 case 'C': 1197 clear_history(); 1198 break; 1199 case 'c': --- 52 unchanged lines hidden (view full) --- 1252 get_reverse_colors(argc, argv, &optind); 1253 break; 1254 case 'S': 1255 set_lockswitch(optarg); 1256 break; 1257 case 's': 1258 set_console(optarg); 1259 break; |
1260 case 'T': 1261 set_terminal_mode(optarg); 1262 break; |
|
1247 case 't': 1248 set_screensaver_timeout(optarg); 1249 break; 1250 case 'x': 1251 hex = 1; 1252 break; 1253 default: 1254 usage(); --- 34 unchanged lines hidden --- | 1263 case 't': 1264 set_screensaver_timeout(optarg); 1265 break; 1266 case 'x': 1267 hex = 1; 1268 break; 1269 default: 1270 usage(); --- 34 unchanged lines hidden --- |