Drop klibc support
authorAlexey Gladkov <gladkov.alexey@gmail.com>
Fri, 7 Jan 2011 21:37:45 +0000 (00:37 +0300)
committerAlexey Gladkov <gladkov.alexey@gmail.com>
Fri, 7 Jan 2011 21:37:45 +0000 (00:37 +0300)
Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>
33 files changed:
configure.ac
m4/klibc.m4 [deleted file]
src/Makefile.am
src/analyze.c
src/analyze.l
src/clrunimap.c
src/dumpkeys.c
src/fgconsole.c
src/findfile.c
src/getkeycodes.c
src/getunimap.c
src/kbd_mode.c
src/klibc_compat.c [deleted file]
src/klibc_compat.h [deleted file]
src/loadkeys.c
src/loadkeys.y
src/loadunimap.c
src/mapscrn.c
src/nls.h
src/psffontop.c
src/psfxtable.c
src/resizecons.c
src/setfont.c
src/setkeycodes.c
src/setleds.c
src/setlogcons.c
src/setmetamode.c
src/setvesablank.c
src/showconsolefont.c
src/showkey.c
src/totextmode.c
src/version.h
src/xmalloc.c

index a8115ed..ddf2488 100644 (file)
@@ -11,8 +11,6 @@ AM_INIT_AUTOMAKE([1.9 -Wall])
 AC_CONFIG_SRCDIR([src/loadkeys.y])
 AC_CONFIG_HEADERS(config.h)
 
-AC_CHECK_KLIBC
-
 # Checks for programs.
 AC_PROG_YACC
 AC_PROG_CC
diff --git a/m4/klibc.m4 b/m4/klibc.m4
deleted file mode 100644 (file)
index 7d40c1b..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-# klibc.m4 serial 99
-## Copyright (C) 1995-2003 Free Software Foundation, Inc.
-## This file is free software, distributed under the terms of the GNU
-## General Public License.  As a special exception to the GNU General
-## Public License, this file may be distributed as part of a program
-## that contains a configuration script generated by Autoconf, under
-## the same distribution terms as the rest of that program.
-##
-## This file can can be used in projects which are not available under
-## the GNU General Public License or the GNU Library General Public
-## License but which still want to provide support for the GNU gettext
-## functionality.
-## Please note that the actual code of the KLIBC Library is partly covered
-## by the GNU Library General Public License, and party copyrighted by the
-## Regents of The University of California, and the rest is covered by a
-## MIT style license. 
-
-# Authors:
-#   Martin Schlemmer <azarah@nosferatu.za.org>, 2005.
-
-
-# AC_CHECK_KLIBC
-# --------------
-# Check if the user wants KLIBC support enabled.  If so, set KLIBC=yes and
-# fill in KLIBC_PREFIX, KLIBC_BINDIR, KLIBC_SBINDIR, KLIBC_LIBDIR and
-# KLIBC_INCLUDEDIR.  CC is also set to the proper klcc executable.
-# NOTE:  This should be called before AC_PROG_CC, and before header, function
-#        or type checks.
-AC_DEFUN([AC_CHECK_KLIBC],
-[AC_BEFORE([$0], [AC_PROG_CC])
-AC_REQUIRE([AC_CANONICAL_HOST])
-AC_ARG_ENABLE([klibc],
-              [AS_HELP_STRING([--enable-klibc],
-                              [Enable linking to klibc [no].  You need at
-                               least klibc-1.0 or later for this.  Set KLCC
-                               to the absolute file name of klcc if not in
-                               the PATH])],
-              [KLIBC=$enableval], [KLIBC=no])
-AC_ARG_ENABLE([klibc-layout],
-              [AS_HELP_STRING([--enable-klibc-layout],
-                              [Enable installing binaries, libraries and
-                               headers into the klibc prefix [yes] ])],
-              [if test "X$KLIBC" != Xno; then
-                 KLIBC_LAYOUT=$enableval
-               else
-                 KLIBC_LAYOUT=no
-               fi],
-              [if test "X$KLIBC" != Xno; then
-                 KLIBC_LAYOUT=yes
-               else
-                 KLIBC_LAYOUT=no
-               fi])
-
-if test "X$KLIBC" != Xno; then
-  # Basic cross compiling support.  I do not think it is wise to use
-  # AC_CHECK_TOOL, because if we are cross compiling, we do not want
-  # just 'klcc' to be returned ...
-  if test "${host_alias}" != "${build_alias}"; then
-    AC_CHECK_PROGS([KLCC], [${host_alias}-klcc], [no])
-  else
-    AC_CHECK_PROGS([KLCC], [klcc], [no])
-  fi
-  if test "X$KLCC" = Xno; then
-    AC_MSG_ERROR([cannot find klibc frontend 'klcc'!])
-  fi
-
-  CC="$KLCC"
-  CFLAGS="-Os -D__klibc__"
-  #AC_DEFINE(__klibc__, 1, [Enable linking to klibc])
-
-  KLIBC_KCROSS="$($KLCC -print-klibc-kcross 2>/dev/null)"
-  KLIBC_PREFIX="$($KLCC -print-klibc-prefix 2>/dev/null)"
-  KLIBC_BIN_DIR="$($KLCC -print-klibc-bindir 2>/dev/null)"
-  KLIBC_SBIN_DIR="${KLIBC_PREFIX}/${KLIBC_KCROSS}sbin"
-  KLIBC_LIB_DIR="$($KLCC -print-klibc-libdir 2>/dev/null)"
-  KLIBC_INCLUDE_DIR="$($KLCC -print-klibc-includedir 2>/dev/null)"
-
-  if test "X$KLIBC_LAYOUT" != Xno; then
-    prefix="$KLIBC_PREFIX"
-    bindir="$KLIBC_BIN_DIR"
-    sbindir="$KLIBC_SBIN_DIR"
-    libdir="$KLIBC_LIB_DIR"
-    includedir="$KLIBC_INCLUDE_DIR"
-  fi
-
-  # At least KLIBC_LIB_DIR should be valid, else klibc is too old or
-  # something went wrong
-  if test ! -d "$KLIBC_LIB_DIR"; then
-    AC_MSG_ERROR([your klibc installation is too old or not functional!])
-  fi
-fi
-
-AC_SUBST(KLIBC)
-AM_CONDITIONAL(KLIBC, test "$KLIBC" != "no")
-])# AC_CHECK_KLIBC
-
index 2a8b81d..7e2cadb 100644 (file)
@@ -8,11 +8,8 @@ AM_CPPFLAGS = -DDATADIR=\"$(datadir)\" -DLOCALEDIR=\"$(localedir)\" $(WARNINGS)
 OLDPROGS = mapscrn loadunimap
 PROGS = \
        dumpkeys loadkeys showkey setfont showconsolefont \
