Merge pull request #1145 from keymanapp/linux-update-kmflcomp

[Linux] Basic groundwork for kmflcomp to support v10 keyboards
This commit is contained in:
Daniel Glassey 2018-08-30 08:27:27 +07:00 committed by GitHub
commit f41935269a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 2804 additions and 2618 deletions

4
.gitignore vendored
View file

@ -226,6 +226,10 @@
# /test/wm_unichar/
# linux
autom4te.cache
*.orig
.DS_Store
*.kpj.user

View file

@ -72,10 +72,9 @@ static gchar * get_dirname(const gchar * path)
}
}
GList * kmfl_get_keyboard_list( const gchar * path)
GList * kmfl_get_keyboard_fromdir( GList *keyboard_list, const gchar * path)
{
GList * keyboard_list=NULL;
// g_message("KMFL: getting from dir: %s", path);
DIR *dir = opendir(path);
if (dir != NULL) {
@ -85,14 +84,24 @@ GList * kmfl_get_keyboard_list( const gchar * path)
gchar * absfn = g_strdup_printf("%s/%s", path, file->d_name);
stat(absfn, &filestat);
if (S_ISDIR(filestat.st_mode))
{
if(strcmp(file->d_name, ".") != 0 && strcmp(file->d_name, "..") != 0)
keyboard_list = kmfl_get_keyboard_fromdir(keyboard_list, absfn);
g_free(absfn);
}
// Only .kmfl and .kmn extensions are valid keyboard files
if (S_ISREG(filestat.st_mode)
else if (S_ISREG(filestat.st_mode)
&& ((g_str_has_suffix(absfn, ".kmfl") && kmfl_check_keyboard(absfn) == 0)
|| g_str_has_suffix(absfn, ".kmn"))) {
keyboard_list=g_list_append(keyboard_list, absfn);
}
else
{
g_free(absfn);
}
file = readdir(dir);
}
@ -101,17 +110,24 @@ GList * kmfl_get_keyboard_list( const gchar * path)
return keyboard_list;
}
GList * kmfl_get_keyboard_list( const gchar * path)
{
GList * keyboard_list=NULL;
keyboard_list = kmfl_get_keyboard_fromdir(keyboard_list, path);
return keyboard_list;
}
gchar * kmfl_get_icon_file(KInputMethod * im)
{
const char * icon_file = kmfl_icon_file(im->keyboard_number);
gchar * full_path_to_icon_file=NULL;
struct stat filestat;
char * valid_extensions[]= {"", ".png", ".bmp", ".jpg", ".ico", NULL};
char * valid_extensions[]= {"", ".png", ".bmp", ".jpg", NULL};
int valid_extension_index;
if (strlen(icon_file) > 0) {
for (valid_extension_index=0; valid_extensions[valid_extension_index] != NULL; valid_extension_index++) {
full_path_to_icon_file=g_strdup_printf("%s/icons/%s%s", get_dirname(im->keyboard_filename), icon_file, valid_extensions[valid_extension_index]);
full_path_to_icon_file=g_strdup_printf("%s/%s%s", get_dirname(im->keyboard_filename), icon_file, valid_extensions[valid_extension_index]);
stat(full_path_to_icon_file, &filestat);
@ -242,21 +258,29 @@ ibus_kmfl_list_engines (void)
gchar *local_keyboard_path;
keyboard_list = kmfl_get_keyboard_list("/usr/share/kmfl");
engines = ibus_kmfl_add_engines(engines, keyboard_list);
g_list_free(keyboard_list);
keyboard_list = kmfl_get_keyboard_list("/usr/share/keyman");
engines = ibus_kmfl_add_engines(engines, keyboard_list);
g_list_free(keyboard_list);
keyboard_list = kmfl_get_keyboard_list("/usr/local/share/keyman");
engines = ibus_kmfl_add_engines(engines, keyboard_list);
g_list_free(keyboard_list);
local_keyboard_path= g_strdup_printf("%s/.kmfl", getenv("HOME"));
keyboard_list = kmfl_get_keyboard_list(local_keyboard_path);
engines = ibus_kmfl_add_engines(engines, keyboard_list);
g_free(local_keyboard_path);
g_list_free(keyboard_list);
local_keyboard_path= g_strdup_printf("%s/.local/share/keyman", getenv("HOME"));
keyboard_list = kmfl_get_keyboard_list(local_keyboard_path);
engines = ibus_kmfl_add_engines(engines, keyboard_list);
g_free(local_keyboard_path);
g_list_free(keyboard_list);
return engines;
}

View file

@ -75,6 +75,7 @@ typedef struct
int keyboard_number;
gchar * keyboard_filename;
gchar * keyboard_icon_filename;
gchar * keyboard_id;
gchar * keyboard_name;
gchar * keyboard_language;
gchar * keyboard_author;

View file

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -370,7 +370,7 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = include src kmfl_compiler
kmflcompdocdir = ${prefix}/doc/kmflcomp
kmflcompdocdir = ${docdir}
kmflcompdoc_DATA = \
README\
COPYING\
@ -638,7 +638,7 @@ distdir: $(DISTFILES)
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
$(am__post_remove_distdir)
dist-bzip2: distdir
@ -664,7 +664,7 @@ dist-shar: distdir
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
$(am__post_remove_distdir)
dist-zip: distdir
@ -682,7 +682,7 @@ dist dist-all:
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
@ -692,7 +692,7 @@ distcheck: dist
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac

View file

@ -1,6 +1,6 @@
# generated automatically by aclocal 1.15 -*- Autoconf -*-
# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -744,7 +744,6 @@ _LT_CONFIG_SAVE_COMMANDS([
cat <<_LT_EOF >> "$cfgfile"
#! $SHELL
# Generated automatically by $as_me ($PACKAGE) $VERSION
# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
# Provide generalized library-building support services.
@ -9068,7 +9067,7 @@ m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
# Copyright (C) 2002-2014 Free Software Foundation, Inc.
# Copyright (C) 2002-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -9083,7 +9082,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.15'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
m4_if([$1], [1.15], [],
m4_if([$1], [1.15.1], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@ -9099,14 +9098,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.15])dnl
[AM_AUTOMAKE_VERSION([1.15.1])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -9158,7 +9157,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997-2014 Free Software Foundation, Inc.
# Copyright (C) 1997-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -9189,7 +9188,7 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Copyright (C) 1999-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -9380,7 +9379,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
# Generate code to set up dependency tracking. -*- Autoconf -*-
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Copyright (C) 1999-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -9456,7 +9455,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -9653,7 +9652,7 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -9674,7 +9673,7 @@ if test x"${install_sh+set}" != xset; then
fi
AC_SUBST([install_sh])])
# Copyright (C) 2003-2014 Free Software Foundation, Inc.
# Copyright (C) 2003-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -9693,7 +9692,7 @@ fi
rmdir .tst 2>/dev/null
AC_SUBST([am__leading_dot])])
# Copyright (C) 1998-2014 Free Software Foundation, Inc.
# Copyright (C) 1998-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -9713,7 +9712,7 @@ fi])
# Check to see how 'make' treats includes. -*- Autoconf -*-
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -9763,7 +9762,7 @@ rm -f confinc confmf
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
# Copyright (C) 1997-2014 Free Software Foundation, Inc.
# Copyright (C) 1997-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -9804,7 +9803,7 @@ fi
# Obsolete and "removed" macros, that must however still report explicit
# error messages when used, to smooth transition.
#
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -9831,7 +9830,7 @@ AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
# Helper functions for option handling. -*- Autoconf -*-
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -9860,7 +9859,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Copyright (C) 1999-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -9907,7 +9906,7 @@ AC_LANG_POP([C])])
# For backward compatibility.
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -9926,7 +9925,7 @@ AC_DEFUN([AM_RUN_LOG],
# Check to make sure that the build environment is sane. -*- Autoconf -*-
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -10007,7 +10006,7 @@ AC_CONFIG_COMMANDS_PRE(
rm -f conftest.file
])
# Copyright (C) 2009-2014 Free Software Foundation, Inc.
# Copyright (C) 2009-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -10067,7 +10066,7 @@ AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -10095,7 +10094,7 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
# Copyright (C) 2006-2014 Free Software Foundation, Inc.
# Copyright (C) 2006-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -10114,7 +10113,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004-2014 Free Software Foundation, Inc.
# Copyright (C) 2004-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,

