Print this page
NEX-16819 loader UEFI support
Includes work by Toomas Soome <tsoome@me.com>
Upstream commits:
loader: pxe receive cleanup
9475 libefi: Do not return only if ReceiveFilter
installboot: should support efi system partition
8931 boot1.efi: scan all display modes rather than
loader: spinconsole updates
loader: gfx experiment to try GOP Blt() function.
sha1 build test
loader: add sha1 hash calculation
common/sha1: update for loader build
loader: biosdisk rework
uts: 32-bit kernel FB needs mapping in low memory
uts: add diag-device
uts: boot console mirror with diag-device
uts: enable very early console on ttya
kmdb: add diag-device as input/output device
uts: test VGA memory exclusion from mapping
uts: clear boot mapping and protect boot pages test
uts: add dboot map debug printf
uts: need to release FB pages in release_bootstrap()
uts: add screenmap ioctl
uts: update sys/queue.h
loader: add illumos uts/common to include path
loader: tem/gfx font cleanup
loader: vbe checks
uts: gfx_private set KD_TEXT when KD_RESETTEXT is
uts: gfx 8-bit update
loader: gfx 8-bit fix
loader: always set media size from partition.
uts: MB2 support for 32-bit kernel
loader: x86 should have tem 80x25
uts: x86 should have tem 80x25
uts: font update
loader: font update
uts: tem attributes
loader: tem.c comment added
uts: use font module
loader: add font module
loader: build rules for new font setup
uts: gfx_private update for new font structure
uts: early boot update for new font structure
uts: font update
uts: font build rules update for new fonts
uts: tem update to new font structure
loader: module.c needs to include tem_impl.h
uts: gfx_private 8x16 font rework
uts: make font_lookup public
loader: font rework
uts: font rework
9259 libefi: efi_alloc_and_read should check for PMBR
uts: tem utf-8 support
loader: implement tem utf-8 support
loader: tem should be able to display UTF-8
7784 uts: console input should support utf-8
7796 uts: ldterm default to utf-8
uts: do not reset serial console
uts: set up colors even if tem is not console
uts: add type for early boot properties
uts: gfx_private experiment with drm and vga
uts: gfx_private should use setmode drm callback.
uts: identify FB types and set up gfx_private based
loader: replace gop and vesa with framebuffer
uts: boot needs simple tem to support mdb
uts: boot_keyboard should emit esc sequences for
uts: gfx_private FB showuld be written by line
kmdb: set terminal window size
uts: gfx_private needs to keep track of early boot FB
pnglite: move pnglite to usr/src/common
loader: gfx_fb
ficl-sys: add gfx primitives
loader: add illumos.png logo
ficl: add fb-putimage
loader: add png support
loader: add alpha blending for gfx_fb
loader: use term-drawrect for menu frame
ficl: add simple gfx words
uts: provide fb_info via fbgattr dev_specific array.
uts: gfx_private add alpha blending
uts: update sys/ascii.h
uts: tem OSC support (incomplete)
uts: implement env module support and use data from
uts: tem get colors from early boot data
loader: use crc32 from libstand (libz)
loader: optimize for size
loader: pass tem info to the environment
loader: import tem for loader console
loader: UEFI loader needs to set ISADIR based on
loader: need UEFI32 support
8918 loader.efi: add vesa edid support
uts: tem_safe_pix_clear_prom_output() should only
uts: tem_safe_pix_clear_entire_screen() should use
uts: tem_safe_check_first_time() should query cursor
uts: tem implement cls callback & visual_io v4
uts: gfx_vgatext use block cursor for vgatext
uts: gfx_private implement cls callback & visual_io
uts: gfx_private bitmap framebuffer implementation
uts: early start frame buffer console support
uts: font functions should check the input char
uts: font rendering should support 16/24/32bit depths
uts: use smallest font as fallback default.
uts: update terminal dimensions based on selected
7834 uts: vgatext should use gfx_private
uts: add spacing property to 8859-1.bdf
terminfo: add underline for sun-color
terminfo: sun-color has 16 colors
uts: add font load callback type
loader: do not repeat int13 calls with error 0x20 and
8905 loader: add skein/edonr support
8904 common/crypto: make skein and edonr loader
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Revert "NEX-16819 loader UEFI support"
This reverts commit ec06b9fc617b99234e538bf2e7e4d02a24993e0c.
Reverting due to failures in the zfs-tests and the sharefs-tests
NEX-16819 loader UEFI support
Includes work by Toomas Soome <tsoome@me.com>
Upstream commits:
loader: pxe receive cleanup
9475 libefi: Do not return only if ReceiveFilter
installboot: should support efi system partition
8931 boot1.efi: scan all display modes rather than
loader: spinconsole updates
loader: gfx experiment to try GOP Blt() function.
sha1 build test
loader: add sha1 hash calculation
common/sha1: update for loader build
loader: biosdisk rework
uts: 32-bit kernel FB needs mapping in low memory
uts: add diag-device
uts: boot console mirror with diag-device
uts: enable very early console on ttya
kmdb: add diag-device as input/output device
uts: test VGA memory exclusion from mapping
uts: clear boot mapping and protect boot pages test
uts: add dboot map debug printf
uts: need to release FB pages in release_bootstrap()
uts: add screenmap ioctl
uts: update sys/queue.h
loader: add illumos uts/common to include path
loader: tem/gfx font cleanup
loader: vbe checks
uts: gfx_private set KD_TEXT when KD_RESETTEXT is
uts: gfx 8-bit update
loader: gfx 8-bit fix
loader: always set media size from partition.
uts: MB2 support for 32-bit kernel
loader: x86 should have tem 80x25
uts: x86 should have tem 80x25
uts: font update
loader: font update
uts: tem attributes
loader: tem.c comment added
uts: use font module
loader: add font module
loader: build rules for new font setup
uts: gfx_private update for new font structure
uts: early boot update for new font structure
uts: font update
uts: font build rules update for new fonts
uts: tem update to new font structure
loader: module.c needs to include tem_impl.h
uts: gfx_private 8x16 font rework
uts: make font_lookup public
loader: font rework
uts: font rework
libefi: efi_alloc_and_read should check for PMBR
uts: tem utf-8 support
loader: implement tem utf-8 support
loader: tem should be able to display UTF-8
7784 uts: console input should support utf-8
7796 uts: ldterm default to utf-8
uts: do not reset serial console
uts: set up colors even if tem is not console
uts: add type for early boot properties
uts: gfx_private experiment with drm and vga
uts: gfx_private should use setmode drm callback.
uts: identify FB types and set up gfx_private based
loader: replace gop and vesa with framebuffer
uts: boot needs simple tem to support mdb
uts: boot_keyboard should emit esc sequences for
uts: gfx_private FB showuld be written by line
kmdb: set terminal window size
uts: gfx_private needs to keep track of early boot FB
pnglite: move pnglite to usr/src/common
loader: gfx_fb
ficl-sys: add gfx primitives
loader: add illumos.png logo
ficl: add fb-putimage
loader: add png support
loader: add alpha blending for gfx_fb
loader: use term-drawrect for menu frame
ficl: add simple gfx words
uts: provide fb_info via fbgattr dev_specific array.
uts: gfx_private add alpha blending
uts: update sys/ascii.h
uts: tem OSC support (incomplete)
uts: implement env module support and use data from
uts: tem get colors from early boot data
loader: use crc32 from libstand (libz)
loader: optimize for size
loader: pass tem info to the environment
loader: import tem for loader console
loader: UEFI loader needs to set ISADIR based on
loader: need UEFI32 support
8918 loader.efi: add vesa edid support
uts: tem_safe_pix_clear_prom_output() should only
uts: tem_safe_pix_clear_entire_screen() should use
uts: tem_safe_check_first_time() should query cursor
uts: tem implement cls callback & visual_io v4
uts: gfx_vgatext use block cursor for vgatext
uts: gfx_private implement cls callback & visual_io
uts: gfx_private bitmap framebuffer implementation
uts: early start frame buffer console support
uts: font functions should check the input char
uts: font rendering should support 16/24/32bit depths
uts: use smallest font as fallback default.
uts: update terminal dimensions based on selected
7834 uts: vgatext should use gfx_private
uts: add spacing property to 8859-1.bdf
terminfo: add underline for sun-color
terminfo: sun-color has 16 colors
uts: add font load callback type
loader: do not repeat int13 calls with error 0x20 and
8905 loader: add skein/edonr support
8904 common/crypto: make skein and edonr loader
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/cmd/loadkeys/dumpkeys.c
+++ new/usr/src/cmd/loadkeys/dumpkeys.c
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License, Version 1.0 only
6 6 * (the "License"). You may not use this file except in compliance
7 7 * with the License.
8 8 *
9 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 * or http://www.opensolaris.org/os/licensing.
11 11 * See the License for the specific language governing permissions
|
↓ open down ↓ |
11 lines elided |
↑ open up ↑ |
12 12 * and limitations under the License.
13 13 *
14 14 * When distributing Covered Code, include this CDDL HEADER in each
15 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 * If applicable, add the following below this CDDL HEADER, with the
17 17 * fields enclosed by brackets "[]" replaced with your own identifying
18 18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 19 *
20 20 * CDDL HEADER END
21 21 */
22 -#ifndef lint
23 -#ident "%Z%%M% %I% %E% SMI"
24 -#endif
25 22
26 23 /*
27 24 * Copyright (c) 1988 by Sun Microsystems, Inc.
28 25 */
29 26
30 27 #include <sys/types.h>
31 28 #include <ctype.h>
32 29 #include <stdio.h>
33 30 #include <fcntl.h>
34 31 #include <sys/kbd.h>
35 32 #include <sys/kbio.h>
36 33 #include <errno.h>
37 34
38 35 typedef enum {
39 36 SM_INVALID, /* this shift mask is invalid for this keyboard */
40 37 SM_NORMAL, /* "normal", valid shift mask */
41 38 SM_NUMLOCK, /* "Num Lock" shift mask */
42 39 SM_UP /* "Up" shift mask */
43 40 } smtype_t;
44 41
45 42 typedef struct {
46 43 char *sm_name;
47 44 int sm_mask;
48 45 smtype_t sm_type;
49 46 } smentry_t;
50 47
51 48
52 49 smentry_t shiftmasks[] = {
53 50 { "base", 0, SM_NORMAL },
54 51 { "shift", SHIFTMASK, SM_NORMAL },
55 52 { "caps", CAPSMASK, SM_NORMAL },
56 53 { "ctrl", CTRLMASK, SM_NORMAL },
57 54 { "altg", ALTGRAPHMASK, SM_NORMAL },
58 55 { "numl", NUMLOCKMASK, SM_NUMLOCK },
|
↓ open down ↓ |
24 lines elided |
↑ open up ↑ |
59 56 { "up", UPMASK, SM_UP },
60 57 };
61 58
62 59 #define NSHIFTS (sizeof (shiftmasks) / sizeof (shiftmasks[0]))
63 60
64 61 static void printentry(struct kiockeymap *kio);
65 62 static void printchar(int character, int delim);
66 63
67 64 /*ARGSUSED*/
68 65 int
69 -main(argc, argv)
70 - int argc;
71 - char **argv;
66 +main(int argc, char **argv)
72 67 {
73 68 register int kbdfd;
74 69 register int keystation;
75 70 register int shift;
76 71 int ktype;
77 72 struct kiockeymap keyentry[NSHIFTS];
78 73 register int allsame;
79 74
80 75 if ((kbdfd = open("/dev/kbd", O_WRONLY)) < 0) {
81 76 perror("dumpkeys: /dev/kbd");
82 77 return (1);
83 78 }
84 79 if (ioctl(kbdfd, KIOCTYPE, &ktype) < 0) {
85 80 perror("dumpkeys: ioctl(KIOCTYPE)");
86 81 return (1);
87 82 }
88 83 /* if no keyboard detected, or ascii terminal, exit silently */
89 84 if (ktype == KB_ASCII || ktype < 0)
90 85 exit(0);
91 86
92 87 /*
93 88 * See which shift masks are valid for this keyboard.
94 89 * We do that by trying to get the entry for keystation 0 and that
95 90 * shift mask; if the "ioctl" fails, we assume it's because the shift
96 91 * mask is invalid.
97 92 */
98 93 for (shift = 0; shift < NSHIFTS; shift++) {
99 94 keyentry[shift].kio_tablemask =
100 95 shiftmasks[shift].sm_mask;
101 96 keyentry[shift].kio_station = 0;
102 97 if (ioctl(kbdfd, KIOCGKEY, &keyentry[shift]) < 0)
103 98 shiftmasks[shift].sm_type = SM_INVALID;
104 99 }
105 100
106 101 /*
107 102 * Loop until we get an EINVAL, so we don't have to know
108 103 * how big the table might be.
109 104 */
110 105 for (keystation = 0; ; keystation++) {
111 106 for (shift = 0; shift < NSHIFTS; shift++) {
112 107 if (shiftmasks[shift].sm_type != SM_INVALID) {
113 108 keyentry[shift].kio_tablemask =
114 109 shiftmasks[shift].sm_mask;
115 110 keyentry[shift].kio_station = keystation;
116 111 if (ioctl(kbdfd, KIOCGKEY,
117 112 &keyentry[shift]) < 0) {
118 113 if (errno == EINVAL)
119 114 return (0);
120 115 perror("dumpkeys: KIOCGKEY");
121 116 return (1);
122 117 }
123 118 }
124 119 }
125 120
126 121 (void) printf("key %d\t", keystation);
127 122
128 123 /*
129 124 * See if all the "normal" entries (all but the Num Lock and Up
130 125 * entries) are the same.
131 126 */
132 127 allsame = 1;
133 128 for (shift = 1; shift < NSHIFTS; shift++) {
134 129 if (shiftmasks[shift].sm_type == SM_NORMAL) {
135 130 if (keyentry[0].kio_entry
136 131 != keyentry[shift].kio_entry) {
137 132 allsame = 0;
138 133 break;
139 134 }
140 135 }
141 136 }
142 137
143 138 if (allsame) {
144 139 /*
145 140 * All of the "normal" entries are the same; just print
146 141 * "all".
147 142 */
148 143 (void) printf(" all ");
149 144 printentry(&keyentry[0]);
150 145 } else {
151 146 /*
152 147 * The normal entries aren't all the same; print them
153 148 * individually.
154 149 */
155 150 for (shift = 0; shift < NSHIFTS; shift++) {
156 151 if (shiftmasks[shift].sm_type == SM_NORMAL) {
157 152 (void) printf(" %s ",
158 153 shiftmasks[shift].sm_name);
159 154 printentry(&keyentry[shift]);
160 155 }
161 156 }
162 157 }
163 158 if (allsame && keyentry[0].kio_entry == HOLE) {
164 159 /*
165 160 * This key is a "hole"; if either the Num Lock or Up
166 161 * entry isn't a "hole", print it.
167 162 */
168 163 for (shift = 0; shift < NSHIFTS; shift++) {
169 164 switch (shiftmasks[shift].sm_type) {
170 165
171 166 case SM_NUMLOCK:
172 167 case SM_UP:
173 168 if (keyentry[shift].kio_entry
174 169 != HOLE) {
175 170 (void) printf(" %s ",
176 171 shiftmasks[shift].sm_name);
177 172 printentry(&keyentry[shift]);
178 173 }
179 174 break;
180 175 }
181 176 }
182 177 } else {
183 178 /*
184 179 * This entry isn't a "hole"; if the Num Lock entry
185 180 * isn't NONL (i.e, if Num Lock actually does
186 181 * something) print it, and if the Up entry isn't NOP
187 182 * (i.e., if up transitions on this key actually do
188 183 * something) print it.
189 184 */
190 185 for (shift = 0; shift < NSHIFTS; shift++) {
191 186 switch (shiftmasks[shift].sm_type) {
192 187
193 188 case SM_NUMLOCK:
194 189 if (keyentry[shift].kio_entry
195 190 != NONL) {
196 191 (void) printf(" %s ",
197 192 shiftmasks[shift].sm_name);
198 193 printentry(&keyentry[shift]);
199 194 }
200 195 break;
201 196
202 197 case SM_UP:
203 198 if (keyentry[shift].kio_entry
204 199 != NOP) {
205 200 (void) printf(" %s ",
206 201 shiftmasks[shift].sm_name);
207 202 printentry(&keyentry[shift]);
208 203 }
209 204 break;
210 205 }
211 206 }
212 207 }
213 208 (void) printf("\n");
214 209 }
215 210 }
216 211
217 212 static char *shiftkeys[] = {
218 213 "capslock",
219 214 "shiftlock",
220 215 "leftshift",
221 216 "rightshift",
222 217 "leftctrl",
223 218 "rightctrl",
224 219 "meta", /* not used */
225 220 "top", /* not used */
226 221 "cmd", /* reserved */
227 222 "altgraph",
228 223 "alt",
229 224 "numlock",
230 225 };
231 226
232 227 #define NSHIFTKEYS (sizeof (shiftkeys) / sizeof (shiftkeys[0]))
233 228
234 229 static char *buckybits[] = {
|
↓ open down ↓ |
153 lines elided |
↑ open up ↑ |
235 230 "metabit",
236 231 "systembit",
237 232 };
238 233
239 234 #define NBUCKYBITS (sizeof (buckybits) / sizeof (buckybits[0]))
240 235
241 236 static char *funnies[] = {
242 237 "nop",
243 238 "oops",
244 239 "hole",
240 + "", /* not used */
241 + "", /* not used */
242 + "", /* not used */
245 243 "reset",
246 244 "error",
247 245 "idle",
248 246 "compose",
249 247 "nonl",
250 248 };
251 249
252 250 #define NFUNNIES (sizeof (funnies) / sizeof (funnies[0]))
253 251
254 252 static char *fa_class[] = {
255 253 "fa_umlaut",
256 254 "fa_cflex",
257 255 "fa_tilde",
258 256 "fa_cedilla",
259 257 "fa_acute",
260 258 "fa_grave",
259 + "fa_macron",
260 + "fa_breve",
261 + "fa_dot",
262 + "fa_slash",
263 + "fa_ring",
264 + "fa_apostrophe",
265 + "fa_dacute",
266 + "fa_ogonek",
267 + "fa_caron"
261 268 };
262 269
263 270 #define NFA_CLASS (sizeof (fa_class) / sizeof (fa_class[0]))
264 271
265 272 typedef struct {
266 273 char *string;
267 274 char *name;
268 275 } builtin_string_t;
269 276
270 277 builtin_string_t builtin_strings[] = {
271 278 { "\033[H", "homearrow" },
272 279 { "\033[A", "uparrow" },
273 280 { "\033[B", "downarrow" },
274 281 { "\033[D", "leftarrow" },
275 282 { "\033[C", "rightarrow" },
276 283 };
277 284
278 285 #define NBUILTIN_STRINGS (sizeof (builtin_strings) / \
279 286 sizeof (builtin_strings[0]))
280 287
281 288 static char *fkeysets[] = {
282 289 "lf",
283 290 "rf",
284 291 "tf",
285 292 "bf",
286 293 };
287 294
288 295 #define NFKEYSETS (sizeof (fkeysets) / sizeof (fkeysets[0]))
289 296
290 297 static char *padkeys[] = {
291 298 "padequal",
292 299 "padslash",
293 300 "padstar",
294 301 "padminus",
295 302 "padsep",
296 303 "pad7",
297 304 "pad8",
298 305 "pad9",
299 306 "padplus",
300 307 "pad4",
301 308 "pad5",
302 309 "pad6",
303 310 "pad1",
|
↓ open down ↓ |
33 lines elided |
↑ open up ↑ |
304 311 "pad2",
305 312 "pad3",
306 313 "pad0",
307 314 "paddot",
308 315 "padenter",
309 316 };
310 317
311 318 #define NPADKEYS (sizeof (padkeys) / sizeof (padkeys[0]))
312 319
313 320 static void
314 -printentry(kio)
315 - register struct kiockeymap *kio;
321 +printentry(struct kiockeymap *kio)
316 322 {
317 - register int entry = (kio->kio_entry & 0x1F);
318 - register int fkeyset;
319 - register int i;
320 - register int c;
323 + int entry = (kio->kio_entry & 0x1F);
324 + int fkeyset;
325 + int i;
326 + int c;
321 327
322 - switch (kio->kio_entry >> 8) {
328 + switch (KEYFLAGS(kio->kio_entry)) {
323 329
324 330 case 0x0:
325 331 if (kio->kio_entry == '"')
326 332 (void) printf("'\"'"); /* special case */
327 333 else if (kio->kio_entry == ' ')
328 334 (void) printf("' '"); /* special case */
329 335 else
330 336 printchar((int)kio->kio_entry, '\'');
331 337 break;
332 338
333 - case SHIFTKEYS >> 8:
339 + case SHIFTKEYS:
334 340 if (entry < NSHIFTKEYS)
335 341 (void) printf("shiftkeys+%s", shiftkeys[entry]);
336 342 else
337 343 (void) printf("%#4x", kio->kio_entry);
338 344 break;
339 345
340 - case BUCKYBITS >> 8:
346 + case BUCKYBITS:
341 347 if (entry < NBUCKYBITS)
342 348 (void) printf("buckybits+%s", buckybits[entry]);
343 349 else
344 350 (void) printf("%#4x", kio->kio_entry);
345 351 break;
346 352
347 - case FUNNY >> 8:
353 + case FUNNY:
348 354 if (entry < NFUNNIES)
349 355 (void) printf("%s", funnies[entry]);
350 356 else
351 357 (void) printf("%#4x", kio->kio_entry);
352 358 break;
353 359
354 - case FA_CLASS >> 8:
360 + case FA_CLASS:
355 361 if (entry < NFA_CLASS)
356 362 (void) printf("%s", fa_class[entry]);
357 363 else
358 364 (void) printf("%#4x", kio->kio_entry);
359 365 break;
360 366
361 - case STRING >> 8:
367 + case STRING:
362 368 if (entry < NBUILTIN_STRINGS && strncmp(kio->kio_string,
363 - builtin_strings[entry].string, KTAB_STRLEN) == 0)
369 + builtin_strings[entry].string, KTAB_STRLEN) == 0)
364 370 (void) printf("string+%s", builtin_strings[entry].name);
365 371 else {
366 372 (void) printf("\"");
367 373 for (i = 0;
368 374 i < KTAB_STRLEN && (c = kio->kio_string[i]) != '\0';
369 375 i++)
370 376 printchar(c, '"');
371 377 (void) printf("\"");
372 378 }
373 379 break;
374 380
375 - case FUNCKEYS >> 8:
381 + case FUNCKEYS:
376 382 fkeyset = (int)(kio->kio_entry & 0xF0) >> 4;
377 383 if (fkeyset < NFKEYSETS)
378 384 (void) printf("%s(%d)", fkeysets[fkeyset],
379 - (entry&0x0F) + 1);
385 + (entry & 0x0F) + 1);
380 386 else
381 387 (void) printf("%#4x", kio->kio_entry);
382 388 break;
383 389
384 - case PADKEYS >> 8:
390 + case PADKEYS:
385 391 if (entry < NPADKEYS)
386 392 (void) printf("%s", padkeys[entry]);
387 393 else
388 394 (void) printf("%#4x", kio->kio_entry);
389 395 break;
390 396
391 397 default:
392 398 (void) printf("%#4x", kio->kio_entry);
393 399 break;
394 400 }
395 401 }
396 402
397 403 static void
398 -printchar(character, delim)
399 - int character;
400 - int delim;
404 +printchar(int character, int delim)
401 405 {
402 406 switch (character) {
403 407
404 408 case '\n':
405 409 (void) printf("'\\n'");
406 410 break;
407 411
408 412 case '\t':
409 413 (void) printf("'\\t'");
410 414 break;
411 415
412 416 case '\b':
413 417 (void) printf("'\\b'");
414 418 break;
415 419
416 420 case '\r':
417 421 (void) printf("'\\r'");
418 422 break;
419 423
420 424 case '\v':
421 425 (void) printf("'\\v'");
422 426 break;
423 427
424 428 case '\\':
425 429 (void) printf("'\\\\'");
|
↓ open down ↓ |
15 lines elided |
↑ open up ↑ |
426 430 break;
427 431
428 432 default:
429 433 if (isprint(character)) {
430 434 if (character == delim)
431 435 (void) printf("'\\'");
432 436 (void) printf("%c", character);
433 437 } else {
434 438 if (character < 040)
435 439 (void) printf("^%c", character + 0100);
436 - else
440 + else if (character <= 0xff)
437 441 (void) printf("'\\%.3o'", character);
442 + else
443 + (void) printf("%#4x", character);
438 444 }
439 445 break;
440 446 }
441 447 }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX