aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/accessibility/speakup/utils.h
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-05-20 21:07:05 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-05-20 21:07:05 +0200
commitcafada1fe932ce761d6c0bc1d56967e27abe4cff (patch)
treef21e256bf45f4a8520c5c97b86a94f193f50518b /drivers/accessibility/speakup/utils.h
parentMerge tag 'icc-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc into char-misc-next (diff)
downloadlinux-dev-cafada1fe932ce761d6c0bc1d56967e27abe4cff.tar.xz
linux-dev-cafada1fe932ce761d6c0bc1d56967e27abe4cff.zip
Revert "speakup: Generate speakupmap.h automatically"
This reverts commit 6646b95aab5f62c049f1416a3801dec5432c348b. Stephen reports that it breaks the build for him so revert it for now. Cc: Samuel Thibault <samuel.thibault@ens-lyon.org> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Link: https://lore.kernel.org/r/20220520194637.03824f7f@canb.auug.org.au Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to '')
-rw-r--r--drivers/accessibility/speakup/utils.h99
1 files changed, 0 insertions, 99 deletions
diff --git a/drivers/accessibility/speakup/utils.h b/drivers/accessibility/speakup/utils.h
deleted file mode 100644
index bab626d3a883..000000000000
--- a/drivers/accessibility/speakup/utils.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/* utils.h
- * originally written by: Kirk Reiser.
- *
- ** Copyright (C) 2002 Kirk Reiser.
- * Copyright (C) 2003 David Borowski.
- */
-
-#include <stdio.h>
-
-#define MAXKEYS 512
-#define MAXKEYVAL 160
-#define HASHSIZE 101
-#define is_shift -3
-#define is_spk -2
-#define is_input -1
-
-struct st_key {
- char *name;
- struct st_key *next;
- int value, shift;
-};
-
-struct st_key key_table[MAXKEYS];
-struct st_key *extra_keys = key_table+HASHSIZE;
-char *def_name, *def_val;
-FILE *infile;
-int lc;
-
-char filename[256];
-
-static inline void open_input(const char *dir_name, const char *name)
-{
- snprintf(filename, sizeof(filename), "%s/%s", dir_name, name);
- infile = fopen(filename, "r");
- if (infile == 0) {
- fprintf(stderr, "can't open %s\n", filename);
- exit(1);
- }
- lc = 0;
-}
-
-static inline int oops(const char *msg, const char *info)
-{
- if (info == NULL)
- info = "";
- fprintf(stderr, "error: file %s line %d\n", filename, lc);
- fprintf(stderr, "%s %s\n", msg, info);
- exit(1);
-}
-
-static inline struct st_key *hash_name(char *name)
-{
- u_char *pn = (u_char *)name;
- int hash = 0;
-
- while (*pn) {
- hash = (hash * 17) & 0xfffffff;
- if (isupper(*pn))
- *pn = tolower(*pn);
- hash += (int)*pn;
- pn++;
- }
- hash %= HASHSIZE;
- return &key_table[hash];
-}
-
-static inline struct st_key *find_key(char *name)
-{
- struct st_key *this = hash_name(name);
-
- while (this) {
- if (this->name && !strcmp(name, this->name))
- return this;
- this = this->next;
- }
- return this;
-}
-
-static inline struct st_key *add_key(char *name, int value, int shift)
-{
- struct st_key *this = hash_name(name);
-
- if (extra_keys-key_table >= MAXKEYS)
- oops("out of key table space, enlarge MAXKEYS", NULL);
- if (this->name != NULL) {
- while (this->next) {
- if (!strcmp(name, this->name))
- oops("attempt to add duplicate key", name);
- this = this->next;
- }
- this->next = extra_keys++;
- this = this->next;
- }
- this->name = strdup(name);
- this->value = value;
- this->shift = shift;
- return this;
-}