-       setleds setmetamode kbd_mode psfxtable fgconsole
-
-if !KLIBC
-PROGS += kbdrate chvt deallocvt openvt
-endif
+       setleds setmetamode kbd_mode psfxtable fgconsole \
+       kbdrate chvt deallocvt openvt
 
 if KEYCODES_PROGS
 PROGS += getkeycodes setkeycodes
@@ -24,11 +21,8 @@ endif
 
 if OPTIONAL_PROGS
 PROGS += \
-       setlogcons setvesablank getunimap clrunimap outpsfheader setpalette
-
-if !KLIBC
-PROGS += screendump spawn_console spawn_login
-endif
+       setlogcons setvesablank getunimap clrunimap outpsfheader setpalette \
+       screendump spawn_console spawn_login
 endif
 
 dist_bin_SCRIPTS = unicode_start unicode_stop
@@ -49,10 +43,6 @@ UNIM_S  = loadunimap.c loadunimap.h
 UTF8_S  = utf8.c utf8.h
 XMAL_S  = xmalloc.c xmalloc.h
 
-if KLIBC
-KLIBC_S = klibc_compat.c klibc_compat.h
-endif
-
 chvt_SOURCES            = $(ALL_S) chvt.c $(GETFD_S)
 clrunimap_SOURCES       = $(ALL_S) clrunimap.c $(GETFD_S) $(KDMA_S)
 deallocvt_SOURCES       = $(ALL_S) deallocvt.c $(GETFD_S)
@@ -61,20 +51,20 @@ fgconsole_SOURCES       = $(ALL_S) fgconsole.c $(GETFD_S)
 getkeycodes_SOURCES     = $(ALL_S) getkeycodes.c $(GETFD_S)
 getunimap_SOURCES       = $(ALL_S) getunimap.c $(GETFD_S) $(KDMA_S)
 kbd_mode_SOURCES        = $(ALL_S) kbd_mode.c $(GETFD_S)
-loadkeys_SOURCES        = $(ALL_S) loadkeys.y $(GETFD_S) $(KSYMS_S) $(XMAL_S) $(FIND_S) $(KLIBC_S)
-loadunimap_SOURCES      = $(ALL_S) loadunimap.c $(FIND_S) $(PSF_S) $(UTF8_S) $(XMAL_S) $(GETFD_S) $(KDMA_S) $(KLIBC_S)
+loadkeys_SOURCES        = $(ALL_S) loadkeys.y $(GETFD_S) $(KSYMS_S) $(XMAL_S) $(FIND_S)
+loadunimap_SOURCES      = $(ALL_S) loadunimap.c $(FIND_S) $(PSF_S) $(UTF8_S) $(XMAL_S) $(GETFD_S) $(KDMA_S)
 mapscrn_SOURCES         = $(ALL_S) mapscrn.c $(FIND_S) $(UTF8_S) $(XMAL_S) $(GETFD_S) $(KDMA_S)
 openvt_SOURCES          = $(ALL_S) openvt.c openvt.h $(GETFD_S)
-psfxtable_SOURCES       = $(ALL_S) psfxtable.c $(PSF_S) $(XMAL_S) $(UTF8_S) $(GETFD_S) $(KLIBC_S)
+psfxtable_SOURCES       = $(ALL_S) psfxtable.c $(PSF_S) $(XMAL_S) $(UTF8_S) $(GETFD_S)
 resizecons_SOURCES      = $(ALL_S) resizecons.c $(GETFD_S) $(FIND_S) $(XMAL_S)
 screendump_SOURCES      = $(ALL_S) screendump.c $(XMAL_S)
