Codebase list kbd / 7dd1a61
Drop klibc support Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com> Alexey Gladkov 13 years ago
33 changed file(s) with 88 addition(s) and 297 deletion(s). Raw diff Collapse all Expand all
99 AM_INIT_AUTOMAKE([1.9 -Wall])
1010 AC_CONFIG_SRCDIR([src/loadkeys.y])
1111 AC_CONFIG_HEADERS(config.h)
12
13 AC_CHECK_KLIBC
1412
1513 # Checks for programs.
1614 AC_PROG_YACC
+0
-96
m4/klibc.m4 less more
0 # klibc.m4 serial 99
1 ## Copyright (C) 1995-2003 Free Software Foundation, Inc.
2 ## This file is free software, distributed under the terms of the GNU
3 ## General Public License. As a special exception to the GNU General
4 ## Public License, this file may be distributed as part of a program
5 ## that contains a configuration script generated by Autoconf, under
6 ## the same distribution terms as the rest of that program.
7 ##
8 ## This file can can be used in projects which are not available under
9 ## the GNU General Public License or the GNU Library General Public
10 ## License but which still want to provide support for the GNU gettext
11 ## functionality.
12 ## Please note that the actual code of the KLIBC Library is partly covered
13 ## by the GNU Library General Public License, and party copyrighted by the
14 ## Regents of The University of California, and the rest is covered by a
15 ## MIT style license.
16
17 # Authors:
18 # Martin Schlemmer <azarah@nosferatu.za.org>, 2005.
19
20
21 # AC_CHECK_KLIBC
22 # --------------
23 # Check if the user wants KLIBC support enabled. If so, set KLIBC=yes and
24 # fill in KLIBC_PREFIX, KLIBC_BINDIR, KLIBC_SBINDIR, KLIBC_LIBDIR and
25 # KLIBC_INCLUDEDIR. CC is also set to the proper klcc executable.
26 # NOTE: This should be called before AC_PROG_CC, and before header, function
27 # or type checks.
28 AC_DEFUN([AC_CHECK_KLIBC],
29 [AC_BEFORE([$0], [AC_PROG_CC])
30 AC_REQUIRE([AC_CANONICAL_HOST])
31 AC_ARG_ENABLE([klibc],
32 [AS_HELP_STRING([--enable-klibc],
33 [Enable linking to klibc [no]. You need at
34 least klibc-1.0 or later for this. Set KLCC
35 to the absolute file name of klcc if not in
36 the PATH])],
37 [KLIBC=$enableval], [KLIBC=no])
38 AC_ARG_ENABLE([klibc-layout],
39 [AS_HELP_STRING([--enable-klibc-layout],
40 [Enable installing binaries, libraries and
41 headers into the klibc prefix [yes] ])],
42 [if test "X$KLIBC" != Xno; then
43 KLIBC_LAYOUT=$enableval
44 else
45 KLIBC_LAYOUT=no
46 fi],
47 [if test "X$KLIBC" != Xno; then
48 KLIBC_LAYOUT=yes
49 else
50 KLIBC_LAYOUT=no
51 fi])
52
53 if test "X$KLIBC" != Xno; then
54 # Basic cross compiling support. I do not think it is wise to use
55 # AC_CHECK_TOOL, because if we are cross compiling, we do not want
56 # just 'klcc' to be returned ...
57 if test "${host_alias}" != "${build_alias}"; then
58 AC_CHECK_PROGS([KLCC], [${host_alias}-klcc], [no])
59 else
60 AC_CHECK_PROGS([KLCC], [klcc], [no])
61 fi
62 if test "X$KLCC" = Xno; then
63 AC_MSG_ERROR([cannot find klibc frontend 'klcc'!])
64 fi
65
66 CC="$KLCC"
67 CFLAGS="-Os -D__klibc__"
68 #AC_DEFINE(__klibc__, 1, [Enable linking to klibc])
69
70 KLIBC_KCROSS="$($KLCC -print-klibc-kcross 2>/dev/null)"
71 KLIBC_PREFIX="$($KLCC -print-klibc-prefix 2>/dev/null)"
72 KLIBC_BIN_DIR="$($KLCC -print-klibc-bindir 2>/dev/null)"
73 KLIBC_SBIN_DIR="${KLIBC_PREFIX}/${KLIBC_KCROSS}sbin"
74 KLIBC_LIB_DIR="$($KLCC -print-klibc-libdir 2>/dev/null)"
75 KLIBC_INCLUDE_DIR="$($KLCC -print-klibc-includedir 2>/dev/null)"
76
77 if test "X$KLIBC_LAYOUT" != Xno; then
78 prefix="$KLIBC_PREFIX"
79 bindir="$KLIBC_BIN_DIR"
80 sbindir="$KLIBC_SBIN_DIR"
81 libdir="$KLIBC_LIB_DIR"
82 includedir="$KLIBC_INCLUDE_DIR"
83 fi
84
85 # At least KLIBC_LIB_DIR should be valid, else klibc is too old or
86 # something went wrong
87 if test ! -d "$KLIBC_LIB_DIR"; then
88 AC_MSG_ERROR([your klibc installation is too old or not functional!])
89 fi
90 fi
91
92 AC_SUBST(KLIBC)
93 AM_CONDITIONAL(KLIBC, test "$KLIBC" != "no")
94 ])# AC_CHECK_KLIBC
95
77 OLDPROGS = mapscrn loadunimap
88 PROGS = \
99 dumpkeys loadkeys showkey setfont showconsolefont \
10 setleds setmetamode kbd_mode psfxtable fgconsole
11
12 if !KLIBC
13 PROGS += kbdrate chvt deallocvt openvt
14 endif
10 setleds setmetamode kbd_mode psfxtable fgconsole \
11 kbdrate chvt deallocvt openvt
1512
1613 if KEYCODES_PROGS
1714 PROGS += getkeycodes setkeycodes
2320
2421 if OPTIONAL_PROGS
2522 PROGS += \
26 setlogcons setvesablank getunimap clrunimap outpsfheader setpalette
27
28 if !KLIBC
29 PROGS += screendump spawn_console spawn_login
30 endif
23 setlogcons setvesablank getunimap clrunimap outpsfheader setpalette \
24 screendump spawn_console spawn_login
3125 endif
3226
3327 dist_bin_SCRIPTS = unicode_start unicode_stop
4842 UTF8_S = utf8.c utf8.h
4943 XMAL_S = xmalloc.c xmalloc.h
5044
51 if KLIBC
52 KLIBC_S = klibc_compat.c klibc_compat.h
53 endif
54
5545 chvt_SOURCES = $(ALL_S) chvt.c $(GETFD_S)
5646 clrunimap_SOURCES = $(ALL_S) clrunimap.c $(GETFD_S) $(KDMA_S)
5747 deallocvt_SOURCES = $(ALL_S) deallocvt.c $(GETFD_S)
6050 getkeycodes_SOURCES = $(ALL_S) getkeycodes.c $(GETFD_S)
6151 getunimap_SOURCES = $(ALL_S) getunimap.c $(GETFD_S) $(KDMA_S)
6252 kbd_mode_SOURCES = $(ALL_S) kbd_mode.c $(GETFD_S)
63 loadkeys_SOURCES = $(ALL_S) loadkeys.y $(GETFD_S) $(KSYMS_S) $(XMAL_S) $(FIND_S) $(KLIBC_S)
64 loadunimap_SOURCES = $(ALL_S) loadunimap.c $(FIND_S) $(PSF_S) $(UTF8_S) $(XMAL_S) $(GETFD_S) $(KDMA_S) $(KLIBC_S)
53 loadkeys_SOURCES = $(ALL_S) loadkeys.y $(GETFD_S) $(KSYMS_S) $(XMAL_S) $(FIND_S)
54 loadunimap_SOURCES = $(ALL_S) loadunimap.c $(FIND_S) $(PSF_S) $(UTF8_S) $(XMAL_S) $(GETFD_S) $(KDMA_S)
6555 mapscrn_SOURCES = $(ALL_S) mapscrn.c $(FIND_S) $(UTF8_S) $(XMAL_S) $(GETFD_S) $(KDMA_S)
6656 openvt_SOURCES = $(ALL_S) openvt.c openvt.h $(GETFD_S)
67 psfxtable_SOURCES = $(ALL_S) psfxtable.c $(PSF_S) $(XMAL_S) $(UTF8_S) $(GETFD_S) $(KLIBC_S)
57 psfxtable_SOURCES = $(ALL_S) psfxtable.c $(PSF_S) $(XMAL_S) $(UTF8_S) $(GETFD_S)
6858 resizecons_SOURCES = $(ALL_S) resizecons.c $(GETFD_S) $(FIND_S) $(XMAL_S)
6959 screendump_SOURCES = $(ALL_S) screendump.c $(XMAL_S)
70 setfont_SOURCES = $(ALL_S) setfont.c $(FIND_S) $(XMAL_S) $(GETFD_S) mapscrn.c $(KDMA_S) $(PSF_S) $(UTF8_S) kdfontop.c kdfontop.h $(UNIM_S) $(KLIBC_S)
60 setfont_SOURCES = $(ALL_S) setfont.c $(FIND_S) $(XMAL_S) $(GETFD_S) mapscrn.c $(KDMA_S) $(PSF_S) $(UTF8_S) kdfontop.c kdfontop.h $(UNIM_S)
7161 setkeycodes_SOURCES = $(ALL_S) setkeycodes.c $(GETFD_S)
7262 setlogcons_SOURCES = $(ALL_S) setlogcons.c $(GETFD_S)
7363 setpalette_SOURCES = $(ALL_S) setpalette.c $(GETFD_S)
7464 setvesablank_SOURCES = $(ALL_S) setvesablank.c $(GETFD_S)
7565 showconsolefont_SOURCES = $(ALL_S) showconsolefont.c $(GETFD_S) $(XMAL_S) $(KDMA_S) kdfontop.c kdfontop.h
76 showkey_SOURCES = $(ALL_S) showkey.c $(GETFD_S) $(KLIBC_S)
66 showkey_SOURCES = $(ALL_S) showkey.c $(GETFD_S)
7767
7868 mapscrn_CFLAGS = -DMAIN
7969 loadunimap_CFLAGS = -DMAIN
804804 #include "ksyms.h"
805805 #include "kbd.h"
806806 #include "xmalloc.h"
807 #ifdef __klibc__
808 #include "klibc_compat.h"
809 #endif
810807
811808 extern int line_nr;
812809 int yylval;
77 #include "ksyms.h"
88 #include "kbd.h"
99 #include "xmalloc.h"
10 #ifdef __klibc__
11 #include "klibc_compat.h"
12 #endif
1310
1411 extern int line_nr;
1512 int yylval;
1717 int fd;
1818 char *console = NULL;
1919
20 #ifndef __klibc__
2120 setlocale(LC_ALL, "");
2221 bindtextdomain(PACKAGE_NAME, LOCALEDIR);
2322 textdomain(PACKAGE_NAME);
24 #endif
2523
2624 if (argc >= 3 && !strcmp(argv[1], "-C"))
2725 console = argv[2];
602602 char diac_only = 0;
603603
604604 set_progname(argv[0]);
605 #ifndef __klibc__
605
606606 setlocale(LC_ALL, "");
607607 bindtextdomain(PACKAGE_NAME, LOCALEDIR);
608608 textdomain(PACKAGE_NAME);
609 #endif
610609
611610 while ((c = getopt_long(argc, argv,
612611 short_opts, long_opts, NULL)) != -1) {
3737 { "next-available", no_argument, NULL, 'n' },
3838 { NULL, 0, NULL, 0 } };
3939
40 #ifndef __klibc__
4140 setlocale(LC_ALL, "");
4241 bindtextdomain(PACKAGE_NAME, LOCALEDIR);
4342 textdomain(PACKAGE_NAME);
44 #endif
4543
4644 set_progname(argv[0]);
4745 while (( c = getopt_long (argc, argv, "Vhn", long_opts, NULL)) != EOF) {
1212 static int ispipe;
1313
1414 void fpclose(FILE *fp) {
15 #ifndef __klibc__
1615 if (ispipe)
1716 pclose(fp);
1817 else
19 #endif /* __klibc__ */
2018 fclose(fp);
2119 }
2220
2321 #define SIZE(a) (sizeof(a)/sizeof(a[0]))
2422
25 #ifndef __klibc__
2623 static struct decompressor {
2724 char *ext; /* starts with `.', has no other dots */
2825 char *cmd;
4542 fprintf(stderr, _("error executing %s\n"), pipe_cmd);
4643 return fp;
4744 }
48 #endif /* __klibc__ */
4945
5046 /* If a file PATHNAME exists, then open it.
5147 If is has a `compressed' extension, then open a pipe reading it */
5248 static FILE *
5349 maybe_pipe_open(void) {
5450 FILE *fp;
55 #ifndef __klibc__
5651 char *t;
5752 struct decompressor *dc;
5853
6661 }
6762 }
6863 }
69 #else
70 fp = fopen(pathname, "r");
71 #endif /* __klibc__ */
7264 return fp;
7365 }
7466
7870 DIR *d;
7971 struct dirent *de;
8072 char *ff, *fdir, *p, *q, **sp;
81 #ifndef __klibc__
8273 struct decompressor *dc;
83 #endif /* __klibc__ */
8474 int secondpass = 0;
8575
8676 ispipe = 0;
151141 /* Does tail consist of a known suffix and possibly
152142 a compression suffix? */
153143 for(sp = suf; *sp; sp++) {
154 #ifndef __klibc__
155144 int l;
156 #endif /* __klibc__ */
157145
158146 if (!strcmp(p, *sp))
159147 return maybe_pipe_open();
160148
161 #ifndef __klibc__
162149 l = strlen(*sp);
163150 if (strncmp(p,*sp,l) == 0) {
164151 for (dc = &decompressors[0]; dc->cmd; dc++)
165152 if (strcmp(p+l, dc->ext) == 0)
166153 return pipe_open(dc);
167154 }
168 #endif /* __klibc__ */
169155 }
170156 }
171157 closedir(d);
181167 char **dp, *dir, **sp;
182168 FILE *fp;
183169 int dl, recdepth;
184 #ifndef __klibc__
185170 struct decompressor *dc;
186 #endif /* __klibc__ */
187171
188172 if (strlen(fnam) >= sizeof(pathname))
189173 return NULL;
210194 return fp;
211195 }
212196
213 #ifndef __klibc__
214197 for (sp = suffixes; *sp; sp++) {
215198 for (dc = &decompressors[0]; dc->cmd; dc++) {
216199 if (strlen(fnam) + strlen(*sp)
225208 }
226209 }
227210 }
228 #endif /* __klibc__ */
229211
230212 return NULL;
231213 }
2626 int old_kernel = 0;
2727
2828 set_progname(argv[0]);
29 #ifndef __klibc__
29
3030 setlocale(LC_ALL, "");
3131 bindtextdomain(PACKAGE_NAME, LOCALEDIR);
3232 textdomain(PACKAGE_NAME);
33 #endif
3433
3534 if (argc == 2 && !strcmp(argv[1], "-V"))
3635 print_version_and_exit();
3939 struct unimapdesc ud;
4040
4141 set_progname(argv[0]);
42 #ifndef __klibc__
42
4343 setlocale(LC_ALL, "");
4444 bindtextdomain(PACKAGE_NAME, LOCALEDIR);
4545 textdomain(PACKAGE_NAME);
46 #endif
4746
4847 if (argc == 2 &&
4948 (!strcmp(argv[1], "-V") || !strcmp(argv[1], "--version")))
2626 char *console = NULL;
2727
2828 set_progname(argv[0]);
29 #ifndef __klibc__
29
3030 setlocale(LC_ALL, "");
3131 bindtextdomain(PACKAGE_NAME, LOCALEDIR);
3232 textdomain(PACKAGE_NAME);
33 #endif
3433
3534 if (argc == 2 && !strcmp(argv[1], "-V"))
3635 print_version_and_exit();
+0
-28
src/klibc_compat.c less more
0 #include <stdio.h>
1 #include <errno.h>
2 #include "kbd.h"
3 #include "klibc_compat.h"
4
5 void clearerr(attr_unused FILE *stream) {
6 errno = 0;
7 }
8
9 void rewind(FILE *stream) {
10 (void)fseek(stream, 0L, SEEK_SET);
11 clearerr(stream);
12 }
13
14 int feof(attr_unused FILE *stream) {
15 return (errno == EOF);
16 }
17
18 int ferror(attr_unused FILE *stream) {
19 return (errno != 0 && errno != EOF);
20 }
21
22 int ungetc(int c, FILE *stream) {
23 if (fseek(stream, -1, SEEK_CUR) < 0)
24 return EOF;
25 else
26 return c;
27 }
+0
-16
src/klibc_compat.h less more
0 #ifdef __klibc__
1 #ifndef _KLIBC_COMPAT_H
2 #define _KLIBC_COMPAT_H
3
4 #include <malloc.h>
5
6 #define signal sysv_signal
7
8 extern void clearerr(FILE *stream);
9 extern void rewind(FILE *stream);
10 extern int feof(FILE *stream);
11 extern int ferror(FILE *stream);
12 extern int ungetc(int c, FILE *stream);
13
14 #endif
15 #endif /* __klibc__ */
0
1 /* A Bison parser, made by GNU Bison 2.4.1. */
0 /* A Bison parser, made by GNU Bison 2.4.3. */
21
32 /* Skeleton implementation for Bison's Yacc-like parsers in C
43
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 Free Software Foundation, Inc.
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
5 2009, 2010 Free Software Foundation, Inc.
76
87 This program is free software: you can redistribute it and/or modify
98 it under the terms of the GNU General Public License as published by
4544 #define YYBISON 1
4645
4746 /* Bison version. */
48 #define YYBISON_VERSION "2.4.1"
47 #define YYBISON_VERSION "2.4.3"
4948
5049 /* Skeleton name. */
5150 #define YYSKELETON_NAME "yacc.c"
162161
163162
164163 /* Line 189 of yacc.c */
165 #line 167 "loadkeys.c"
164 #line 166 "loadkeys.c"
166165
167166 /* Enabling traces. */
168167 #ifndef YYDEBUG
274273
275274
276275 /* Line 264 of yacc.c */
277 #line 279 "loadkeys.c"
276 #line 278 "loadkeys.c"
278277
279278 #ifdef short
280279 # undef short
324323 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
325324
326325 #ifndef YY_
327 # if YYENABLE_NLS
326 # if defined YYENABLE_NLS && YYENABLE_NLS
328327 # if ENABLE_NLS
329328 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
330329 # define YY_(msgid) dgettext ("bison-runtime", msgid)
748747
749748 /* Like YYERROR except do call yyerror. This remains here temporarily
750749 to ease the transition to the new meaning of YYERROR, for GCC.
751 Once GCC version 2 has supplanted version 1, this can go. */
750 Once GCC version 2 has supplanted version 1, this can go. However,
751 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
752 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
753 discussed. */
752754
753755 #define YYFAIL goto yyerrlab
756 #if defined YYFAIL
757 /* This is here to suppress warnings from the GCC cpp's
758 -Wunused-macros. Normally we don't worry about that warning, but
759 some users do, and we want to make it easy for users to remove
760 YYFAIL uses, which will produce warnings from Bison 2.5. */
761 #endif
754762
755763 #define YYRECOVERING() (!!yyerrstatus)
756764
807815 we won't break user code: when these are the locations we know. */
808816
809817 #ifndef YY_LOCATION_PRINT
810 # if YYLTYPE_IS_TRIVIAL
818 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
811819 # define YY_LOCATION_PRINT(File, Loc) \
812820 fprintf (File, "%d.%d-%d.%d", \
813821 (Loc).first_line, (Loc).first_column, \
15461554 {
15471555 case 14:
15481556
1549 /* Line 1455 of yacc.c */
1557 /* Line 1464 of yacc.c */
15501558 #line 121 "loadkeys.y"
15511559 {
15521560 set_charset((char *) kbs_buf.kb_string);
15551563
15561564 case 15:
15571565
1558 /* Line 1455 of yacc.c */
1566 /* Line 1464 of yacc.c */
15591567 #line 126 "loadkeys.y"
15601568 {
15611569 alt_is_meta = 1;
15641572
15651573 case 16:
15661574
1567 /* Line 1455 of yacc.c */
1575 /* Line 1464 of yacc.c */
15681576 #line 131 "loadkeys.y"
15691577 {
15701578 strings_as_usual();
15731581
15741582 case 17:
15751583
1576 /* Line 1455 of yacc.c */
1584 /* Line 1464 of yacc.c */
15771585 #line 136 "loadkeys.y"
15781586 {
15791587 compose_as_usual((char *) kbs_buf.kb_string);
15821590
15831591 case 18:
15841592
1585 /* Line 1455 of yacc.c */
1593 /* Line 1464 of yacc.c */
15861594 #line 140 "loadkeys.y"
15871595 {
15881596 compose_as_usual(0);
15911599
15921600 case 19:
15931601
1594 /* Line 1455 of yacc.c */
1602 /* Line 1464 of yacc.c */
15951603 #line 145 "loadkeys.y"
15961604 {
15971605 keymaps_line_seen = 1;
16001608
16011609 case 22:
16021610
1603 /* Line 1455 of yacc.c */
1611 /* Line 1464 of yacc.c */
16041612 #line 153 "loadkeys.y"
16051613 {
16061614 int i;
16111619
16121620 case 23:
16131621
1614 /* Line 1455 of yacc.c */
1622 /* Line 1464 of yacc.c */
16151623 #line 159 "loadkeys.y"
16161624 {
16171625 addmap((yyvsp[(1) - (1)]),1);
16201628
16211629 case 24:
16221630
1623 /* Line 1455 of yacc.c */
1631 /* Line 1464 of yacc.c */
16241632 #line 164 "loadkeys.y"
16251633 {
16261634 if (KTYP((yyvsp[(2) - (5)])) != KT_FN)
16331641
16341642 case 25:
16351643
1636 /* Line 1455 of yacc.c */
1644 /* Line 1464 of yacc.c */
16371645 #line 173 "loadkeys.y"
16381646 {
16391647 compose((yyvsp[(2) - (6)]), (yyvsp[(3) - (6)]), (yyvsp[(5) - (6)]));
16421650
16431651 case 26:
16441652
1645 /* Line 1455 of yacc.c */
1653 /* Line 1464 of yacc.c */
16461654 #line 177 "loadkeys.y"
16471655 {
16481656 compose((yyvsp[(2) - (6)]), (yyvsp[(3) - (6)]), (yyvsp[(5) - (6)]));
16511659
16521660 case 27:
16531661
1654 /* Line 1455 of yacc.c */
1662 /* Line 1464 of yacc.c */
16551663 #line 182 "loadkeys.y"
16561664 { (yyval) = (yyvsp[(1) - (1)]); }
16571665 break;
16581666
16591667 case 28:
16601668
1661 /* Line 1455 of yacc.c */
1669 /* Line 1464 of yacc.c */
16621670 #line 184 "loadkeys.y"
16631671 { (yyval) = (yyvsp[(1) - (1)]) ^ 0xf000; }
16641672 break;
16651673
16661674 case 29:
16671675
1668 /* Line 1455 of yacc.c */
1676 /* Line 1464 of yacc.c */
16691677 #line 186 "loadkeys.y"
16701678 { mod = 0; }
16711679 break;
16721680
16731681 case 30:
16741682
1675 /* Line 1455 of yacc.c */
1683 /* Line 1464 of yacc.c */
16761684 #line 188 "loadkeys.y"
16771685 {
16781686 addkey((yyvsp[(4) - (7)]), mod, (yyvsp[(6) - (7)]));
16811689
16821690 case 31:
16831691
1684 /* Line 1455 of yacc.c */
1692 /* Line 1464 of yacc.c */
16851693 #line 192 "loadkeys.y"
16861694 {
16871695 addkey((yyvsp[(3) - (6)]), 0, (yyvsp[(5) - (6)]));
16901698
16911699 case 34:
16921700
1693 /* Line 1455 of yacc.c */
1701 /* Line 1464 of yacc.c */
16941702 #line 199 "loadkeys.y"
16951703 { mod |= M_SHIFT; }
16961704 break;
16971705
16981706 case 35:
16991707
1700 /* Line 1455 of yacc.c */
1708 /* Line 1464 of yacc.c */
17011709 #line 200 "loadkeys.y"
17021710 { mod |= M_CTRL; }
17031711 break;
17041712
17051713 case 36:
17061714
1707 /* Line 1455 of yacc.c */
1715 /* Line 1464 of yacc.c */
17081716 #line 201 "loadkeys.y"
17091717 { mod |= M_ALT; }
17101718 break;
17111719
17121720 case 37:
17131721
1714 /* Line 1455 of yacc.c */
1722 /* Line 1464 of yacc.c */
17151723 #line 202 "loadkeys.y"
17161724 { mod |= M_ALTGR; }
17171725 break;
17181726
17191727 case 38:
17201728
1721 /* Line 1455 of yacc.c */
1729 /* Line 1464 of yacc.c */
17221730 #line 203 "loadkeys.y"
17231731 { mod |= M_SHIFTL; }
17241732 break;
17251733
17261734 case 39:
17271735
1728 /* Line 1455 of yacc.c */
1736 /* Line 1464 of yacc.c */
17291737 #line 204 "loadkeys.y"
17301738 { mod |= M_SHIFTR; }
17311739 break;
17321740
17331741 case 40:
17341742
1735 /* Line 1455 of yacc.c */
1743 /* Line 1464 of yacc.c */
17361744 #line 205 "loadkeys.y"
17371745 { mod |= M_CTRLL; }
17381746 break;
17391747
17401748 case 41:
17411749
1742 /* Line 1455 of yacc.c */
1750 /* Line 1464 of yacc.c */
17431751 #line 206 "loadkeys.y"
17441752 { mod |= M_CTRLR; }
17451753 break;
17461754
17471755 case 42:
17481756
1749 /* Line 1455 of yacc.c */
1757 /* Line 1464 of yacc.c */
17501758 #line 207 "loadkeys.y"
17511759 { mod |= M_CAPSSHIFT; }
17521760 break;
17531761
17541762 case 43:
17551763
1756 /* Line 1455 of yacc.c */
1764 /* Line 1464 of yacc.c */
17571765 #line 210 "loadkeys.y"
17581766 {
17591767 int i, j;
17891797
17901798 case 46:
17911799
1792 /* Line 1455 of yacc.c */
1800 /* Line 1464 of yacc.c */
17931801 #line 246 "loadkeys.y"
17941802 {
17951803 if (rvalct >= MAX_NR_KEYMAPS)
18001808
18011809 case 47:
18021810
1803 /* Line 1455 of yacc.c */
1811 /* Line 1464 of yacc.c */
18041812 #line 253 "loadkeys.y"
18051813 {(yyval)=convert_code((yyvsp[(1) - (1)]), TO_AUTO);}
18061814 break;
18071815
18081816 case 48:
18091817
1810 /* Line 1455 of yacc.c */
1818 /* Line 1464 of yacc.c */
18111819 #line 255 "loadkeys.y"
18121820 {(yyval)=add_capslock((yyvsp[(2) - (2)]));}
18131821 break;
18141822
18151823 case 49:
18161824
1817 /* Line 1455 of yacc.c */
1825 /* Line 1464 of yacc.c */
18181826 #line 257 "loadkeys.y"
18191827 {(yyval)=convert_code((yyvsp[(1) - (1)])^0xf000, TO_AUTO);}
18201828 break;
18211829
18221830 case 50:
18231831
1824 /* Line 1455 of yacc.c */
1832 /* Line 1464 of yacc.c */
18251833 #line 259 "loadkeys.y"
18261834 {(yyval)=add_capslock((yyvsp[(2) - (2)])^0xf000);}
18271835 break;
18281836
18291837 case 51:
18301838
1831 /* Line 1455 of yacc.c */
1839 /* Line 1464 of yacc.c */
18321840 #line 261 "loadkeys.y"
18331841 {(yyval)=(yyvsp[(1) - (1)]);}
18341842 break;
18351843
18361844 case 52:
18371845
1838 /* Line 1455 of yacc.c */
1846 /* Line 1464 of yacc.c */
18391847 #line 263 "loadkeys.y"
18401848 {(yyval)=add_capslock((yyvsp[(2) - (2)]));}
18411849 break;
18421850
18431851
18441852
1845 /* Line 1455 of yacc.c */
1846 #line 1848 "loadkeys.c"
1853 /* Line 1464 of yacc.c */
1854 #line 1856 "loadkeys.c"
18471855 default: break;
18481856 }
18491857 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
20542062
20552063
20562064
2057 /* Line 1675 of yacc.c */
2065 /* Line 1684 of yacc.c */
20582066 #line 265 "loadkeys.y"
20592067
20602068
21192127 char *console = NULL;
21202128
21212129 set_progname(argv[0]);
2122 #ifndef __klibc__
2130
21232131 setlocale(LC_ALL, "");
21242132 bindtextdomain(PACKAGE_NAME, LOCALEDIR);
21252133 textdomain(PACKAGE_NAME);
2126 #endif
21272134
21282135 while ((c = getopt_long(argc, argv,
21292136 short_opts, long_opts, NULL)) != -1) {
21662173 }
21672174 }
21682175
2176 if (optu && opta) {
2177 fprintf(stderr, _("%s: Options --unicode and --ascii are mutually exclusive\n"),
2178 progname);
2179 exit(1);
2180 }
2181
21692182 prefer_unicode = optu;
21702183 if (!optm && !optb) {
21712184 /* check whether the keyboard is in Unicode mode */
29692982 exit(1);
29702983 } else {
29712984 struct ccc {
2972 char c1, c2, c3;
2985 unsigned char c1, c2, c3;
29732986 } def_latin1_composes[68] = {
29742987 { '`', 'A', 0300 }, { '`', 'a', 0340 },
29752988 { '\'', 'A', 0301 }, { '\'', 'a', 0341 },
324324 char *console = NULL;
325325
326326 set_progname(argv[0]);
327 #ifndef __klibc__
327
328328 setlocale(LC_ALL, "");
329329 bindtextdomain(PACKAGE_NAME, LOCALEDIR);
330330 textdomain(PACKAGE_NAME);
331 #endif
332331
333332 while ((c = getopt_long(argc, argv,
334333 short_opts, long_opts, NULL)) != -1) {
5151 char *infnam = "def.uni";
5252
5353 set_progname(argv[0]);
54 #ifndef __klibc__
54
5555 setlocale(LC_ALL, "");
5656 bindtextdomain(PACKAGE_NAME, LOCALEDIR);
5757 textdomain(PACKAGE_NAME);
58 #endif
5958
6059 if (argc == 2 &&
6160 (!strcmp(argv[1], "-V") || !strcmp(argv[1], "--version")))
33
44 #include <stdio.h>
55 #include <stdlib.h>
6 #ifndef __klibc__
76 #include <memory.h>
8 #endif
97 #include <string.h>
108 #include <fcntl.h>
119 #include <sys/types.h>
4139 int fd;
4240
4341 set_progname(argv[0]);
44 #ifndef __klibc__
42
4543 setlocale(LC_ALL, "");
4644 bindtextdomain(PACKAGE_NAME, LOCALEDIR);
4745 textdomain(PACKAGE_NAME);
48 #endif
4946
5047 if (argc == 2 && !strcmp(argv[1], "-V"))
5148 print_version_and_exit();
44 #define LOCALEDIR "/usr/share/locale"
55 #endif
66
7 #ifndef __klibc__
87 #ifdef HAVE_LOCALE_H
98 # include <locale.h>
10 #endif
119 #endif
1210
1311 #ifdef ENABLE_NLS
1111 #include "psffontop.h"
1212 #include "utf8.h"
1313 #include "paths.h"
14
15 #ifdef __klibc__
16 #include "klibc_compat.h"
17 #endif
1814
1915 extern char *progname;
2016
237237 int inbuflth, fontbuflth;
238238
239239 set_progname(argv[0]);
240 #ifndef __klibc__
240
241241 setlocale(LC_ALL, "");
242242 bindtextdomain(PACKAGE_NAME, LOCALEDIR);
243243 textdomain(PACKAGE_NAME);
244 #endif
245244
246245 if (argc == 2 && !strcmp(argv[1], "-V"))
247246 print_version_and_exit();
119119 char *defaultfont;
120120
121121 set_progname(argv[0]);
122 #ifndef __klibc__
122
123123 setlocale(LC_ALL, "");
124124 bindtextdomain(PACKAGE_NAME, LOCALEDIR);
125125 textdomain(PACKAGE_NAME);
126 #endif
127126
128127 if (argc < 2)
129128 usage();
1010 */
1111
1212 #include <stdio.h>
13 #ifndef __klibc__
1413 #include <memory.h>
15 #endif
1614 #include <fcntl.h>
1715 #include <stdlib.h>
1816 #include <unistd.h>
109107 int restore = 0;
110108
111109 set_progname(argv[0]);
112 #ifndef __klibc__
110
113111 setlocale(LC_ALL, "");
114112 bindtextdomain(PACKAGE_NAME, LOCALEDIR);
115113 textdomain(PACKAGE_NAME);
116 #endif
117114
118115 ifiles[0] = mfil = ufil = Ofil = ofil = omfil = oufil = NULL;
119116 iunit = hwunit = 0;
3030 struct kbkeycode a;
3131
3232 set_progname(argv[0]);
33 #ifndef __klibc__
33
3434 setlocale(LC_ALL, "");
3535 bindtextdomain(PACKAGE_NAME, LOCALEDIR);
3636 textdomain(PACKAGE_NAME);
37 #endif
3837
3938 if (argc == 2 && !strcmp(argv[1], "-V"))
4039 print_version_and_exit();
161161 struct led *lp;
162162
163163 set_progname(argv[0]);
164 #ifndef __klibc__
164
165165 setlocale(LC_ALL, "");
166166 bindtextdomain(PACKAGE_NAME, LOCALEDIR);
167167 textdomain(PACKAGE_NAME);
168 #endif
169168
170169 if (argc == 2 && (!strcmp("-V", argv[1]) || !strcmp("--version", argv[1])))
171170 print_version_and_exit();
1616 int fd, cons;
1717 struct { char fn, subarg; } arg;
1818
19 #ifndef __klibc__
2019 setlocale(LC_ALL, "");
2120 bindtextdomain(PACKAGE_NAME, LOCALEDIR);
2221 textdomain(PACKAGE_NAME);
23 #endif
2422
2523 if (argc == 2)
2624 cons = atoi(argv[1]);
6363 struct meta *mp;
6464
6565 set_progname(argv[0]);
66 #ifndef __klibc__
66
6767 setlocale(LC_ALL, "");
6868 bindtextdomain(PACKAGE_NAME, LOCALEDIR);
6969 textdomain(PACKAGE_NAME);
70 #endif
7170
7271 if (argc == 2 && !strcmp(argv[1], "-V"))
7372 print_version_and_exit();
1414 int fd;
1515 struct { char ten, onoff; } arg;
1616
17 #ifndef __klibc__
1817 setlocale(LC_ALL, "");
1918 bindtextdomain(PACKAGE_NAME, LOCALEDIR);
2019 textdomain(PACKAGE_NAME);
21 #endif
2220
2321 if (argc != 2) {
2422 fprintf(stderr, _("usage: %s\n"), "setvesablank ON|on|off");
120120 int list[64], lth, info = 0, verbose = 0;
121121
122122 set_progname(argv[0]);
123 #ifndef __klibc__
123
124124 setlocale(LC_ALL, "");
125125 bindtextdomain(PACKAGE_NAME, LOCALEDIR);
126126 textdomain(PACKAGE_NAME);
127 #endif
128127
129128 if (argc == 2 &&
130129 (!strcmp(argv[1], "-V") || !strcmp(argv[1], "--version")))
11 #include <unistd.h>
22 #include <getopt.h>
33 #include <fcntl.h>
4 #include <signal.h>
45 #include <termios.h>
56 #include <sys/ioctl.h>
67 #include <linux/kd.h>
89 #include "getfd.h"
910 #include "nls.h"
1011 #include "version.h"
11
12 #ifndef __klibc__
13 #include <signal.h>
14 #else
15 #include "klibc_compat.h"
16 #endif
1712
1813 int tmp; /* for debugging */
1914
113108 int i, n;
114109
115110 set_progname(argv[0]);
116 #ifndef __klibc__
111
117112 setlocale(LC_ALL, "");
118113 bindtextdomain(PACKAGE_NAME, LOCALEDIR);
119114 textdomain(PACKAGE_NAME);
120 #endif
121115
122116 while ((c = getopt_long(argc, argv,
123117 short_opts, long_opts, NULL)) != -1) {
1616 int fd, num;
1717
1818 set_progname(argv[0]);
19 #ifndef __klibc__
19
2020 setlocale(LC_ALL, "");
2121 bindtextdomain(PACKAGE_NAME, LOCALEDIR);
2222 textdomain(PACKAGE_NAME);
23 #endif
2423
2524 if (argc == 2 && !strcmp(argv[1], "-V"))
2625 print_version_and_exit();
00 #include "kbd.h"
11 #include "../config.h"
2 #ifdef __klibc__
3 #include "klibc_compat.h"
4 #endif
52 #include <string.h>
63 #include <stdlib.h>
74
66 #include "kbd.h"
77 #include "nls.h"
88 #include "xmalloc.h"
9
10 #ifdef __klibc__
11 #include "klibc_compat.h"
12 #endif
139
1410 extern char *progname;
1511