View file

@ -15483,7 +15483,6 @@ $as_echo X"$file" |
cat <<_LT_EOF >> "$cfgfile"
#! $SHELL
# Generated automatically by $as_me ($PACKAGE) $VERSION
# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
# Provide generalized library-building support services.

View file

@ -2,8 +2,11 @@ kmflcomp (10.99.1-1) UNRELEASED; urgency=medium
* Change license to MIT as kmflcomp is being moved into Keyman 11
* Keyman is now owned by SIL
* new upstream pre-release
- add new symbols to d/libkmflcomp0.symbols
* d/control remove build-dep on autotools-dev (compat 10)
-- Daniel Glassey <wdg@debian.org> Thu, 17 May 2018 11:39:04 +0700
-- Daniel Glassey <wdg@debian.org> Wed, 29 Aug 2018 16:37:58 +0700
kmflcomp (0.9.10-1) unstable; urgency=low

View file

@ -4,7 +4,7 @@ Section: utils
Maintainer: Doug Rintoul <doug_rintoul@sil.org>
Uploaders: Torsten Werner <twerner@debian.org>
Homepage: http://kmfl.sourceforge.net/
Build-Depends: cdbs (>= 0.4.27), debhelper (>= 10), libx11-dev, autotools-dev
Build-Depends: cdbs (>= 0.4.27), debhelper (>= 10), libx11-dev
Standards-Version: 3.9.8.0
Package: libkmflcomp-dev