-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)
+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)
 setkeycodes_SOURCES     = $(ALL_S) setkeycodes.c $(GETFD_S)
 setlogcons_SOURCES      = $(ALL_S) setlogcons.c $(GETFD_S)
 setpalette_SOURCES      = $(ALL_S) setpalette.c $(GETFD_S)
 setvesablank_SOURCES    = $(ALL_S) setvesablank.c $(GETFD_S)
 showconsolefont_SOURCES = $(ALL_S) showconsolefont.c $(GETFD_S) $(XMAL_S) $(KDMA_S) kdfontop.c kdfontop.h
-showkey_SOURCES         = $(ALL_S) showkey.c $(GETFD_S) $(KLIBC_S)
+showkey_SOURCES         = $(ALL_S) showkey.c $(GETFD_S)
 
 mapscrn_CFLAGS = -DMAIN
 loadunimap_CFLAGS = -DMAIN
index c9b0b07..3d7e258 100644 (file)
@@ -805,9 +805,6 @@ char *yytext;
 #include "ksyms.h"
 #include "kbd.h"
 #include "xmalloc.h"
-#ifdef __klibc__
-#include "klibc_compat.h"
-#endif
 
 extern int line_nr;
 int    yylval;
index dab17a7..b231564 100644 (file)
@@ -8,9 +8,6 @@
 #include "ksyms.h"
 #include "kbd.h"
 #include "xmalloc.h"
-#ifdef __klibc__
-#include "klibc_compat.h"
-#endif
 
 extern int line_nr;
 int    yylval;
