Lines 65-70
Link Here
|
65 |
static void do_constant_key (int, u_short); |
65 |
static void do_constant_key (int, u_short); |
66 |
static void loadkeys(char *console, int *warned); |
66 |
static void loadkeys(char *console, int *warned); |
67 |
static void mktable(void); |
67 |
static void mktable(void); |
|
|
68 |
static void bkeymap(void); |
68 |
static void strings_as_usual(void); |
69 |
static void strings_as_usual(void); |
69 |
/* static void keypad_as_usual(char *keyboard); */ |
70 |
/* static void keypad_as_usual(char *keyboard); */ |
70 |
/* static void function_keys_as_usual(char *keyboard); */ |
71 |
/* static void function_keys_as_usual(char *keyboard); */ |
Lines 252-257
Link Here
|
252 |
"\n" |
253 |
"\n" |
253 |
"valid options are:\n" |
254 |
"valid options are:\n" |
254 |
"\n" |
255 |
"\n" |
|
|
256 |
" -b --bkeymap output a binary keymap to stdout\n" |
255 |
" -c --clearcompose clear kernel compose table\n" |
257 |
" -c --clearcompose clear kernel compose table\n" |
256 |
" -C <cons1,cons2,...>\n" |
258 |
" -C <cons1,cons2,...>\n" |
257 |
" --console=<...> Indicate console device(s) to be used.\n" |
259 |
" --console=<...> Indicate console device(s) to be used.\n" |
Lines 265-270
Link Here
|
265 |
} |
267 |
} |
266 |
|
268 |
|
267 |
char **args; |
269 |
char **args; |
|
|
270 |
int optb = 0; |
268 |
int optd = 0; |
271 |
int optd = 0; |
269 |
int optm = 0; |
272 |
int optm = 0; |
270 |
int opts = 0; |
273 |
int opts = 0; |
Lines 274-281
Link Here
|
274 |
|
277 |
|
275 |
int |
278 |
int |
276 |
main(unsigned int argc, char *argv[]) { |
279 |
main(unsigned int argc, char *argv[]) { |
277 |
const char *short_opts = "cC:dhmsuqvV"; |
280 |
const char *short_opts = "bcC:dhmsuqvV"; |
278 |
const struct option long_opts[] = { |
281 |
const struct option long_opts[] = { |
|
|
282 |
{ "bkeymap", no_argument, NULL, 'b' }, |
279 |
{ "clearcompose", no_argument, NULL, 'c' }, |
283 |
{ "clearcompose", no_argument, NULL, 'c' }, |
280 |
{ "console", 1, NULL, 'C' }, |
284 |
{ "console", 1, NULL, 'C' }, |
281 |
{ "default", no_argument, NULL, 'd' }, |
285 |
{ "default", no_argument, NULL, 'd' }, |
Lines 297-302
Link Here
|
297 |
while ((c = getopt_long(argc, argv, |
301 |
while ((c = getopt_long(argc, argv, |
298 |
short_opts, long_opts, NULL)) != -1) { |
302 |
short_opts, long_opts, NULL)) != -1) { |
299 |
switch (c) { |
303 |
switch (c) { |
|
|
304 |
case 'b': |
305 |
optb = 1; |
306 |
break; |
300 |
case 'c': |
307 |
case 'c': |
301 |
nocompose = 1; |
308 |
nocompose = 1; |
302 |
break; |
309 |
break; |
Lines 339-347
Link Here
|
339 |
exit(1); |
346 |
exit(1); |
340 |
} |
347 |
} |
341 |
do_constant(); |
348 |
do_constant(); |
342 |
if(optm) |
349 |
if(optb) { |
|
|
350 |
bkeymap(); |
351 |
} else if(optm) { |
343 |
mktable(); |
352 |
mktable(); |
344 |
else if (console) |
353 |
} else if (console) |
345 |
{ |
354 |
{ |
346 |
char *buf = strdup(console); /* make writable */ |
355 |
char *buf = strdup(console); /* make writable */ |
347 |
char *e, *s = buf; |
356 |
char *e, *s = buf; |
Lines 1263-1265
Link Here
|
1263 |
|
1272 |
|
1264 |
exit(0); |
1273 |
exit(0); |
1265 |
} |
1274 |
} |
|
|
1275 |
|
1276 |
static void |
1277 |
bkeymap () { |
1278 |
int i, j; |
1279 |
|
1280 |
u_char *p; |
1281 |
char flag, magic[] = "bkeymap"; |
1282 |
unsigned short v; |
1283 |
|
1284 |
write(1, magic, 7); |
1285 |
for (i = 0; i < MAX_NR_KEYMAPS; i++) { |
1286 |
flag = key_map[i]? 1 : 0; |
1287 |
write(1, &flag, 1); |
1288 |
} |
1289 |
for (i = 0; i < MAX_NR_KEYMAPS; i++) { |
1290 |
if (key_map[i]) { |
1291 |
for (j = 0; j < NR_KEYS / 2; j++) { |
1292 |
v = key_map[i][j]; |
1293 |
write(1, &v, 2); |
1294 |
} |
1295 |
} |
1296 |
} |
1297 |
exit(0); |
1298 |
} |
1299 |
|