AC_CONFIG_SRCDIR([src/showkey.c])
AC_CONFIG_HEADERS(config.h)
+m4_include(m4/klibc.m4)
+AC_CHECK_KLIBC
+
# Checks for programs.
AC_PROG_YACC
AC_PROG_CC
--- /dev/null
+# 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
+
{"assuming iso-8859-3 %s\n", 60},
{"assuming iso-8859-4 %s\n", 61},
{"unknown keysym '%s'\n", 62},
- {"plus before %s ignored\n", 63},
- {"'%s' is not a function key symbol", 64},
- {"too many (%d) entries on one line", 65},
- {"too many key definitions on one line", 66},
+ {"'%s' is not a function key symbol", 63},
+ {"too many (%d) entries on one line", 64},
+ {"too many key definitions on one line", 65},
{"\
loadkeys version %s\n\
\n\
-h --help display this help text\n\
-m --mktable output a \"defkeymap.c\" to stdout\n\
-s --clearstrings clear kernel string table\n\
- -u --unicode implicit conversion to Unicode\n\
- -v --verbose report the changes\n", 67},
+ -u --unicode force conversion to Unicode\n\
+ -v --verbose report the changes\n", 66},
+ {"loadkeys: error reading keyboard mode\n", 67},
{"syntax error in map file\n", 68},
{"key bindings not changed\n", 69},
{"includes are nested too deeply", 70},
{"deallocate keymap %d\n", 90},
{"%s: could not deallocate keymap %d\n", 91},
{"%s: cannot deallocate or clear keymap\n", 92},
- {"%s: failed to restore keyboard mode\n", 93},
- {"\
-%s: warning: this map uses Unicode symbols, %s mode=%d\n\
- (perhaps you want to do `kbd_mode -u'?)\n", 94},
- {"failed to bind string '%s' to function %s\n", 95},
- {"failed to clear string %s\n", 96},
- {"too many compose definitions\n", 97},
- {"impossible error in do_constant", 98},
+ {"failed to bind string '%s' to function %s\n", 93},
+ {"failed to clear string %s\n", 94},
+ {"too many compose definitions\n", 95},
+ {"impossible error in do_constant", 96},
{"\
\n\
-Changed %d %s and %d %s.\n", 99},
- {"key", 100},
- {"keys", 101},
- {"string", 102},
- {"strings", 103},
- {"Loaded %d compose %s.\n", 104},
- {"definition", 105},
- {"definitions", 106},
- {"(No change in compose definitions.)\n", 107},
- {"loadkeys: don't know how to compose for %s\n", 108},
- {"Error writing map to file\n", 109},
+Changed %d %s and %d %s.\n", 97},
+ {"key", 98},
+ {"keys", 99},
+ {"string", 100},
+ {"strings", 101},
+ {"Loaded %d compose %s.\n", 102},
+ {"definition", 103},
+ {"definitions", 104},
+ {"(No change in compose definitions.)\n", 105},
+ {"loadkeys: don't know how to compose for %s\n", 106},
+ {"Error writing map to file\n", 107},
{"\
Usage:\n\
-\t%s [-C console] [-o map.orig]\n", 110},
- {"Bad input line: %s\n", 111},
- {"%s: Glyph number (0x%x) larger than font length\n", 112},
- {"%s: Bad end of range (0x%x)\n", 113},
- {"%s: Bad Unicode range corresponding to font position range 0x%x-0x%x\n", 114},
+\t%s [-C console] [-o map.orig]\n", 108},
+ {"Bad input line: %s\n", 109},
+ {"%s: Glyph number (0x%x) larger than font length\n", 110},
+ {"%s: Bad end of range (0x%x)\n", 111},
+ {"%s: Bad Unicode range corresponding to font position range 0x%x-0x%x\n", 112},
{"\
%s: Unicode range U+%x-U+%x not of the same length as font position range 0x%\
-x-0x%x\n", 115},
- {"%s: trailing junk (%s) ignored\n", 116},
- {"Loading unicode map from file %s\n", 117},
- {"%s: %s: Warning: line too long\n", 118},
+x-0x%x\n", 113},
+ {"%s: trailing junk (%s) ignored\n", 114},
+ {"Loading unicode map from file %s\n", 115},
+ {"%s: %s: Warning: line too long\n", 116},
{"\
%s: not loading empty unimap\n\
-(if you insist: use option -f to override)\n", 119},
- {"entry", 120},
- {"entries", 121},
- {"Saved unicode map on `%s'\n", 122},
- {"Appended Unicode map\n", 123},
- {"usage: %s [-v] [-o map.orig] map-file\n", 124},
- {"mapscrn: cannot open map file _%s_\n", 125},
- {"Cannot stat map file", 126},
- {"Loading binary direct-to-font screen map from file %s\n", 127},
- {"Error reading map from file `%s'\n", 128},
- {"Loading binary unicode screen map from file %s\n", 129},
- {"Loading symbolic screen map from file %s\n", 130},
- {"Error parsing symbolic map from `%s', line %d\n", 131},
- {"Cannot read console map\n", 132},
- {"Saved screen map in `%s'\n", 133},
- {"openvt: %s: illegal vt number\n", 134},
- {"openvt: only root can use the -u flag.\n", 135},
- {"openvt: cannot find a free vt\n", 136},
- {"openvt: cannot check whether vt %d is free\n", 137},
- {" use `openvt -f' to force.\n", 138},
- {"openvt: vt %d is in use; command aborted\n", 139},
- {"openvt: Unable to open %s: %s\n", 140},
- {"openvt: Cannot open %s read/write (%s)\n", 141},
- {"openvt: using VT %s\n", 142},
- {"openvt: Unable to set new session (%s)\n", 143},
+(if you insist: use option -f to override)\n", 117},
+ {"entry", 118},
+ {"entries", 119},
+ {"Saved unicode map on `%s'\n", 120},
+ {"Appended Unicode map\n", 121},
+ {"usage: %s [-v] [-o map.orig] map-file\n", 122},
+ {"mapscrn: cannot open map file _%s_\n", 123},
+ {"Cannot stat map file", 124},
+ {"Loading binary direct-to-font screen map from file %s\n", 125},
+ {"Error reading map from file `%s'\n", 126},
+ {"Loading binary unicode screen map from file %s\n", 127},
+ {"Loading symbolic screen map from file %s\n", 128},
+ {"Error parsing symbolic map from `%s', line %d\n", 129},
+ {"Cannot read console map\n", 130},
+ {"Saved screen map in `%s'\n", 131},
+ {"openvt: %s: illegal vt number\n", 132},
+ {"openvt: only root can use the -u flag.\n", 133},
+ {"openvt: cannot find a free vt\n", 134},
+ {"openvt: cannot check whether vt %d is free\n", 135},
+ {" use `openvt -f' to force.\n", 136},
+ {"openvt: vt %d is in use; command aborted\n", 137},
+ {"openvt: Unable to open %s: %s\n", 138},
+ {"openvt: Cannot open %s read/write (%s)\n", 139},
+ {"openvt: using VT %s\n", 140},
+ {"openvt: Unable to set new session (%s)\n", 141},
{"\
\n\
-openvt: could not open %s R/W (%s)\n", 144},
+openvt: could not open %s R/W (%s)\n", 142},
{"\
\n\
-openvt: could not activate vt %d (%s)\n", 145},
+openvt: could not activate vt %d (%s)\n", 143},
{"\
\n\
-openvt: activation interrupted? (%s)\n", 146},
- {"openvt: could not deallocate console %d\n", 147},
- {"\
-Usage: openvt [-c vtnumber] [-f] [-l] [-u] [-s] [-v] [-w] -- command_line\n", 148},
- {"Couldn't find owner of current tty!\n", 149},
- {"%s: short ucs2 unicode table\n", 150},
- {"%s: short utf8 unicode table\n", 151},
- {"%s: bad utf8\n", 152},
- {"%s: unknown utf8 error\n", 153},
- {"%s: short unicode table\n", 154},
- {"%s: Error reading input font", 155},
- {"%s: Bad call of readpsffont\n", 156},
- {"%s: Unsupported psf file mode (%d)\n", 157},
- {"%s: Unsupported psf version (%d)\n", 158},
- {"%s: zero input font length?\n", 159},
- {"%s: zero input character size?\n", 160},
- {"%s: Input file: bad input length (%d)\n", 161},
- {"%s: Input file: trailing garbage\n", 162},
- {"appendunicode: illegal unicode %u\n", 163},
- {"Cannot write font file header", 164},
- {"Cannot write font file", 165},
- {"%s: Warning: line too long\n", 166},
- {"%s: Bad input line: %s\n", 167},
- {"%s: Glyph number (0x%lx) past end of font\n", 168},
- {"%s: Bad end of range (0x%lx)\n", 169},
+openvt: activation interrupted? (%s)\n", 144},
+ {"openvt: could not deallocate console %d\n", 145},
+ {"\
+Usage: openvt [-c vtnumber] [-f] [-l] [-u] [-s] [-v] [-w] -- command_line\n", 146},
+ {"Couldn't find owner of current tty!\n", 147},
+ {"%s: short ucs2 unicode table\n", 148},
+ {"%s: short utf8 unicode table\n", 149},
+ {"%s: bad utf8\n", 150},
+ {"%s: unknown utf8 error\n", 151},
+ {"%s: short unicode table\n", 152},
+ {"%s: Error reading input font", 153},
+ {"%s: Bad call of readpsffont\n", 154},
+ {"%s: Unsupported psf file mode (%d)\n", 155},
+ {"%s: Unsupported psf version (%d)\n", 156},
+ {"%s: zero input font length?\n", 157},
+ {"%s: zero input character size?\n", 158},
+ {"%s: Input file: bad input length (%d)\n", 159},
+ {"%s: Input file: trailing garbage\n", 160},
+ {"appendunicode: illegal unicode %u\n", 161},
+ {"Cannot write font file header", 162},
+ {"Cannot write font file", 163},
+ {"%s: Warning: line too long\n", 164},
+ {"%s: Bad input line: %s\n", 165},
+ {"%s: Glyph number (0x%lx) past end of font\n", 166},
+ {"%s: Bad end of range (0x%lx)\n", 167},
{"\
%s: Corresponding to a range of font positions, there should be a Unicode \
-range\n", 170},
+range\n", 168},
{"\
Usage:\n\
-\t%s infont intable outfont\n", 171},
+\t%s infont intable outfont\n", 169},
{"\
Usage:\n\
-\t%s infont [outtable]\n", 172},
+\t%s infont [outtable]\n", 170},
{"\
Usage:\n\
-\t%s infont outfont\n", 173},
+\t%s infont outfont\n", 171},
{"\
Usage:\n\
-\t%s [-i infont] [-o outfont] [-it intable] [-ot outtable] [-nt]\n", 174},
- {"%s: Bad magic number on %s\n", 175},
- {"%s: psf file with unknown magic\n", 176},
- {"%s: input font does not have an index\n", 177},
- {"resizecons: cannot find videomode file %s\n", 178},
- {"Invalid number of lines\n", 179},
- {"Old mode: %dx%d New mode: %dx%d\n", 180},
- {"Old #scanlines: %d New #scanlines: %d Character height: %d\n", 181},
- {"resizecons: the command `%s' failed\n", 182},
- {"\
-resizecons: don't forget to change TERM (maybe to con%dx%d or linux-%dx%d)\n", 183},
+\t%s [-i infont] [-o outfont] [-it intable] [-ot outtable] [-nt]\n", 172},
+ {"%s: Bad magic number on %s\n", 173},
+ {"%s: psf file with unknown magic\n", 174},
+ {"%s: input font does not have an index\n", 175},
+ {"resizecons: cannot find videomode file %s\n", 176},
+ {"Invalid number of lines\n", 177},
+ {"Old mode: %dx%d New mode: %dx%d\n", 178},
+ {"Old #scanlines: %d New #scanlines: %d Character height: %d\n", 179},
+ {"resizecons: the command `%s' failed\n", 180},
+ {"\
+resizecons: don't forget to change TERM (maybe to con%dx%d or linux-%dx%d)\n", 181},
{"\
resizecons:\n\
call is: resizecons COLSxROWS or: resizecons COLS ROWS\n\
or: resizecons -lines ROWS, with ROWS one of 25, 28, 30, 34, 36, 40, 44, 50, \
-60\n", 184},
- {"resizecons: cannot get I/O permissions.\n", 185},
- {"usage: screendump [n]\n", 186},
- {"Error reading %s\n", 187},
- {"couldn't read %s, and cannot ioctl dump\n", 188},
- {"couldn't read %s\n", 189},
- {"Strange ... screen is both %dx%d and %dx%d ??\n", 190},
- {"Error writing screendump\n", 191},
+60\n", 182},
+ {"resizecons: cannot get I/O permissions.\n", 183},
+ {"usage: screendump [n]\n", 184},
+ {"Error reading %s\n", 185},
+ {"couldn't read %s, and cannot ioctl dump\n", 186},
+ {"couldn't read %s\n", 187},
+ {"Strange ... screen is both %dx%d and %dx%d ??\n", 188},
+ {"Error writing screendump\n", 189},
{"\
Usage: setfont [write-options] [-<N>] [newfont..] [-m consolemap] [-u \
unicodemap]\n\
-v Be verbose.\n\
-C <cons> Indicate console device to be used.\n\
-V Print version and exit.\n\
-Files are loaded from the current directory or %s/*/.\n", 192},
- {"setfont: too many input files\n", 193},
+Files are loaded from the current directory or %s/*/.\n", 190},
+ {"setfont: too many input files\n", 191},
{"\
setfont: cannot both restore from character ROM and from file. Font \
-unchanged.\n", 194},
- {"Bad character height %d\n", 195},
- {"Bad character width %d\n", 196},
- {"%s: font position 32 is nonblank\n", 197},
- {"%s: wiped it\n", 198},
- {"%s: background will look funny\n", 199},
- {"Loading %d-char %dx%d font from file %s\n", 200},
- {"Loading %d-char %dx%d font\n", 201},
- {"Loading %d-char %dx%d (%d) font from file %s\n", 202},
- {"Loading %d-char %dx%d (%d) font\n", 203},
- {"%s: bug in do_loadtable\n", 204},
- {"Loading Unicode mapping table...\n", 205},
- {"Cannot open font file %s\n", 206},
- {"When loading several fonts, all must be psf fonts - %s isn't\n", 207},
- {"Read %d-char %dx%d font from file %s\n", 208},
- {"When loading several fonts, all must have the same height\n", 209},
- {"When loading several fonts, all must have the same width\n", 210},
- {"Cannot find default font\n", 211},
- {"Cannot find %s font\n", 212},
- {"Reading font file %s\n", 213},
- {"No final newline in combine file\n", 214},
- {"Too many files to combine\n", 215},
- {"Hmm - a font from restorefont? Using the first half.\n", 216},
- {"Bad input file size\n", 217},
+unchanged.\n", 192},
+ {"Bad character height %d\n", 193},
+ {"Bad character width %d\n", 194},
+ {"%s: font position 32 is nonblank\n", 195},
+ {"%s: wiped it\n", 196},
+ {"%s: background will look funny\n", 197},
+ {"Loading %d-char %dx%d font from file %s\n", 198},
+ {"Loading %d-char %dx%d font\n", 199},
+ {"Loading %d-char %dx%d (%d) font from file %s\n", 200},
+ {"Loading %d-char %dx%d (%d) font\n", 201},
+ {"%s: bug in do_loadtable\n", 202},
+ {"Loading Unicode mapping table...\n", 203},
+ {"Cannot open font file %s\n", 204},
+ {"When loading several fonts, all must be psf fonts - %s isn't\n", 205},
+ {"Read %d-char %dx%d font from file %s\n", 206},
+ {"When loading several fonts, all must have the same height\n", 207},
+ {"When loading several fonts, all must have the same width\n", 208},
+ {"Cannot find default font\n", 209},
+ {"Cannot find %s font\n", 210},
+ {"Reading font file %s\n", 211},
+ {"No final newline in combine file\n", 212},
+ {"Too many files to combine\n", 213},
+ {"Hmm - a font from restorefont? Using the first half.\n", 214},
+ {"Bad input file size\n", 215},
{"\
This file contains 3 fonts: 8x8, 8x14 and 8x16. Please indicate\n\
-using an option -8 or -14 or -16 which one you want loaded.\n", 218},
- {"You asked for font size %d, but only 8, 14, 16 are possible here.\n", 219},
- {"Found nothing to save\n", 220},
- {"Saved %d-char %dx%d font file on %s\n", 221},
+using an option -8 or -14 or -16 which one you want loaded.\n", 216},
+ {"You asked for font size %d, but only 8, 14, 16 are possible here.\n", 217},
+ {"Found nothing to save\n", 218},
+ {"Saved %d-char %dx%d font file on %s\n", 219},
{"\
usage: setkeycode scancode keycode ...\n\
(where scancode is either xx or e0xx, given in hexadecimal,\n\
- and keycode is given in decimal)\n", 222},
- {"even number of arguments expected", 223},
- {"error reading scancode", 224},
- {"code outside bounds", 225},
- {"failed to set scancode %x to keycode %d\n", 226},
+ and keycode is given in decimal)\n", 220},
+ {"even number of arguments expected", 221},
+ {"error reading scancode", 222},
+ {"code outside bounds", 223},
+ {"failed to set scancode %x to keycode %d\n", 224},
{"\
Usage:\n\
\tsetleds [-v] [-L] [-D] [-F] [[+|-][ num | caps | scroll %s]]\n\
(and these are usually reflected in the leds).\n\
With -L, setleds only sets the leds, and leaves the flags alone.\n\
With -D, setleds sets both the flags and the default flags, so\n\
-that a subsequent reset will not change the flags.\n", 227},
- {"on ", 228},
- {"off", 229},
- {"Error reading current led setting. Maybe stdin is not a VT?\n", 230},
- {"\
-Error reading current flags setting. Maybe you are not on the console?\n", 231},
- {"Error reading current led setting from /dev/kbd.\n", 232},
- {"KIOCGLED unavailable?\n", 233},
- {"KIOCSLED unavailable?\n", 234},
- {"Error opening /dev/kbd.\n", 235},
- {"Error resetting ledmode\n", 236},
- {"Current default flags: ", 237},
- {"Current flags: ", 238},
- {"Current leds: ", 239},
+that a subsequent reset will not change the flags.\n", 225},
+ {"on ", 226},
+ {"off", 227},
+ {"Error reading current led setting. Maybe stdin is not a VT?\n", 228},
+ {"\
+Error reading current flags setting. Maybe you are not on the console?\n", 229},
+ {"Error reading current led setting from /dev/kbd.\n", 230},
+ {"KIOCGLED unavailable?\n", 231},
+ {"KIOCSLED unavailable?\n", 232},
+ {"Error opening /dev/kbd.\n", 233},
+ {"Error resetting ledmode\n", 234},
+ {"Current default flags: ", 235},
+ {"Current flags: ", 236},
+ {"Current leds: ", 237},
{"\
unrecognized argument: _%s_\n\
-\n", 240},
- {"Old default flags: ", 241},
- {"New default flags: ", 242},
- {"Old flags: ", 243},
- {"New flags: ", 244},
- {"Old leds: ", 245},
- {"New leds: ", 246},
+\n", 238},
+ {"Old default flags: ", 239},
+ {"New default flags: ", 240},
+ {"Old flags: ", 241},
+ {"New flags: ", 242},
+ {"Old leds: ", 243},
+ {"New leds: ", 244},
{"\
Usage:\n\
\tsetmetamode [ metabit | meta | bit | escprefix | esc | prefix ]\n\
Each vt has his own copy of this bit. Use\n\
\tsetmetamode [arg] < /dev/ttyn\n\
to change the settings of another vt.\n\
-The setting before and after the change are reported.\n", 247},
- {"Meta key sets high order bit\n", 248},
- {"Meta key gives Esc prefix\n", 249},
- {"Strange mode for Meta key?\n", 250},
- {"Error reading current setting. Maybe stdin is not a VT?\n", 251},
- {"old state: ", 252},
- {"new state: ", 253},
- {"usage: %s\n", 254},
- {"failed to restore original translation table\n", 255},
- {"failed to restore original unimap\n", 256},
- {"cannot change translation table\n", 257},
- {"%s: out of memory?\n", 258},
+The setting before and after the change are reported.\n", 245},
+ {"Meta key sets high order bit\n", 246},
+ {"Meta key gives Esc prefix\n", 247},
+ {"Strange mode for Meta key?\n", 248},
+ {"Error reading current setting. Maybe stdin is not a VT?\n", 249},
+ {"old state: ", 250},
+ {"new state: ", 251},
+ {"usage: %s\n", 252},
+ {"failed to restore original translation table\n", 253},
+ {"failed to restore original unimap\n", 254},
+ {"cannot change translation table\n", 255},
+ {"%s: out of memory?\n", 256},
{"\
usage: showconsolefont -V|--version\n\
showconsolefont [-C tty] [-v] [-i]\n\
-C tty Device to read the font from. Default: current tty.\n\
-v Be more verbose.\n\
-i Don't print out the font table, just show\n\
- ROWSxCOLSxCOUNT and exit.\n", 259},
- {"Character count: %d\n", 260},
- {"Font width : %d\n", 261},
- {"Font height : %d\n", 262},
+ ROWSxCOLSxCOUNT and exit.\n", 257},
+ {"Character count: %d\n", 258},
+ {"Font width : %d\n", 259},
+ {"Font height : %d\n", 260},
{"\
Showing %d-char font\n\
-\n", 263},
- {"?UNKNOWN?", 264},
- {"kb mode was %s\n", 265},
+\n", 261},
+ {"?UNKNOWN?", 262},
+ {"kb mode was %s\n", 263},
{"\
[ if you are trying this under X, it might not work\n\
-since the X server is also reading /dev/console ]\n", 266},
- {"caught signal %d, cleaning up...\n", 267},
+since the X server is also reading /dev/console ]\n", 264},
+ {"caught signal %d, cleaning up...\n", 265},
{"\
showkey version %s\n\
\n\
\t-h --help\tdisplay this help text\n\
\t-a --ascii\tdisplay the decimal/octal/hex values of the keys\n\
\t-s --scancodes\tdisplay only the raw scan-codes\n\
-\t-k --keycodes\tdisplay only the interpreted keycodes (default)\n", 268},
+\t-k --keycodes\tdisplay only the interpreted keycodes (default)\n", 266},
{"\
\n\
Press any keys - Ctrl-D will terminate this program\n\
-\n", 269},
- {"press any key (program terminates 10s after last keypress)...\n", 270},
- {"release", 271},
- {"press", 272},
- {"keycode %3d %s\n", 273},
- {"%s from %s\n", 274},
+\n", 267},
+ {"press any key (program terminates 10s after last keypress)...\n", 268},
+ {"release", 269},
+ {"press", 270},
+ {"keycode %3d %s\n", 271},
+ {"%s from %s\n", 272},
};
-int _msg_tbl_length = 274;
+int _msg_tbl_length = 272;
WARNINGS = -Wall -Wextra -Wmissing-noreturn -Wdisabled-optimization \
-Wcast-align -Wshadow -Wmissing-format-attribute -Wmissing-prototypes \
- -Wstrict-prototypes -Wmissing-declarations $(WERROR)
+ -Wstrict-prototypes -Wmissing-declarations
+
+if ! KLIBC
+WARNINGS += $(WERROR)
+endif
AM_CPPFLAGS = -DDATADIR=\"$(datadir)\" -DLOCALEDIR=\"$(localedir)\" $(WARNINGS) \
-funit-at-a-time
OLDPROGS = mapscrn loadunimap
PROGS = \
dumpkeys loadkeys showkey setfont showconsolefont \
- setleds setmetamode kbd_mode chvt deallocvt \
- psfxtable kbdrate fgconsole openvt
+ setleds setmetamode kbd_mode psfxtable fgconsole
+
+if ! KLIBC
+PROGS += kbdrate chvt deallocvt openvt
+endif
if KEYCODES_PROGS
PROGS += getkeycodes setkeycodes
if OPTIONAL_PROGS
PROGS += \
- screendump setlogcons setvesablank spawn_console spawn_login \
- getunimap clrunimap outpsfheader setpalette
+ setlogcons setvesablank getunimap clrunimap outpsfheader setpalette
+if ! KLIBC
+PROGS += screendump spawn_console spawn_login
+endif
endif
dist_bin_SCRIPTS = unicode_start unicode_stop
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)
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)
-loadunimap_SOURCES = $(ALL_S) loadunimap.c $(FIND_S) $(PSF_S) $(UTF8_S) $(XMAL_S) $(GETFD_S) $(KDMA_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)
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)
+psfxtable_SOURCES = $(ALL_S) psfxtable.c $(PSF_S) $(XMAL_S) $(UTF8_S) $(GETFD_S) $(KLIBC_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)
+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)
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)
+showkey_SOURCES = $(ALL_S) showkey.c $(GETFD_S) $(KLIBC_S)
mapscrn_CFLAGS = -DMAIN
loadunimap_CFLAGS = -DMAIN
#include "ksyms.h"
#include "kbd.h"
#include "xmalloc.h"
+#ifdef __klibc__
+#include "klibc_compat.h"
+#endif
extern int line_nr;
int yylval;
#include "ksyms.h"
#include "kbd.h"
#include "xmalloc.h"
+#ifdef __klibc__
+#include "klibc_compat.h"
+#endif
extern int line_nr;
int yylval;
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];
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) {
{ "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) {
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;
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;
}
}
}
+#else
+ fp = fopen(pathname, "r");
+#endif /* __klibc__ */
return fp;
}
DIR *d;
struct dirent *de;
char *ff, *fdir, *p, *q, **sp;
+#ifndef __klibc__
struct decompressor *dc;
+#endif /* __klibc__ */
int secondpass = 0;
ispipe = 0;
/* 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);
char **dp, *dir, **sp;
FILE *fp;
int dl, recdepth;
+#ifndef __klibc__
struct decompressor *dc;
+#endif /* __klibc__ */
if (strlen(fnam) >= sizeof(pathname))
return NULL;
return fp;
}
+#ifndef __klibc__
for (sp = suffixes; *sp; sp++) {
for (dc = &decompressors[0]; dc->cmd; dc++) {
if (strlen(fnam) + strlen(*sp)
}
}
}
+#endif /* __klibc__ */
return NULL;
}
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();
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")))
* If you make \215A\201 an alias for "kbd_mode -a", and you are
* in raw mode, then hitting F7 = (two keys) will return you to sanity.
*/
+
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
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();
--- /dev/null
+#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;
+}
--- /dev/null
+#ifdef __klibc__
+#ifndef _KLIBC_COMPAT_H
+#define _KLIBC_COMPAT_H
+
+#undef _MALLOC_H
+#undef malloc
+#undef realloc
+#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__ */
-
-/* A Bison parser, made by GNU Bison 2.4.1. */
+/* A Bison parser, made by GNU Bison 2.3. */
/* Skeleton implementation for Bison's Yacc-like parsers in C
-
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
-
- This program is free software: you can redistribute it and/or modify
+
+ 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
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
-
+
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "2.4.1"
+#define YYBISON_VERSION "2.3"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
/* Pure parsers. */
#define YYPURE 0
-/* Push parsers. */
-#define YYPUSH 0
-
-/* Pull parsers. */
-#define YYPULL 1
-
/* Using locations. */
#define YYLSP_NEEDED 0
-/* Copy the first part of user declarations. */
+/* Tokens. */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+ /* Put the tokens into the symbol table, so that GDB and other debuggers
+ know about them. */
+ enum yytokentype {
+ EOL = 258,
+ NUMBER = 259,
+ LITERAL = 260,
+ CHARSET = 261,
+ KEYMAPS = 262,
+ KEYCODE = 263,
+ EQUALS = 264,
+ PLAIN = 265,
+ SHIFT = 266,
+ CONTROL = 267,
+ ALT = 268,
+ ALTGR = 269,
+ SHIFTL = 270,
+ SHIFTR = 271,
+ CTRLL = 272,
+ CTRLR = 273,
+ CAPSSHIFT = 274,
+ COMMA = 275,
+ DASH = 276,
+ STRING = 277,
+ STRLITERAL = 278,
+ COMPOSE = 279,
+ TO = 280,
+ CCHAR = 281,
+ ERROR = 282,
+ PLUS = 283,
+ UNUMBER = 284,
+ ALT_IS_META = 285,
+ STRINGS = 286,
+ AS = 287,
+ USUAL = 288,
+ ON = 289,
+ FOR = 290
+ };
+#endif
+/* Tokens. */
+#define EOL 258
+#define NUMBER 259
+#define LITERAL 260
+#define CHARSET 261
+#define KEYMAPS 262
+#define KEYCODE 263
+#define EQUALS 264
+#define PLAIN 265
+#define SHIFT 266
+#define CONTROL 267
+#define ALT 268
+#define ALTGR 269
+#define SHIFTL 270
+#define SHIFTR 271
+#define CTRLL 272
+#define CTRLR 273
+#define CAPSSHIFT 274
+#define COMMA 275
+#define DASH 276
+#define STRING 277
+#define STRLITERAL 278
+#define COMPOSE 279
+#define TO 280
+#define CCHAR 281
+#define ERROR 282
+#define PLUS 283
+#define UNUMBER 284
+#define ALT_IS_META 285
+#define STRINGS 286
+#define AS 287
+#define USUAL 288
+#define ON 289
+#define FOR 290
+
+
+
-/* Line 189 of yacc.c */
+/* Copy the first part of user declarations. */
#line 12 "loadkeys.y"
#include <errno.h>
int yylex (void);
-/* Line 189 of yacc.c */
-#line 167 "loadkeys.c"
-
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
# define YYTOKEN_TABLE 0
#endif
-
-/* Tokens. */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
- /* Put the tokens into the symbol table, so that GDB and other debuggers
- know about them. */
- enum yytokentype {
- EOL = 258,
- NUMBER = 259,
- LITERAL = 260,
- CHARSET = 261,
- KEYMAPS = 262,
- KEYCODE = 263,
- EQUALS = 264,
- PLAIN = 265,
- SHIFT = 266,
- CONTROL = 267,
- ALT = 268,
- ALTGR = 269,
- SHIFTL = 270,
- SHIFTR = 271,
- CTRLL = 272,
- CTRLR = 273,
- CAPSSHIFT = 274,
- COMMA = 275,
- DASH = 276,
- STRING = 277,
- STRLITERAL = 278,
- COMPOSE = 279,
- TO = 280,
- CCHAR = 281,
- ERROR = 282,
- PLUS = 283,
- UNUMBER = 284,
- ALT_IS_META = 285,
- STRINGS = 286,
- AS = 287,
- USUAL = 288,
- ON = 289,
- FOR = 290
- };
-#endif
-/* Tokens. */
-#define EOL 258
-#define NUMBER 259
-#define LITERAL 260
-#define CHARSET 261
-#define KEYMAPS 262
-#define KEYCODE 263
-#define EQUALS 264
-#define PLAIN 265
-#define SHIFT 266
-#define CONTROL 267
-#define ALT 268
-#define ALTGR 269
-#define SHIFTL 270
-#define SHIFTR 271
-#define CTRLL 272
-#define CTRLR 273
-#define CAPSSHIFT 274
-#define COMMA 275
-#define DASH 276
-#define STRING 277
-#define STRLITERAL 278
-#define COMPOSE 279
-#define TO 280
-#define CCHAR 281
-#define ERROR 282
-#define PLUS 283
-#define UNUMBER 284
-#define ALT_IS_META 285
-#define STRINGS 286
-#define AS 287
-#define USUAL 288
-#define ON 289
-#define FOR 290
-
-
-
-
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef int YYSTYPE;
-# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
#endif
+
/* Copy the second part of user declarations. */
-/* Line 264 of yacc.c */
-#line 279 "loadkeys.c"
+/* Line 216 of yacc.c. */
+#line 269 "loadkeys.c"
#ifdef short
# undef short
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static int
-YYID (int yyi)
+YYID (int i)
#else
static int
-YYID (yyi)
- int yyi;
+YYID (i)
+ int i;
#endif
{
- return yyi;
+ return i;
}
#endif
/* A type that is properly aligned for any stack member. */
union yyalloc
{
- yytype_int16 yyss_alloc;
- YYSTYPE yyvs_alloc;
-};
+ yytype_int16 yyss;
+ YYSTYPE yyvs;
+ };
/* The size of the maximum gap between one aligned stack and the next. */
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
elements in the stack, and YYPTR gives the new location of the
stack. Advance YYPTR to a properly aligned location for the next
stack. */
-# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
+# define YYSTACK_RELOCATE(Stack) \
do \
{ \
YYSIZE_T yynewbytes; \
- YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
- Stack = &yyptr->Stack_alloc; \
+ YYCOPY (&yyptr->Stack, Stack, yysize); \
+ Stack = &yyptr->Stack; \
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / sizeof (*yyptr); \
} \
"PLUS", "UNUMBER", "ALT_IS_META", "STRINGS", "AS", "USUAL", "ON", "FOR",
"$accept", "keytable", "line", "charsetline", "altismetaline",
"usualstringsline", "usualcomposeline", "keymapline", "range", "range0",
- "strline", "compline", "singleline", "$@1", "modifiers", "modifier",
+ "strline", "compline", "singleline", "@1", "modifiers", "modifier",
"fullline", "rvalue0", "rvalue1", "rvalue", 0
};
#endif
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
-yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
+yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
#else
static void
-yy_stack_print (yybottom, yytop)
- yytype_int16 *yybottom;
- yytype_int16 *yytop;
+yy_stack_print (bottom, top)
+ yytype_int16 *bottom;
+ yytype_int16 *top;
#endif
{
YYFPRINTF (stderr, "Stack now");
- for (; yybottom <= yytop; yybottom++)
- {
- int yybot = *yybottom;
- YYFPRINTF (stderr, " %d", yybot);
- }
+ for (; bottom <= top; ++bottom)
+ YYFPRINTF (stderr, " %d", *bottom);
YYFPRINTF (stderr, "\n");
}
/* The symbols being reduced. */
for (yyi = 0; yyi < yynrhs; yyi++)
{
- YYFPRINTF (stderr, " $%d = ", yyi + 1);
+ fprintf (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
&(yyvsp[(yyi + 1) - (yynrhs)])
);
- YYFPRINTF (stderr, "\n");
+ fprintf (stderr, "\n");
}
}
break;
}
}
+\f
/* Prevent warnings from -Wmissing-prototypes. */
+
#ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus
int yyparse (void *YYPARSE_PARAM);
#endif /* ! YYPARSE_PARAM */
-/* The lookahead symbol. */
+
+/* The look-ahead symbol. */
int yychar;
-/* The semantic value of the lookahead symbol. */
+/* The semantic value of the look-ahead symbol. */
YYSTYPE yylval;
/* Number of syntax errors so far. */
-/*-------------------------.
-| yyparse or yypush_parse. |
-`-------------------------*/
+/*----------.
+| yyparse. |
+`----------*/
#ifdef YYPARSE_PARAM
#if (defined __STDC__ || defined __C99__FUNC__ \
#endif
#endif
{
+
+ int yystate;
+ int yyn;
+ int yyresult;
+ /* Number of tokens to shift before error messages enabled. */
+ int yyerrstatus;
+ /* Look-ahead token as an internal (translated) token number. */
+ int yytoken = 0;
+#if YYERROR_VERBOSE
+ /* Buffer for error messages, and its allocated size. */
+ char yymsgbuf[128];
+ char *yymsg = yymsgbuf;
+ YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
+#endif
+ /* Three stacks and their tools:
+ `yyss': related to states,
+ `yyvs': related to semantic values,
+ `yyls': related to locations.
- int yystate;
- /* Number of tokens to shift before error messages enabled. */
- int yyerrstatus;
+ Refer to the stacks thru separate pointers, to allow yyoverflow
+ to reallocate them elsewhere. */
- /* The stacks and their tools:
- `yyss': related to states.
- `yyvs': related to semantic values.
+ /* The state stack. */
+ yytype_int16 yyssa[YYINITDEPTH];
+ yytype_int16 *yyss = yyssa;
+ yytype_int16 *yyssp;
- Refer to the stacks thru separate pointers, to allow yyoverflow
- to reallocate them elsewhere. */
+ /* The semantic value stack. */
+ YYSTYPE yyvsa[YYINITDEPTH];
+ YYSTYPE *yyvs = yyvsa;
+ YYSTYPE *yyvsp;
- /* The state stack. */
- yytype_int16 yyssa[YYINITDEPTH];
- yytype_int16 *yyss;
- yytype_int16 *yyssp;
- /* The semantic value stack. */
- YYSTYPE yyvsa[YYINITDEPTH];
- YYSTYPE *yyvs;
- YYSTYPE *yyvsp;
- YYSIZE_T yystacksize;
+#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
+
+ YYSIZE_T yystacksize = YYINITDEPTH;
- int yyn;
- int yyresult;
- /* Lookahead token as an internal (translated) token number. */
- int yytoken;
/* The variables used to return semantic value and location from the
action routines. */
YYSTYPE yyval;
-#if YYERROR_VERBOSE
- /* Buffer for error messages, and its allocated size. */
- char yymsgbuf[128];
- char *yymsg = yymsgbuf;
- YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
-#endif
-
-#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
/* The number of symbols on the RHS of the reduced rule.
Keep to zero when no symbol should be popped. */
int yylen = 0;
- yytoken = 0;
- yyss = yyssa;
- yyvs = yyvsa;
- yystacksize = YYINITDEPTH;
-
YYDPRINTF ((stderr, "Starting parse\n"));
yystate = 0;
yyerrstatus = 0;
yynerrs = 0;
- yychar = YYEMPTY; /* Cause a token to be read. */
+ yychar = YYEMPTY; /* Cause a token to be read. */
/* Initialize stack pointers.
Waste one element of value and location stack
so that they stay on the same level as the state stack.
The wasted elements are never initialized. */
+
yyssp = yyss;
yyvsp = yyvs;
YYSTYPE *yyvs1 = yyvs;
yytype_int16 *yyss1 = yyss;
+
/* Each stack pointer address is followed by the size of the
data in use in that stack, in bytes. This used to be a
conditional around just the two extra args, but that might
yyoverflow (YY_("memory exhausted"),
&yyss1, yysize * sizeof (*yyssp),
&yyvs1, yysize * sizeof (*yyvsp),
+
&yystacksize);
yyss = yyss1;
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
if (! yyptr)
goto yyexhaustedlab;
- YYSTACK_RELOCATE (yyss_alloc, yyss);
- YYSTACK_RELOCATE (yyvs_alloc, yyvs);
+ YYSTACK_RELOCATE (yyss);
+ YYSTACK_RELOCATE (yyvs);
+
# undef YYSTACK_RELOCATE
if (yyss1 != yyssa)
YYSTACK_FREE (yyss1);
yyssp = yyss + yysize - 1;
yyvsp = yyvs + yysize - 1;
+
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
(unsigned long int) yystacksize));
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
- if (yystate == YYFINAL)
- YYACCEPT;
-
goto yybackup;
/*-----------.
yybackup:
/* Do appropriate processing given the current state. Read a
- lookahead token if we need one and don't already have one. */
+ look-ahead token if we need one and don't already have one. */
- /* First try to decide what to do without reference to lookahead token. */
+ /* First try to decide what to do without reference to look-ahead token. */
yyn = yypact[yystate];
if (yyn == YYPACT_NINF)
goto yydefault;
- /* Not known => get a lookahead token if don't already have one. */
+ /* Not known => get a look-ahead token if don't already have one. */
- /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
+ /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
if (yychar == YYEMPTY)
{
YYDPRINTF ((stderr, "Reading a token: "));
goto yyreduce;
}
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
/* Count tokens shifted since error; after three, turn off error
status. */
if (yyerrstatus)
yyerrstatus--;
- /* Shift the lookahead token. */
+ /* Shift the look-ahead token. */
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
- /* Discard the shifted token. */
- yychar = YYEMPTY;
+ /* Discard the shifted token unless it is eof. */
+ if (yychar != YYEOF)
+ yychar = YYEMPTY;
yystate = yyn;
*++yyvsp = yylval;
switch (yyn)
{
case 14:
-
-/* Line 1455 of yacc.c */
#line 121 "loadkeys.y"
{
set_charset((char *) kbs_buf.kb_string);
break;
case 15:
-
-/* Line 1455 of yacc.c */
#line 126 "loadkeys.y"
{
alt_is_meta = 1;
break;
case 16:
-
-/* Line 1455 of yacc.c */
#line 131 "loadkeys.y"
{
strings_as_usual();
break;
case 17:
-
-/* Line 1455 of yacc.c */
#line 136 "loadkeys.y"
{
compose_as_usual((char *) kbs_buf.kb_string);
break;
case 18:
-
-/* Line 1455 of yacc.c */
#line 140 "loadkeys.y"
{
compose_as_usual(0);
break;
case 19:
-
-/* Line 1455 of yacc.c */
#line 145 "loadkeys.y"
{
keymaps_line_seen = 1;
break;
case 22:
-
-/* Line 1455 of yacc.c */
#line 153 "loadkeys.y"
{
int i;
break;
case 23:
-
-/* Line 1455 of yacc.c */
#line 159 "loadkeys.y"
{
addmap((yyvsp[(1) - (1)]),1);
break;
case 24:
-
-/* Line 1455 of yacc.c */
#line 164 "loadkeys.y"
{
if (KTYP((yyvsp[(2) - (5)])) != KT_FN)
break;
case 25:
-
-/* Line 1455 of yacc.c */
#line 173 "loadkeys.y"
{
compose((yyvsp[(2) - (6)]), (yyvsp[(3) - (6)]), (yyvsp[(5) - (6)]));
break;
case 26:
-
-/* Line 1455 of yacc.c */
#line 177 "loadkeys.y"
{
compose((yyvsp[(2) - (6)]), (yyvsp[(3) - (6)]), (yyvsp[(5) - (6)]));
break;
case 27:
-
-/* Line 1455 of yacc.c */
#line 181 "loadkeys.y"
{ mod = 0; }
break;
case 28:
-
-/* Line 1455 of yacc.c */
#line 183 "loadkeys.y"
{
addkey((yyvsp[(4) - (7)]), mod, (yyvsp[(6) - (7)]));
break;
case 29:
-
-/* Line 1455 of yacc.c */
#line 187 "loadkeys.y"
{
addkey((yyvsp[(3) - (6)]), 0, (yyvsp[(5) - (6)]));
break;
case 32:
-
-/* Line 1455 of yacc.c */
#line 194 "loadkeys.y"
{ mod |= M_SHIFT; }
break;
case 33:
-
-/* Line 1455 of yacc.c */
#line 195 "loadkeys.y"
{ mod |= M_CTRL; }
break;
case 34:
-
-/* Line 1455 of yacc.c */
#line 196 "loadkeys.y"
{ mod |= M_ALT; }
break;
case 35:
-
-/* Line 1455 of yacc.c */
#line 197 "loadkeys.y"
{ mod |= M_ALTGR; }
break;
case 36:
-
-/* Line 1455 of yacc.c */
#line 198 "loadkeys.y"
{ mod |= M_SHIFTL; }
break;
case 37:
-
-/* Line 1455 of yacc.c */
#line 199 "loadkeys.y"
{ mod |= M_SHIFTR; }
break;
case 38:
-
-/* Line 1455 of yacc.c */
#line 200 "loadkeys.y"
{ mod |= M_CTRLL; }
break;
case 39:
-
-/* Line 1455 of yacc.c */
#line 201 "loadkeys.y"
{ mod |= M_CTRLR; }
break;
case 40:
-
-/* Line 1455 of yacc.c */
#line 202 "loadkeys.y"
{ mod |= M_CAPSSHIFT; }
break;
case 41:
-
-/* Line 1455 of yacc.c */
#line 205 "loadkeys.y"
{
int i, j;
break;
case 44:
-
-/* Line 1455 of yacc.c */
#line 241 "loadkeys.y"
{
if (rvalct >= MAX_NR_KEYMAPS)
break;
case 45:
-
-/* Line 1455 of yacc.c */
#line 248 "loadkeys.y"
{(yyval)=convert_code((yyvsp[(1) - (1)]), TO_AUTO);}
break;
case 46:
-
-/* Line 1455 of yacc.c */
#line 250 "loadkeys.y"
{(yyval)=add_capslock((yyvsp[(2) - (2)]));}
break;
case 47:
-
-/* Line 1455 of yacc.c */
#line 252 "loadkeys.y"
{(yyval)=convert_code((yyvsp[(1) - (1)])^0xf000, TO_AUTO);}
break;
case 48:
-
-/* Line 1455 of yacc.c */
#line 254 "loadkeys.y"
{(yyval)=add_capslock((yyvsp[(2) - (2)])^0xf000);}
break;
case 49:
-
-/* Line 1455 of yacc.c */
#line 256 "loadkeys.y"
{(yyval)=(yyvsp[(1) - (1)]);}
break;
case 50:
-
-/* Line 1455 of yacc.c */
#line 258 "loadkeys.y"
{(yyval)=add_capslock((yyvsp[(2) - (2)]));}
break;
-
-/* Line 1455 of yacc.c */
-#line 1829 "loadkeys.c"
+/* Line 1267 of yacc.c. */
+#line 1759 "loadkeys.c"
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
*++yyvsp = yyval;
+
/* Now `shift' the result of the reduction. Determine what state
that goes to, based on the state we popped back to and the rule
number reduced by. */
if (yyerrstatus == 3)
{
- /* If just tried and failed to reuse lookahead token after an
+ /* If just tried and failed to reuse look-ahead token after an
error, discard it. */
if (yychar <= YYEOF)
}
}
- /* Else will try to reuse lookahead token after shifting the error
+ /* Else will try to reuse look-ahead token after shifting the error
token. */
goto yyerrlab1;
YY_STACK_PRINT (yyss, yyssp);
}
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
*++yyvsp = yylval;
yyresult = 1;
goto yyreturn;
-#if !defined(yyoverflow) || YYERROR_VERBOSE
+#ifndef yyoverflow
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/
#endif
yyreturn:
- if (yychar != YYEMPTY)
+ if (yychar != YYEOF && yychar != YYEMPTY)
yydestruct ("Cleanup: discarding lookahead",
yytoken, &yylval);
/* Do not reclaim the symbols of the rule which action triggered
}
-
-/* Line 1675 of yacc.c */
#line 260 "loadkeys.y"
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) {
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) {
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")))
#include <stdio.h>
#include <stdlib.h>
+#ifndef __klibc__
#include <memory.h>
+#endif
#include <string.h>
#include <fcntl.h>
#include <sys/types.h>
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();
#define LOCALEDIR "/usr/share/locale"
#endif
+#ifndef __klibc__
#ifdef HAVE_LOCALE_H
# include <locale.h>
#endif
+#endif
#ifdef ENABLE_NLS
# include <libintl.h>
#include "utf8.h"
#include "paths.h"
+#ifdef __klibc__
+#include "klibc_compat.h"
+#endif
+
extern char *progname;
static void
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();
#include <stdio.h>
#include <errno.h>
#include <signal.h>
+#include <sys/io.h>
#include <sys/ioctl.h>
#if (__GNU_LIBRARY__ >= 6)
#include <sys/perm.h>
char *defaultfont;
set_progname(argv[0]);
-
+#ifndef __klibc__
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE_NAME, LOCALEDIR);
textdomain(PACKAGE_NAME);
+#endif
if (argc < 2)
usage();
/* Port I/O macros. Note that these are not compatible with the ones */
/* defined in the kernel header files. */
-static inline void outb( int port, int value )
+static inline void my_outb( int port, int value )
{
__asm__ volatile ("outb %0,%1"
: : "a" ((unsigned char)value), "d" ((unsigned short)port));
}
-static inline int inb( int port )
+static inline int my_inb( int port )
{
unsigned char value;
__asm__ volatile ("inb %1,%0"
exit(1);
}
crtcport = 0x3d4;
- if ((inb(0x3cc) & 0x01) == 0)
+ if ((my_inb(0x3cc) & 0x01) == 0)
crtcport = 0x3b4;
}
static void vga_set_fontheight( int h ) {
- outb(crtcport, 0x09);
- outb(crtcport + 1, (inb(crtcport + 1) & 0xe0) | (h - 1));
+ my_outb(crtcport, 0x09);
+ my_outb(crtcport + 1, (my_inb(crtcport + 1) & 0xe0) | (h - 1));
}
static int vga_get_fontheight() {
- outb(crtcport, 0x09);
- return (inb(crtcport + 1) & 0x1f) + 1;
+ my_outb(crtcport, 0x09);
+ return (my_inb(crtcport + 1) & 0x1f) + 1;
}
static void vga_set_cursor( int top, int bottom ) {
- outb(crtcport, 0x0a);
- outb(crtcport + 1, (inb(crtcport + 1) & 0xc0) | top);
- outb(crtcport, 0x0b);
- outb(crtcport + 1, (inb(crtcport + 1) & 0xe0) | bottom);
+ my_outb(crtcport, 0x0a);
+ my_outb(crtcport + 1, (my_inb(crtcport + 1) & 0xc0) | top);
+ my_outb(crtcport, 0x0b);
+ my_outb(crtcport + 1, (my_inb(crtcport + 1) & 0xe0) | bottom);
}
static void vga_set_verticaldisplayend_lowbyte( int byte ) {
/* CRTC register 0x12 */
/* vertical display end */
- outb(crtcport, 0x12);
- outb(crtcport + 1, byte);
+ my_outb(crtcport, 0x12);
+ my_outb(crtcport + 1, byte);
}
static void vga_480_scanlines() {
/* CRTC register 0x11 */
/* vertical sync end (also unlocks CR0-7) */
- outb(crtcport, 0x11);
- outb(crtcport + 1, 0x0c);
+ my_outb(crtcport, 0x11);
+ my_outb(crtcport + 1, 0x0c);
/* CRTC register 0x06 */
/* vertical total */
- outb(crtcport, 0x06);
- outb(crtcport + 1, 0x0b);
+ my_outb(crtcport, 0x06);
+ my_outb(crtcport + 1, 0x0b);
/* CRTC register 0x07 */
/* (vertical) overflow */
- outb(crtcport, 0x07);
- outb(crtcport + 1, 0x3e);
+ my_outb(crtcport, 0x07);
+ my_outb(crtcport + 1, 0x3e);
/* CRTC register 0x10 */
/* vertical sync start */
- outb(crtcport, 0x10);
- outb(crtcport + 1, 0xea);
+ my_outb(crtcport, 0x10);
+ my_outb(crtcport + 1, 0xea);
/* CRTC register 0x12 */
/* vertical display end */
- outb(crtcport, 0x12);
- outb(crtcport + 1, 0xdf);
+ my_outb(crtcport, 0x12);
+ my_outb(crtcport + 1, 0xdf);
/* CRTC register 0x15 */
/* vertical blank start */
- outb(crtcport, 0x15);
- outb(crtcport + 1, 0xe7);
+ my_outb(crtcport, 0x15);
+ my_outb(crtcport + 1, 0xe7);
/* CRTC register 0x16 */
/* vertical blank end */
- outb(crtcport, 0x16);
- outb(crtcport + 1, 0x04);
+ my_outb(crtcport, 0x16);
+ my_outb(crtcport + 1, 0x04);
/* Misc Output register */
/* Preserver clock select bits and set correct sync polarity */
- outb(0x3c2, (inb(0x3cc) & 0x0d) | 0xe2);
+ my_outb(0x3c2, (my_inb(0x3cc) & 0x0d) | 0xe2);
}
static void vga_400_scanlines() {
/* CRTC register 0x11 */
/* vertical sync end (also unlocks CR0-7) */
- outb(crtcport, 0x11);
- outb(crtcport + 1, 0x0e);
+ my_outb(crtcport, 0x11);
+ my_outb(crtcport + 1, 0x0e);
/* CRTC register 0x06 */
/* vertical total */
- outb(crtcport, 0x06);
- outb(crtcport + 1, 0xbf);
+ my_outb(crtcport, 0x06);
+ my_outb(crtcport + 1, 0xbf);
/* CRTC register 0x07 */
/* (vertical) overflow */
- outb(crtcport, 0x07);
- outb(crtcport + 1, 0x1f);
+ my_outb(crtcport, 0x07);
+ my_outb(crtcport + 1, 0x1f);
/* CRTC register 0x10 */
/* vertical sync start */
- outb(crtcport, 0x10);
- outb(crtcport + 1, 0x9c);
+ my_outb(crtcport, 0x10);
+ my_outb(crtcport + 1, 0x9c);
/* CRTC register 0x12 */
/* vertical display end */
- outb(crtcport, 0x12);
- outb(crtcport + 1, 0x8f);
+ my_outb(crtcport, 0x12);
+ my_outb(crtcport + 1, 0x8f);
/* CRTC register 0x15 */
/* vertical blank start */
- outb(crtcport, 0x15);
- outb(crtcport + 1, 0x96);
+ my_outb(crtcport, 0x15);
+ my_outb(crtcport + 1, 0x96);
/* CRTC register 0x16 */
/* vertical blank end */
- outb(crtcport, 0x16);
- outb(crtcport + 1, 0xb9);
+ my_outb(crtcport, 0x16);
+ my_outb(crtcport + 1, 0xb9);
/* Misc Output register */
/* Preserver clock select bits and set correct sync polarity */
- outb(0x3c2, (inb(0x3cc) & 0x0d) | 0x62);
+ my_outb(0x3c2, (my_inb(0x3cc) & 0x0d) | 0x62);
}
*/
#include <stdio.h>
+#ifndef __klibc__
#include <memory.h>
+#endif
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
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;
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();
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();
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]);
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();
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");
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")))
#include <stdio.h>
#include <unistd.h>
#include <getopt.h>
-#include <signal.h>
#include <fcntl.h>
#include <termios.h>
#include <sys/ioctl.h>
#include "nls.h"
#include "version.h"
+#ifndef __klibc__
+ #include <signal.h>
+#else
+ #include "klibc_compat.h"
+#endif
+
int tmp; /* for debugging */
int fd;
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) {
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();
-#include <string.h>
-#include <stdlib.h>
-
#include "kbd.h"
#include "../config.h"
+#ifdef __klibc__
+#include "klibc_compat.h"
+#endif
+#include <string.h>
+#include <stdlib.h>
char *progname;
#include "nls.h"
#include "xmalloc.h"
+#ifdef __klibc__
+#include "klibc_compat.h"
+#endif
+
extern char *progname;
static void attr_noreturn