Drop klibc support
Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>
Alexey Gladkov
13 years ago
9 | 9 | AM_INIT_AUTOMAKE([1.9 -Wall]) |
10 | 10 | AC_CONFIG_SRCDIR([src/loadkeys.y]) |
11 | 11 | AC_CONFIG_HEADERS(config.h) |
12 | ||
13 | AC_CHECK_KLIBC | |
14 | 12 | |
15 | 13 | # Checks for programs. |
16 | 14 | AC_PROG_YACC |
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 |
7 | 7 | OLDPROGS = mapscrn loadunimap |
8 | 8 | PROGS = \ |
9 | 9 | 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 | |
15 | 12 | |
16 | 13 | if KEYCODES_PROGS |
17 | 14 | PROGS += getkeycodes setkeycodes |
23 | 20 | |
24 | 21 | if OPTIONAL_PROGS |
25 | 22 | 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 | |
31 | 25 | endif |
32 | 26 | |
33 | 27 | dist_bin_SCRIPTS = unicode_start unicode_stop |
48 | 42 | UTF8_S = utf8.c utf8.h |
49 | 43 | XMAL_S = xmalloc.c xmalloc.h |
50 | 44 | |
51 | if KLIBC | |
52 | KLIBC_S = klibc_compat.c klibc_compat.h | |
53 | endif | |
54 | ||
55 | 45 | chvt_SOURCES = $(ALL_S) chvt.c $(GETFD_S) |
56 | 46 | clrunimap_SOURCES = $(ALL_S) clrunimap.c $(GETFD_S) $(KDMA_S) |
57 | 47 | deallocvt_SOURCES = $(ALL_S) deallocvt.c $(GETFD_S) |
60 | 50 | getkeycodes_SOURCES = $(ALL_S) getkeycodes.c $(GETFD_S) |
61 | 51 | getunimap_SOURCES = $(ALL_S) getunimap.c $(GETFD_S) $(KDMA_S) |
62 | 52 | 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) | |
65 | 55 | mapscrn_SOURCES = $(ALL_S) mapscrn.c $(FIND_S) $(UTF8_S) $(XMAL_S) $(GETFD_S) $(KDMA_S) |
66 | 56 | 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) | |
68 | 58 | resizecons_SOURCES = $(ALL_S) resizecons.c $(GETFD_S) $(FIND_S) $(XMAL_S) |
69 | 59 | 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) | |
71 | 61 | setkeycodes_SOURCES = $(ALL_S) setkeycodes.c $(GETFD_S) |
72 | 62 | setlogcons_SOURCES = $(ALL_S) setlogcons.c $(GETFD_S) |
73 | 63 | setpalette_SOURCES = $(ALL_S) setpalette.c $(GETFD_S) |
74 | 64 | setvesablank_SOURCES = $(ALL_S) setvesablank.c $(GETFD_S) |
75 | 65 | 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) | |
77 | 67 | |
78 | 68 | mapscrn_CFLAGS = -DMAIN |
79 | 69 | loadunimap_CFLAGS = -DMAIN |
804 | 804 | #include "ksyms.h" |
805 | 805 | #include "kbd.h" |
806 | 806 | #include "xmalloc.h" |
807 | #ifdef __klibc__ | |
808 | #include "klibc_compat.h" | |
809 | #endif | |
810 | 807 | |
811 | 808 | extern int line_nr; |
812 | 809 | int yylval; |
7 | 7 | #include "ksyms.h" |
8 | 8 | #include "kbd.h" |
9 | 9 | #include "xmalloc.h" |
10 | #ifdef __klibc__ | |
11 | #include "klibc_compat.h" | |
12 | #endif | |
13 | 10 | |
14 | 11 | extern int line_nr; |
15 | 12 | int yylval; |
17 | 17 | int fd; |
18 | 18 | char *console = NULL; |
19 | 19 | |
20 | #ifndef __klibc__ | |
21 | 20 | setlocale(LC_ALL, ""); |
22 | 21 | bindtextdomain(PACKAGE_NAME, LOCALEDIR); |
23 | 22 | textdomain(PACKAGE_NAME); |
24 | #endif | |
25 | 23 | |
26 | 24 | if (argc >= 3 && !strcmp(argv[1], "-C")) |
27 | 25 | console = argv[2]; |
602 | 602 | char diac_only = 0; |
603 | 603 | |
604 | 604 | set_progname(argv[0]); |
605 | #ifndef __klibc__ | |
605 | ||
606 | 606 | setlocale(LC_ALL, ""); |
607 | 607 | bindtextdomain(PACKAGE_NAME, LOCALEDIR); |
608 | 608 | textdomain(PACKAGE_NAME); |
609 | #endif | |
610 | 609 | |
611 | 610 | while ((c = getopt_long(argc, argv, |
612 | 611 | short_opts, long_opts, NULL)) != -1) { |
37 | 37 | { "next-available", no_argument, NULL, 'n' }, |
38 | 38 | { NULL, 0, NULL, 0 } }; |
39 | 39 | |
40 | #ifndef __klibc__ | |
41 | 40 | setlocale(LC_ALL, ""); |
42 | 41 | bindtextdomain(PACKAGE_NAME, LOCALEDIR); |
43 | 42 | textdomain(PACKAGE_NAME); |
44 | #endif | |
45 | 43 | |
46 | 44 | set_progname(argv[0]); |
47 | 45 | while (( c = getopt_long (argc, argv, "Vhn", long_opts, NULL)) != EOF) { |
12 | 12 | static int ispipe; |
13 | 13 | |
14 | 14 | void fpclose(FILE *fp) { |
15 | #ifndef __klibc__ | |
16 | 15 | if (ispipe) |
17 | 16 | pclose(fp); |
18 | 17 | else |
19 | #endif /* __klibc__ */ | |
20 | 18 | fclose(fp); |
21 | 19 | } |
22 | 20 | |
23 | 21 | #define SIZE(a) (sizeof(a)/sizeof(a[0])) |
24 | 22 | |
25 | #ifndef __klibc__ | |
26 | 23 | static struct decompressor { |
27 | 24 | char *ext; /* starts with `.', has no other dots */ |
28 | 25 | char *cmd; |
45 | 42 | fprintf(stderr, _("error executing %s\n"), pipe_cmd); |
46 | 43 | return fp; |
47 | 44 | } |
48 | #endif /* __klibc__ */ | |
49 | 45 | |
50 | 46 | /* If a file PATHNAME exists, then open it. |
51 | 47 | If is has a `compressed' extension, then open a pipe reading it */ |
52 | 48 | static FILE * |
53 | 49 | maybe_pipe_open(void) { |
54 | 50 | FILE *fp; |
55 | #ifndef __klibc__ | |
56 | 51 | char *t; |
57 | 52 | struct decompressor *dc; |
58 | 53 | |
66 | 61 | } |
67 | 62 | } |
68 | 63 | } |
69 | #else | |
70 | fp = fopen(pathname, "r"); | |
71 | #endif /* __klibc__ */ | |
72 | 64 | return fp; |
73 | 65 | } |
74 | 66 | |
78 | 70 | DIR *d; |
79 | 71 | struct dirent *de; |
80 | 72 | char *ff, *fdir, *p, *q, **sp; |
81 | #ifndef __klibc__ | |
82 | 73 | struct decompressor *dc; |
83 | #endif /* __klibc__ */ | |
84 | 74 | int secondpass = 0; |
85 | 75 | |
86 | 76 | ispipe = 0; |
151 | 141 | /* Does tail consist of a known suffix and possibly |
152 | 142 | a compression suffix? */ |
153 | 143 | for(sp = suf; *sp; sp++) { |
154 | #ifndef __klibc__ | |
155 | 144 | int l; |
156 | #endif /* __klibc__ */ | |
157 | 145 | |
158 | 146 | if (!strcmp(p, *sp)) |
159 | 147 | return maybe_pipe_open(); |
160 | 148 | |
161 | #ifndef __klibc__ | |
162 | 149 | l = strlen(*sp); |
163 | 150 | if (strncmp(p,*sp,l) == 0) { |
164 | 151 | for (dc = &decompressors[0]; dc->cmd; dc++) |
165 | 152 | if (strcmp(p+l, dc->ext) == 0) |
166 | 153 | return pipe_open(dc); |
167 | 154 | } |
168 | #endif /* __klibc__ */ | |
169 | 155 | } |
170 | 156 | } |
171 | 157 | closedir(d); |
181 | 167 | char **dp, *dir, **sp; |
182 | 168 | FILE *fp; |
183 | 169 | int dl, recdepth; |
184 | #ifndef __klibc__ | |
185 | 170 | struct decompressor *dc; |
186 | #endif /* __klibc__ */ | |
187 | 171 | |
188 | 172 | if (strlen(fnam) >= sizeof(pathname)) |
189 | 173 | return NULL; |
210 | 194 | return fp; |
211 | 195 | } |
212 | 196 | |
213 | #ifndef __klibc__ | |
214 | 197 | for (sp = suffixes; *sp; sp++) { |
215 | 198 | for (dc = &decompressors[0]; dc->cmd; dc++) { |
216 | 199 | if (strlen(fnam) + strlen(*sp) |
225 | 208 | } |
226 | 209 | } |
227 | 210 | } |
228 | #endif /* __klibc__ */ | |
229 | 211 | |
230 | 212 | return NULL; |
231 | 213 | } |
26 | 26 | int old_kernel = 0; |
27 | 27 | |
28 | 28 | set_progname(argv[0]); |
29 | #ifndef __klibc__ | |
29 | ||
30 | 30 | setlocale(LC_ALL, ""); |
31 | 31 | bindtextdomain(PACKAGE_NAME, LOCALEDIR); |
32 | 32 | textdomain(PACKAGE_NAME); |
33 | #endif | |
34 | 33 | |
35 | 34 | if (argc == 2 && !strcmp(argv[1], "-V")) |
36 | 35 | print_version_and_exit(); |
39 | 39 | struct unimapdesc ud; |
40 | 40 | |
41 | 41 | set_progname(argv[0]); |
42 | #ifndef __klibc__ | |
42 | ||
43 | 43 | setlocale(LC_ALL, ""); |
44 | 44 | bindtextdomain(PACKAGE_NAME, LOCALEDIR); |
45 | 45 | textdomain(PACKAGE_NAME); |
46 | #endif | |
47 | 46 | |
48 | 47 | if (argc == 2 && |
49 | 48 | (!strcmp(argv[1], "-V") || !strcmp(argv[1], "--version"))) |
26 | 26 | char *console = NULL; |
27 | 27 | |
28 | 28 | set_progname(argv[0]); |
29 | #ifndef __klibc__ | |
29 | ||
30 | 30 | setlocale(LC_ALL, ""); |
31 | 31 | bindtextdomain(PACKAGE_NAME, LOCALEDIR); |
32 | 32 | textdomain(PACKAGE_NAME); |
33 | #endif | |
34 | 33 | |
35 | 34 | if (argc == 2 && !strcmp(argv[1], "-V")) |
36 | 35 | print_version_and_exit(); |
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 | #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. */ | |
2 | 1 | |
3 | 2 | /* Skeleton implementation for Bison's Yacc-like parsers in C |
4 | 3 | |
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. | |
7 | 6 | |
8 | 7 | This program is free software: you can redistribute it and/or modify |
9 | 8 | it under the terms of the GNU General Public License as published by |
45 | 44 | #define YYBISON 1 |
46 | 45 | |
47 | 46 | /* Bison version. */ |
48 | #define YYBISON_VERSION "2.4.1" | |
47 | #define YYBISON_VERSION "2.4.3" | |
49 | 48 | |
50 | 49 | /* Skeleton name. */ |
51 | 50 | #define YYSKELETON_NAME "yacc.c" |
162 | 161 | |
163 | 162 | |
164 | 163 | /* Line 189 of yacc.c */ |
165 | #line 167 "loadkeys.c" | |
164 | #line 166 "loadkeys.c" | |
166 | 165 | |
167 | 166 | /* Enabling traces. */ |
168 | 167 | #ifndef YYDEBUG |
274 | 273 | |
275 | 274 | |
276 | 275 | /* Line 264 of yacc.c */ |
277 | #line 279 "loadkeys.c" | |
276 | #line 278 "loadkeys.c" | |
278 | 277 | |
279 | 278 | #ifdef short |
280 | 279 | # undef short |
324 | 323 | #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) |
325 | 324 | |
326 | 325 | #ifndef YY_ |
327 | # if YYENABLE_NLS | |
326 | # if defined YYENABLE_NLS && YYENABLE_NLS | |
328 | 327 | # if ENABLE_NLS |
329 | 328 | # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ |
330 | 329 | # define YY_(msgid) dgettext ("bison-runtime", msgid) |
748 | 747 | |
749 | 748 | /* Like YYERROR except do call yyerror. This remains here temporarily |
750 | 749 | 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. */ | |
752 | 754 | |
753 | 755 | #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 | |
754 | 762 | |
755 | 763 | #define YYRECOVERING() (!!yyerrstatus) |
756 | 764 | |
807 | 815 | we won't break user code: when these are the locations we know. */ |
808 | 816 | |
809 | 817 | #ifndef YY_LOCATION_PRINT |
810 | # if YYLTYPE_IS_TRIVIAL | |
818 | # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL | |
811 | 819 | # define YY_LOCATION_PRINT(File, Loc) \ |
812 | 820 | fprintf (File, "%d.%d-%d.%d", \ |
813 | 821 | (Loc).first_line, (Loc).first_column, \ |
1546 | 1554 | { |
1547 | 1555 | case 14: |
1548 | 1556 | |
1549 | /* Line 1455 of yacc.c */ | |
1557 | /* Line 1464 of yacc.c */ | |
1550 | 1558 | #line 121 "loadkeys.y" |
1551 | 1559 | { |
1552 | 1560 | set_charset((char *) kbs_buf.kb_string); |
1555 | 1563 | |
1556 | 1564 | case 15: |
1557 | 1565 | |
1558 | /* Line 1455 of yacc.c */ | |
1566 | /* Line 1464 of yacc.c */ | |
1559 | 1567 | #line 126 "loadkeys.y" |
1560 | 1568 | { |
1561 | 1569 | alt_is_meta = 1; |
1564 | 1572 | |
1565 | 1573 | case 16: |
1566 | 1574 | |
1567 | /* Line 1455 of yacc.c */ | |
1575 | /* Line 1464 of yacc.c */ | |
1568 | 1576 | #line 131 "loadkeys.y" |
1569 | 1577 | { |
1570 | 1578 | strings_as_usual(); |
1573 | 1581 | |
1574 | 1582 | case 17: |
1575 | 1583 | |
1576 | /* Line 1455 of yacc.c */ | |
1584 | /* Line 1464 of yacc.c */ | |
1577 | 1585 | #line 136 "loadkeys.y" |
1578 | 1586 | { |
1579 | 1587 | compose_as_usual((char *) kbs_buf.kb_string); |
1582 | 1590 | |
1583 | 1591 | case 18: |
1584 | 1592 | |
1585 | /* Line 1455 of yacc.c */ | |
1593 | /* Line 1464 of yacc.c */ | |
1586 | 1594 | #line 140 "loadkeys.y" |
1587 | 1595 | { |
1588 | 1596 | compose_as_usual(0); |
1591 | 1599 | |
1592 | 1600 | case 19: |
1593 | 1601 | |
1594 | /* Line 1455 of yacc.c */ | |
1602 | /* Line 1464 of yacc.c */ | |
1595 | 1603 | #line 145 "loadkeys.y" |
1596 | 1604 | { |
1597 | 1605 | keymaps_line_seen = 1; |
1600 | 1608 | |
1601 | 1609 | case 22: |
1602 | 1610 | |
1603 | /* Line 1455 of yacc.c */ | |
1611 | /* Line 1464 of yacc.c */ | |
1604 | 1612 | #line 153 "loadkeys.y" |
1605 | 1613 | { |
1606 | 1614 | int i; |
1611 | 1619 | |
1612 | 1620 | case 23: |
1613 | 1621 | |
1614 | /* Line 1455 of yacc.c */ | |
1622 | /* Line 1464 of yacc.c */ | |
1615 | 1623 | #line 159 "loadkeys.y" |
1616 | 1624 | { |
1617 | 1625 | addmap((yyvsp[(1) - (1)]),1); |
1620 | 1628 | |
1621 | 1629 | case 24: |
1622 | 1630 | |
1623 | /* Line 1455 of yacc.c */ | |
1631 | /* Line 1464 of yacc.c */ | |
1624 | 1632 | #line 164 "loadkeys.y" |
1625 | 1633 | { |
1626 | 1634 | if (KTYP((yyvsp[(2) - (5)])) != KT_FN) |
1633 | 1641 | |
1634 | 1642 | case 25: |
1635 | 1643 | |
1636 | /* Line 1455 of yacc.c */ | |
1644 | /* Line 1464 of yacc.c */ | |
1637 | 1645 | #line 173 "loadkeys.y" |
1638 | 1646 | { |
1639 | 1647 | compose((yyvsp[(2) - (6)]), (yyvsp[(3) - (6)]), (yyvsp[(5) - (6)])); |
1642 | 1650 | |
1643 | 1651 | case 26: |
1644 | 1652 | |
1645 | /* Line 1455 of yacc.c */ | |
1653 | /* Line 1464 of yacc.c */ | |
1646 | 1654 | #line 177 "loadkeys.y" |
1647 | 1655 | { |
1648 | 1656 | compose((yyvsp[(2) - (6)]), (yyvsp[(3) - (6)]), (yyvsp[(5) - (6)])); |
1651 | 1659 | |
1652 | 1660 | case 27: |
1653 | 1661 | |
1654 | /* Line 1455 of yacc.c */ | |
1662 | /* Line 1464 of yacc.c */ | |
1655 | 1663 | #line 182 "loadkeys.y" |
1656 | 1664 | { (yyval) = (yyvsp[(1) - (1)]); } |
1657 | 1665 | break; |
1658 | 1666 | |
1659 | 1667 | case 28: |
1660 | 1668 | |
1661 | /* Line 1455 of yacc.c */ | |
1669 | /* Line 1464 of yacc.c */ | |
1662 | 1670 | #line 184 "loadkeys.y" |
1663 | 1671 | { (yyval) = (yyvsp[(1) - (1)]) ^ 0xf000; } |
1664 | 1672 | break; |
1665 | 1673 | |
1666 | 1674 | case 29: |
1667 | 1675 | |
1668 | /* Line 1455 of yacc.c */ | |
1676 | /* Line 1464 of yacc.c */ | |
1669 | 1677 | #line 186 "loadkeys.y" |
1670 | 1678 | { mod = 0; } |
1671 | 1679 | break; |
1672 | 1680 | |
1673 | 1681 | case 30: |
1674 | 1682 | |
1675 | /* Line 1455 of yacc.c */ | |
1683 | /* Line 1464 of yacc.c */ | |
1676 | 1684 | #line 188 "loadkeys.y" |
1677 | 1685 | { |
1678 | 1686 | addkey((yyvsp[(4) - (7)]), mod, (yyvsp[(6) - (7)])); |
1681 | 1689 | |
1682 | 1690 | case 31: |
1683 | 1691 | |
1684 | /* Line 1455 of yacc.c */ | |
1692 | /* Line 1464 of yacc.c */ | |
1685 | 1693 | #line 192 "loadkeys.y" |
1686 | 1694 | { |
1687 | 1695 | addkey((yyvsp[(3) - (6)]), 0, (yyvsp[(5) - (6)])); |
1690 | 1698 | |
1691 | 1699 | case 34: |
1692 | 1700 | |
1693 | /* Line 1455 of yacc.c */ | |
1701 | /* Line 1464 of yacc.c */ | |
1694 | 1702 | #line 199 "loadkeys.y" |
1695 | 1703 | { mod |= M_SHIFT; } |
1696 | 1704 | break; |
1697 | 1705 | |
1698 | 1706 | case 35: |
1699 | 1707 | |
1700 | /* Line 1455 of yacc.c */ | |
1708 | /* Line 1464 of yacc.c */ | |
1701 | 1709 | #line 200 "loadkeys.y" |
1702 | 1710 | { mod |= M_CTRL; } |
1703 | 1711 | break; |
1704 | 1712 | |
1705 | 1713 | case 36: |
1706 | 1714 | |
1707 | /* Line 1455 of yacc.c */ | |
1715 | /* Line 1464 of yacc.c */ | |
1708 | 1716 | #line 201 "loadkeys.y" |
1709 | 1717 | { mod |= M_ALT; } |
1710 | 1718 | break; |
1711 | 1719 | |
1712 | 1720 | case 37: |
1713 | 1721 | |
1714 | /* Line 1455 of yacc.c */ | |
1722 | /* Line 1464 of yacc.c */ | |
1715 | 1723 | #line 202 "loadkeys.y" |
1716 | 1724 | { mod |= M_ALTGR; } |
1717 | 1725 | break; |
1718 | 1726 | |
1719 | 1727 | case 38: |
1720 | 1728 | |
1721 | /* Line 1455 of yacc.c */ | |
1729 | /* Line 1464 of yacc.c */ | |
1722 | 1730 | #line 203 "loadkeys.y" |
1723 | 1731 | { mod |= M_SHIFTL; } |
1724 | 1732 | break; |
1725 | 1733 | |
1726 | 1734 | case 39: |
1727 | 1735 | |
1728 | /* Line 1455 of yacc.c */ | |
1736 | /* Line 1464 of yacc.c */ | |
1729 | 1737 | #line 204 "loadkeys.y" |
1730 | 1738 | { mod |= M_SHIFTR; } |
1731 | 1739 | break; |
1732 | 1740 | |
1733 | 1741 | case 40: |
1734 | 1742 | |
1735 | /* Line 1455 of yacc.c */ | |
1743 | /* Line 1464 of yacc.c */ | |
1736 | 1744 | #line 205 "loadkeys.y" |
1737 | 1745 | { mod |= M_CTRLL; } |
1738 | 1746 | break; |
1739 | 1747 | |
1740 | 1748 | case 41: |
1741 | 1749 | |
1742 | /* Line 1455 of yacc.c */ | |
1750 | /* Line 1464 of yacc.c */ | |
1743 | 1751 | #line 206 "loadkeys.y" |
1744 | 1752 | { mod |= M_CTRLR; } |
1745 | 1753 | break; |
1746 | 1754 | |
1747 | 1755 | case 42: |
1748 | 1756 | |
1749 | /* Line 1455 of yacc.c */ | |
1757 | /* Line 1464 of yacc.c */ | |
1750 | 1758 | #line 207 "loadkeys.y" |
1751 | 1759 | { mod |= M_CAPSSHIFT; } |
1752 | 1760 | break; |
1753 | 1761 | |
1754 | 1762 | case 43: |
1755 | 1763 | |
1756 | /* Line 1455 of yacc.c */ | |
1764 | /* Line 1464 of yacc.c */ | |
1757 | 1765 | #line 210 "loadkeys.y" |
1758 | 1766 | { |
1759 | 1767 | int i, j; |
1789 | 1797 | |
1790 | 1798 | case 46: |
1791 | 1799 | |
1792 | /* Line 1455 of yacc.c */ | |
1800 | /* Line 1464 of yacc.c */ | |
1793 | 1801 | #line 246 "loadkeys.y" |
1794 | 1802 | { |
1795 | 1803 | if (rvalct >= MAX_NR_KEYMAPS) |
1800 | 1808 | |
1801 | 1809 | case 47: |
1802 | 1810 | |
1803 | /* Line 1455 of yacc.c */ | |
1811 | /* Line 1464 of yacc.c */ | |
1804 | 1812 | #line 253 "loadkeys.y" |
1805 | 1813 | {(yyval)=convert_code((yyvsp[(1) - (1)]), TO_AUTO);} |
1806 | 1814 | break; |
1807 | 1815 | |
1808 | 1816 | case 48: |
1809 | 1817 | |
1810 | /* Line 1455 of yacc.c */ | |
1818 | /* Line 1464 of yacc.c */ | |
1811 | 1819 | #line 255 "loadkeys.y" |
1812 | 1820 | {(yyval)=add_capslock((yyvsp[(2) - (2)]));} |
1813 | 1821 | break; |
1814 | 1822 | |
1815 | 1823 | case 49: |
1816 | 1824 | |
1817 | /* Line 1455 of yacc.c */ | |
1825 | /* Line 1464 of yacc.c */ | |
1818 | 1826 | #line 257 "loadkeys.y" |
1819 | 1827 | {(yyval)=convert_code((yyvsp[(1) - (1)])^0xf000, TO_AUTO);} |
1820 | 1828 | break; |
1821 | 1829 | |
1822 | 1830 | case 50: |
1823 | 1831 | |
1824 | /* Line 1455 of yacc.c */ | |
1832 | /* Line 1464 of yacc.c */ | |
1825 | 1833 | #line 259 "loadkeys.y" |
1826 | 1834 | {(yyval)=add_capslock((yyvsp[(2) - (2)])^0xf000);} |
1827 | 1835 | break; |
1828 | 1836 | |
1829 | 1837 | case 51: |
1830 | 1838 | |
1831 | /* Line 1455 of yacc.c */ | |
1839 | /* Line 1464 of yacc.c */ | |
1832 | 1840 | #line 261 "loadkeys.y" |
1833 | 1841 | {(yyval)=(yyvsp[(1) - (1)]);} |
1834 | 1842 | break; |
1835 | 1843 | |
1836 | 1844 | case 52: |
1837 | 1845 | |
1838 | /* Line 1455 of yacc.c */ | |
1846 | /* Line 1464 of yacc.c */ | |
1839 | 1847 | #line 263 "loadkeys.y" |
1840 | 1848 | {(yyval)=add_capslock((yyvsp[(2) - (2)]));} |
1841 | 1849 | break; |
1842 | 1850 | |
1843 | 1851 | |
1844 | 1852 | |
1845 | /* Line 1455 of yacc.c */ | |
1846 | #line 1848 "loadkeys.c" | |
1853 | /* Line 1464 of yacc.c */ | |
1854 | #line 1856 "loadkeys.c" | |
1847 | 1855 | default: break; |
1848 | 1856 | } |
1849 | 1857 | YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); |
2054 | 2062 | |
2055 | 2063 | |
2056 | 2064 | |
2057 | /* Line 1675 of yacc.c */ | |
2065 | /* Line 1684 of yacc.c */ | |
2058 | 2066 | #line 265 "loadkeys.y" |
2059 | 2067 | |
2060 | 2068 | |
2119 | 2127 | char *console = NULL; |
2120 | 2128 | |
2121 | 2129 | set_progname(argv[0]); |
2122 | #ifndef __klibc__ | |
2130 | ||
2123 | 2131 | setlocale(LC_ALL, ""); |
2124 | 2132 | bindtextdomain(PACKAGE_NAME, LOCALEDIR); |
2125 | 2133 | textdomain(PACKAGE_NAME); |
2126 | #endif | |
2127 | 2134 | |
2128 | 2135 | while ((c = getopt_long(argc, argv, |
2129 | 2136 | short_opts, long_opts, NULL)) != -1) { |
2166 | 2173 | } |
2167 | 2174 | } |
2168 | 2175 | |
2176 | if (optu && opta) { | |
2177 | fprintf(stderr, _("%s: Options --unicode and --ascii are mutually exclusive\n"), | |
2178 | progname); | |
2179 | exit(1); | |
2180 | } | |
2181 | ||
2169 | 2182 | prefer_unicode = optu; |
2170 | 2183 | if (!optm && !optb) { |
2171 | 2184 | /* check whether the keyboard is in Unicode mode */ |
2969 | 2982 | exit(1); |
2970 | 2983 | } else { |
2971 | 2984 | struct ccc { |
2972 | char c1, c2, c3; | |
2985 | unsigned char c1, c2, c3; | |
2973 | 2986 | } def_latin1_composes[68] = { |
2974 | 2987 | { '`', 'A', 0300 }, { '`', 'a', 0340 }, |
2975 | 2988 | { '\'', 'A', 0301 }, { '\'', 'a', 0341 }, |
324 | 324 | char *console = NULL; |
325 | 325 | |
326 | 326 | set_progname(argv[0]); |
327 | #ifndef __klibc__ | |
327 | ||
328 | 328 | setlocale(LC_ALL, ""); |
329 | 329 | bindtextdomain(PACKAGE_NAME, LOCALEDIR); |
330 | 330 | textdomain(PACKAGE_NAME); |
331 | #endif | |
332 | 331 | |
333 | 332 | while ((c = getopt_long(argc, argv, |
334 | 333 | short_opts, long_opts, NULL)) != -1) { |
51 | 51 | char *infnam = "def.uni"; |
52 | 52 | |
53 | 53 | set_progname(argv[0]); |
54 | #ifndef __klibc__ | |
54 | ||
55 | 55 | setlocale(LC_ALL, ""); |
56 | 56 | bindtextdomain(PACKAGE_NAME, LOCALEDIR); |
57 | 57 | textdomain(PACKAGE_NAME); |
58 | #endif | |
59 | 58 | |
60 | 59 | if (argc == 2 && |
61 | 60 | (!strcmp(argv[1], "-V") || !strcmp(argv[1], "--version"))) |
3 | 3 | |
4 | 4 | #include <stdio.h> |
5 | 5 | #include <stdlib.h> |
6 | #ifndef __klibc__ | |
7 | 6 | #include <memory.h> |
8 | #endif | |
9 | 7 | #include <string.h> |
10 | 8 | #include <fcntl.h> |
11 | 9 | #include <sys/types.h> |
41 | 39 | int fd; |
42 | 40 | |
43 | 41 | set_progname(argv[0]); |
44 | #ifndef __klibc__ | |
42 | ||
45 | 43 | setlocale(LC_ALL, ""); |
46 | 44 | bindtextdomain(PACKAGE_NAME, LOCALEDIR); |
47 | 45 | textdomain(PACKAGE_NAME); |
48 | #endif | |
49 | 46 | |
50 | 47 | if (argc == 2 && !strcmp(argv[1], "-V")) |
51 | 48 | print_version_and_exit(); |
4 | 4 | #define LOCALEDIR "/usr/share/locale" |
5 | 5 | #endif |
6 | 6 | |
7 | #ifndef __klibc__ | |
8 | 7 | #ifdef HAVE_LOCALE_H |
9 | 8 | # include <locale.h> |
10 | #endif | |
11 | 9 | #endif |
12 | 10 | |
13 | 11 | #ifdef ENABLE_NLS |
11 | 11 | #include "psffontop.h" |
12 | 12 | #include "utf8.h" |
13 | 13 | #include "paths.h" |
14 | ||
15 | #ifdef __klibc__ | |
16 | #include "klibc_compat.h" | |
17 | #endif | |
18 | 14 | |
19 | 15 | extern char *progname; |
20 | 16 |
237 | 237 | int inbuflth, fontbuflth; |
238 | 238 | |
239 | 239 | set_progname(argv[0]); |
240 | #ifndef __klibc__ | |
240 | ||
241 | 241 | setlocale(LC_ALL, ""); |
242 | 242 | bindtextdomain(PACKAGE_NAME, LOCALEDIR); |
243 | 243 | textdomain(PACKAGE_NAME); |
244 | #endif | |
245 | 244 | |
246 | 245 | if (argc == 2 && !strcmp(argv[1], "-V")) |
247 | 246 | print_version_and_exit(); |
119 | 119 | char *defaultfont; |
120 | 120 | |
121 | 121 | set_progname(argv[0]); |
122 | #ifndef __klibc__ | |
122 | ||
123 | 123 | setlocale(LC_ALL, ""); |
124 | 124 | bindtextdomain(PACKAGE_NAME, LOCALEDIR); |
125 | 125 | textdomain(PACKAGE_NAME); |
126 | #endif | |
127 | 126 | |
128 | 127 | if (argc < 2) |
129 | 128 | usage(); |
10 | 10 | */ |
11 | 11 | |
12 | 12 | #include <stdio.h> |
13 | #ifndef __klibc__ | |
14 | 13 | #include <memory.h> |
15 | #endif | |
16 | 14 | #include <fcntl.h> |
17 | 15 | #include <stdlib.h> |
18 | 16 | #include <unistd.h> |
109 | 107 | int restore = 0; |
110 | 108 | |
111 | 109 | set_progname(argv[0]); |
112 | #ifndef __klibc__ | |
110 | ||
113 | 111 | setlocale(LC_ALL, ""); |
114 | 112 | bindtextdomain(PACKAGE_NAME, LOCALEDIR); |
115 | 113 | textdomain(PACKAGE_NAME); |
116 | #endif | |
117 | 114 | |
118 | 115 | ifiles[0] = mfil = ufil = Ofil = ofil = omfil = oufil = NULL; |
119 | 116 | iunit = hwunit = 0; |
30 | 30 | struct kbkeycode a; |
31 | 31 | |
32 | 32 | set_progname(argv[0]); |
33 | #ifndef __klibc__ | |
33 | ||
34 | 34 | setlocale(LC_ALL, ""); |
35 | 35 | bindtextdomain(PACKAGE_NAME, LOCALEDIR); |
36 | 36 | textdomain(PACKAGE_NAME); |
37 | #endif | |
38 | 37 | |
39 | 38 | if (argc == 2 && !strcmp(argv[1], "-V")) |
40 | 39 | print_version_and_exit(); |
161 | 161 | struct led *lp; |
162 | 162 | |
163 | 163 | set_progname(argv[0]); |
164 | #ifndef __klibc__ | |
164 | ||
165 | 165 | setlocale(LC_ALL, ""); |
166 | 166 | bindtextdomain(PACKAGE_NAME, LOCALEDIR); |
167 | 167 | textdomain(PACKAGE_NAME); |
168 | #endif | |
169 | 168 | |
170 | 169 | if (argc == 2 && (!strcmp("-V", argv[1]) || !strcmp("--version", argv[1]))) |
171 | 170 | print_version_and_exit(); |
16 | 16 | int fd, cons; |
17 | 17 | struct { char fn, subarg; } arg; |
18 | 18 | |
19 | #ifndef __klibc__ | |
20 | 19 | setlocale(LC_ALL, ""); |
21 | 20 | bindtextdomain(PACKAGE_NAME, LOCALEDIR); |
22 | 21 | textdomain(PACKAGE_NAME); |
23 | #endif | |
24 | 22 | |
25 | 23 | if (argc == 2) |
26 | 24 | cons = atoi(argv[1]); |
63 | 63 | struct meta *mp; |
64 | 64 | |
65 | 65 | set_progname(argv[0]); |
66 | #ifndef __klibc__ | |
66 | ||
67 | 67 | setlocale(LC_ALL, ""); |
68 | 68 | bindtextdomain(PACKAGE_NAME, LOCALEDIR); |
69 | 69 | textdomain(PACKAGE_NAME); |
70 | #endif | |
71 | 70 | |
72 | 71 | if (argc == 2 && !strcmp(argv[1], "-V")) |
73 | 72 | print_version_and_exit(); |
14 | 14 | int fd; |
15 | 15 | struct { char ten, onoff; } arg; |
16 | 16 | |
17 | #ifndef __klibc__ | |
18 | 17 | setlocale(LC_ALL, ""); |
19 | 18 | bindtextdomain(PACKAGE_NAME, LOCALEDIR); |
20 | 19 | textdomain(PACKAGE_NAME); |
21 | #endif | |
22 | 20 | |
23 | 21 | if (argc != 2) { |
24 | 22 | fprintf(stderr, _("usage: %s\n"), "setvesablank ON|on|off"); |
120 | 120 | int list[64], lth, info = 0, verbose = 0; |
121 | 121 | |
122 | 122 | set_progname(argv[0]); |
123 | #ifndef __klibc__ | |
123 | ||
124 | 124 | setlocale(LC_ALL, ""); |
125 | 125 | bindtextdomain(PACKAGE_NAME, LOCALEDIR); |
126 | 126 | textdomain(PACKAGE_NAME); |
127 | #endif | |
128 | 127 | |
129 | 128 | if (argc == 2 && |
130 | 129 | (!strcmp(argv[1], "-V") || !strcmp(argv[1], "--version"))) |
1 | 1 | #include <unistd.h> |
2 | 2 | #include <getopt.h> |
3 | 3 | #include <fcntl.h> |
4 | #include <signal.h> | |
4 | 5 | #include <termios.h> |
5 | 6 | #include <sys/ioctl.h> |
6 | 7 | #include <linux/kd.h> |
8 | 9 | #include "getfd.h" |
9 | 10 | #include "nls.h" |
10 | 11 | #include "version.h" |
11 | ||
12 | #ifndef __klibc__ | |
13 | #include <signal.h> | |
14 | #else | |
15 | #include "klibc_compat.h" | |
16 | #endif | |
17 | 12 | |
18 | 13 | int tmp; /* for debugging */ |
19 | 14 | |
113 | 108 | int i, n; |
114 | 109 | |
115 | 110 | set_progname(argv[0]); |
116 | #ifndef __klibc__ | |
111 | ||
117 | 112 | setlocale(LC_ALL, ""); |
118 | 113 | bindtextdomain(PACKAGE_NAME, LOCALEDIR); |
119 | 114 | textdomain(PACKAGE_NAME); |
120 | #endif | |
121 | 115 | |
122 | 116 | while ((c = getopt_long(argc, argv, |
123 | 117 | short_opts, long_opts, NULL)) != -1) { |
16 | 16 | int fd, num; |
17 | 17 | |
18 | 18 | set_progname(argv[0]); |
19 | #ifndef __klibc__ | |
19 | ||
20 | 20 | setlocale(LC_ALL, ""); |
21 | 21 | bindtextdomain(PACKAGE_NAME, LOCALEDIR); |
22 | 22 | textdomain(PACKAGE_NAME); |
23 | #endif | |
24 | 23 | |
25 | 24 | if (argc == 2 && !strcmp(argv[1], "-V")) |
26 | 25 | print_version_and_exit(); |