From 67507b4620e6cee2a6aa3211d70337659492fc4e Mon Sep 17 00:00:00 2001 From: netchild Date: Wed, 9 Aug 2006 11:25:10 +0000 Subject: Remove the keymap stuff too, it is not needed in sade. --- usr.sbin/sade/Makefile | 35 ++----------------- usr.sbin/sade/dmenu.c | 19 ---------- usr.sbin/sade/keymap.c | 95 -------------------------------------------------- usr.sbin/sade/sade.h | 5 --- 4 files changed, 2 insertions(+), 152 deletions(-) delete mode 100644 usr.sbin/sade/keymap.c (limited to 'usr.sbin') diff --git a/usr.sbin/sade/Makefile b/usr.sbin/sade/Makefile index f66254c..c8dad48 100644 --- a/usr.sbin/sade/Makefile +++ b/usr.sbin/sade/Makefile @@ -8,10 +8,10 @@ PROG= sade MAN= sade.8 SRCS= command.c config.c devices.c \ disks.c dispatch.c dmenu.c \ - globals.c install.c keymap.c \ + globals.c install.c \ label.c main.c menus.c misc.c \ msg.c system.c termcap.c \ - variable.c ${_wizard} keymap.h + variable.c ${_wizard} WARNS?= 3 # command.c @@ -24,35 +24,4 @@ CFLAGS+= -I${.CURDIR}/../../gnu/lib/libdialog -I. DPADD= ${LIBDIALOG} ${LIBNCURSES} ${LIBUTIL} ${LIBDISK} ${LIBFTPIO} LDADD= -ldialog -lncurses -lutil -ldisk -lftpio -CLEANFILES= keymap.tmp keymap.h - -.if ${MACHINE} == "pc98" -KEYMAPS= jp.pc98 jp.pc98.iso -.else -KEYMAPS= be.iso bg.bds.ctrlcaps bg.phonetic.ctrlcaps br275.iso \ - ce.iso2 cs.latin2.qwertz danish.iso el.iso07 \ - estonian.cp850 estonian.iso estonian.iso15 finnish.iso fr.iso \ - german.iso gr.elot.acc gr.us101.acc hr.iso hu.iso2.101keys \ - it.iso icelandic.iso jp.106 norwegian.iso pl_PL.ISO8859-2 \ - pt.iso ru.koi8-r si.iso sk.iso2 spanish.iso swedish.iso \ - swissfrench.iso \ - swissgerman.iso ua.koi8-u ua.koi8-u.shift.alt uk.iso us.dvorak \ - us.iso us.pc-ctrl us.unix -.endif - -keymap.h: - rm -f keymap.tmp - for map in ${KEYMAPS} ; do \ - KEYMAP_PATH=${.CURDIR}/../../share/syscons/keymaps \ - kbdcontrol -L $$map | \ - sed -e '/^static accentmap_t/,$$d' >> keymap.tmp ; \ - done - echo "static struct keymapInfo keymapInfos[] = {" >> keymap.tmp - for map in ${KEYMAPS} ; do \ - echo -n ' { "'$$map'", ' >> keymap.tmp ; \ - echo "&keymap_$$map }," | tr '[-.]' '_' >> keymap.tmp ; \ - done - ( echo " { NULL, NULL }"; echo "};" ; echo "" ) >> keymap.tmp - mv keymap.tmp keymap.h - .include diff --git a/usr.sbin/sade/dmenu.c b/usr.sbin/sade/dmenu.c index fea1953..139f999 100644 --- a/usr.sbin/sade/dmenu.c +++ b/usr.sbin/sade/dmenu.c @@ -106,25 +106,6 @@ dmenuSetVariables(dialogMenuItem *tmp) } int -dmenuSetKmapVariable(dialogMenuItem *tmp) -{ - char *lang; - int err; - - variable_set((char *)tmp->data, TRUE); - lang = variable_get(VAR_KEYMAP); - if (lang != NULL) - { - err = loadKeymap(lang); - if (err == -1) - msgConfirm("No appropriate keyboard map found, sorry."); - else if (err == -2) - msgConfirm("Error installing keyboard map, errno = %d.", errno); - } - return DITEM_SUCCESS; -} - -int dmenuToggleVariable(dialogMenuItem *tmp) { char *var, *cp; diff --git a/usr.sbin/sade/keymap.c b/usr.sbin/sade/keymap.c deleted file mode 100644 index 384f30e..0000000 --- a/usr.sbin/sade/keymap.c +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 1996 Joerg Wunsch - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - * - */ - -#include "sade.h" -#include -#include -#include -#include -#include - -struct keymapInfo { - const char *name; - const struct keymap *map; -}; - -#include "keymap.h" - -/* - * keymap.h is being automatically generated by the Makefile. It - * contains definitions for all desired keymaps. Note that since we - * don't support font loading nor screen mapping during installation, - * we simply don't care for any other keys than the ASCII subset. - * - * Therefore, if no keymap with the exact name has been found in the - * first pass, we make a second pass over the table looking just for - * the language name only. - */ - -/* - * Return values: - * - * 0: OK - * -1: no appropriate keymap found - * -2: error installing map (other than ENXIO which means we're not on syscons) - */ - -int -loadKeymap(const char *lang) -{ - int passno, err; - char *llang; - size_t l; - struct keymapInfo *kip; - - llang = strdup(lang); - if (llang == NULL) - abort(); - - for (passno = 0; passno < 2; passno++) - { - if (passno > 0) - { - /* make the match more fuzzy */ - l = strspn(llang, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"); - llang[l] = '\0'; - } - - l = strlen(llang); - - for (kip = keymapInfos; kip->name; kip++) - if (strncmp(kip->name, llang, l) == 0) - { - /* Yep, got it! */ - err = ioctl(0, PIO_KEYMAP, kip->map); - free(llang); - return (err == -1 && errno != ENOTTY)? -2: 0; - } - } - free(llang); - return -1; -} diff --git a/usr.sbin/sade/sade.h b/usr.sbin/sade/sade.h index d6c5612..66ba396 100644 --- a/usr.sbin/sade/sade.h +++ b/usr.sbin/sade/sade.h @@ -93,7 +93,6 @@ #define VAR_GEOMETRY "geometry" #define VAR_INSTALL_CFG "installConfig" #define VAR_INSTALL_ROOT "installRoot" -#define VAR_KEYMAP "keymap" #define VAR_LABEL "label" #define VAR_LABEL_COUNT "labelCount" #define VAR_NEWFS_ARGS "newfsArgs" @@ -352,7 +351,6 @@ extern int dmenuSystemCommandBox(dialogMenuItem *tmp); extern int dmenuExit(dialogMenuItem *tmp); extern int dmenuISetVariable(dialogMenuItem *tmp); extern int dmenuSetVariable(dialogMenuItem *tmp); -extern int dmenuSetKmapVariable(dialogMenuItem *tmp); extern int dmenuSetVariables(dialogMenuItem *tmp); extern int dmenuToggleVariable(dialogMenuItem *tmp); extern int dmenuSetFlag(dialogMenuItem *tmp); @@ -385,9 +383,6 @@ extern Boolean copySelf(void); /* kget.c */ extern int kget(char *out); -/* keymap.c */ -extern int loadKeymap(const char *lang); - /* label.c */ extern int diskLabelEditor(dialogMenuItem *self); extern int diskLabelCommit(dialogMenuItem *self); -- cgit v1.1