index 74c9311..63d162f 100644 (file)
@@ -18,11 +18,9 @@ main(int argc, char *argv[]) {
        int fd;
        char *console = NULL;
 
-#ifndef __klibc__
        setlocale(LC_ALL, "");
        bindtextdomain(PACKAGE_NAME, LOCALEDIR);
        textdomain(PACKAGE_NAME);
-#endif
 
        if (argc >= 3 && !strcmp(argv[1], "-C"))
                console = argv[2];
index f6e7ff5..326ec37 100644 (file)
@@ -603,11 +603,10 @@ main (int argc, char *argv[]) {
        char diac_only = 0;
 
        set_progname(argv[0]);
-#ifndef __klibc__
+
        setlocale(LC_ALL, "");
        bindtextdomain(PACKAGE_NAME, LOCALEDIR);
        textdomain(PACKAGE_NAME);
-#endif
 
        while ((c = getopt_long(argc, argv,
                short_opts, long_opts, NULL)) != -1) {
index bb860e8..268bfda 100644 (file)
@@ -38,11 +38,9 @@ main(int argc, char **argv){
           { "next-available", no_argument, NULL, 'n' },
           { NULL, 0, NULL, 0 } };
 
-#ifndef __klibc__
        setlocale(LC_ALL, "");
        bindtextdomain(PACKAGE_NAME, LOCALEDIR);
        textdomain(PACKAGE_NAME);
-#endif
 
        set_progname(argv[0]);
        while (( c = getopt_long (argc, argv, "Vhn", long_opts, NULL)) != EOF) {
index c050bd8..b51db77 100644 (file)
@@ -13,17 +13,14 @@ char pathname[1024];
 static int ispipe;
 
 void fpclose(FILE *fp) {
-#ifndef __klibc__
        if (ispipe)
             pclose(fp);
        else
-#endif /* __klibc__ */
             fclose(fp);
 }
 
 #define SIZE(a) (sizeof(a)/sizeof(a[0]))
 
-#ifndef __klibc__
 static struct decompressor {
        char *ext;              /* starts with `.', has no other dots */
        char *cmd;
@@ -46,14 +43,12 @@ pipe_open(struct decompressor *dc) {
                fprintf(stderr, _("error executing  %s\n"), pipe_cmd);
        return fp;
 }
-#endif /* __klibc__ */
 
 /* If a file PATHNAME exists, then open it.
    If is has a `compressed' extension, then open a pipe reading it */
 static FILE *
 maybe_pipe_open(void) {
        FILE *fp;
-#ifndef __klibc__
        char *t;
        struct decompressor *dc;
 
@@ -67,9 +62,6 @@ maybe_pipe_open(void) {
                    }
            }
        }
-#else
-       fp = fopen(pathname, "r");
-#endif /* __klibc__ */
        return fp;
 }
 
@@ -79,9 +71,7 @@ findfile_in_dir(char *fnam, char *dir, int recdepth, char **suf) {
        DIR *d;
        struct dirent *de;
        char *ff, *fdir, *p, *q, **sp;
-#ifndef __klibc__
        struct decompressor *dc;
-#endif /* __klibc__ */
        int secondpass = 0;
 
        ispipe = 0;
@@ -152,21 +142,17 @@ findfile_in_dir(char *fnam, char *dir, int recdepth, char **suf) {
            /* Does tail consist of a known suffix and possibly
               a compression suffix? */
            for(sp = suf; *sp; sp++) {
-#ifndef __klibc__
                    int l;
-#endif /* __klibc__ */
 
                    if (!strcmp(p, *sp))
                            return maybe_pipe_open();
 
-#ifndef __klibc__
                    l = strlen(*sp);
                    if (strncmp(p,*sp,l) == 0) {
                        for (dc = &decompressors[0]; dc->cmd; dc++)
                            if (strcmp(p+l, dc->ext) == 0)
                                return pipe_open(dc);
                    }
-#endif /* __klibc__ */
            }
        }
        closedir(d);
@@ -182,9 +168,7 @@ FILE *findfile(char *fnam, char **dirpath, char **suffixes) {
         char **dp, *dir, **sp;
        FILE *fp;
        int dl, recdepth;
-#ifndef __klibc__
        struct decompressor *dc;
-#endif /* __klibc__ */
 
        if (strlen(fnam) >= sizeof(pathname))
                return NULL;
@@ -211,7 +195,6 @@ FILE *findfile(char *fnam, char **dirpath, char **suffixes) {
                    return fp;
            }
 
-#ifndef __klibc__
            for (sp = suffixes; *sp; sp++) {
                for (dc = &decompressors[0]; dc->cmd; dc++) {
                    if (strlen(fnam) + strlen(*sp)
@@ -226,7 +209,6 @@ FILE *findfile(char *fnam, char **dirpath, char **suffixes) {
                    }
                }
            }
-#endif /* __klibc__ */
 
            return NULL;
        }
index 6504e7e..9bee144 100644 (file)
@@ -27,11 +27,10 @@ main(int argc, char **argv) {
        int old_kernel = 0;
 
        set_progname(argv[0]);
-#ifndef __klibc__
+
        setlocale(LC_ALL, "");
        bindtextdomain(PACKAGE_NAME, LOCALEDIR);
        textdomain(PACKAGE_NAME);
-#endif
 
        if (argc == 2 && !strcmp(argv[1], "-V"))
                print_version_and_exit();
index 0097d5f..e36326d 100644 (file)
@@ -40,11 +40,10 @@ main(int argc, char **argv){
        struct unimapdesc ud;
 
        set_progname(argv[0]);
-#ifndef __klibc__
+
        setlocale(LC_ALL, "");
        bindtextdomain(PACKAGE_NAME, LOCALEDIR);
        textdomain(PACKAGE_NAME);
-#endif
 
        if (argc == 2 &&
            (!strcmp(argv[1], "-V") || !strcmp(argv[1], "--version")))
index b286678..991df8d 100644 (file)
@@ -27,11 +27,10 @@ main(int argc, char *argv[]){
         char *console = NULL;
 
        set_progname(argv[0]);
-#ifndef __klibc__
+
        setlocale(LC_ALL, "");
        bindtextdomain(PACKAGE_NAME, LOCALEDIR);
        textdomain(PACKAGE_NAME);
-#endif
 
        if (argc == 2 && !strcmp(argv[1], "-V"))
            print_version_and_exit();
diff --git a/src/klibc_compat.c b/src/klibc_compat.c
deleted file mode 100644 (file)
index c8c994e..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#include <stdio.h>
-#include <errno.h>
-#include "kbd.h"
-#include "klibc_compat.h"
-
-void clearerr(attr_unused FILE *stream) {
-    errno = 0;
-}
-
-void rewind(FILE *stream) {
-    (void)fseek(stream, 0L, SEEK_SET);
-    clearerr(stream);
-}
-
-int feof(attr_unused FILE *stream) {
-    return (errno == EOF);
-}
-
-int ferror(attr_unused FILE *stream) {
-    return (errno != 0 && errno != EOF);
-}
-
-int ungetc(int c, FILE *stream) {
-    if (fseek(stream, -1, SEEK_CUR) < 0)
-       return EOF;
-    else
-       return c;
-}
diff --git a/src/klibc_compat.h b/src/klibc_compat.h
deleted file mode 100644 (file)
index 4f6940d..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifdef __klibc__
-#ifndef _KLIBC_COMPAT_H
-#define _KLIBC_COMPAT_H
-
-#include <malloc.h>
-
-#define signal sysv_signal
-
-extern void clearerr(FILE *stream);
-extern void rewind(FILE *stream);
-extern int feof(FILE *stream);
-extern int ferror(FILE *stream);
-extern int ungetc(int c, FILE *stream);
-
-#endif
-#endif /* __klibc__ */
index 7c403d6..0752d85 100644 (file)
@@ -1,10 +1,9 @@
-
-/* A Bison parser, made by GNU Bison 2.4.1.  */
+/* A Bison parser, made by GNU Bison 2.4.3.  */
 
 /* Skeleton implementation for Bison's Yacc-like parsers in C
    
-      Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
-   Free Software Foundation, Inc.
+      Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+   2009, 2010 Free Software Foundation, Inc.
    
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -46,7 +45,7 @@
 #define YYBISON 1
 
 /* Bison version.  */
-#define YYBISON_VERSION "2.4.1"
+#define YYBISON_VERSION "2.4.3"
 
 /* Skeleton name.  */
 #define YYSKELETON_NAME "yacc.c"
@@ -163,7 +162,7 @@ int yylex (void);
 
 
 /* Line 189 of yacc.c  */
-#line 167 "loadkeys.c"
+#line 166 "loadkeys.c"
 
 /* Enabling traces.  */
 #ifndef YYDEBUG
@@ -275,7 +274,7 @@ typedef int YYSTYPE;
 
 
 /* Line 264 of yacc.c  */
-#line 279 "loadkeys.c"
+#line 278 "loadkeys.c"
 
 #ifdef short
 # undef short
@@ -325,7 +324,7 @@ typedef short int yytype_int16;
 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
 
 #ifndef YY_
-# if YYENABLE_NLS
+# if defined YYENABLE_NLS && YYENABLE_NLS
 #  if ENABLE_NLS
 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
 #   define YY_(msgid) dgettext ("bison-runtime", msgid)
@@ -749,9 +748,18 @@ static const yytype_uint8 yystos[] =
 
 /* Like YYERROR except do call yyerror.  This remains here temporarily
    to ease the transition to the new meaning of YYERROR, for GCC.
-   Once GCC version 2 has supplanted version 1, this can go.  */
+   Once GCC version 2 has supplanted version 1, this can go.  However,
+   YYFAIL appears to be in use.  Nevertheless, it is formally deprecated
+   in Bison 2.4.2's NEWS entry, where a plan to phase it out is
+   discussed.  */
 
 #define YYFAIL         goto yyerrlab
+#if defined YYFAIL
+  /* This is here to suppress warnings from the GCC cpp's
+     -Wunused-macros.  Normally we don't worry about that warning, but
+     some users do, and we want to make it easy for users to remove
+     YYFAIL uses, which will produce warnings from Bison 2.5.  */
+#endif
 
 #define YYRECOVERING()  (!!yyerrstatus)
 
@@ -808,7 +816,7 @@ while (YYID (0))
    we won't break user code: when these are the locations we know.  */
 
 #ifndef YY_LOCATION_PRINT
-# if YYLTYPE_IS_TRIVIAL
+# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
 #  define YY_LOCATION_PRINT(File, Loc)                 \
      fprintf (File, "%d.%d-%d.%d",                     \
              (Loc).first_line, (Loc).first_column,     \
@@ -1547,7 +1555,7 @@ yyreduce:
     {
         case 14:
 
-/* Line 1455 of yacc.c  */
+/* Line 1464 of yacc.c  */
 #line 121 "loadkeys.y"
     {
                            set_charset((char *) kbs_buf.kb_string);
@@ -1556,7 +1564,7 @@ yyreduce:
 
   case 15:
 
-/* Line 1455 of yacc.c  */
+/* Line 1464 of yacc.c  */
 #line 126 "loadkeys.y"
     {
                            alt_is_meta = 1;
@@ -1565,7 +1573,7 @@ yyreduce:
 
   case 16:
 
-/* Line 1455 of yacc.c  */
+/* Line 1464 of yacc.c  */
 #line 131 "loadkeys.y"
     {
                            strings_as_usual();
@@ -1574,7 +1582,7 @@ yyreduce:
 
   case 17:
 
-/* Line 1455 of yacc.c  */
+/* Line 1464 of yacc.c  */
 #line 136 "loadkeys.y"
     {
                            compose_as_usual((char *) kbs_buf.kb_string);
@@ -1583,7 +1591,7 @@ yyreduce:
 
   case 18:
 
-/* Line 1455 of yacc.c  */
+/* Line 1464 of yacc.c  */
 #line 140 "loadkeys.y"
     {
                            compose_as_usual(0);
@@ -1592,7 +1600,7 @@ yyreduce:
 
   case 19:
 
-/* Line 1455 of yacc.c  */
+/* Line 1464 of yacc.c  */
 #line 145 "loadkeys.y"
     {
                            keymaps_line_seen = 1;
@@ -1601,7 +1609,7 @@ yyreduce:
 
   case 22:
 
-/* Line 1455 of yacc.c  */
+/* Line 1464 of yacc.c  */
 #line 153 "loadkeys.y"
     {
                            int i;
@@ -1612,7 +1620,7 @@ yyreduce:
 
   case 23:
 
-/* Line 1455 of yacc.c  */
+/* Line 1464 of yacc.c  */
 #line 159 "loadkeys.y"
     {
                            addmap((yyvsp[(1) - (1)]),1);
@@ -1621,7 +1629,7 @@ yyreduce:
 
   case 24:
 
-/* Line 1455 of yacc.c  */
+/* Line 1464 of yacc.c  */
 #line 164 "loadkeys.y"
     {
                            if (KTYP((yyvsp[(2) - (5)])) != KT_FN)
@@ -1634,7 +1642,7 @@ yyreduce:
 
   case 25:
 
-/* Line 1455 of yacc.c  */
+/* Line 1464 of yacc.c  */
 #line 173 "loadkeys.y"
     {
                            compose((yyvsp[(2) - (6)]), (yyvsp[(3) - (6)]), (yyvsp[(5) - (6)]));
@@ -1643,7 +1651,7 @@ yyreduce:
 
   case 26:
 
-/* Line 1455 of yacc.c  */
+/* Line 1464 of yacc.c  */
 #line 177 "loadkeys.y"
     {
                            compose((yyvsp[(2) - (6)]), (yyvsp[(3) - (6)]), (yyvsp[(5) - (6)]));
@@ -1652,28 +1660,28 @@ yyreduce:
 
   case 27:
 
-/* Line 1455 of yacc.c  */
+/* Line 1464 of yacc.c  */
 #line 182 "loadkeys.y"
     { (yyval) = (yyvsp[(1) - (1)]); }
     break;
 
   case 28:
 
-/* Line 1455 of yacc.c  */
+/* Line 1464 of yacc.c  */
 #line 184 "loadkeys.y"
     { (yyval) = (yyvsp[(1) - (1)]) ^ 0xf000; }
     break;
 
   case 29:
 
-/* Line 1455 of yacc.c  */
+/* Line 1464 of yacc.c  */
 #line 186 "loadkeys.y"
     { mod = 0; }
     break;
 
   case 30:
 
-/* Line 1455 of yacc.c  */
+/* Line 1464 of yacc.c  */
 #line 188 "loadkeys.y"
     {
                            addkey((yyvsp[(4) - (7)]), mod, (yyvsp[(6) - (7)]));
@@ -1682,7 +1690,7 @@ yyreduce:
 
   case 31:
 
-/* Line 1455 of yacc.c  */
+/* Line 1464 of yacc.c  */
 #line 192 "loadkeys.y"
     {
                            addkey((yyvsp[(3) - (6)]), 0, (yyvsp[(5) - (6)]));
@@ -1691,70 +1699,70 @@ yyreduce:
 
   case 34:
 
-/* Line 1455 of yacc.c  */
+/* Line 1464 of yacc.c  */
 #line 199 "loadkeys.y"
     { mod |= M_SHIFT;  }
     break;
 
   case 35:
 
-/* Line 1455 of yacc.c  */
+/* Line 1464 of yacc.c  */
 #line 200 "loadkeys.y"
     { mod |= M_CTRL;   }
     break;
 
   case 36:
 
-/* Line 1455 of yacc.c  */
+/* Line 1464 of yacc.c  */
 #line 201 "loadkeys.y"
     { mod |= M_ALT;            }
     break;
 
   case 37:
 
-/* Line 1455 of yacc.c  */
+/* Line 1464 of yacc.c  */
 #line 202 "loadkeys.y"
     { mod |= M_ALTGR;  }
     break;
 
   case 38:
 
-/* Line 1455 of yacc.c  */
+/* Line 1464 of yacc.c  */
 #line 203 "loadkeys.y"
     { mod |= M_SHIFTL; }
     break;
 
   case 39:
 
-/* Line 1455 of yacc.c  */
+/* Line 1464 of yacc.c  */
 #line 204 "loadkeys.y"
     { mod |= M_SHIFTR; }
     break;
 
   case 40:
 
-/* Line 1455 of yacc.c  */
+/* Line 1464 of yacc.c  */
 #line 205 "loadkeys.y"
     { mod |= M_CTRLL;  }
     break;
 
   case 41:
 
-/* Line 1455 of yacc.c  */
+/* Line 1464 of yacc.c  */
 #line 206 "loadkeys.y"
     { mod |= M_CTRLR;  }
     break;
 
   case 42:
 
-/* Line 1455 of yacc.c  */
+/* Line 1464 of yacc.c  */
 #line 207 "loadkeys.y"
     { mod |= M_CAPSSHIFT;      }
     break;
 
   case 43:
 
-/* Line 1455 of yacc.c  */
+/* Line 1464 of yacc.c  */
 #line 210 "loadkeys.y"
     {
            int i, j;
@@ -1790,7 +1798,7 @@ yyreduce:
 
   case 46:
 
-/* Line 1455 of yacc.c  */
+/* Line 1464 of yacc.c  */
 #line 246 "loadkeys.y"
     {
                            if (rvalct >= MAX_NR_KEYMAPS)
@@ -1801,50 +1809,50 @@ yyreduce:
 
   case 47:
 
-/* Line 1455 of yacc.c  */
+/* Line 1464 of yacc.c  */
 #line 253 "loadkeys.y"
     {(yyval)=convert_code((yyvsp[(1) - (1)]), TO_AUTO);}
     break;
 
   case 48:
 
-/* Line 1455 of yacc.c  */
+/* Line 1464 of yacc.c  */
 #line 255 "loadkeys.y"
     {(yyval)=add_capslock((yyvsp[(2) - (2)]));}
     break;
 
   case 49:
 
-/* Line 1455 of yacc.c  */
+/* Line 1464 of yacc.c  */
 #line 257 "loadkeys.y"
     {(yyval)=convert_code((yyvsp[(1) - (1)])^0xf000, TO_AUTO);}
     break;
 
   case 50:
 
-/* Line 1455 of yacc.c  */
+/* Line 1464 of yacc.c  */
 #line 259 "loadkeys.y"
     {(yyval)=add_capslock((yyvsp[(2) - (2)])^0xf000);}
     break;
 
   case 51:
 
-/* Line 1455 of yacc.c  */
+/* Line 1464 of yacc.c  */
 #line 261 "loadkeys.y"
     {(yyval)=(yyvsp[(1) - (1)]);}
     break;
 
   case 52:
 
-/* Line 1455 of yacc.c  */
+/* Line 1464 of yacc.c  */
 #line 263 "loadkeys.y"
     {(yyval)=add_capslock((yyvsp[(2) - (2)]));}
     break;
 
 
 
-/* Line 1455 of yacc.c  */
-#line 1848 "loadkeys.c"
+/* Line 1464 of yacc.c  */
+#line 1856 "loadkeys.c"
       default: break;
     }
   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@@ -2055,7 +2063,7 @@ yyreturn:
 
 
 
-/* Line 1675 of yacc.c  */
+/* Line 1684 of yacc.c  */
 #line 265 "loadkeys.y"
                        
 
@@ -2120,11 +2128,10 @@ main(int argc, char *argv[]) {
        char *console = NULL;
 
        set_progname(argv[0]);
-#ifndef __klibc__
+
        setlocale(LC_ALL, "");
        bindtextdomain(PACKAGE_NAME, LOCALEDIR);
        textdomain(PACKAGE_NAME);
-#endif
 
        while ((c = getopt_long(argc, argv,
                short_opts, long_opts, NULL)) != -1) {
@@ -2167,6 +2174,12 @@ main(int argc, char *argv[]) {
                }
        }
 
+       if (optu && opta) {
+               fprintf(stderr, _("%s: Options --unicode and --ascii are mutually exclusive\n"),
+                       progname);
+               exit(1);
+       }
+
        prefer_unicode = optu;
        if (!optm && !optb) {
                /* check whether the keyboard is in Unicode mode */
@@ -2970,7 +2983,7 @@ compose_as_usual(char *charset) {
                exit(1);
        } else {
                struct ccc {
-                       char c1, c2, c3;
+                       unsigned char c1, c2, c3;
                } def_latin1_composes[68] = {
                        { '`', 'A', 0300 }, { '`', 'a', 0340 },
                        { '\'', 'A', 0301 }, { '\'', 'a', 0341 },
index cc7e2ab..2ba3b76 100644 (file)
@@ -325,11 +325,10 @@ main(int argc, char *argv[]) {
        char *console = NULL;
 
        set_progname(argv[0]);
-#ifndef __klibc__
+
        setlocale(LC_ALL, "");
        bindtextdomain(PACKAGE_NAME, LOCALEDIR);
        textdomain(PACKAGE_NAME);
-#endif
 
        while ((c = getopt_long(argc, argv,
                short_opts, long_opts, NULL)) != -1) {
index 7a876a8..249e900 100644 (file)
@@ -52,11 +52,10 @@ main(int argc, char *argv[]) {
        char *infnam = "def.uni";
 
        set_progname(argv[0]);
-#ifndef __klibc__
+
        setlocale(LC_ALL, "");
        bindtextdomain(PACKAGE_NAME, LOCALEDIR);
        textdomain(PACKAGE_NAME);
-#endif
 
        if (argc == 2 &&
            (!strcmp(argv[1], "-V") || !strcmp(argv[1], "--version")))
index e1140b7..a08634e 100644 (file)
@@ -4,9 +4,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#ifndef __klibc__
 #include <memory.h>
-#endif
 #include <string.h>
 #include <fcntl.h>
 #include <sys/types.h>
@@ -42,11 +40,10 @@ main(int argc, char *argv[]) {
        int fd;
 
        set_progname(argv[0]);
-#ifndef __klibc__
+
        setlocale(LC_ALL, "");
        bindtextdomain(PACKAGE_NAME, LOCALEDIR);
        textdomain(PACKAGE_NAME);
-#endif
 
        if (argc == 2 && !strcmp(argv[1], "-V"))
            print_version_and_exit();
index f275d55..5960c0d 100644 (file)
--- a/src/nls.h
+++ b/src/nls.h
@@ -5,11 +5,9 @@
 #define LOCALEDIR "/usr/share/locale"
 #endif
 
-#ifndef __klibc__
 #ifdef HAVE_LOCALE_H
 # include <locale.h>
 #endif
-#endif
 
 #ifdef ENABLE_NLS
 # include <libintl.h>
index 40577df..9d7ee54 100644 (file)
 #include "utf8.h"
 #include "paths.h"
 
-#ifdef __klibc__
-#include "klibc_compat.h"
-#endif
-
 extern char *progname;
 
 static void
index fdefc07..0eda1bd 100644 (file)
@@ -238,11 +238,10 @@ main(int argc, char **argv) {
        int inbuflth, fontbuflth;
 
        set_progname(argv[0]);
-#ifndef __klibc__
+
        setlocale(LC_ALL, "");
        bindtextdomain(PACKAGE_NAME, LOCALEDIR);
        textdomain(PACKAGE_NAME);
-#endif
 
        if (argc == 2 && !strcmp(argv[1], "-V"))
                print_version_and_exit();
index c0f85a5..38b548f 100644 (file)
@@ -120,11 +120,10 @@ main(int argc, char **argv) {
     char *defaultfont;
 
     set_progname(argv[0]);
-#ifndef __klibc__
+
     setlocale(LC_ALL, "");
     bindtextdomain(PACKAGE_NAME, LOCALEDIR);
     textdomain(PACKAGE_NAME);
-#endif
 
     if (argc < 2)
       usage();
index 8efa528..511a94b 100644 (file)
@@ -11,9 +11,7 @@
  */
 
 #include <stdio.h>
-#ifndef __klibc__
 #include <memory.h>
-#endif
 #include <fcntl.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -110,11 +108,10 @@ main(int argc, char *argv[]) {
        int restore = 0;
 
        set_progname(argv[0]);
-#ifndef __klibc__
+
        setlocale(LC_ALL, "");
        bindtextdomain(PACKAGE_NAME, LOCALEDIR);
        textdomain(PACKAGE_NAME);
-#endif
 
        ifiles[0] = mfil = ufil = Ofil = ofil = omfil = oufil = NULL;
        iunit = hwunit = 0;
index 8ae8fb2..f48da2a 100644 (file)
@@ -31,11 +31,10 @@ main(int argc, char **argv) {
        struct kbkeycode a;
 
        set_progname(argv[0]);
-#ifndef __klibc__
+
        setlocale(LC_ALL, "");
        bindtextdomain(PACKAGE_NAME, LOCALEDIR);
        textdomain(PACKAGE_NAME);
-#endif
 
        if (argc == 2 && !strcmp(argv[1], "-V"))
                print_version_and_exit();
index b7d0907..3577aee 100644 (file)
@@ -162,11 +162,10 @@ main(int argc, char **argv) {
     struct led *lp;
 
     set_progname(argv[0]);
-#ifndef __klibc__
+
     setlocale(LC_ALL, "");
     bindtextdomain(PACKAGE_NAME, LOCALEDIR);
     textdomain(PACKAGE_NAME);
-#endif
 
     if (argc == 2 && (!strcmp("-V", argv[1]) || !strcmp("--version", argv[1])))
        print_version_and_exit();
index 46246b5..cfccb85 100644 (file)
@@ -17,11 +17,9 @@ main(int argc, char **argv){
        int fd, cons;
        struct { char fn, subarg; } arg;
 
-#ifndef __klibc__
        setlocale(LC_ALL, "");
        bindtextdomain(PACKAGE_NAME, LOCALEDIR);
        textdomain(PACKAGE_NAME);
-#endif
 
        if (argc == 2)
                cons = atoi(argv[1]);
index 9e05d71..1d927b0 100644 (file)
@@ -64,11 +64,10 @@ main(int argc, char **argv) {
     struct meta *mp;
 
     set_progname(argv[0]);
-#ifndef __klibc__
+
     setlocale(LC_ALL, "");
     bindtextdomain(PACKAGE_NAME, LOCALEDIR);
     textdomain(PACKAGE_NAME);
-#endif
 
     if (argc == 2 && !strcmp(argv[1], "-V"))
        print_version_and_exit();
index c0c0247..f0e23bd 100644 (file)
@@ -15,11 +15,9 @@ main(int argc, char *argv[]) {
        int fd;
        struct { char ten, onoff; } arg;
 
-#ifndef __klibc__
        setlocale(LC_ALL, "");
        bindtextdomain(PACKAGE_NAME, LOCALEDIR);
        textdomain(PACKAGE_NAME);
-#endif
 
        if (argc != 2) {
                fprintf(stderr, _("usage: %s\n"), "setvesablank ON|on|off");
index 08c430d..733e634 100644 (file)
@@ -121,11 +121,10 @@ main (int argc, char **argv) {
        int list[64], lth, info = 0, verbose = 0;
 
        set_progname(argv[0]);
-#ifndef __klibc__
+
        setlocale(LC_ALL, "");
        bindtextdomain(PACKAGE_NAME, LOCALEDIR);
        textdomain(PACKAGE_NAME);
-#endif
 
        if (argc == 2 &&
            (!strcmp(argv[1], "-V") || !strcmp(argv[1], "--version")))
index 0c40541..988238a 100644 (file)
@@ -2,6 +2,7 @@
 #include <unistd.h>
 #include <getopt.h>
 #include <fcntl.h>
+#include <signal.h>
 #include <termios.h>
 #include <sys/ioctl.h>
 #include <linux/kd.h>
 #include "nls.h"
 #include "version.h"
 
-#ifndef __klibc__
-       #include <signal.h>
-#else
-       #include "klibc_compat.h"
-#endif
-
 int tmp;       /* for debugging */
 
 int fd;
@@ -114,11 +109,10 @@ main (int argc, char *argv[]) {
        int i, n;
 
        set_progname(argv[0]);
-#ifndef __klibc__
+
        setlocale(LC_ALL, "");
        bindtextdomain(PACKAGE_NAME, LOCALEDIR);
        textdomain(PACKAGE_NAME);
-#endif
 
        while ((c = getopt_long(argc, argv,
                                short_opts, long_opts, NULL)) != -1) {
index 3d114e3..3d59061 100644 (file)
@@ -17,11 +17,10 @@ main(int argc, char *argv[]) {
        int fd, num;
 
        set_progname(argv[0]);
-#ifndef __klibc__
+
        setlocale(LC_ALL, "");
        bindtextdomain(PACKAGE_NAME, LOCALEDIR);
        textdomain(PACKAGE_NAME);
-#endif
 
        if (argc == 2 && !strcmp(argv[1], "-V"))
                print_version_and_exit();
index 7d10978..2d94efa 100644 (file)
@@ -1,8 +1,5 @@
 #include "kbd.h"
 #include "../config.h"
-#ifdef __klibc__
-#include "klibc_compat.h"
-#endif
 #include <string.h>
 #include <stdlib.h>
 
index a7e02d6..081db0a 100644 (file)
@@ -8,10 +8,6 @@
 #include "nls.h"
 #include "xmalloc.h"
 
-#ifdef __klibc__
-#include "klibc_compat.h"
-#endif
-
 extern char *progname;
 
 static void attr_noreturn