From 740a9e9e79464e6edaa839a9d44c8ef06b27f73b Mon Sep 17 00:00:00 2001 From: Mike Small Date: Sun, 6 Oct 2019 22:28:07 -0400 Subject: [PATCH] Start converting to C++. Start simplified icon placement. --- Makefile.in | 25 +- aclocal.m4 | 2515 ++++++++++++------------ configure | 595 +++++- configure.ac | 1 + man/Makefile.in | 15 +- src/Makefile.am | 5 +- src/Makefile.in | 53 +- src/add_window.c | 40 +- src/events.c | 16 +- src/gram.c | 3860 ++++++++++++++++++++++++------------- src/gram.h | 253 ++- src/gram.y | 3 - src/{icons.c => icons.cc} | 321 +-- src/icons.h | 29 +- src/list.c | 18 +- src/list.h | 21 +- src/menus.c | 10 +- src/screen.h | 4 +- src/session.c | 28 +- src/twm.c | 4 +- src/twm.h | 4 +- src/util.c | 6 +- src/util.h | 75 +- src/version.c | 2 +- 24 files changed, 4759 insertions(+), 3144 deletions(-) rename src/{icons.c => icons.cc} (60%) diff --git a/Makefile.in b/Makefile.in index d8fa85f..56fddc7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -242,6 +242,9 @@ CHANGELOG_CMD = @CHANGELOG_CMD@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CWARNFLAGS = @CWARNFLAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -270,7 +273,6 @@ LIBS = @LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN_SUBSTS = @MAN_SUBSTS@ MISC_MAN_DIR = @MISC_MAN_DIR@ @@ -305,6 +307,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -359,7 +362,7 @@ all: config.h .SUFFIXES: am--refresh: Makefile @: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -385,9 +388,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): @@ -398,7 +401,7 @@ config.h: stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h -$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ @@ -580,7 +583,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) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 @@ -605,7 +608,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) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir @@ -623,7 +626,7 @@ dist dist-all: distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ - eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ @@ -633,7 +636,7 @@ distcheck: dist *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ - eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac diff --git a/aclocal.m4 b/aclocal.m4 index fa0b1a7..4bd0798 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.15.1 -*- Autoconf -*- +# generated automatically by aclocal 1.15 -*- Autoconf -*- -# Copyright (C) 1996-2017 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -20,32 +20,63 @@ 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'.])]) -# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -# serial 1 (pkg-config-0.24) -# -# Copyright © 2004 Scott James Remnant . -# -# 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 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 -# 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, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# serial 12 (pkg-config-0.29.2) -# PKG_PROG_PKG_CONFIG([MIN-VERSION]) -# ---------------------------------- +dnl Copyright © 2004 Scott James Remnant . +dnl Copyright © 2012-2015 Dan Nicholson +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +dnl 02111-1307, USA. +dnl +dnl As a special exception to the GNU General Public License, if you +dnl distribute this file as part of a program that contains a +dnl configuration script generated by Autoconf, you may include it under +dnl the same distribution terms that you use for the rest of that +dnl program. + +dnl PKG_PREREQ(MIN-VERSION) +dnl ----------------------- +dnl Since: 0.29 +dnl +dnl Verify that the version of the pkg-config macros are at least +dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's +dnl installed version of pkg-config, this checks the developer's version +dnl of pkg.m4 when generating configure. +dnl +dnl To ensure that this macro is defined, also add: +dnl m4_ifndef([PKG_PREREQ], +dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) +dnl +dnl See the "Since" comment for each macro you use to see what version +dnl of the macros you require. +m4_defun([PKG_PREREQ], +[m4_define([PKG_MACROS_VERSION], [0.29.2]) +m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, + [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) +])dnl PKG_PREREQ + +dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) +dnl ---------------------------------- +dnl Since: 0.16 +dnl +dnl Search for the pkg-config tool and set the PKG_CONFIG variable to +dnl first found in the path. Checks that the version of pkg-config found +dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is +dnl used since that's the first version where most current features of +dnl pkg-config existed. AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) @@ -67,18 +98,19 @@ if test -n "$PKG_CONFIG"; then PKG_CONFIG="" fi fi[]dnl -])# PKG_PROG_PKG_CONFIG +])dnl PKG_PROG_PKG_CONFIG -# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# -# Check to see whether a particular set of modules exists. Similar -# to PKG_CHECK_MODULES(), but does not set variables or print errors. -# -# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -# only at the first occurence in configure.ac, so if the first place -# it's called might be skipped (such as if it is within an "if", you -# have to call PKG_CHECK_EXISTS manually -# -------------------------------------------------------------- +dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +dnl ------------------------------------------------------------------- +dnl Since: 0.18 +dnl +dnl Check to see whether a particular set of modules exists. Similar to +dnl PKG_CHECK_MODULES(), but does not set variables or print errors. +dnl +dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +dnl only at the first occurence in configure.ac, so if the first place +dnl it's called might be skipped (such as if it is within an "if", you +dnl have to call PKG_CHECK_EXISTS manually AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ @@ -88,8 +120,10 @@ m4_ifvaln([$3], [else $3])dnl fi]) -# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) -# --------------------------------------------- +dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +dnl --------------------------------------------- +dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting +dnl pkg_failed based on the result. m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" @@ -101,10 +135,11 @@ m4_define([_PKG_CONFIG], else pkg_failed=untried fi[]dnl -])# _PKG_CONFIG +])dnl _PKG_CONFIG -# _PKG_SHORT_ERRORS_SUPPORTED -# ----------------------------- +dnl _PKG_SHORT_ERRORS_SUPPORTED +dnl --------------------------- +dnl Internal check to see if pkg-config supports short errors. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then @@ -112,26 +147,24 @@ if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then else _pkg_short_errors_supported=no fi[]dnl -])# _PKG_SHORT_ERRORS_SUPPORTED +])dnl _PKG_SHORT_ERRORS_SUPPORTED -# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -# [ACTION-IF-NOT-FOUND]) -# -# -# Note that if there is a possibility the first call to -# PKG_CHECK_MODULES might not happen, you should be sure to include an -# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac -# -# -# -------------------------------------------------------------- +dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +dnl [ACTION-IF-NOT-FOUND]) +dnl -------------------------------------------------------------- +dnl Since: 0.4.0 +dnl +dnl Note that if there is a possibility the first call to +dnl PKG_CHECK_MODULES might not happen, you should be sure to include an +dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no -AC_MSG_CHECKING([for $1]) +AC_MSG_CHECKING([for $2]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) @@ -141,11 +174,11 @@ and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then - AC_MSG_RESULT([no]) + AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` - else + else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs @@ -162,7 +195,7 @@ installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then - AC_MSG_RESULT([no]) + AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full @@ -178,16 +211,40 @@ else AC_MSG_RESULT([yes]) $3 fi[]dnl -])# PKG_CHECK_MODULES +])dnl PKG_CHECK_MODULES -# PKG_INSTALLDIR(DIRECTORY) -# ------------------------- -# Substitutes the variable pkgconfigdir as the location where a module -# should install pkg-config .pc files. By default the directory is -# $libdir/pkgconfig, but the default can be changed by passing -# DIRECTORY. The user can override through the --with-pkgconfigdir -# parameter. +dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +dnl [ACTION-IF-NOT-FOUND]) +dnl --------------------------------------------------------------------- +dnl Since: 0.29 +dnl +dnl Checks for existence of MODULES and gathers its build flags with +dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags +dnl and VARIABLE-PREFIX_LIBS from --libs. +dnl +dnl Note that if there is a possibility the first call to +dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to +dnl include an explicit call to PKG_PROG_PKG_CONFIG in your +dnl configure.ac. +AC_DEFUN([PKG_CHECK_MODULES_STATIC], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +_save_PKG_CONFIG=$PKG_CONFIG +PKG_CONFIG="$PKG_CONFIG --static" +PKG_CHECK_MODULES($@) +PKG_CONFIG=$_save_PKG_CONFIG[]dnl +])dnl PKG_CHECK_MODULES_STATIC + + +dnl PKG_INSTALLDIR([DIRECTORY]) +dnl ------------------------- +dnl Since: 0.27 +dnl +dnl Substitutes the variable pkgconfigdir as the location where a module +dnl should install pkg-config .pc files. By default the directory is +dnl $libdir/pkgconfig, but the default can be changed by passing +dnl DIRECTORY. The user can override through the --with-pkgconfigdir +dnl parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], @@ -198,16 +255,18 @@ AC_ARG_WITH([pkgconfigdir], AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) -]) dnl PKG_INSTALLDIR +])dnl PKG_INSTALLDIR -# PKG_NOARCH_INSTALLDIR(DIRECTORY) -# ------------------------- -# Substitutes the variable noarch_pkgconfigdir as the location where a -# module should install arch-independent pkg-config .pc files. By -# default the directory is $datadir/pkgconfig, but the default can be -# changed by passing DIRECTORY. The user can override through the -# --with-noarch-pkgconfigdir parameter. +dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) +dnl -------------------------------- +dnl Since: 0.27 +dnl +dnl Substitutes the variable noarch_pkgconfigdir as the location where a +dnl module should install arch-independent pkg-config .pc files. By +dnl default the directory is $datadir/pkgconfig, but the default can be +dnl changed by passing DIRECTORY. The user can override through the +dnl --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], @@ -218,1173 +277,24 @@ AC_ARG_WITH([noarch-pkgconfigdir], AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) -]) dnl PKG_NOARCH_INSTALLDIR +])dnl PKG_NOARCH_INSTALLDIR -# 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, -# with or without modifications, as long as this notice is preserved. -# AM_AUTOMAKE_VERSION(VERSION) -# ---------------------------- -# Automake X.Y traces this macro to ensure aclocal.m4 has been -# generated from the m4 files accompanying Automake X.Y. -# (This private macro should not be called outside this file.) -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.1], [], - [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl -]) - -# _AM_AUTOCONF_VERSION(VERSION) -# ----------------------------- -# aclocal traces this macro to find the Autoconf version. -# This is a private macro too. Using m4_define simplifies -# the logic in aclocal, which can simply ignore this definition. -m4_define([_AM_AUTOCONF_VERSION], []) - -# AM_SET_CURRENT_AUTOMAKE_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.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-2017 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets -# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to -# '$srcdir', '$srcdir/..', or '$srcdir/../..'. -# -# Of course, Automake must honor this variable whenever it calls a -# tool from the auxiliary directory. The problem is that $srcdir (and -# therefore $ac_aux_dir as well) can be either absolute or relative, -# depending on how configure is run. This is pretty annoying, since -# it makes $ac_aux_dir quite unusable in subdirectories: in the top -# source directory, any form will work fine, but in subdirectories a -# relative path needs to be adjusted first. -# -# $ac_aux_dir/missing -# fails when called from a subdirectory if $ac_aux_dir is relative -# $top_srcdir/$ac_aux_dir/missing -# fails if $ac_aux_dir is absolute, -# fails when called from a subdirectory in a VPATH build with -# a relative $ac_aux_dir -# -# The reason of the latter failure is that $top_srcdir and $ac_aux_dir -# are both prefixed by $srcdir. In an in-source build this is usually -# harmless because $srcdir is '.', but things will broke when you -# start a VPATH build or use an absolute $srcdir. -# -# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, -# iff we strip the leading $srcdir from $ac_aux_dir. That would be: -# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` -# and then we would define $MISSING as -# MISSING="\${SHELL} $am_aux_dir/missing" -# This will work as long as MISSING is not called from configure, because -# unfortunately $(top_srcdir) has no meaning in configure. -# However there are other variables, like CC, which are often used in -# configure, and could therefore not use this "fixed" $ac_aux_dir. -# -# Another solution, used here, is to always expand $ac_aux_dir to an -# absolute PATH. The drawback is that using absolute paths prevent a -# configured tree to be moved without reconfiguration. - -AC_DEFUN([AM_AUX_DIR_EXPAND], -[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl -# Expand $ac_aux_dir to an absolute path. -am_aux_dir=`cd "$ac_aux_dir" && pwd` -]) - -# AM_CONDITIONAL -*- Autoconf -*- - -# 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, -# with or without modifications, as long as this notice is preserved. - -# AM_CONDITIONAL(NAME, SHELL-CONDITION) -# ------------------------------------- -# Define a conditional. -AC_DEFUN([AM_CONDITIONAL], -[AC_PREREQ([2.52])dnl - m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -AC_SUBST([$1_TRUE])dnl -AC_SUBST([$1_FALSE])dnl -_AM_SUBST_NOTMAKE([$1_TRUE])dnl -_AM_SUBST_NOTMAKE([$1_FALSE])dnl -m4_define([_AM_COND_VALUE_$1], [$2])dnl -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= -fi -AC_CONFIG_COMMANDS_PRE( -[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then - AC_MSG_ERROR([[conditional "$1" was never defined. -Usually this means the macro was only invoked conditionally.]]) -fi])]) - -# 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, -# with or without modifications, as long as this notice is preserved. - - -# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be -# written in clear, in which case automake, when reading aclocal.m4, -# will think it sees a *use*, and therefore will trigger all it's -# C support machinery. Also note that it means that autoscan, seeing -# CC etc. in the Makefile, will ask for an AC_PROG_CC use... - - -# _AM_DEPENDENCIES(NAME) -# ---------------------- -# See how the compiler implements dependency checking. -# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". -# We try a few techniques and use that to set a single cache variable. -# -# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was -# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular -# dependency, and given that the user is not expected to run this macro, -# just rely on AC_PROG_CC. -AC_DEFUN([_AM_DEPENDENCIES], -[AC_REQUIRE([AM_SET_DEPDIR])dnl -AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl -AC_REQUIRE([AM_MAKE_INCLUDE])dnl -AC_REQUIRE([AM_DEP_TRACK])dnl - -m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], - [$1], [CXX], [depcc="$CXX" am_compiler_list=], - [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], - [$1], [UPC], [depcc="$UPC" am_compiler_list=], - [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], - [depcc="$$1" am_compiler_list=]) - -AC_CACHE_CHECK([dependency style of $depcc], - [am_cv_$1_dependencies_compiler_type], -[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_$1_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` - fi - am__universal=false - m4_case([$1], [CC], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac], - [CXX], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac]) - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_$1_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_$1_dependencies_compiler_type=none -fi -]) -AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) -AM_CONDITIONAL([am__fastdep$1], [ - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) -]) - - -# AM_SET_DEPDIR -# ------------- -# Choose a directory name for dependency files. -# This macro is AC_REQUIREd in _AM_DEPENDENCIES. -AC_DEFUN([AM_SET_DEPDIR], -[AC_REQUIRE([AM_SET_LEADING_DOT])dnl -AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl -]) - - -# AM_DEP_TRACK -# ------------ -AC_DEFUN([AM_DEP_TRACK], -[AC_ARG_ENABLE([dependency-tracking], [dnl -AS_HELP_STRING( - [--enable-dependency-tracking], - [do not reject slow dependency extractors]) -AS_HELP_STRING( - [--disable-dependency-tracking], - [speeds up one-time build])]) -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi -AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -AC_SUBST([AMDEPBACKSLASH])dnl -_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl -AC_SUBST([am__nodep])dnl -_AM_SUBST_NOTMAKE([am__nodep])dnl -]) - -# Generate code to set up dependency tracking. -*- Autoconf -*- - -# 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, -# with or without modifications, as long as this notice is preserved. - - -# _AM_OUTPUT_DEPENDENCY_COMMANDS -# ------------------------------ -AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], -[{ - # Older Autoconf quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac - shift - for mf - do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`AS_DIRNAME("$mf")` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "$am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`AS_DIRNAME(["$file"])` - AS_MKDIR_P([$dirpart/$fdir]) - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done - done -} -])# _AM_OUTPUT_DEPENDENCY_COMMANDS - - -# AM_OUTPUT_DEPENDENCY_COMMANDS -# ----------------------------- -# This macro should only be invoked once -- use via AC_REQUIRE. -# -# This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each '.P' file that we will -# need in order to bootstrap the dependency handling code. -AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], -[AC_CONFIG_COMMANDS([depfiles], - [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], - [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) -]) - -# Do all the work for Automake. -*- Autoconf -*- - -# 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, -# with or without modifications, as long as this notice is preserved. - -# This macro actually does too much. Some checks are only needed if -# your package does certain things. But this isn't really a big deal. - -dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. -m4_define([AC_PROG_CC], -m4_defn([AC_PROG_CC]) -[_AM_PROG_CC_C_O -]) - -# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) -# AM_INIT_AUTOMAKE([OPTIONS]) -# ----------------------------------------------- -# The call with PACKAGE and VERSION arguments is the old style -# call (pre autoconf-2.50), which is being phased out. PACKAGE -# and VERSION should now be passed to AC_INIT and removed from -# the call to AM_INIT_AUTOMAKE. -# We support both call styles for the transition. After -# the next Automake release, Autoconf can make the AC_INIT -# arguments mandatory, and then we can depend on a new Autoconf -# release and drop the old call support. -AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.65])dnl -dnl Autoconf wants to disallow AM_ names. We explicitly allow -dnl the ones we care about. -m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl -AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl -AC_REQUIRE([AC_PROG_INSTALL])dnl -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi -AC_SUBST([CYGPATH_W]) - -# Define the identity of the package. -dnl Distinguish between old-style and new-style calls. -m4_ifval([$2], -[AC_DIAGNOSE([obsolete], - [$0: two- and three-arguments forms are deprecated.]) -m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl - AC_SUBST([PACKAGE], [$1])dnl - AC_SUBST([VERSION], [$2])], -[_AM_SET_OPTIONS([$1])dnl -dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. -m4_if( - m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), - [ok:ok],, - [m4_fatal([AC_INIT should be called with package and version arguments])])dnl - AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl - AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl - -_AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) - AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl - -# Some tools Automake needs. -AC_REQUIRE([AM_SANITY_CHECK])dnl -AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) -AM_MISSING_PROG([AUTOCONF], [autoconf]) -AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) -AM_MISSING_PROG([AUTOHEADER], [autoheader]) -AM_MISSING_PROG([MAKEINFO], [makeinfo]) -AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl -AC_REQUIRE([AC_PROG_MKDIR_P])dnl -# For better backward compatibility. To be removed once Automake 1.9.x -# dies out for good. For more background, see: -# -# -AC_SUBST([mkdir_p], ['$(MKDIR_P)']) -# We need awk for the "check" target (and possibly the TAP driver). The -# system "awk" is bad on some platforms. -AC_REQUIRE([AC_PROG_AWK])dnl -AC_REQUIRE([AC_PROG_MAKE_SET])dnl -AC_REQUIRE([AM_SET_LEADING_DOT])dnl -_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], - [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], - [_AM_PROG_TAR([v7])])]) -_AM_IF_OPTION([no-dependencies],, -[AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES([CC])], - [m4_define([AC_PROG_CC], - m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES([CXX])], - [m4_define([AC_PROG_CXX], - m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_OBJC], - [_AM_DEPENDENCIES([OBJC])], - [m4_define([AC_PROG_OBJC], - m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], - [_AM_DEPENDENCIES([OBJCXX])], - [m4_define([AC_PROG_OBJCXX], - m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl -]) -AC_REQUIRE([AM_SILENT_RULES])dnl -dnl The testsuite driver may need to know about EXEEXT, so add the -dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This -dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. -AC_CONFIG_COMMANDS_PRE(dnl -[m4_provide_if([_AM_COMPILER_EXEEXT], - [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl - -# POSIX will say in a future version that running "rm -f" with no argument -# is OK; and we want to be able to make that assumption in our Makefile -# recipes. So use an aggressive probe to check that the usage we want is -# actually supported "in the wild" to an acceptable degree. -# See automake bug#10828. -# To make any issue more visible, cause the running configure to be aborted -# by default if the 'rm' program in use doesn't match our expectations; the -# user can still override this though. -if rm -f && rm -fr && rm -rf; then : OK; else - cat >&2 <<'END' -Oops! - -Your 'rm' program seems unable to run without file operands specified -on the command line, even when the '-f' option is present. This is contrary -to the behaviour of most rm programs out there, and not conforming with -the upcoming POSIX standard: - -Please tell bug-automake@gnu.org about your system, including the value -of your $PATH and any error possibly output before this message. This -can help us improve future automake versions. - -END - if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then - echo 'Configuration will proceed anyway, since you have set the' >&2 - echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 - echo >&2 - else - cat >&2 <<'END' -Aborting the configuration process, to ensure you take notice of the issue. - -You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . - -If you want to complete the configuration process using your problematic -'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM -to "yes", and re-run configure. - -END - AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) - fi -fi -dnl The trailing newline in this macro's definition is deliberate, for -dnl backward compatibility and to allow trailing 'dnl'-style comments -dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. -]) - -dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not -dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further -dnl mangled by Autoconf and run in a shell conditional statement. -m4_define([_AC_COMPILER_EXEEXT], -m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) - -# When config.status generates a header, we must update the stamp-h file. -# This file resides in the same directory as the config header -# that is generated. The stamp files are numbered to have different names. - -# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the -# loop where config.status creates the headers, so we can generate -# our stamp files there. -AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], -[# Compute $1's index in $config_headers. -_am_arg=$1 -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) - -# 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, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_INSTALL_SH -# ------------------ -# Define $install_sh. -AC_DEFUN([AM_PROG_INSTALL_SH], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -if test x"${install_sh+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac -fi -AC_SUBST([install_sh])]) - -# 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, -# with or without modifications, as long as this notice is preserved. - -# Check whether the underlying file-system supports filenames -# with a leading dot. For instance MS-DOS doesn't. -AC_DEFUN([AM_SET_LEADING_DOT], -[rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null -AC_SUBST([am__leading_dot])]) - -# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- -# From Jim Meyering - -# 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, -# with or without modifications, as long as this notice is preserved. - -# AM_MAINTAINER_MODE([DEFAULT-MODE]) -# ---------------------------------- -# Control maintainer-specific portions of Makefiles. -# Default is to disable them, unless 'enable' is passed literally. -# For symmetry, 'disable' may be passed as well. Anyway, the user -# can override the default with the --enable/--disable switch. -AC_DEFUN([AM_MAINTAINER_MODE], -[m4_case(m4_default([$1], [disable]), - [enable], [m4_define([am_maintainer_other], [disable])], - [disable], [m4_define([am_maintainer_other], [enable])], - [m4_define([am_maintainer_other], [enable]) - m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) -AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) - dnl maintainer-mode's default is 'disable' unless 'enable' is passed - AC_ARG_ENABLE([maintainer-mode], - [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], - am_maintainer_other[ make rules and dependencies not useful - (and sometimes confusing) to the casual installer])], - [USE_MAINTAINER_MODE=$enableval], - [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) - AC_MSG_RESULT([$USE_MAINTAINER_MODE]) - AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) - MAINT=$MAINTAINER_MODE_TRUE - AC_SUBST([MAINT])dnl -] -) - -# Check to see how 'make' treats includes. -*- Autoconf -*- - -# 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, -# with or without modifications, as long as this notice is preserved. - -# AM_MAKE_INCLUDE() -# ----------------- -# Check to see how make treats includes. -AC_DEFUN([AM_MAKE_INCLUDE], -[am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo this is the am__doit target -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -AC_MSG_CHECKING([for style of include used by $am_make]) -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi -AC_SUBST([am__include]) -AC_SUBST([am__quote]) -AC_MSG_RESULT([$_am_result]) -rm -f confinc confmf -]) - -# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- - -# 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, -# with or without modifications, as long as this notice is preserved. - -# AM_MISSING_PROG(NAME, PROGRAM) -# ------------------------------ -AC_DEFUN([AM_MISSING_PROG], -[AC_REQUIRE([AM_MISSING_HAS_RUN]) -$1=${$1-"${am_missing_run}$2"} -AC_SUBST($1)]) - -# AM_MISSING_HAS_RUN -# ------------------ -# Define MISSING if not defined so far and test if it is modern enough. -# If it is, set am_missing_run to use it, otherwise, to nothing. -AC_DEFUN([AM_MISSING_HAS_RUN], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([missing])dnl -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac -fi -# Use eval to expand $SHELL -if eval "$MISSING --is-lightweight"; then - am_missing_run="$MISSING " -else - am_missing_run= - AC_MSG_WARN(['missing' script is too old or missing]) -fi -]) - -# Helper functions for option handling. -*- Autoconf -*- - -# 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, -# with or without modifications, as long as this notice is preserved. - -# _AM_MANGLE_OPTION(NAME) -# ----------------------- -AC_DEFUN([_AM_MANGLE_OPTION], -[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) - -# _AM_SET_OPTION(NAME) -# -------------------- -# Set option NAME. Presently that only means defining a flag for this option. -AC_DEFUN([_AM_SET_OPTION], -[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) - -# _AM_SET_OPTIONS(OPTIONS) -# ------------------------ -# OPTIONS is a space-separated list of Automake options. -AC_DEFUN([_AM_SET_OPTIONS], -[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) - -# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) -# ------------------------------------------- -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -AC_DEFUN([_AM_IF_OPTION], -[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) - -# 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, -# with or without modifications, as long as this notice is preserved. - -# _AM_PROG_CC_C_O -# --------------- -# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC -# to automatically call this. -AC_DEFUN([_AM_PROG_CC_C_O], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([compile])dnl -AC_LANG_PUSH([C])dnl -AC_CACHE_CHECK( - [whether $CC understands -c and -o together], - [am_cv_prog_cc_c_o], - [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) - # Make sure it works both with $CC and with simple cc. - # Following AC_PROG_CC_C_O, we do the test twice because some - # compilers refuse to overwrite an existing .o file with -o, - # though they will create one. - am_cv_prog_cc_c_o=yes - for am_i in 1 2; do - if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ - && test -f conftest2.$ac_objext; then - : OK - else - am_cv_prog_cc_c_o=no - break - fi - done - rm -f core conftest* - unset am_i]) -if test "$am_cv_prog_cc_c_o" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -AC_LANG_POP([C])]) - -# For backward compatibility. -AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) - -# 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, -# with or without modifications, as long as this notice is preserved. - -# AM_RUN_LOG(COMMAND) -# ------------------- -# Run COMMAND, save the exit status in ac_status, and log it. -# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) -AC_DEFUN([AM_RUN_LOG], -[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD - ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - (exit $ac_status); }]) - -# Check to make sure that the build environment is sane. -*- Autoconf -*- - -# 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, -# with or without modifications, as long as this notice is preserved. - -# AM_SANITY_CHECK -# --------------- -AC_DEFUN([AM_SANITY_CHECK], -[AC_MSG_CHECKING([whether build environment is sane]) -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[[\\\"\#\$\&\'\`$am_lf]]*) - AC_MSG_ERROR([unsafe absolute working directory name]);; -esac -case $srcdir in - *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) - AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; -esac - -# Do 'set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - am_has_slept=no - for am_try in 1 2; do - echo "timestamp, slept: $am_has_slept" > conftest.file - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken - alias in your environment]) - fi - if test "$[2]" = conftest.file || test $am_try -eq 2; then - break - fi - # Just in case. - sleep 1 - am_has_slept=yes - done - test "$[2]" = conftest.file - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) -fi -AC_MSG_RESULT([yes]) -# If we didn't sleep, we still need to ensure time stamps of config.status and -# generated files are strictly newer. -am_sleep_pid= -if grep 'slept: no' conftest.file >/dev/null 2>&1; then - ( sleep 1 ) & - am_sleep_pid=$! -fi -AC_CONFIG_COMMANDS_PRE( - [AC_MSG_CHECKING([that generated files are newer than configure]) - if test -n "$am_sleep_pid"; then - # Hide warnings about reused PIDs. - wait $am_sleep_pid 2>/dev/null - fi - AC_MSG_RESULT([done])]) -rm -f conftest.file -]) - -# 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, -# with or without modifications, as long as this notice is preserved. - -# AM_SILENT_RULES([DEFAULT]) -# -------------------------- -# Enable less verbose build rules; with the default set to DEFAULT -# ("yes" being less verbose, "no" or empty being verbose). -AC_DEFUN([AM_SILENT_RULES], -[AC_ARG_ENABLE([silent-rules], [dnl -AS_HELP_STRING( - [--enable-silent-rules], - [less verbose build output (undo: "make V=1")]) -AS_HELP_STRING( - [--disable-silent-rules], - [verbose build output (undo: "make V=0")])dnl -]) -case $enable_silent_rules in @%:@ ((( - yes) AM_DEFAULT_VERBOSITY=0;; - no) AM_DEFAULT_VERBOSITY=1;; - *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; -esac +dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, +dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +dnl ------------------------------------------- +dnl Since: 0.28 dnl -dnl A few 'make' implementations (e.g., NonStop OS and NextStep) -dnl do not support nested variable expansions. -dnl See automake bug#9928 and bug#10237. -am_make=${MAKE-make} -AC_CACHE_CHECK([whether $am_make supports nested variables], - [am_cv_make_support_nested_variables], - [if AS_ECHO([['TRUE=$(BAR$(V)) -BAR0=false -BAR1=true -V=1 -am__doit: - @$(TRUE) -.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then - am_cv_make_support_nested_variables=yes -else - am_cv_make_support_nested_variables=no -fi]) -if test $am_cv_make_support_nested_variables = yes; then - dnl Using '$V' instead of '$(V)' breaks IRIX make. - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi -AC_SUBST([AM_V])dnl -AM_SUBST_NOTMAKE([AM_V])dnl -AC_SUBST([AM_DEFAULT_V])dnl -AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl -AC_SUBST([AM_DEFAULT_VERBOSITY])dnl -AM_BACKSLASH='\' -AC_SUBST([AM_BACKSLASH])dnl -_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl -]) +dnl Retrieves the value of the pkg-config variable for the given module. +AC_DEFUN([PKG_CHECK_VAR], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl -# 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, -# with or without modifications, as long as this notice is preserved. +_PKG_CONFIG([$1], [variable="][$3]["], [$2]) +AS_VAR_COPY([$1], [pkg_cv_][$1]) -# AM_PROG_INSTALL_STRIP -# --------------------- -# One issue with vendor 'install' (even GNU) is that you can't -# specify the program used to strip binaries. This is especially -# annoying in cross-compiling environments, where the build's strip -# is unlikely to handle the host's binaries. -# Fortunately install-sh will honor a STRIPPROG variable, so we -# always use install-sh in "make install-strip", and initialize -# STRIPPROG with the value of the STRIP variable (set by the user). -AC_DEFUN([AM_PROG_INSTALL_STRIP], -[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -# Installed binaries are usually stripped using 'strip' when the user -# run "make install-strip". However 'strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the 'STRIP' environment variable to overrule this program. -dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. -if test "$cross_compiling" != no; then - AC_CHECK_TOOL([STRIP], [strip], :) -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" -AC_SUBST([INSTALL_STRIP_PROGRAM])]) - -# 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, -# with or without modifications, as long as this notice is preserved. - -# _AM_SUBST_NOTMAKE(VARIABLE) -# --------------------------- -# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. -# This macro is traced by Automake. -AC_DEFUN([_AM_SUBST_NOTMAKE]) - -# AM_SUBST_NOTMAKE(VARIABLE) -# -------------------------- -# Public sister of _AM_SUBST_NOTMAKE. -AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) - -# Check how to create a tarball. -*- Autoconf -*- - -# 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, -# with or without modifications, as long as this notice is preserved. - -# _AM_PROG_TAR(FORMAT) -# -------------------- -# Check how to create a tarball in format FORMAT. -# FORMAT should be one of 'v7', 'ustar', or 'pax'. -# -# Substitute a variable $(am__tar) that is a command -# writing to stdout a FORMAT-tarball containing the directory -# $tardir. -# tardir=directory && $(am__tar) > result.tar -# -# Substitute a variable $(am__untar) that extract such -# a tarball read from stdin. -# $(am__untar) < result.tar -# -AC_DEFUN([_AM_PROG_TAR], -[# Always define AMTAR for backward compatibility. Yes, it's still used -# in the wild :-( We should find a proper way to deprecate it ... -AC_SUBST([AMTAR], ['$${TAR-tar}']) - -# We'll loop over all known methods to create a tar archive until one works. -_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' - -m4_if([$1], [v7], - [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], - - [m4_case([$1], - [ustar], - [# The POSIX 1988 'ustar' format is defined with fixed-size fields. - # There is notably a 21 bits limit for the UID and the GID. In fact, - # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 - # and bug#13588). - am_max_uid=2097151 # 2^21 - 1 - am_max_gid=$am_max_uid - # The $UID and $GID variables are not portable, so we need to resort - # to the POSIX-mandated id(1) utility. Errors in the 'id' calls - # below are definitely unexpected, so allow the users to see them - # (that is, avoid stderr redirection). - am_uid=`id -u || echo unknown` - am_gid=`id -g || echo unknown` - AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) - if test $am_uid -le $am_max_uid; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - _am_tools=none - fi - AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) - if test $am_gid -le $am_max_gid; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - _am_tools=none - fi], - - [pax], - [], - - [m4_fatal([Unknown tar format])]) - - AC_MSG_CHECKING([how to create a $1 tar archive]) - - # Go ahead even if we have the value already cached. We do so because we - # need to set the values for the 'am__tar' and 'am__untar' variables. - _am_tools=${am_cv_prog_tar_$1-$_am_tools} - - for _am_tool in $_am_tools; do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; do - AM_RUN_LOG([$_am_tar --version]) && break - done - am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x $1 -w "$$tardir"' - am__tar_='pax -L -x $1 -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H $1 -L' - am__tar_='find "$tardir" -print | cpio -o -H $1 -L' - am__untar='cpio -i -H $1 -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac - - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_$1}" && break - - # tar/untar a dummy directory, and stop if the command works. - rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) - rm -rf conftest.dir - if test -s conftest.tar; then - AM_RUN_LOG([$am__untar /dev/null 2>&1 && break - fi - done - rm -rf conftest.dir - - AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) - AC_MSG_RESULT([$am_cv_prog_tar_$1])]) - -AC_SUBST([am__tar]) -AC_SUBST([am__untar]) -]) # _AM_PROG_TAR +AS_VAR_IF([$1], [""], [$5], [$4])dnl +])dnl PKG_CHECK_VAR dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure. dnl @@ -1435,7 +345,6 @@ m4_if(m4_version_compare(vers_have, [$1]), -1, m4_undefine([vers_have]) m4_undefine([maj_have]) m4_undefine([maj_needed]) -AM_MAINTAINER_MODE ]) # XORG_MACROS_VERSION # XORG_PROG_RAWCPP() @@ -3063,7 +1972,7 @@ XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute]) -# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls]) +XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op]) # These are currently disabled because they are noisy. They will be enabled @@ -3282,3 +2191,1133 @@ echo 'git directory not found: installing possibly empty changelog.' >&2)" AC_SUBST([CHANGELOG_CMD]) ]) # XORG_CHANGELOG +# Copyright (C) 2002-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +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], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_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 +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. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is '.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named 'Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "$am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each '.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.65])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl +]) +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. +]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) + +# Copyright (C) 2003-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + AC_MSG_WARN(['missing' script is too old or missing]) +fi +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +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. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) + +# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# ("yes" being less verbose, "no" or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor 'install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in "make install-strip", and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +# +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' + +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + diff --git a/configure b/configure index 029aa5b..30cb194 100755 --- a/configure +++ b/configure @@ -628,6 +628,12 @@ LTLIBOBJS LIBOBJS TWM_LIBS TWM_CFLAGS +am__fastdepCXX_FALSE +am__fastdepCXX_TRUE +CXXDEPMODE +ac_ct_CXX +CXXFLAGS +CXX LEXLIB LEX_OUTPUT_ROOT LEX @@ -665,9 +671,6 @@ CHANGELOG_CMD STRICT_CFLAGS CWARNFLAGS BASE_CFLAGS -MAINT -MAINTAINER_MODE_FALSE -MAINTAINER_MODE_TRUE AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V @@ -758,7 +761,6 @@ ac_user_opts=' enable_option_checking enable_dependency_tracking enable_silent_rules -enable_maintainer_mode enable_selective_werror enable_strict_compilation ' @@ -776,6 +778,9 @@ PKG_CONFIG_PATH PKG_CONFIG_LIBDIR YACC YFLAGS +CXX +CXXFLAGS +CCC TWM_CFLAGS TWM_LIBS' @@ -1402,9 +1407,6 @@ Optional Features: speeds up one-time build --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") - --enable-maintainer-mode - enable make rules and dependencies not useful (and - sometimes confusing) to the casual installer --disable-selective-werror Turn off selective compiler errors. (default: enabled) @@ -1432,6 +1434,8 @@ Some influential environment variables: YFLAGS The list of arguments that will be passed by default to $YACC. This script will default YFLAGS to the empty string to avoid a default value of `-d' given by some make applications. + CXX C++ compiler command + CXXFLAGS C++ compiler flags TWM_CFLAGS C compiler flags for TWM, overriding pkg-config TWM_LIBS linker flags for TWM, overriding pkg-config @@ -1846,6 +1850,44 @@ fi } # ac_fn_c_try_link +# ac_fn_cxx_try_compile LINENO +# ---------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_compile + # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly @@ -4388,29 +4430,6 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 -$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } - # Check whether --enable-maintainer-mode was given. -if test "${enable_maintainer_mode+set}" = set; then : - enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval -else - USE_MAINTAINER_MODE=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 -$as_echo "$USE_MAINTAINER_MODE" >&6; } - if test $USE_MAINTAINER_MODE = yes; then - MAINTAINER_MODE_TRUE= - MAINTAINER_MODE_FALSE='#' -else - MAINTAINER_MODE_TRUE='#' - MAINTAINER_MODE_FALSE= -fi - - MAINT=$MAINTAINER_MODE_TRUE - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 $as_echo_n "checking for $CC option to accept ISO C99... " >&6; } if ${ac_cv_prog_cc_c99+:} false; then : @@ -6772,7 +6791,124 @@ $as_echo "$supported" >&6; } fi -# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls]) + + + + + + + + + + + + + +xorg_testset_save_CFLAGS="$CFLAGS" + +if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int i; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + xorg_cv_cc_flag_unknown_warning_option=yes +else + xorg_cv_cc_flag_unknown_warning_option=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int i; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + xorg_cv_cc_flag_unused_command_line_argument=yes +else + xorg_cv_cc_flag_unused_command_line_argument=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +found="no" + + if test $found = "no" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + fi + + CFLAGS="$CFLAGS -Wredundant-decls" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wredundant-decls" >&5 +$as_echo_n "checking if $CC supports -Wredundant-decls... " >&6; } + cacheid=xorg_cv_cc_flag__Wredundant_decls + if eval \${$cacheid+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval $cacheid=yes +else + eval $cacheid=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 +$as_echo "$supported" >&6; } + if test "$supported" = "yes" ; then + BASE_CFLAGS="$BASE_CFLAGS -Wredundant-decls" + found="yes" + fi + fi + + @@ -10988,6 +11124,391 @@ fi rm -f conftest.l $LEX_OUTPUT_ROOT.c fi +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if ${ac_cv_cxx_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } +if ${ac_cv_prog_cxx_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +else + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CXX" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CXX_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + for ac_func in mkstemp do : @@ -11004,8 +11525,8 @@ done # Checks for pkg-config packages pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for TWM" >&5 -$as_echo_n "checking for TWM... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for x11 xext xt xmu ice sm xproto >= 7.0.17" >&5 +$as_echo_n "checking for x11 xext xt xmu ice sm xproto >= 7.0.17... " >&6; } if test -n "$TWM_CFLAGS"; then pkg_cv_TWM_CFLAGS="$TWM_CFLAGS" @@ -11045,7 +11566,7 @@ fi if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then @@ -11072,7 +11593,7 @@ Alternatively, you may set the environment variables TWM_CFLAGS and TWM_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} @@ -11229,8 +11750,8 @@ else am__EXEEXT_FALSE= fi -if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then - as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi diff --git a/configure.ac b/configure.ac index 1e3d9b7..f12d709 100644 --- a/configure.ac +++ b/configure.ac @@ -45,6 +45,7 @@ if test ! -f "$srcdir/gram.c"; then fi fi AC_PROG_LEX +AC_PROG_CXX AC_CHECK_FUNCS([mkstemp]) diff --git a/man/Makefile.in b/man/Makefile.in index 34a74cf..6e8136a 100644 --- a/man/Makefile.in +++ b/man/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -191,6 +191,9 @@ CHANGELOG_CMD = @CHANGELOG_CMD@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CWARNFLAGS = @CWARNFLAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -219,7 +222,6 @@ LIBS = @LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN_SUBSTS = @MAN_SUBSTS@ -e 's|__datadir__|$(datadir)|g' MISC_MAN_DIR = @MISC_MAN_DIR@ @@ -254,6 +256,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -309,7 +312,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .$(APP_MAN_SUFFIX) .man -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -333,9 +336,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-appmanDATA: $(appman_DATA) diff --git a/src/Makefile.am b/src/Makefile.am index f1e4a78..52beab4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -28,11 +28,10 @@ rcdir = ${datadir}/X11/twmruined dist_rc_DATA = system.twmruinedrc AM_CPPFLAGS = \ - -DXVENDORNAME=\"The\ X.Org\ Foundation\" \ - -DXORG_RELEASE=\"Release\ $(VERSION)\" \ -DSYSTEM_INIT_FILE=\"${datadir}/X11/twmruined/system.twmruinedrc\" AM_CFLAGS = -Werror $(TWM_CFLAGS) +AM_CXXFLAGS = -std=c++11 twmruined_LDADD = $(TWM_LIBS) twmruined_SOURCES = \ @@ -44,7 +43,7 @@ twmruined_SOURCES = \ events.h \ gc.c \ gc.h \ - icons.c \ + icons.cc \ icons.h \ list.c \ list.h \ diff --git a/src/Makefile.in b/src/Makefile.in index 4b7cd65..6967850 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2017 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -160,14 +160,25 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -@MAINTAINER_MODE_FALSE@am__skiplex = test -f $@ || +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +AM_V_CXX = $(am__v_CXX_@AM_V@) +am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) +am__v_CXX_0 = @echo " CXX " $@; +am__v_CXX_1 = +CXXLD = $(CXX) +CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) +am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) +am__v_CXXLD_0 = @echo " CXXLD " $@; +am__v_CXXLD_1 = LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS) AM_V_LEX = $(am__v_LEX_@AM_V@) am__v_LEX_ = $(am__v_LEX_@AM_DEFAULT_V@) am__v_LEX_0 = @echo " LEX " $@; am__v_LEX_1 = YLWRAP = $(top_srcdir)/ylwrap -@MAINTAINER_MODE_FALSE@am__skipyacc = test -f $@ || am__yacc_c2h = sed -e s/cc$$/hh/ -e s/cpp$$/hpp/ -e s/cxx$$/hxx/ \ -e s/c++$$/h++/ -e s/c$$/h/ YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS) @@ -251,6 +262,9 @@ CHANGELOG_CMD = @CHANGELOG_CMD@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CWARNFLAGS = @CWARNFLAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -279,7 +293,6 @@ LIBS = @LIBS@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MAN_SUBSTS = @MAN_SUBSTS@ MISC_MAN_DIR = @MISC_MAN_DIR@ @@ -314,6 +327,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -363,11 +377,10 @@ AM_YFLAGS = -d rcdir = ${datadir}/X11/twmruined dist_rc_DATA = system.twmruinedrc AM_CPPFLAGS = \ - -DXVENDORNAME=\"The\ X.Org\ Foundation\" \ - -DXORG_RELEASE=\"Release\ $(VERSION)\" \ -DSYSTEM_INIT_FILE=\"${datadir}/X11/twmruined/system.twmruinedrc\" AM_CFLAGS = -Werror $(TWM_CFLAGS) +AM_CXXFLAGS = -std=c++11 twmruined_LDADD = $(TWM_LIBS) twmruined_SOURCES = \ add_window.c \ @@ -378,7 +391,7 @@ twmruined_SOURCES = \ events.h \ gc.c \ gc.h \ - icons.c \ + icons.cc \ icons.h \ list.c \ list.h \ @@ -406,8 +419,8 @@ all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: -.SUFFIXES: .c .l .o .obj .y -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +.SUFFIXES: .c .cc .l .o .obj .y +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -431,9 +444,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @@ -484,7 +497,7 @@ gram.h: gram.c twmruined$(EXEEXT): $(twmruined_OBJECTS) $(twmruined_DEPENDENCIES) $(EXTRA_twmruined_DEPENDENCIES) @rm -f twmruined$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(twmruined_OBJECTS) $(twmruined_LDADD) $(LIBS) + $(AM_V_CXXLD)$(CXXLINK) $(twmruined_OBJECTS) $(twmruined_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -523,6 +536,20 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +.cc.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cc.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + .l.c: $(AM_V_LEX)$(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE) diff --git a/src/add_window.c b/src/add_window.c index 60b6e20..cddde08 100644 --- a/src/add_window.c +++ b/src/add_window.c @@ -180,8 +180,8 @@ AddWindow(Window w) if (!I18N_FetchName(dpy, tmp_win->w, &name)) name = NULL; - tmp_win->class = NoClass; - XGetClassHint(dpy, tmp_win->w, &tmp_win->class); + tmp_win->classh = NoClass; + XGetClassHint(dpy, tmp_win->w, &tmp_win->classh); FetchWmProtocols (tmp_win); FetchWmColormapWindows (tmp_win); @@ -260,25 +260,25 @@ AddWindow(Window w) tmp_win->transient = Transient(tmp_win->w, &tmp_win->transientfor); tmp_win->nameChanged = 0; - if (tmp_win->class.res_name == NULL) - tmp_win->class.res_name = NoName; - if (tmp_win->class.res_class == NULL) - tmp_win->class.res_class = NoName; + if (tmp_win->classh.res_name == NULL) + tmp_win->classh.res_name = NoName; + if (tmp_win->classh.res_class == NULL) + tmp_win->classh.res_class = NoName; tmp_win->full_name = strdup(tmp_win->name); namelen = strlen (tmp_win->name); tmp_win->stackmode = Scr->StackMode && (!(short)(long) LookInList(Scr->NoStackModeL, tmp_win->full_name, - &tmp_win->class)); + &tmp_win->classh)); tmp_win->auto_raise = (short)(long) LookInList(Scr->AutoRaise, tmp_win->full_name, - &tmp_win->class); + &tmp_win->classh); if (tmp_win->auto_raise) Scr->NumAutoRaises++; - if (LookInList(Scr->WindowRingL, tmp_win->full_name, &tmp_win->class)) { + if (LookInList(Scr->WindowRingL, tmp_win->full_name, &tmp_win->classh)) { if (Scr->Ring) { tmp_win->ring.next = Scr->Ring->ring.next; if (Scr->Ring->ring.next->ring.prev) @@ -299,16 +299,16 @@ AddWindow(Window w) tmp_win->title_height = Scr->TitleHeight + tmp_win->frame_bw; if (Scr->NoTitlebar) tmp_win->title_height = 0; - if (LookInList(Scr->MakeTitle, tmp_win->full_name, &tmp_win->class)) + if (LookInList(Scr->MakeTitle, tmp_win->full_name, &tmp_win->classh)) tmp_win->title_height = Scr->TitleHeight + tmp_win->frame_bw; - if (LookInList(Scr->NoTitle, tmp_win->full_name, &tmp_win->class)) + if (LookInList(Scr->NoTitle, tmp_win->full_name, &tmp_win->classh)) tmp_win->title_height = 0; /* if it is a transient window, don't put a title on it */ if (tmp_win->transient && !Scr->DecorateTransients) tmp_win->title_height = 0; - if (LookInList(Scr->StartIconified, tmp_win->full_name, &tmp_win->class)) + if (LookInList(Scr->StartIconified, tmp_win->full_name, &tmp_win->classh)) { if (!tmp_win->wmhints) { @@ -438,21 +438,21 @@ AddWindow(Window w) tmp_win->iconc.fore = Scr->IconC.fore; tmp_win->iconc.back = Scr->IconC.back; - GetColorFromList(Scr->BorderColorL, tmp_win->full_name, &tmp_win->class, + GetColorFromList(Scr->BorderColorL, tmp_win->full_name, &tmp_win->classh, &tmp_win->border); - GetColorFromList(Scr->IconBorderColorL, tmp_win->full_name, &tmp_win->class, + GetColorFromList(Scr->IconBorderColorL, tmp_win->full_name, &tmp_win->classh, &tmp_win->icon_border); GetColorFromList(Scr->BorderTileForegroundL, tmp_win->full_name, - &tmp_win->class, &tmp_win->border_tile.fore); + &tmp_win->classh, &tmp_win->border_tile.fore); GetColorFromList(Scr->BorderTileBackgroundL, tmp_win->full_name, - &tmp_win->class, &tmp_win->border_tile.back); - GetColorFromList(Scr->TitleForegroundL, tmp_win->full_name, &tmp_win->class, + &tmp_win->classh, &tmp_win->border_tile.back); + GetColorFromList(Scr->TitleForegroundL, tmp_win->full_name, &tmp_win->classh, &tmp_win->title.fore); - GetColorFromList(Scr->TitleBackgroundL, tmp_win->full_name, &tmp_win->class, + GetColorFromList(Scr->TitleBackgroundL, tmp_win->full_name, &tmp_win->classh, &tmp_win->title.back); - GetColorFromList(Scr->IconForegroundL, tmp_win->full_name, &tmp_win->class, + GetColorFromList(Scr->IconForegroundL, tmp_win->full_name, &tmp_win->classh, &tmp_win->iconc.fore); - GetColorFromList(Scr->IconBackgroundL, tmp_win->full_name, &tmp_win->class, + GetColorFromList(Scr->IconBackgroundL, tmp_win->full_name, &tmp_win->classh, &tmp_win->iconc.back); diff --git a/src/events.c b/src/events.c index f77be52..1233dd1 100644 --- a/src/events.c +++ b/src/events.c @@ -632,7 +632,7 @@ HandleKeyPress(void) for (Tmp_win = Scr->TwmRoot.next; Tmp_win != NULL; Tmp_win = Tmp_win->next) { - if (!strncmp(key->win_name, Tmp_win->class.res_name, len)) + if (!strncmp(key->win_name, Tmp_win->classh.res_name, len)) { matched = TRUE; ExecuteFunction(key->func, key->action, Tmp_win->frame, @@ -646,7 +646,7 @@ HandleKeyPress(void) for (Tmp_win = Scr->TwmRoot.next; Tmp_win != NULL; Tmp_win = Tmp_win->next) { - if (!strncmp(key->win_name, Tmp_win->class.res_class, len)) + if (!strncmp(key->win_name, Tmp_win->classh.res_class, len)) { matched = TRUE; ExecuteFunction(key->func, key->action, Tmp_win->frame, @@ -1183,8 +1183,8 @@ HandleDestroyNotify(void) * 2. name * 3. icon_name * 4. wmhints - * 5. class.res_name - * 6. class.res_class + * 5. classh.res_name + * 6. classh.res_class * * * 9. cwins @@ -1206,10 +1206,10 @@ HandleDestroyNotify(void) free_window_names (Tmp_win, True, True, True); /* 1, 2, 3 */ if (Tmp_win->wmhints) /* 4 */ XFree (Tmp_win->wmhints); - if (Tmp_win->class.res_name && Tmp_win->class.res_name != NoName) /* 5 */ - XFree (Tmp_win->class.res_name); - if (Tmp_win->class.res_class && Tmp_win->class.res_class != NoName) /* 6 */ - XFree (Tmp_win->class.res_class); + if (Tmp_win->classh.res_name && Tmp_win->classh.res_name != NoName) /* 5 */ + XFree (Tmp_win->classh.res_name); + if (Tmp_win->classh.res_class && Tmp_win->classh.res_class != NoName) /* 6 */ + XFree (Tmp_win->classh.res_class); free_cwins (Tmp_win); /* 9 */ if (Tmp_win->titlebuttons) /* 10 */ free (Tmp_win->titlebuttons); diff --git a/src/gram.c b/src/gram.c index c60cb4b..18a3b1d 100644 --- a/src/gram.c +++ b/src/gram.c @@ -1,15 +1,69 @@ -#include -#include -#define YYBYACC 1 -#define YYMAJOR 1 -#define YYMINOR 9 -#define YYLEX yylex() -#define YYEMPTY -1 -#define yyclearin (yychar=(YYEMPTY)) -#define yyerrok (yyerrflag=0) -#define YYRECOVERING() (yyerrflag!=0) -#define YYPREFIX "yy" -#line 68 "gram.y" +/* A Bison parser, made by GNU Bison 3.0.4. */ + +/* Bison implementation for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + 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 + 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 . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + 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. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output. */ +#define YYBISON 1 + +/* Bison version. */ +#define YYBISON_VERSION "3.0.4" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 0 + +/* Push parsers. */ +#define YYPUSH 0 + +/* Pull parsers. */ +#define YYPULL 1 + + + + +/* Copy the first part of user declarations. */ +#line 67 "gram.y" /* yacc.c:339 */ + #include #include #include "twm.h" @@ -19,7 +73,6 @@ #include "screen.h" #include "parse.h" #include "add_window.h" -#include "icons.h" #include #include @@ -46,548 +99,2424 @@ unsigned int mods_used = (ShiftMask | ControlMask | Mod1Mask); extern int yylineno; static void yyerror ( const char *s ); -#line 106 "gram.y" -#ifndef YYSTYPE_DEFINED -#define YYSTYPE_DEFINED -typedef union + +#line 104 "gram.c" /* yacc.c:339 */ + +# ifndef YY_NULLPTR +# if defined __cplusplus && 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +/* In a future release of Bison, this section will be replaced + by #include "y.tab.h". */ +#ifndef YY_YY_GRAM_H_INCLUDED +# define YY_YY_GRAM_H_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif +#if YYDEBUG +extern int yydebug; +#endif + +/* Token type. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + enum yytokentype + { + LB = 258, + RB = 259, + LP = 260, + RP = 261, + MENUS = 262, + MENU = 263, + BUTTON = 264, + DEFAULT_FUNCTION = 265, + PLUS = 266, + MINUS = 267, + ALL = 268, + OR = 269, + CURSORS = 270, + ICONS = 271, + COLOR = 272, + SAVECOLOR = 273, + MONOCHROME = 274, + FUNCTION = 275, + WINDOW_FUNCTION = 276, + ZOOM = 277, + MAKE_TITLE = 278, + GRAYSCALE = 279, + NO_TITLE = 280, + AUTO_RAISE = 281, + ICON_REGION = 282, + META = 283, + SHIFT = 284, + LOCK = 285, + CONTROL = 286, + WINDOW = 287, + TITLE = 288, + ICON = 289, + ROOT = 290, + FRAME = 291, + COLON = 292, + EQUALS = 293, + START_ICONIFIED = 294, + MOVE = 295, + RESIZE = 296, + WAIT = 297, + SELECT = 298, + KILL = 299, + LEFT_TITLEBUTTON = 300, + RIGHT_TITLEBUTTON = 301, + NUMBER = 302, + KEYWORD = 303, + NKEYWORD = 304, + CKEYWORD = 305, + CLKEYWORD = 306, + FKEYWORD = 307, + FSKEYWORD = 308, + SKEYWORD = 309, + DKEYWORD = 310, + JKEYWORD = 311, + WINDOW_RING = 312, + WARP_CURSOR = 313, + ERRORTOKEN = 314, + NO_STACKMODE = 315, + STRING = 316 + }; +#endif +/* Tokens. */ +#define LB 258 +#define RB 259 +#define LP 260 +#define RP 261 +#define MENUS 262 +#define MENU 263 +#define BUTTON 264 +#define DEFAULT_FUNCTION 265 +#define PLUS 266 +#define MINUS 267 +#define ALL 268 +#define OR 269 +#define CURSORS 270 +#define ICONS 271 +#define COLOR 272 +#define SAVECOLOR 273 +#define MONOCHROME 274 +#define FUNCTION 275 +#define WINDOW_FUNCTION 276 +#define ZOOM 277 +#define MAKE_TITLE 278 +#define GRAYSCALE 279 +#define NO_TITLE 280 +#define AUTO_RAISE 281 +#define ICON_REGION 282 +#define META 283 +#define SHIFT 284 +#define LOCK 285 +#define CONTROL 286 +#define WINDOW 287 +#define TITLE 288 +#define ICON 289 +#define ROOT 290 +#define FRAME 291 +#define COLON 292 +#define EQUALS 293 +#define START_ICONIFIED 294 +#define MOVE 295 +#define RESIZE 296 +#define WAIT 297 +#define SELECT 298 +#define KILL 299 +#define LEFT_TITLEBUTTON 300 +#define RIGHT_TITLEBUTTON 301 +#define NUMBER 302 +#define KEYWORD 303 +#define NKEYWORD 304 +#define CKEYWORD 305 +#define CLKEYWORD 306 +#define FKEYWORD 307 +#define FSKEYWORD 308 +#define SKEYWORD 309 +#define DKEYWORD 310 +#define JKEYWORD 311 +#define WINDOW_RING 312 +#define WARP_CURSOR 313 +#define ERRORTOKEN 314 +#define NO_STACKMODE 315 +#define STRING 316 + +/* Value type. */ +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED + +union YYSTYPE { +#line 106 "gram.y" /* yacc.c:355 */ + int num; char *ptr; -} YYSTYPE; -#endif /* YYSTYPE_DEFINED */ -#line 59 "gram.c" -#define LB 257 -#define RB 258 -#define LP 259 -#define RP 260 -#define MENUS 261 -#define MENU 262 -#define BUTTON 263 -#define DEFAULT_FUNCTION 264 -#define PLUS 265 -#define MINUS 266 -#define ALL 267 -#define OR 268 -#define CURSORS 269 -#define ICONS 270 -#define COLOR 271 -#define SAVECOLOR 272 -#define MONOCHROME 273 -#define FUNCTION 274 -#define WINDOW_FUNCTION 275 -#define ZOOM 276 -#define MAKE_TITLE 277 -#define GRAYSCALE 278 -#define NO_TITLE 279 -#define AUTO_RAISE 280 -#define ICON_REGION 281 -#define META 282 -#define SHIFT 283 -#define LOCK 284 -#define CONTROL 285 -#define WINDOW 286 -#define TITLE 287 -#define ICON 288 -#define ROOT 289 -#define FRAME 290 -#define COLON 291 -#define EQUALS 292 -#define START_ICONIFIED 293 -#define MOVE 294 -#define RESIZE 295 -#define WAIT 296 -#define SELECT 297 -#define KILL 298 -#define LEFT_TITLEBUTTON 299 -#define RIGHT_TITLEBUTTON 300 -#define NUMBER 301 -#define KEYWORD 302 -#define NKEYWORD 303 -#define CKEYWORD 304 -#define CLKEYWORD 305 -#define FKEYWORD 306 -#define FSKEYWORD 307 -#define SKEYWORD 308 -#define DKEYWORD 309 -#define JKEYWORD 310 -#define WINDOW_RING 311 -#define WARP_CURSOR 312 -#define ERRORTOKEN 313 -#define NO_STACKMODE 314 -#define STRING 315 -#define YYERRCODE 256 -const short yylhs[] = - { -1, - 0, 20, 20, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 21, 5, 5, - 22, 5, 5, 23, 5, 24, 5, 25, 5, 26, - 5, 27, 5, 28, 5, 30, 5, 31, 5, 32, - 5, 5, 33, 5, 5, 5, 34, 5, 5, 35, - 5, 10, 11, 12, 18, 19, 36, 36, 39, 39, - 39, 39, 39, 39, 37, 37, 40, 40, 40, 40, - 40, 40, 40, 38, 38, 41, 41, 41, 41, 41, - 41, 41, 41, 2, 42, 42, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 3, 44, 44, 13, - 45, 13, 13, 4, 46, 46, 47, 47, 6, 48, - 48, 49, 7, 50, 50, 51, 29, 52, 52, 53, - 8, 54, 54, 55, 9, 56, 56, 57, 57, 14, - 14, 17, 17, 17, 15, 1, 16, + +#line 271 "gram.c" /* yacc.c:355 */ }; -const short yylen[] = - { 2, - 1, 0, 2, 1, 1, 1, 1, 6, 2, 1, - 2, 4, 4, 2, 2, 2, 2, 0, 3, 1, - 0, 3, 1, 0, 3, 0, 3, 0, 3, 0, - 9, 0, 4, 0, 4, 0, 3, 0, 3, 0, - 3, 2, 0, 3, 2, 2, 0, 3, 1, 0, - 3, 1, 2, 2, 6, 6, 0, 2, 1, 1, - 1, 1, 2, 1, 0, 2, 1, 1, 1, 1, - 1, 1, 1, 0, 2, 1, 1, 1, 1, 1, - 1, 1, 1, 3, 0, 2, 3, 2, 3, 2, - 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, - 3, 2, 3, 2, 3, 2, 3, 0, 2, 2, - 0, 4, 2, 3, 0, 2, 1, 1, 3, 0, - 2, 2, 3, 0, 2, 1, 3, 0, 2, 2, - 3, 0, 2, 1, 3, 0, 2, 2, 7, 1, - 2, 1, 2, 2, 2, 1, 1, -}; -const short yydefred[] = - { 2, - 0, 0, 4, 0, 0, 0, 0, 36, 38, 0, - 43, 0, 0, 0, 24, 40, 0, 28, 0, 26, - 0, 0, 52, 0, 0, 50, 0, 0, 146, 0, - 3, 5, 6, 7, 0, 0, 147, 145, 140, 0, - 45, 85, 11, 0, 0, 115, 42, 0, 34, 46, - 9, 0, 0, 0, 0, 0, 0, 0, 0, 54, - 53, 0, 0, 0, 57, 16, 57, 14, 15, 17, - 0, 0, 141, 0, 128, 37, 108, 39, 0, 44, - 0, 124, 25, 41, 22, 29, 0, 27, 0, 0, - 51, 48, 19, 0, 0, 0, 136, 33, 84, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, - 0, 0, 114, 118, 117, 116, 132, 35, 0, 0, - 12, 13, 64, 0, 60, 61, 62, 74, 58, 65, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 127, 0, 129, 107, 0, 0, 109, 0, - 123, 126, 125, 0, 63, 0, 0, 0, 135, 0, - 137, 101, 93, 89, 91, 87, 95, 97, 99, 103, - 105, 130, 113, 0, 131, 134, 133, 8, 81, 82, - 76, 77, 78, 79, 80, 0, 83, 75, 72, 73, - 67, 68, 69, 70, 71, 0, 66, 30, 0, 138, - 0, 56, 55, 0, 0, 120, 112, 31, 0, 0, - 0, 119, 0, 121, 0, 122, 139, -}; -const short yydgoto[] = - { 1, - 30, 43, 78, 47, 31, 207, 83, 118, 98, 32, - 33, 34, 149, 41, 35, 38, 0, 70, 66, 2, - 64, 54, 52, 57, 55, 204, 72, 81, 76, 44, - 45, 53, 48, 63, 62, 94, 157, 156, 129, 197, - 188, 74, 110, 112, 201, 79, 116, 210, 214, 119, - 153, 111, 145, 150, 177, 132, 161, -}; -const short yysindex[] = - { 0, - 0, -223, 0, -311, -282, -293, -235, 0, 0, -234, - 0, -311, -293, -282, 0, 0, 0, 0, -311, 0, - -311, -311, 0, -282, -311, 0, 0, 0, 0, -266, - 0, 0, 0, 0, -197, -232, 0, 0, 0, -311, - 0, 0, 0, -229, -228, 0, 0, -228, 0, 0, - 0, -227, -228, -227, -227, -274, -227, -254, -250, 0, - 0, -227, -227, -227, 0, 0, 0, 0, 0, 0, - -311, -214, 0, -108, 0, 0, 0, 0, -242, 0, - -213, 0, 0, 0, 0, 0, -264, 0, -293, -293, - 0, 0, 0, -66, -47, -226, 0, 0, 0, -311, - -311, -311, -311, -311, -311, -311, -311, -311, -311, 0, - -255, -221, 0, 0, 0, 0, 0, 0, -253, -282, - 0, 0, 0, -282, 0, 0, 0, 0, 0, 0, - -311, -251, -311, -311, -311, -311, -311, -311, -311, -311, - -311, -311, 0, -311, 0, 0, -311, -311, 0, -238, - 0, 0, 0, -282, 0, -119, -1, -201, 0, -225, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, -293, 0, 0, 0, 0, - 0, 0, 0, 0, 0, -293, 0, 0, -311, 0, - -183, 0, 0, -214, -198, 0, 0, 0, -311, -249, - -182, 0, -311, 0, -293, 0, 0,}; -const short yyrindex[] = - { 0, - 0, 90, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 175, 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 61, 121, 0, 0, - 0, 0, 0, 0, 0, -163, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, -23, 0, 0, 0, 0, 0, 0, - 0, 0, -64, -48, 204, 218, 259, 271, 312, 324, - 365, 377, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, -233, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0,}; -const short yygindex[] = - { 0, - -4, 0, -42, 0, 0, 0, 62, 0, -98, 0, - 0, 0, 0, -3, 0, -12, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 44, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, -}; -#define YYTABLESIZE 675 -const short yytable[] = - { 36, - 23, 51, 143, 29, 151, 80, 159, 49, 212, 50, - 84, 60, 39, 40, 56, 113, 58, 59, 37, 175, - 61, 42, 46, 111, 110, 65, 71, 75, 77, 82, - 68, 69, 3, 199, 87, 73, 146, 89, 4, 5, - 6, 90, 97, 117, 120, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 198, 29, - 49, 29, 114, 29, 131, 29, 96, 39, 40, 20, - 110, 110, 29, 206, 115, 21, 22, 215, 23, 24, - 39, 40, 147, 148, 25, 121, 122, 26, 27, 1, - 28, 29, 209, 32, 67, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 208, 144, 154, 39, 40, - 95, 155, 0, 0, 152, 85, 86, 29, 88, 0, - 20, 0, 0, 91, 92, 93, 158, 160, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 0, 172, - 0, 178, 173, 174, 0, 0, 176, 179, 180, 99, - 0, 187, 0, 100, 101, 0, 200, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 181, 182, 183, 184, - 185, 186, 0, 0, 10, 0, 0, 0, 102, 103, - 0, 104, 202, 0, 0, 105, 106, 107, 108, 109, - 0, 0, 203, 102, 205, 29, 0, 102, 102, 0, - 0, 123, 0, 0, 211, 213, 0, 0, 216, 94, - 0, 217, 0, 94, 94, 124, 125, 126, 127, 0, - 123, 0, 102, 102, 128, 102, 0, 0, 0, 102, - 102, 102, 102, 102, 124, 125, 126, 127, 94, 94, - 0, 94, 0, 130, 59, 94, 94, 94, 94, 94, - 0, 0, 0, 0, 0, 0, 23, 21, 59, 59, - 59, 59, 23, 23, 23, 189, 190, 59, 0, 23, - 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, - 23, 23, 0, 0, 191, 192, 193, 194, 195, 196, - 0, 0, 0, 23, 0, 0, 0, 0, 0, 23, - 23, 0, 23, 23, 0, 0, 0, 0, 23, 0, - 0, 23, 23, 0, 23, 23, 49, 47, 0, 0, - 0, 0, 49, 49, 49, 0, 0, 0, 0, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 49, 0, 0, 0, 0, 0, 49, - 49, 0, 49, 49, 0, 0, 0, 0, 49, 0, - 0, 49, 49, 0, 49, 49, 20, 18, 0, 0, - 0, 0, 20, 20, 20, 0, 0, 0, 0, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 20, 0, 0, 0, 0, 0, 20, - 20, 0, 20, 20, 0, 0, 0, 0, 20, 0, - 10, 20, 20, 0, 20, 20, 10, 10, 10, 0, - 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, - 0, 90, 0, 0, 0, 90, 90, 10, 0, 0, - 0, 0, 0, 10, 10, 92, 10, 10, 0, 92, - 92, 0, 10, 0, 0, 10, 10, 0, 10, 10, - 90, 90, 0, 90, 0, 0, 0, 90, 90, 90, - 90, 90, 0, 0, 92, 92, 0, 92, 0, 0, - 0, 92, 92, 92, 92, 92, 88, 0, 0, 0, - 88, 88, 0, 0, 0, 0, 0, 0, 96, 0, - 0, 0, 96, 96, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 88, 88, 0, 88, 0, - 0, 0, 88, 88, 88, 88, 88, 96, 96, 0, - 96, 0, 0, 0, 96, 96, 96, 96, 96, 98, - 0, 0, 0, 98, 98, 0, 0, 0, 0, 0, - 0, 100, 0, 0, 0, 100, 100, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 98, 98, - 0, 98, 0, 0, 0, 98, 98, 98, 98, 98, - 100, 100, 0, 100, 0, 0, 0, 100, 100, 100, - 100, 100, 104, 0, 0, 0, 104, 104, 0, 0, - 0, 0, 0, 0, 106, 0, 0, 0, 106, 106, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 104, 104, 0, 104, 0, 0, 0, 104, 104, - 104, 104, 104, 106, 106, 0, 106, 0, 0, 0, - 106, 106, 106, 106, 106, -}; -const short yycheck[] = - { 4, - 0, 14, 258, 315, 258, 48, 258, 12, 258, 13, - 53, 24, 306, 307, 19, 258, 21, 22, 301, 258, - 25, 257, 257, 257, 258, 292, 259, 257, 257, 257, - 35, 35, 256, 259, 309, 40, 258, 292, 262, 263, - 264, 292, 257, 257, 309, 269, 270, 271, 272, 273, - 274, 275, 276, 277, 278, 279, 280, 281, 260, 315, - 0, 315, 305, 315, 291, 315, 71, 306, 307, 293, - 304, 305, 315, 257, 79, 299, 300, 260, 302, 303, - 306, 307, 304, 305, 308, 89, 90, 311, 312, 0, - 314, 315, 291, 257, 292, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 204, 111, 120, 306, 307, - 67, 124, -1, -1, 119, 54, 55, 315, 57, -1, - 0, -1, -1, 62, 63, 64, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, -1, 144, - -1, 154, 147, 148, -1, -1, 150, 267, 268, 258, - -1, 156, -1, 262, 263, -1, 160, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 286, 287, 288, 289, - 290, 291, -1, -1, 0, -1, -1, -1, 287, 288, - -1, 290, 186, -1, -1, 294, 295, 296, 297, 298, - -1, -1, 196, 258, 199, 315, -1, 262, 263, -1, - -1, 268, -1, -1, 209, 210, -1, -1, 213, 258, - -1, 215, -1, 262, 263, 282, 283, 284, 285, -1, - 268, -1, 287, 288, 291, 290, -1, -1, -1, 294, - 295, 296, 297, 298, 282, 283, 284, 285, 287, 288, - -1, 290, -1, 291, 268, 294, 295, 296, 297, 298, - -1, -1, -1, -1, -1, -1, 256, 257, 282, 283, - 284, 285, 262, 263, 264, 267, 268, 291, -1, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, -1, -1, 286, 287, 288, 289, 290, 291, - -1, -1, -1, 293, -1, -1, -1, -1, -1, 299, - 300, -1, 302, 303, -1, -1, -1, -1, 308, -1, - -1, 311, 312, -1, 314, 315, 256, 257, -1, -1, - -1, -1, 262, 263, 264, -1, -1, -1, -1, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 293, -1, -1, -1, -1, -1, 299, - 300, -1, 302, 303, -1, -1, -1, -1, 308, -1, - -1, 311, 312, -1, 314, 315, 256, 257, -1, -1, - -1, -1, 262, 263, 264, -1, -1, -1, -1, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 293, -1, -1, -1, -1, -1, 299, - 300, -1, 302, 303, -1, -1, -1, -1, 308, -1, - 256, 311, 312, -1, 314, 315, 262, 263, 264, -1, - -1, -1, -1, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, -1, -1, -1, -1, - -1, 258, -1, -1, -1, 262, 263, 293, -1, -1, - -1, -1, -1, 299, 300, 258, 302, 303, -1, 262, - 263, -1, 308, -1, -1, 311, 312, -1, 314, 315, - 287, 288, -1, 290, -1, -1, -1, 294, 295, 296, - 297, 298, -1, -1, 287, 288, -1, 290, -1, -1, - -1, 294, 295, 296, 297, 298, 258, -1, -1, -1, - 262, 263, -1, -1, -1, -1, -1, -1, 258, -1, - -1, -1, 262, 263, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 287, 288, -1, 290, -1, - -1, -1, 294, 295, 296, 297, 298, 287, 288, -1, - 290, -1, -1, -1, 294, 295, 296, 297, 298, 258, - -1, -1, -1, 262, 263, -1, -1, -1, -1, -1, - -1, 258, -1, -1, -1, 262, 263, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 287, 288, - -1, 290, -1, -1, -1, 294, 295, 296, 297, 298, - 287, 288, -1, 290, -1, -1, -1, 294, 295, 296, - 297, 298, 258, -1, -1, -1, 262, 263, -1, -1, - -1, -1, -1, -1, 258, -1, -1, -1, 262, 263, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 287, 288, -1, 290, -1, -1, -1, 294, 295, - 296, 297, 298, 287, 288, -1, 290, -1, -1, -1, - 294, 295, 296, 297, 298, -}; -#define YYFINAL 1 -#ifndef YYDEBUG -#define YYDEBUG 0 + +typedef union YYSTYPE YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define YYSTYPE_IS_DECLARED 1 #endif -#define YYMAXTOKEN 315 + + +extern YYSTYPE yylval; + +int yyparse (void); + +#endif /* !YY_YY_GRAM_H_INCLUDED */ + +/* Copy the second part of user declarations. */ + +#line 288 "gram.c" /* yacc.c:358 */ + +#ifdef short +# undef short +#endif + +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; +#endif + +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#else +typedef signed char yytype_int8; +#endif + +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif + +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned int +# endif +#endif + +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(Msgid) dgettext ("bison-runtime", Msgid) +# endif +# endif +# ifndef YY_ +# define YY_(Msgid) Msgid +# endif +#endif + +#ifndef YY_ATTRIBUTE +# if (defined __GNUC__ \ + && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ + || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C +# define YY_ATTRIBUTE(Spec) __attribute__(Spec) +# else +# define YY_ATTRIBUTE(Spec) /* empty */ +# endif +#endif + +#ifndef YY_ATTRIBUTE_PURE +# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) +#endif + +#if !defined _Noreturn \ + && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) +# if defined _MSC_VER && 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(E) ((void) (E)) +#else +# define YYUSE(E) /* empty */ +#endif + +#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") +#else +# define YY_INITIAL_VALUE(Value) Value +#endif +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + + +#if ! defined yyoverflow || YYERROR_VERBOSE + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS +# include /* INFRINGES ON USER NAME SPACE */ + /* Use EXIT_SUCCESS as a witness for stdlib.h. */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined EXIT_SUCCESS \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined EXIT_SUCCESS +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined EXIT_SUCCESS +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# endif +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ + + +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + yytype_int16 yyss_alloc; + YYSTYPE yyvs_alloc; +}; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +# define YYCOPY_NEEDED 1 + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + 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) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) + +#endif + +#if defined YYCOPY_NEEDED && YYCOPY_NEEDED +/* Copy COUNT objects from SRC to DST. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(Dst, Src, Count) \ + __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) +# else +# define YYCOPY(Dst, Src, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (Dst)[yyi] = (Src)[yyi]; \ + } \ + while (0) +# endif +# endif +#endif /* !YYCOPY_NEEDED */ + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 3 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 214 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 62 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 58 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 144 +/* YYNSTATES -- Number of states. */ +#define YYNSTATES 213 + +/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned + by yylex, with out-of-bounds checking. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 316 + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, without out-of-bounds checking. */ +static const yytype_uint8 yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61 +}; + #if YYDEBUG -const char * const yyname[] = - { -"end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"LB","RB","LP","RP","MENUS", -"MENU","BUTTON","DEFAULT_FUNCTION","PLUS","MINUS","ALL","OR","CURSORS","ICONS", -"COLOR","SAVECOLOR","MONOCHROME","FUNCTION","WINDOW_FUNCTION","ZOOM", -"MAKE_TITLE","GRAYSCALE","NO_TITLE","AUTO_RAISE","ICON_REGION","META","SHIFT", -"LOCK","CONTROL","WINDOW","TITLE","ICON","ROOT","FRAME","COLON","EQUALS", -"START_ICONIFIED","MOVE","RESIZE","WAIT","SELECT","KILL","LEFT_TITLEBUTTON", -"RIGHT_TITLEBUTTON","NUMBER","KEYWORD","NKEYWORD","CKEYWORD","CLKEYWORD", -"FKEYWORD","FSKEYWORD","SKEYWORD","DKEYWORD","JKEYWORD","WINDOW_RING", -"WARP_CURSOR","ERRORTOKEN","NO_STACKMODE","STRING", -}; -const char * const yyrule[] = - {"$accept : twmrc", -"twmrc : stmts", -"stmts :", -"stmts : stmts stmt", -"stmt : error", -"stmt : noarg", -"stmt : sarg", -"stmt : narg", -"stmt : ICON_REGION string DKEYWORD DKEYWORD number number", -"stmt : ZOOM number", -"stmt : ZOOM", -"stmt : CURSORS cursor_list", -"stmt : LEFT_TITLEBUTTON string EQUALS action", -"stmt : RIGHT_TITLEBUTTON string EQUALS action", -"stmt : button string", -"stmt : button action", -"stmt : string fullkey", -"stmt : button full", -"$$1 :", -"stmt : NO_STACKMODE $$1 win_list", -"stmt : NO_STACKMODE", -"$$2 :", -"stmt : NO_TITLE $$2 win_list", -"stmt : NO_TITLE", -"$$3 :", -"stmt : MAKE_TITLE $$3 win_list", -"$$4 :", -"stmt : START_ICONIFIED $$4 win_list", -"$$5 :", -"stmt : AUTO_RAISE $$5 win_list", -"$$6 :", -"stmt : MENU string LP string COLON string RP $$6 menu", -"$$7 :", -"stmt : MENU string $$7 menu", -"$$8 :", -"stmt : FUNCTION string $$8 function", -"$$9 :", -"stmt : ICONS $$9 icon_list", -"$$10 :", -"stmt : COLOR $$10 color_list", -"$$11 :", -"stmt : GRAYSCALE $$11 color_list", -"stmt : SAVECOLOR save_color_list", -"$$12 :", -"stmt : MONOCHROME $$12 color_list", -"stmt : DEFAULT_FUNCTION action", -"stmt : WINDOW_FUNCTION action", -"$$13 :", -"stmt : WARP_CURSOR $$13 win_list", -"stmt : WARP_CURSOR", -"$$14 :", -"stmt : WINDOW_RING $$14 win_list", -"noarg : KEYWORD", -"sarg : SKEYWORD string", -"narg : NKEYWORD number", -"full : EQUALS keys COLON contexts COLON action", -"fullkey : EQUALS keys COLON contextkeys COLON action", -"keys :", -"keys : keys key", -"key : META", -"key : SHIFT", -"key : LOCK", -"key : CONTROL", -"key : META number", -"key : OR", -"contexts :", -"contexts : contexts context", -"context : WINDOW", -"context : TITLE", -"context : ICON", -"context : ROOT", -"context : FRAME", -"context : ALL", -"context : OR", -"contextkeys :", -"contextkeys : contextkeys contextkey", -"contextkey : WINDOW", -"contextkey : TITLE", -"contextkey : ICON", -"contextkey : ROOT", -"contextkey : FRAME", -"contextkey : ALL", -"contextkey : OR", -"contextkey : string", -"cursor_list : LB cursor_entries RB", -"cursor_entries :", -"cursor_entries : cursor_entries cursor_entry", -"cursor_entry : FRAME string string", -"cursor_entry : FRAME string", -"cursor_entry : TITLE string string", -"cursor_entry : TITLE string", -"cursor_entry : ICON string string", -"cursor_entry : ICON string", -"cursor_entry : BUTTON string string", -"cursor_entry : BUTTON string", -"cursor_entry : MOVE string string", -"cursor_entry : MOVE string", -"cursor_entry : RESIZE string string", -"cursor_entry : RESIZE string", -"cursor_entry : WAIT string string", -"cursor_entry : WAIT string", -"cursor_entry : MENU string string", -"cursor_entry : MENU string", -"cursor_entry : SELECT string string", -"cursor_entry : SELECT string", -"cursor_entry : KILL string string", -"cursor_entry : KILL string", -"color_list : LB color_entries RB", -"color_entries :", -"color_entries : color_entries color_entry", -"color_entry : CLKEYWORD string", -"$$15 :", -"color_entry : CLKEYWORD string $$15 win_color_list", -"color_entry : CKEYWORD string", -"save_color_list : LB s_color_entries RB", -"s_color_entries :", -"s_color_entries : s_color_entries s_color_entry", -"s_color_entry : string", -"s_color_entry : CLKEYWORD", -"win_color_list : LB win_color_entries RB", -"win_color_entries :", -"win_color_entries : win_color_entries win_color_entry", -"win_color_entry : string string", -"win_list : LB win_entries RB", -"win_entries :", -"win_entries : win_entries win_entry", -"win_entry : string", -"icon_list : LB icon_entries RB", -"icon_entries :", -"icon_entries : icon_entries icon_entry", -"icon_entry : string string", -"function : LB function_entries RB", -"function_entries :", -"function_entries : function_entries function_entry", -"function_entry : action", -"menu : LB menu_entries RB", -"menu_entries :", -"menu_entries : menu_entries menu_entry", -"menu_entry : string action", -"menu_entry : string LP string COLON string RP action", -"action : FKEYWORD", -"action : FSKEYWORD string", -"signed_number : number", -"signed_number : PLUS number", -"signed_number : MINUS number", -"button : BUTTON number", -"string : STRING", -"number : NUMBER", + /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ +static const yytype_uint16 yyrline[] = +{ + 0, 133, 133, 136, 137, 140, 141, 142, 143, 144, + 150, 152, 153, 156, 159, 163, 179, 180, 181, 181, + 183, 185, 185, 187, 189, 189, 191, 191, 193, 193, + 195, 195, 198, 198, 200, 200, 202, 202, 204, 204, + 206, 206, 208, 210, 210, 212, 228, 236, 236, 238, + 240, 240, 245, 255, 265, 277, 280, 283, 284, 287, + 288, 289, 290, 291, 301, 304, 305, 308, 309, 310, + 311, 312, 313, 314, 317, 318, 321, 322, 323, 324, + 325, 326, 327, 328, 331, 334, 335, 338, 340, 342, + 344, 346, 348, 350, 352, 354, 356, 358, 360, 362, + 364, 366, 368, 370, 372, 374, 376, 380, 384, 385, + 388, 397, 397, 408, 419, 422, 423, 426, 427, 430, + 433, 434, 437, 442, 445, 446, 449, 454, 457, 458, + 461, 464, 467, 468, 471, 477, 480, 481, 484, 489, + 497, 498, 544, 556, 561 }; #endif -#ifdef YYSTACKSIZE -#undef YYMAXDEPTH -#define YYMAXDEPTH YYSTACKSIZE -#else -#ifdef YYMAXDEPTH -#define YYSTACKSIZE YYMAXDEPTH -#else -#define YYSTACKSIZE 10000 -#define YYMAXDEPTH 10000 + +#if YYDEBUG || YYERROR_VERBOSE || 0 +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "$end", "error", "$undefined", "LB", "RB", "LP", "RP", "MENUS", "MENU", + "BUTTON", "DEFAULT_FUNCTION", "PLUS", "MINUS", "ALL", "OR", "CURSORS", + "ICONS", "COLOR", "SAVECOLOR", "MONOCHROME", "FUNCTION", + "WINDOW_FUNCTION", "ZOOM", "MAKE_TITLE", "GRAYSCALE", "NO_TITLE", + "AUTO_RAISE", "ICON_REGION", "META", "SHIFT", "LOCK", "CONTROL", + "WINDOW", "TITLE", "ICON", "ROOT", "FRAME", "COLON", "EQUALS", + "START_ICONIFIED", "MOVE", "RESIZE", "WAIT", "SELECT", "KILL", + "LEFT_TITLEBUTTON", "RIGHT_TITLEBUTTON", "NUMBER", "KEYWORD", "NKEYWORD", + "CKEYWORD", "CLKEYWORD", "FKEYWORD", "FSKEYWORD", "SKEYWORD", "DKEYWORD", + "JKEYWORD", "WINDOW_RING", "WARP_CURSOR", "ERRORTOKEN", "NO_STACKMODE", + "STRING", "$accept", "twmrc", "stmts", "stmt", "$@1", "$@2", "$@3", + "$@4", "$@5", "$@6", "$@7", "$@8", "$@9", "$@10", "$@11", "$@12", "$@13", + "$@14", "noarg", "sarg", "narg", "full", "fullkey", "keys", "key", + "contexts", "context", "contextkeys", "contextkey", "cursor_list", + "cursor_entries", "cursor_entry", "color_list", "color_entries", + "color_entry", "$@15", "save_color_list", "s_color_entries", + "s_color_entry", "win_color_list", "win_color_entries", + "win_color_entry", "win_list", "win_entries", "win_entry", "icon_list", + "icon_entries", "icon_entry", "function", "function_entries", + "function_entry", "menu", "menu_entries", "menu_entry", "action", + "button", "string", "number", YY_NULLPTR +}; #endif + +# ifdef YYPRINT +/* YYTOKNUM[NUM] -- (External) token number corresponding to the + (internal) symbol number NUM (which must be that of a token). */ +static const yytype_uint16 yytoknum[] = +{ + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316 +}; +# endif + +#define YYPACT_NINF -109 + +#define yypact_value_is_default(Yystate) \ + (!!((Yystate) == (-109))) + +#define YYTABLE_NINF -112 + +#define yytable_value_is_error(Yytable_value) \ + 0 + + /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +static const yytype_int16 yypact[] = +{ + -109, 12, 23, -109, -109, -46, -29, -27, 18, -109, + -109, 27, -109, -46, -27, -29, -109, -109, 31, -109, + -109, -46, -46, -109, -29, -46, -109, 34, 48, -109, + -109, -109, -109, -109, -25, 14, 50, -109, -109, -109, + -46, -109, -109, -109, 53, 54, -109, -109, 54, -109, + -109, -109, 67, 54, 67, 67, 67, 36, 40, -109, + -109, 67, 67, 67, -109, -109, -109, -109, -109, -109, + -46, 76, -109, 113, -109, -109, -109, -109, -1, -109, + 79, -109, -109, -109, -109, -109, -109, -27, -27, -109, + -109, -109, 154, 165, 49, -109, -109, -109, -46, -46, + -46, -46, -46, -46, -46, -46, -46, -46, -109, 0, + 63, -109, -109, -109, -109, -109, -109, 2, -109, -109, + -109, -29, -109, -109, -109, -109, -109, -109, -46, 3, + -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, + -109, -109, -46, -109, -46, -46, -109, 1, -109, -109, + -109, -109, 138, 129, 81, -109, -109, 6, -109, -109, + -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, + 82, -109, -109, -109, -109, -109, -109, -109, -109, -109, + -109, -27, -109, -109, -109, -109, -109, -109, -109, -109, + -27, -109, -109, -109, -46, -109, 85, -109, -109, 76, + 52, -109, -109, -109, -46, 5, 84, -109, -109, -46, + -27, -109, -109 +}; + + /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ +static const yytype_uint8 yydefact[] = +{ + 3, 0, 0, 1, 5, 0, 0, 0, 0, 36, + 38, 0, 43, 0, 0, 10, 24, 40, 23, 28, + 26, 0, 0, 52, 0, 0, 50, 49, 20, 143, + 4, 6, 7, 8, 0, 0, 32, 144, 142, 140, + 0, 45, 85, 11, 0, 0, 115, 42, 0, 34, + 46, 9, 0, 0, 0, 0, 0, 0, 0, 54, + 53, 0, 0, 0, 57, 17, 15, 14, 57, 16, + 0, 0, 141, 0, 128, 37, 108, 39, 0, 44, + 0, 124, 25, 41, 22, 29, 27, 0, 0, 51, + 48, 19, 0, 0, 0, 136, 33, 84, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 86, 0, + 0, 114, 118, 116, 117, 132, 35, 0, 12, 13, + 64, 59, 60, 61, 62, 65, 58, 74, 0, 0, + 102, 94, 90, 92, 88, 96, 98, 100, 104, 106, + 127, 129, 0, 107, 0, 0, 109, 0, 123, 125, + 126, 63, 0, 0, 0, 135, 137, 0, 101, 93, + 89, 91, 87, 95, 97, 99, 103, 105, 130, 113, + 110, 131, 133, 134, 72, 73, 67, 68, 69, 70, + 71, 0, 66, 81, 82, 76, 77, 78, 79, 80, + 0, 75, 83, 30, 0, 138, 0, 55, 56, 0, + 0, 120, 112, 31, 0, 0, 0, 119, 121, 0, + 0, 122, 139 +}; + + /* YYPGOTO[NTERM-NUM]. */ +static const yytype_int16 yypgoto[] = +{ + -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, + -109, -109, -109, -109, -109, -109, -109, -109, -109, -109, + -109, -109, -109, 24, -109, -109, -109, -109, -109, -109, + -109, -109, -34, -109, -109, -109, -109, -109, -109, -109, + -109, -109, 151, -109, -109, -109, -109, -109, -109, -109, + -109, -108, -109, -109, -12, -109, -5, -14 +}; + + /* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + -1, 1, 2, 30, 63, 54, 52, 56, 55, 199, + 71, 80, 44, 45, 53, 48, 62, 61, 31, 32, + 33, 65, 69, 92, 126, 152, 182, 153, 191, 43, + 73, 108, 77, 110, 146, 196, 47, 78, 113, 202, + 205, 208, 82, 117, 149, 75, 109, 141, 116, 147, + 172, 96, 129, 156, 41, 34, 35, 38 +}; + + /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ +static const yytype_int16 yytable[] = +{ + 36, 51, 50, 111, 140, 171, 148, 155, 49, 207, + 59, 194, 3, 64, 79, 29, 57, 58, 37, 83, + 60, 42, 66, -2, 4, 39, 40, 39, 40, 67, + 46, 5, 6, 7, -21, 72, 29, -47, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 112, -18, 68, 39, 40, 70, 74, 76, 39, 40, + 29, 29, 20, 29, 29, 94, 29, 143, 21, 22, + 81, 23, 24, 114, 87, 118, 119, 25, 88, 95, + 26, 27, 115, 28, 29, -111, 128, 193, 201, 204, + 210, 203, 93, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 0, 142, 0, 0, 151, 0, 0, + 0, 0, 150, 144, 145, 0, 0, 97, 0, 0, + 0, 98, 99, 154, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 173, 0, 168, 0, 169, + 170, 0, 183, 184, 0, 195, 100, 101, 192, 102, + 0, 174, 175, 103, 104, 105, 106, 107, 0, 0, + 0, 185, 186, 187, 188, 189, 190, 0, 120, 197, + 176, 177, 178, 179, 180, 181, 0, 0, 198, 120, + 0, 0, 121, 122, 123, 124, 0, 0, 0, 200, + 29, 125, 0, 121, 122, 123, 124, 0, 212, 206, + 209, 0, 127, 0, 211, 84, 85, 86, 0, 0, + 0, 0, 89, 90, 91 +}; + +static const yytype_int16 yycheck[] = +{ + 5, 15, 14, 4, 4, 4, 4, 4, 13, 4, + 24, 5, 0, 38, 48, 61, 21, 22, 47, 53, + 25, 3, 34, 0, 1, 52, 53, 52, 53, 34, + 3, 8, 9, 10, 3, 40, 61, 3, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 51, 3, 38, 52, 53, 5, 3, 3, 52, 53, + 61, 61, 39, 61, 61, 70, 61, 4, 45, 46, + 3, 48, 49, 78, 38, 87, 88, 54, 38, 3, + 57, 58, 3, 60, 61, 3, 37, 6, 3, 37, + 6, 199, 68, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, -1, 109, -1, -1, 121, -1, -1, + -1, -1, 117, 50, 51, -1, -1, 4, -1, -1, + -1, 8, 9, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 147, -1, 142, -1, 144, + 145, -1, 13, 14, -1, 157, 33, 34, 153, 36, + -1, 13, 14, 40, 41, 42, 43, 44, -1, -1, + -1, 32, 33, 34, 35, 36, 37, -1, 14, 181, + 32, 33, 34, 35, 36, 37, -1, -1, 190, 14, + -1, -1, 28, 29, 30, 31, -1, -1, -1, 194, + 61, 37, -1, 28, 29, 30, 31, -1, 210, 204, + 205, -1, 37, -1, 209, 54, 55, 56, -1, -1, + -1, -1, 61, 62, 63 +}; + + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const yytype_uint8 yystos[] = +{ + 0, 63, 64, 0, 1, 8, 9, 10, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 39, 45, 46, 48, 49, 54, 57, 58, 60, 61, + 65, 80, 81, 82, 117, 118, 118, 47, 119, 52, + 53, 116, 3, 91, 74, 75, 3, 98, 77, 118, + 116, 119, 68, 76, 67, 70, 69, 118, 118, 119, + 118, 79, 78, 66, 38, 83, 116, 118, 38, 84, + 5, 72, 118, 92, 3, 107, 3, 94, 99, 94, + 73, 3, 104, 94, 104, 104, 104, 38, 38, 104, + 104, 104, 85, 85, 118, 3, 113, 4, 8, 9, + 33, 34, 36, 40, 41, 42, 43, 44, 93, 108, + 95, 4, 51, 100, 118, 3, 110, 105, 116, 116, + 14, 28, 29, 30, 31, 37, 86, 37, 37, 114, + 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, + 4, 109, 118, 4, 50, 51, 96, 111, 4, 106, + 118, 119, 87, 89, 118, 4, 115, 118, 118, 118, + 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, + 118, 4, 112, 116, 13, 14, 32, 33, 34, 35, + 36, 37, 88, 13, 14, 32, 33, 34, 35, 36, + 37, 90, 118, 6, 5, 116, 97, 116, 116, 71, + 118, 3, 101, 113, 37, 102, 118, 4, 103, 118, + 6, 118, 116 +}; + + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 62, 63, 64, 64, 65, 65, 65, 65, 65, + 65, 65, 65, 65, 65, 65, 65, 65, 66, 65, + 65, 67, 65, 65, 68, 65, 69, 65, 70, 65, + 71, 65, 72, 65, 73, 65, 74, 65, 75, 65, + 76, 65, 65, 77, 65, 65, 65, 78, 65, 65, + 79, 65, 80, 81, 82, 83, 84, 85, 85, 86, + 86, 86, 86, 86, 86, 87, 87, 88, 88, 88, + 88, 88, 88, 88, 89, 89, 90, 90, 90, 90, + 90, 90, 90, 90, 91, 92, 92, 93, 93, 93, + 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, + 93, 93, 93, 93, 93, 93, 93, 94, 95, 95, + 96, 97, 96, 96, 98, 99, 99, 100, 100, 101, + 102, 102, 103, 104, 105, 105, 106, 107, 108, 108, + 109, 110, 111, 111, 112, 113, 114, 114, 115, 115, + 116, 116, 117, 118, 119 +}; + + /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 1, 0, 2, 1, 1, 1, 1, 2, + 1, 2, 4, 4, 2, 2, 2, 2, 0, 3, + 1, 0, 3, 1, 0, 3, 0, 3, 0, 3, + 0, 9, 0, 4, 0, 4, 0, 3, 0, 3, + 0, 3, 2, 0, 3, 2, 2, 0, 3, 1, + 0, 3, 1, 2, 2, 6, 6, 0, 2, 1, + 1, 1, 1, 2, 1, 0, 2, 1, 1, 1, + 1, 1, 1, 1, 0, 2, 1, 1, 1, 1, + 1, 1, 1, 1, 3, 0, 2, 3, 2, 3, + 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, + 2, 3, 2, 3, 2, 3, 2, 3, 0, 2, + 2, 0, 4, 2, 3, 0, 2, 1, 1, 3, + 0, 2, 2, 3, 0, 2, 1, 3, 0, 2, + 2, 3, 0, 2, 1, 3, 0, 2, 2, 7, + 1, 2, 2, 1, 1 +}; + + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ +while (0) + +/* Error token number */ +#define YYTERROR 1 +#define YYERRCODE 256 + + + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) + +/* This macro is provided for backward compatibility. */ +#ifndef YY_LOCATION_PRINT +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) #endif -#define YYINITSTACKSIZE 200 -/* LINTUSED */ + + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) + + +/*----------------------------------------. +| Print this symbol's value on YYOUTPUT. | +`----------------------------------------*/ + +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +{ + FILE *yyo = yyoutput; + YYUSE (yyo); + if (!yyvaluep) + return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# endif + YYUSE (yytype); +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +{ + YYFPRINTF (yyoutput, "%s %s (", + yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); + + yy_symbol_value_print (yyoutput, yytype, yyvaluep); + YYFPRINTF (yyoutput, ")"); +} + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +static void +yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) +{ + YYFPRINTF (stderr, "Stack now"); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +static void +yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) +{ + unsigned long int yylno = yyrline[yyrule]; + int yynrhs = yyr2[yyrule]; + int yyi; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + YYFPRINTF (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, + yystos[yyssp[yyi + 1 - yynrhs]], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); + YYFPRINTF (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, Rule); \ +} while (0) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ int yydebug; -int yynerrs; -int yyerrflag; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +static YYSIZE_T +yystrlen (const char *yystr) +{ + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; +} +# endif +# endif + +# ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +static char * +yystpcpy (char *yydest, const char *yysrc) +{ + char *yyd = yydest; + const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif + +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message + about the unexpected token YYTOKEN for the state stack whose top is + YYSSP. + + Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is + not large enough to hold the message. In that case, also set + *YYMSG_ALLOC to the required number of bytes. Return 2 if the + required number of bytes is too large to store. */ +static int +yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, + yytype_int16 *yyssp, int yytoken) +{ + YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); + YYSIZE_T yysize = yysize0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + /* Internationalized format string. */ + const char *yyformat = YY_NULLPTR; + /* Arguments of yyformat. */ + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + /* Number of reported tokens (one for the "unexpected", one per + "expected"). */ + int yycount = 0; + + /* There are many possibilities here to consider: + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yychar) is if + this state is a consistent state with a default action. Thus, + detecting the absence of a lookahead is sufficient to determine + that there is no unexpected or expected token to report. In that + case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is a + consistent state with a default action. There might have been a + previous inconsistent state, consistent state with a non-default + action, or user semantic action that manipulated yychar. + - Of course, the expected token list depends on states to have + correct lookahead information, and it depends on the parser not + to perform extra reductions after fetching a lookahead from the + scanner and before detecting a syntax error. Thus, state merging + (from LALR or IELR) and default reductions corrupt the expected + token list. However, the list is correct for canonical LR with + one exception: it will still contain any token that will not be + accepted due to an error action in a later state. + */ + if (yytoken != YYEMPTY) + { + int yyn = yypact[*yyssp]; + yyarg[yycount++] = yytname[yytoken]; + if (!yypact_value_is_default (yyn)) + { + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yyx; + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR + && !yytable_value_is_error (yytable[yyx + yyn])) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + break; + } + yyarg[yycount++] = yytname[yyx]; + { + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); + if (! (yysize <= yysize1 + && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + } + } + } + + switch (yycount) + { +# define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +# undef YYCASE_ + } + + { + YYSIZE_T yysize1 = yysize + yystrlen (yyformat); + if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + + if (*yymsg_alloc < yysize) + { + *yymsg_alloc = 2 * yysize; + if (! (yysize <= *yymsg_alloc + && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) + *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; + return 1; + } + + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + { + char *yyp = *yymsg; + int yyi = 0; + while ((*yyp = *yyformat) != '\0') + if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyformat += 2; + } + else + { + yyp++; + yyformat++; + } + } + return 0; +} +#endif /* YYERROR_VERBOSE */ + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +static void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +{ + YYUSE (yyvaluep); + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END +} + + + + +/* The lookahead symbol. */ int yychar; -short *yyssp; -YYSTYPE *yyvsp; -YYSTYPE yyval; + +/* The semantic value of the lookahead symbol. */ YYSTYPE yylval; -short *yyss; -short *yysslim; -YYSTYPE *yyvs; -unsigned int yystacksize; -int yyparse(void); -#line 568 "gram.y" +/* Number of syntax errors so far. */ +int yynerrs; + + +/*----------. +| yyparse. | +`----------*/ + +int +yyparse (void) +{ + int yystate; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + + /* The stacks and their tools: + 'yyss': related to states. + 'yyvs': related to semantic values. + + Refer to the stacks through separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* 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; + + int yyn; + int yyresult; + /* Lookahead token as an internal (translated) token number. */ + int yytoken = 0; + /* 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; + + yyssp = yyss = yyssa; + yyvsp = yyvs = yyvsa; + yystacksize = YYINITDEPTH; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + goto yysetstate; + +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; + + yysetstate: + *yyssp = yystate; + + if (yyss + yystacksize - 1 <= yyssp) + { + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = yyssp - yyss + 1; + +#ifdef yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + 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 + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; + } +#else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyexhaustedlab; +# else + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif +#endif /* no yyoverflow */ + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } + + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + if (yystate == YYFINAL) + YYACCEPT; + + goto yybackup; + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + + /* Do appropriate processing given the current state. Read a + lookahead token if we need one and don't already have one. */ + + /* First try to decide what to do without reference to lookahead token. */ + yyn = yypact[yystate]; + if (yypact_value_is_default (yyn)) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = yylex (); + } + + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yytable_value_is_error (yyn)) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + /* Shift the lookahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the shifted token. */ + yychar = YYEMPTY; + + yystate = yyn; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END + + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + '$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 9: +#line 144 "gram.y" /* yacc.c:1646 */ + { if (Scr->FirstTime) + { + Scr->DoZoom = TRUE; + Scr->ZoomCount = (yyvsp[0].num); + } + } +#line 1546 "gram.c" /* yacc.c:1646 */ + break; + + case 10: +#line 150 "gram.y" /* yacc.c:1646 */ + { if (Scr->FirstTime) + Scr->DoZoom = TRUE; } +#line 1553 "gram.c" /* yacc.c:1646 */ + break; + + case 11: +#line 152 "gram.y" /* yacc.c:1646 */ + {} +#line 1559 "gram.c" /* yacc.c:1646 */ + break; + + case 12: +#line 153 "gram.y" /* yacc.c:1646 */ + { + GotTitleButton ((yyvsp[-2].ptr), (yyvsp[0].num), False); + } +#line 1567 "gram.c" /* yacc.c:1646 */ + break; + + case 13: +#line 156 "gram.y" /* yacc.c:1646 */ + { + GotTitleButton ((yyvsp[-2].ptr), (yyvsp[0].num), True); + } +#line 1575 "gram.c" /* yacc.c:1646 */ + break; + + case 14: +#line 159 "gram.y" /* yacc.c:1646 */ + { root = GetRoot((yyvsp[0].ptr), NULLSTR, NULLSTR); + Scr->Mouse[(yyvsp[-1].num)][C_ROOT][0].func = F_MENU; + Scr->Mouse[(yyvsp[-1].num)][C_ROOT][0].menu = root; + } +#line 1584 "gram.c" /* yacc.c:1646 */ + break; + + case 15: +#line 163 "gram.y" /* yacc.c:1646 */ + { Scr->Mouse[(yyvsp[-1].num)][C_ROOT][0].func = (yyvsp[0].num); + if ((yyvsp[0].num) == F_MENU) + { + pull->prev = NULL; + Scr->Mouse[(yyvsp[-1].num)][C_ROOT][0].menu = pull; + } + else + { + root = GetRoot(TWM_ROOT,NULLSTR,NULLSTR); + Scr->Mouse[(yyvsp[-1].num)][C_ROOT][0].item = + AddToMenu(root,"x",Action, + NULL,(yyvsp[0].num),NULLSTR,NULLSTR); + } + Action = ""; + pull = NULL; + } +#line 1605 "gram.c" /* yacc.c:1646 */ + break; + + case 16: +#line 179 "gram.y" /* yacc.c:1646 */ + { GotKey((yyvsp[-1].ptr), (yyvsp[0].num)); } +#line 1611 "gram.c" /* yacc.c:1646 */ + break; + + case 17: +#line 180 "gram.y" /* yacc.c:1646 */ + { GotButton((yyvsp[-1].num), (yyvsp[0].num)); } +#line 1617 "gram.c" /* yacc.c:1646 */ + break; + + case 18: +#line 181 "gram.y" /* yacc.c:1646 */ + { list = &Scr->NoStackModeL; } +#line 1623 "gram.c" /* yacc.c:1646 */ + break; + + case 20: +#line 183 "gram.y" /* yacc.c:1646 */ + { if (Scr->FirstTime) + Scr->StackMode = FALSE; } +#line 1630 "gram.c" /* yacc.c:1646 */ + break; + + case 21: +#line 185 "gram.y" /* yacc.c:1646 */ + { list = &Scr->NoTitle; } +#line 1636 "gram.c" /* yacc.c:1646 */ + break; + + case 23: +#line 187 "gram.y" /* yacc.c:1646 */ + { if (Scr->FirstTime) + Scr->NoTitlebar = TRUE; } +#line 1643 "gram.c" /* yacc.c:1646 */ + break; + + case 24: +#line 189 "gram.y" /* yacc.c:1646 */ + { list = &Scr->MakeTitle; } +#line 1649 "gram.c" /* yacc.c:1646 */ + break; + + case 26: +#line 191 "gram.y" /* yacc.c:1646 */ + { list = &Scr->StartIconified; } +#line 1655 "gram.c" /* yacc.c:1646 */ + break; + + case 28: +#line 193 "gram.y" /* yacc.c:1646 */ + { list = &Scr->AutoRaise; } +#line 1661 "gram.c" /* yacc.c:1646 */ + break; + + case 30: +#line 195 "gram.y" /* yacc.c:1646 */ + { + root = GetRoot((yyvsp[-5].ptr), (yyvsp[-3].ptr), (yyvsp[-1].ptr)); } +#line 1668 "gram.c" /* yacc.c:1646 */ + break; + + case 31: +#line 197 "gram.y" /* yacc.c:1646 */ + { root->real_menu = TRUE;} +#line 1674 "gram.c" /* yacc.c:1646 */ + break; + + case 32: +#line 198 "gram.y" /* yacc.c:1646 */ + { root = GetRoot((yyvsp[0].ptr), NULLSTR, NULLSTR); } +#line 1680 "gram.c" /* yacc.c:1646 */ + break; + + case 33: +#line 199 "gram.y" /* yacc.c:1646 */ + { root->real_menu = TRUE; } +#line 1686 "gram.c" /* yacc.c:1646 */ + break; + + case 34: +#line 200 "gram.y" /* yacc.c:1646 */ + { root = GetRoot((yyvsp[0].ptr), NULLSTR, NULLSTR); } +#line 1692 "gram.c" /* yacc.c:1646 */ + break; + + case 36: +#line 202 "gram.y" /* yacc.c:1646 */ + { list = &Scr->IconNames; } +#line 1698 "gram.c" /* yacc.c:1646 */ + break; + + case 38: +#line 204 "gram.y" /* yacc.c:1646 */ + { color = COLOR; } +#line 1704 "gram.c" /* yacc.c:1646 */ + break; + + case 40: +#line 206 "gram.y" /* yacc.c:1646 */ + { color = GRAYSCALE; } +#line 1710 "gram.c" /* yacc.c:1646 */ + break; + + case 43: +#line 210 "gram.y" /* yacc.c:1646 */ + { color = MONOCHROME; } +#line 1716 "gram.c" /* yacc.c:1646 */ + break; + + case 45: +#line 212 "gram.y" /* yacc.c:1646 */ + { Scr->DefaultFunction.func = (yyvsp[0].num); + if ((yyvsp[0].num) == F_MENU) + { + pull->prev = NULL; + Scr->DefaultFunction.menu = pull; + } + else + { + root = GetRoot(TWM_ROOT,NULLSTR,NULLSTR); + Scr->DefaultFunction.item = + AddToMenu(root,"x",Action, + NULL,(yyvsp[0].num), NULLSTR, NULLSTR); + } + Action = ""; + pull = NULL; + } +#line 1737 "gram.c" /* yacc.c:1646 */ + break; + + case 46: +#line 228 "gram.y" /* yacc.c:1646 */ + { Scr->WindowFunction.func = (yyvsp[0].num); + root = GetRoot(TWM_ROOT,NULLSTR,NULLSTR); + Scr->WindowFunction.item = + AddToMenu(root,"x",Action, + NULL,(yyvsp[0].num), NULLSTR, NULLSTR); + Action = ""; + pull = NULL; + } +#line 1750 "gram.c" /* yacc.c:1646 */ + break; + + case 47: +#line 236 "gram.y" /* yacc.c:1646 */ + { list = &Scr->WarpCursorL; } +#line 1756 "gram.c" /* yacc.c:1646 */ + break; + + case 49: +#line 238 "gram.y" /* yacc.c:1646 */ + { if (Scr->FirstTime) + Scr->WarpCursor = TRUE; } +#line 1763 "gram.c" /* yacc.c:1646 */ + break; + + case 50: +#line 240 "gram.y" /* yacc.c:1646 */ + { list = &Scr->WindowRingL; } +#line 1769 "gram.c" /* yacc.c:1646 */ + break; + + case 52: +#line 245 "gram.y" /* yacc.c:1646 */ + { if (!do_single_keyword ((yyvsp[0].num))) { + twmrc_error_prefix(); + fprintf (stderr, + "unknown singleton keyword %d\n", + (yyvsp[0].num)); + ParseError = 1; + } + } +#line 1782 "gram.c" /* yacc.c:1646 */ + break; + + case 53: +#line 255 "gram.y" /* yacc.c:1646 */ + { if (!do_string_keyword ((yyvsp[-1].num), (yyvsp[0].ptr))) { + twmrc_error_prefix(); + fprintf (stderr, + "unknown string keyword %d (value \"%s\")\n", + (yyvsp[-1].num), (yyvsp[0].ptr)); + ParseError = 1; + } + } +#line 1795 "gram.c" /* yacc.c:1646 */ + break; + + case 54: +#line 265 "gram.y" /* yacc.c:1646 */ + { if (!do_number_keyword ((yyvsp[-1].num), (yyvsp[0].num))) { + twmrc_error_prefix(); + fprintf (stderr, + "unknown numeric keyword %d (value %d)\n", + (yyvsp[-1].num), (yyvsp[0].num)); + ParseError = 1; + } + } +#line 1808 "gram.c" /* yacc.c:1646 */ + break; + + case 55: +#line 277 "gram.y" /* yacc.c:1646 */ + { (yyval.num) = (yyvsp[0].num); } +#line 1814 "gram.c" /* yacc.c:1646 */ + break; + + case 56: +#line 280 "gram.y" /* yacc.c:1646 */ + { (yyval.num) = (yyvsp[0].num); } +#line 1820 "gram.c" /* yacc.c:1646 */ + break; + + case 59: +#line 287 "gram.y" /* yacc.c:1646 */ + { mods |= Mod1Mask; } +#line 1826 "gram.c" /* yacc.c:1646 */ + break; + + case 60: +#line 288 "gram.y" /* yacc.c:1646 */ + { mods |= ShiftMask; } +#line 1832 "gram.c" /* yacc.c:1646 */ + break; + + case 61: +#line 289 "gram.y" /* yacc.c:1646 */ + { mods |= LockMask; } +#line 1838 "gram.c" /* yacc.c:1646 */ + break; + + case 62: +#line 290 "gram.y" /* yacc.c:1646 */ + { mods |= ControlMask; } +#line 1844 "gram.c" /* yacc.c:1646 */ + break; + + case 63: +#line 291 "gram.y" /* yacc.c:1646 */ + { if ((yyvsp[0].num) < 1 || (yyvsp[0].num) > 5) { + twmrc_error_prefix(); + fprintf (stderr, + "bad modifier number (%d), must be 1-5\n", + (yyvsp[0].num)); + ParseError = 1; + } else { + mods |= (Mod1Mask << ((yyvsp[0].num) - 1)); + } + } +#line 1859 "gram.c" /* yacc.c:1646 */ + break; + + case 64: +#line 301 "gram.y" /* yacc.c:1646 */ + { } +#line 1865 "gram.c" /* yacc.c:1646 */ + break; + + case 67: +#line 308 "gram.y" /* yacc.c:1646 */ + { cont |= C_WINDOW_BIT; } +#line 1871 "gram.c" /* yacc.c:1646 */ + break; + + case 68: +#line 309 "gram.y" /* yacc.c:1646 */ + { cont |= C_TITLE_BIT; } +#line 1877 "gram.c" /* yacc.c:1646 */ + break; + + case 69: +#line 310 "gram.y" /* yacc.c:1646 */ + { cont |= C_ICON_BIT; } +#line 1883 "gram.c" /* yacc.c:1646 */ + break; + + case 70: +#line 311 "gram.y" /* yacc.c:1646 */ + { cont |= C_ROOT_BIT; } +#line 1889 "gram.c" /* yacc.c:1646 */ + break; + + case 71: +#line 312 "gram.y" /* yacc.c:1646 */ + { cont |= C_FRAME_BIT; } +#line 1895 "gram.c" /* yacc.c:1646 */ + break; + + case 72: +#line 313 "gram.y" /* yacc.c:1646 */ + { cont |= C_ALL_BITS; } +#line 1901 "gram.c" /* yacc.c:1646 */ + break; + + case 73: +#line 314 "gram.y" /* yacc.c:1646 */ + { } +#line 1907 "gram.c" /* yacc.c:1646 */ + break; + + case 76: +#line 321 "gram.y" /* yacc.c:1646 */ + { cont |= C_WINDOW_BIT; } +#line 1913 "gram.c" /* yacc.c:1646 */ + break; + + case 77: +#line 322 "gram.y" /* yacc.c:1646 */ + { cont |= C_TITLE_BIT; } +#line 1919 "gram.c" /* yacc.c:1646 */ + break; + + case 78: +#line 323 "gram.y" /* yacc.c:1646 */ + { cont |= C_ICON_BIT; } +#line 1925 "gram.c" /* yacc.c:1646 */ + break; + + case 79: +#line 324 "gram.y" /* yacc.c:1646 */ + { cont |= C_ROOT_BIT; } +#line 1931 "gram.c" /* yacc.c:1646 */ + break; + + case 80: +#line 325 "gram.y" /* yacc.c:1646 */ + { cont |= C_FRAME_BIT; } +#line 1937 "gram.c" /* yacc.c:1646 */ + break; + + case 81: +#line 326 "gram.y" /* yacc.c:1646 */ + { cont |= C_ALL_BITS; } +#line 1943 "gram.c" /* yacc.c:1646 */ + break; + + case 82: +#line 327 "gram.y" /* yacc.c:1646 */ + { } +#line 1949 "gram.c" /* yacc.c:1646 */ + break; + + case 83: +#line 328 "gram.y" /* yacc.c:1646 */ + { Name = (yyvsp[0].ptr); cont |= C_NAME_BIT; } +#line 1955 "gram.c" /* yacc.c:1646 */ + break; + + case 87: +#line 338 "gram.y" /* yacc.c:1646 */ + { + NewBitmapCursor(&Scr->FrameCursor, (yyvsp[-1].ptr), (yyvsp[0].ptr)); } +#line 1962 "gram.c" /* yacc.c:1646 */ + break; + + case 88: +#line 340 "gram.y" /* yacc.c:1646 */ + { + NewFontCursor(&Scr->FrameCursor, (yyvsp[0].ptr)); } +#line 1969 "gram.c" /* yacc.c:1646 */ + break; + + case 89: +#line 342 "gram.y" /* yacc.c:1646 */ + { + NewBitmapCursor(&Scr->TitleCursor, (yyvsp[-1].ptr), (yyvsp[0].ptr)); } +#line 1976 "gram.c" /* yacc.c:1646 */ + break; + + case 90: +#line 344 "gram.y" /* yacc.c:1646 */ + { + NewFontCursor(&Scr->TitleCursor, (yyvsp[0].ptr)); } +#line 1983 "gram.c" /* yacc.c:1646 */ + break; + + case 91: +#line 346 "gram.y" /* yacc.c:1646 */ + { + NewBitmapCursor(&Scr->IconCursor, (yyvsp[-1].ptr), (yyvsp[0].ptr)); } +#line 1990 "gram.c" /* yacc.c:1646 */ + break; + + case 92: +#line 348 "gram.y" /* yacc.c:1646 */ + { + NewFontCursor(&Scr->IconCursor, (yyvsp[0].ptr)); } +#line 1997 "gram.c" /* yacc.c:1646 */ + break; + + case 93: +#line 350 "gram.y" /* yacc.c:1646 */ + { + NewBitmapCursor(&Scr->ButtonCursor, (yyvsp[-1].ptr), (yyvsp[0].ptr)); } +#line 2004 "gram.c" /* yacc.c:1646 */ + break; + + case 94: +#line 352 "gram.y" /* yacc.c:1646 */ + { + NewFontCursor(&Scr->ButtonCursor, (yyvsp[0].ptr)); } +#line 2011 "gram.c" /* yacc.c:1646 */ + break; + + case 95: +#line 354 "gram.y" /* yacc.c:1646 */ + { + NewBitmapCursor(&Scr->MoveCursor, (yyvsp[-1].ptr), (yyvsp[0].ptr)); } +#line 2018 "gram.c" /* yacc.c:1646 */ + break; + + case 96: +#line 356 "gram.y" /* yacc.c:1646 */ + { + NewFontCursor(&Scr->MoveCursor, (yyvsp[0].ptr)); } +#line 2025 "gram.c" /* yacc.c:1646 */ + break; + + case 97: +#line 358 "gram.y" /* yacc.c:1646 */ + { + NewBitmapCursor(&Scr->ResizeCursor, (yyvsp[-1].ptr), (yyvsp[0].ptr)); } +#line 2032 "gram.c" /* yacc.c:1646 */ + break; + + case 98: +#line 360 "gram.y" /* yacc.c:1646 */ + { + NewFontCursor(&Scr->ResizeCursor, (yyvsp[0].ptr)); } +#line 2039 "gram.c" /* yacc.c:1646 */ + break; + + case 99: +#line 362 "gram.y" /* yacc.c:1646 */ + { + NewBitmapCursor(&Scr->WaitCursor, (yyvsp[-1].ptr), (yyvsp[0].ptr)); } +#line 2046 "gram.c" /* yacc.c:1646 */ + break; + + case 100: +#line 364 "gram.y" /* yacc.c:1646 */ + { + NewFontCursor(&Scr->WaitCursor, (yyvsp[0].ptr)); } +#line 2053 "gram.c" /* yacc.c:1646 */ + break; + + case 101: +#line 366 "gram.y" /* yacc.c:1646 */ + { + NewBitmapCursor(&Scr->MenuCursor, (yyvsp[-1].ptr), (yyvsp[0].ptr)); } +#line 2060 "gram.c" /* yacc.c:1646 */ + break; + + case 102: +#line 368 "gram.y" /* yacc.c:1646 */ + { + NewFontCursor(&Scr->MenuCursor, (yyvsp[0].ptr)); } +#line 2067 "gram.c" /* yacc.c:1646 */ + break; + + case 103: +#line 370 "gram.y" /* yacc.c:1646 */ + { + NewBitmapCursor(&Scr->SelectCursor, (yyvsp[-1].ptr), (yyvsp[0].ptr)); } +#line 2074 "gram.c" /* yacc.c:1646 */ + break; + + case 104: +#line 372 "gram.y" /* yacc.c:1646 */ + { + NewFontCursor(&Scr->SelectCursor, (yyvsp[0].ptr)); } +#line 2081 "gram.c" /* yacc.c:1646 */ + break; + + case 105: +#line 374 "gram.y" /* yacc.c:1646 */ + { + NewBitmapCursor(&Scr->DestroyCursor, (yyvsp[-1].ptr), (yyvsp[0].ptr)); } +#line 2088 "gram.c" /* yacc.c:1646 */ + break; + + case 106: +#line 376 "gram.y" /* yacc.c:1646 */ + { + NewFontCursor(&Scr->DestroyCursor, (yyvsp[0].ptr)); } +#line 2095 "gram.c" /* yacc.c:1646 */ + break; + + case 110: +#line 388 "gram.y" /* yacc.c:1646 */ + { if (!do_colorlist_keyword ((yyvsp[-1].num), color, + (yyvsp[0].ptr))) { + twmrc_error_prefix(); + fprintf (stderr, + "unhandled list color keyword %d (string \"%s\")\n", + (yyvsp[-1].num), (yyvsp[0].ptr)); + ParseError = 1; + } + } +#line 2109 "gram.c" /* yacc.c:1646 */ + break; + + case 111: +#line 397 "gram.y" /* yacc.c:1646 */ + { list = do_colorlist_keyword((yyvsp[-1].num), color, + (yyvsp[0].ptr)); + if (!list) { + twmrc_error_prefix(); + fprintf (stderr, + "unhandled color list keyword %d (string \"%s\")\n", + (yyvsp[-1].num), (yyvsp[0].ptr)); + ParseError = 1; + } + } +#line 2124 "gram.c" /* yacc.c:1646 */ + break; + + case 112: +#line 407 "gram.y" /* yacc.c:1646 */ + { /* No action */; } +#line 2130 "gram.c" /* yacc.c:1646 */ + break; + + case 113: +#line 408 "gram.y" /* yacc.c:1646 */ + { if (!do_color_keyword ((yyvsp[-1].num), color, + (yyvsp[0].ptr))) { + twmrc_error_prefix(); + fprintf (stderr, + "unhandled color keyword %d (string \"%s\")\n", + (yyvsp[-1].num), (yyvsp[0].ptr)); + ParseError = 1; + } + } +#line 2144 "gram.c" /* yacc.c:1646 */ + break; + + case 117: +#line 426 "gram.y" /* yacc.c:1646 */ + { do_string_savecolor(color, (yyvsp[0].ptr)); } +#line 2150 "gram.c" /* yacc.c:1646 */ + break; + + case 118: +#line 427 "gram.y" /* yacc.c:1646 */ + { do_var_savecolor((yyvsp[0].num)); } +#line 2156 "gram.c" /* yacc.c:1646 */ + break; + + case 122: +#line 437 "gram.y" /* yacc.c:1646 */ + { if (Scr->FirstTime && + color == Scr->Monochrome) + AddToList(list, (yyvsp[-1].ptr), (yyvsp[0].ptr)); } +#line 2164 "gram.c" /* yacc.c:1646 */ + break; + + case 126: +#line 449 "gram.y" /* yacc.c:1646 */ + { if (Scr->FirstTime) + AddToList(list, (yyvsp[0].ptr), 0); + } +#line 2172 "gram.c" /* yacc.c:1646 */ + break; + + case 130: +#line 461 "gram.y" /* yacc.c:1646 */ + { if (Scr->FirstTime) AddToList(list, (yyvsp[-1].ptr), (yyvsp[0].ptr)); } +#line 2178 "gram.c" /* yacc.c:1646 */ + break; + + case 134: +#line 471 "gram.y" /* yacc.c:1646 */ + { AddToMenu(root, "", Action, NULL, (yyvsp[0].num), + NULLSTR, NULLSTR); + Action = ""; + } +#line 2187 "gram.c" /* yacc.c:1646 */ + break; + + case 138: +#line 484 "gram.y" /* yacc.c:1646 */ + { AddToMenu(root, (yyvsp[-1].ptr), Action, pull, (yyvsp[0].num), + NULLSTR, NULLSTR); + Action = ""; + pull = NULL; + } +#line 2197 "gram.c" /* yacc.c:1646 */ + break; + + case 139: +#line 489 "gram.y" /* yacc.c:1646 */ + { + AddToMenu(root, (yyvsp[-6].ptr), Action, pull, (yyvsp[0].num), + (yyvsp[-4].ptr), (yyvsp[-2].ptr)); + Action = ""; + pull = NULL; + } +#line 2208 "gram.c" /* yacc.c:1646 */ + break; + + case 140: +#line 497 "gram.y" /* yacc.c:1646 */ + { (yyval.num) = (yyvsp[0].num); } +#line 2214 "gram.c" /* yacc.c:1646 */ + break; + + case 141: +#line 498 "gram.y" /* yacc.c:1646 */ + { + (yyval.num) = (yyvsp[-1].num); + Action = (yyvsp[0].ptr); + switch ((yyvsp[-1].num)) { + case F_MENU: + pull = GetRoot ((yyvsp[0].ptr), NULLSTR,NULLSTR); + pull->prev = root; + break; + case F_WARPRING: + if (!CheckWarpRingArg (Action)) { + twmrc_error_prefix(); + fprintf (stderr, + "ignoring invalid f.warptoring argument \"%s\"\n", + Action); + (yyval.num) = F_NOP; + } + case F_WARPTOSCREEN: + if (!CheckWarpScreenArg (Action)) { + twmrc_error_prefix(); + fprintf (stderr, + "ignoring invalid f.warptoscreen argument \"%s\"\n", + Action); + (yyval.num) = F_NOP; + } + break; + case F_COLORMAP: + if (CheckColormapArg (Action)) { + (yyval.num) = F_COLORMAP; + } else { + twmrc_error_prefix(); + fprintf (stderr, + "ignoring invalid f.colormap argument \"%s\"\n", + Action); + (yyval.num) = F_NOP; + } + break; + } /* end switch */ + } +#line 2257 "gram.c" /* yacc.c:1646 */ + break; + + case 142: +#line 544 "gram.y" /* yacc.c:1646 */ + { (yyval.num) = (yyvsp[0].num); + if ((yyvsp[0].num) == 0) + yyerror("bad button 0"); + + if ((yyvsp[0].num) > MAX_BUTTONS) + { + (yyval.num) = 0; + yyerror("button number too large"); + } + } +#line 2272 "gram.c" /* yacc.c:1646 */ + break; + + case 143: +#line 556 "gram.y" /* yacc.c:1646 */ + { ptr = strdup((yyvsp[0].ptr)); + RemoveDQuote(ptr); + (yyval.ptr) = ptr; + } +#line 2281 "gram.c" /* yacc.c:1646 */ + break; + + case 144: +#line 561 "gram.y" /* yacc.c:1646 */ + { (yyval.num) = (yyvsp[0].num); } +#line 2287 "gram.c" /* yacc.c:1646 */ + break; + + +#line 2291 "gram.c" /* yacc.c:1646 */ + default: break; + } + /* User semantic actions sometimes alter yychar, and that requires + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action invokes + YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or + if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an + incorrect destructor might then be invoked immediately. In the + case of YYERROR or YYBACKUP, subsequent parser actions might lead + to an incorrect destructor call or verbose syntax error message + before the lookahead is translated. */ + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + + *++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. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTOKENS]; + + goto yynewstate; + + +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ +yyerrlab: + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); + + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; +#if ! YYERROR_VERBOSE + yyerror (YY_("syntax error")); +#else +# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ + yyssp, yytoken) + { + char const *yymsgp = YY_("syntax error"); + int yysyntax_error_status; + yysyntax_error_status = YYSYNTAX_ERROR; + if (yysyntax_error_status == 0) + yymsgp = yymsg; + else if (yysyntax_error_status == 1) + { + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); + if (!yymsg) + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + yysyntax_error_status = 2; + } + else + { + yysyntax_error_status = YYSYNTAX_ERROR; + yymsgp = yymsg; + } + } + yyerror (yymsgp); + if (yysyntax_error_status == 2) + goto yyexhaustedlab; + } +# undef YYSYNTAX_ERROR +#endif + } + + + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } + } + + /* Else will try to reuse lookahead token after shifting the error + token. */ + goto yyerrlab1; + + +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) + goto yyerrorlab; + + /* Do not reclaim the symbols of the rule whose action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; + + +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + for (;;) + { + yyn = yypact[yystate]; + if (!yypact_value_is_default (yyn)) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + + yydestruct ("Error: popping", + yystos[yystate], yyvsp); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END + + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturn; + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturn; + +#if !defined yyoverflow || YYERROR_VERBOSE +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); + yyresult = 2; + /* Fall through. */ +#endif + +yyreturn: + if (yychar != YYEMPTY) + { + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = YYTRANSLATE (yychar); + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + } + /* Do not reclaim the symbols of the rule whose action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK (1); + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + return yyresult; +} +#line 564 "gram.y" /* yacc.c:1906 */ + static void yyerror(const char *s) { @@ -807,850 +2736,3 @@ twmrc_error_prefix (void) { fprintf (stderr, "%s: line %d: ", ProgramName, yylineno); } -#line 803 "gram.c" -/* allocate initial stack or double stack size, up to YYMAXDEPTH */ -static int yygrowstack(void) -{ - unsigned int newsize; - long sslen; - short *newss; - YYSTYPE *newvs; - - if ((newsize = yystacksize) == 0) - newsize = YYINITSTACKSIZE; - else if (newsize >= YYMAXDEPTH) - return -1; - else if ((newsize *= 2) > YYMAXDEPTH) - newsize = YYMAXDEPTH; - sslen = yyssp - yyss; -#ifdef SIZE_MAX -#define YY_SIZE_MAX SIZE_MAX -#else -#define YY_SIZE_MAX 0xffffffffU -#endif - if (newsize && YY_SIZE_MAX / newsize < sizeof *newss) - goto bail; - newss = yyss ? (short *)realloc(yyss, newsize * sizeof *newss) : - (short *)malloc(newsize * sizeof *newss); /* overflow check above */ - if (newss == NULL) - goto bail; - yyss = newss; - yyssp = newss + sslen; - if (newsize && YY_SIZE_MAX / newsize < sizeof *newvs) - goto bail; - newvs = yyvs ? (YYSTYPE *)realloc(yyvs, newsize * sizeof *newvs) : - (YYSTYPE *)malloc(newsize * sizeof *newvs); /* overflow check above */ - if (newvs == NULL) - goto bail; - yyvs = newvs; - yyvsp = newvs + sslen; - yystacksize = newsize; - yysslim = yyss + newsize - 1; - return 0; -bail: - if (yyss) - free(yyss); - if (yyvs) - free(yyvs); - yyss = yyssp = NULL; - yyvs = yyvsp = NULL; - yystacksize = 0; - return -1; -} - -#define YYABORT goto yyabort -#define YYREJECT goto yyabort -#define YYACCEPT goto yyaccept -#define YYERROR goto yyerrlab -int -yyparse(void) -{ - int yym, yyn, yystate; -#if YYDEBUG - const char *yys; - - if ((yys = getenv("YYDEBUG"))) - { - yyn = *yys; - if (yyn >= '0' && yyn <= '9') - yydebug = yyn - '0'; - } -#endif /* YYDEBUG */ - - yynerrs = 0; - yyerrflag = 0; - yychar = (-1); - - if (yyss == NULL && yygrowstack()) goto yyoverflow; - yyssp = yyss; - yyvsp = yyvs; - *yyssp = yystate = 0; - -yyloop: - if ((yyn = yydefred[yystate]) != 0) goto yyreduce; - if (yychar < 0) - { - if ((yychar = yylex()) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - } - if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, shifting to state %d\n", - YYPREFIX, yystate, yytable[yyn]); -#endif - if (yyssp >= yysslim && yygrowstack()) - { - goto yyoverflow; - } - *++yyssp = yystate = yytable[yyn]; - *++yyvsp = yylval; - yychar = (-1); - if (yyerrflag > 0) --yyerrflag; - goto yyloop; - } - if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { - yyn = yytable[yyn]; - goto yyreduce; - } - if (yyerrflag) goto yyinrecovery; -#if defined(__GNUC__) - goto yynewerror; -#endif -yynewerror: - yyerror("syntax error"); -#if defined(__GNUC__) - goto yyerrlab; -#endif -yyerrlab: - ++yynerrs; -yyinrecovery: - if (yyerrflag < 3) - { - yyerrflag = 3; - for (;;) - { - if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, error recovery shifting\ - to state %d\n", YYPREFIX, *yyssp, yytable[yyn]); -#endif - if (yyssp >= yysslim && yygrowstack()) - { - goto yyoverflow; - } - *++yyssp = yystate = yytable[yyn]; - *++yyvsp = yylval; - goto yyloop; - } - else - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: error recovery discarding state %d\n", - YYPREFIX, *yyssp); -#endif - if (yyssp <= yyss) goto yyabort; - --yyssp; - --yyvsp; - } - } - } - else - { - if (yychar == 0) goto yyabort; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, error recovery discards token %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - yychar = (-1); - goto yyloop; - } -yyreduce: -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, reducing by rule %d (%s)\n", - YYPREFIX, yystate, yyn, yyrule[yyn]); -#endif - yym = yylen[yyn]; - if (yym) - yyval = yyvsp[1-yym]; - else - memset(&yyval, 0, sizeof yyval); - switch (yyn) - { -case 8: -#line 146 "gram.y" -{ AddIconRegion(yyvsp[-4].ptr, yyvsp[-3].num, yyvsp[-2].num, yyvsp[-1].num, yyvsp[0].num); } -break; -case 9: -#line 147 "gram.y" -{ if (Scr->FirstTime) - { - Scr->DoZoom = TRUE; - Scr->ZoomCount = yyvsp[0].num; - } - } -break; -case 10: -#line 153 "gram.y" -{ if (Scr->FirstTime) - Scr->DoZoom = TRUE; } -break; -case 11: -#line 155 "gram.y" -{} -break; -case 12: -#line 156 "gram.y" -{ - GotTitleButton (yyvsp[-2].ptr, yyvsp[0].num, False); - } -break; -case 13: -#line 159 "gram.y" -{ - GotTitleButton (yyvsp[-2].ptr, yyvsp[0].num, True); - } -break; -case 14: -#line 162 "gram.y" -{ root = GetRoot(yyvsp[0].ptr, NULLSTR, NULLSTR); - Scr->Mouse[yyvsp[-1].num][C_ROOT][0].func = F_MENU; - Scr->Mouse[yyvsp[-1].num][C_ROOT][0].menu = root; - } -break; -case 15: -#line 166 "gram.y" -{ Scr->Mouse[yyvsp[-1].num][C_ROOT][0].func = yyvsp[0].num; - if (yyvsp[0].num == F_MENU) - { - pull->prev = NULL; - Scr->Mouse[yyvsp[-1].num][C_ROOT][0].menu = pull; - } - else - { - root = GetRoot(TWM_ROOT,NULLSTR,NULLSTR); - Scr->Mouse[yyvsp[-1].num][C_ROOT][0].item = - AddToMenu(root,"x",Action, - NULL,yyvsp[0].num,NULLSTR,NULLSTR); - } - Action = ""; - pull = NULL; - } -break; -case 16: -#line 182 "gram.y" -{ GotKey(yyvsp[-1].ptr, yyvsp[0].num); } -break; -case 17: -#line 183 "gram.y" -{ GotButton(yyvsp[-1].num, yyvsp[0].num); } -break; -case 18: -#line 184 "gram.y" -{ list = &Scr->NoStackModeL; } -break; -case 20: -#line 186 "gram.y" -{ if (Scr->FirstTime) - Scr->StackMode = FALSE; } -break; -case 21: -#line 188 "gram.y" -{ list = &Scr->NoTitle; } -break; -case 23: -#line 190 "gram.y" -{ if (Scr->FirstTime) - Scr->NoTitlebar = TRUE; } -break; -case 24: -#line 192 "gram.y" -{ list = &Scr->MakeTitle; } -break; -case 26: -#line 194 "gram.y" -{ list = &Scr->StartIconified; } -break; -case 28: -#line 196 "gram.y" -{ list = &Scr->AutoRaise; } -break; -case 30: -#line 198 "gram.y" -{ - root = GetRoot(yyvsp[-5].ptr, yyvsp[-3].ptr, yyvsp[-1].ptr); } -break; -case 31: -#line 200 "gram.y" -{ root->real_menu = TRUE;} -break; -case 32: -#line 201 "gram.y" -{ root = GetRoot(yyvsp[0].ptr, NULLSTR, NULLSTR); } -break; -case 33: -#line 202 "gram.y" -{ root->real_menu = TRUE; } -break; -case 34: -#line 203 "gram.y" -{ root = GetRoot(yyvsp[0].ptr, NULLSTR, NULLSTR); } -break; -case 36: -#line 205 "gram.y" -{ list = &Scr->IconNames; } -break; -case 38: -#line 207 "gram.y" -{ color = COLOR; } -break; -case 40: -#line 209 "gram.y" -{ color = GRAYSCALE; } -break; -case 43: -#line 213 "gram.y" -{ color = MONOCHROME; } -break; -case 45: -#line 215 "gram.y" -{ Scr->DefaultFunction.func = yyvsp[0].num; - if (yyvsp[0].num == F_MENU) - { - pull->prev = NULL; - Scr->DefaultFunction.menu = pull; - } - else - { - root = GetRoot(TWM_ROOT,NULLSTR,NULLSTR); - Scr->DefaultFunction.item = - AddToMenu(root,"x",Action, - NULL,yyvsp[0].num, NULLSTR, NULLSTR); - } - Action = ""; - pull = NULL; - } -break; -case 46: -#line 231 "gram.y" -{ Scr->WindowFunction.func = yyvsp[0].num; - root = GetRoot(TWM_ROOT,NULLSTR,NULLSTR); - Scr->WindowFunction.item = - AddToMenu(root,"x",Action, - NULL,yyvsp[0].num, NULLSTR, NULLSTR); - Action = ""; - pull = NULL; - } -break; -case 47: -#line 239 "gram.y" -{ list = &Scr->WarpCursorL; } -break; -case 49: -#line 241 "gram.y" -{ if (Scr->FirstTime) - Scr->WarpCursor = TRUE; } -break; -case 50: -#line 243 "gram.y" -{ list = &Scr->WindowRingL; } -break; -case 52: -#line 248 "gram.y" -{ if (!do_single_keyword (yyvsp[0].num)) { - twmrc_error_prefix(); - fprintf (stderr, - "unknown singleton keyword %d\n", - yyvsp[0].num); - ParseError = 1; - } - } -break; -case 53: -#line 258 "gram.y" -{ if (!do_string_keyword (yyvsp[-1].num, yyvsp[0].ptr)) { - twmrc_error_prefix(); - fprintf (stderr, - "unknown string keyword %d (value \"%s\")\n", - yyvsp[-1].num, yyvsp[0].ptr); - ParseError = 1; - } - } -break; -case 54: -#line 268 "gram.y" -{ if (!do_number_keyword (yyvsp[-1].num, yyvsp[0].num)) { - twmrc_error_prefix(); - fprintf (stderr, - "unknown numeric keyword %d (value %d)\n", - yyvsp[-1].num, yyvsp[0].num); - ParseError = 1; - } - } -break; -case 55: -#line 280 "gram.y" -{ yyval.num = yyvsp[0].num; } -break; -case 56: -#line 283 "gram.y" -{ yyval.num = yyvsp[0].num; } -break; -case 59: -#line 290 "gram.y" -{ mods |= Mod1Mask; } -break; -case 60: -#line 291 "gram.y" -{ mods |= ShiftMask; } -break; -case 61: -#line 292 "gram.y" -{ mods |= LockMask; } -break; -case 62: -#line 293 "gram.y" -{ mods |= ControlMask; } -break; -case 63: -#line 294 "gram.y" -{ if (yyvsp[0].num < 1 || yyvsp[0].num > 5) { - twmrc_error_prefix(); - fprintf (stderr, - "bad modifier number (%d), must be 1-5\n", - yyvsp[0].num); - ParseError = 1; - } else { - mods |= (Mod1Mask << (yyvsp[0].num - 1)); - } - } -break; -case 64: -#line 304 "gram.y" -{ } -break; -case 67: -#line 311 "gram.y" -{ cont |= C_WINDOW_BIT; } -break; -case 68: -#line 312 "gram.y" -{ cont |= C_TITLE_BIT; } -break; -case 69: -#line 313 "gram.y" -{ cont |= C_ICON_BIT; } -break; -case 70: -#line 314 "gram.y" -{ cont |= C_ROOT_BIT; } -break; -case 71: -#line 315 "gram.y" -{ cont |= C_FRAME_BIT; } -break; -case 72: -#line 316 "gram.y" -{ cont |= C_ALL_BITS; } -break; -case 73: -#line 317 "gram.y" -{ } -break; -case 76: -#line 324 "gram.y" -{ cont |= C_WINDOW_BIT; } -break; -case 77: -#line 325 "gram.y" -{ cont |= C_TITLE_BIT; } -break; -case 78: -#line 326 "gram.y" -{ cont |= C_ICON_BIT; } -break; -case 79: -#line 327 "gram.y" -{ cont |= C_ROOT_BIT; } -break; -case 80: -#line 328 "gram.y" -{ cont |= C_FRAME_BIT; } -break; -case 81: -#line 329 "gram.y" -{ cont |= C_ALL_BITS; } -break; -case 82: -#line 330 "gram.y" -{ } -break; -case 83: -#line 331 "gram.y" -{ Name = yyvsp[0].ptr; cont |= C_NAME_BIT; } -break; -case 87: -#line 341 "gram.y" -{ - NewBitmapCursor(&Scr->FrameCursor, yyvsp[-1].ptr, yyvsp[0].ptr); } -break; -case 88: -#line 343 "gram.y" -{ - NewFontCursor(&Scr->FrameCursor, yyvsp[0].ptr); } -break; -case 89: -#line 345 "gram.y" -{ - NewBitmapCursor(&Scr->TitleCursor, yyvsp[-1].ptr, yyvsp[0].ptr); } -break; -case 90: -#line 347 "gram.y" -{ - NewFontCursor(&Scr->TitleCursor, yyvsp[0].ptr); } -break; -case 91: -#line 349 "gram.y" -{ - NewBitmapCursor(&Scr->IconCursor, yyvsp[-1].ptr, yyvsp[0].ptr); } -break; -case 92: -#line 351 "gram.y" -{ - NewFontCursor(&Scr->IconCursor, yyvsp[0].ptr); } -break; -case 93: -#line 353 "gram.y" -{ - NewBitmapCursor(&Scr->ButtonCursor, yyvsp[-1].ptr, yyvsp[0].ptr); } -break; -case 94: -#line 355 "gram.y" -{ - NewFontCursor(&Scr->ButtonCursor, yyvsp[0].ptr); } -break; -case 95: -#line 357 "gram.y" -{ - NewBitmapCursor(&Scr->MoveCursor, yyvsp[-1].ptr, yyvsp[0].ptr); } -break; -case 96: -#line 359 "gram.y" -{ - NewFontCursor(&Scr->MoveCursor, yyvsp[0].ptr); } -break; -case 97: -#line 361 "gram.y" -{ - NewBitmapCursor(&Scr->ResizeCursor, yyvsp[-1].ptr, yyvsp[0].ptr); } -break; -case 98: -#line 363 "gram.y" -{ - NewFontCursor(&Scr->ResizeCursor, yyvsp[0].ptr); } -break; -case 99: -#line 365 "gram.y" -{ - NewBitmapCursor(&Scr->WaitCursor, yyvsp[-1].ptr, yyvsp[0].ptr); } -break; -case 100: -#line 367 "gram.y" -{ - NewFontCursor(&Scr->WaitCursor, yyvsp[0].ptr); } -break; -case 101: -#line 369 "gram.y" -{ - NewBitmapCursor(&Scr->MenuCursor, yyvsp[-1].ptr, yyvsp[0].ptr); } -break; -case 102: -#line 371 "gram.y" -{ - NewFontCursor(&Scr->MenuCursor, yyvsp[0].ptr); } -break; -case 103: -#line 373 "gram.y" -{ - NewBitmapCursor(&Scr->SelectCursor, yyvsp[-1].ptr, yyvsp[0].ptr); } -break; -case 104: -#line 375 "gram.y" -{ - NewFontCursor(&Scr->SelectCursor, yyvsp[0].ptr); } -break; -case 105: -#line 377 "gram.y" -{ - NewBitmapCursor(&Scr->DestroyCursor, yyvsp[-1].ptr, yyvsp[0].ptr); } -break; -case 106: -#line 379 "gram.y" -{ - NewFontCursor(&Scr->DestroyCursor, yyvsp[0].ptr); } -break; -case 110: -#line 391 "gram.y" -{ if (!do_colorlist_keyword (yyvsp[-1].num, color, - yyvsp[0].ptr)) { - twmrc_error_prefix(); - fprintf (stderr, - "unhandled list color keyword %d (string \"%s\")\n", - yyvsp[-1].num, yyvsp[0].ptr); - ParseError = 1; - } - } -break; -case 111: -#line 400 "gram.y" -{ list = do_colorlist_keyword(yyvsp[-1].num, color, - yyvsp[0].ptr); - if (!list) { - twmrc_error_prefix(); - fprintf (stderr, - "unhandled color list keyword %d (string \"%s\")\n", - yyvsp[-1].num, yyvsp[0].ptr); - ParseError = 1; - } - } -break; -case 112: -#line 410 "gram.y" -{ /* No action */; } -break; -case 113: -#line 411 "gram.y" -{ if (!do_color_keyword (yyvsp[-1].num, color, - yyvsp[0].ptr)) { - twmrc_error_prefix(); - fprintf (stderr, - "unhandled color keyword %d (string \"%s\")\n", - yyvsp[-1].num, yyvsp[0].ptr); - ParseError = 1; - } - } -break; -case 117: -#line 429 "gram.y" -{ do_string_savecolor(color, yyvsp[0].ptr); } -break; -case 118: -#line 430 "gram.y" -{ do_var_savecolor(yyvsp[0].num); } -break; -case 122: -#line 440 "gram.y" -{ if (Scr->FirstTime && - color == Scr->Monochrome) - AddToList(list, yyvsp[-1].ptr, yyvsp[0].ptr); } -break; -case 126: -#line 452 "gram.y" -{ if (Scr->FirstTime) - AddToList(list, yyvsp[0].ptr, 0); - } -break; -case 130: -#line 464 "gram.y" -{ if (Scr->FirstTime) AddToList(list, yyvsp[-1].ptr, yyvsp[0].ptr); } -break; -case 134: -#line 474 "gram.y" -{ AddToMenu(root, "", Action, NULL, yyvsp[0].num, - NULLSTR, NULLSTR); - Action = ""; - } -break; -case 138: -#line 487 "gram.y" -{ AddToMenu(root, yyvsp[-1].ptr, Action, pull, yyvsp[0].num, - NULLSTR, NULLSTR); - Action = ""; - pull = NULL; - } -break; -case 139: -#line 492 "gram.y" -{ - AddToMenu(root, yyvsp[-6].ptr, Action, pull, yyvsp[0].num, - yyvsp[-4].ptr, yyvsp[-2].ptr); - Action = ""; - pull = NULL; - } -break; -case 140: -#line 500 "gram.y" -{ yyval.num = yyvsp[0].num; } -break; -case 141: -#line 501 "gram.y" -{ - yyval.num = yyvsp[-1].num; - Action = yyvsp[0].ptr; - switch (yyvsp[-1].num) { - case F_MENU: - pull = GetRoot (yyvsp[0].ptr, NULLSTR,NULLSTR); - pull->prev = root; - break; - case F_WARPRING: - if (!CheckWarpRingArg (Action)) { - twmrc_error_prefix(); - fprintf (stderr, - "ignoring invalid f.warptoring argument \"%s\"\n", - Action); - yyval.num = F_NOP; - } - case F_WARPTOSCREEN: - if (!CheckWarpScreenArg (Action)) { - twmrc_error_prefix(); - fprintf (stderr, - "ignoring invalid f.warptoscreen argument \"%s\"\n", - Action); - yyval.num = F_NOP; - } - break; - case F_COLORMAP: - if (CheckColormapArg (Action)) { - yyval.num = F_COLORMAP; - } else { - twmrc_error_prefix(); - fprintf (stderr, - "ignoring invalid f.colormap argument \"%s\"\n", - Action); - yyval.num = F_NOP; - } - break; - } /* end switch */ - } -break; -case 142: -#line 542 "gram.y" -{ yyval.num = yyvsp[0].num; } -break; -case 143: -#line 543 "gram.y" -{ yyval.num = yyvsp[0].num; } -break; -case 144: -#line 544 "gram.y" -{ yyval.num = -(yyvsp[0].num); } -break; -case 145: -#line 547 "gram.y" -{ yyval.num = yyvsp[0].num; - if (yyvsp[0].num == 0) - yyerror("bad button 0"); - - if (yyvsp[0].num > MAX_BUTTONS) - { - yyval.num = 0; - yyerror("button number too large"); - } - } -break; -case 146: -#line 559 "gram.y" -{ ptr = strdup(yyvsp[0].ptr); - RemoveDQuote(ptr); - yyval.ptr = ptr; - } -break; -case 147: -#line 564 "gram.y" -{ yyval.num = yyvsp[0].num; } -break; -#line 1579 "gram.c" - } - yyssp -= yym; - yystate = *yyssp; - yyvsp -= yym; - yym = yylhs[yyn]; - if (yystate == 0 && yym == 0) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state 0 to\ - state %d\n", YYPREFIX, YYFINAL); -#endif - yystate = YYFINAL; - *++yyssp = YYFINAL; - *++yyvsp = yyval; - if (yychar < 0) - { - if ((yychar = yylex()) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, YYFINAL, yychar, yys); - } -#endif - } - if (yychar == 0) goto yyaccept; - goto yyloop; - } - if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yystate) - yystate = yytable[yyn]; - else - yystate = yydgoto[yym]; -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state %d \ -to state %d\n", YYPREFIX, *yyssp, yystate); -#endif - if (yyssp >= yysslim && yygrowstack()) - { - goto yyoverflow; - } - *++yyssp = yystate; - *++yyvsp = yyval; - goto yyloop; -yyoverflow: - yyerror("yacc stack overflow"); -yyabort: - if (yyss) - free(yyss); - if (yyvs) - free(yyvs); - yyss = yyssp = NULL; - yyvs = yyvsp = NULL; - yystacksize = 0; - return (1); -yyaccept: - if (yyss) - free(yyss); - if (yyvs) - free(yyvs); - yyss = yyssp = NULL; - yyvs = yyvsp = NULL; - yystacksize = 0; - return (0); -} diff --git a/src/gram.h b/src/gram.h index 00e47ae..3c7b71d 100644 --- a/src/gram.h +++ b/src/gram.h @@ -1,68 +1,193 @@ -#define LB 257 -#define RB 258 -#define LP 259 -#define RP 260 -#define MENUS 261 -#define MENU 262 -#define BUTTON 263 -#define DEFAULT_FUNCTION 264 -#define PLUS 265 -#define MINUS 266 -#define ALL 267 -#define OR 268 -#define CURSORS 269 -#define ICONS 270 -#define COLOR 271 -#define SAVECOLOR 272 -#define MONOCHROME 273 -#define FUNCTION 274 -#define WINDOW_FUNCTION 275 -#define ZOOM 276 -#define MAKE_TITLE 277 -#define GRAYSCALE 278 -#define NO_TITLE 279 -#define AUTO_RAISE 280 -#define ICON_REGION 281 -#define META 282 -#define SHIFT 283 -#define LOCK 284 -#define CONTROL 285 -#define WINDOW 286 -#define TITLE 287 -#define ICON 288 -#define ROOT 289 -#define FRAME 290 -#define COLON 291 -#define EQUALS 292 -#define START_ICONIFIED 293 -#define MOVE 294 -#define RESIZE 295 -#define WAIT 296 -#define SELECT 297 -#define KILL 298 -#define LEFT_TITLEBUTTON 299 -#define RIGHT_TITLEBUTTON 300 -#define NUMBER 301 -#define KEYWORD 302 -#define NKEYWORD 303 -#define CKEYWORD 304 -#define CLKEYWORD 305 -#define FKEYWORD 306 -#define FSKEYWORD 307 -#define SKEYWORD 308 -#define DKEYWORD 309 -#define JKEYWORD 310 -#define WINDOW_RING 311 -#define WARP_CURSOR 312 -#define ERRORTOKEN 313 -#define NO_STACKMODE 314 -#define STRING 315 -#ifndef YYSTYPE_DEFINED -#define YYSTYPE_DEFINED -typedef union +/* A Bison parser, made by GNU Bison 3.0.4. */ + +/* Bison interface for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + 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 + 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 . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + 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. */ + +#ifndef YY_YY_GRAM_H_INCLUDED +# define YY_YY_GRAM_H_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif +#if YYDEBUG +extern int yydebug; +#endif + +/* Token type. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + enum yytokentype + { + LB = 258, + RB = 259, + LP = 260, + RP = 261, + MENUS = 262, + MENU = 263, + BUTTON = 264, + DEFAULT_FUNCTION = 265, + PLUS = 266, + MINUS = 267, + ALL = 268, + OR = 269, + CURSORS = 270, + ICONS = 271, + COLOR = 272, + SAVECOLOR = 273, + MONOCHROME = 274, + FUNCTION = 275, + WINDOW_FUNCTION = 276, + ZOOM = 277, + MAKE_TITLE = 278, + GRAYSCALE = 279, + NO_TITLE = 280, + AUTO_RAISE = 281, + ICON_REGION = 282, + META = 283, + SHIFT = 284, + LOCK = 285, + CONTROL = 286, + WINDOW = 287, + TITLE = 288, + ICON = 289, + ROOT = 290, + FRAME = 291, + COLON = 292, + EQUALS = 293, + START_ICONIFIED = 294, + MOVE = 295, + RESIZE = 296, + WAIT = 297, + SELECT = 298, + KILL = 299, + LEFT_TITLEBUTTON = 300, + RIGHT_TITLEBUTTON = 301, + NUMBER = 302, + KEYWORD = 303, + NKEYWORD = 304, + CKEYWORD = 305, + CLKEYWORD = 306, + FKEYWORD = 307, + FSKEYWORD = 308, + SKEYWORD = 309, + DKEYWORD = 310, + JKEYWORD = 311, + WINDOW_RING = 312, + WARP_CURSOR = 313, + ERRORTOKEN = 314, + NO_STACKMODE = 315, + STRING = 316 + }; +#endif +/* Tokens. */ +#define LB 258 +#define RB 259 +#define LP 260 +#define RP 261 +#define MENUS 262 +#define MENU 263 +#define BUTTON 264 +#define DEFAULT_FUNCTION 265 +#define PLUS 266 +#define MINUS 267 +#define ALL 268 +#define OR 269 +#define CURSORS 270 +#define ICONS 271 +#define COLOR 272 +#define SAVECOLOR 273 +#define MONOCHROME 274 +#define FUNCTION 275 +#define WINDOW_FUNCTION 276 +#define ZOOM 277 +#define MAKE_TITLE 278 +#define GRAYSCALE 279 +#define NO_TITLE 280 +#define AUTO_RAISE 281 +#define ICON_REGION 282 +#define META 283 +#define SHIFT 284 +#define LOCK 285 +#define CONTROL 286 +#define WINDOW 287 +#define TITLE 288 +#define ICON 289 +#define ROOT 290 +#define FRAME 291 +#define COLON 292 +#define EQUALS 293 +#define START_ICONIFIED 294 +#define MOVE 295 +#define RESIZE 296 +#define WAIT 297 +#define SELECT 298 +#define KILL 299 +#define LEFT_TITLEBUTTON 300 +#define RIGHT_TITLEBUTTON 301 +#define NUMBER 302 +#define KEYWORD 303 +#define NKEYWORD 304 +#define CKEYWORD 305 +#define CLKEYWORD 306 +#define FKEYWORD 307 +#define FSKEYWORD 308 +#define SKEYWORD 309 +#define DKEYWORD 310 +#define JKEYWORD 311 +#define WINDOW_RING 312 +#define WARP_CURSOR 313 +#define ERRORTOKEN 314 +#define NO_STACKMODE 315 +#define STRING 316 + +/* Value type. */ +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED + +union YYSTYPE { +#line 106 "gram.y" /* yacc.c:1909 */ + int num; char *ptr; -} YYSTYPE; -#endif /* YYSTYPE_DEFINED */ + +#line 181 "gram.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_GRAM_H_INCLUDED */ diff --git a/src/gram.y b/src/gram.y index 6612b3e..b1f060b 100644 --- a/src/gram.y +++ b/src/gram.y @@ -74,7 +74,6 @@ in this Software without prior written authorization from The Open Group. #include "screen.h" #include "parse.h" #include "add_window.h" -#include "icons.h" #include #include @@ -142,8 +141,6 @@ stmt : error | noarg | sarg | narg - | ICON_REGION string DKEYWORD DKEYWORD number number - { AddIconRegion($2, $3, $4, $5, $6); } | ZOOM number { if (Scr->FirstTime) { Scr->DoZoom = TRUE; diff --git a/src/icons.c b/src/icons.cc similarity index 60% rename from src/icons.c rename to src/icons.cc index 344c8f0..b7e8f78 100644 --- a/src/icons.c +++ b/src/icons.cc @@ -31,7 +31,9 @@ in this Software without prior written authorization from The Open Group. * **********************************************************************/ +#include #include +#include #include "twm.h" #include "screen.h" #include "icons.h" @@ -39,97 +41,75 @@ in this Software without prior written authorization from The Open Group. #include "parse.h" #include "util.h" +using namespace std; + +// TODO: initialize at runtime. Per screen unless you simplify to only one screen allowed. +const int icon_area_x = 1600; // big enough area for my xclock to look like an icon, not be stacked on. +const int icon_pad = 10; + #define iconWidth(w) (BW2 + w->icon_w_width) #define iconHeight(w) (BW2 + w->icon_w_height) -static void splitEntry ( IconEntry *ie, int grav1, int grav2, int w, int h ); -static IconEntry * FindIconEntry ( TwmWindow *tmp_win, IconRegion **irp ); -static IconEntry * prevIconEntry ( IconEntry *ie, IconRegion *ir ); -static void mergeEntries ( IconEntry *old, IconEntry *ie ); - -static void -splitEntry (IconEntry *ie, int grav1, int grav2, int w, int h) -{ - IconEntry *new; - - switch (grav1) { - case D_NORTH: - case D_SOUTH: - if (w != ie->w) - splitEntry (ie, grav2, grav1, w, ie->h); - if (h != ie->h) { - new = malloc (sizeof (IconEntry)); - new->twm_win = 0; - new->used = 0; - new->next = ie->next; - ie->next = new; - new->x = ie->x; - new->h = (ie->h - h); - new->w = ie->w; - ie->h = h; - if (grav1 == D_SOUTH) { - new->y = ie->y; - ie->y = new->y + new->h; - } else - new->y = ie->y + ie->h; - } - break; - case D_EAST: - case D_WEST: - if (h != ie->h) - splitEntry (ie, grav2, grav1, ie->w, h); - if (w != ie->w) { - new = malloc (sizeof (IconEntry)); - new->twm_win = 0; - new->used = 0; - new->next = ie->next; - ie->next = new; - new->y = ie->y; - new->w = (ie->w - w); - new->h = ie->h; - ie->w = w; - if (grav1 == D_EAST) { - new->x = ie->x; - ie->x = new->x + new->w; - } else - new->x = ie->x + ie->w; - } - break; - } -} - static inline int roundUp (int v, int multiple) { return ((v + multiple - 1) / multiple) * multiple; } +struct Span { + int p1, p2; +}; +inline bool operator<(Span a, Span b) +{ + return a.p1 == b.p1 && a.p2 < b.p2 || a.p1 < b.p1; +} + static void PlaceIcon(TwmWindow *tmp_win, int def_x, int def_y, int *final_x, int *final_y) { - IconRegion *ir; - IconEntry *ie; - int w = 0, h = 0; + // Try to place in a gap on the right side. - ie = 0; - for (ir = Scr->FirstRegion; ir; ir = ir->next) { - w = roundUp (iconWidth (tmp_win), ir->stepx); - h = roundUp (iconHeight (tmp_win), ir->stepy); - for (ie = ir->entries; ie; ie=ie->next) { - if (ie->used) - continue; - if (ie->w >= w && ie->h >= h) - break; + Window root, parent; + Window* children; + unsigned int nchildren; + XWindowAttributes attr; + int y = 0; + if (XQueryTree(dpy, Scr->Root, &root, &parent, &children, &nchildren)) { + XArray childarray(children, nchildren); + vector occupied; + for (Window w : childarray) { + if (XGetWindowAttributes(dpy, w, &attr)) { + // w looks like icon? + if (attr.map_state != IsUnmapped + && attr.height <= 200 && attr.width <= 200 + && attr.x >= icon_area_x) { + + occupied.push_back({attr.y, attr.y + attr.height}); + } + } + } + int h = 64; + if (tmp_win->icon_height) { + h = tmp_win->icon_height; + } + + sort(occupied.begin(), occupied.end()); + int prev = 0; + for (auto span : occupied) { + if (span.p1 - prev >= h) { + if (span.p1 - prev >= h + 2*icon_pad) + y = prev + icon_pad; + else + y = prev; + break; + } + prev = span.p2; } - if (ie) - break; } - if (ie) { - splitEntry (ie, ir->grav1, ir->grav2, w, h); - ie->used = 1; - ie->twm_win = tmp_win; - *final_x = ie->x + (ie->w - iconWidth (tmp_win)) / 2; - *final_y = ie->y + (ie->h - iconHeight (tmp_win)) / 2; + + if (y) { + *final_x = icon_area_x + 20; // TODO: stick the icon roughly in the center of the space. + *final_y = y; } else { *final_x = def_x; *final_y = def_y; @@ -137,201 +117,16 @@ PlaceIcon(TwmWindow *tmp_win, int def_x, int def_y, int *final_x, int *final_y) return; } -static IconEntry * -FindIconEntry (TwmWindow *tmp_win, IconRegion **irp) -{ - IconRegion *ir; - IconEntry *ie; - - for (ir = Scr->FirstRegion; ir; ir = ir->next) { - for (ie = ir->entries; ie; ie=ie->next) - if (ie->twm_win == tmp_win) { - if (irp) - *irp = ir; - return ie; - } - } - return 0; -} - void IconUp (TwmWindow *tmp_win) { - int x, y; - int defx, defy; - struct IconRegion *ir; - - /* - * If the client specified a particular location, let's use it (this might - * want to be an option at some point). Otherwise, try to fit within the - * icon region. - */ - if (tmp_win->wmhints && (tmp_win->wmhints->flags & IconPositionHint)) - return; - - if (tmp_win->icon_moved) { - if (!XGetGeometry (dpy, tmp_win->icon_w, &JunkRoot, &defx, &defy, - &JunkWidth, &JunkHeight, &JunkBW, &JunkDepth)) - return; - - x = defx + ((int) JunkWidth) / 2; - y = defy + ((int) JunkHeight) / 2; - - for (ir = Scr->FirstRegion; ir; ir = ir->next) { - if (x >= ir->x && x < (ir->x + ir->w) && - y >= ir->y && y < (ir->y + ir->h)) - break; - } - if (!ir) return; /* outside icon regions, leave alone */ - } - - defx = -100; - defy = -100; - PlaceIcon(tmp_win, defx, defy, &x, &y); - if (x != defx || y != defy) { - XMoveWindow (dpy, tmp_win->icon_w, x, y); - tmp_win->icon_moved = FALSE; /* since we've restored it */ - } -} - -static IconEntry * -prevIconEntry (IconEntry *ie, IconRegion *ir) -{ - IconEntry *ip; - - if (ie == ir->entries) - return 0; - for (ip = ir->entries; ip->next != ie; ip=ip->next) - ; - return ip; -} - -/** - * old is being freed; and is adjacent to ie. Merge - * regions together - */ -static void -mergeEntries (IconEntry *old, IconEntry *ie) -{ - if (old->y == ie->y) { - ie->w = old->w + ie->w; - if (old->x < ie->x) - ie->x = old->x; - } else { - ie->h = old->h + ie->h; - if (old->y < ie->y) - ie->y = old->y; - } } void IconDown (TwmWindow *tmp_win) { - IconEntry *ie, *ip, *in; - IconRegion *ir; - - ie = FindIconEntry (tmp_win, &ir); - if (ie) { - ie->twm_win = 0; - ie->used = 0; - ip = prevIconEntry (ie, ir); - in = ie->next; - for (;;) { - if (ip && ip->used == 0 && - ((ip->x == ie->x && ip->w == ie->w) || - (ip->y == ie->y && ip->h == ie->h))) - { - ip->next = ie->next; - mergeEntries (ie, ip); - free (ie); - ie = ip; - ip = prevIconEntry (ip, ir); - } else if (in && in->used == 0 && - ((in->x == ie->x && in->w == ie->w) || - (in->y == ie->y && in->h == ie->h))) - { - ie->next = in->next; - mergeEntries (in, ie); - free (in); - in = ie->next; - } else - break; - } - } } -void -AddIconRegion(char *geom, int grav1, int grav2, int stepx, int stepy) -{ - IconRegion *ir; - int mask; - - ir = malloc(sizeof(IconRegion)); - ir->next = NULL; - if (Scr->LastRegion) - Scr->LastRegion->next = ir; - Scr->LastRegion = ir; - if (!Scr->FirstRegion) - Scr->FirstRegion = ir; - - ir->entries = NULL; - ir->grav1 = grav1; - ir->grav2 = grav2; - if (stepx <= 0) - stepx = 1; - if (stepy <= 0) - stepy = 1; - ir->stepx = stepx; - ir->stepy = stepy; - ir->x = ir->y = ir->w = ir->h = 0; - - mask = XParseGeometry(geom, &ir->x, &ir->y, (unsigned int *)&ir->w, (unsigned int *)&ir->h); - - if (mask & XNegative) - ir->x += Scr->MyDisplayWidth - ir->w; - - if (mask & YNegative) - ir->y += Scr->MyDisplayHeight - ir->h; - ir->entries = malloc(sizeof(IconEntry)); - ir->entries->next = 0; - ir->entries->x = ir->x; - ir->entries->y = ir->y; - ir->entries->w = ir->w; - ir->entries->h = ir->h; - ir->entries->twm_win = 0; - ir->entries->used = 0; -} - -#ifdef comment -void -FreeIconEntries (IconRegion *ir) -{ - IconEntry *ie, *tmp; - - for (ie = ir->entries; ie; ie=tmp) - { - tmp = ie->next; - free (ie); - } -} - -void -FreeIconRegions(void) -{ - IconRegion *ir, *tmp; - - for (ir = Scr->FirstRegion; ir != NULL;) - { - tmp = ir; - FreeIconEntries (ir); - ir = ir->next; - free(tmp); - } - Scr->FirstRegion = NULL; - Scr->LastRegion = NULL; -} -#endif - void CreateIconWindow(TwmWindow *tmp_win, int def_x, int def_y) { @@ -360,7 +155,7 @@ CreateIconWindow(TwmWindow *tmp_win, int def_x, int def_y) icon_name = LookInNameList(Scr->IconNames, tmp_win->full_name); if (icon_name == NULL) icon_name = LookInList(Scr->IconNames, tmp_win->full_name, - &tmp_win->class); + &tmp_win->classh); bm = None; if (icon_name != NULL) @@ -420,7 +215,7 @@ CreateIconWindow(TwmWindow *tmp_win, int def_x, int def_y) icon_name = LookInNameList(Scr->IconNames, tmp_win->full_name); if (icon_name == NULL) icon_name = LookInList(Scr->IconNames, tmp_win->full_name, - &tmp_win->class); + &tmp_win->classh); bm = None; if (icon_name != NULL) diff --git a/src/icons.h b/src/icons.h index f05e8ff..8fb1cf9 100644 --- a/src/icons.h +++ b/src/icons.h @@ -34,27 +34,14 @@ in this Software without prior written authorization from The Open Group. #ifndef ICONS_H #define ICONS_H -typedef struct IconRegion -{ - struct IconRegion *next; - int x, y, w, h; - int grav1, grav2; - int stepx, stepy; /* allocation granularity */ - struct IconEntry *entries; -} IconRegion; +#ifdef __cplusplus +#define EXTERN extern "C" +#else +#define EXTERN extern +#endif -typedef struct IconEntry -{ - struct IconEntry *next; - int x, y, w, h; - TwmWindow *twm_win; - short used; -}IconEntry; - -extern void IconUp ( TwmWindow *tmp_win ); -extern void IconDown ( TwmWindow *tmp_win ); -extern void AddIconRegion ( char *geom, int grav1, int grav2, - int stepx, int stepy ); -extern void CreateIconWindow ( TwmWindow *tmp_win, int def_x, int def_y ); +EXTERN void IconUp ( TwmWindow *tmp_win ); +EXTERN void IconDown ( TwmWindow *tmp_win ); +EXTERN void CreateIconWindow ( TwmWindow *tmp_win, int def_x, int def_y ); #endif /* ICONS_H */ diff --git a/src/list.c b/src/list.c index b43cd59..121dc71 100644 --- a/src/list.c +++ b/src/list.c @@ -117,7 +117,7 @@ AddToList(name_list **list_head, char *name, char *ptr) * \param class a pointer to the class to look for */ char * -LookInList(name_list *list_head, char *name, XClassHint *class) +LookInList(name_list *list_head, char *name, XClassHint *classh) { name_list *nptr; @@ -126,16 +126,16 @@ LookInList(name_list *list_head, char *name, XClassHint *class) if (strcmp(name, nptr->name) == 0) return (nptr->ptr); - if (class) + if (classh) { /* look for the res_name next */ for (nptr = list_head; nptr != NULL; nptr = nptr->next) - if (strcmp(class->res_name, nptr->name) == 0) + if (strcmp(classh->res_name, nptr->name) == 0) return (nptr->ptr); /* finally look for the res_class */ for (nptr = list_head; nptr != NULL; nptr = nptr->next) - if (strcmp(class->res_class, nptr->name) == 0) + if (strcmp(classh->res_class, nptr->name) == 0) return (nptr->ptr); } return (NULL); @@ -155,10 +155,10 @@ LookInNameList(name_list *list_head, char *name) * * \param list a pointer to the head of a list * \param name a pointer to the name to look for - * \param class a pointer to the class to look for + * \param classh a pointer to the class to look for * \param[out] ptr fill in the list value if the name was found */ -int GetColorFromList(name_list *list_head, char *name, XClassHint *class, +int GetColorFromList(name_list *list_head, char *name, XClassHint *classh, Pixel *ptr) { int save; @@ -174,10 +174,10 @@ int GetColorFromList(name_list *list_head, char *name, XClassHint *class, return (TRUE); } - if (class) + if (classh) { for (nptr = list_head; nptr != NULL; nptr = nptr->next) - if (strcmp(class->res_name, nptr->name) == 0) + if (strcmp(classh->res_name, nptr->name) == 0) { save = Scr->FirstTime; Scr->FirstTime = TRUE; @@ -187,7 +187,7 @@ int GetColorFromList(name_list *list_head, char *name, XClassHint *class, } for (nptr = list_head; nptr != NULL; nptr = nptr->next) - if (strcmp(class->res_class, nptr->name) == 0) + if (strcmp(classh->res_class, nptr->name) == 0) { save = Scr->FirstTime; Scr->FirstTime = TRUE; diff --git a/src/list.h b/src/list.h index ec77dfe..be30e30 100644 --- a/src/list.h +++ b/src/list.h @@ -65,16 +65,23 @@ in this Software without prior written authorization from The Open Group. #include #include + +#ifdef __cplusplus +#define EXTERN extern "C" +#else +#define EXTERN extern +#endif + typedef struct name_list_struct name_list; -extern void AddToList ( name_list **list_head, char *name, char *ptr ); -extern void FreeList ( name_list **list ); +EXTERN void AddToList ( name_list **list_head, char *name, char *ptr ); +EXTERN void FreeList ( name_list **list ); -extern int GetColorFromList ( name_list *list_head, char *name, - XClassHint *class, Pixel *ptr ); -extern char * LookInList ( name_list *list_head, char *name, - XClassHint *class ); -extern char * LookInNameList ( name_list *list_head, char *name ); +EXTERN int GetColorFromList ( name_list *list_head, char *name, + XClassHint *classh, Pixel *ptr ); +EXTERN char * LookInList ( name_list *list_head, char *name, + XClassHint *classh ); +EXTERN char * LookInNameList ( name_list *list_head, char *name ); #endif /* _LIST_ */ diff --git a/src/menus.c b/src/menus.c index f398c6f..2dc3169 100644 --- a/src/menus.c +++ b/src/menus.c @@ -2018,12 +2018,12 @@ ExecuteFunction(int func, const char *action, Window w, TwmWindow *tmp_win, } if (!t) { for (t = Scr->TwmRoot.next; t != NULL; t = t->next) { - if (!strncmp(action, t->class.res_name, len)) + if (!strncmp(action, t->classh.res_name, len)) if (WarpThere(t)) break; } if (!t) { for (t = Scr->TwmRoot.next; t != NULL; t = t->next) { - if (!strncmp(action, t->class.res_class, len)) + if (!strncmp(action, t->classh.res_class, len)) if (WarpThere(t)) break; } } @@ -2313,7 +2313,7 @@ DeIconify(TwmWindow *tmp_win) IconDown (tmp_win); } if ((Scr->WarpCursor || - LookInList(Scr->WarpCursorL, tmp_win->full_name, &tmp_win->class)) && + LookInList(Scr->WarpCursorL, tmp_win->full_name, &tmp_win->classh)) && tmp_win->icon) WarpToWindow (tmp_win); tmp_win->icon = FALSE; @@ -2451,9 +2451,9 @@ Identify (TwmWindow *t) snprintf(Info[n++], INFO_SIZE, "Name = \"%s\"", t->full_name); snprintf(Info[n++], INFO_SIZE, - "Class.res_name = \"%s\"", t->class.res_name); + "Class.res_name = \"%s\"", t->classh.res_name); snprintf(Info[n++], INFO_SIZE, - "Class.res_class = \"%s\"", t->class.res_class); + "Class.res_class = \"%s\"", t->classh.res_class); Info[n++][0] = '\0'; snprintf(Info[n++], INFO_SIZE, "Geometry/root = %dx%d+%d+%d", wwidth, wheight, x, y); diff --git a/src/screen.h b/src/screen.h index 3db1c64..7f0e261 100644 --- a/src/screen.h +++ b/src/screen.h @@ -57,7 +57,7 @@ typedef struct _TitlebarPixmaps { Pixmap resize; Pixmap question; Pixmap menu; - Pixmap delete; + Pixmap del; } TitlebarPixmaps; typedef struct ScreenInfo @@ -177,8 +177,6 @@ typedef struct ScreenInfo MyFont IconFont; /* icon font structure */ MyFont SizeFont; /* resize font structure */ MyFont DefaultFont; - struct IconRegion *FirstRegion; /* pointer to icon regions */ - struct IconRegion *LastRegion; /* pointer to the last icon region */ const char *IconDirectory; /* icon directory to search */ int SizeStringOffset; /* x offset in size window for drawing */ int SizeStringWidth; /* minimum width of size window */ diff --git a/src/session.c b/src/session.c index c6bffb6..3fea5c1 100644 --- a/src/session.c +++ b/src/session.c @@ -303,9 +303,9 @@ WriteWinConfigEntry (FILE *configFile, TwmWindow *theWindow, if (!windowRole) { - if (!write_counted_string (configFile, theWindow->class.res_name)) + if (!write_counted_string (configFile, theWindow->classh.res_name)) return 0; - if (!write_counted_string (configFile, theWindow->class.res_class)) + if (!write_counted_string (configFile, theWindow->classh.res_class)) return 0; if (theWindow->nameChanged) { @@ -397,8 +397,8 @@ ReadWinConfigEntry (FILE *configFile, unsigned short version, entry->tag = 0; entry->client_id = NULL; entry->window_role = NULL; - entry->class.res_name = NULL; - entry->class.res_class = NULL; + entry->classh.res_name = NULL; + entry->classh.res_class = NULL; entry->wm_name = NULL; entry->wm_command = NULL; entry->wm_command_count = 0; @@ -411,9 +411,9 @@ ReadWinConfigEntry (FILE *configFile, unsigned short version, if (!entry->window_role) { - if (!read_counted_string (configFile, &entry->class.res_name)) + if (!read_counted_string (configFile, &entry->classh.res_name)) goto give_up; - if (!read_counted_string (configFile, &entry->class.res_class)) + if (!read_counted_string (configFile, &entry->classh.res_class)) goto give_up; if (!read_counted_string (configFile, &entry->wm_name)) goto give_up; @@ -487,10 +487,10 @@ give_up: free (entry->client_id); if (entry->window_role) free (entry->window_role); - if (entry->class.res_name) - free (entry->class.res_name); - if (entry->class.res_class) - free (entry->class.res_class); + if (entry->classh.res_name) + free (entry->classh.res_name); + if (entry->classh.res_class) + free (entry->classh.res_class); if (entry->wm_name) free (entry->wm_name); if (entry->wm_command_count && entry->wm_command) @@ -597,10 +597,10 @@ GetWindowConfig ( * changed in the previous session. */ - if (strcmp(theWindow->class.res_name, - ptr->class.res_name) == 0 && - strcmp(theWindow->class.res_class, - ptr->class.res_class) == 0 && + if (strcmp(theWindow->classh.res_name, + ptr->classh.res_name) == 0 && + strcmp(theWindow->classh.res_class, + ptr->classh.res_class) == 0 && (ptr->wm_name == NULL || strcmp(theWindow->name, ptr->wm_name) == 0)) { diff --git a/src/twm.c b/src/twm.c index d04ccef..0350b0d 100644 --- a/src/twm.c +++ b/src/twm.c @@ -522,7 +522,7 @@ main(int argc, char *argv[]) Scr->tbpm.resize = None; Scr->tbpm.question = None; Scr->tbpm.menu = None; - Scr->tbpm.delete = None; + Scr->tbpm.del = None; InitVariables(); InitMenus(); @@ -720,8 +720,6 @@ InitVariables(void) Scr->ZoomCount = 8; Scr->Shadow = TRUE; Scr->InterpolateMenuColors = FALSE; - Scr->FirstRegion = NULL; - Scr->LastRegion = NULL; Scr->FirstTime = TRUE; Scr->HaveFonts = FALSE; /* i.e. not loaded yet */ Scr->CaseSensitive = TRUE; diff --git a/src/twm.h b/src/twm.h index 0c85150..f92d66f 100644 --- a/src/twm.h +++ b/src/twm.h @@ -247,7 +247,7 @@ typedef struct TwmWindow XSizeHints hints; /* normal hints */ XWMHints *wmhints; /* WM hints */ Window group; /* group ID */ - XClassHint class; + XClassHint classh; /*********************************************************************** * color definitions per window **********************************************************************/ @@ -299,7 +299,7 @@ typedef struct TWMWinConfigEntry int tag; char *client_id; char *window_role; - XClassHint class; + XClassHint classh; char *wm_name; int wm_command_count; char **wm_command; diff --git a/src/util.c b/src/util.c index 43d721d..4f282bc 100644 --- a/src/util.c +++ b/src/util.c @@ -879,11 +879,11 @@ CreateDotPixmap (unsigned *widthp, unsigned *heightp) if (!(h & 1)) h--; *widthp = *heightp = (unsigned int) h; - if (Scr->tbpm.delete == None) { + if (Scr->tbpm.del == None) { GC gc; Pixmap pix; - pix = Scr->tbpm.delete = XCreatePixmap (dpy, Scr->Root, h, h, 1); + pix = Scr->tbpm.del = XCreatePixmap (dpy, Scr->Root, h, h, 1); gc = XCreateGC (dpy, pix, 0L, NULL); XSetLineAttributes (dpy, gc, h, LineSolid, CapRound, JoinRound); XSetForeground (dpy, gc, 0L); @@ -892,7 +892,7 @@ CreateDotPixmap (unsigned *widthp, unsigned *heightp) XDrawLine (dpy, pix, gc, h/2, h/2, h/2, h/2); XFreeGC (dpy, gc); } - return Scr->tbpm.delete; + return Scr->tbpm.del; } #define questionmark_width 8 diff --git a/src/util.h b/src/util.h index 1649395..d4f6ce6 100644 --- a/src/util.h +++ b/src/util.h @@ -61,35 +61,41 @@ in this Software without prior written authorization from The Open Group. #ifndef _UTIL_ #define _UTIL_ -extern void MoveOutline ( Window root, int x, int y, int width, int height, +#ifdef __cplusplus +#define EXTERN extern "C" +#else +#define EXTERN extern +#endif + +EXTERN void MoveOutline ( Window root, int x, int y, int width, int height, int bw, int th ); -extern void Zoom ( Window wf, Window wt ); -extern const char * ExpandFilename ( const char *name ); -extern void GetUnknownIcon ( const char *name ); -extern Pixmap FindBitmap ( const char *name, unsigned int *widthp, +EXTERN void Zoom ( Window wf, Window wt ); +EXTERN const char * ExpandFilename ( const char *name ); +EXTERN void GetUnknownIcon ( const char *name ); +EXTERN Pixmap FindBitmap ( const char *name, unsigned int *widthp, unsigned int *heightp ); -extern Pixmap GetBitmap ( const char *name ); -extern void InsertRGBColormap ( Atom a, XStandardColormap *maps, int nmaps, +EXTERN Pixmap GetBitmap ( const char *name ); +EXTERN void InsertRGBColormap ( Atom a, XStandardColormap *maps, int nmaps, Bool replace ); -extern void RemoveRGBColormap ( Atom a ); -extern void LocateStandardColormaps ( void ); -extern void GetColor ( int kind, Pixel *what, const char *name ); -extern void GetColorValue ( int kind, XColor *what, const char *name ); -extern void GetFont ( MyFont *font ); -extern int MyFont_TextWidth( MyFont *font, const char *string, int len); -extern void MyFont_DrawImageString( Display *dpy, Drawable d, MyFont *font, +EXTERN void RemoveRGBColormap ( Atom a ); +EXTERN void LocateStandardColormaps ( void ); +EXTERN void GetColor ( int kind, Pixel *what, const char *name ); +EXTERN void GetColorValue ( int kind, XColor *what, const char *name ); +EXTERN void GetFont ( MyFont *font ); +EXTERN int MyFont_TextWidth( MyFont *font, const char *string, int len); +EXTERN void MyFont_DrawImageString( Display *dpy, Drawable d, MyFont *font, GC gc, int x, int y, const char * string, int len); -extern void MyFont_DrawString( Display *dpy, Drawable d, MyFont *font, GC gc, +EXTERN void MyFont_DrawString( Display *dpy, Drawable d, MyFont *font, GC gc, int x, int y, const char * string, int len); -extern void MyFont_ChangeGC( unsigned long fix_fore, unsigned long fix_back, +EXTERN void MyFont_ChangeGC( unsigned long fix_fore, unsigned long fix_back, MyFont *fix_font); -extern Status I18N_FetchName( Display *dpy, Window win, char **winname); -extern Status I18N_GetIconName( Display *dpy, Window win, char **iconname); -extern void SetFocus ( TwmWindow *tmp_win, Time time ); -extern void Bell ( int type, int percent, Window win ); +EXTERN Status I18N_FetchName( Display *dpy, Window win, char **winname); +EXTERN Status I18N_GetIconName( Display *dpy, Window win, char **iconname); +EXTERN void SetFocus ( TwmWindow *tmp_win, Time time ); +EXTERN void Bell ( int type, int percent, Window win ); -extern int HotX, HotY; +EXTERN int HotX, HotY; #define WM_BELL 0 #define MINOR_ERROR_BELL 1 @@ -109,4 +115,31 @@ extern int HotX, HotY; #define XkbBI_MajorError 2 #endif +#ifdef __cplusplus +template +class XArray +{ + T *array; + int sz; +public: + XArray(T * a, int s) : array{a}, sz{s} + { + } + T* begin() const + { + return array; + } + T* end() const + { + return array+sz; + } + + ~XArray() + { + XFree(array); + } +}; +#endif + + #endif /* _UTIL_ */ diff --git a/src/version.c b/src/version.c index cf06076..b0a7f6f 100644 --- a/src/version.c +++ b/src/version.c @@ -49,5 +49,5 @@ in this Software without prior written authorization from The Open Group. /** OR PERFORMANCE OF THIS SOFTWARE. **/ /*****************************************************************************/ -const char *Version = XVENDORNAME", "XORG_RELEASE; +const char *Version = "0.1";