View file

@ -17,6 +17,7 @@ libkmflcomp.so.0 libkmflcomp0 #MINVER#
caller@Base 0.9.10
check_bitmap_file@Base 0.9.10
check_keyboard@Base 0.9.10
check_linux_target@Base 10.99.1
check_lhs@Base 0.9.10
check_rhs@Base 0.9.10
check_rule@Base 0.9.10
@ -44,6 +45,7 @@ libkmflcomp.so.0 libkmflcomp0 #MINVER#
find_store@Base 0.9.10
gp@Base 0.9.10
group_number@Base 0.9.10
ignored_stores@Base 10.99.1
initialize_special_stores@Base 0.9.10
items_from_string@Base 0.9.10
items_to_string@Base 0.9.10
@ -83,6 +85,7 @@ libkmflcomp.so.0 libkmflcomp0 #MINVER#
store_number@Base 0.9.10
string_to_keysym@Base 0.9.10
text_to_keysym@Base 0.9.10
valid_targets@Base 10.99.1
warncount@Base 0.9.10
warnlimit@Base 0.9.10
write_keyboard@Base 0.9.10

View file

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,

View file

@ -37,8 +37,8 @@ extern "C" {
#include <sys/types.h>
#define FILE_VERSION "1"
#define BASE_VERSION "320"
#define LAST_VERSION "700"
#define BASE_VERSION "0320"
#define LAST_VERSION "1000"
// Undefine some Windows constants so we can use them (even on Windows)
#ifdef UNDEFINED
@ -107,7 +107,8 @@ enum {ITEM_CHAR=0,ITEM_KEYSYM,ITEM_ANY,ITEM_INDEX,ITEM_OUTS,ITEM_DEADKEY,ITEM_CO
// Enumerate special stores with reserved names (prefixed by &)
enum TAG_SS {SS_UNDEFINED=-1,SS_NAME,SS_VERSION,SS_HOTKEY,SS_LANGUAGE,SS_LAYOUT,SS_COPYRIGHT,
SS_MESSAGE,SS_BITMAP,SS_MNEMONIC,SS_ETHNOLOGUE,SS_CAPSOFF,SS_CAPSON,SS_CAPSFREE,SS_AUTHOR};
SS_MESSAGE,SS_BITMAP,SS_MNEMONIC,SS_ETHNOLOGUE,SS_CAPSOFF,SS_CAPSON,SS_CAPSFREE,SS_AUTHOR,
SS_TARGETS,SS_VISUALKEYBOARD,SS_KEYBOARDVERSION};
// The following compiled keyboard structures and types are used by both the compiler
// and the interpreter
@ -146,7 +147,7 @@ typedef struct _xgroup XGROUP;
// Compiled keyboard structure
struct _xkeyboard {
char id[4]; // always KMFL
char version[4]; // keyboard version(3) and file version(1)
char version[5]; // keyboard version(4) and file version(1)
char name[NAMELEN+1]; // utf8 version of keyboard name
UINT mode:1; // Keyboard Flags: Unicode (0) or ANSI (1)
UINT layout:1; // positional(0) or mnemonic(1)

View file

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,

View file

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,

View file

@ -65,7 +65,7 @@ typedef struct _group GROUP;
// Keyboard structure
struct _keyboard {
char id[4]; // always KMFL
char version[4]; // initially 1000
char version[5]; // initially 1000
char name[NAMELEN+1]; // utf8 version of keyboard name
UINT mode:1; // Keyboard Flags: Unicode (0) or ANSI (1)
UINT layout:1; // positional(0) or mnemonic(1)
@ -132,6 +132,7 @@ void initialize_special_stores(void);
void process_special_store(char *name, STORE *sp, int line);
void check_keyboard(KEYBOARD *kbp);
int check_bitmap_file(STORE *sp, int line);
int check_linux_target(STORE *sp, int line);
void *checked_alloc(size_t n, size_t sz);
void sort_rules(GROUP *gp);

View file

@ -114,12 +114,12 @@ void write_keyboard(char * infile, void *keyboard_buffer, int keyboard_buffer_si
fprintf(stderr," Total warnings: %d\n",warncount);
}
if(Version[2] > '0')
fprintf(stderr,"Keyboard '%s' (Version %c.%c%c) compiled to %ld bytes\n",
kbp->name,Version[0],Version[1],Version[2],filesize);
if(Version[3] > '0')
fprintf(stderr,"Keyboard '%s' (Version %c%c.%c%c) compiled to %ld bytes\n",
kbp->name,Version[0],Version[1],Version[2],Version[3],filesize);
else
fprintf(stderr,"Keyboard '%s' (Version %c.%c) compiled to %ld bytes\n",
kbp->name,Version[0],Version[1],filesize);
fprintf(stderr,"Keyboard '%s' (Version %c%c.%c) compiled to %ld bytes\n",
kbp->name,Version[0],Version[1],Version[2],filesize);
}
else
fail(3,"unable to save output file!");
@ -285,7 +285,7 @@ unsigned long create_keyboard_buffer(const char *infile, void ** kb_buf)
// Set tag and version
memcpy(&xkbd.id,"KMFL",4);
memcpy(&xkbd.version,Version,4);
memcpy(&xkbd.version,Version,5);
// add the keyboard header
keyboard_buffer = append_to_buffer(keyboard_buffer, &keyboard_buffer_size, &xkbd, sizeof(XKEYBOARD));
@ -572,14 +572,14 @@ ITEM *check_lhs(ITEM *lhs, unsigned int ilen, GROUP *gp, int line)
}
*p = 0; // ensure rule string terminated after compacting
if((gp->flags & GF_USEKEYS) && !goodplus && (Version[0] > '3'))
if((gp->flags & GF_USEKEYS) && !goodplus && (Version[1] > '3' || Version[0] >= '1')) // needs review
{
kmflcomp_warn(line,"'+' should be used before the keystroke");
}
if(badplus)
{
if(Version[0] > '5')
if(Version[1] > '5' || Version[0] >= '1') // needs review
kmflcomp_error(line,"use '+' only immediately before keystroke");
else
kmflcomp_warn(line,"'+' used incorrectly (but ignored)");
@ -1045,8 +1045,8 @@ char *items_to_string(ITEM *p)
static char temp[256];
char *sp, *sp1;
int n;
n = count_items(p);
//int n;
//n = count_items(p);
for(sp=temp,sp1=temp+240,*sp=0; (*p) && (sp<sp1); p++)
{
@ -1114,7 +1114,14 @@ char *items_to_string(ITEM *p)
char *special_stores[] = {
"&name","&version","&hotkey","&language","&layout","&copyright","&message",
"&bitmap","&mnemoniclayout","&ethnologuecode",
"&capsalwaysoff","&capsononly","&shiftfreescaps","&author"};
"&capsalwaysoff","&capsononly","&shiftfreescaps","&author",
"&targets","&visualkeyboard","&keyboardversion"};
// stores new from keyman 7.0 onwards that can safely be ignored for kmfl 11 for now
char *ignored_stores[] = {
"&layoutfile","&kmw_helpfile","&kmw_embedjs",
"&windowslanguages","&kmw_rtl",
"&kmw_embedcss","&kmw_helptext","&includecodes"};
// Initialize special stores (create dummy entries)
void initialize_special_stores(void)
@ -1129,7 +1136,7 @@ void initialize_special_stores(void)
// Copy special store contents to keyboard header as required
void process_special_store(char *name, STORE *sp, int line)
{
int n, kbver;
int n, p, kbver;
// Identify store by name
for(n=0; n<sizeof(special_stores)/sizeof(char *); n++)
@ -1159,20 +1166,32 @@ void process_special_store(char *name, STORE *sp, int line)
break;
case SS_VERSION:
kbver = (int)(100.0*atof(items_to_string(sp->items))+0.5);
sprintf(Version,"%3.3d%1.1s",kbver,FILE_VERSION);
sprintf(Version,"%4.4d%1.1s",kbver,FILE_VERSION);
break;
case SS_BITMAP:
check_bitmap_file(sp,line);
break;
case SS_TARGETS:
if (!check_linux_target(sp,line))
fail(1, "Line %d: No valid linux target in %s", line, items_to_string(sp->items));
//kmflcomp_warn(line, "No valid linux target.");
break;
case SS_COPYRIGHT:
case SS_MESSAGE:
case SS_LAYOUT:
case SS_AUTHOR:
case SS_LANGUAGE:
case SS_ETHNOLOGUE:
case SS_KEYBOARDVERSION:
case SS_VISUALKEYBOARD:
break;
default:
kmflcomp_warn(line-1,"unrecognized special store '&%s'",name);
for(p=0; p<sizeof(ignored_stores)/sizeof(char *); p++)
{
if(strcasecmp(name,ignored_stores[p]) == 0 ) break;
}
if (p==sizeof(ignored_stores)/sizeof(char *))
kmflcomp_warn(line-1,"unrecognized special store '&%s'",name);
return;
}
}
@ -1403,11 +1422,41 @@ char *find_first_match(char *path)
}
#endif
// valid targets that should compile for linux
char *valid_targets[] = {
"any","linux","desktop","windows","macosx"};
int check_linux_target(STORE *sp, int line)
{
char *p, *ptr, tname[128];
char delim[] = " ";
UTF32 *p1;
UTF8 *p2;
int n;
p1 = (UTF32*)sp->items;
p2 = (UTF8*)tname;
IConvertUTF32toUTF8((const UTF32 **)&p1,(const UTF32 *)(sp->items+sp->len),&p2,(UTF8 *)(tname+127));
*p2 = 0;
p = (char *)tname;
ptr = strtok(p, delim);
while(ptr != NULL)
{
for(n=0; n<sizeof(valid_targets)/sizeof(char *); n++)
{
if(strcasecmp(ptr,valid_targets[n]) == 0 ) {
return 1;
}
}
ptr = strtok(NULL, delim);
}
return 0;
}
// Check that the bitmap file exists as specified, or else that a file with an accepted variation
// of the name exists (different case, .bmp or .png suffixes)
int check_bitmap_file(STORE *sp, int line)
{
char *p,*bmp_path=NULL,tname[64];
char *p,*bmp_path=NULL,*icons_path=NULL,tname[256];
struct stat fstat;
UINT i;
UTF32 *p1,*titems=NULL;
@ -1415,23 +1464,27 @@ int check_bitmap_file(STORE *sp, int line)
p1 = (UTF32*)sp->items;
p2 = (UTF8*)tname;
IConvertUTF32toUTF8((const UTF32 **)&p1,(const UTF32 *)(sp->items+sp->len),&p2,(UTF8 *)(tname+63));
IConvertUTF32toUTF8((const UTF32 **)&p1,(const UTF32 *)(sp->items+sp->len),&p2,(UTF8 *)(tname+255));
*p2 = 0;
if((p=rindex(fname,DIRDELIM)) != NULL)
{
bmp_path = (char *)checked_alloc((p-fname+1)+strlen(tname)+6,1);
bmp_path = (char *)checked_alloc((p-fname+1)+strlen(tname)+10,1);
strncpy(bmp_path,fname,p-fname+1);
strcpy(bmp_path+(p-fname+1),tname);
}
else
{
bmp_path = (char *)checked_alloc(strlen(tname)+6,1);
bmp_path = (char *)checked_alloc(strlen(tname)+10,1);
strcpy(bmp_path,tname);
}
if (strncmp(bmp_path+strlen(bmp_path)-4, ".ico", 4) == 0)
{
strcat(bmp_path,".bmp");
}
// First test if the file exists exactly as in BITMAP statement
if(stat(bmp_path,&fstat) == 0)
else if(stat(bmp_path,&fstat) == 0)
{
mem_free(bmp_path); // file exists
return 0;
@ -1440,18 +1493,61 @@ int check_bitmap_file(STORE *sp, int line)
// Search for a case-variation (irrelevant for Windows)
p = find_first_match(bmp_path);
// Search in icons dir
if(p == NULL)
{
icons_path = (char *)checked_alloc(strlen(bmp_path)+12,1);
if((p=rindex(fname,DIRDELIM)) != NULL)
{
strncpy(icons_path,fname,p-fname+1);
strcpy(icons_path+(p-fname+1),"icons/");
strcpy(icons_path+(p-fname+1+6),tname);
}
else
{
strcpy(icons_path,"icons/");
strcat(icons_path, bmp_path);
}
p = find_first_match(icons_path);
}
// If no extension specified, search next for files with extensions .bmp and .png
if((p == NULL) && (strchr(tname,'.') == NULL))
{
// Add .bmp
strcat(bmp_path,".bmp");
p = find_first_match(bmp_path);
if ((p == NULL) && icons_path)
{
// Add .bmp in icons dir
strcat(icons_path,".bmp");
p = find_first_match(icons_path);
}
if(p == NULL)
{
// Add .png
strcpy(bmp_path+strlen(bmp_path)-4,".png");
p = find_first_match(bmp_path);
}
if ((p == NULL) && icons_path)
{
// Add .png in icons dir
strcpy(icons_path+strlen(icons_path)-4,".png");
p = find_first_match(icons_path);
}
if(p == NULL)
{
// Add .ico.bmp (ico converted to bmp)
strcpy(bmp_path+strlen(bmp_path)-4,".ico.bmp");
p = find_first_match(bmp_path);
}
}
// If there is an extension but not found, try .bmp added (converted from .ico)
if(p == NULL)
{
strcat(bmp_path, ".bmp");
p = find_first_match(bmp_path);
}
// Issue appropriate warnings and replace file name in store
@ -1459,11 +1555,13 @@ int check_bitmap_file(STORE *sp, int line)
{
kmflcomp_warn(line,"The bitmap file '%s' was not found. Create a suitable bitmap of that name "
"and copy it with the compiled keyboard",tname);
}
else
{
if (icons_path)
{
p = p - 6; // include 'icons/' in name
}
kmflcomp_warn(line,"A bitmap named '%s' was found and will be referred to in the compiled keyboard "
"instead of '%s'",p,tname);
@ -1479,6 +1577,7 @@ int check_bitmap_file(STORE *sp, int line)
}
if(bmp_path) mem_free(bmp_path);
if(icons_path) mem_free(icons_path);
return 1;
}

File diff suppressed because it is too large Load diff

View file

@ -74,6 +74,9 @@ MESSAGE {return TOK_MESSAGE;}
MNEMONIC[ ]*LAYOUT {return TOK_MNEMONIC;}
ETHNOLOGUE[ ]*CODE {return TOK_ETHNOLOGUE;}
AUTHOR {return TOK_AUTHOR;}
TARGETS {return TOK_TARGETS;}
VISUALKEYBOARD {return TOK_VISUALKEYBOARD;}
KEYBOARDVERSION {BEGIN(KBDVER);return TOK_KEYBOARDVERSION;}
begin[ ]+ansi {return TOK_ANSI;}
begin[ ]+unicode {return TOK_UNICODE;}
begin {return TOK_ANSI;}

File diff suppressed because it is too large Load diff

View file

@ -1,14 +1,13 @@
/* A Bison parser, made by GNU Bison 2.3. */
/* A Bison parser, made by GNU Bison 3.0.4. */
/* Skeleton interface for Bison's Yacc-like parsers in C
/* Bison interface for 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-2015 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 2, or (at your option)
any later version.
the Free Software Foundation, either version 3 of the License, 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
@ -16,9 +15,7 @@
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, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@ -33,62 +30,74 @@
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
/* Tokens. */
#ifndef YY_YY_YACC_H_INCLUDED
# define YY_YY_YACC_H_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
#if YYDEBUG
extern int yydebug;
#endif
/* Token type. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
TOK_ANY = 258,
TOK_ANSI = 259,
TOK_AUTHOR = 260,
TOK_BEEP = 261,
TOK_BITMAP = 262,
TOK_BRKT = 263,
TOK_CALL = 264,
TOK_CAPSFREE = 265,
TOK_CAPSOFF = 266,
TOK_CAPSON = 267,
TOK_COMMA = 268,
TOK_CONTEXT = 269,
TOK_COPYRIGHT = 270,
TOK_CHAR = 271,
TOK_DEADKEY = 272,
TOK_DOLLAR = 273,
TOK_ERROR = 274,
TOK_ETHNOLOGUE = 275,
TOK_GROUP = 276,
TOK_GT = 277,
TOK_HOTKEY = 278,
TOK_INDEX = 279,
TOK_LANGUAGE = 280,
TOK_LAYOUT = 281,
TOK_MATCH = 282,
TOK_MESSAGE = 283,
TOK_MNEMONIC = 284,
TOK_NOMATCH = 285,
TOK_NAME = 286,
TOK_NOTANY = 287,
TOK_NUL = 288,
TOK_NUMBER = 289,
TOK_NL = 290,
TOK_OUTS = 291,
TOK_RAWKEY = 292,
TOK_PLUS = 293,
TOK_QM = 294,
TOK_RTN = 295,
TOK_SB = 296,
TOK_SHIFT = 297,
TOK_STORE = 298,
TOK_STOREINSTORE = 299,
TOK_SWITCH = 300,
TOK_UNICODE = 301,
TOK_USE = 302,
TOK_USINGKEYS = 303,
TOK_UTF = 304,
TOK_VERSION = 305,
TOK_XKEYSYM = 306
};
enum yytokentype
{
TOK_ANY = 258,
TOK_ANSI = 259,
TOK_AUTHOR = 260,
TOK_BEEP = 261,
TOK_BITMAP = 262,
TOK_BRKT = 263,
TOK_CALL = 264,
TOK_CAPSFREE = 265,
TOK_CAPSOFF = 266,
TOK_CAPSON = 267,
TOK_COMMA = 268,
TOK_CONTEXT = 269,
TOK_COPYRIGHT = 270,
TOK_CHAR = 271,
TOK_DEADKEY = 272,
TOK_DOLLAR = 273,
TOK_ERROR = 274,
TOK_ETHNOLOGUE = 275,
TOK_GROUP = 276,
TOK_GT = 277,
TOK_HOTKEY = 278,
TOK_INDEX = 279,
TOK_LANGUAGE = 280,
TOK_LAYOUT = 281,
TOK_KEYBOARDVERSION = 282,
TOK_MATCH = 283,
TOK_MESSAGE = 284,
TOK_MNEMONIC = 285,
TOK_NOMATCH = 286,
TOK_NAME = 287,
TOK_NOTANY = 288,
TOK_NUL = 289,
TOK_NUMBER = 290,
TOK_NL = 291,
TOK_OUTS = 292,
TOK_RAWKEY = 293,
TOK_PLUS = 294,
TOK_QM = 295,
TOK_RTN = 296,
TOK_SB = 297,
TOK_SHIFT = 298,
TOK_STORE = 299,
TOK_STOREINSTORE = 300,
TOK_SWITCH = 301,
TOK_TARGETS = 302,
TOK_UNICODE = 303,
TOK_USE = 304,
TOK_USINGKEYS = 305,
TOK_UTF = 306,
TOK_VERSION = 307,
TOK_VISUALKEYBOARD = 308,
TOK_XKEYSYM = 309
};
#endif
/* Tokens. */
#define TOK_ANY 258
@ -115,53 +124,61 @@
#define TOK_INDEX 279
#define TOK_LANGUAGE 280
#define TOK_LAYOUT 281
#define TOK_MATCH 282
#define TOK_MESSAGE 283
#define TOK_MNEMONIC 284
#define TOK_NOMATCH 285
#define TOK_NAME 286
#define TOK_NOTANY 287
#define TOK_NUL 288
#define TOK_NUMBER 289
#define TOK_NL 290
#define TOK_OUTS 291
#define TOK_RAWKEY 292
#define TOK_PLUS 293
#define TOK_QM 294
#define TOK_RTN 295
#define TOK_SB 296
#define TOK_SHIFT 297
#define TOK_STORE 298
#define TOK_STOREINSTORE 299
#define TOK_SWITCH 300
#define TOK_UNICODE 301
#define TOK_USE 302
#define TOK_USINGKEYS 303
#define TOK_UTF 304
#define TOK_VERSION 305
#define TOK_XKEYSYM 306
#define TOK_KEYBOARDVERSION 282
#define TOK_MATCH 283
#define TOK_MESSAGE 284
#define TOK_MNEMONIC 285
#define TOK_NOMATCH 286
#define TOK_NAME 287
#define TOK_NOTANY 288
#define TOK_NUL 289
#define TOK_NUMBER 290
#define TOK_NL 291
#define TOK_OUTS 292
#define TOK_RAWKEY 293
#define TOK_PLUS 294
#define TOK_QM 295
#define TOK_RTN 296
#define TOK_SB 297
#define TOK_SHIFT 298
#define TOK_STORE 299
#define TOK_STOREINSTORE 300
#define TOK_SWITCH 301
#define TOK_TARGETS 302
#define TOK_UNICODE 303
#define TOK_USE 304
#define TOK_USINGKEYS 305
#define TOK_UTF 306
#define TOK_VERSION 307
#define TOK_VISUALKEYBOARD 308
#define TOK_XKEYSYM 309
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
#line 25 "yacc.y"
union YYSTYPE
{
#line 25 "../../kmflcomp/src/yacc.y" /* yacc.c:1909 */
int simple;
ITEM number;
char *string;
ITEM *items;
RULE *rule;
GROUP *group;
}
/* Line 1489 of yacc.c. */
#line 160 "yacc.h"
YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
#line 172 "yacc.h" /* yacc.c:1909 */
};
typedef union YYSTYPE YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
#endif
extern YYSTYPE yylval;
int yyparse (void);
#endif /* !YY_YY_YACC_H_INCLUDED */

