pax_global_header00006660000000000000000000000064141062573700014517gustar00rootroot0000000000000052 comment=8c097c97808d67f0f58ec48d00487cf417cbd7da detox-1.4.5/000077500000000000000000000000001410625737000126515ustar00rootroot00000000000000detox-1.4.5/.github/000077500000000000000000000000001410625737000142115ustar00rootroot00000000000000detox-1.4.5/.github/workflows/000077500000000000000000000000001410625737000162465ustar00rootroot00000000000000detox-1.4.5/.github/workflows/regress-1.x.yml000066400000000000000000000016141410625737000210510ustar00rootroot00000000000000name: Test build and deploy process on version 1 branch on: push: branches: [ 1.x ] pull_request: branches: [ 1.x ] jobs: build-ubuntu: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 - name: autoreconf run: autoreconf --install - name: configure run: ./configure - name: make run: make - name: make check run: make check - name: legacy unit tests run: ./tests/test.sh src/detox - name: make distcheck run: make distcheck build-macos: runs-on: macos-latest steps: - uses: actions/checkout@v2 - name: brew install run: brew install automake coreutils bash - name: autoreconf run: autoreconf --install - name: configure run: ./configure - name: make run: make - name: make check run: make check - name: make distcheck run: make distcheck detox-1.4.5/.gitignore000066400000000000000000000010641410625737000146420ustar00rootroot00000000000000# Object files *.o *.ko *.obj *.elf # Precompiled Headers *.gch *.pch # Libraries *.lib *.a *.la *.lo # Shared objects (inc. Windows DLLs) *.dll *.so *.so.* *.dylib # Executables *.exe *.out *.app *.i*86 *.x86_64 *.hex # Debug files *.dSYM/ *.su # Maintainer files *.patch *~ .idea aclocal.m4 autom4te.cache/ compile depcomp install-sh missing ylwrap # Dist Clean files Makefile Makefile.in config.h config.log config.status # Clean files detox inline-detox .deps/ stamp-h1 # Testing files lab/ # Dist files /detox-*.tar.gz /detox-*.tar.bz2 /detox-*.zip detox-1.4.5/BUILD.md000066400000000000000000000037421410625737000140400ustar00rootroot00000000000000# Compilation Instructions Compilation: autoreconf --install ./configure make Installation: make install Installation that overwrites config files and translation tables: make force-install # Compilation notes Ensure that the path to lex/yacc (or an equivalent) is in your $PATH environmental variable. For instance, under Solaris, you may need to add /usr/ccs/bin to your path to get detox to compile: export PATH=${PATH}:/usr/ccs/bin --- To get detox working with long options on Darwin or Solaris (or any other OS without getopt_long in its C library), I've included support for libpopt. Install libpopt and configure with the following: ./configure --with-popt If you've installed libpopt in a directory other than /usr, which is likely, you'll want to specify the base path to libpopt. So, if popt.h is in /usr/local/include, you'll run configure like so: ./configure --with-popt=/usr/local # Release Instructions ## Testing 1. Run static analysis tools. 2. Run `make clean ; make` to rebuild `detox`. 3. Run `tests/test.sh src/detox` to perform basic regression tests. 4. Run custom external regression tests. ## Release 1. Update version at head of `CHANGELOG.md`. 2. Update version link at footer of `CHANGELOG.md`. 3. Update version in `configure.ac`. 4. Run `autoconf` or `make` to rebuild `configure`. 5. Commit and push. git diff git add -A git commit -m "Release v1.4.0" git tag git tag v1.4.0 git push git push --tags 6. Build tarballs. TAR_OPTIONS="--owner=0 --group=0 --numeric-owner" export TAR_OPTIONS make dist make dist-bzip2 make dist-zip 7. Create a new release on GitHub, using the rendered contents of the CHANGELOG, and attaching the release files. 8. Create a new release on Sourceforge, using the same items. 9. Update the "latest stable" version in README.md, if appropriate. 10. Play [Alwa's Legacy]. [Alwa's Legacy]: https://eldenpixels.com/alwas-legacy/ detox-1.4.5/CHANGELOG.md000066400000000000000000000213601410625737000144640ustar00rootroot00000000000000# CHANGELOG All notable changes to this project will be documented in this file. For releases after 1.3.0, the format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [1.4.5] - 2021-08-15 ### Fixed - Autoconf macros have been updated to support 2.70 changes. [#82] ## [1.4.4] - 2021-08-14 ### Fixed - Add explicit large file support via autoconf. [#81] ## [1.4.3] - 2021-07-24 ### Fixed - Fixed build when the `stat` struct is missing `st_blocks`. [#77] ## [1.4.2] - 2021-03-06 ### Fixed - Replaced instances of `cp -an` with `test` and `install` in the Makefile rule that copies `yyz.sample` to `yyz`. [#73] - Fixed `make distcheck`. [#73] ## [1.4.1] - 2021-02-20 ### Fixed - Fixed a memory overflow bug while reading files from the command line, using a patch from David Tardon, which was passed on by UsernameRandomlyGenerated. [#56] [#sf-patch-3] ## [1.4.0] - 2021-02-11 ### Added - Regression tests for basic functionality, based on old custom scripts. - Regression tests confirming fixes for previously fixed issues: [#14], [#19]. ### Changed - Removed one check for `.` and `..` when traversing a directory tree. [#12] - Regenerated config file parser. - Updated the safe filter to translate new lines, carriage returns, and tabs into underscores. [#9] [#11] [#17] ### Fixed - The examples in `detox.1` no longer say `-c` when they mean `-f`. [#30] - The command synopsis in `detox.1` and `inline-detox.1` no longer adds a dash before the `sequence` and `configfile`. [#30] ## [1.3.3] - 2021-02-03 ### Fixed - Fix version identifier in `detox` binary. ## [1.3.2] - 2021-01-31 ### Fixed - Table based UTF-8 translation no longer mangles characters. [#14] ## [1.3.1] - 2021-01-30 ### Fixed - Merged fix for Debian #861537, written by Vasily Kolobkov, passed on by Zenaan Harkness, Quentin Guittard, and Joao Eriberto Mota Filho. This addresses an issue with detox generating malformed characters during translation. [#14] ## [1.3.0] - 2017-03-04 - Migrated from `configure.in` and `Makefile.in` to the full autoconf suite. [#1] - Remove `detox_path.h`, in favor of command line defines. [#1] - Removed `libpopt` support. [#2] - Fixed the way `inline-detox` is generated. [#6] - Merged `parse_option_*.[ch]` and `file*.[ch]`. [#1], [#2], [#6] - Added `--inline` as an option to `detox`, to enable inline mode on the main binary. [#6] ## [1.2.1] - 2017-02-27 - Migrated documents to Markdown for better presentation on github. - Applied Debian patch `01-make-upstream-makefiles-parallel-build-safe.patch`, written by Patrick Schoenfeld and updated by Joao Eriberto Mota Filho. This adds additional variables to the `Makefile` for safe parallel builds and GCC hardening. - Applied Debian patch `02-fix-wrong-use-of-hyphens-in-manpage.patch`, written by Patrick Schoenfeld and updated by Joao Eriberto Mota Filho. This fixes an errant "-" in the manpage, and corrects a spelling mistake. - Applied Debian patch `03-remove-build-instructions-from-upstream-readme.patch`, written by Patrick Schoenfeld, in spirit. I had already converted the `README` to `README.md`, so it did not apply. I moved the compilation instructions into a new file, BUILD.md, instead. - Applied Debian patch `04-change-default-sequence-to-use-utf8-table.patch`, written by Teemu Likonen. This changes the default character set from ISO 8859-1 to UTF-8. - Applied Debian patch `05-install-missing-file.patch`, written by Nelson A. de Oliveira. This ensures that the `safe.tbl` file gets installed during `make install` (`make install-safe-config`). - Applied Debian patch `06-fix-arguments.patch`, written by Joao Eriberto Mota Filho. This fixes several calls to printf that were causing `-Werror=format-security` to fail. - Removed CVS `$Id$` tags and updated copyright. - Added `inline-detox.1`, from the Debian package, adapted from `detox.1` by Patrick Schoenfeld. - Updated `configure` script from GNU Autoconf 2.61 to 2.69. - Updated config file parsers; `flex` goes from 5.33 to 6.0, `bison` goes from 2.3 to 3.0.4. - Added a minor work around to stop compiler noise regarding `yylex()`. ## [1.2.0] - 2008-04-12 - Modified the safe filter to use a translation table. - Modified the safe filter fallback (previous functionality) to operate without any special behavior. The wipeup filter now picks up where the safe filter left off. - Fixed the default permissions on install (files are 644 now). - Updated `libpopt` support to work on Linux under the PowerPC platform (chars are unsigned by default). - Included the generated `lex` and `yacc` files in the default package. - Added additional logic to allow files on case insensitive filesystems to have their case changed. - Added the ability to set locale specific translations in the translation tables. - Added German specific translations to the translation tables. - Added the ability to ignore specific files. [sourceforge.net tracker #1253826] - Fixed a bug where directories specified on the command line wouldn't get translated. [sourceforge.net tracker #1213623] - Added support for translating large files. [sourceforge.net tracker #1509493] - Added inline-detox for stream based detoxification. ## 1.1.1 - 2005-03-13 - Modified `Makefile` to support parallel builds. - Added `${DESTDIR}` to install paths, for Gentoo package builds. - Modified the install script to not overwrite existing configuration files or translation tables. - Modified the install script to install the config file and translation tables as `".sample"` as well as the working version, for all users, but in particular, to make patching the `Makefile` easier for the FreeBSD port. ## 1.1.0 - 2005-03-05 - Added lowercase filter. - Added `libpopt` support to facilitate long options on Darwin or Solaris. - Fixed some compiler gripes with `lex`/`yacc`. - Replaced the hardcoded `-ll` in `Makefile.in` with `@LEXLIB@`. ## 1.0.0 - 2004-08-08 - Added a new filter for translating UTF-8 encoded Unicode characters. - Added handling of configuration files for controlling what sequence filters are run in. - Added handling of loadable translation tables, so the user can control how the ISO 8859-1 and Unicode filters operate. - Added a new filter for trimming based on the max length. - Added command line options: -f set config file -L list sequences -n the same as --dry-run -s set sequence - Added handling for an environmental variable `DETOX_SEQUENCE`, which sets the default sequence name. - Translation of some Icelandic characters has changed. 0xd0, 0xde, 0xf0, 0xfe, the Icelandic characters for "Eth" and "Thorn" have been changed from "D", "Y", "o", "y" to "TH" and "th". - Fixed translation of 0xfc (u), 0xfd (y) and 0xff (y). - Added `.depend` generation to the `Makefile`. - Created more man pages (`detoxrc.5` and `detox.tbl.5`). ## 0.9.1 - 2004-07-15 - Added `-d` flag to install - Broke installation out into a script to handle differences between Solaris and BSD/Linux. - Added function check for `getopt_long`. ## 0.9.0 - 2004-02-16 - Initial release [Unreleased]: https://github.com/dharple/detox/compare/v1.4.5...1.x [1.4.5]: https://github.com/dharple/detox/compare/v1.4.4...v1.4.5 [1.4.4]: https://github.com/dharple/detox/compare/v1.4.3...v1.4.4 [1.4.3]: https://github.com/dharple/detox/compare/v1.4.2...v1.4.3 [1.4.2]: https://github.com/dharple/detox/compare/v1.4.1...v1.4.2 [1.4.1]: https://github.com/dharple/detox/compare/v1.4.0...v1.4.1 [1.4.0]: https://github.com/dharple/detox/compare/v1.3.3...v1.4.0 [1.3.3]: https://github.com/dharple/detox/compare/v1.3.2...v1.3.3 [1.3.2]: https://github.com/dharple/detox/compare/v1.3.1...v1.3.2 [1.3.1]: https://github.com/dharple/detox/compare/v1.3.0...v1.3.1 [1.3.0]: https://github.com/dharple/detox/compare/v1.2.1...v1.3.0 [1.2.1]: https://github.com/dharple/detox/compare/v1.2.0...v1.2.1 [1.2.0]: https://github.com/dharple/detox/releases/tag/v1.2.0 [#82]: https://github.com/dharple/detox/issues/82 [#81]: https://github.com/dharple/detox/issues/81 [#77]: https://github.com/dharple/detox/issues/77 [#73]: https://github.com/dharple/detox/issues/73 [#56]: https://github.com/dharple/detox/issues/56 [#30]: https://github.com/dharple/detox/issues/30 [#19]: https://github.com/dharple/detox/issues/19 [#17]: https://github.com/dharple/detox/issues/17 [#14]: https://github.com/dharple/detox/issues/14 [#12]: https://github.com/dharple/detox/issues/12 [#11]: https://github.com/dharple/detox/issues/11 [#9]: https://github.com/dharple/detox/issues/9 [#6]: https://github.com/dharple/detox/issues/6 [#2]: https://github.com/dharple/detox/issues/2 [#1]: https://github.com/dharple/detox/issues/1 [#sf-patch-3]: https://sourceforge.net/p/detox/patches/3/ [mikrosimage/detox]: https://github.com/mikrosimage/detox detox-1.4.5/LICENSE000066400000000000000000000027221410625737000136610ustar00rootroot00000000000000Copyright (c) 2004-2021, Doug Harple. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. detox-1.4.5/Makefile.am000066400000000000000000000027071410625737000147130ustar00rootroot00000000000000SUBDIRS = src dist_doc_DATA = README.md dist_man1_MANS = man/detox.1 man/inline-detox.1 dist_man5_MANS = man/detox.tbl.5 man/detoxrc.5 dist_sysconf_DATA = etc/detoxrc.sample dist_pkgdata_DATA = table/iso8859_1.tbl.sample table/safe.tbl.sample table/unicode.tbl.sample install-data-hook: test -f $(DESTDIR)$(sysconfdir)/detoxrc || $(INSTALL_DATA) $(DESTDIR)$(sysconfdir)/detoxrc.sample $(DESTDIR)$(sysconfdir)/detoxrc test -f $(DESTDIR)$(pkgdatadir)/iso8859_1.tbl || $(INSTALL_DATA) $(DESTDIR)$(pkgdatadir)/iso8859_1.tbl.sample $(DESTDIR)$(pkgdatadir)/iso8859_1.tbl test -f $(DESTDIR)$(pkgdatadir)/safe.tbl || $(INSTALL_DATA) $(DESTDIR)$(pkgdatadir)/safe.tbl.sample $(DESTDIR)$(pkgdatadir)/safe.tbl test -f $(DESTDIR)$(pkgdatadir)/unicode.tbl || $(INSTALL_DATA) $(DESTDIR)$(pkgdatadir)/unicode.tbl.sample $(DESTDIR)$(pkgdatadir)/unicode.tbl .PHONY: force-install force-install: install $(INSTALL_DATA) $(DESTDIR)$(sysconfdir)/detoxrc.sample $(DESTDIR)$(sysconfdir)/detoxrc $(INSTALL_DATA) $(DESTDIR)$(pkgdatadir)/iso8859_1.tbl.sample $(DESTDIR)$(pkgdatadir)/iso8859_1.tbl $(INSTALL_DATA) $(DESTDIR)$(pkgdatadir)/safe.tbl.sample $(DESTDIR)$(pkgdatadir)/safe.tbl $(INSTALL_DATA) $(DESTDIR)$(pkgdatadir)/unicode.tbl.sample $(DESTDIR)$(pkgdatadir)/unicode.tbl uninstall-hook: rm $(DESTDIR)$(sysconfdir)/detoxrc rm $(DESTDIR)$(pkgdatadir)/iso8859_1.tbl rm $(DESTDIR)$(pkgdatadir)/safe.tbl rm $(DESTDIR)$(pkgdatadir)/unicode.tbl detox-1.4.5/README.md000066400000000000000000000020401410625737000141240ustar00rootroot00000000000000# Overview `detox` is a program that renames files to make them easier to work with under Unix and related operating systems. Spaces and various other unsafe characters (such as "$") get replaced with "_". ISO 8859-1 (Latin-1) characters can be transliterated to ASCII, as can UTF-8 characters. More details are contained in the `detox.1` man page. # Runtime Notes The most important option to learn is `-n`, aka `--dry-run`. This will let you run `detox` without actually changing any files, so that you can get an idea of what `detox` is all about. The simplest way to run `detox` is to just run it on a directory containing files that need work: detox xfer_files/ You can also just to specify the filename: detox my\ bad\ file.txt You can also specify recursion (this works best on directories): detox -r /music/transferred_from_elsewhere/ # Build To build `detox` from source, run: ``` git clone https://github.com/dharple/detox.git cd detox autoreconf --install ./configure make ``` # Contact Doug Harple detox-1.4.5/THANKS.md000066400000000000000000000050371410625737000141700ustar00rootroot00000000000000# Thanks *If I missed you, please let me know!* Thomas Klausner reminded me that `cp -n` does not work on NetBSD. David Tardon fixed a memory overflow bug, which was passed to me by UsernameRandomlyGenerated. Mplx let me know that `detox.1` had a typo in the examples. Daniel Hauck for letting me know that passing `.` as an argument was not working. Kanliot and Tyler Adams for reporting on issues with newlines and spaces causing problems. Thank you to Vasily Kolobkov, Zenaan Harkness, Quentin Guittard, Joao Eriberto Mota Filho, and Andrew Berezovskyi for the fix addressing the issue with detox generating malformed characters during a translation. Sanjaymsh added the PowerPC architecture to the Travis tests. Special thanks to Patrick Schoenfeld and Joao Eriberto Mota Filho, for maintaining the Debian version. Release v1.2.1 is almost entirely comprised of their patches. Many thanks to Miguel Angelo Rozsas for suggesting UTF-8 support and his valuable input following that suggestion. This change helped introduce translation tables into detox. Ciaran McCreesh put together a package for Gentoo (rock!), submitted a patch to add a prefix onto install paths (for package builds) and helped fix parallel builds. Lou Alfonso for suggesting that the safe filter be controlled through a table so that it can be tuned easily. Christoph Wegscheider noticed that the install script was installing everything 0755, for pointing out that not everyone has lex or yacc, and for his input on how umlauts should be converted. Gerg Thor informed me that characters on the PowerPC platform are unsigned by default and that the libpopt parser was rolling into an infinite loop as a result. Jon Amundsen pointed out that the lowercase converting sequence was only really working on case-insensitive filesystems. zero_dogg from sourceforge.net suggested adding the ability to prevent certain files from being translated. rsnemmen from sourceforge.net pointed out a bug in the way directories are handled when passed in from the command line. # Additional Thanks Eric S. Raymond for his work on "The Art of UNIX Programming" http://www.bbsinc.com/iso8859.html for their help in building a complete list of Latin-1 translations. SourceForge.net for their generous hosting of this and many other projects. http://en.wikipedia.org/wiki/UTF-8 for its help with explaining UTF-8. Data Structures Using C - Tenenbaum, Langsam and Augenstein - for their help with hashes. Paul Oakenfold for his unbelievable mixes. Version 1.0.0 was developed with the help of his Great Wall mix. detox-1.4.5/configure000077500000000000000000005351621410625737000145740ustar00rootroot00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for detox 1.4.5. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and detox.dharple at $0: gmail.com about your system, including any error $0: possibly output before this message. Then install a $0: modern shell, or manually run the script under such a $0: shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='detox' PACKAGE_TARNAME='detox' PACKAGE_VERSION='1.4.5' PACKAGE_STRING='detox 1.4.5' PACKAGE_BUGREPORT='detox.dharple at gmail.com' PACKAGE_URL='https://github.com/dharple/detox' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS EGREP GREP CPP YFLAGS YACC LEXLIB LEX_OUTPUT_ROOT LEX am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking enable_largefile ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS YACC YFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures detox 1.4.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/detox] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of detox 1.4.5:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --disable-largefile omit support for large files Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory YACC The `Yet Another Compiler Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. 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. CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . detox home page: . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF detox configure 1.4.5 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_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_c_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_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" 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_link") 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_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES # ---------------------------------------------------- # Tries to find if the field MEMBER exists in type AGGR, after including # INCLUDES, setting cache variable VAR accordingly. ac_fn_c_check_member () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 $as_echo_n "checking for $2.$3... " >&6; } if eval \${$4+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (sizeof ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" else eval "$4=no" 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 eval ac_res=\$$4 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_member # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" 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_cpp conftest.$ac_ext") 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; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; 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_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" 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_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { 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_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by detox $as_me 1.4.5, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## 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 am__api_version='1.16' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # 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]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; 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". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 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 as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # 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 rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` 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= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi 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 # 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. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; 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_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # 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_STRIP="${ac_tool_prefix}strip" $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 STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; 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_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # 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_STRIP="strip" $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_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" 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 STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk 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_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # 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_AWK="$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 AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi 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 # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 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 # Define the identity of the package. PACKAGE='detox' VERSION='1.4.5' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # 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 as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 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 if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; 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_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # 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_CC="${ac_tool_prefix}gcc" $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 CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; 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_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # 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_CC="gcc" $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_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" 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 CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; 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_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # 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_CC="${ac_tool_prefix}cc" $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 CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; 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_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no 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 if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $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 if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe 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_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # 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_CC="$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 CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe 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_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # 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_CC="$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_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" 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 CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # 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 cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" 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_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" 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_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" 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_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { 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_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj 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>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $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_c_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_c_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_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_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_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : 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 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # 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 { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } 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_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 DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 $as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } case $?:`cat confinc.out 2>/dev/null` in #( '0:this is the am__doit target') : case $s in #( BSD) : am__include='.include' am__quote='"' ;; #( *) : am__include='include' am__quote='' ;; esac ;; #( *) : ;; esac if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 $as_echo "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" 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_CC_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_CC_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_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi for ac_prog in flex lex 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_LEX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # 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_LEX="$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 LEX=$ac_cv_prog_LEX if test -n "$LEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 $as_echo "$LEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LEX" && break done test -n "$LEX" || LEX=":" if test "x$LEX" != "x:"; then cat >conftest.l <<_ACEOF %% a { ECHO; } b { REJECT; } c { yymore (); } d { yyless (1); } e { /* IRIX 6.5 flex 2.5.4 underquotes its yyless argument. */ yyless ((input () != 0)); } f { unput (yytext[0]); } . { BEGIN INITIAL; } %% #ifdef YYTEXT_POINTER extern char *yytext; #endif int main (void) { return ! yylex () + ! yywrap (); } _ACEOF { { ac_try="$LEX conftest.l" 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 "$LEX conftest.l") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5 $as_echo_n "checking lex output file root... " >&6; } if ${ac_cv_prog_lex_root+:} false; then : $as_echo_n "(cached) " >&6 else if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy else as_fn_error $? "cannot find output from $LEX; giving up" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 $as_echo "$ac_cv_prog_lex_root" >&6; } LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root if test -z "${LEXLIB+set}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5 $as_echo_n "checking lex library... " >&6; } if ${ac_cv_lib_lex+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_LIBS=$LIBS ac_cv_lib_lex='none needed' for ac_lib in '' -lfl -ll; do LIBS="$ac_lib $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_lex=$ac_lib fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext test "$ac_cv_lib_lex" != 'none needed' && break done LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 $as_echo "$ac_cv_lib_lex" >&6; } test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 $as_echo_n "checking whether yytext is a pointer... " >&6; } if ${ac_cv_prog_lex_yytext_pointer+:} false; then : $as_echo_n "(cached) " >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no ac_save_LIBS=$LIBS LIBS="$LEXLIB $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define YYTEXT_POINTER 1 `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_prog_lex_yytext_pointer=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 $as_echo "$ac_cv_prog_lex_yytext_pointer" >&6; } if test $ac_cv_prog_lex_yytext_pointer = yes; then $as_echo "#define YYTEXT_POINTER 1" >>confdefs.h fi rm -f conftest.l $LEX_OUTPUT_ROOT.c fi for ac_prog in 'bison -y' byacc 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_YACC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # 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_YACC="$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 YACC=$ac_cv_prog_YACC if test -n "$YACC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 $as_echo "$YACC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" for ac_func in getopt_long do : ac_fn_c_check_func "$LINENO" "getopt_long" "ac_cv_func_getopt_long" if test "x$ac_cv_func_getopt_long" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETOPT_LONG 1 _ACEOF fi done 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_c_check_member "$LINENO" "struct stat" "st_blocks" "ac_cv_member_struct_stat_st_blocks" "$ac_includes_default" if test "x$ac_cv_member_struct_stat_st_blocks" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_BLOCKS 1 _ACEOF $as_echo "#define HAVE_ST_BLOCKS 1" >>confdefs.h else case " $LIBOBJS " in *" fileblocks.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS fileblocks.$ac_objext" ;; esac fi # Check whether --enable-largefile was given. if test "${enable_largefile+set}" = set; then : enableval=$enable_largefile; fi if test "$enable_largefile" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 $as_echo_n "checking for special C compiler options needed for large files... " >&6; } if ${ac_cv_sys_largefile_CC+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : break fi rm -f core conftest.err conftest.$ac_objext CC="$CC -n32" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_largefile_CC=' -n32'; break fi rm -f core conftest.err conftest.$ac_objext break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 $as_echo "$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } if ${ac_cv_sys_file_offset_bits+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=64; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_file_offset_bits=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 $as_echo "$ac_cv_sys_file_offset_bits" >&6; } case $ac_cv_sys_file_offset_bits in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF ;; esac rm -rf conftest* if test $ac_cv_sys_file_offset_bits = unknown; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } if ${ac_cv_sys_large_files+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_large_files=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGE_FILES 1 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_large_files=1; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_large_files=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 $as_echo "$ac_cv_sys_large_files" >&6; } case $ac_cv_sys_large_files in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _LARGE_FILES $ac_cv_sys_large_files _ACEOF ;; esac rm -rf conftest* fi fi ac_config_headers="$ac_config_headers src/config.h" ac_config_files="$ac_config_files Makefile src/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by detox $as_me 1.4.5, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to . detox home page: ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ detox config.status 1.4.5 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _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" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # 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. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. case $CONFIG_FILES in #( *\'*) : eval set x "$CONFIG_FILES" ;; #( *) : set x $CONFIG_FILES ;; #( *) : ;; esac shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`$as_dirname -- "$am_mf" || $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` am_filepart=`$as_basename -- "$am_mf" || $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` { echo "$as_me:$LINENO: cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles" >&5 (cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. Try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See \`config.log' for more details" "$LINENO" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} { am_mf=; unset am_mf;} { am_rc=; unset am_rc;} rm -f conftest-deps.mk } ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi detox-1.4.5/configure.ac000066400000000000000000000006331410625737000151410ustar00rootroot00000000000000# Process this file with autoconf to produce a configure script. AC_INIT([detox], [1.4.5], [detox.dharple at gmail.com], [], [https://github.com/dharple/detox]) AM_INIT_AUTOMAKE([foreign -Wall -Werror]) AC_PROG_CC AC_PROG_LEX([noyywrap]) AC_PROG_YACC AC_CHECK_FUNCS([getopt_long]) AC_STRUCT_ST_BLOCKS AC_SYS_LARGEFILE AC_CONFIG_HEADERS([src/config.h]) AC_CONFIG_FILES([ Makefile src/Makefile ]) AC_OUTPUT detox-1.4.5/etc/000077500000000000000000000000001410625737000134245ustar00rootroot00000000000000detox-1.4.5/etc/detoxrc.sample000066400000000000000000000017571410625737000163110ustar00rootroot00000000000000# # config file for detox(1) # # # Default sequence # sequence default { utf_8; safe; wipeup; }; # # Sequences meant primarily for detox # # transliterates ISO8859-1 into ASCII sequence "iso8859_1" { iso8859_1; safe; wipeup; }; # transliterates UTF-8 into ASCII sequence "utf_8" { utf_8; safe; wipeup; }; # decodes CGI escaped characters sequence "uncgi" { uncgi; safe; wipeup; }; # converts files to lower case sequence "lower" { iso8859_1; safe; lower; wipeup; }; # # Sequences meant primarily for inline-detox # # transliterates ISO8859-1 to ASCII sequence "iso8859_1-only" { iso8859_1; }; # transliterates UTF-8 to ASCII sequence "utf_8-only" { utf_8; }; # decodes CGI escaped characters sequence "uncgi-only" { uncgi; }; # converts files to lower case sequence "lower-only" { lower; }; # # Files to ignore (detox only) # ignore { filename ".arch-params"; filename ".evolution"; filename ".gnome"; filename ".mozilla"; filename ".themes"; filename "{arch}"; }; detox-1.4.5/man/000077500000000000000000000000001410625737000134245ustar00rootroot00000000000000detox-1.4.5/man/detox.1000066400000000000000000000077141410625737000146420ustar00rootroot00000000000000.\" .\" This file is part of the Detox package. .\" .\" Copyright (c) Doug Harple .\" .\" For the full copyright and license information, please view the LICENSE .\" file that was distributed with this source code. .\" .Dd February 11, 2021 .Dt DETOX 1 .Os .Sh NAME .Nm detox .Nd clean up filenames .Sh SYNOPSIS .Nm .Op Fl hnLrv .Op Fl s Ar sequence .Op Fl f Ar configfile .Op Fl -dry-run .Op Fl -special .Ar .Sh DESCRIPTION The .Nm utility renames files to make them easier to work with. It removes spaces and other such annoyances. It'll also translate or cleanup Latin-1 (ISO 8859-1) characters encoded in 8-bit ASCII, Unicode characters encoded in UTF-8, and CGI escaped characters. .Ss Sequences .Nm is driven by a configurable series of filters, called a sequence. Sequences are covered in more detail in .Xr detoxrc 5 and are discoverable with the .Fl L option. Some examples of default sequences are .Cm iso8859_1 and .Cm utf_8 . .Ss Options The main options: .Bl -tag -width Fl .It Fl f Ar configfile Use .Ar configfile instead of the default configuration files for loading translation sequences. No other config file will be parsed. .It Fl h -help Display helpful information. .It Fl L List the currently available sequences. When paired with .Fl v this option shows what filters are used in each sequence and any properties applied to the filters. .It Fl n -dry-run Doesn't actually change anything. This implies the .Fl v option. .It Fl r Recurse into subdirectories. .It Fl s Ar sequence Use .Ar sequence instead of default. .It Fl -special Works on special files (including links). Normally .Nm ignores these files. .It Fl v Be verbose about which files are being renamed. .It Fl V Show the current version of .Nm . .El .Ss Deprecated Options Deprecated Options are options that were available in earlier versions of .Nm but have lost their meaning and are being phased out. .Bl -tag -width Fl .It Fl -remove-trailing Removes _ and - after .'s in filenames. This was first provided in the 0.9 series of .Nm . After the introduction of sequences, it lost its meaning, as you could now determine the properties of wipeup through a particular sequence's configuration. It presently forces all instances of the wipeup filter to use remove trailing, regardless of what's actually in the config files. .El .Sh FILES .Bl -tag -width iso8859_1.tbl -compact .It Pa detoxrc The system-wide detoxrc file. .It Pa ~/.detoxrc A user's personal detoxrc. Normally it extends the system-wide detoxrc, unless .Fl f has been specified, in which case, it is ignored. .It Pa iso8859_1.tbl The default ISO 8859-1 translation table. .It Pa unicode.tbl The default Unicode (UTF-8) translation table. .El .Sh EXAMPLES .Bl -tag -width Fl .It Nm Fl s Ar iso8859_1 Fl r Fl v Fl n Pa /tmp/new_files Will run the sequence .Ar iso8859_1 recursively, listing any changes, without changing anything, on the files of .Pa /tmp/new_files . .It Nm Fl f Ar my_detoxrc Fl L Fl v Will list the sequences within .Ar my_detoxrc , showing their filters and options. .El .Sh SEE ALSO .Xr inline-detox 1 , .Xr detoxrc 5 , .Xr detox.tbl 5 . .Sh HISTORY .Nm was originally designed to clean up files that I had received from friends which had been created using other operating systems. It's trivial to create a filename with spaces, parenthesis, brackets, and ampersands under some operating systems. These have special meaning within FreeBSD and Linux, and cause problems when you go to access them. I created .Nm to clean up these files. .Sh AUTHORS .Nm was written by .An "Doug Harple" . .Sh BUGS If, after the translation of a filename is finished, a file already exists with that same name, .Nm will not rename the file. This could cause a problem with the .Cm max_length filter, if it was imperative that the files be cut down to a certain length. .Pp Long options don't work under Solaris or Darwin. .Pp An error in the config file will cause a segfault as it's going to print the offending word within the config file. detox-1.4.5/man/detox.tbl.5000066400000000000000000000032101410625737000154110ustar00rootroot00000000000000.\" .\" This file is part of the Detox package. .\" .\" Copyright (c) Doug Harple .\" .\" For the full copyright and license information, please view the LICENSE .\" file that was distributed with this source code. .\" .Dd August 3, 2004 .Dt DETOX.TBL 5 .Os .Sh NAME .Nm detox.tbl .Nd translation table for .Xr detox 1 .Sh OVERVIEW detox allows for configuration of how the ISO 8859-1 and UTF-8 (Unicode) filters operate. Through text based translation tables, it is possible to tune how these character sets are interpreted. .Sh SYNTAX The format of the translation tables is simple. There are two levels: one containing meta data and one containing the actual translations. .Bl -tag -width 0.25i .It Cm default Ar _ Default specifies the default translation for a character. An empty or nonexistent default indicates that any unknown character should fall through to the next filter. In this manner, it is possible to chain together multiple translation tables in a sequence. .It Cm start Indicates the start of a value list within the translation table. .It Cm start Ar lang Indicates the start of a language specific value list within the translation table. .It Cm end Indicates the end of a value list within the translation table. .It Ar value translation Value can be specified in decimal (1), hex (0x01) or octal (01). The same rules that apply to sscanf apply here. .Pp Translation can be a string or a quoted string, with either single or double quotes. .El .Sh EXAMPLE .Bd -literal default _ start 0x0101 a 0x0102 b end .Ed .Sh SEE ALSO .Xr detox 1 , .Xr detoxrc 5 . .Sh AUTHORS detox was written by .An "Doug Harple" . detox-1.4.5/man/detoxrc.5000066400000000000000000000150371410625737000151700ustar00rootroot00000000000000.\" .\" This file is part of the Detox package. .\" .\" Copyright (c) Doug Harple .\" .\" For the full copyright and license information, please view the LICENSE .\" file that was distributed with this source code. .\" .Dd August 3, 2004 .Dt DETOXRC 5 .Os .Sh NAME .Nm detoxrc .Nd configuration file for .Xr detox 1 .Sh OVERVIEW detox allows for configuration of its sequences through config files. This document describes how these files work. .Sh IMPORTANT When setting up a new set of rules, the .Cm safe and .Cm wipeup filters must always be run after a translating filter (or series thereof), such as the .Cm utf_8 or the .Cm uncgi filters. Otherwise, the risk of introducing illegal characters into the filename is introduced. .Sh SYNTAX The format of this configuration file is C-like. It is based loosely off named's configuration files. Each statement is semicolon terminated, and modifiers on a particular statement are generally contained within braces. .Bl -tag -width 0.25i .It Cm sequence Qo Ar name Qc Bro Ar ... Brc ; Defines a sequence of filters to run a filename through. "name" specifies how the user will refer to the particular sequence during runtime. Quotes around the sequence name are generally optional, but should be used if the sequence name does not start with a letter. .Pp There is a special sequence, named "default", which is the default sequence used by detox. This can be overridden through the command line option .Fl s or the environmental variable .Ev DETOX_SEQUENCE . .Pp Sequence names are case sensitive and unique throughout all sequences; that is, if a system wide file defines .Ar normal_seq and a user has a sequence with the same name in their .Pa .detoxrc , the users' .Ar normal_seq will take precedence. .It Cm iso8859_1 Bro Cm filename Qo Ar /path/to/filename Qc ; Brc ; This translates ISO 8859-1 (aka Latin-1) characters into lower ASCII equivalents. The output is not necessarily safe, and should also be run through the .Cm safe filter. .Pp Under normal circumstances, the filename syntax is not needed. Detox looks in several locations for a file called .Pa iso8859_1.tbl , which is a set of rules defining how an ISO 8859-1 character should be translated. .Pp In the event this table doesn't exist, you have two options. You can download or create your own, and tell detox the location of it using the filename syntax shown above, or you can let detox fall back on its internal tables. The internal tables translate the same as the stock translation tables. .Pp You can chain together multiple iso8859_1 translations, as long as the default value of all but the last one is set to nothing. This is explained in .Xr detox.tbl 5 . .Pp This filter is mutually exclusive with the .Cm utf_8 filter. .It Cm utf_8 Bro Cm filename Qo Ar /path/to/filename Qc ; Brc ; This translates Unicode characters, encoded by the UTF-8 translation method, into safe equivalents. .Pp This operates in a manner similar to .Cm iso8859_1 , except it looks for a translation table called .Pa unicode.tbl . .Pp The default internal translation for Unicode characters only contains the lower 256 characters of Unicode, which is equivalent to the set of Basic Latin and Latin-1 characters. .It Cm uncgi ; This translates CGI escaped strings into their ASCII equivalents. The output of this is not necessarily safe, and could contain ISO 8859-1 chars or potentially UTF-8 characters. .It Cm safe Bro Cm filename Qo Ar /path/to/filename Qc ; Brc ; This could also be called "safe for UNIX-like operating systems". It translates characters that are difficult to work with in UNIX environments into characters that are not. .Pp In earlier versions this filter was entirely internal. Starting with 1.2.0, this filter is controlled by a translation table. In the absence of the translation table, the previous code will be employed for the translation. Also, prior to 1.2.0, the safe filter removed leading dashes to prevent the hassle of dealing with a filename in the format .Pa -filename . This functionality is exclusively handled by the .Cm wipeup filter now. .Pp See the .Sx SAFE section for more details on what this filter translates by default. .It Cm wipeup Bro Cm remove_trailing ; Brc ; This wipes up any excessive characters. For instance, multiple underscores or dashes will be converted into a single underscore or dash. Any series of dash and underscore (i.e. "_-_") will be converted into a single dash. .Pp The remove trailing option removes a dash or underscore followed immediately by a period. .Pp See the .Sx WIPEUP section for more details on what this filter translates. .It Cm max_length Bro Cm length Ar value ; Brc ; This trims a file down to the length specified (or less). It is conscious of extensions and attempts to preserve anything following the last period in a filename. .Pp For instance, given a max length of 12, and a filename of "this_is_my_file.txt", the filter would output "this_is_.txt". .It Cm lower ; This translates uppercase characters into lowercase characters. .It Cm # Comments Any thing after a # on any line is ignored. .El .Sh EXAMPLE .Bd -literal sequence default { uncgi; iso8859_1 { filename "iso8859_1.tbl"; }; # utf_8 { # filename "unicode.tbl"; # }; safe { filename "safe.tbl"; }; wipeup { remove_trailing; }; # max_length { # length 128; # }; }; .Ed .Sh SAFE The following characters are translated by the stock .Cm safe filter. They can be tuned by updating safe.tbl or creating a copy of safe.tbl and updating your rc file. .Pp .Ss Rules that apply anywhere in the filename: .Bl -column -offset indent ".Sy Removed" ".Sy Original" .It Sy Safe Ta Sy Original .It _and_ Ta & .It _ Ta \fIspace\fR ` \&! @ $ * \e | \&: \&; \&" ' < > \&? / .It - Ta \&( \&) \&[ \&] { } .El .Pp .Sh WIPEUP The following characters are translated by the .Cm wipeup filter. .Pp .Ss Rules that apply anywhere in the filename: .Bl -column -offset indent ".Sy Wipeup" ".Sy Original" .It Sy Wipeup Ta Sy Original .It - Ta -_ .It - Ta _- .It - Ta -- .It _ Ta __ .El .Pp .Ss Rules that apply only at the beginning of a filename: Any leading dashes are stripped to prevent programs from interpreting these files as command line options. .Bl -column -offset indent ".Sy removed" ".Sy Original" .It Sy Wipeup Ta Sy Original .It \fIremoved\fR Ta - _ # .El .Ss Rules that apply when remove trailing is enabled: .Bl -column -offset indent ".Sy Wipeup" ".Sy Original" .It Sy Wipeup Ta Sy Original .It . Ta .- .It . Ta -. .It . Ta ._ .It . Ta _. .El .Pp .Sh SEE ALSO .Xr detox 1 , .Xr detox.tbl 5 . .Sh AUTHORS detox was written by .An "Doug Harple" . detox-1.4.5/man/inline-detox.1000066400000000000000000000065601410625737000161140ustar00rootroot00000000000000.\" .\" This file is part of the Detox package. .\" .\" Copyright (c) Doug Harple .\" .\" For the full copyright and license information, please view the LICENSE .\" file that was distributed with this source code. .\" .Dd February 11, 2021 .Dt DETOX 1 .Os .Sh NAME .Nm inline-detox .Nd clean up filenames (stream-based) .Sh SYNOPSIS .Nm .Op Fl hnLrv .Op Fl s Ar sequence .Op Fl f Ar configfile .Ar .Sh DESCRIPTION The .Nm utility can remove spaces and other such annoyances from streams. It'll also translate or cleanup Latin-1 (ISO 8859-1) characters encoded in 8-bit ASCII, Unicode characters encoded in UTF-8, and CGI escaped characters. Basically it's detox, but does not operate on files. .Ss Sequences .Nm is driven by a configurable series of filters, called a sequence. Sequences are covered in more detail in .Xr detoxrc 5 and are discoverable with the .Fl L option. Some examples of default sequences are .Cm iso8859_1 and .Cm utf_8 . .Ss Options The main options: .Bl -tag -width Fl .It Fl f Ar configfile Use .Ar configfile instead of the default configuration files for loading translation sequences. No other config file will be parsed. .It Fl h -help Display helpful information. .It Fl L List the currently available sequences. When paired with .Fl v this option shows what filters are used in each sequence and any properties applied to the filters. .It Fl r Recurse into subdirectories. .It Fl s Ar sequence Use .Ar sequence instead of default. .It Fl v Be verbose about which files are being renamed. .It Fl V Show the current version of .Nm . .El .Ss Deprecated Options Deprecated Options are options that were available in earlier versions of .Nm but have lost their meaning and are being phased out. .Bl -tag -width Fl .It Fl -remove-trailing Removes _ and - after .'s in filenames. This was first provided in the 0.9 series of .Nm . After the introduction of sequences, it lost its meaning, as you could now determine the properties of wipeup through a particular sequence's configuration. It presently forces all instances of the wipeup filter to use remove trailing, regardless of what's actually in the config files. .El .Sh FILES .Bl -tag -width iso8859_1.tbl -compact .It Pa detoxrc The system-wide detoxrc file. .It Pa ~/.detoxrc A user's personal detoxrc. Normally it extends the system-wide detoxrc, unless .Fl f has been specified, in which case, it is ignored. .It Pa iso8859_1.tbl The default ISO 8859-1 translation table. .It Pa unicode.tbl The default Unicode (UTF-8) translation table. .El .Sh EXAMPLES .Bl -tag -width Fl .It echo "Foo Bar" | Nm Fl s Ar iso8859_1 Fl v Will run the sequence .Ar iso8859_1 listing any changes and returning the result to STDOUT. .El .Sh SEE ALSO .Xr detox 1 , .Xr detoxrc 5 , .Xr detox.tbl 5 . .Sh HISTORY detox was originally designed to clean up files that I had received from friends which had been created using other operating systems. It's trivial to create a filename with spaces, parenthesis, brackets, and ampersands under some operating systems. These have special meaning within FreeBSD and Linux, and cause problems when you go to access them. I created .Nm to clean up these files. .Sh AUTHORS .Nm was written by .An "Doug Harple" . .Sh BUGS .Pp Long options don't work under Solaris or Darwin. .Pp An error in the config file will cause a segfault as it's going to print the offending word within the config file. detox-1.4.5/src/000077500000000000000000000000001410625737000134405ustar00rootroot00000000000000detox-1.4.5/src/Makefile.am000066400000000000000000000005611410625737000154760ustar00rootroot00000000000000BUILT_SOURCES = config_file.h AM_YFLAGS = -d AM_CPPFLAGS = -DDATADIR=\"$(datadir)\" -DSYSCONFDIR=\"$(sysconfdir)\" bin_PROGRAMS = detox inline-detox detox_SOURCES = detox.c file.c clean_string.c table.c parse_table.c config_file_yacc.y config_file_lex.l config_file_spoof.c config_file_dump.c parse_options.c inline_detox_SOURCES = $(detox_SOURCES) EXTRA_DIST = *.h detox-1.4.5/src/clean_string.c000066400000000000000000000337031410625737000162620ustar00rootroot00000000000000/** * This file is part of the Detox package. * * Copyright (c) Doug Harple * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ #include "config.h" #include #include #include #include #include #include "clean_string.h" /* translation array for ISO8859.1 characters */ #include "iso8859_1.h" /* translation array for unicode characters */ #include "unicode.h" #include "parse_table.h" #include "table.h" /* * Translates ISO8859.1 characters (Latin-1) into lower ASCII characters. */ unsigned char *clean_iso8859_1_basic(unsigned char *s, void *opts) { unsigned char *output, *input_walk, *output_walk, *replace_walk; int replace_pos; if (s == NULL) { return NULL; } output = malloc((strlen(s) * ISO8859_1_MAXLEN) + 1); if (output == NULL) { fprintf(stderr, "out of memory: %s\n", strerror(errno)); return NULL; } input_walk = s; output_walk = output; while (*input_walk != '\0') { if (*input_walk >= ISO8859_1_OFFSET) { replace_pos = *input_walk - ISO8859_1_OFFSET; replace_walk = (unsigned char *)&iso8859_1_trans[replace_pos]; while (*replace_walk != '\0') { *output_walk++ = *replace_walk++; } input_walk++; } else { *output_walk++ = *input_walk++; } } *output_walk = '\0'; return output; } /* * Translates ISO8859.1 characters (Latin-1) into lower ASCII characters. */ unsigned char *clean_iso8859_1(unsigned char *s, void *opts) { unsigned char *output, *input_walk, *output_walk, *replace_walk; struct translation_table *table = NULL; struct clean_string_options *options = NULL; if (s == NULL) { return NULL; } if (opts == NULL) { fprintf(stderr, "this shouldn't happen\n"); exit(EXIT_FAILURE); } options = (struct clean_string_options *)opts; table = options->translation_table; output = malloc((strlen(s) * table->max_data_length) + 1); if (output == NULL) { fprintf(stderr, "out of memory: %s\n", strerror(errno)); return NULL; } input_walk = s; output_walk = output; while (*input_walk != '\0') { if (*input_walk >= ISO8859_1_OFFSET) { replace_walk = table_get(table, *input_walk); if (replace_walk == NULL) { if (table->default_translation == NULL) { /* * Null translation == leave it alone */ *output_walk++ = *input_walk++; continue; } else { replace_walk = table->default_translation; } } while (*replace_walk != '\0') { *output_walk++ = *replace_walk++; } input_walk++; } else { *output_walk++ = *input_walk++; } } *output_walk = '\0'; return output; } /* * Cleans up any unsafe characters. * * The rules are: * Leave alone: * - # ~ % ^ _ , . + = * * Translate: * & into _and_ * * Replace with _: * ` ! @ $ * \ | : ; " ' < ? / '\n' '\r' '\t' * * Replace with -: * ( ) [ ] { } * */ unsigned char *clean_safe_basic(unsigned char *s, void *opts) { unsigned char *output, *input_walk, *output_walk; if (s == NULL) { return NULL; } output = malloc((strlen(s) * 5) + 1); if (output == NULL) { fprintf(stderr, "out of memory: %s\n", strerror(errno)); return NULL; } input_walk = s; output_walk = output; while (*input_walk != '\0') { if (isalnum(*input_walk)) { *output_walk++ = *input_walk++; continue; } switch (*input_walk) { case '-': case '#': case '~': case '%': case '^': case '_': case ',': case '.': case '+': case '=': *output_walk++ = *input_walk; break; case '&': *output_walk++ = '_'; *output_walk++ = 'a'; *output_walk++ = 'n'; *output_walk++ = 'd'; *output_walk++ = '_'; break; case ' ': case '`': case '!': case '@': case '$': case '*': case '\\': case '|': case ':': case ';': case '"': case '\'': case '<': case '>': case '?': case '/': case '\n': case '\r': case '\t': *output_walk++ = '_'; break; case '(': case ')': case '[': case ']': case '{': case '}': *output_walk++ = '-'; break; } input_walk++; } *output_walk = '\0'; return output; } /* * Translates unsafe characters */ unsigned char *clean_safe(unsigned char *s, void *opts) { unsigned char *output, *input_walk, *output_walk, *replace_walk; struct translation_table *table = NULL; struct clean_string_options *options = NULL; if (s == NULL) { return NULL; } if (opts == NULL) { fprintf(stderr, "this shouldn't happen\n"); exit(EXIT_FAILURE); } options = (struct clean_string_options *)opts; table = options->translation_table; output = malloc((strlen(s) * table->max_data_length) + 1); if (output == NULL) { fprintf(stderr, "out of memory: %s\n", strerror(errno)); return NULL; } input_walk = s; output_walk = output; while (*input_walk != '\0') { replace_walk = table_get(table, *input_walk); if (replace_walk == NULL) { if (table->default_translation == NULL) { /* * Null translation == leave it alone */ *output_walk++ = *input_walk++; continue; } else { replace_walk = table->default_translation; } } while (*replace_walk != '\0') { *output_walk++ = *replace_walk++; } input_walk++; } *output_walk = '\0'; return output; } /* * Cleans up any CGI encoded characters, in the form "%" followed by 2 hex * digits. */ unsigned char *clean_uncgi(unsigned char *s, void *opts) { unsigned char *output, *input_walk, *output_walk; unsigned char conv[3]; if (s == NULL) { return NULL; } output = malloc(strlen(s) + 1); if (output == NULL) { fprintf(stderr, "out of memory: %s\n", strerror(errno)); return NULL; } input_walk = s; output_walk = output; while (*input_walk != '\0') { if (input_walk[0] == '%' && isxdigit(input_walk[1]) && isxdigit(input_walk[2])) { conv[0] = input_walk[1]; conv[1] = input_walk[2]; conv[2] = 0; *output_walk++ = (unsigned char)strtol(conv, NULL, 16); input_walk += 3; } else { *output_walk++ = *input_walk++; } } *output_walk = '\0'; return output; } /* * Reduces any series of "_" and "-" to a single character. "-" takes * precedence. * * If "remove_trailing" is set to non-zero, then "." is added to the * comparison, and takes precedence. This has the effect of reducing "-." or * "._", etc, to ".". * * Strips any "-", "_" or "#" from the beginning of a string. * */ unsigned char *clean_wipeup(unsigned char *s, void *opts) { unsigned char *output, *input_walk, *output_walk; int matched; int remove_trailing; if (s == NULL) { return NULL; } remove_trailing = 0; if (opts != NULL) { remove_trailing = ((struct clean_string_options *)opts)->remove_trailing; } /* remove any -, _, or # at beginning of string */ while (*s == '-' || *s == '_' || *s == '#') { s++; } output = malloc(strlen(s) + 1); if (output == NULL) { fprintf(stderr, "out of memory: %s\n", strerror(errno)); return NULL; } input_walk = s; output_walk = output; matched = 0; while (*input_walk != '\0') { switch (*input_walk) { case '-': if (matched) { if (*output_walk == '_') { *output_walk = '-'; } } else { *output_walk = '-'; } matched = 1; break; case '_': if (!matched) { *output_walk = '_'; } matched = 1; break; case '.': if (remove_trailing) { *output_walk = '.'; matched = 1; break; } /* else fall through */ default: if (matched) { output_walk++; matched = 0; } *output_walk++ = *input_walk; } input_walk++; } if (matched) { output_walk++; } *output_walk = '\0'; return output; } #define UTF_8_ENCODED 0x80 #define UTF_8_ENCODED_4_CHARS 0xf0 #define UTF_8_ENCODED_3_CHARS 0xe0 #define UTF_8_ENCODED_2_CHARS 0xc0 /* * Translates UTF-8 characters (Unicode Translation Format - 8 Bit) into * Unicode and then lower ASCII characters. */ unsigned char *clean_utf_8_basic(unsigned char *s, void *opts) { unsigned char *output, *input_walk, *output_walk, *replace_walk; int new_value, expected_chars; if (s == NULL) { return NULL; } output = malloc((strlen(s) * UNICODE_MAXLEN) + 1); if (output == NULL) { fprintf(stderr, "out of memory: %s\n", strerror(errno)); return NULL; } input_walk = s; output_walk = output; while (*input_walk != '\0') { if ((*input_walk & UTF_8_ENCODED) == 0) { *output_walk++ = *input_walk++; continue; } new_value = 0; expected_chars = 0; /* * Needs to be done in descending orders due to the fact that * the 2 char mask will match on the 4 char mask, but not * vice versa. */ if ((*input_walk & UTF_8_ENCODED_4_CHARS) == UTF_8_ENCODED_4_CHARS) { /* * 11110aaa 10bbbbbb 10cccccc 10dddddd */ new_value = *input_walk & 0x07; expected_chars = 3; } else if ((*input_walk & UTF_8_ENCODED_3_CHARS) == UTF_8_ENCODED_3_CHARS) { /* * 1110aaaa 10bbbbbb 10cccccc */ new_value = *input_walk & 0x0f; expected_chars = 2; } else if ((*input_walk & UTF_8_ENCODED_2_CHARS) == UTF_8_ENCODED_2_CHARS) { /* * 110aaaaa 10bbbbbb */ new_value = *input_walk & 0x1f; expected_chars = 1; } else { input_walk++; continue; } while (expected_chars > 0) { new_value <<= 6; input_walk++; if (*input_walk == '\0') { new_value = -1; break; } if ((*input_walk & UTF_8_ENCODED) == 0) { new_value = -1; break; } new_value += *input_walk & 0x3f; expected_chars--; } if (new_value == -1) { continue; } if (new_value >= UNICODE_COUNT) { *output_walk++ = '_'; continue; } replace_walk = (unsigned char *)&unicode_trans[new_value]; while (*replace_walk != '\0') { *output_walk++ = *replace_walk++; } } *output_walk = '\0'; return output; } /* * Translates UTF-8 characters (Unicode Translation Format - 8 Bit) into * Unicode and then runs the translation table. */ unsigned char *clean_utf_8(unsigned char *s, void *opts) { unsigned char *output, *input_walk, *output_walk, *replace_walk; int new_value, expected_chars; struct translation_table *table = NULL; struct clean_string_options *options = NULL; int characters_eaten; if (s == NULL) { return NULL; } if (opts == NULL) { fprintf(stderr, "this shouldn't happen\n"); exit(EXIT_FAILURE); } options = (struct clean_string_options *)opts; table = options->translation_table; output = malloc((strlen(s) * table->max_data_length) + 1); if (output == NULL) { fprintf(stderr, "out of memory: %s\n", strerror(errno)); return NULL; } input_walk = s; output_walk = output; while (*input_walk != '\0') { new_value = 0; expected_chars = 0; characters_eaten = 0; /* * Needs to be done in descending orders due to the fact that * the 2 char mask will match on the 4 char mask, but not * vice versa. */ if ((*input_walk & UTF_8_ENCODED_4_CHARS) == UTF_8_ENCODED_4_CHARS) { /* * 11110aaa 10bbbbbb 10cccccc 10dddddd */ new_value = *input_walk & 0x07; expected_chars = 3; characters_eaten = 4; } else if ((*input_walk & UTF_8_ENCODED_3_CHARS) == UTF_8_ENCODED_3_CHARS) { /* * 1110aaaa 10bbbbbb 10cccccc */ new_value = *input_walk & 0x0f; expected_chars = 2; characters_eaten = 3; } else if ((*input_walk & UTF_8_ENCODED_2_CHARS) == UTF_8_ENCODED_2_CHARS) { /* * 110aaaaa 10bbbbbb */ new_value = *input_walk & 0x1f; expected_chars = 1; characters_eaten = 2; } else if ((*input_walk & UTF_8_ENCODED) == UTF_8_ENCODED) { fprintf(stderr, "unsupported unicode length\n"); exit(EXIT_FAILURE); } else { new_value = *input_walk; expected_chars = 0; characters_eaten = 1; } while (expected_chars > 0) { new_value <<= 6; input_walk++; if (*input_walk == '\0') { new_value = -1; break; } if ((*input_walk & UTF_8_ENCODED) == 0) { new_value = -1; break; } new_value += *input_walk & 0x3f; expected_chars--; } input_walk++; if (new_value == -1) { continue; } replace_walk = table_get(table, new_value); if (replace_walk == NULL) { replace_walk = table->default_translation; } if (replace_walk == NULL) { /* * Null translation == leave it alone */ input_walk -= characters_eaten; while (characters_eaten > 0) { *output_walk++ = *input_walk++; characters_eaten--; } continue; } while (*replace_walk != '\0') { *output_walk++ = *replace_walk++; } } *output_walk = '\0'; return output; } /* * Trims a file down to specified length. */ unsigned char *clean_max_length(unsigned char *s, void *opts) { unsigned char *output, *input_walk, *output_walk; size_t max_length; size_t s_length; size_t ext_length; if (s == NULL) { return NULL; } max_length = 256; if (opts != NULL) { max_length = ((struct clean_string_options *)opts)->max_length; } s_length = strlen(s); output = malloc(max_length + 1); if (output == NULL) { fprintf(stderr, "out of memory: %s\n", strerror(errno)); return NULL; } snprintf(output, max_length + 1, "%s", s); if (s_length <= max_length) { return output; } input_walk = strrchr(s, '.'); if (input_walk == NULL) { return output; } ext_length = strlen(input_walk); output_walk = output; output_walk += max_length - ext_length; while (*(output_walk - 1) == '.' && output_walk > output) { output_walk--; } snprintf(output_walk, ext_length + 1, "%s", input_walk); return output; } /* * Converts all characters to lowercase. */ unsigned char *clean_lower(unsigned char *s, void *opts) { unsigned char *output, *input_walk, *output_walk; if (s == NULL) { return NULL; } output = malloc(strlen(s) + 1); if (output == NULL) { fprintf(stderr, "out of memory: %s\n", strerror(errno)); return NULL; } input_walk = s; output_walk = output; while (*input_walk != '\0') { if (isupper(*input_walk)) { *output_walk++ = tolower(*input_walk++); } else { *output_walk++ = *input_walk++; } } *output_walk = '\0'; return output; } detox-1.4.5/src/clean_string.h000066400000000000000000000022121410625737000162560ustar00rootroot00000000000000/** * This file is part of the Detox package. * * Copyright (c) Doug Harple * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ #ifndef __CLEAN_STRING_H #define __CLEAN_STRING_H struct clean_string_options { char *filename; int remove_trailing; size_t max_length; void *misc; void *translation_table; }; extern unsigned char *clean_iso8859_1_basic(unsigned char *s, void *options); extern unsigned char *clean_iso8859_1(unsigned char *s, void *options); extern unsigned char *clean_safe_basic(unsigned char *s, void *options); extern unsigned char *clean_safe(unsigned char *s, void *options); extern unsigned char *clean_uncgi(unsigned char *s, void *options); extern unsigned char *clean_wipeup(unsigned char *s, void *options); extern unsigned char *clean_utf_8_basic(unsigned char *s, void *options); extern unsigned char *clean_utf_8(unsigned char *s, void *options); extern unsigned char *clean_max_length(unsigned char *s, void *opts); extern unsigned char *clean_lower(unsigned char *s, void *opts); #endif /* __CLEAN_STRING_H */ detox-1.4.5/src/config.h.in000066400000000000000000000041721410625737000154670ustar00rootroot00000000000000/* src/config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the `getopt_long' function. */ #undef HAVE_GETOPT_LONG /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if `st_blocks' is a member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_BLOCKS /* Define to 1 if your `struct stat' has `st_blocks'. Deprecated, use `HAVE_STRUCT_STAT_ST_BLOCKS' instead. */ #undef HAVE_ST_BLOCKS /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #undef YYTEXT_POINTER /* Enable large inode numbers on Mac OS X 10.5. */ #ifndef _DARWIN_USE_64_BIT_INODE # define _DARWIN_USE_64_BIT_INODE 1 #endif /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES detox-1.4.5/src/config_file.h000066400000000000000000000010131410625737000160500ustar00rootroot00000000000000/** * This file is part of the Detox package. * * Copyright (c) Doug Harple * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ #ifndef __CONFIG_FILE_H #define __CONFIG_FILE_H #include "detox.h" extern int config_file_lineno; extern struct detox_parse_results *parse_config_file(char *filename, struct detox_parse_results *previous_list, struct detox_options *main_options); #endif /* __CONFIG_FILE_H */ detox-1.4.5/src/config_file_dump.c000066400000000000000000000057031410625737000171020ustar00rootroot00000000000000/** * This file is part of the Detox package. * * Copyright (c) Doug Harple * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ #include "config.h" #include #include #include #include "detox.h" #include "config_file_dump.h" #include "clean_string.h" void dump_config_file(struct detox_parse_results *parse_results, struct detox_options *main_options) { struct detox_sequence_list *list_work = NULL; struct detox_sequence_entry *work = NULL; struct detox_ignore_entry *ignore_walk = NULL; if (!main_options->verbose) { printf("available sequences:\n"); } list_work = parse_results->sequences; while (list_work != NULL) { if (main_options->verbose) { printf("sequence name: "); } else { printf("\t"); } printf("%s%s\n", list_work->name, (main_options->sequence_to_use == list_work->head) ? " (*)" : ""); if (main_options->verbose) { printf("\tsource file: %s\n", list_work->source_filename); work = list_work->head; while (work != NULL) { if (work->cleaner == &clean_uncgi) { printf("\tcleaner: uncgi\n"); } else if (work->cleaner == &clean_safe) { printf("\tcleaner: safe\n"); if (work->options != NULL) { struct clean_string_options *opts = work->options; if (opts->filename != NULL) { printf("\t\ttranslation table: %s\n", opts->filename); } } } else if (work->cleaner == &clean_wipeup) { printf("\tcleaner: wipeup\n"); if (work->options != NULL) { struct clean_string_options *opts = work->options; printf("\t\tremove trailing: %s\n", opts->remove_trailing ? "yes" : "no"); } } else if (work->cleaner == &clean_iso8859_1) { printf("\tcleaner: iso8859_1\n"); if (work->options != NULL) { struct clean_string_options *opts = work->options; if (opts->filename != NULL) { printf("\t\ttranslation table: %s\n", opts->filename); } } } else if (work->cleaner == &clean_utf_8) { printf("\tcleaner: utf_8\n"); if (work->options != NULL) { struct clean_string_options *opts = work->options; if (opts->filename != NULL) { printf("\t\ttranslation table: %s\n", opts->filename); } } } else if (work->cleaner == &clean_max_length) { printf("\tcleaner: max length\n"); if (work->options != NULL) { struct clean_string_options *opts = work->options; printf("\t\tlength: %d\n", (unsigned int)opts->max_length); } } if (work->cleaner == &clean_lower) { printf("\tcleaner: lower\n"); } work = work->next; } } list_work = list_work->next; } if (parse_results->files_to_ignore) { printf("\nfiles to ignore:\n"); ignore_walk = parse_results->files_to_ignore; while (ignore_walk != NULL) { printf("\t%s\n", ignore_walk->filename); ignore_walk = ignore_walk->next; } } } detox-1.4.5/src/config_file_dump.h000066400000000000000000000007221410625737000171030ustar00rootroot00000000000000/** * This file is part of the Detox package. * * Copyright (c) Doug Harple * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ #ifndef __CONFIG_FILE_DUMP_H #define __CONFIG_FILE_DUMP_H #include "detox.h" extern void dump_config_file(struct detox_parse_results *parse_results, struct detox_options *main_options); #endif /* __CONFIG_FILE_DUMP_H */ detox-1.4.5/src/config_file_lex.c000066400000000000000000001430601410625737000167240ustar00rootroot00000000000000 #line 3 "config_file_lex.c" #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 6 #define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ #include #include #include #include /* end standard C headers. */ /* flex integer type definitions */ #ifndef FLEXINT_H #define FLEXINT_H /* C99 systems have . Non-C99 systems may or may not. */ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 #endif #include typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; /* Limits of integral types. */ #ifndef INT8_MIN #define INT8_MIN (-128) #endif #ifndef INT16_MIN #define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN #define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX #define INT8_MAX (127) #endif #ifndef INT16_MAX #define INT16_MAX (32767) #endif #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX #define UINT8_MAX (255U) #endif #ifndef UINT16_MAX #define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX #define UINT32_MAX (4294967295U) #endif #ifndef SIZE_MAX #define SIZE_MAX (~(size_t)0) #endif #endif /* ! C99 */ #endif /* ! FLEXINT_H */ /* begin standard C++ headers. */ /* TODO: this is always defined, so inline it */ #define yyconst const #if defined(__GNUC__) && __GNUC__ >= 3 #define yynoreturn __attribute__((__noreturn__)) #else #define yynoreturn #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an * integer in range [0..255] for use as an array index. */ #define YY_SC_TO_UI(c) ((YY_CHAR) (c)) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k. * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. * Ditto for the __ia64__ case accordingly. */ #define YY_BUF_SIZE 32768 #else #define YY_BUF_SIZE 16384 #endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; #endif extern int yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) #define YY_LINENO_REWIND_TO(ptr) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". * * Returns the top of the stack, or NULL. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; static int yy_n_chars; /* number of characters read into yy_ch_buf */ int yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = NULL; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; void yyrestart ( FILE *input_file ); void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); void yy_delete_buffer ( YY_BUFFER_STATE b ); void yy_flush_buffer ( YY_BUFFER_STATE b ); void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); void yypop_buffer_state ( void ); static void yyensure_buffer_stack ( void ); static void yy_load_buffer_state ( void ); static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); void *yyalloc ( yy_size_t ); void *yyrealloc ( void *, yy_size_t ); void yyfree ( void * ); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ #define yywrap() (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP typedef flex_uint8_t YY_CHAR; FILE *yyin = NULL, *yyout = NULL; typedef int yy_state_type; extern int yylineno; int yylineno = 1; extern char *yytext; #ifdef yytext_ptr #undef yytext_ptr #endif #define yytext_ptr yytext static yy_state_type yy_get_previous_state ( void ); static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); static int yy_get_next_buffer ( void ); static void yynoreturn yy_fatal_error ( const char* msg ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ yyleng = (int) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; #define YY_NUM_RULES 22 #define YY_END_OF_BUFFER 23 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info { flex_int32_t yy_verify; flex_int32_t yy_nxt; }; static const flex_int16_t yy_accept[104] = { 0, 0, 0, 23, 22, 1, 3, 22, 2, 20, 21, 19, 19, 19, 19, 19, 19, 19, 19, 19, 16, 17, 1, 0, 18, 2, 20, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 9, 19, 19, 19, 19, 19, 19, 19, 19, 12, 19, 19, 19, 6, 8, 19, 19, 5, 19, 13, 19, 19, 19, 10, 19, 19, 19, 19, 19, 14, 19, 19, 19, 4, 7, 19, 19, 11, 19, 19, 19, 19, 19, 15, 0 } ; static const YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 4, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, 7, 6, 6, 6, 8, 6, 6, 9, 10, 1, 11, 1, 1, 1, 1, 1, 12, 13, 14, 13, 15, 16, 17, 18, 19, 13, 13, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 13, 13, 1, 1, 1, 1, 33, 1, 12, 13, 14, 13, 15, 16, 17, 18, 19, 13, 13, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 13, 13, 34, 1, 35, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static const YY_CHAR yy_meta[36] = { 0, 1, 1, 2, 1, 1, 3, 3, 3, 3, 3, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1 } ; static const flex_int16_t yy_base[107] = { 0, 0, 0, 133, 134, 130, 134, 33, 0, 32, 134, 0, 112, 26, 29, 118, 114, 33, 27, 109, 134, 134, 125, 43, 134, 0, 50, 0, 106, 103, 101, 101, 91, 89, 99, 103, 93, 103, 100, 91, 99, 90, 103, 94, 95, 76, 85, 92, 77, 88, 71, 88, 80, 75, 91, 71, 72, 77, 66, 0, 80, 75, 84, 63, 79, 75, 81, 70, 0, 72, 71, 63, 0, 0, 60, 62, 0, 72, 0, 59, 47, 65, 0, 63, 44, 59, 47, 59, 0, 66, 44, 45, 0, 0, 52, 57, 0, 49, 47, 46, 32, 34, 0, 134, 60, 63, 47 } ; static const flex_int16_t yy_def[107] = { 0, 103, 1, 103, 103, 103, 103, 104, 105, 103, 103, 106, 106, 106, 106, 106, 106, 106, 106, 106, 103, 103, 103, 104, 103, 105, 103, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 0, 103, 103, 103 } ; static const flex_int16_t yy_nxt[170] = { 0, 4, 5, 6, 7, 8, 9, 9, 9, 9, 9, 10, 11, 11, 11, 11, 12, 11, 11, 13, 14, 15, 11, 11, 11, 11, 16, 17, 11, 18, 11, 19, 11, 4, 20, 21, 24, 24, 26, 26, 26, 26, 26, 29, 31, 35, 24, 24, 36, 37, 27, 102, 32, 30, 101, 38, 26, 26, 26, 26, 26, 23, 23, 23, 25, 100, 25, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 22, 39, 34, 33, 28, 22, 103, 3, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103 } ; static const flex_int16_t yy_chk[170] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 7, 9, 9, 9, 9, 9, 13, 14, 17, 23, 23, 17, 18, 106, 101, 14, 13, 100, 18, 26, 26, 26, 26, 26, 104, 104, 104, 105, 99, 105, 98, 97, 95, 94, 91, 90, 89, 87, 86, 85, 84, 83, 81, 80, 79, 77, 75, 74, 71, 70, 69, 67, 66, 65, 64, 63, 62, 61, 60, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 22, 19, 16, 15, 12, 5, 3, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103 } ; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; extern int yy_flex_debug; int yy_flex_debug = 0; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "config_file_lex.l" #line 2 "config_file_lex.l" /** * This file is part of the Detox package. * * Copyright (c) Doug Harple * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ #include "config.h" #include #include #include "config_file_yacc.h" int config_file_lineno = 1; #line 533 "config_file_lex.c" #line 534 "config_file_lex.c" #define INITIAL 0 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ #include #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif static int yy_init_globals ( void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ int yylex_destroy ( void ); int yyget_debug ( void ); void yyset_debug ( int debug_flag ); YY_EXTRA_TYPE yyget_extra ( void ); void yyset_extra ( YY_EXTRA_TYPE user_defined ); FILE *yyget_in ( void ); void yyset_in ( FILE * _in_str ); FILE *yyget_out ( void ); void yyset_out ( FILE * _out_str ); int yyget_leng ( void ); char *yyget_text ( void ); int yyget_lineno ( void ); void yyset_lineno ( int _line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int yywrap ( void ); #else extern int yywrap ( void ); #endif #endif #ifndef YY_NO_UNPUT static void yyunput ( int c, char *buf_ptr ); #endif #ifndef yytext_ptr static void yy_flex_strncpy ( char *, const char *, int ); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen ( const char * ); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput ( void ); #else static int input ( void ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k */ #define YY_READ_BUF_SIZE 16384 #else #define YY_READ_BUF_SIZE 8192 #endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ int n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else \ { \ errno=0; \ while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ break; \ } \ errno=0; \ clearerr(yyin); \ } \ }\ \ #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif /* end tables serialization structures and prototypes */ /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 extern int yylex (void); #define YY_DECL int yylex (void) #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK /*LINTED*/break; #endif #define YY_RULE_SETUP \ YY_USER_ACTION /** The main scanner function which does all the work. */ YY_DECL { yy_state_type yy_current_state; char *yy_cp, *yy_bp; int yy_act; if ( !(yy_init) ) { (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif if ( ! (yy_start) ) (yy_start) = 1; /* first start state */ if ( ! yyin ) yyin = stdin; if ( ! yyout ) yyout = stdout; if ( ! YY_CURRENT_BUFFER ) { yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer( yyin, YY_BUF_SIZE ); } yy_load_buffer_state( ); } { #line 24 "config_file_lex.l" #line 754 "config_file_lex.c" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); /* Support of yytext. */ *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = (yy_start); yy_match: do { YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 104 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 134 ); yy_find_action: yy_act = yy_accept[yy_current_state]; if ( yy_act == 0 ) { /* have to back up */ yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); yy_act = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = (yy_hold_char); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); goto yy_find_action; case 1: YY_RULE_SETUP #line 26 "config_file_lex.l" { /* ignore whitespace */ } YY_BREAK case 2: YY_RULE_SETUP #line 28 "config_file_lex.l" { /* ignore comments */ } YY_BREAK case 3: /* rule 3 can match eol */ YY_RULE_SETUP #line 30 "config_file_lex.l" { config_file_lineno++; } YY_BREAK case 4: YY_RULE_SETUP #line 32 "config_file_lex.l" { return SEQUENCE; } YY_BREAK case 5: YY_RULE_SETUP #line 34 "config_file_lex.l" { return IGNORE; } YY_BREAK case 6: YY_RULE_SETUP #line 36 "config_file_lex.l" { return UNCGI; } YY_BREAK case 7: YY_RULE_SETUP #line 38 "config_file_lex.l" { return ISO8859_1; } YY_BREAK case 8: YY_RULE_SETUP #line 40 "config_file_lex.l" { return UTF_8; } YY_BREAK case 9: YY_RULE_SETUP #line 42 "config_file_lex.l" { return SAFE; } YY_BREAK case 10: YY_RULE_SETUP #line 44 "config_file_lex.l" { return WIPEUP; } YY_BREAK case 11: YY_RULE_SETUP #line 46 "config_file_lex.l" { return MAX_LENGTH; } YY_BREAK case 12: YY_RULE_SETUP #line 48 "config_file_lex.l" { return LOWER; } YY_BREAK case 13: YY_RULE_SETUP #line 50 "config_file_lex.l" { return LENGTH; } YY_BREAK case 14: YY_RULE_SETUP #line 52 "config_file_lex.l" { return FILENAME; } YY_BREAK case 15: YY_RULE_SETUP #line 54 "config_file_lex.l" { return REMOVE_TRAILING; } YY_BREAK case 16: YY_RULE_SETUP #line 56 "config_file_lex.l" { return OPEN; } YY_BREAK case 17: YY_RULE_SETUP #line 57 "config_file_lex.l" { return CLOSE; } YY_BREAK case 18: /* rule 18 can match eol */ YY_RULE_SETUP #line 59 "config_file_lex.l" { yylval.string = strdup(yytext+1); if (yylval.string[yyleng-2] != '"') { printf("Unterminated character string\n"); } else { yylval.string[yyleng-2] = '\0'; } return QSTRING; } YY_BREAK case 19: YY_RULE_SETUP #line 70 "config_file_lex.l" { yylval.string = strdup(yytext); return ID; } YY_BREAK case 20: YY_RULE_SETUP #line 75 "config_file_lex.l" { yylval.nvalue = atoi(yytext); return NVALUE; } YY_BREAK case 21: YY_RULE_SETUP #line 82 "config_file_lex.l" { return EOL; } YY_BREAK case 22: YY_RULE_SETUP #line 84 "config_file_lex.l" ECHO; YY_BREAK #line 938 "config_file_lex.c" case YY_STATE_EOF(INITIAL): yyterminate(); case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = (yy_hold_char); YY_RESTORE_YY_MORE_OFFSET if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ yy_state_type yy_next_state; (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = (yytext_ptr) + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++(yy_c_buf_p); yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = (yy_c_buf_p); goto yy_find_action; } } else switch ( yy_get_next_buffer( ) ) { case EOB_ACT_END_OF_FILE: { (yy_did_buffer_switch_on_eof) = 0; if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: (yy_c_buf_p) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of user's declarations */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer (void) { char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; char *source = (yytext_ptr); int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; else { int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ yyrealloc( (void *) b->yy_ch_buf, (yy_size_t) (b->yy_buf_size + 2) ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = NULL; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } if ( (yy_n_chars) == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; yyrestart( yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); /* "- 2" to take care of EOB's */ YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); } (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state (void) { yy_state_type yy_current_state; char *yy_cp; yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 104 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { int yy_is_jam; char *yy_cp = (yy_c_buf_p); YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 104 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; yy_is_jam = (yy_current_state == 103); return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_UNPUT static void yyunput (int c, char * yy_bp ) { char *yy_cp; yy_cp = (yy_c_buf_p); /* undo effects of setting up yytext */ *yy_cp = (yy_hold_char); if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ int number_to_move = (yy_n_chars) + 2; char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size; if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; (yytext_ptr) = yy_bp; (yy_hold_char) = *yy_cp; (yy_c_buf_p) = yy_cp; } #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) #else static int input (void) #endif { int c; *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) /* This was really a NUL. */ *(yy_c_buf_p) = '\0'; else { /* need more input */ int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ yyrestart( yyin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { if ( yywrap( ) ) return 0; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + offset; break; } } } c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ *(yy_c_buf_p) = '\0'; /* preserve yytext */ (yy_hold_char) = *++(yy_c_buf_p); return c; } #endif /* ifndef YY_NO_INPUT */ /** Immediately switch to a different input stream. * @param input_file A readable stream. * * @note This function does not reset the start condition to @c INITIAL . */ void yyrestart (FILE * input_file ) { if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer( yyin, YY_BUF_SIZE ); } yy_init_buffer( YY_CURRENT_BUFFER, input_file ); yy_load_buffer_state( ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { /* TODO. We should be able to replace this entire function body * with * yypop_buffer_state(); * yypush_buffer_state(new_buffer); */ yyensure_buffer_stack (); if ( YY_CURRENT_BUFFER == new_buffer ) return; if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } YY_CURRENT_BUFFER_LVALUE = new_buffer; yy_load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ (yy_did_buffer_switch_on_eof) = 1; } static void yy_load_buffer_state (void) { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * * @return the allocated buffer state. */ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; yy_init_buffer( b, file ); return b; } /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() * */ void yy_delete_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) yyfree( (void *) b->yy_ch_buf ); yyfree( (void *) b ); } /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. */ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) { int oerrno = errno; yy_flush_buffer( b ); b->yy_input_file = file; b->yy_fill_buffer = 1; /* If b is the current buffer, then yy_init_buffer was _probably_ * called from yyrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ b->yy_bs_lineno = 1; b->yy_bs_column = 0; } b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ void yy_flush_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) yy_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * */ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { if (new_buffer == NULL) return; yyensure_buffer_stack(); /* This block is copied from yy_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } /* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER) (yy_buffer_stack_top)++; YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * */ void yypop_buffer_state (void) { if (!YY_CURRENT_BUFFER) return; yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ static void yyensure_buffer_stack (void) { yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; } if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ yy_size_t grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; } } /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return NULL; b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = NULL; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; yy_switch_to_buffer( b ); return b; } /** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ YY_BUFFER_STATE yy_scan_string (const char * yystr ) { return yy_scan_bytes( yystr, (int) strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = (yy_size_t) (_yybytes_len + 2); buf = (char *) yyalloc( n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; b = yy_scan_buffer( buf, n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif static void yynoreturn yy_fatal_error (const char* msg ) { fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ yytext[yyleng] = (yy_hold_char); \ (yy_c_buf_p) = yytext + yyless_macro_arg; \ (yy_hold_char) = *(yy_c_buf_p); \ *(yy_c_buf_p) = '\0'; \ yyleng = yyless_macro_arg; \ } \ while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. * */ int yyget_lineno (void) { return yylineno; } /** Get the input stream. * */ FILE *yyget_in (void) { return yyin; } /** Get the output stream. * */ FILE *yyget_out (void) { return yyout; } /** Get the length of the current token. * */ int yyget_leng (void) { return yyleng; } /** Get the current token. * */ char *yyget_text (void) { return yytext; } /** Set the current line number. * @param _line_number line number * */ void yyset_lineno (int _line_number ) { yylineno = _line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param _in_str A readable stream. * * @see yy_switch_to_buffer */ void yyset_in (FILE * _in_str ) { yyin = _in_str ; } void yyset_out (FILE * _out_str ) { yyout = _out_str ; } int yyget_debug (void) { return yy_flex_debug; } void yyset_debug (int _bdebug ) { yy_flex_debug = _bdebug ; } static int yy_init_globals (void) { /* Initialization is the same as for the non-reentrant scanner. * This function is called from yylex_destroy(), so don't allocate here. */ (yy_buffer_stack) = NULL; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; (yy_c_buf_p) = NULL; (yy_init) = 0; (yy_start) = 0; /* Defined in main.c */ #ifdef YY_STDINIT yyin = stdin; yyout = stdout; #else yyin = NULL; yyout = NULL; #endif /* For future reference: Set errno on error, since we are called by * yylex_init() */ return 0; } /* yylex_destroy is for both reentrant and non-reentrant scanners. */ int yylex_destroy (void) { /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ yy_delete_buffer( YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; yypop_buffer_state(); } /* Destroy the stack itself. */ yyfree((yy_buffer_stack) ); (yy_buffer_stack) = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * yylex() is called, initialization will occur. */ yy_init_globals( ); return 0; } /* * Internal utility routines. */ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, const char * s2, int n ) { int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (const char * s ) { int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif void *yyalloc (yy_size_t size ) { return malloc(size); } void *yyrealloc (void * ptr, yy_size_t size ) { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return realloc(ptr, size); } void yyfree (void * ptr ) { free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" #line 84 "config_file_lex.l" detox-1.4.5/src/config_file_lex.l000066400000000000000000000030221410625737000167260ustar00rootroot00000000000000%{ /** * This file is part of the Detox package. * * Copyright (c) Doug Harple * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ #include "config.h" #include #include #include "config_file_yacc.h" int config_file_lineno = 1; %} %option noyywrap %% [\t ]+ { /* ignore whitespace */ } #.* { /* ignore comments */ } \n { config_file_lineno++; } [Ss][Ee][Qq][Uu][Ee][Nn][Cc][Ee] { return SEQUENCE; } [Ii][Gg][Nn][Oo][Rr][Ee] { return IGNORE; } [Uu][Nn][Cc][Gg][Ii] { return UNCGI; } [Ii][Ss][Oo]8859_1 { return ISO8859_1; } [Uu][Tt][Ff]_8 { return UTF_8; } [Ss][Aa][Ff][Ee] { return SAFE; } [Ww][Ii][Pp][Ee][Uu][Pp] { return WIPEUP; } [Mm][Aa][Xx]_[Ll][Ee][Nn][Gg][Tt][Hh] { return MAX_LENGTH; } [Ll][Oo][Ww][Ee][Rr] { return LOWER; } [Ll][Ee][Nn][Gg][Tt][Hh] { return LENGTH; } [Ff][Ii][Ll][Ee][Nn][Aa][Mm][Ee] { return FILENAME; } [Rr][Ee][Mm][Oo][Vv][Ee]_[Tt][Rr][Aa][Ii][Ll][Ii][Nn][Gg] { return REMOVE_TRAILING; } [{] { return OPEN; } [}] { return CLOSE; } \"[^\"\n]*[\"\n] { yylval.string = strdup(yytext+1); if (yylval.string[yyleng-2] != '"') { printf("Unterminated character string\n"); } else { yylval.string[yyleng-2] = '\0'; } return QSTRING; } [a-zA-Z][a-zA-Z0-9_]* { yylval.string = strdup(yytext); return ID; } [0-9]+ { yylval.nvalue = atoi(yytext); return NVALUE; } [;] { return EOL; } %% detox-1.4.5/src/config_file_spoof.c000066400000000000000000000051131410625737000172560ustar00rootroot00000000000000/** * This file is part of the Detox package. * * Copyright (c) Doug Harple * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ #include "config.h" #include #include #include #include #include "detox.h" #include "config_file_spoof.h" #include "clean_string.h" struct detox_parse_results *spoof_config_file(struct detox_options *main_options) { struct detox_parse_results *ret = NULL; struct detox_sequence_list *sequences = NULL; struct detox_sequence_entry *work = NULL; /* * Initialize return */ ret = malloc(sizeof(struct detox_parse_results)); if (ret == NULL) { fprintf(stderr, "out of memory: %s\n", strerror(errno)); exit(EXIT_FAILURE); } memset(ret, 0, sizeof(struct detox_parse_results)); /* * Head of sequence */ sequences = malloc(sizeof(struct detox_sequence_list)); if (sequences == NULL) { fprintf(stderr, "out of memory: %s\n", strerror(errno)); exit(EXIT_FAILURE); } memset(sequences, 0, sizeof(struct detox_sequence_list)); sequences->name = strdup("default"); sequences->source_filename = strdup("inside the beast"); /* * Step 1 - ISO8859_1 */ sequences->head = malloc(sizeof(struct detox_sequence_entry)); if (sequences->head == NULL) { fprintf(stderr, "out of memory: %s\n", strerror(errno)); exit(EXIT_FAILURE); } work = sequences->head; memset(work, 0, sizeof(struct detox_sequence_entry)); work->cleaner = &clean_iso8859_1; /* * Step 2 - Safe */ work->next = malloc(sizeof(struct detox_sequence_entry)); if (work->next == NULL) { fprintf(stderr, "out of memory: %s\n", strerror(errno)); exit(EXIT_FAILURE); } work = work->next; memset(work, 0, sizeof(struct detox_sequence_entry)); work->cleaner = &clean_safe; /* * Step 3 - Wipe Up */ work->next = malloc(sizeof(struct detox_sequence_entry)); if (work->next == NULL) { fprintf(stderr, "out of memory: %s\n", strerror(errno)); exit(EXIT_FAILURE); } work = work->next; memset(work, 0, sizeof(struct detox_sequence_entry)); work->cleaner = &clean_wipeup; /* * Deprecated */ if (main_options->remove_trailing) { static struct clean_string_options *csopts; csopts = malloc(sizeof(struct clean_string_options)); if (csopts == NULL) { fprintf(stderr, "out of memory: %s\n", strerror(errno)); exit(EXIT_FAILURE); } memset(csopts, 0, sizeof(struct clean_string_options)); csopts->remove_trailing = 1; work->options = csopts; } /* * */ ret->sequences = sequences; return ret; } detox-1.4.5/src/config_file_spoof.h000066400000000000000000000007021410625737000172620ustar00rootroot00000000000000/** * This file is part of the Detox package. * * Copyright (c) Doug Harple * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ #ifndef __CONFIG_FILE_SPOOF_H #define __CONFIG_FILE_SPOOF_H #include "detox.h" extern struct detox_parse_results *spoof_config_file(struct detox_options *main_options); #endif /* __CONFIG_FILE_SPOOF_H */ detox-1.4.5/src/config_file_yacc.c000066400000000000000000001606351410625737000170620ustar00rootroot00000000000000/* 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 1 "config_file_yacc.y" /* yacc.c:339 */ /** * This file is part of the Detox package. * * Copyright (c) Doug Harple * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ #include "config.h" #include #include #include #include "detox.h" #include "clean_string.h" #include "config_file.h" /* * I must apologize in advance for the cryptic, global variable names. */ static struct detox_sequence_list *cf_sl_ret, *cf_sl_current; static struct detox_sequence_entry *cf_seq_ret, *cf_seq_current; static struct detox_ignore_entry *cf_ignore_ret, *cf_ignore_current; static struct clean_string_options *csopts; static char *current_name = NULL; static char *current_filename = NULL; static struct detox_options *current_options; void cf_append_sequence_list(void); void cf_append_sequence_entry(void *ptr, void *opts); void cf_append_ignore_entry(int token, void *str); void yyerror (char *s); int yylex (void); #line 131 "config_file_yacc.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_CONFIG_FILE_YACC_H_INCLUDED # define YY_YY_CONFIG_FILE_YACC_H_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif #if YYDEBUG extern int yydebug; #endif /* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { QSTRING = 258, ID = 259, SEQUENCE = 260, IGNORE = 261, UNCGI = 262, ISO8859_1 = 263, UTF_8 = 264, SAFE = 265, WIPEUP = 266, MAX_LENGTH = 267, LOWER = 268, FILENAME = 269, REMOVE_TRAILING = 270, LENGTH = 271, OPEN = 272, CLOSE = 273, EOL = 274, NVALUE = 275 }; #endif /* Tokens. */ #define QSTRING 258 #define ID 259 #define SEQUENCE 260 #define IGNORE 261 #define UNCGI 262 #define ISO8859_1 263 #define UTF_8 264 #define SAFE 265 #define WIPEUP 266 #define MAX_LENGTH 267 #define LOWER 268 #define FILENAME 269 #define REMOVE_TRAILING 270 #define LENGTH 271 #define OPEN 272 #define CLOSE 273 #define EOL 274 #define NVALUE 275 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { #line 66 "config_file_yacc.y" /* yacc.c:355 */ char *string; /* string buffer */ int cmd; /* command value */ struct detox_sequence_entry *seq; /* sequence */ int nvalue; /* nvalue */ #line 218 "config_file_yacc.c" /* yacc.c:355 */ }; typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif extern YYSTYPE yylval; int yyparse (void); #endif /* !YY_YY_CONFIG_FILE_YACC_H_INCLUDED */ /* Copy the second part of user declarations. */ #line 235 "config_file_yacc.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 2 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 74 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 21 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 19 /* YYNRULES -- Number of rules. */ #define YYNRULES 40 /* YYNSTATES -- Number of states. */ #define YYNSTATES 78 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 275 #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 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint8 yyrline[] = { 0, 85, 85, 87, 90, 92, 95, 98, 101, 104, 105, 108, 110, 112, 114, 116, 118, 120, 123, 125, 127, 136, 138, 140, 149, 151, 153, 162, 175, 188, 197, 199, 201, 210, 213, 216, 219, 220, 223, 228, 230 }; #endif #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", "QSTRING", "ID", "SEQUENCE", "IGNORE", "UNCGI", "ISO8859_1", "UTF_8", "SAFE", "WIPEUP", "MAX_LENGTH", "LOWER", "FILENAME", "REMOVE_TRAILING", "LENGTH", "OPEN", "CLOSE", "EOL", "NVALUE", "$accept", "configfile", "rule", "sequence", "sequence_open", "sequence_close", "method_list", "method", "iso8859_1", "utf_8", "safe", "wipeup", "max_length", "ignore", "ignore_open", "ignore_close", "ignore_list", "ignore_filename", "string", 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 }; # endif #define YYPACT_NINF -29 #define yypact_value_is_default(Yystate) \ (!!((Yystate) == (-29))) #define YYTABLE_NINF -1 #define yytable_value_is_error(Yytable_value) \ 0 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ static const yytype_int8 yypact[] = { -29, 24, -29, 35, -8, -29, -29, 6, -29, -4, -29, -29, 3, -29, 2, 23, 25, 26, 27, 28, 22, -6, -29, 29, 30, 31, 32, 33, 35, 8, -29, -29, -29, 14, 17, 19, -7, 18, -29, 34, -29, -29, -29, -29, -29, -29, -29, 36, 37, -29, -29, 35, -29, 35, -29, 35, -29, 38, -29, 39, -29, -29, -29, -29, 41, 42, 43, 40, 44, 46, 47, 48, -29, 49, -29, -29, -29, -29 }; /* 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[] = { 2, 0, 1, 0, 0, 3, 4, 0, 5, 0, 39, 40, 0, 34, 0, 18, 21, 24, 27, 30, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 36, 7, 11, 0, 0, 0, 0, 0, 12, 0, 6, 10, 14, 15, 16, 13, 17, 0, 0, 33, 37, 0, 19, 0, 22, 0, 25, 0, 28, 0, 31, 8, 38, 35, 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, 20, 23, 26, 32 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { -29, -29, -29, -29, -29, -29, -29, 50, -29, -29, -29, -29, -29, -29, -29, -29, -29, 45, -28 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { -1, 1, 5, 6, 7, 40, 21, 22, 23, 24, 25, 26, 27, 8, 9, 49, 29, 30, 12 }; /* 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_uint8 yytable[] = { 47, 14, 15, 16, 17, 18, 19, 20, 57, 13, 28, 58, 39, 14, 15, 16, 17, 18, 19, 20, 31, 32, 28, 64, 2, 65, 48, 66, 51, 3, 4, 53, 52, 55, 59, 54, 60, 56, 10, 11, 33, 38, 34, 35, 36, 37, 0, 0, 42, 43, 44, 45, 46, 61, 0, 62, 63, 67, 72, 68, 69, 70, 71, 73, 74, 75, 76, 77, 0, 0, 0, 41, 0, 0, 50 }; static const yytype_int8 yycheck[] = { 28, 7, 8, 9, 10, 11, 12, 13, 15, 17, 14, 18, 18, 7, 8, 9, 10, 11, 12, 13, 17, 19, 14, 51, 0, 53, 18, 55, 14, 5, 6, 14, 18, 14, 16, 18, 18, 18, 3, 4, 17, 19, 17, 17, 17, 17, -1, -1, 19, 19, 19, 19, 19, 19, -1, 19, 19, 19, 18, 20, 19, 19, 19, 19, 18, 18, 18, 18, -1, -1, -1, 21, -1, -1, 29 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 22, 0, 5, 6, 23, 24, 25, 34, 35, 3, 4, 39, 17, 7, 8, 9, 10, 11, 12, 13, 27, 28, 29, 30, 31, 32, 33, 14, 37, 38, 17, 19, 17, 17, 17, 17, 17, 19, 18, 26, 28, 19, 19, 19, 19, 19, 39, 18, 36, 38, 14, 18, 14, 18, 14, 18, 15, 18, 16, 18, 19, 19, 19, 39, 39, 39, 19, 20, 19, 19, 19, 18, 19, 18, 18, 18, 18 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { 0, 21, 22, 22, 23, 23, 24, 25, 26, 27, 27, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 30, 30, 30, 31, 31, 31, 32, 32, 32, 33, 33, 33, 34, 35, 36, 37, 37, 38, 39, 39 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 0, 2, 1, 1, 3, 3, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 3, 6, 1, 3, 6, 1, 3, 6, 1, 3, 5, 1, 3, 6, 3, 2, 2, 1, 2, 3, 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 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; #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; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* 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 7: #line 98 "config_file_yacc.y" /* yacc.c:1646 */ { current_name = (yyvsp[-1].string); } #line 1358 "config_file_yacc.c" /* yacc.c:1646 */ break; case 8: #line 101 "config_file_yacc.y" /* yacc.c:1646 */ { cf_append_sequence_list(); } #line 1364 "config_file_yacc.c" /* yacc.c:1646 */ break; case 11: #line 108 "config_file_yacc.y" /* yacc.c:1646 */ { cf_append_sequence_entry(&clean_uncgi, NULL); } #line 1370 "config_file_yacc.c" /* yacc.c:1646 */ break; case 12: #line 110 "config_file_yacc.y" /* yacc.c:1646 */ { cf_append_sequence_entry(&clean_lower, NULL); } #line 1376 "config_file_yacc.c" /* yacc.c:1646 */ break; case 18: #line 123 "config_file_yacc.y" /* yacc.c:1646 */ { cf_append_sequence_entry(&clean_iso8859_1, NULL); } #line 1382 "config_file_yacc.c" /* yacc.c:1646 */ break; case 19: #line 125 "config_file_yacc.y" /* yacc.c:1646 */ { cf_append_sequence_entry(&clean_iso8859_1, NULL); } #line 1388 "config_file_yacc.c" /* yacc.c:1646 */ break; case 20: #line 127 "config_file_yacc.y" /* yacc.c:1646 */ { csopts = malloc(sizeof(struct clean_string_options)); memset(csopts, 0, sizeof(struct clean_string_options)); csopts->filename = (yyvsp[-2].string); cf_append_sequence_entry(&clean_iso8859_1, csopts); } #line 1400 "config_file_yacc.c" /* yacc.c:1646 */ break; case 21: #line 136 "config_file_yacc.y" /* yacc.c:1646 */ { cf_append_sequence_entry(&clean_utf_8, NULL); } #line 1406 "config_file_yacc.c" /* yacc.c:1646 */ break; case 22: #line 138 "config_file_yacc.y" /* yacc.c:1646 */ { cf_append_sequence_entry(&clean_utf_8, NULL); } #line 1412 "config_file_yacc.c" /* yacc.c:1646 */ break; case 23: #line 140 "config_file_yacc.y" /* yacc.c:1646 */ { csopts = malloc(sizeof(struct clean_string_options)); memset(csopts, 0, sizeof(struct clean_string_options)); csopts->filename = (yyvsp[-2].string); cf_append_sequence_entry(&clean_utf_8, csopts); } #line 1424 "config_file_yacc.c" /* yacc.c:1646 */ break; case 24: #line 149 "config_file_yacc.y" /* yacc.c:1646 */ { cf_append_sequence_entry(&clean_safe, NULL); } #line 1430 "config_file_yacc.c" /* yacc.c:1646 */ break; case 25: #line 151 "config_file_yacc.y" /* yacc.c:1646 */ { cf_append_sequence_entry(&clean_safe, NULL); } #line 1436 "config_file_yacc.c" /* yacc.c:1646 */ break; case 26: #line 153 "config_file_yacc.y" /* yacc.c:1646 */ { csopts = malloc(sizeof(struct clean_string_options)); memset(csopts, 0, sizeof(struct clean_string_options)); csopts->filename = (yyvsp[-2].string); cf_append_sequence_entry(&clean_safe, csopts); } #line 1448 "config_file_yacc.c" /* yacc.c:1646 */ break; case 27: #line 162 "config_file_yacc.y" /* yacc.c:1646 */ { if (current_options->remove_trailing) { csopts = malloc(sizeof(struct clean_string_options)); memset(csopts, 0, sizeof(struct clean_string_options)); csopts->remove_trailing = 1; } else { csopts = NULL; } cf_append_sequence_entry(&clean_wipeup, csopts); } #line 1465 "config_file_yacc.c" /* yacc.c:1646 */ break; case 28: #line 175 "config_file_yacc.y" /* yacc.c:1646 */ { if (current_options->remove_trailing) { csopts = malloc(sizeof(struct clean_string_options)); memset(csopts, 0, sizeof(struct clean_string_options)); csopts->remove_trailing = 1; } else { csopts = NULL; } cf_append_sequence_entry(&clean_wipeup, csopts); } #line 1482 "config_file_yacc.c" /* yacc.c:1646 */ break; case 29: #line 188 "config_file_yacc.y" /* yacc.c:1646 */ { csopts = malloc(sizeof(struct clean_string_options)); memset(csopts, 0, sizeof(struct clean_string_options)); csopts->remove_trailing = 1; cf_append_sequence_entry(&clean_wipeup, csopts); } #line 1494 "config_file_yacc.c" /* yacc.c:1646 */ break; case 30: #line 197 "config_file_yacc.y" /* yacc.c:1646 */ { cf_append_sequence_entry(&clean_max_length, NULL); } #line 1500 "config_file_yacc.c" /* yacc.c:1646 */ break; case 31: #line 199 "config_file_yacc.y" /* yacc.c:1646 */ { cf_append_sequence_entry(&clean_max_length, NULL); } #line 1506 "config_file_yacc.c" /* yacc.c:1646 */ break; case 32: #line 201 "config_file_yacc.y" /* yacc.c:1646 */ { csopts = malloc(sizeof(struct clean_string_options)); memset(csopts, 0, sizeof(struct clean_string_options)); csopts->max_length = (size_t)(yyvsp[-2].nvalue); cf_append_sequence_entry(&clean_max_length, csopts); } #line 1518 "config_file_yacc.c" /* yacc.c:1646 */ break; case 38: #line 223 "config_file_yacc.y" /* yacc.c:1646 */ { cf_append_ignore_entry(FILENAME, (yyvsp[-1].string)); } #line 1526 "config_file_yacc.c" /* yacc.c:1646 */ break; case 39: #line 228 "config_file_yacc.y" /* yacc.c:1646 */ { (yyval.string) = (yyvsp[0].string); } #line 1532 "config_file_yacc.c" /* yacc.c:1646 */ break; case 40: #line 230 "config_file_yacc.y" /* yacc.c:1646 */ { (yyval.string) = (yyvsp[0].string); } #line 1538 "config_file_yacc.c" /* yacc.c:1646 */ break; #line 1542 "config_file_yacc.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 233 "config_file_yacc.y" /* yacc.c:1906 */ extern FILE *yyin; extern FILE *yyout; struct detox_parse_results *parse_config_file(char *filename, struct detox_parse_results *previous_results, struct detox_options *main_options) { struct detox_parse_results *ret = NULL; current_filename = filename; current_options = main_options; /* * XXX - Should we be closing the default yyin/yyout? If so, should we * be setting them to NULL at the end of this function? */ yyin = fopen(filename, "r"); if (yyin == NULL) { return previous_results; } yyout = fopen("/dev/null", "w"); /* * Initialize the return variable */ if (previous_results) { ret = previous_results; } else { ret = malloc(sizeof(struct detox_parse_results)); memset(ret, 0, sizeof(struct detox_parse_results)); } /* * Initialize the sequence list */ cf_sl_ret = NULL; cf_sl_current = NULL; if (previous_results && previous_results->sequences) { cf_sl_ret = previous_results->sequences; cf_sl_current = cf_sl_ret; while (cf_sl_current->next != NULL) { cf_sl_current = cf_sl_current->next; } } /* * Initialize the ignore list */ cf_ignore_ret = NULL; cf_ignore_current = NULL; if (previous_results && previous_results->files_to_ignore) { cf_ignore_ret = previous_results->files_to_ignore; cf_ignore_current = cf_ignore_ret; while (cf_ignore_current->next != NULL) { cf_ignore_current = cf_ignore_current->next; } } /* * Reset the sequence entry holding vars */ cf_seq_ret = NULL; cf_seq_current = NULL; do { yyparse(); } while (!feof(yyin)); fclose(yyin); fclose(yyout); /* * Populate returns */ ret->sequences = cf_sl_ret; ret->files_to_ignore = cf_ignore_ret; return ret; } void yyerror(char *s) { /* * XXX - Is extern valid here? Does it do what I'm expecting? */ extern char *yytext; fprintf(stderr, "detox: error parsing config file %s: %s\n", current_filename, s); fprintf(stderr, "\tline %d", config_file_lineno); if (yytext != NULL) { fprintf(stderr, ": %s", yytext); } fprintf(stderr, "\n"); exit(EXIT_FAILURE); } void cf_append_sequence_list(void) { struct detox_sequence_list *work; if (current_name == NULL) { current_name = strdup("default"); } work = NULL; if (cf_sl_ret != NULL) { work = cf_sl_ret; while (work != NULL) { if (strcmp(work->name, current_name) == 0) { break; } work = work->next; } } if (work != NULL) { /* * XXX - Free Old Tree */ } else { work = malloc(sizeof(struct detox_sequence_list)); memset(work, 0, sizeof(struct detox_sequence_list)); work->name = strdup(current_name); /* * Append to the tree first. If we don't, we could create a * circular reference. */ if (cf_sl_ret == NULL) { cf_sl_ret = cf_sl_current = work; } else { cf_sl_current->next = work; cf_sl_current = work; } } work->head = cf_seq_ret; work->source_filename = strdup(current_filename); cf_seq_ret = cf_seq_current = NULL; } void cf_append_sequence_entry(void *ptr, void *opts) { struct detox_sequence_entry *work; work = malloc(sizeof(struct detox_sequence_entry)); memset(work, 0, sizeof(struct detox_sequence_entry)); work->cleaner = ptr; work->options = opts; if (cf_seq_ret == NULL) { cf_seq_ret = cf_seq_current = work; } else { cf_seq_current->next = work; cf_seq_current = work; } } void cf_append_ignore_entry(int token, void *str) { struct detox_ignore_entry *work; work = malloc(sizeof(struct detox_ignore_entry)); memset(work, 0, sizeof(struct detox_ignore_entry)); switch(token) { case FILENAME: work->filename = str; break; default: break; } if (cf_ignore_ret == NULL) { cf_ignore_ret = cf_ignore_current = work; } else { cf_ignore_current->next = work; cf_ignore_current = work; } } detox-1.4.5/src/config_file_yacc.h000066400000000000000000000057361410625737000170670ustar00rootroot00000000000000/* 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_CONFIG_FILE_YACC_H_INCLUDED # define YY_YY_CONFIG_FILE_YACC_H_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif #if YYDEBUG extern int yydebug; #endif /* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { QSTRING = 258, ID = 259, SEQUENCE = 260, IGNORE = 261, UNCGI = 262, ISO8859_1 = 263, UTF_8 = 264, SAFE = 265, WIPEUP = 266, MAX_LENGTH = 267, LOWER = 268, FILENAME = 269, REMOVE_TRAILING = 270, LENGTH = 271, OPEN = 272, CLOSE = 273, EOL = 274, NVALUE = 275 }; #endif /* Tokens. */ #define QSTRING 258 #define ID 259 #define SEQUENCE 260 #define IGNORE 261 #define UNCGI 262 #define ISO8859_1 263 #define UTF_8 264 #define SAFE 265 #define WIPEUP 266 #define MAX_LENGTH 267 #define LOWER 268 #define FILENAME 269 #define REMOVE_TRAILING 270 #define LENGTH 271 #define OPEN 272 #define CLOSE 273 #define EOL 274 #define NVALUE 275 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { #line 66 "config_file_yacc.y" /* yacc.c:1909 */ char *string; /* string buffer */ int cmd; /* command value */ struct detox_sequence_entry *seq; /* sequence */ int nvalue; /* nvalue */ #line 101 "config_file_yacc.h" /* yacc.c:1909 */ }; typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif extern YYSTYPE yylval; int yyparse (void); #endif /* !YY_YY_CONFIG_FILE_YACC_H_INCLUDED */ detox-1.4.5/src/config_file_yacc.y000066400000000000000000000204541410625737000171020ustar00rootroot00000000000000%{ /** * This file is part of the Detox package. * * Copyright (c) Doug Harple * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ #include "config.h" #include #include #include #include "detox.h" #include "clean_string.h" #include "config_file.h" /* * I must apologize in advance for the cryptic, global variable names. */ static struct detox_sequence_list *cf_sl_ret, *cf_sl_current; static struct detox_sequence_entry *cf_seq_ret, *cf_seq_current; static struct detox_ignore_entry *cf_ignore_ret, *cf_ignore_current; static struct clean_string_options *csopts; static char *current_name = NULL; static char *current_filename = NULL; static struct detox_options *current_options; void cf_append_sequence_list(void); void cf_append_sequence_entry(void *ptr, void *opts); void cf_append_ignore_entry(int token, void *str); void yyerror (char *s); int yylex (void); %} %union { char *string; /* string buffer */ int cmd; /* command value */ struct detox_sequence_entry *seq; /* sequence */ int nvalue; /* nvalue */ } %token QSTRING ID %token SEQUENCE IGNORE %token UNCGI ISO8859_1 UTF_8 SAFE WIPEUP %token MAX_LENGTH LOWER %token FILENAME REMOVE_TRAILING LENGTH %token OPEN CLOSE EOL %token NVALUE %type string %% configfile: | configfile rule ; rule: sequence | ignore ; sequence: sequence_open method_list sequence_close ; sequence_open: SEQUENCE string OPEN { current_name = $2; } ; sequence_close: CLOSE EOL { cf_append_sequence_list(); } ; method_list: method | method_list method ; method: UNCGI EOL { cf_append_sequence_entry(&clean_uncgi, NULL); } | LOWER EOL { cf_append_sequence_entry(&clean_lower, NULL); } | wipeup EOL | iso8859_1 EOL | utf_8 EOL | safe EOL | max_length EOL ; iso8859_1: ISO8859_1 { cf_append_sequence_entry(&clean_iso8859_1, NULL); } | ISO8859_1 OPEN CLOSE { cf_append_sequence_entry(&clean_iso8859_1, NULL); } | ISO8859_1 OPEN FILENAME string EOL CLOSE { csopts = malloc(sizeof(struct clean_string_options)); memset(csopts, 0, sizeof(struct clean_string_options)); csopts->filename = $4; cf_append_sequence_entry(&clean_iso8859_1, csopts); } ; utf_8: UTF_8 { cf_append_sequence_entry(&clean_utf_8, NULL); } | UTF_8 OPEN CLOSE { cf_append_sequence_entry(&clean_utf_8, NULL); } | UTF_8 OPEN FILENAME string EOL CLOSE { csopts = malloc(sizeof(struct clean_string_options)); memset(csopts, 0, sizeof(struct clean_string_options)); csopts->filename = $4; cf_append_sequence_entry(&clean_utf_8, csopts); } ; safe: SAFE { cf_append_sequence_entry(&clean_safe, NULL); } | SAFE OPEN CLOSE { cf_append_sequence_entry(&clean_safe, NULL); } | SAFE OPEN FILENAME string EOL CLOSE { csopts = malloc(sizeof(struct clean_string_options)); memset(csopts, 0, sizeof(struct clean_string_options)); csopts->filename = $4; cf_append_sequence_entry(&clean_safe, csopts); } ; wipeup: WIPEUP { if (current_options->remove_trailing) { csopts = malloc(sizeof(struct clean_string_options)); memset(csopts, 0, sizeof(struct clean_string_options)); csopts->remove_trailing = 1; } else { csopts = NULL; } cf_append_sequence_entry(&clean_wipeup, csopts); } | WIPEUP OPEN CLOSE { if (current_options->remove_trailing) { csopts = malloc(sizeof(struct clean_string_options)); memset(csopts, 0, sizeof(struct clean_string_options)); csopts->remove_trailing = 1; } else { csopts = NULL; } cf_append_sequence_entry(&clean_wipeup, csopts); } | WIPEUP OPEN REMOVE_TRAILING EOL CLOSE { csopts = malloc(sizeof(struct clean_string_options)); memset(csopts, 0, sizeof(struct clean_string_options)); csopts->remove_trailing = 1; cf_append_sequence_entry(&clean_wipeup, csopts); } ; max_length: MAX_LENGTH { cf_append_sequence_entry(&clean_max_length, NULL); } | MAX_LENGTH OPEN CLOSE { cf_append_sequence_entry(&clean_max_length, NULL); } | MAX_LENGTH OPEN LENGTH NVALUE EOL CLOSE { csopts = malloc(sizeof(struct clean_string_options)); memset(csopts, 0, sizeof(struct clean_string_options)); csopts->max_length = (size_t)$4; cf_append_sequence_entry(&clean_max_length, csopts); } ; ignore: ignore_open ignore_list ignore_close ; ignore_open: IGNORE OPEN ; ignore_close: CLOSE EOL ; ignore_list: ignore_filename | ignore_list ignore_filename ; ignore_filename: FILENAME string EOL { cf_append_ignore_entry(FILENAME, $2); } ; string: QSTRING { $$ = $1; } | ID { $$ = $1; } ; %% extern FILE *yyin; extern FILE *yyout; struct detox_parse_results *parse_config_file(char *filename, struct detox_parse_results *previous_results, struct detox_options *main_options) { struct detox_parse_results *ret = NULL; current_filename = filename; current_options = main_options; /* * XXX - Should we be closing the default yyin/yyout? If so, should we * be setting them to NULL at the end of this function? */ yyin = fopen(filename, "r"); if (yyin == NULL) { return previous_results; } yyout = fopen("/dev/null", "w"); /* * Initialize the return variable */ if (previous_results) { ret = previous_results; } else { ret = malloc(sizeof(struct detox_parse_results)); memset(ret, 0, sizeof(struct detox_parse_results)); } /* * Initialize the sequence list */ cf_sl_ret = NULL; cf_sl_current = NULL; if (previous_results && previous_results->sequences) { cf_sl_ret = previous_results->sequences; cf_sl_current = cf_sl_ret; while (cf_sl_current->next != NULL) { cf_sl_current = cf_sl_current->next; } } /* * Initialize the ignore list */ cf_ignore_ret = NULL; cf_ignore_current = NULL; if (previous_results && previous_results->files_to_ignore) { cf_ignore_ret = previous_results->files_to_ignore; cf_ignore_current = cf_ignore_ret; while (cf_ignore_current->next != NULL) { cf_ignore_current = cf_ignore_current->next; } } /* * Reset the sequence entry holding vars */ cf_seq_ret = NULL; cf_seq_current = NULL; do { yyparse(); } while (!feof(yyin)); fclose(yyin); fclose(yyout); /* * Populate returns */ ret->sequences = cf_sl_ret; ret->files_to_ignore = cf_ignore_ret; return ret; } void yyerror(char *s) { /* * XXX - Is extern valid here? Does it do what I'm expecting? */ extern char *yytext; fprintf(stderr, "detox: error parsing config file %s: %s\n", current_filename, s); fprintf(stderr, "\tline %d", config_file_lineno); if (yytext != NULL) { fprintf(stderr, ": %s", yytext); } fprintf(stderr, "\n"); exit(EXIT_FAILURE); } void cf_append_sequence_list(void) { struct detox_sequence_list *work; if (current_name == NULL) { current_name = strdup("default"); } work = NULL; if (cf_sl_ret != NULL) { work = cf_sl_ret; while (work != NULL) { if (strcmp(work->name, current_name) == 0) { break; } work = work->next; } } if (work != NULL) { /* * XXX - Free Old Tree */ } else { work = malloc(sizeof(struct detox_sequence_list)); memset(work, 0, sizeof(struct detox_sequence_list)); work->name = strdup(current_name); /* * Append to the tree first. If we don't, we could create a * circular reference. */ if (cf_sl_ret == NULL) { cf_sl_ret = cf_sl_current = work; } else { cf_sl_current->next = work; cf_sl_current = work; } } work->head = cf_seq_ret; work->source_filename = strdup(current_filename); cf_seq_ret = cf_seq_current = NULL; } void cf_append_sequence_entry(void *ptr, void *opts) { struct detox_sequence_entry *work; work = malloc(sizeof(struct detox_sequence_entry)); memset(work, 0, sizeof(struct detox_sequence_entry)); work->cleaner = ptr; work->options = opts; if (cf_seq_ret == NULL) { cf_seq_ret = cf_seq_current = work; } else { cf_seq_current->next = work; cf_seq_current = work; } } void cf_append_ignore_entry(int token, void *str) { struct detox_ignore_entry *work; work = malloc(sizeof(struct detox_ignore_entry)); memset(work, 0, sizeof(struct detox_ignore_entry)); switch(token) { case FILENAME: work->filename = str; break; default: break; } if (cf_ignore_ret == NULL) { cf_ignore_ret = cf_ignore_current = work; } else { cf_ignore_current->next = work; cf_ignore_current = work; } } detox-1.4.5/src/detox.c000066400000000000000000000200711410625737000147270ustar00rootroot00000000000000/** * This file is part of the Detox package. * * Copyright (c) Doug Harple * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ #include "config.h" #include #include #include #include #include #include #include #include "detox.h" #include "clean_string.h" #include "file.h" #include "config_file.h" #include "config_file_spoof.h" #include "config_file_dump.h" #include "parse_table.h" #include "parse_options.h" #define MAX_PATH_LEN 256 int main(int argc, char **argv) { struct stat stat_info; int err; struct detox_parse_results *parse_results = NULL; struct detox_sequence_list *list_work = NULL; struct detox_sequence_entry *which_sequence = NULL; struct detox_sequence_entry *work = NULL; struct detox_options *main_options; char *check_config_file = NULL; char *file_work = NULL; char **file_walk; main_options = parse_options_getopt(argc, argv); if (main_options == NULL) { fprintf(stderr, "detox: an error occurred while parsing command line arguments\n"); exit(EXIT_FAILURE); } if (main_options->check_config_file) { check_config_file = strdup(main_options->check_config_file); } if (check_config_file != NULL) { parse_results = parse_config_file(check_config_file, NULL, main_options); if (parse_results == NULL) { fprintf(stderr, "detox: unable to open: %s\n", check_config_file); exit(EXIT_FAILURE); } } else { check_config_file = malloc(MAX_PATH_LEN); if (check_config_file == NULL) { fprintf(stderr, "out of memory: %s\n", strerror(errno)); exit(EXIT_FAILURE); } #ifdef SYSCONFDIR err = snprintf(check_config_file, MAX_PATH_LEN, "%s/detoxrc", SYSCONFDIR); if (err < MAX_PATH_LEN) parse_results = parse_config_file(check_config_file, NULL, main_options); #endif if (parse_results == NULL) { parse_results = parse_config_file("/etc/detoxrc", NULL, main_options); } if (parse_results == NULL) { parse_results = parse_config_file("/usr/local/etc/detoxrc", NULL, main_options); } file_work = getenv("HOME"); if (file_work != NULL) { err = snprintf(check_config_file, MAX_PATH_LEN, "%s/.detoxrc", file_work); if (err < MAX_PATH_LEN) parse_results = parse_config_file(check_config_file, parse_results, main_options); file_work = NULL; } if (parse_results == NULL) { parse_results = spoof_config_file(main_options); } free(check_config_file); } if (parse_results == NULL) { fprintf(stderr, "detox: no config file to work with\n"); exit(EXIT_FAILURE); } /* * Store the files_to_ignore array in the main_options struct for use in * parse_dir/file/special */ main_options->files_to_ignore = parse_results->files_to_ignore; /* * Determine which sequence to use */ which_sequence = NULL; list_work = parse_results->sequences; while (list_work != NULL) { if (strcmp(list_work->name, (main_options->sequence_name == NULL) ? "default" : main_options->sequence_name) == 0) { which_sequence = list_work->head; break; } list_work = list_work->next; } /* * If no sequence was found, and the user didn't specify a sequence * to use, just use the first sequence. */ if (which_sequence == NULL && main_options->sequence_name == NULL) { if (parse_results->sequences != NULL) { which_sequence = parse_results->sequences->head; } } main_options->sequence_to_use = which_sequence; /* * List sequences */ if (main_options->list_sequences) { dump_config_file(parse_results, main_options); exit(EXIT_SUCCESS); } /* * Fail if no sequence is available */ if (main_options->sequence_to_use == NULL) { /* * XXX - Explain this better */ fprintf(stderr, "detox: no sequence to work with\n"); exit(EXIT_FAILURE); } /* * Check translation tables */ work = main_options->sequence_to_use; while (work != NULL) { char *check_filename = NULL; int do_search = 0; struct translation_table *table = NULL; struct clean_string_options *opts; if (work->cleaner == &clean_iso8859_1) { if (work->options != NULL) { opts = work->options; if (opts->filename != NULL) { check_filename = opts->filename; } } if (!check_filename) { check_filename = "iso8859_1.tbl"; do_search = 1; } } else if (work->cleaner == &clean_utf_8) { if (work->options != NULL) { opts = work->options; if (opts->filename != NULL) { check_filename = opts->filename; } } if (!check_filename) { check_filename = "unicode.tbl"; do_search = 1; } } else if (work->cleaner == &clean_safe) { if (work->options != NULL) { opts = work->options; if (opts->filename != NULL) { check_filename = opts->filename; } } if (!check_filename) { check_filename = "safe.tbl"; do_search = 1; } } if (check_filename || do_search) { table = NULL; if (do_search) { check_config_file = malloc(MAX_PATH_LEN); if (check_config_file == NULL) { fprintf(stderr, "out of memory: %s\n", strerror(errno)); exit(EXIT_FAILURE); } #ifdef DATADIR err = snprintf(check_config_file, MAX_PATH_LEN, "%s/detox/%s", DATADIR, check_filename); if (err < MAX_PATH_LEN) table = parse_table(check_config_file); #endif if (table == NULL) { err = snprintf(check_config_file, MAX_PATH_LEN, "/usr/share/detox/%s", check_filename); if (err < MAX_PATH_LEN) table = parse_table(check_config_file); } if (table == NULL) { err = snprintf(check_config_file, MAX_PATH_LEN, "/usr/local/share/detox/%s", check_filename); if (err < MAX_PATH_LEN) table = parse_table(check_config_file); } if (table == NULL) { /* * Fall back to the non-file based * cleaner */ if (work->cleaner == &clean_iso8859_1) { work->cleaner = &clean_iso8859_1_basic; } else if (work->cleaner == &clean_utf_8) { work->cleaner = &clean_utf_8_basic; } else if (work->cleaner == &clean_safe) { work->cleaner = &clean_safe_basic; } else { fprintf(stderr, "detox: unable to locate translation table or fall back\n"); exit(EXIT_FAILURE); } } else { /* * Allocate an options */ opts = malloc(sizeof(struct clean_string_options)); if (opts == NULL) { fprintf(stderr, "out of memory: %s\n", strerror(errno)); exit(EXIT_FAILURE); } memset(opts, 0, sizeof(struct clean_string_options)); opts->translation_table = table; work->options = opts; } free(check_config_file); } else { table = parse_table(check_filename); if (table == NULL) { fprintf(stderr, "detox: unable to parse file: %s\n", check_filename); exit(EXIT_FAILURE); } opts = work->options; opts->translation_table = table; } } work = work->next; } /* * Do some actual work */ if (!main_options->is_inline_mode) { file_walk = main_options->files; while (*file_walk) { if (main_options->verbose) { printf("Scanning: %s\n", *file_walk); } err = lstat(*file_walk, &stat_info); if (err == -1) { fprintf(stderr, "%s: %s\n", *file_walk, strerror(errno)); } else { if (S_ISDIR(stat_info.st_mode)) { file_work = parse_file(*file_walk, main_options); parse_dir(file_work, main_options); free(file_work); } else if (S_ISREG(stat_info.st_mode)) { parse_file(*file_walk, main_options); } else if (main_options->special) { parse_special(*file_walk, main_options); } } file_walk++; } } else { if (main_options->files[0] != NULL) { file_walk = main_options->files; while (*file_walk) { err = lstat(*file_walk, &stat_info); if (err == -1) { fprintf(stderr, "%s: %s\n", *file_walk, strerror(errno)); } else { if (S_ISDIR(stat_info.st_mode)) { fprintf(stderr, "%s: is a directory\n", *file_walk); } else { parse_inline(*file_walk, main_options); } } file_walk++; } } else { parse_inline(NULL, main_options); } } return 0; } detox-1.4.5/src/detox.h000066400000000000000000000027301410625737000147360ustar00rootroot00000000000000/** * This file is part of the Detox package. * * Copyright (c) Doug Harple * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ #ifndef __DETOX_H #define __DETOX_H /* * Holds information about all of the defined sequences */ struct detox_sequence_list { struct detox_sequence_list *next; char *name; /* * The top of the linked list of entries for this sequence */ struct detox_sequence_entry *head; char *source_filename; }; /* * Holds information about an entry within a specific sequence */ struct detox_sequence_entry { struct detox_sequence_entry *next; unsigned char *(*cleaner) (unsigned char *str, void *options); void *options; }; /* * Holds information about files the user has asked us to ignore */ struct detox_ignore_entry { struct detox_ignore_entry *next; unsigned char *filename; }; /* * Holds the result of a config file parse */ struct detox_parse_results { struct detox_sequence_list *sequences; struct detox_ignore_entry *files_to_ignore; }; /* * Holds command line options */ struct detox_options { int dry_run; int is_inline_bin; int is_inline_mode; int list_sequences; int recurse; int remove_trailing; int special; int verbose; struct detox_sequence_entry *sequence_to_use; struct detox_ignore_entry *files_to_ignore; char *sequence_name; char *check_config_file; char **files; }; #endif /* __DETOX_H */ detox-1.4.5/src/file.c000066400000000000000000000166071410625737000145350ustar00rootroot00000000000000/** * This file is part of the Detox package. * * Copyright (c) Doug Harple * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ #include "config.h" #include #include #include #include #include #include #include #include "clean_string.h" #include "file.h" #include "detox.h" static char badfiles[3][30] = { ".", "..", "" }; #define BUF_SIZE 1024 /* * Internal function declarations */ static int ignore_file(unsigned char *filename, struct detox_options *options); /* * Renames file to a safe filename. */ unsigned char *parse_file(unsigned char *filename, struct detox_options *options) { unsigned char *old_filename, *old_filename_ptr, *new_filename; unsigned char *work, *hold; struct stat stat_info_old; struct stat stat_info_new; int err; size_t len; struct detox_sequence_entry *sequence; len = strlen(filename) + 1; old_filename = malloc(len); if (old_filename == NULL) { fprintf(stderr, "out of memory: %s\n", strerror(errno)); return NULL; } memcpy(old_filename, filename, len); old_filename_ptr = strrchr(old_filename, '/'); if (old_filename_ptr != NULL) { old_filename_ptr++; } else { old_filename_ptr = old_filename; } /* * Check for files that need to be ignored */ if (ignore_file(old_filename_ptr, options)) { return old_filename; } /* * Do the actual filename cleaning */ sequence = options->sequence_to_use; work = strdup(old_filename_ptr); while (sequence != NULL && work != NULL) { hold = sequence->cleaner(work, sequence->options); if (work != NULL) { free(work); } work = hold; sequence = sequence->next; } if (work == NULL) { return old_filename; } /* check to see if nothing changed */ if (strcmp(old_filename_ptr, work) == 0) { return old_filename; } len = (old_filename_ptr - old_filename); new_filename = malloc(len + strlen(work) + 1); if (new_filename == NULL) { fprintf(stderr, "out of memory: %s\n", strerror(errno)); free(work); free(old_filename); return NULL; } strncpy(new_filename, old_filename, len); strcpy(new_filename + len, work); free(work); err = lstat(old_filename, &stat_info_old); if (err == -1) { free(new_filename); return old_filename; } err = lstat(new_filename, &stat_info_new); if (err != -1) { // New file exists if (stat_info_old.st_dev != stat_info_new.st_dev || // Different device stat_info_old.st_ino != stat_info_new.st_ino || // Different inode stat_info_old.st_nlink > 1) // More than one hard link { fprintf(stderr, "Cannot rename %s to %s: file already exists\n", old_filename, new_filename); free(new_filename); return old_filename; } } if (options->verbose || options->dry_run) { printf("%s -> %s\n", old_filename, new_filename); } if (options->dry_run) { free(new_filename); return old_filename; } err = rename(old_filename, new_filename); if (err == -1) { fprintf(stderr, "Cannot rename %s to %s: %s\n", old_filename, new_filename, strerror(errno)); free(new_filename); return old_filename; } free(old_filename); return new_filename; } /* * Handles directory. */ void parse_dir(unsigned char *indir, struct detox_options *options) { unsigned char *new_file, *work; DIR *dir_handle; struct dirent *dir_entry; struct stat stat_info; int check_file; int err; size_t new_file_length; err = lstat(indir, &stat_info); if (err == -1) { return; } if (!S_ISDIR(stat_info.st_mode)) { return; } new_file_length = strlen(indir) + 1024; new_file = (char *)malloc(new_file_length); if (new_file == NULL) { fprintf(stderr, "out of memory: %s\n", strerror(errno)); return; } /* * Parse directory */ dir_handle = opendir(indir); if (dir_handle == NULL) { fprintf(stderr, "unable to parse: %s\n", strerror(errno)); free(new_file); return; } dir_entry = readdir(dir_handle); while (dir_entry != NULL) { /* * Check for files that need to be ignored */ check_file = !ignore_file(dir_entry->d_name, options); if (check_file) { snprintf(new_file, new_file_length, "%s/%s", indir, dir_entry->d_name); lstat(new_file, &stat_info); if (S_ISDIR(stat_info.st_mode)) { work = parse_file(new_file, options); if (options->recurse) { parse_dir(work, options); } free(work); } else if (S_ISREG(stat_info.st_mode)) { work = parse_file(new_file, options); free(work); } else if (options->special) { parse_special(new_file, options); } } dir_entry = readdir(dir_handle); } closedir(dir_handle); } /* * Handles a special file. */ void parse_special(unsigned char *in, struct detox_options *options) { struct stat stat_info; char *new_file, *work; int err; /* detox, then parse_dir if a symlink to a dir */ new_file = parse_file(in, options); if (!new_file) { return; } err = lstat(new_file, &stat_info); if (err == -1) { fprintf(stderr, "Unable to stat %s\n", in); free(new_file); return; } if (options->recurse && S_ISLNK(stat_info.st_mode)) { work = malloc(1024); if (!work) { fprintf(stderr, "out of memory: %s\n", strerror(errno)); free(new_file); return; } memset(work, 0, 1024); err = readlink(new_file, work, 1023); if (err == -1) { fprintf(stderr, "Unable to read symbolic link %s\n", in); free(work); free(new_file); return; } err = lstat(work, &stat_info); if (err == -1) { fprintf(stderr, "Unable to follow symbolic link %s\n", in); free(work); free(new_file); return; } if (S_ISDIR(stat_info.st_mode)) { parse_dir(work, options); } free(work); } free(new_file); } /* * Determines if the file should be ignored */ static int ignore_file(unsigned char *filename, struct detox_options *options) { struct detox_ignore_entry *ignore_walk; int x; for (x = 0; badfiles[x][0] != 0; x++) { if (strcmp(filename, badfiles[x]) == 0) { return 1; } } ignore_walk = options->files_to_ignore; while (ignore_walk != NULL) { if (strcmp(filename, ignore_walk->filename) == 0) { return 1; } ignore_walk = ignore_walk->next; } return 0; } /* * Renames file to a safe filename. */ void parse_inline(unsigned char *filename, struct detox_options *options) { struct detox_sequence_entry *sequence; FILE *fp; unsigned char *base, *work, *hold; size_t buf_size; if (filename != NULL) { if (!(fp = fopen(filename, "r"))) { fprintf(stderr, "%s: %s\n", filename, strerror(errno)); return; } } else { fp = stdin; } buf_size = BUF_SIZE; base = malloc(buf_size); if (base == NULL) { fprintf(stderr, "out of memory: %s\n", strerror(errno)); return; } while (fgets(base, buf_size, fp)) { while (strrchr(base, '\n') == NULL) { work = realloc(base, buf_size + BUF_SIZE - 1); if (!fgets(work + buf_size - 1, BUF_SIZE, fp)) { base = work; break; } base = work; buf_size += BUF_SIZE - 1; } hold = strrchr(base, '\n'); if (hold == NULL) { fprintf(stderr, "Unable to parse input\n"); exit(EXIT_FAILURE); } *hold = '\0'; work = strdup(base); sequence = options->sequence_to_use; while (sequence != NULL && work != NULL) { hold = sequence->cleaner(work, sequence->options); if (work != NULL) { free(work); } work = hold; sequence = sequence->next; } if (work != NULL) { printf("%s\n", work); } else { printf("\n"); } } } detox-1.4.5/src/file.h000066400000000000000000000012111410625737000145230ustar00rootroot00000000000000/** * This file is part of the Detox package. * * Copyright (c) Doug Harple * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ #ifndef __FILE_H #define __FILE_H #include "detox.h" extern unsigned char *parse_file(unsigned char *filename, struct detox_options *options); extern void parse_dir(unsigned char *indir, struct detox_options *options); extern void parse_special(unsigned char *in, struct detox_options *options); extern void parse_inline(unsigned char *filename, struct detox_options *options); #endif /* __FILE_H */ detox-1.4.5/src/iso8859_1.h000066400000000000000000000062011410625737000151600ustar00rootroot00000000000000/** * This file is part of the Detox package. * * Copyright (c) Doug Harple * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * */ /** * Special thanks to: http://www.bbsinc.com/iso8859.html */ #define ISO8859_1_OFFSET 0x80 #define ISO8859_1_COUNT 128 #define ISO8859_1_MAXLEN 8 /* starts at 80 */ char iso8859_1_trans[ISO8859_1_COUNT][ISO8859_1_MAXLEN] = { "_", /* 0x0080 */ "_", /* 0x0081 */ "_", /* 0x0082 */ "_", /* 0x0083 */ "_", /* 0x0084 */ "...", /* 0x0085 */ "_", /* 0x0086 */ "_", /* 0x0087 */ "^", /* 0x0088 */ "_", /* 0x0089 */ "S", /* 0x008A */ "_", /* 0x008B */ "OE", /* 0x008C */ "_", /* 0x008D */ "_", /* 0x008E */ "_", /* 0x008F */ "_", /* 0x0090 */ "_", /* 0x0091 */ "_", /* 0x0092 */ "_", /* 0x0093 */ "_", /* 0x0094 */ "_", /* 0x0095 */ "-", /* 0x0096 */ "-", /* 0x0097 */ "_", /* 0x0098 */ "_tm_", /* 0x0099 */ "s", /* 0x009A */ "_", /* 0x009B */ "oe", /* 0x009C */ "_", /* 0x009D */ "_", /* 0x009E */ "Y", /* 0x009F */ "_", /* 0x00A0 */ "_", /* 0x00A1 */ "_cent_", /* 0x00A2 */ "_pound_", /* 0x00A3 */ "_", /* 0x00A4 */ "_yen_", /* 0x00A5 */ "_", /* 0x00A6 */ "_", /* 0x00A7 */ "_", /* 0x00A8 */ "_copy_", /* 0x00A9 */ "_", /* 0x00AA */ "_", /* 0x00AB */ "_", /* 0x00AC */ "_", /* 0x00AD */ "_reg_", /* 0x00AE */ "_", /* 0x00AF */ "_", /* 0x00B0 */ "_", /* 0x00B1 */ "2", /* 0x00B2 */ "3", /* 0x00B3 */ "_", /* 0x00B4 */ "b", /* 0x00B5 */ "_pp_", /* 0x00B6 */ "_", /* 0x00B7 */ "_", /* 0x00B8 */ "1", /* 0x00B9 */ "_", /* 0x00BA */ "_", /* 0x00BB */ "_", /* 0x00BC */ "_", /* 0x00BD */ "_", /* 0x00BE */ "_", /* 0x00BF */ "A", /* 0x00C0 */ "A", /* 0x00C1 */ "A", /* 0x00C2 */ "A", /* 0x00C3 */ "A", /* 0x00C4 */ "A", /* 0x00C5 */ "AE", /* 0x00C6 */ "C", /* 0x00C7 */ "E", /* 0x00C8 */ "E", /* 0x00C9 */ "E", /* 0x00CA */ "E", /* 0x00CB */ "I", /* 0x00CC */ "I", /* 0x00CD */ "I", /* 0x00CE */ "I", /* 0x00CF */ "TH", /* 0x00D0 */ "N", /* 0x00D1 */ "O", /* 0x00D2 */ "O", /* 0x00D3 */ "O", /* 0x00D4 */ "O", /* 0x00D5 */ "O", /* 0x00D6 */ "x", /* 0x00D7 */ "O", /* 0x00D8 */ "U", /* 0x00D9 */ "U", /* 0x00DA */ "U", /* 0x00DB */ "U", /* 0x00DC */ "Y", /* 0x00DD */ "TH", /* 0x00DE */ "ss", /* 0x00DF */ "a", /* 0x00E0 */ "a", /* 0x00E1 */ "a", /* 0x00E2 */ "a", /* 0x00E3 */ "a", /* 0x00E4 */ "a", /* 0x00E5 */ "ae", /* 0x00E6 */ "c", /* 0x00E7 */ "e", /* 0x00E8 */ "e", /* 0x00E9 */ "e", /* 0x00EA */ "e", /* 0x00EB */ "i", /* 0x00EC */ "i", /* 0x00ED */ "i", /* 0x00EE */ "i", /* 0x00EF */ "th", /* 0x00F0 */ "n", /* 0x00F1 */ "o", /* 0x00F2 */ "o", /* 0x00F3 */ "o", /* 0x00F4 */ "o", /* 0x00F5 */ "o", /* 0x00F6 */ "_", /* 0x00F7 */ "o", /* 0x00F8 */ "u", /* 0x00F9 */ "u", /* 0x00FA */ "u", /* 0x00FB */ "u", /* 0x00FC */ "y", /* 0x00FD */ "th", /* 0x00FE */ "y", /* 0x00FF */ }; detox-1.4.5/src/parse_options.c000066400000000000000000000141011410625737000164660ustar00rootroot00000000000000/** * This file is part of the Detox package. * * Copyright (c) Doug Harple * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ #include "config.h" #include #include #include #include #include #include #include #include "detox.h" #include "config.h" #include "parse_options.h" #ifdef HAVE_GETOPT_LONG #include #endif enum { LONG_OPTION_DRY_RUN = 1, LONG_OPTION_INLINE, LONG_OPTION_REMOVE_TRAILING, LONG_OPTION_SPECIAL }; #define INLINE_DETOX_BIN "inline-detox" /* expect this to be overwritten! */ static int long_option = 0; #ifdef HAVE_GETOPT_LONG static struct option longopts[] = { /* long options with equivalents */ {"help", no_argument, 0, 'h'}, {"dry-run", no_argument, 0, 'n'}, /* long options without */ {"inline", no_argument, &long_option, LONG_OPTION_INLINE}, {"special", no_argument, &long_option, LONG_OPTION_SPECIAL}, /* deprecated long opts without */ {"remove-trailing", no_argument, &long_option, LONG_OPTION_REMOVE_TRAILING}, /* done */ {0, 0, 0, 0} }; #endif /* *INDENT-OFF* */ char usage_message[] = { "usage: detox [-hLnrvV] [-f configfile] [-s sequence]" #ifdef HAVE_GETOPT_LONG " [--dry-run] [--inline] [--special]" "\n\t " #endif " file [file ...]\n" }; char help_message[] = { " -f configfile choose which config file to use\n" #ifdef HAVE_GETOPT_LONG " -h --help this message\n" #else " -h this message\n" #endif #ifdef HAVE_GETOPT_LONG " --inline run inline mode\n" #endif " -L list available sequences and exit\n" " with -v ... dump sequence contents\n" #ifdef HAVE_GETOPT_LONG " -n --dry-run do a dry run (don't actually do anything)\n" #else " -n do a dry run (don't actually do anything)\n" #endif " -r be recursive (descend into subdirectories)\n" #ifdef HAVE_GETOPT_LONG " --remove-trailing (deprecated)\n" " remove trailing _ and - before a period\n" #endif " -s sequence choose which sequence to detox with\n" #ifdef HAVE_GETOPT_LONG " --special work on links and special files\n" #endif " -v be verbose\n" " -V show the current version\n" }; char usage_message_inline[] = { "usage: inline-detox [-hLvV] [-f configfile] [-s sequence] [file]\n" }; char help_message_inline[] = { " -f configfile choose which config file to use\n" #ifdef HAVE_GETOPT_LONG " -h --help this message\n" #else " -h this message\n" #endif " -L list available sequences and exit\n" " with -v ... dump sequence contents\n" #ifdef HAVE_GETOPT_LONG " --remove-trailing (deprecated)\n" " remove trailing _ and - before a period\n" #endif " -s sequence choose which sequence to detox with\n" " -v be verbose\n" " -V show the current version\n" }; /* *INDENT-ON* */ struct detox_options *initialize_main_options(void) { struct detox_options *main_options; main_options = malloc(sizeof(struct detox_options)); if (main_options == NULL) { fprintf(stderr, "out of memory: %s\n", strerror(errno)); return NULL; } memset(main_options, 0, sizeof(struct detox_options)); /* * XXX - handle blank strings better */ main_options->sequence_name = getenv("DETOX_SEQUENCE"); return main_options; } struct detox_options *parse_options_getopt(int argc, char **argv) { int optcode; struct detox_options *main_options; int i; int max = 10; char *binname; main_options = initialize_main_options(); if (main_options == NULL) { return NULL; } binname = basename(argv[0]); main_options->is_inline_bin = main_options->is_inline_mode = (strcmp(binname, INLINE_DETOX_BIN) == 0); #ifdef HAVE_GETOPT_LONG while ((optcode = getopt_long(argc, argv, "hrvV?Ls:f:n", longopts, NULL)) != -1) { #else while ((optcode = getopt(argc, argv, "hrvV?Ls:f:n")) != -1) { #endif switch (optcode) { case 'h': printf("%s", !main_options->is_inline_bin ? usage_message : usage_message_inline); printf("\n"); printf("%s", !main_options->is_inline_bin ? help_message : help_message_inline); exit(EXIT_SUCCESS); case 'f': /* * XXX - free multiple check_config_files */ main_options->check_config_file = strdup(optarg); break; case 'L': main_options->list_sequences = 1; break; case 'n': main_options->dry_run = 1; break; case 'r': main_options->recurse = 1; break; case 's': /* * XXX - free multiple sequence name opts */ main_options->sequence_name = strdup(optarg); break; case 'v': main_options->verbose++; break; case 'V': printf("%s\n", PACKAGE_STRING); exit(EXIT_SUCCESS); case '?': printf("%s", !main_options->is_inline_bin ? usage_message : usage_message_inline); exit(EXIT_SUCCESS); case 0: switch (long_option) { case LONG_OPTION_INLINE: main_options->is_inline_mode = 1; break; case LONG_OPTION_REMOVE_TRAILING: main_options->remove_trailing = 1; break; case LONG_OPTION_SPECIAL: main_options->special = 1; break; default: /* * getopt_long shouldn't let us get here... * verify? */ printf("unknown option: %s\n", optarg); break; } long_option = 0; /* clean up! */ break; default: fprintf(stderr, "unknown option: %c\n", optcode); exit(EXIT_FAILURE); } } if (main_options->list_sequences) { /* * Early Retirement */ return main_options; } main_options->files = malloc(sizeof(char *) * 10); i = 0; max = 10; if (optind < argc) { while (optind < argc) { /* not enough space for the next file and possible ending NULL -> realloc */ if (i + 2 > max) { main_options->files = realloc(main_options->files, sizeof(char *) * (10 + max)); max += 10; } main_options->files[i++] = strdup(argv[optind]); optind++; } main_options->files[i] = NULL; } else if (!main_options->is_inline_mode) { printf("%s", !main_options->is_inline_bin ? usage_message : usage_message_inline); exit(EXIT_FAILURE); } return main_options; } detox-1.4.5/src/parse_options.h000066400000000000000000000011471410625737000165010ustar00rootroot00000000000000/** * This file is part of the Detox package. * * Copyright (c) Doug Harple * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * */ #ifndef __PARSE_OPTIONS_H #define __PARSE_OPTIONS_H #include "detox.h" extern char usage_message[]; extern char help_message[]; extern char usage_message_inline[]; extern char help_message_inline[]; extern struct detox_options *initialize_main_options(void); extern struct detox_options *parse_options_getopt(int argc, char **argv); #endif /* __PARSE_OPTIONS_H */ detox-1.4.5/src/parse_table.c000066400000000000000000000076321410625737000160750ustar00rootroot00000000000000/** * This file is part of the Detox package. * * Copyright (c) Doug Harple * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ #include "config.h" #include #include #include #include #include #include #include #include #include "table.h" #define LINE_LENGTH 6 enum { BASE_STATE, INSIDE_STATE }; struct translation_table *parse_table(char *filename) { FILE *ttable_file; char *work; int code; int offset; char *parsed; int err; int size; int max_data_length; int ret; int state; char *system_ctype; struct translation_table *table; struct stat ttable_stat; err = stat(filename, &ttable_stat); if (err == -1) { return NULL; } system_ctype = setlocale(LC_CTYPE, ""); if (system_ctype == NULL) { system_ctype = ""; // I don't think we can free the return from setlocale() } size = 0; if (ttable_stat.st_size > 0) { size = ttable_stat.st_size / LINE_LENGTH; } #ifdef HAVE_STRUCT_STAT_ST_BLOCKS else { size = (512 * ttable_stat.st_blocks) / LINE_LENGTH; } #endif if (size < 500) { size = 500; } table = table_init(size); if (table == NULL) { return NULL; } ttable_file = fopen(filename, "r"); if (ttable_file == NULL) { fprintf(stderr, "Unable to open translation table: %s\n", strerror(errno)); return NULL; } work = malloc(1024); if (work == NULL) { fprintf(stderr, "Unable to allocate memory: %s\n", strerror(errno)); return NULL; } parsed = malloc(1024); if (parsed == NULL) { fprintf(stderr, "Unable to allocate memory: %s\n", strerror(errno)); return NULL; } max_data_length = 1; state = BASE_STATE; while (fgets(work, 1024, ttable_file) != NULL) { if (*work == '#') { /* * Don't even bother */ continue; } parsed[0] = '\0'; if (state == BASE_STATE) { ret = sscanf(work, " %s %n", parsed, &offset); if (ret == 0) { continue; } if (strncasecmp(parsed, "start", 5) == 0) { if (work[offset] == '\0') { // All languages state = INSIDE_STATE; continue; } if (work[offset] == '"') { sscanf(work + offset + 1, "%[^\"]", parsed); } else if (work[offset] == '\'') { sscanf(work + offset + 1, "%[^']", parsed); } else { sscanf(work + offset, "%s", parsed); } if (strncasecmp(parsed, system_ctype, strlen(parsed)) == 0) { state = INSIDE_STATE; } // else ignore this start/end block continue; } if (strncasecmp(parsed, "default", 7) == 0) { if (work[offset] == '\0') { table->default_translation = NULL; continue; } if (work[offset] == '"') { sscanf(work + offset + 1, "%[^\"]", parsed); } else if (work[offset] == '\'') { sscanf(work + offset + 1, "%[^']", parsed); } else { sscanf(work + offset, "%s", parsed); } table->default_translation = strdup(parsed); if (strlen(parsed) > max_data_length) { max_data_length = strlen(parsed); } continue; } continue; } /* * Inside state */ code = -1; ret = sscanf(work, "%i %n", &code, &offset); if (ret == 0 || code < 0 || offset < 0) { /* * Check for end */ ret = sscanf(work, " %s %n", parsed, &offset); if (ret > 0 && strncasecmp(parsed, "end", 5) == 0) { state = BASE_STATE; } continue; } if (work[offset] == '\0') { continue; } if (work[offset] == '"') { sscanf(work + offset + 1, "%[^\"]", parsed); } else if (work[offset] == '\'') { sscanf(work + offset + 1, "%[^']", parsed); } else { sscanf(work + offset, "%s", parsed); } table_put(table, code, parsed); if (strlen(parsed) > max_data_length) { max_data_length = strlen(parsed); } } table->max_data_length = max_data_length; free(work); free(parsed); fclose(ttable_file); return table; } detox-1.4.5/src/parse_table.h000066400000000000000000000006271410625737000160770ustar00rootroot00000000000000/** * This file is part of the Detox package. * * Copyright (c) Doug Harple * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * */ #ifndef __PARSE_TABLE_H #define __PARSE_TABLE_H #include "table.h" extern struct translation_table *parse_table(char *filename); #endif /* __PARSE_TABLE_H */ detox-1.4.5/src/table.c000066400000000000000000000062761410625737000147060ustar00rootroot00000000000000/** * This file is part of the Detox package. * * Copyright (c) Doug Harple * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ #include "config.h" #include #include #include #include #include #include "table.h" /* * Internal function declarations */ static int table_hash1(int table_length, unsigned int key); static int table_hash2(int table_length, unsigned int key); struct translation_table *table_init(int max_rows) { struct translation_table *ret; size_t row_length; if (max_rows <= 0) { max_rows = 500; } row_length = max_rows * sizeof(struct translation_table_row); ret = malloc(sizeof(struct translation_table)); if (ret == NULL) { return NULL; } memset(ret, 0, sizeof(struct translation_table)); ret->rows = malloc(row_length); if (ret->rows == NULL) { free(ret); return NULL; } memset(ret->rows, 0, row_length); ret->length = max_rows; return ret; } struct translation_table *table_resize(struct translation_table *table, int rows) { struct translation_table *ret; int i; ret = table_init(rows); if (ret == NULL) return table; if (table == NULL) return ret; for (i = 0; i < table->length; i++) { if (table->rows[i].key > 0 && table->rows[i].data != NULL) { table_put(ret, table->rows[i].key, table->rows[i].data); } } return ret; } void table_free(struct translation_table *table) { int i; if (table == NULL) return; for (i = 0; i < table->length; i++) { if (table->rows[i].key > 0 && table->rows[i].data != NULL) { free(table->rows[i].data); } } free(table->rows); free(table); } static int table_hash1(int table_length, unsigned int key) { return key % table_length; } static int table_hash2(int table_length, unsigned int key) { return (key >> 8) % table_length; } /* * 0 is an invalid key (sorry) */ int table_put(struct translation_table *table, unsigned int key, char *data) { int hashed; int hashed2; int i; if (table->length == table->used) { return -1; } hashed = table_hash1(table->length, key); if (table->rows[hashed].key != 0 && table->rows[hashed].key != key) { hashed2 = table_hash2(table->length, key); i = 0; while (table->rows[hashed].key != 0 && table->rows[hashed].key != key) { hashed += i + hashed2; hashed %= table->length; } } if (table->rows[hashed].key == key) { table->overwrites++; } table->rows[hashed].key = key; table->rows[hashed].data = strdup(data); table->used++; return hashed; } /* * 0 is an invalid key (sorry) */ char *table_get(struct translation_table *table, unsigned int key) { int hashed; int hashed2; int i; if (table == NULL) { return NULL; } hashed = table_hash1(table->length, key); if (table->rows[hashed].key == 0) { return NULL; } if (table->rows[hashed].key != key) { hashed2 = table_hash2(table->length, key); i = 0; while (table->rows[hashed].key != key && table->rows[hashed].key != 0) { table->misses++; hashed += i + hashed2; hashed %= table->length; } } if (table->rows[hashed].key == 0) { return NULL; } table->hits++; return table->rows[hashed].data; } detox-1.4.5/src/table.h000066400000000000000000000016221410625737000147010ustar00rootroot00000000000000/** * This file is part of the Detox package. * * Copyright (c) Doug Harple * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ #ifndef __TABLE_H #define __TABLE_H struct translation_table_row { unsigned int key; char *data; }; struct translation_table { int length; int used; int max_data_length; char *default_translation; struct translation_table_row *rows; int hits, misses, overwrites; }; extern struct translation_table *table_init(int max_rows); extern struct translation_table *table_resize(struct translation_table *table, int rows); extern void table_free(struct translation_table *table); extern int table_put(struct translation_table *table, unsigned int key, char *data); extern char *table_get(struct translation_table *table, unsigned int key); #endif /* __TABLE_H */ detox-1.4.5/src/unicode.h000066400000000000000000000133341410625737000152430ustar00rootroot00000000000000/** * This file is part of the Detox package. * * Copyright (c) Doug Harple * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * */ /** * Special thanks to: http://www.unicode.org/Public/UNIDATA/UnicodeData.txt */ #define UNICODE_COUNT 256 #define UNICODE_MAXLEN 8 char unicode_trans[UNICODE_COUNT][UNICODE_MAXLEN] = { "_", /* 0x0000 */ "_", /* 0x0001 */ "_", /* 0x0002 */ "_", /* 0x0003 */ "_", /* 0x0004 */ "_", /* 0x0005 */ "_", /* 0x0006 */ "_", /* 0x0007 */ "_", /* 0x0008 */ "_", /* 0x0009 */ "_", /* 0x000A */ "_", /* 0x000B */ "_", /* 0x000C */ "_", /* 0x000D */ "_", /* 0x000E */ "_", /* 0x000F */ "_", /* 0x0010 */ "_", /* 0x0011 */ "_", /* 0x0012 */ "_", /* 0x0013 */ "_", /* 0x0014 */ "_", /* 0x0015 */ "_", /* 0x0016 */ "_", /* 0x0017 */ "_", /* 0x0018 */ "_", /* 0x0019 */ "_", /* 0x001A */ "_", /* 0x001B */ "_", /* 0x001C */ "_", /* 0x001D */ "_", /* 0x001E */ "_", /* 0x001F */ "_", /* 0x0020 */ "_", /* 0x0021 */ "_", /* 0x0022 */ "#", /* 0x0023 */ "_", /* 0x0024 */ "%", /* 0x0025 */ "_and_", /* 0x0026 */ "_", /* 0x0027 */ "_", /* 0x0028 */ "_", /* 0x0029 */ "_", /* 0x002A */ "+", /* 0x002B */ ",", /* 0x002C */ "-", /* 0x002D */ ".", /* 0x002E */ "_", /* 0x002F */ "0", /* 0x0030 */ "1", /* 0x0031 */ "2", /* 0x0032 */ "3", /* 0x0033 */ "4", /* 0x0034 */ "5", /* 0x0035 */ "6", /* 0x0036 */ "7", /* 0x0037 */ "8", /* 0x0038 */ "9", /* 0x0039 */ "_", /* 0x003A */ "_", /* 0x003B */ "_", /* 0x003C */ "=", /* 0x003D */ "_", /* 0x003E */ "_", /* 0x003F */ "_", /* 0x0040 */ "A", /* 0x0041 */ "B", /* 0x0042 */ "C", /* 0x0043 */ "D", /* 0x0044 */ "E", /* 0x0045 */ "F", /* 0x0046 */ "G", /* 0x0047 */ "H", /* 0x0048 */ "I", /* 0x0049 */ "J", /* 0x004A */ "K", /* 0x004B */ "L", /* 0x004C */ "M", /* 0x004D */ "N", /* 0x004E */ "O", /* 0x004F */ "P", /* 0x0050 */ "Q", /* 0x0051 */ "R", /* 0x0052 */ "S", /* 0x0053 */ "T", /* 0x0054 */ "U", /* 0x0055 */ "V", /* 0x0056 */ "W", /* 0x0057 */ "X", /* 0x0058 */ "Y", /* 0x0059 */ "Z", /* 0x005A */ "_", /* 0x005B */ "_", /* 0x005C */ "_", /* 0x005D */ "^", /* 0x005E */ "_", /* 0x005F */ "_", /* 0x0060 */ "a", /* 0x0061 */ "b", /* 0x0062 */ "c", /* 0x0063 */ "d", /* 0x0064 */ "e", /* 0x0065 */ "f", /* 0x0066 */ "g", /* 0x0067 */ "h", /* 0x0068 */ "i", /* 0x0069 */ "j", /* 0x006A */ "k", /* 0x006B */ "l", /* 0x006C */ "m", /* 0x006D */ "n", /* 0x006E */ "o", /* 0x006F */ "p", /* 0x0070 */ "q", /* 0x0071 */ "r", /* 0x0072 */ "s", /* 0x0073 */ "t", /* 0x0074 */ "u", /* 0x0075 */ "v", /* 0x0076 */ "w", /* 0x0077 */ "x", /* 0x0078 */ "y", /* 0x0079 */ "z", /* 0x007A */ "_", /* 0x007B */ "_", /* 0x007C */ "_", /* 0x007D */ "~", /* 0x007E */ "_", /* 0x007F */ "_", /* 0x0080 */ "_", /* 0x0081 */ "_", /* 0x0082 */ "_", /* 0x0083 */ "_", /* 0x0084 */ "...", /* 0x0085 */ "_", /* 0x0086 */ "_", /* 0x0087 */ "^", /* 0x0088 */ "_", /* 0x0089 */ "S", /* 0x008A */ "_", /* 0x008B */ "OE", /* 0x008C */ "_", /* 0x008D */ "_", /* 0x008E */ "_", /* 0x008F */ "_", /* 0x0090 */ "_", /* 0x0091 */ "_", /* 0x0092 */ "_", /* 0x0093 */ "_", /* 0x0094 */ "_", /* 0x0095 */ "-", /* 0x0096 */ "-", /* 0x0097 */ "_", /* 0x0098 */ "_tm_", /* 0x0099 */ "s", /* 0x009A */ "_", /* 0x009B */ "oe", /* 0x009C */ "_", /* 0x009D */ "_", /* 0x009E */ "Y", /* 0x009F */ "_", /* 0x00A0 */ "_", /* 0x00A1 */ "_cent_", /* 0x00A2 */ "_pound_", /* 0x00A3 */ "_", /* 0x00A4 */ "_yen_", /* 0x00A5 */ "_", /* 0x00A6 */ "_", /* 0x00A7 */ "_", /* 0x00A8 */ "_copy_", /* 0x00A9 */ "_", /* 0x00AA */ "_", /* 0x00AB */ "_", /* 0x00AC */ "_", /* 0x00AD */ "_reg_", /* 0x00AE */ "_", /* 0x00AF */ "_", /* 0x00B0 */ "_", /* 0x00B1 */ "2", /* 0x00B2 */ "3", /* 0x00B3 */ "_", /* 0x00B4 */ "b", /* 0x00B5 */ "_pp_", /* 0x00B6 */ "_", /* 0x00B7 */ "_", /* 0x00B8 */ "1", /* 0x00B9 */ "_", /* 0x00BA */ "_", /* 0x00BB */ "_", /* 0x00BC */ "_", /* 0x00BD */ "_", /* 0x00BE */ "_", /* 0x00BF */ "A", /* 0x00C0 */ "A", /* 0x00C1 */ "A", /* 0x00C2 */ "A", /* 0x00C3 */ "A", /* 0x00C4 */ "A", /* 0x00C5 */ "AE", /* 0x00C6 */ "C", /* 0x00C7 */ "E", /* 0x00C8 */ "E", /* 0x00C9 */ "E", /* 0x00CA */ "E", /* 0x00CB */ "I", /* 0x00CC */ "I", /* 0x00CD */ "I", /* 0x00CE */ "I", /* 0x00CF */ "TH", /* 0x00D0 */ "N", /* 0x00D1 */ "O", /* 0x00D2 */ "O", /* 0x00D3 */ "O", /* 0x00D4 */ "O", /* 0x00D5 */ "O", /* 0x00D6 */ "x", /* 0x00D7 */ "O", /* 0x00D8 */ "U", /* 0x00D9 */ "U", /* 0x00DA */ "U", /* 0x00DB */ "U", /* 0x00DC */ "Y", /* 0x00DD */ "TH", /* 0x00DE */ "ss", /* 0x00DF */ "a", /* 0x00E0 */ "a", /* 0x00E1 */ "a", /* 0x00E2 */ "a", /* 0x00E3 */ "a", /* 0x00E4 */ "a", /* 0x00E5 */ "ae", /* 0x00E6 */ "c", /* 0x00E7 */ "e", /* 0x00E8 */ "e", /* 0x00E9 */ "e", /* 0x00EA */ "e", /* 0x00EB */ "i", /* 0x00EC */ "i", /* 0x00ED */ "i", /* 0x00EE */ "i", /* 0x00EF */ "th", /* 0x00F0 */ "n", /* 0x00F1 */ "o", /* 0x00F2 */ "o", /* 0x00F3 */ "o", /* 0x00F4 */ "o", /* 0x00F5 */ "o", /* 0x00F6 */ "_", /* 0x00F7 */ "o", /* 0x00F8 */ "u", /* 0x00F9 */ "u", /* 0x00FA */ "u", /* 0x00FB */ "u", /* 0x00FC */ "y", /* 0x00FD */ "th", /* 0x00FE */ "y", /* 0x00FF */ }; detox-1.4.5/table/000077500000000000000000000000001410625737000137405ustar00rootroot00000000000000detox-1.4.5/table/iso8859_1.tbl.sample000066400000000000000000000075431410625737000173040ustar00rootroot00000000000000# This file is part of the Detox package. # # Copyright (c) Doug Harple # # For the full copyright and license information, please view the LICENSE # file that was distributed with this source code. # # Special thanks to: http://www.bbsinc.com/iso8859.html # default _ start # # CP 1252 # 0x85 ... # HORIZONTAL ELLIPSIS 0x88 ^ # MODIFIER LETTER CIRCUMFLEX ACCENT 0x8A S # LATIN CAPITAL LETTER S WITH CARON 0x8C OE # LATIN CAPITAL LIGATURE OE 0x96 - # EN DASH 0x97 - # EM DASH 0x99 _tm_ # TRADE MARK SIGN 0x9A s # LATIN SMALL LETTER S WITH CARON 0x9C oe # LATIN SMALL LIGATURE OE 0x9F Y # LATIN CAPITAL LETTER Y WITH DIAERESIS # # Latin 1 # 0xA2 _cent_ 0xA3 _pound_ 0xA5 _yen_ 0xA9 _copy_ 0xAE _reg_ 0xB2 2 0xB3 3 0xB5 b 0xB6 _pp_ 0xB9 1 0xC0 A # LATIN CAPITAL LETTER A WITH GRAVE 0xC1 A # LATIN CAPITAL LETTER A WITH ACUTE 0xC2 A # LATIN CAPITAL LETTER A WITH CIRCUMFLEX 0xC3 A # LATIN CAPITAL LETTER A WITH TILDE 0xC4 A # LATIN CAPITAL LETTER A WITH DIAERESIS 0xC5 A # LATIN CAPITAL LETTER A WITH RING ABOVE 0xC6 AE # LATIN CAPITAL LETTER AE 0xC7 C # LATIN CAPITAL LETTER C WITH CEDILLA 0xC8 E # LATIN CAPITAL LETTER E WITH GRAVE 0xC9 E # LATIN CAPITAL LETTER E WITH ACUTE 0xCA E # LATIN CAPITAL LETTER E WITH CIRCUMFLEX 0xCB E # LATIN CAPITAL LETTER E WITH DIAERESIS 0xCC I # LATIN CAPITAL LETTER I WITH GRAVE 0xCD I # LATIN CAPITAL LETTER I WITH ACUTE 0xCE I # LATIN CAPITAL LETTER I WITH CIRCUMFLEX 0xCF I # LATIN CAPITAL LETTER I WITH DIAERESIS 0xD0 TH # LATIN CAPITAL LETTER ETH (Icelandic) 0xD1 N # LATIN CAPITAL LETTER N WITH TILDE 0xD2 O # LATIN CAPITAL LETTER O WITH GRAVE 0xD3 O # LATIN CAPITAL LETTER O WITH ACUTE 0xD4 O # LATIN CAPITAL LETTER O WITH CIRCUMFLEX 0xD5 O # LATIN CAPITAL LETTER O WITH TILDE 0xD6 O # LATIN CAPITAL LETTER O WITH DIAERESIS 0xD7 x # MULTIPLICATION SIGN 0xD8 O # LATIN CAPITAL LETTER O WITH STROKE 0xD9 U # LATIN CAPITAL LETTER U WITH GRAVE 0xDA U # LATIN CAPITAL LETTER U WITH ACUTE 0xDB U # LATIN CAPITAL LETTER U WITH CIRCUMFLEX 0xDC U # LATIN CAPITAL LETTER U WITH DIAERESIS 0xDD Y # LATIN CAPITAL LETTER Y WITH ACUTE 0xDE TH # LATIN CAPITAL LETTER THORN (Icelandic) 0xDF ss # LATIN SMALL LETTER SHARP S (German) 0xE0 a # LATIN SMALL LETTER A WITH GRAVE 0xE1 a # LATIN SMALL LETTER A WITH ACUTE 0xE2 a # LATIN SMALL LETTER A WITH CIRCUMFLEX 0xE3 a # LATIN SMALL LETTER A WITH TILDE 0xE4 a # LATIN SMALL LETTER A WITH DIAERESIS 0xE5 a # LATIN SMALL LETTER A WITH RING ABOVE 0xE6 ae # LATIN SMALL LETTER AE 0xE7 c # LATIN SMALL LETTER C WITH CEDILLA 0xE8 e # LATIN SMALL LETTER E WITH GRAVE 0xE9 e # LATIN SMALL LETTER E WITH ACUTE 0xEA e # LATIN SMALL LETTER E WITH CIRCUMFLEX 0xEB e # LATIN SMALL LETTER E WITH DIAERESIS 0xEC i # LATIN SMALL LETTER I WITH GRAVE 0xED i # LATIN SMALL LETTER I WITH ACUTE 0xEE i # LATIN SMALL LETTER I WITH CIRCUMFLEX 0xEF i # LATIN SMALL LETTER I WITH DIAERESIS 0xF0 th # LATIN SMALL LETTER ETH (Icelandic) 0xF1 n # LATIN SMALL LETTER N WITH TILDE 0xF2 o # LATIN SMALL LETTER O WITH GRAVE 0xF3 o # LATIN SMALL LETTER O WITH ACUTE 0xF4 o # LATIN SMALL LETTER O WITH CIRCUMFLEX 0xF5 o # LATIN SMALL LETTER O WITH TILDE 0xF6 o # LATIN SMALL LETTER O WITH DIAERESIS 0xF8 o # LATIN SMALL LETTER O WITH STROKE 0xF9 u # LATIN SMALL LETTER U WITH GRAVE 0xFA u # LATIN SMALL LETTER U WITH ACUTE 0xFB u # LATIN SMALL LETTER U WITH CIRCUMFLEX 0xFC u # LATIN SMALL LETTER U WITH DIAERESIS 0xFD y # LATIN SMALL LETTER Y WITH ACUTE 0xFE th # LATIN SMALL LETTER THORN (Icelandic) 0xFF y # LATIN SMALL LETTER Y WITH DIAERESIS end # # German specific conversions # start de 0xC4 AE # LATIN CAPITAL LETTER A WITH UMLAUT 0xD6 OE # LATIN CAPITAL LETTER O WITH UMLAUT 0xDC UE # LATIN CAPITAL LETTER U WITH UMLAUT 0xE4 ae # LATIN SMALL LETTER A WITH UMLAUT 0xF6 oe # LATIN SMALL LETTER O WITH UMLAUT 0xFC ue # LATIN SMALL LETTER U WITH UMLAUT end detox-1.4.5/table/safe.tbl.sample000066400000000000000000000024111410625737000166370ustar00rootroot00000000000000# This file is part of the Detox package. # # Copyright (c) Doug Harple # # For the full copyright and license information, please view the LICENSE # file that was distributed with this source code. start # # Alphanumeric # 0x30 0 0x31 1 0x32 2 0x33 3 0x34 4 0x35 5 0x36 6 0x37 7 0x38 8 0x39 9 0x41 A 0x42 B 0x43 C 0x44 D 0x45 E 0x46 F 0x47 G 0x48 H 0x49 I 0x4a J 0x4b K 0x4c L 0x4d M 0x4e N 0x4f O 0x50 P 0x51 Q 0x52 R 0x53 S 0x54 T 0x55 U 0x56 V 0x57 W 0x58 X 0x59 Y 0x5a Z 0x61 a 0x62 b 0x63 c 0x64 d 0x65 e 0x66 f 0x67 g 0x68 h 0x69 i 0x6a j 0x6b k 0x6c l 0x6d m 0x6e n 0x6f o 0x70 p 0x71 q 0x72 r 0x73 s 0x74 t 0x75 u 0x76 v 0x77 w 0x78 x 0x79 y 0x7a z # # Chars to leave alone # 0x23 '#' 0x25 % 0x2b + 0x2c , 0x2d - 0x2e . 0x3d = 0x5e ^ 0x5f _ 0x7e ~ # # Chars to translate to _ # 0x09 _ # tab 0x0A _ # new line 0x0D _ # carriage return 0x20 _ # space 0x21 _ # ! 0x22 _ # " 0x24 _ # $ 0x27 _ # ' 0x2a _ # * 0x2f _ # / 0x3a _ # : 0x3b _ # ; 0x3c _ # < 0x3e _ # > 0x3f _ # ? 0x40 _ # @ 0x5c _ # \ 0x60 _ # ` 0x7c _ # | # # Chars to translate to - # 0x28 - # ( 0x29 - # ) 0x5b - # [ 0x5d - # ] 0x7b - # { 0x7d - # } # # Other # 0x26 _and_ # & end detox-1.4.5/table/unicode.tbl.sample000066400000000000000000000314671410625737000173640ustar00rootroot00000000000000# This file is part of the Detox package. # # Copyright (c) Doug Harple # # For the full copyright and license information, please view the LICENSE # file that was distributed with this source code. # # Special thanks to: http://www.unicode.org/Public/UNIDATA/UnicodeData.txt # # Used for translating Icelandic: # http://www.bartleby.com/65/th/Thingval.html # http://www.wordiq.com/definition/Thorn_%28letter%29 # http://www.wordiq.com/definition/Edh # # Greenlandic: # http://std.dkuug.dk/cultreg/registrations/narrative/da_DK,_4.3.html # # Sami: # http://www.wordiq.com/definition/Sami_languages # # Germanic: # http://www.wordiq.com/definition/%DF # default _ start # # Basic Latin - This is a subset of the basic 7-bit ASCII table, with unsafe # characters removed. # 0x0023 # # NUMBER SIGN 0x0025 % # PERCENT SIGN 0x0026 _and_ # AMPERSAND 0x002B + # PLUS SIGN 0x002C , # COMMA 0x002D - # HYPHEN-MINUS 0x002E . # FULL STOP 0x0030 0 # DIGIT ZERO 0x0031 1 # DIGIT ONE 0x0032 2 # DIGIT TWO 0x0033 3 # DIGIT THREE 0x0034 4 # DIGIT FOUR 0x0035 5 # DIGIT FIVE 0x0036 6 # DIGIT SIX 0x0037 7 # DIGIT SEVEN 0x0038 8 # DIGIT EIGHT 0x0039 9 # DIGIT NINE 0x003D = # EQUALS SIGN 0x0041 A # LATIN CAPITAL LETTER A 0x0042 B # LATIN CAPITAL LETTER B 0x0043 C # LATIN CAPITAL LETTER C 0x0044 D # LATIN CAPITAL LETTER D 0x0045 E # LATIN CAPITAL LETTER E 0x0046 F # LATIN CAPITAL LETTER F 0x0047 G # LATIN CAPITAL LETTER G 0x0048 H # LATIN CAPITAL LETTER H 0x0049 I # LATIN CAPITAL LETTER I 0x004A J # LATIN CAPITAL LETTER J 0x004B K # LATIN CAPITAL LETTER K 0x004C L # LATIN CAPITAL LETTER L 0x004D M # LATIN CAPITAL LETTER M 0x004E N # LATIN CAPITAL LETTER N 0x004F O # LATIN CAPITAL LETTER O 0x0050 P # LATIN CAPITAL LETTER P 0x0051 Q # LATIN CAPITAL LETTER Q 0x0052 R # LATIN CAPITAL LETTER R 0x0053 S # LATIN CAPITAL LETTER S 0x0054 T # LATIN CAPITAL LETTER T 0x0055 U # LATIN CAPITAL LETTER U 0x0056 V # LATIN CAPITAL LETTER V 0x0057 W # LATIN CAPITAL LETTER W 0x0058 X # LATIN CAPITAL LETTER X 0x0059 Y # LATIN CAPITAL LETTER Y 0x005A Z # LATIN CAPITAL LETTER Z 0x005E ^ # CIRCUMFLEX ACCENT 0x0061 a # LATIN SMALL LETTER A 0x0062 b # LATIN SMALL LETTER B 0x0063 c # LATIN SMALL LETTER C 0x0064 d # LATIN SMALL LETTER D 0x0065 e # LATIN SMALL LETTER E 0x0066 f # LATIN SMALL LETTER F 0x0067 g # LATIN SMALL LETTER G 0x0068 h # LATIN SMALL LETTER H 0x0069 i # LATIN SMALL LETTER I 0x006A j # LATIN SMALL LETTER J 0x006B k # LATIN SMALL LETTER K 0x006C l # LATIN SMALL LETTER L 0x006D m # LATIN SMALL LETTER M 0x006E n # LATIN SMALL LETTER N 0x006F o # LATIN SMALL LETTER O 0x0070 p # LATIN SMALL LETTER P 0x0071 q # LATIN SMALL LETTER Q 0x0072 r # LATIN SMALL LETTER R 0x0073 s # LATIN SMALL LETTER S 0x0074 t # LATIN SMALL LETTER T 0x0075 u # LATIN SMALL LETTER U 0x0076 v # LATIN SMALL LETTER V 0x0077 w # LATIN SMALL LETTER W 0x0078 x # LATIN SMALL LETTER X 0x0079 y # LATIN SMALL LETTER Y 0x007A z # LATIN SMALL LETTER Z 0x007E ~ # TILDE # # CP 1252 # 0x0085 ... # HORIZONTAL ELLIPSIS 0x0088 ^ # MODIFIER LETTER CIRCUMFLEX ACCENT 0x008A S # LATIN CAPITAL LETTER S WITH CARON 0x008C OE # LATIN CAPITAL LIGATURE OE 0x0096 - # EN DASH 0x0097 - # EM DASH 0x0099 _tm_ # TRADE MARK SIGN 0x009A s # LATIN SMALL LETTER S WITH CARON 0x009C oe # LATIN SMALL LIGATURE OE 0x009F Y # LATIN CAPITAL LETTER Y WITH DIAERESIS # # Latin 1 # 0x00A2 _cent_ 0x00A3 _pound_ 0x00A5 _yen_ 0x00A9 _copy_ 0x00AE _reg_ 0x00B2 2 0x00B3 3 0x00B5 b 0x00B6 _pp_ 0x00B9 1 0x00C0 A # LATIN CAPITAL LETTER A WITH GRAVE 0x00C1 A # LATIN CAPITAL LETTER A WITH ACUTE 0x00C2 A # LATIN CAPITAL LETTER A WITH CIRCUMFLEX 0x00C3 A # LATIN CAPITAL LETTER A WITH TILDE 0x00C4 A # LATIN CAPITAL LETTER A WITH DIAERESIS 0x00C5 A # LATIN CAPITAL LETTER A WITH RING ABOVE 0x00C6 AE # LATIN CAPITAL LETTER AE 0x00C7 C # LATIN CAPITAL LETTER C WITH CEDILLA 0x00C8 E # LATIN CAPITAL LETTER E WITH GRAVE 0x00C9 E # LATIN CAPITAL LETTER E WITH ACUTE 0x00CA E # LATIN CAPITAL LETTER E WITH CIRCUMFLEX 0x00CB E # LATIN CAPITAL LETTER E WITH DIAERESIS 0x00CC I # LATIN CAPITAL LETTER I WITH GRAVE 0x00CD I # LATIN CAPITAL LETTER I WITH ACUTE 0x00CE I # LATIN CAPITAL LETTER I WITH CIRCUMFLEX 0x00CF I # LATIN CAPITAL LETTER I WITH DIAERESIS 0x00D0 TH # LATIN CAPITAL LETTER ETH (Icelandic) 0x00D1 N # LATIN CAPITAL LETTER N WITH TILDE 0x00D2 O # LATIN CAPITAL LETTER O WITH GRAVE 0x00D3 O # LATIN CAPITAL LETTER O WITH ACUTE 0x00D4 O # LATIN CAPITAL LETTER O WITH CIRCUMFLEX 0x00D5 O # LATIN CAPITAL LETTER O WITH TILDE 0x00D6 O # LATIN CAPITAL LETTER O WITH DIAERESIS 0x00D7 x # MULTIPLICATION SIGN 0x00D8 O # LATIN CAPITAL LETTER O WITH STROKE 0x00D9 U # LATIN CAPITAL LETTER U WITH GRAVE 0x00DA U # LATIN CAPITAL LETTER U WITH ACUTE 0x00DB U # LATIN CAPITAL LETTER U WITH CIRCUMFLEX 0x00DC U # LATIN CAPITAL LETTER U WITH DIAERESIS 0x00DD Y # LATIN CAPITAL LETTER Y WITH ACUTE 0x00DE TH # LATIN CAPITAL LETTER THORN (Icelandic) 0x00DF ss # LATIN SMALL LETTER SHARP S (German) 0x00E0 a # LATIN SMALL LETTER A WITH GRAVE 0x00E1 a # LATIN SMALL LETTER A WITH ACUTE 0x00E2 a # LATIN SMALL LETTER A WITH CIRCUMFLEX 0x00E3 a # LATIN SMALL LETTER A WITH TILDE 0x00E4 a # LATIN SMALL LETTER A WITH DIAERESIS 0x00E5 a # LATIN SMALL LETTER A WITH RING ABOVE 0x00E6 ae # LATIN SMALL LETTER AE 0x00E7 c # LATIN SMALL LETTER C WITH CEDILLA 0x00E8 e # LATIN SMALL LETTER E WITH GRAVE 0x00E9 e # LATIN SMALL LETTER E WITH ACUTE 0x00EA e # LATIN SMALL LETTER E WITH CIRCUMFLEX 0x00EB e # LATIN SMALL LETTER E WITH DIAERESIS 0x00EC i # LATIN SMALL LETTER I WITH GRAVE 0x00ED i # LATIN SMALL LETTER I WITH ACUTE 0x00EE i # LATIN SMALL LETTER I WITH CIRCUMFLEX 0x00EF i # LATIN SMALL LETTER I WITH DIAERESIS 0x00F0 th # LATIN SMALL LETTER ETH (Icelandic) 0x00F1 n # LATIN SMALL LETTER N WITH TILDE 0x00F2 o # LATIN SMALL LETTER O WITH GRAVE 0x00F3 o # LATIN SMALL LETTER O WITH ACUTE 0x00F4 o # LATIN SMALL LETTER O WITH CIRCUMFLEX 0x00F5 o # LATIN SMALL LETTER O WITH TILDE 0x00F6 o # LATIN SMALL LETTER O WITH DIAERESIS 0x00F8 o # LATIN SMALL LETTER O WITH STROKE 0x00F9 u # LATIN SMALL LETTER U WITH GRAVE 0x00FA u # LATIN SMALL LETTER U WITH ACUTE 0x00FB u # LATIN SMALL LETTER U WITH CIRCUMFLEX 0x00FC u # LATIN SMALL LETTER U WITH DIAERESIS 0x00FD y # LATIN SMALL LETTER Y WITH ACUTE 0x00FE th # LATIN SMALL LETTER THORN (Icelandic) 0x00FF y # LATIN SMALL LETTER Y WITH DIAERESIS # # Latin Extended A # 0x0100 A # LATIN CAPITAL LETTER A WITH MACRON 0x0101 a # LATIN SMALL LETTER A WITH MACRON 0x0102 A # LATIN CAPITAL LETTER A WITH BREVE 0x0103 a # LATIN SMALL LETTER A WITH BREVE 0x0104 A # LATIN CAPITAL LETTER A WITH OGONEK 0x0105 a # LATIN SMALL LETTER A WITH OGONEK 0x0106 C # LATIN CAPITAL LETTER C WITH ACUTE 0x0107 c # LATIN SMALL LETTER C WITH ACUTE 0x0108 C # LATIN CAPITAL LETTER C WITH CIRCUMFLEX 0x0109 c # LATIN SMALL LETTER C WITH CIRCUMFLEX 0x010A C # LATIN CAPITAL LETTER C WITH DOT ABOVE 0x010B c # LATIN SMALL LETTER C WITH DOT ABOVE 0x010C C # LATIN CAPITAL LETTER C WITH CARON 0x010D c # LATIN SMALL LETTER C WITH CARON 0x010E D # LATIN CAPITAL LETTER D WITH CARON 0x010F d # LATIN SMALL LETTER D WITH CARON 0x0110 D # LATIN CAPITAL LETTER D WITH STROKE 0x0111 d # LATIN SMALL LETTER D WITH STROKE 0x0112 E # LATIN CAPITAL LETTER E WITH MACRON 0x0113 e # LATIN SMALL LETTER E WITH MACRON 0x0114 E # LATIN CAPITAL LETTER E WITH BREVE 0x0115 e # LATIN SMALL LETTER E WITH BREVE 0x0116 E # LATIN CAPITAL LETTER E WITH DOT ABOVE 0x0117 e # LATIN SMALL LETTER E WITH DOT ABOVE 0x0118 E # LATIN CAPITAL LETTER E WITH OGONEK 0x0119 e # LATIN SMALL LETTER E WITH OGONEK 0x011A E # LATIN CAPITAL LETTER E WITH CARON 0x011B e # LATIN SMALL LETTER E WITH CARON 0x011C G # LATIN CAPITAL LETTER G WITH CIRCUMFLEX 0x011D g # LATIN SMALL LETTER G WITH CIRCUMFLEX 0x011E G # LATIN CAPITAL LETTER G WITH BREVE 0x011F g # LATIN SMALL LETTER G WITH BREVE 0x0120 G # LATIN CAPITAL LETTER G WITH DOT ABOVE 0x0121 g # LATIN SMALL LETTER G WITH DOT ABOVE 0x0122 G # LATIN CAPITAL LETTER G WITH CEDILLA 0x0123 g # LATIN SMALL LETTER G WITH CEDILLA 0x0124 H # LATIN CAPITAL LETTER H WITH CIRCUMFLEX 0x0125 h # LATIN SMALL LETTER H WITH CIRCUMFLEX 0x0126 H # LATIN CAPITAL LETTER H WITH STROKE 0x0127 h # LATIN SMALL LETTER H WITH STROKE 0x0128 I # LATIN CAPITAL LETTER I WITH TILDE 0x0129 i # LATIN SMALL LETTER I WITH TILDE 0x012A I # LATIN CAPITAL LETTER I WITH MACRON 0x012B i # LATIN SMALL LETTER I WITH MACRON 0x012C I # LATIN CAPITAL LETTER I WITH BREVE 0x012D i # LATIN SMALL LETTER I WITH BREVE 0x012E I # LATIN CAPITAL LETTER I WITH OGONEK 0x012F i # LATIN SMALL LETTER I WITH OGONEK 0x0130 I # LATIN CAPITAL LETTER I WITH DOT ABOVE 0x0131 i # LATIN SMALL LETTER DOTLESS I 0x0132 IJ # LATIN CAPITAL LIGATURE IJ 0x0133 ij # LATIN SMALL LIGATURE IJ 0x0134 J # LATIN CAPITAL LETTER J WITH CIRCUMFLEX 0x0135 j # LATIN SMALL LETTER J WITH CIRCUMFLEX 0x0136 K # LATIN CAPITAL LETTER K WITH CEDILLA 0x0137 k # LATIN SMALL LETTER K WITH CEDILLA 0x0138 q # LATIN SMALL LETTER KRA (Greenlandic) 0x0139 L # LATIN CAPITAL LETTER L WITH ACUTE 0x013A l # LATIN SMALL LETTER L WITH ACUTE 0x013B L # LATIN CAPITAL LETTER L WITH CEDILLA 0x013C l # LATIN SMALL LETTER L WITH CEDILLA 0x013D L # LATIN CAPITAL LETTER L WITH CARON 0x013E l # LATIN SMALL LETTER L WITH CARON 0x013F L # LATIN CAPITAL LETTER L WITH MIDDLE DOT 0x0140 l # LATIN SMALL LETTER L WITH MIDDLE DOT 0x0141 L # LATIN CAPITAL LETTER L WITH STROKE 0x0142 l # LATIN SMALL LETTER L WITH STROKE 0x0143 N # LATIN CAPITAL LETTER N WITH ACUTE 0x0144 n # LATIN SMALL LETTER N WITH ACUTE 0x0145 N # LATIN CAPITAL LETTER N WITH CEDILLA 0x0146 n # LATIN SMALL LETTER N WITH CEDILLA 0x0147 N # LATIN CAPITAL LETTER N WITH CARON 0x0148 n # LATIN SMALL LETTER N WITH CARON 0x0149 n # LATIN SMALL LETTER N PRECEDED BY APOSTROPHE 0x014A NG # LATIN CAPITAL LETTER ENG (Sami) 0x014B ng # LATIN SMALL LETTER ENG (Sami) 0x014C O # LATIN CAPITAL LETTER O WITH MACRON 0x014D o # LATIN SMALL LETTER O WITH MACRON 0x014E O # LATIN CAPITAL LETTER O WITH BREVE 0x014F o # LATIN SMALL LETTER O WITH BREVE 0x0150 O # LATIN CAPITAL LETTER O WITH DOUBLE ACUTE 0x0151 o # LATIN SMALL LETTER O WITH DOUBLE ACUTE 0x0152 OE # LATIN CAPITAL LIGATURE OE 0x0153 oe # LATIN SMALL LIGATURE OE 0x0154 R # LATIN CAPITAL LETTER R WITH ACUTE 0x0155 r # LATIN SMALL LETTER R WITH ACUTE 0x0156 R # LATIN CAPITAL LETTER R WITH CEDILLA 0x0157 r # LATIN SMALL LETTER R WITH CEDILLA 0x0158 R # LATIN CAPITAL LETTER R WITH CARON 0x0159 r # LATIN SMALL LETTER R WITH CARON 0x015A S # LATIN CAPITAL LETTER S WITH ACUTE 0x015B s # LATIN SMALL LETTER S WITH ACUTE 0x015C S # LATIN CAPITAL LETTER S WITH CIRCUMFLEX 0x015D s # LATIN SMALL LETTER S WITH CIRCUMFLEX 0x015E S # LATIN CAPITAL LETTER S WITH CEDILLA 0x015F s # LATIN SMALL LETTER S WITH CEDILLA 0x0160 S # LATIN CAPITAL LETTER S WITH CARON 0x0161 s # LATIN SMALL LETTER S WITH CARON 0x0162 T # LATIN CAPITAL LETTER T WITH CEDILLA 0x0163 t # LATIN SMALL LETTER T WITH CEDILLA 0x0164 T # LATIN CAPITAL LETTER T WITH CARON 0x0165 t # LATIN SMALL LETTER T WITH CARON 0x0166 T # LATIN CAPITAL LETTER T WITH STROKE 0x0167 t # LATIN SMALL LETTER T WITH STROKE 0x0168 U # LATIN CAPITAL LETTER U WITH TILDE 0x0169 u # LATIN SMALL LETTER U WITH TILDE 0x016A U # LATIN CAPITAL LETTER U WITH MACRON 0x016B u # LATIN SMALL LETTER U WITH MACRON 0x016C U # LATIN CAPITAL LETTER U WITH BREVE 0x016D u # LATIN SMALL LETTER U WITH BREVE 0x016E U # LATIN CAPITAL LETTER U WITH RING ABOVE 0x016F u # LATIN SMALL LETTER U WITH RING ABOVE 0x0170 U # LATIN CAPITAL LETTER U WITH DOUBLE ACUTE 0x0171 u # LATIN SMALL LETTER U WITH DOUBLE ACUTE 0x0172 U # LATIN CAPITAL LETTER U WITH OGONEK 0x0173 u # LATIN SMALL LETTER U WITH OGONEK 0x0174 W # LATIN CAPITAL LETTER W WITH CIRCUMFLEX 0x0175 w # LATIN SMALL LETTER W WITH CIRCUMFLEX 0x0176 Y # LATIN CAPITAL LETTER Y WITH CIRCUMFLEX 0x0177 y # LATIN SMALL LETTER Y WITH CIRCUMFLEX 0x0178 Y # LATIN CAPITAL LETTER Y WITH DIAERESIS 0x0179 Z # LATIN CAPITAL LETTER Z WITH ACUTE 0x017A z # LATIN SMALL LETTER Z WITH ACUTE 0x017B Z # LATIN CAPITAL LETTER Z WITH DOT ABOVE 0x017C z # LATIN SMALL LETTER Z WITH DOT ABOVE 0x017D Z # LATIN CAPITAL LETTER Z WITH CARON 0x017E z # LATIN SMALL LETTER Z WITH CARON 0x017F s # LATIN SMALL LETTER LONG S # # Dunno where # 0x02C6 ^ # MODIFIER LETTER CIRCUMFLEX ACCENT 0x2010 - # HYPHEN 0x2011 - # NON-BREAKING HYPHEN 0x2012 - # FIGURE DASH 0x2013 - # EN DASH 0x2014 - # EM DASH 0x2015 - # HORIZONTAL BAR 0x2026 ... # HORIZONTAL ELLIPSIS 0x2122 _tm_ # TRADE MARK SIGN end # # German specific conversions # start de 0x00C4 AE # LATIN CAPITAL LETTER A WITH UMLAUT 0x00D6 OE # LATIN CAPITAL LETTER O WITH UMLAUT 0x00DC UE # LATIN CAPITAL LETTER U WITH UMLAUT 0x00E4 ae # LATIN SMALL LETTER A WITH UMLAUT 0x00F6 oe # LATIN SMALL LETTER O WITH UMLAUT 0x00FC ue # LATIN SMALL LETTER U WITH UMLAUT end detox-1.4.5/tests/000077500000000000000000000000001410625737000140135ustar00rootroot00000000000000detox-1.4.5/tests/build.sh000077500000000000000000000005261410625737000154540ustar00rootroot00000000000000#!/usr/bin/env bash set -ex # set up working dir WORK="/tmp/detox-build-test-$RANDOM" mkdir $WORK cd $WORK # git git clone -b 1.x https://github.com/dharple/detox cd detox # configure autoreconf --install ./configure # make make # tests src/detox -V tests/test.sh src/detox # distcheck make distcheck # cleanup cd rm -rf $WORK detox-1.4.5/tests/test-functions000066400000000000000000000073401410625737000167270ustar00rootroot00000000000000#!/bin/sh # # unit test functions # ## # Realpath polyfill for systems where it doesn't exist # # @param $1 Path to examine # if [ ! -x "$(command -v realpath)" ] ; then function realpath() { readlink -f $1 } fi ## # Executes a single test against a single function using a single table. # # @param $1 Detox Executable # @param $2 Input Filename # @param $3 Output Filename # @param $4 Method (utf_8, safe, etc) # @param $5 Table (path to the table to use) # # @return int 0 for success, 1 for failure # function test_single_table () { if [ -z "$1" -o -z "$2" -o -z "$3" -o -z "$4" -o -z "$5" ] ; then echo missing parameters return 1 fi local DETOX=$1 local INPUT=$2 local OUTPUT=$3 local METHOD=$4 local TABLE=$5 if [ ! -x "$DETOX" ] ; then echo $DETOX is not executable return 1 fi if [ ! -f "$TABLE" ] ; then echo $TABLE is not a file return 1 fi local BASE=/tmp/detoxtest/ if [ ! -d $BASE ] ; then mkdir $BASE fi local WORK=$(realpath $(mktemp -d $BASE/test-XXXXXX)) local TMPTABLE=$WORK/test.tbl cp $TABLE $TMPTABLE local SEQUENCE=unittest local RC=$WORK/detoxrc cat <<- DONE > $RC sequence $SEQUENCE { $METHOD { filename "$TMPTABLE"; }; }; DONE cd $WORK local ACTION="touch" local OPERATOR="-f" local CMDINPUT="$INPUT" if [ "${INPUT: -1}" = "/" ] ; then ACTION="mkdir" OPERATOR="-d" CMDINPUT="${INPUT:0: -1}" fi $ACTION "$CMDINPUT" $DETOX -s $SEQUENCE -f $RC "$CMDINPUT" if [ ! $OPERATOR "$OUTPUT" ] ; then echo renaming "$INPUT" to "$OUTPUT" failed return 1 fi return 0 } ## # Executes a single test against one or more functions in a sequence, using the # stock tables when applicable, from source control. # # @param $1 Detox Executable # @param $2 Input Filename # @param $3 Output Filename # @param $4 Path to Stock Tables # @param $5 First method (utf_8, safe, etc) # @param ... Additional methods # # @return int 0 for success, 1 for failure # function test_sequence () { if [ -z "$1" -o -z "$2" -o -z "$3" -o -z "$4" -o -z "$5" ] ; then echo missing parameters return 1 fi local DETOX=$1 local INPUT=$2 local OUTPUT=$3 local TABLEPATH=$4 shift 4 if [ ! -x "$DETOX" ] ; then echo $DETOX is not executable return 1 fi if [ ! -d "$TABLEPATH" ] ; then echo $TABLEPATH is not a dir return 1 fi local BASE=/tmp/detoxtest/ if [ ! -d $BASE ] ; then mkdir $BASE fi local WORK=$(realpath $(mktemp -d $BASE/test-XXXXXX)) local SEQUENCE=unittest local RC=$WORK/detoxrc cat <<- DONE > $RC sequence $SEQUENCE { DONE while [ -n "$1" ] ; do case $1 in safe | iso8859_1 | utf_8 ) local TABLE=$1.tbl if [ $1 = "utf_8" ] ; then TABLE="unicode.tbl" fi cp $TABLEPATH/$TABLE.sample $WORK/$TABLE cat <<- DONE >> $RC $1 { filename "$WORK/$TABLE"; }; DONE ;; lower | uncgi | wipeup ) cat <<- DONE >> $RC $1; DONE ;; wipeup-remove-trailing ) cat <<- DONE >> $RC wipeup { remove_trailing; }; DONE ;; max-length-32 ) cat <<- DONE >> $RC max_length { length 32; }; DONE ;; safe-basic ) cat <<- DONE >> $RC safe; DONE ;; utf_8-basic ) cat <<- DONE >> $RC utf_8; DONE ;; iso8859_1-basic ) cat <<- DONE >> $RC iso8859_1; DONE ;; *) echo "Unknown method $1"; return 1; ;; esac shift done cat <<- DONE >> $RC }; DONE cd $WORK local ACTION="touch" local OPERATOR="-f" local CMDINPUT="$INPUT" if [ "${INPUT: -1}" = "/" ] ; then ACTION="mkdir" OPERATOR="-d" CMDINPUT="${INPUT:0: -1}" fi $ACTION "$CMDINPUT" $DETOX -s $SEQUENCE -f $RC "$CMDINPUT" if [ ! $OPERATOR "$OUTPUT" ] ; then echo renaming "$INPUT" to "$OUTPUT" failed return 1 fi return 0 } detox-1.4.5/tests/test.sh000077500000000000000000000012011410625737000153230ustar00rootroot00000000000000#!/usr/bin/env bash # # Executes all unit tests # if [ -z $1 ] ; then echo missing detox path exit 1 fi . $(dirname "$0")/test-functions DETOX=$(realpath $1) if [ ! -x $DETOX ] ; then echo cannot find detox at $1 exit 1 fi cd $(dirname $0) export TESTBASE=$(pwd) SUCCESS=1 for DIR in tests/* ; do echo "------------------------------------------------------" echo running test $(basename $DIR) cd $DIR ./test.sh $DETOX if [ $? -ne 0 ] ; then SUCCESS=0 echo FAILED fi cd $TESTBASE done echo "------------------------------------------------------" if [ $SUCCESS -ne 1 ] ; then echo one or more tests failed exit 1 fi detox-1.4.5/tests/tests/000077500000000000000000000000001410625737000151555ustar00rootroot00000000000000detox-1.4.5/tests/tests/github-issue-0009/000077500000000000000000000000001410625737000201535ustar00rootroot00000000000000detox-1.4.5/tests/tests/github-issue-0009/test.sh000077500000000000000000000012231410625737000214670ustar00rootroot00000000000000#!/usr/bin/env bash # # Tests to confirm GitHub issue #9 is resolved # # https://github.com/dharple/detox/issues/9 # set -e if [ -z "$TESTBASE" ] ; then echo TESTBASE needs to be passed via the env exit 1 fi . $TESTBASE/test-functions DETOX=$1 TABLEPATH=$(dirname $TESTBASE)/table INPUT=$(printf "hi\tthere") OUTPUT="hi_there" # --------------------------------------------------------------------------- METHOD1=safe test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" # --------------------------------------------------------------------------- METHOD1=safe-basic test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" detox-1.4.5/tests/tests/github-issue-0011/000077500000000000000000000000001410625737000201445ustar00rootroot00000000000000detox-1.4.5/tests/tests/github-issue-0011/test.sh000077500000000000000000000023531410625737000214650ustar00rootroot00000000000000#!/usr/bin/env bash # # Tests to confirm GitHub issue #11 is resolved # # https://github.com/dharple/detox/issues/11 # set -e if [ -z "$TESTBASE" ] ; then echo TESTBASE needs to be passed via the env exit 1 fi . $TESTBASE/test-functions DETOX=$1 INPUT=$(printf ' '$'\n\n''song name'$'\n''by band'$'\n''/') OUTPUT="_______song_name_by_band_" METHOD="safe" TABLE=$(dirname $TESTBASE)/table/safe.tbl.sample test_single_table "$DETOX" "$INPUT" "$OUTPUT" "$METHOD" "$TABLE" # --------------------------------------------------------------------------- METHOD1=safe TABLEPATH=$(dirname $TESTBASE)/table test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" # --------------------------------------------------------------------------- METHOD1=safe-basic test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" # --------------------------------------------------------------------------- OUTPUT="$INPUT" METHOD1=uncgi test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" # --------------------------------------------------------------------------- OUTPUT="song_name_by_band_" METHOD1=uncgi METHOD2=safe METHOD3=wipeup test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2" "$METHOD3" detox-1.4.5/tests/tests/github-issue-0012/000077500000000000000000000000001410625737000201455ustar00rootroot00000000000000detox-1.4.5/tests/tests/github-issue-0012/test.sh000077500000000000000000000025541410625737000214710ustar00rootroot00000000000000#!/usr/bin/env bash # # Tests to confirm GitHub issue #12 is resolved # # https://github.com/dharple/detox/issues/12 # set -e if [ -z "$TESTBASE" ] ; then echo TESTBASE needs to be passed via the env exit 1 fi . $TESTBASE/test-functions DETOX=$1 CONFIGPATH=$(dirname $TESTBASE)/etc BASE=/tmp/detoxtest/ if [ ! -d $BASE ] ; then mkdir $BASE fi WORK=$(realpath $(mktemp -d $BASE/test-custom-XXXXXX)) # ----- cd $WORK touch "hi there" "another test" "wow" EXPECTED="hi_there another_test wow" $DETOX -r . for OUTPUT in $EXPECTED ; do if [ ! -f "$OUTPUT" ] ; then echo expected "$OUTPUT" not found exit 1 fi done # ----- cd $WORK touch "hi there2" "another test2" "wow2" EXPECTED="hi_there2 another_test2 wow2" cd $TESTBASE $DETOX -r $WORK cd $WORK for OUTPUT in $EXPECTED ; do if [ ! -f "$OUTPUT" ] ; then echo expected "$OUTPUT" not found exit 1 fi done # ----- cd $WORK mkdir 3 confirm.3 cd 3 touch "hi there3" "another test3" "wow3" EXPECTED="hi_there3 another_test3 wow3" cd $TESTBASE $DETOX -r $WORK/confirm.3/.. cd $WORK/3 for OUTPUT in $EXPECTED ; do if [ ! -f "$OUTPUT" ] ; then echo expected "$OUTPUT" not found exit 1 fi done # ----- INPUT="4/.gnome/ignore me" OUTPUT="$INPUT" cd $WORK mkdir -p 4/.gnome touch "$INPUT" $DETOX -f $CONFIGPATH/detoxrc.sample -r 4/ if [ ! -f "$OUTPUT" ] ; then echo expected "$OUTPUT" not found exit 1 fi detox-1.4.5/tests/tests/github-issue-0014/000077500000000000000000000000001410625737000201475ustar00rootroot00000000000000detox-1.4.5/tests/tests/github-issue-0014/test.sh000077500000000000000000000013551410625737000214710ustar00rootroot00000000000000#!/usr/bin/env bash # # Tests to confirm GitHub issue #14 is resolved # # https://github.com/dharple/detox/issues/14 # set -e if [ -z "$TESTBASE" ] ; then echo TESTBASE needs to be passed via the env exit 1 fi . $TESTBASE/test-functions # Run the test based on data from # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=861537 DETOX=$1 INPUT="mÉ Æ.txt" OUTPUT="mÉ_Æ.txt" METHOD="utf_8" TABLE="test.tbl" test_single_table "$DETOX" "$INPUT" "$OUTPUT" "$METHOD" "$TABLE" # --------------------------------------------------------------------------- # Run the same test, based on the default table OUTPUT="mE_AE.txt" TABLE=$(dirname $TESTBASE)/table/unicode.tbl.sample test_single_table "$DETOX" "$INPUT" "$OUTPUT" "$METHOD" "$TABLE" detox-1.4.5/tests/tests/github-issue-0014/test.tbl000066400000000000000000000013701410625737000216320ustar00rootroot00000000000000start 0x0026 _and_ # AMPERSAND # Chars to translate to _ 0x0020 _ # space 0x0021 _ # ! 0x0022 _ # " 0x0024 _ # $ 0x0027 _ # ' 0x002a _ # * 0x002f _ # / 0x003a _ # : 0x003b _ # ; 0x003c _ # < 0x003e _ # > 0x003f _ # ? 0x0040 _ # @ 0x005c _ # \ 0x0060 _ # ` 0x007c _ # | # Chars to translate to - 0x0028 - # ( 0x0029 - # ) 0x005b - # [ 0x005d - # ] 0x007b - # { 0x007d - # } #0x00c9 e #0x00c6 ae end detox-1.4.5/tests/tests/github-issue-0017/000077500000000000000000000000001410625737000201525ustar00rootroot00000000000000detox-1.4.5/tests/tests/github-issue-0017/test.sh000077500000000000000000000012251410625737000214700ustar00rootroot00000000000000#!/usr/bin/env bash # # Tests to confirm GitHub issue #17 is resolved # # https://github.com/dharple/detox/issues/17 # set -e if [ -z "$TESTBASE" ] ; then echo TESTBASE needs to be passed via the env exit 1 fi . $TESTBASE/test-functions DETOX=$1 TABLEPATH=$(dirname $TESTBASE)/table INPUT=$(printf "new\nline") OUTPUT="new_line" # --------------------------------------------------------------------------- METHOD1=safe test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" # --------------------------------------------------------------------------- METHOD1=safe-basic test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" detox-1.4.5/tests/tests/github-issue-0019/000077500000000000000000000000001410625737000201545ustar00rootroot00000000000000detox-1.4.5/tests/tests/github-issue-0019/test.sh000077500000000000000000000007131410625737000214730ustar00rootroot00000000000000#!/usr/bin/env bash # # Tests to confirm GitHub issue #19 is resolved # # https://github.com/dharple/detox/issues/19 # set -e if [ -z "$TESTBASE" ] ; then echo TESTBASE needs to be passed via the env exit 1 fi . $TESTBASE/test-functions # Run the test based on data from the issue DETOX=$1 INPUT="01 5G Core Networks.pdf" OUTPUT="01 5G Core Networks.pdf" METHOD="safe" TABLE="test.tbl" test_single_table "$DETOX" "$INPUT" "$OUTPUT" "$METHOD" "$TABLE" detox-1.4.5/tests/tests/github-issue-0019/test.tbl000066400000000000000000000006331410625737000216400ustar00rootroot00000000000000default start 0x23 _ # '#' 0x25 _ # % 0x2b + 0x2c _ # , 0x2d - 0x2e . 0x3d _ # = 0x5e _ # ^ 0x5f _ 0x7e ~ #0x20 _ # space 0x21 _ # ! 0x22 _ # " 0x24 _ # $ 0x27 _ # ' 0x2a _ # * 0x2f _ # / 0x3a _ # : 0x3b _ # ; 0x3c _ # < 0x3e _ # > 0x3f _ # ? #0x40 # @ 0x5c _ # \ 0x60 _ # ` 0x7c _ # | #0x28 - # ( #0x29 - # ) #0x5b - # [ #0x5d - # ] 0x7b - # { 0x7d - # } 0x26 _and_ # & end detox-1.4.5/tests/tests/github-issue-0056/000077500000000000000000000000001410625737000201555ustar00rootroot00000000000000detox-1.4.5/tests/tests/github-issue-0056/test.sh000077500000000000000000000020521410625737000214720ustar00rootroot00000000000000#!/usr/bin/env bash # # Tests to confirm GitHub issue #56 is resolved # # https://github.com/dharple/detox/issues/56 # set -e if [ -z "$TESTBASE" ] ; then echo TESTBASE needs to be passed via the env exit 1 fi . $TESTBASE/test-functions DETOX=$1 BASE=/tmp/detoxtest/ if [ ! -d $BASE ] ; then mkdir $BASE fi # ------------------------------------------------------------------------ WORK=$(realpath $(mktemp -d $BASE/test-custom-XXXXXX)) cd $WORK VALGRIND=$(command -v valgrind || true) touch a b c d e f g h i j k if [ -z "$VALGRIND" ] ; then echo WARNING: valgrind is not installed else $VALGRIND --quiet --error-exitcode=1 --track-origins=yes $DETOX a b c d e f g h i j k fi # ------------------------------------------------------------------------ INPUT="has space" OUTPUT="has_space" for COUNT in 10 100 1000 ; do WORK=$(realpath $(mktemp -d $BASE/test-custom-XXXXXX)) cd $WORK touch $(seq 1 $COUNT) "$INPUT" $DETOX $(seq 1 $COUNT) "$INPUT" if [ ! -f "$OUTPUT" ] ; then echo "Could not find expected file '$OUTPUT'" exit 1 fi done detox-1.4.5/tests/tests/legacy-dir/000077500000000000000000000000001410625737000171755ustar00rootroot00000000000000detox-1.4.5/tests/tests/legacy-dir/test.sh000077500000000000000000000015731410625737000205210ustar00rootroot00000000000000#!/usr/bin/env bash # # Subset of legacy regression tests: recursion # set -e if [ -z "$TESTBASE" ] ; then echo TESTBASE needs to be passed via the env exit 1 fi . $TESTBASE/test-functions DETOX=$1 BASE=/tmp/detoxtest/ if [ ! -d $BASE ] ; then mkdir $BASE fi WORK=$(realpath $(mktemp -d $BASE/test-custom-XXXXXX)) # ----- cd $WORK mkdir 1 2 3 4 5 INPUT="1/&ersand" touch "$INPUT" INPUT="2/|bar" touch "$INPUT" INPUT="3/:colon" touch "$INPUT" INPUT="4/,comma" touch "$INPUT" INPUT="5/#octothorpe" touch "$INPUT" INPUT="%percent" touch "$INPUT" INPUT="+plus" touch "$INPUT" INPUT=";semi colon" touch "$INPUT" # ----- cd $TESTBASE $DETOX -r $WORK cd $WORK # ----- EXPECTED="1/and_ampersand 2/bar 3/colon 4/,comma 5/octothorpe %percent +plus semi_colon" for OUTPUT in $EXPECTED ; do if [ ! -f "$OUTPUT" ] ; then echo expected "$OUTPUT" not found exit 1 fi done detox-1.4.5/tests/tests/legacy-iso8859_1-basic/000077500000000000000000000000001410625737000210465ustar00rootroot00000000000000detox-1.4.5/tests/tests/legacy-iso8859_1-basic/test.sh000077500000000000000000000025711410625737000223710ustar00rootroot00000000000000#!/usr/bin/env bash # # Subset of legacy regression tests: iso8859_1 # set -e if [ -z "$TESTBASE" ] ; then echo TESTBASE needs to be passed via the env exit 1 fi . $TESTBASE/test-functions DETOX=$1 TABLEPATH=$(dirname $TESTBASE)/table METHOD1=iso8859_1-basic METHOD2=safe-basic METHOD3=wipeup # --------------------------------------------------------------------------- INPUT="safe string" OUTPUT="safe_string" test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2" "$METHOD3" # --------------------------------------------------------------------------- INPUT=$(printf "\\xAE reg") OUTPUT="reg_reg" test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2" "$METHOD3" # --------------------------------------------------------------------------- INPUT=$(printf "\\xA9 copy") OUTPUT="copy_copy" test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2" "$METHOD3" # --------------------------------------------------------------------------- INPUT=$(printf "\\xC6 capital AE") OUTPUT="AE_capital_AE" test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2" "$METHOD3" # --------------------------------------------------------------------------- INPUT=$(printf "\\xDE capital thorn") OUTPUT="TH_capital_thorn" test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2" "$METHOD3" detox-1.4.5/tests/tests/legacy-iso8859_1/000077500000000000000000000000001410625737000177675ustar00rootroot00000000000000detox-1.4.5/tests/tests/legacy-iso8859_1/test.sh000077500000000000000000000025551410625737000213140ustar00rootroot00000000000000#!/usr/bin/env bash # # Subset of legacy regression tests: iso8859_1 # set -e if [ -z "$TESTBASE" ] ; then echo TESTBASE needs to be passed via the env exit 1 fi . $TESTBASE/test-functions DETOX=$1 TABLEPATH=$(dirname $TESTBASE)/table METHOD1=iso8859_1 METHOD2=safe METHOD3=wipeup # --------------------------------------------------------------------------- INPUT="safe string" OUTPUT="safe_string" test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2" "$METHOD3" # --------------------------------------------------------------------------- INPUT=$(printf "\\xAE reg") OUTPUT="reg_reg" test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2" "$METHOD3" # --------------------------------------------------------------------------- INPUT=$(printf "\\xA9 copy") OUTPUT="copy_copy" test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2" "$METHOD3" # --------------------------------------------------------------------------- INPUT=$(printf "\\xC6 capital AE") OUTPUT="AE_capital_AE" test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2" "$METHOD3" # --------------------------------------------------------------------------- INPUT=$(printf "\\xDE capital thorn") OUTPUT="TH_capital_thorn" test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2" "$METHOD3" detox-1.4.5/tests/tests/legacy-lower/000077500000000000000000000000001410625737000175475ustar00rootroot00000000000000detox-1.4.5/tests/tests/legacy-lower/test.sh000077500000000000000000000020641410625737000210670ustar00rootroot00000000000000#!/usr/bin/env bash # # Subset of legacy regression tests: lower # set -e if [ -z "$TESTBASE" ] ; then echo TESTBASE needs to be passed via the env exit 1 fi . $TESTBASE/test-functions DETOX=$1 TABLEPATH=$(dirname $TESTBASE)/table METHOD1=lower METHOD2=safe METHOD3=wipeup # --------------------------------------------------------------------------- INPUT="lower" OUTPUT="lower" test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2" "$METHOD3" # --------------------------------------------------------------------------- INPUT="L0W3R" OUTPUT="l0w3r" test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2" "$METHOD3" # --------------------------------------------------------------------------- INPUT="UPPER" OUTPUT="upper" test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2" "$METHOD3" # --------------------------------------------------------------------------- INPUT="UPPer_2" OUTPUT="upper_2" test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2" "$METHOD3" detox-1.4.5/tests/tests/legacy-max_32/000077500000000000000000000000001410625737000175105ustar00rootroot00000000000000detox-1.4.5/tests/tests/legacy-max_32/test.sh000077500000000000000000000025071410625737000210320ustar00rootroot00000000000000#!/usr/bin/env bash # # Subset of legacy regression tests: max_32 # set -e if [ -z "$TESTBASE" ] ; then echo TESTBASE needs to be passed via the env exit 1 fi . $TESTBASE/test-functions DETOX=$1 TABLEPATH=$(dirname $TESTBASE)/table METHOD1=safe METHOD2=wipeup METHOD3=max-length-32 # --------------------------------------------------------------------------- INPUT="___________underscore_______________________x" OUTPUT="underscore_x" test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2" "$METHOD3" # --------------------------------------------------------------------------- INPUT="..........how.....does.....this....translate......" OUTPUT="..........how.....does.....this." test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2" "$METHOD3" # --------------------------------------------------------------------------- INPUT="_-_-_-_-_-dotted-_-_-_-_line.....part......two......." OUTPUT="dotted-line.....part......two." test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2" "$METHOD3" # --------------------------------------------------------------------------- INPUT="registered trademark symbol, ®, is a typographic symbol" OUTPUT="registered_trademark_symbol,_®," test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2" "$METHOD3" detox-1.4.5/tests/tests/legacy-remove_trailing/000077500000000000000000000000001410625737000216055ustar00rootroot00000000000000detox-1.4.5/tests/tests/legacy-remove_trailing/test.sh000077500000000000000000000023731410625737000231300ustar00rootroot00000000000000#!/usr/bin/env bash # # Subset of legacy regression tests: remove_trailing # set -e if [ -z "$TESTBASE" ] ; then echo TESTBASE needs to be passed via the env exit 1 fi . $TESTBASE/test-functions DETOX=$1 TABLEPATH=$(dirname $TESTBASE)/table METHOD1=safe METHOD2=wipeup-remove-trailing # --------------------------------------------------------------------------- INPUT="___________underscore_______________________.x" OUTPUT="underscore.x" test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2" "$METHOD3" # --------------------------------------------------------------------------- INPUT="..........how.....does.....this....translate......" OUTPUT=".how.does.this.translate." test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2" "$METHOD3" # --------------------------------------------------------------------------- INPUT="_-_-_-_-_-dotted-_-_-_-_line.....part......two......." OUTPUT="dotted-line.part.two." test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2" "$METHOD3" # --------------------------------------------------------------------------- INPUT="blah-.-de_._da" OUTPUT="blah.de.da" test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2" "$METHOD3" detox-1.4.5/tests/tests/legacy-safe-basic/000077500000000000000000000000001410625737000204145ustar00rootroot00000000000000detox-1.4.5/tests/tests/legacy-safe-basic/test.sh000077500000000000000000000162161410625737000217400ustar00rootroot00000000000000#!/usr/bin/env bash # # Subset of legacy regression tests: safe # set -e if [ -z "$TESTBASE" ] ; then echo TESTBASE needs to be passed via the env exit 1 fi . $TESTBASE/test-functions DETOX=$1 TABLEPATH=$(dirname $TESTBASE)/table METHOD1=safe-basic METHOD2=wipeup # --------------------------------------------------------------------------- INPUT="lower" OUTPUT="lower" test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2" # --------------------------------------------------------------------------- INPUT="^acute" OUTPUT="^acute" test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2" # --------------------------------------------------------------------------- INPUT="&ersand" OUTPUT="and_ampersand" test_sequence "$DETOX" "$INPUT" "$OUTPUT" "$TABLEPATH" "$METHOD1" "$METHOD2" # --------------------------------------------------------------------------- INPUT="