View file

@ -71,6 +71,7 @@ GROUP *gp = NULL; /* Temporary group pointer */
%token <simple> TOK_INDEX
%token <simple> TOK_LANGUAGE
%token <simple> TOK_LAYOUT
%token <simple> TOK_KEYBOARDVERSION
%token <simple> TOK_MATCH
%token <simple> TOK_MESSAGE
%token <simple> TOK_MNEMONIC
@ -90,11 +91,13 @@ GROUP *gp = NULL; /* Temporary group pointer */
%token <simple> TOK_STORE
%token <simple> TOK_STOREINSTORE
%token <simple> TOK_SWITCH
%token <simple> TOK_TARGETS
%token <simple> TOK_UNICODE
%token <simple> TOK_USE
%token <simple> TOK_USINGKEYS
%token <number> TOK_UTF
%token <simple> TOK_VERSION
%token <simple> TOK_VISUALKEYBOARD
%token <number> TOK_XKEYSYM
%%
@ -143,6 +146,14 @@ T_HEADLINE :
{
new_store_from_string("&version",$2,lineno);
}
| TOK_KEYBOARDVERSION T_BYTES TOK_NL
{
new_store_from_string("&keyboardversion",$2,lineno);
}
| TOK_KEYBOARDVERSION T_STRING TOK_NL
{
new_store_from_string("&keyboardversion",$2,lineno);
}
| TOK_BITMAP T_BYTES TOK_NL
{
new_store_from_string("&bitmap",$2,lineno);
@ -159,7 +170,7 @@ T_HEADLINE :
{
new_store_from_string("&message",$2,lineno);
}
| TOK_LANGUAGE T_ITEMS TOK_NL
| TOK_LANGUAGE T_STRING TOK_NL
{
new_store_from_string("&language",$2,lineno);
}
@ -204,6 +215,14 @@ T_HEADLINE :
{
new_store_from_string("&author",$2,lineno);
}
| TOK_TARGETS T_STRING TOK_NL
{
new_store_from_string("&targets",$2,lineno);
}
| TOK_VISUALKEYBOARD T_STRING TOK_NL
{
new_store_from_string("&visualkeyboard",$2,lineno);
}
| TOK_MNEMONIC T_STRING TOK_NL
{
new_store_from_string("&mnemoniclayout",$2,lineno);

View file

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -363,7 +363,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = include src
ACLOCAL_AMFLAGS = -I m4
libkmfldocdir = ${prefix}/doc/libkmfl
libkmfldocdir = ${docdir}
libkmfldoc_DATA = \
README\
COPYING\
@ -631,7 +631,7 @@ distdir: $(DISTFILES)
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
$(am__post_remove_distdir)
dist-bzip2: distdir
@ -657,7 +657,7 @@ dist-shar: distdir
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
$(am__post_remove_distdir)
dist-zip: distdir
@ -675,7 +675,7 @@ dist dist-all:
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
@ -685,7 +685,7 @@ distcheck: dist
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac

View file

@ -1,6 +1,6 @@
# generated automatically by aclocal 1.15 -*- Autoconf -*-
# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -20,7 +20,7 @@ You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
# Copyright (C) 2002-2014 Free Software Foundation, Inc.
# Copyright (C) 2002-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -35,7 +35,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.15'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
m4_if([$1], [1.15], [],
m4_if([$1], [1.15.1], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.15])dnl
[AM_AUTOMAKE_VERSION([1.15.1])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -110,7 +110,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997-2014 Free Software Foundation, Inc.
# Copyright (C) 1997-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -141,7 +141,7 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Copyright (C) 1999-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -332,7 +332,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
# Generate code to set up dependency tracking. -*- Autoconf -*-
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Copyright (C) 1999-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -408,7 +408,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -605,7 +605,7 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -626,7 +626,7 @@ if test x"${install_sh+set}" != xset; then
fi
AC_SUBST([install_sh])])
# Copyright (C) 2003-2014 Free Software Foundation, Inc.
# Copyright (C) 2003-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -647,7 +647,7 @@ AC_SUBST([am__leading_dot])])
# Check to see how 'make' treats includes. -*- Autoconf -*-
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -697,7 +697,7 @@ rm -f confinc confmf
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
# Copyright (C) 1997-2014 Free Software Foundation, Inc.
# Copyright (C) 1997-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -738,7 +738,7 @@ fi
# Obsolete and "removed" macros, that must however still report explicit
# error messages when used, to smooth transition.
#
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -765,7 +765,7 @@ AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
# Helper functions for option handling. -*- Autoconf -*-
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -794,7 +794,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Copyright (C) 1999-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -841,7 +841,7 @@ AC_LANG_POP([C])])
# For backward compatibility.
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -860,7 +860,7 @@ AC_DEFUN([AM_RUN_LOG],
# Check to make sure that the build environment is sane. -*- Autoconf -*-
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -941,7 +941,7 @@ AC_CONFIG_COMMANDS_PRE(
rm -f conftest.file
])
# Copyright (C) 2009-2014 Free Software Foundation, Inc.
# Copyright (C) 2009-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -1001,7 +1001,7 @@ AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -1029,7 +1029,7 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
# Copyright (C) 2006-2014 Free Software Foundation, Inc.
# Copyright (C) 2006-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@ -1048,7 +1048,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004-2014 Free Software Foundation, Inc.
# Copyright (C) 2004-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,

View file

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,

View file

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,

View file

@ -191,7 +191,7 @@ XKEYBOARD * kmfl_load_keyboard_from_file(const char *filename)
if (errcode == 0)
{
compile_keyboard_to_buffer(filename, (void *) &p_kbd);
memcpy(version_string,p_kbd->version,3); // Copy to ensure terminated
memcpy(version_string,p_kbd->version,4); // Copy to ensure terminated
kbver = (unsigned)atoi(version_string);
}
else
@ -219,17 +219,17 @@ XKEYBOARD * kmfl_load_keyboard_from_file(const char *filename)
return NULL;
}
fclose(fp);
memcpy(version_string,p_kbd->version,3); // Copy to ensure terminated
memcpy(version_string,p_kbd->version,4); // Copy to ensure terminated
kbver = (unsigned)atoi(version_string);
}
}
// Check the loaded file is valid and has the correct version
if((memcmp(p_kbd->id,"KMFL",4) != 0)
|| (p_kbd->version[3] != *FILE_VERSION)
|| (p_kbd->version[4] != *FILE_VERSION)
|| (kbver < (unsigned)atoi(BASE_VERSION))
|| (kbver > (unsigned)atoi(LAST_VERSION)))
{
DBGMSG(1, "Invalid version\n");
DBGMSG(1, "Invalid version %s\n", version_string);
free(p_kbd);
return NULL;
}