summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2016-12-11 16:04:20 -0800
committerMichael Forney <mforney@mforney.org>2016-12-13 23:10:30 -0800
commit293f5a93b77d92fd65db7f3d0df654f102e46cfb (patch)
tree6ecd1170e3dd793862dd852814dc1b4cd5e44260 /extra
parent9a506a6834df01a26795cea222b410f206efa9fa (diff)
Move to flat package hierarchy
Note to self: never try to move submodules again To migrate your existing submodules (more or less): set -x set -e mkdir .git/modules/pkg for old in */*/src ; do new="pkg/${old#*/}" if ! [ -f "$old/.git" ] || [ "${old%%/*}" = pkg ] ; then continue fi git -C ".git/modules/$old" config core.worktree "../../../../../$new" rmdir "$new" mv "$old" "$new" sed -e "s,$old,$new," "$new/.git" > "$new/.git.tmp" mv "$new/.git.tmp" "$new/.git" mkdir ".git/modules/${new%/src}" mv ".git/modules/$old" ".git/modules/$new" rm "${old%/src}"/*.ninja mv "${old%/src}"/*.tar.{gz,xz,bz2} "${new%/src}/" rmdir "${old%/src}" || true done sed -e 's,^\[submodule "[^/]*/,[submodule "pkg/,' .git/config > .git/config.tmp mv .git/config.tmp .git/config
Diffstat (limited to 'extra')
-rw-r--r--extra/ccid/config.h27
-rw-r--r--extra/ccid/gen.rc31
-rw-r--r--extra/ccid/info_plist.awk31
-rw-r--r--extra/ccid/patch/0001-Check-in-source-files-from-ccid-1.4.24-distribution.patch5181
-rw-r--r--extra/ccid/rev1
m---------extra/ccid/src0
-rw-r--r--extra/efibootmgr/gen.rc11
-rw-r--r--extra/efibootmgr/rev1
m---------extra/efibootmgr/src0
-rw-r--r--extra/efivar/.gitignore1
-rw-r--r--extra/efivar/compat.h3
-rw-r--r--extra/efivar/gen.rc36
-rw-r--r--extra/efivar/patch/0001-Workaround-rename-of-linux-nvme.h.patch30
-rw-r--r--extra/efivar/rev1
m---------extra/efivar/src0
-rw-r--r--extra/fribidi/.gitignore1
-rw-r--r--extra/fribidi/config.h19
-rw-r--r--extra/fribidi/fribidi-config.h26
-rw-r--r--extra/fribidi/gen.rc63
-rw-r--r--extra/fribidi/rev1
m---------extra/fribidi/src0
-rw-r--r--extra/gen.rc23
-rw-r--r--extra/hostap/config.h17
-rw-r--r--extra/hostap/gen.rc88
-rw-r--r--extra/hostap/patch/0001-LibreSSL-Fix-dh5-code.patch38
-rw-r--r--extra/hostap/rev1
m---------extra/hostap/src0
-rw-r--r--extra/ii/gen.rc9
-rw-r--r--extra/ii/rev1
m---------extra/ii/src0
-rw-r--r--extra/less/.gitignore2
-rw-r--r--extra/less/defines.h99
-rw-r--r--extra/less/gen.rc17
-rw-r--r--extra/less/rev1
-rw-r--r--extra/less/sha2561
-rw-r--r--extra/less/url1
-rw-r--r--extra/libevent/config.h149
-rw-r--r--extra/libevent/gen.rc23
-rw-r--r--extra/libevent/rev1
m---------extra/libevent/src0
-rw-r--r--extra/libfuse/config.h22
-rw-r--r--extra/libfuse/gen.rc33
-rw-r--r--extra/libfuse/patch/0001-Fix-poll.h-include.patch25
-rw-r--r--extra/libfuse/rev1
m---------extra/libfuse/src0
-rw-r--r--extra/libnl/defs.h20
-rw-r--r--extra/libnl/gen.rc52
-rw-r--r--extra/libnl/rev1
m---------extra/libnl/src0
-rw-r--r--extra/libtermkey/.gitignore2
-rw-r--r--extra/libtermkey/gen.rc9
-rw-r--r--extra/libtermkey/rev1
-rw-r--r--extra/libtermkey/sha2561
-rw-r--r--extra/libtermkey/url1
-rw-r--r--extra/libusb/config.h38
-rw-r--r--extra/libusb/gen.rc14
-rw-r--r--extra/libusb/rev1
m---------extra/libusb/src0
-rw-r--r--extra/lpeg/.gitignore2
-rw-r--r--extra/lpeg/gen.rc8
-rw-r--r--extra/lpeg/rev1
-rw-r--r--extra/lpeg/sha2561
-rw-r--r--extra/lpeg/url1
-rw-r--r--extra/man-pages-posix/.gitignore2
-rw-r--r--extra/man-pages-posix/gen.rc7
-rw-r--r--extra/man-pages-posix/manpages.rc40
-rw-r--r--extra/man-pages-posix/rev0
-rw-r--r--extra/man-pages-posix/sha2561
-rw-r--r--extra/man-pages-posix/url1
-rw-r--r--extra/msmtp/config.h39
-rw-r--r--extra/msmtp/gen.rc29
-rw-r--r--extra/msmtp/patch/0001-Use-_Static_assert-instead-of-checking-for-size-of-l.patch40
-rw-r--r--extra/msmtp/rev1
m---------extra/msmtp/src0
-rw-r--r--extra/ncurses/.gitignore3
-rw-r--r--extra/ncurses/gen.rc128
-rw-r--r--extra/ncurses/gensources.awk29
-rw-r--r--extra/ncurses/ncurses_cfg.h86
-rw-r--r--extra/ncurses/rev1
-rw-r--r--extra/ncurses/sha2561
-rw-r--r--extra/ncurses/sources.txt158
-rw-r--r--extra/ncurses/subst.sed51
-rw-r--r--extra/ncurses/transform.h9
-rw-r--r--extra/ncurses/url1
-rw-r--r--extra/pcre/.gitignore2
-rw-r--r--extra/pcre/config.h64
-rw-r--r--extra/pcre/gen.rc41
-rw-r--r--extra/pcre/rev1
-rw-r--r--extra/pcre/sha2561
-rw-r--r--extra/pcre/url1
-rw-r--r--extra/pcsc/config.h66
-rw-r--r--extra/pcsc/gen.rc34
-rw-r--r--extra/pcsc/patch/0001-Add-tokenparser.c-from-pcsc-1.8.17-distribution.patch2058
-rw-r--r--extra/pcsc/rev1
m---------extra/pcsc/src0
-rw-r--r--extra/sshfs/config.h11
-rw-r--r--extra/sshfs/gen.rc15
-rw-r--r--extra/sshfs/patch/0001-Add-nocache.c-stub.patch113
-rw-r--r--extra/sshfs/patch/0002-Use-a-compact-array-and-free-list-for-requests.patch292
-rw-r--r--extra/sshfs/patch/0003-Use-bool-instead-of-gboolean.patch33
-rw-r--r--extra/sshfs/patch/0004-Use-struct-list_head-instead-of-GList.patch62
-rw-r--r--extra/sshfs/patch/0005-Use-standard-C-functions.patch277
-rw-r--r--extra/sshfs/patch/0006-Add-missing-includes.patch34
-rw-r--r--extra/sshfs/patch/0007-Disable-uidmap-and-gidmap-support.patch127
-rw-r--r--extra/sshfs/patch/0008-Remove-remaining-uses-of-glib.patch36
-rw-r--r--extra/sshfs/rev1
m---------extra/sshfs/src0
-rw-r--r--extra/the_silver_searcher/config.h24
-rw-r--r--extra/the_silver_searcher/gen.rc14
-rw-r--r--extra/the_silver_searcher/rev1
m---------extra/the_silver_searcher/src0
-rw-r--r--extra/transmission/.gitignore5
-rw-r--r--extra/transmission/config.h27
-rw-r--r--extra/transmission/gen.rc152
-rw-r--r--extra/transmission/rev1
-rw-r--r--extra/transmission/sha2561
-rw-r--r--extra/transmission/url1
-rw-r--r--extra/unzip/.gitignore2
-rw-r--r--extra/unzip/config.h15
-rw-r--r--extra/unzip/gen.rc15
-rw-r--r--extra/unzip/patch/0001-Drop-L-suffix-from-man-page-sections.patch319
-rw-r--r--extra/unzip/patch/0002-Handle-the-PKWare-verification-bit-of-internal-attri.patch32
-rw-r--r--extra/unzip/patch/0003-Restore-uid-and-gid-information-when-requested.patch39
-rw-r--r--extra/unzip/patch/0004-Initialize-the-symlink-flag.patch31
-rw-r--r--extra/unzip/patch/0005-Increase-size-of-cfactorstr-array-to-avoid-buffer-ov.patch27
-rw-r--r--extra/unzip/patch/0006-zipinfo.c-Do-not-crash-when-hostver-byte-is-100.patch27
-rw-r--r--extra/unzip/patch/0007-Fix-CVE-2014-8139-CRC32-verification-heap-based-over.patch64
-rw-r--r--extra/unzip/patch/0008-Fix-CVE-2014-8140-out-of-bounds-write-issue-in-test_.patch40
-rw-r--r--extra/unzip/patch/0009-Fix-CVE-2014-8141-out-of-bounds-read-issues-in-getZi.patch152
-rw-r--r--extra/unzip/patch/0010-Info-ZIP-UnZip-buffer-overflow.patch41
-rw-r--r--extra/unzip/patch/0011-Upstream-fix-for-heap-overflow.patch36
-rw-r--r--extra/unzip/patch/0012-fix-infinite-loop-when-extracting-empty-bzip2-data.patch30
-rw-r--r--extra/unzip/patch/0013-extract-prevent-unsigned-overflow-on-invalid-input.patch37
-rw-r--r--extra/unzip/rev1
-rw-r--r--extra/unzip/sha2561
-rw-r--r--extra/unzip/url1
-rw-r--r--extra/vis/gen.rc196
-rw-r--r--extra/vis/patch/0001-Allow-building-lpeg-statically.patch54
-rw-r--r--extra/vis/patch/0002-Set-default-theme-to-dark-16.patch25
-rw-r--r--extra/vis/rev1
m---------extra/vis/src0
141 files changed, 0 insertions, 11478 deletions
diff --git a/extra/ccid/config.h b/extra/ccid/config.h
deleted file mode 100644
index cc49a808..00000000
--- a/extra/ccid/config.h
+++ /dev/null
@@ -1,27 +0,0 @@
-#include <config-posix.h>
-
-#define BUNDLE "ifd-ccid.bundle"
-#define HAVE_LIBUSB_H 1
-#define HAVE_MEMORY_H 1
-#define HAVE_PTHREAD 1
-#define HAVE_PTHREAD_PRIO_INHERIT 1
-#define HAVE_STRLCAT 1
-#define HAVE_STRLCPY 1
-#define LT_OBJDIR ".libs/"
-/* #undef NO_LOG */
-#define PACKAGE "ccid"
-#define PACKAGE_BUGREPORT ""
-#define PACKAGE_NAME "ccid"
-#define PACKAGE_STRING "ccid 1.4.24"
-#define PACKAGE_TARNAME "ccid"
-#define PACKAGE_URL ""
-#define PACKAGE_VERSION "1.4.24"
-#define PCSCLITE_HP_DROPDIR "/lib/pcsc/drivers"
-/* #undef PTHREAD_CREATE_JOINABLE */
-#define TIME_WITH_SYS_TIME 1
-/* #undef USE_COMPOSITE_AS_MULTISLOT */
-/* #undef USE_SYSLOG */
-#define VERSION "1.4.24"
-/* #undef YYTEXT_POINTER */
-/* #undef const */
-/* #undef size_t */
diff --git a/extra/ccid/gen.rc b/extra/ccid/gen.rc
deleted file mode 100644
index 8cd552f3..00000000
--- a/extra/ccid/gen.rc
+++ /dev/null
@@ -1,31 +0,0 @@
-version=1.4.24
-cflags\
- -D HAVE_CONFIG_H\
- -isystem '$builddir'/extra/libusb/include\
- -isystem '$builddir'/extra/pcsc/include\
- -I include\
- -I '$dir' \
- -I '$srcdir'/src\
-
-phony deps extra/^(libusb pcsc)^/headers
-
-lib libccid.a -d '$dir'/deps src/^(\
- ccid.c \
- commands.c \
- ifdhandler.c \
- utils.c \
- ccid_usb.c\
- tokenparser.c\
- towitoko/atr.c \
- towitoko/pps.c \
- openct/buffer.c \
- openct/checksum.c \
- openct/proto-t1.c \
-)
-
-build '$outdir'/Info.plist awk '$srcdir'/src/Info.plist.src\
- '|' '$dir'/info_plist.awk '$srcdir'/readers/supported_readers.txt
-with expr '-f $dir/info_plist.awk -v readers=$srcdir/readers/supported_readers.txt target=libccid.a version='$version
-file lib/pcsc/drivers/ifd-ccid.bundle/Contents/Info.plist '$outdir'/Info.plist 644
-
-fetch git
diff --git a/extra/ccid/info_plist.awk b/extra/ccid/info_plist.awk
deleted file mode 100644
index 50b3fcf7..00000000
--- a/extra/ccid/info_plist.awk
+++ /dev/null
@@ -1,31 +0,0 @@
-BEGIN {
- n = 1
- while (getline < readers) {
- if ($0 ~ /^(#|$)/)
- continue
- split($0, r, ":")
- vendor[n] = r[1]
- product[n] = r[2]
- gsub("&", "&amp;", r[3])
- name[n] = r[3]
- ++n
- }
-}
-
-function printstrs(a) {
- for (i = 1; i < n; ++i)
- printf "\t\t<string>%s</string>\n", a[i]
-}
-
-/MAGIC_VENDOR/ {printstrs(vendor); next}
-/MAGIC_PRODUCT/ {printstrs(product); next}
-/MAGIC_FRIENDLYNAME/ {printstrs(name); next}
-/MAGIC_TARGET/ {sub("MAGIC_TARGET", target)}
-/MAGIC_VERSION/ {sub("MAGIC_VERSION", version)}
-/MAGIC_CLASS/ {
- print "\t<key>CFBundleName</key>"
- print "\t<string>CCIDCLASSDRIVER</string>"
- next
-}
-
-{print}
diff --git a/extra/ccid/patch/0001-Check-in-source-files-from-ccid-1.4.24-distribution.patch b/extra/ccid/patch/0001-Check-in-source-files-from-ccid-1.4.24-distribution.patch
deleted file mode 100644
index 75f32470..00000000
--- a/extra/ccid/patch/0001-Check-in-source-files-from-ccid-1.4.24-distribution.patch
+++ /dev/null
@@ -1,5181 +0,0 @@
-From 0dde59faca9805e0981eb598e5ad683e6da21d16 Mon Sep 17 00:00:00 2001
-From: Michael Forney <mforney@mforney.org>
-Date: Tue, 5 Jul 2016 22:26:57 -0700
-Subject: [PATCH] Check in source files from ccid 1.4.24 distribution
-
-This replaces some symlinks to ../PCSC/* with the actual files, and adds the
-generated tokenparser.c.
----
- src/misc.h | 84 ++-
- src/parser.h | 54 +-
- src/simclist.c | 1526 +++++++++++++++++++++++++++++++++++++++-
- src/simclist.h | 981 +++++++++++++++++++++++++-
- src/strlcpy.c | 61 +-
- src/strlcpycat.h | 46 +-
- src/tokenparser.c | 2020 +++++++++++++++++++++++++++++++++++++++++++++++++++++
- src/tokenparser.l | 283 +++++++-
- 8 files changed, 5048 insertions(+), 7 deletions(-)
- mode change 120000 => 100644 src/misc.h
- mode change 120000 => 100644 src/parser.h
- mode change 120000 => 100644 src/simclist.c
- mode change 120000 => 100644 src/simclist.h
- mode change 120000 => 100644 src/strlcpy.c
- mode change 120000 => 100644 src/strlcpycat.h
- create mode 100644 src/tokenparser.c
- mode change 120000 => 100644 src/tokenparser.l
-
-diff --git a/src/misc.h b/src/misc.h
-deleted file mode 120000
-index b47f6b0..0000000
---- a/src/misc.h
-+++ /dev/null
-@@ -1 +0,0 @@
--../PCSC/src/misc.h
-\ No newline at end of file
-diff --git a/src/misc.h b/src/misc.h
-new file mode 100644
-index 0000000..ea0d098
---- /dev/null
-+++ b/src/misc.h
-@@ -0,0 +1,83 @@
-+/*
-+ * This handles GCC attributes
-+ *
-+ * MUSCLE SmartCard Development ( http://pcsclite.alioth.debian.org/pcsclite.html )
-+ *
-+ * Copyright (C) 2005-2010
-+ * Ludovic Rousseau <ludovic.rousseau@free.fr>
-+ *
-+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. The name of the author may not be used to endorse or promote products
-+ derived from this software without specific prior written permission.
-+
-+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
-+ */
-+
-+#ifndef __misc_h__
-+#define __misc_h__
-+
-+/*
-+ * Declare the function as internal to the library: the function name is
-+ * not exported and can't be used by a program linked to the library
-+ *
-+ * see http://gcc.gnu.org/onlinedocs/gcc-3.3.5/gcc/Function-Attributes.html#Function-Attributes
-+ * see http://www.nedprod.com/programs/gccvisibility.html
-+ */
-+#if defined __GNUC__ && (! defined (__sun)) && (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3))
-+#define INTERNAL __attribute__ ((visibility("hidden")))
-+#define PCSC_API __attribute__ ((visibility("default")))
-+#elif (! defined __GNUC__ ) && defined (__sun)
-+/* http://wikis.sun.com/display/SunStudio/Macros+for+Shared+Library+Symbol+Visibility */
-+#define INTERNAL __hidden
-+#define PCSC_API __global
-+#else
-+#define INTERNAL
-+#define PCSC_API
-+#endif
-+#define EXTERNAL PCSC_API
-+
-+#if defined __GNUC__
-+
-+/* GNU Compiler Collection (GCC) */
-+#define CONSTRUCTOR __attribute__ ((constructor))
-+#define DESTRUCTOR __attribute__ ((destructor))
-+
-+#else
-+
-+/* SUN C compiler does not use __attribute__ but #pragma init (function)
-+ * We can't use a # inside a #define so it is not possible to use
-+ * #define CONSTRUCTOR_DECLARATION(x) #pragma init (x)
-+ * The #pragma is used directly where needed */
-+
-+/* any other */
-+#define CONSTRUCTOR
-+#define DESTRUCTOR
-+
-+#endif
-+
-+#ifndef min
-+#define min(a,b) (((a) < (b)) ? (a) : (b))
-+#endif
-+
-+#ifndef COUNT_OF
-+#define COUNT_OF(arr) (sizeof(arr)/sizeof(arr[0]))
-+#endif
-+
-+#endif /* __misc_h__ */
-diff --git a/src/parser.h b/src/parser.h
-deleted file mode 120000
-index 00feb5b..0000000
---- a/src/parser.h
-+++ /dev/null
-@@ -1 +0,0 @@
--../PCSC/src/parser.h
-\ No newline at end of file
-diff --git a/src/parser.h b/src/parser.h
-new file mode 100644
-index 0000000..09450dc
---- /dev/null
-+++ b/src/parser.h
-@@ -0,0 +1,53 @@
-+/*
-+ * MUSCLE SmartCard Development ( http://pcsclite.alioth.debian.org/pcsclite.html )
-+ *
-+ * Copyright (C) 2003
-+ * Toni Andjelkovic <toni@soth.at>
-+ * Copyright (C) 2003-2009
-+ * Ludovic Rousseau <ludovic.rousseau@free.fr>
-+ *
-+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. The name of the author may not be used to endorse or promote products
-+ derived from this software without specific prior written permission.
-+
-+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
-+ */
-+
-+/**
-+ * @file
-+ * @brief Reads lexical config files and updates database.
-+ */
-+
-+#ifndef __parser_h__
-+#define __parser_h__
-+
-+#include "simclist.h"
-+
-+struct bundleElt
-+{
-+ char *key;
-+ list_t values;
-+};
-+
-+int LTPBundleFindValueWithKey(list_t *l, const char *key, list_t **values);
-+int bundleParse(const char *fileName, list_t *l);
-+void bundleRelease(list_t *l);
-+
-+#endif
-diff --git a/src/simclist.c b/src/simclist.c
-deleted file mode 120000
-index 40933f2..0000000
---- a/src/simclist.c
-+++ /dev/null
-@@ -1 +0,0 @@
--../PCSC/src/simclist.c
-\ No newline at end of file
-diff --git a/src/simclist.c b/src/simclist.c
-new file mode 100644
-index 0000000..c8d36f5
---- /dev/null
-+++ b/src/simclist.c
-@@ -0,0 +1,1525 @@
-+/*
-+ * Copyright (c) 2007,2008,2009,2010,2011 Mij <mij@bitchx.it>
-+ *
-+ * Permission to use, copy, modify, and distribute this software for any
-+ * purpose with or without fee is hereby granted, provided that the above
-+ * copyright notice and this permission notice appear in all copies.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-+ */
-+
-+
-+/*
-+ * SimCList library. See http://mij.oltrelinux.com/devel/simclist
-+ */
-+
-+/* SimCList implementation, version 1.6 */
-+
-+#include <stdlib.h>
-+#include <string.h>
-+#include <errno.h> /* for setting errno */
-+#include <sys/types.h>
-+#ifndef _WIN32
-+ /* not in Windows! */
-+# include <unistd.h>
-+# include <stdint.h>
-+#endif
-+#ifndef SIMCLIST_NO_DUMPRESTORE
-+ /* includes for dump/restore */
-+# include <time.h>
-+# include <sys/uio.h> /* for READ_ERRCHECK() and write() */
-+# include <fcntl.h> /* for open() etc */
-+# ifndef _WIN32
-+# include <arpa/inet.h> /* for htons() on UNIX */
-+# else
-+# include <winsock2.h> /* for htons() on Windows */
-+# endif
-+#endif
-+
-+/* disable asserts */
-+#ifndef SIMCLIST_DEBUG
-+#define NDEBUG
-+#endif
-+
-+#include <assert.h>
-+
-+
-+#include <sys/stat.h> /* for open()'s access modes S_IRUSR etc */
-+#include <limits.h>
-+
-+#if defined(_MSC_VER) || defined(__MINGW32__)
-+/* provide gettimeofday() missing in Windows */
-+int gettimeofday(struct timeval *tp, void *tzp) {
-+ DWORD t;
-+
-+ /* XSI says: "If tzp is not a null pointer, the behavior is unspecified" */
-+ assert(tzp == NULL);
-+
-+ t = timeGetTime();
-+ tp->tv_sec = t / 1000;
-+ tp->tv_usec = t % 1000;
-+ return 0;
-+}
-+#endif
-+
-+
-+/* work around lack of inttypes.h support in broken Microsoft Visual Studio compilers */
-+#if !defined(_WIN32) || !defined(_MSC_VER)
-+# include <inttypes.h> /* (u)int*_t */
-+#else
-+# include <basetsd.h>
-+typedef UINT8 uint8_t;
-+typedef UINT16 uint16_t;
-+typedef ULONG32 uint32_t;
-+typedef UINT64 uint64_t;
-+typedef INT8 int8_t;
-+typedef INT16 int16_t;
-+typedef LONG32 int32_t;
-+typedef INT64 int64_t;
-+#endif
-+
-+
-+/* define some commodity macros for Dump/Restore functionality */
-+#ifndef SIMCLIST_NO_DUMPRESTORE
-+/* write() decorated with error checking logic */
-+#define WRITE_ERRCHECK(fd, msgbuf, msglen) do { \
-+ if (write(fd, msgbuf, msglen) < 0) return -1; \
-+ } while (0);
-+/* READ_ERRCHECK() decorated with error checking logic */
-+#define READ_ERRCHECK(fd, msgbuf, msglen) do { \
-+ if (read(fd, msgbuf, msglen) != msglen) { \
-+ /*errno = EPROTO;*/ \
-+ return -1; \
-+ } \
-+ } while (0);
-+
-+/* convert 64bit integers from host to network format */
-+#define hton64(x) (\
-+ htons(1) == 1 ? \
-+ (uint64_t)x /* big endian */ \
-+ : /* little endian */ \
-+ ((uint64_t)((((uint64_t)(x) & 0xff00000000000000ULL) >> 56) | \
-+ (((uint64_t)(x) & 0x00ff000000000000ULL) >> 40) | \
-+ (((uint64_t)(x) & 0x0000ff0000000000ULL) >> 24) | \
-+ (((uint64_t)(x) & 0x000000ff00000000ULL) >> 8) | \
-+ (((uint64_t)(x) & 0x00000000ff000000ULL) << 8) | \
-+ (((uint64_t)(x) & 0x0000000000ff0000ULL) << 24) | \
-+ (((uint64_t)(x) & 0x000000000000ff00ULL) << 40) | \
-+ (((uint64_t)(x) & 0x00000000000000ffULL) << 56))) \
-+ )
-+
-+/* convert 64bit integers from network to host format */
-+#define ntoh64(x) (hton64(x))
-+#endif
-+
-+/* some OSes don't have EPROTO (eg OpenBSD) */
-+#ifndef EPROTO
-+#define EPROTO EIO
-+#endif
-+
-+#ifdef SIMCLIST_WITH_THREADS
-+/* limit (approx) to the number of threads running
-+ * for threaded operations. Only meant when
-+ * SIMCLIST_WITH_THREADS is defined */
-+#define SIMCLIST_MAXTHREADS 2
-+#endif
-+
-+/*
-+ * how many elems to keep as spare. During a deletion, an element
-+ * can be saved in a "free-list", not free()d immediately. When
-+ * latter insertions are performed, spare elems can be used instead
-+ * of malloc()ing new elems.
-+ *
-+ * about this param, some values for appending
-+ * 10 million elems into an empty list:
-+ * (#, time[sec], gain[%], gain/no[%])
-+ * 0 2,164 0,00 0,00 <-- feature disabled
-+ * 1 1,815 34,9 34,9
-+ * 2 1,446 71,8 35,9 <-- MAX gain/no
-+ * 3 1,347 81,7 27,23
-+ * 5 1,213 95,1 19,02
-+ * 8 1,064 110,0 13,75
-+ * 10 1,015 114,9 11,49 <-- MAX gain w/ likely sol
-+ * 15 1,019 114,5 7,63
-+ * 25 0,985 117,9 4,72
-+ * 50 1,088 107,6 2,15
-+ * 75 1,016 114,8 1,53
-+ * 100 0,988 117,6 1,18
-+ * 150 1,022 114,2 0,76
-+ * 200 0,939 122,5 0,61 <-- MIN time
-+ */
-+#ifndef SIMCLIST_MAX_SPARE_ELEMS
-+#define SIMCLIST_MAX_SPARE_ELEMS 5
-+#endif
-+
-+
-+#ifdef SIMCLIST_WITH_THREADS
-+#include <pthread.h>
-+#endif
-+
-+#include "simclist.h"
-+
-+
-+/* minumum number of elements for sorting with quicksort instead of insertion */
-+#define SIMCLIST_MINQUICKSORTELS 24
-+
-+
-+/* list dump declarations */
-+#define SIMCLIST_DUMPFORMAT_VERSION 1 /* (short integer) version of fileformat managed by _dump* and _restore* functions */
-+
-+#define SIMCLIST_DUMPFORMAT_HEADERLEN 30 /* length of the header */
-+
-+/* header for a list dump */
-+struct list_dump_header_s {
-+ uint16_t ver; /* version */
-+ int32_t timestamp_sec; /* dump timestamp, seconds since UNIX Epoch */
-+ int32_t timestamp_usec; /* dump timestamp, microseconds since timestamp_sec */
-+ int32_t rndterm; /* random value terminator -- terminates the data sequence */
-+
-+ uint32_t totlistlen; /* sum of every element' size, bytes */
-+ uint32_t numels; /* number of elements */
-+ uint32_t elemlen; /* bytes length of an element, for constant-size lists, <= 0 otherwise */
-+ int32_t listhash; /* hash of the list at the time of dumping, or 0 if to be ignored */
-+};
-+
-+
-+
-+/* deletes tmp from list, with care wrt its position (head, tail, middle) */
-+static int list_drop_elem(list_t *restrict l, struct list_entry_s *tmp, unsigned int pos);
-+
-+/* set default values for initialized lists */
-+static int list_attributes_setdefaults(list_t *restrict l);
-+
-+#ifndef NDEBUG
-+/* check whether the list internal REPresentation is valid -- Costs O(n) */
-+static int list_repOk(const list_t *restrict l);
-+
-+/* check whether the list attribute set is valid -- Costs O(1) */
-+static int list_attrOk(const list_t *restrict l);
-+#endif
-+
-+/* do not inline, this is recursive */
-+static void list_sort_quicksort(list_t *restrict l, int versus,
-+ unsigned int first, struct list_entry_s *fel,
-+ unsigned int last, struct list_entry_s *lel);
-+
-+static inline void list_sort_selectionsort(list_t *restrict l, int versus,
-+ unsigned int first, struct list_entry_s *fel,
-+ unsigned int last, struct list_entry_s *lel);
-+
-+static void *list_get_minmax(const list_t *restrict l, int versus);
-+
-+static inline struct list_entry_s *list_findpos(const list_t *restrict l, int posstart);
-+
-+/*
-+ * Random Number Generator
-+ *
-+ * The user is expected to seed the RNG (ie call srand()) if
-+ * SIMCLIST_SYSTEM_RNG is defined.
-+ *
-+ * Otherwise, a self-contained RNG based on LCG is used; see
-+ * http://en.wikipedia.org/wiki/Linear_congruential_generator .
-+ *
-+ * Facts pro local RNG:
-+ * 1. no need for the user to call srand() on his own
-+ * 2. very fast, possibly faster than OS
-+ * 3. avoid interference with user's RNG
-+ *
-+ * Facts pro system RNG:
-+ * 1. may be more accurate (irrelevant for SimCList randno purposes)
-+ * 2. why reinvent the wheel
-+ *
-+ * Default to local RNG for user's ease of use.
-+ */
-+
-+#ifdef SIMCLIST_SYSTEM_RNG
-+/* keep track whether we initialized already (non-0) or not (0) */
-+static unsigned random_seed = 0;
-+
-+/* use local RNG */
-+static inline void seed_random(void) {
-+ if (random_seed == 0)
-+ random_seed = (unsigned)getpid() ^ (unsigned)time(NULL);
-+}
-+
-+static inline long get_random(void) {
-+ random_seed = (1664525 * random_seed + 1013904223);
-+ return random_seed;
-+}
-+
-+#else
-+/* use OS's random generator */
-+# define seed_random()
-+# define get_random() (rand())
-+#endif
-+
-+
-+/* list initialization */
-+int list_init(list_t *restrict l) {
-+ if (l == NULL) return -1;
-+
-+ seed_random();
-+
-+ l->numels = 0;
-+
-+ /* head/tail sentinels and mid pointer */
-+ l->head_sentinel = (struct list_entry_s *)malloc(sizeof(struct list_entry_s));
-+ l->tail_sentinel = (struct list_entry_s *)malloc(sizeof(struct list_entry_s));
-+ l->head_sentinel->next = l->tail_sentinel;
-+ l->tail_sentinel->prev = l->head_sentinel;
-+ l->head_sentinel->prev = l->tail_sentinel->next = l->mid = NULL;
-+ l->head_sentinel->data = l->tail_sentinel->data = NULL;
-+
-+ /* iteration attributes */
-+ l->iter_active = 0;
-+ l->iter_pos = 0;
-+ l->iter_curentry = NULL;
-+
-+ /* free-list attributes */
-+ l->spareels = (struct list_entry_s **)malloc(SIMCLIST_MAX_SPARE_ELEMS * sizeof(struct list_entry_s *));
-+ l->spareelsnum = 0;
-+
-+#ifdef SIMCLIST_WITH_THREADS
-+ l->threadcount = 0;
-+#endif
-+
-+ list_attributes_setdefaults(l);
-+
-+ assert(list_repOk(l));
-+ assert(list_attrOk(l));
-+
-+ return 0;
-+}
-+
-+void list_destroy(list_t *restrict l) {
-+ unsigned int i;
-+
-+ list_clear(l);
-+ for (i = 0; i < l->spareelsnum; i++) {
-+ free(l->spareels[i]);
-+ }
-+ free(l->spareels);
-+ free(l->head_sentinel);
-+ free(l->tail_sentinel);
-+}
-+
-+int list_attributes_setdefaults(list_t *restrict l) {
-+ l->attrs.comparator = NULL;
-+ l->attrs.seeker = NULL;
-+
-+ /* also free() element data when removing and element from the list */
-+ l->attrs.meter = NULL;
-+ l->attrs.copy_data = 0;
-+
-+ l->attrs.hasher = NULL;
-+
-+ /* serializer/unserializer */
-+ l->attrs.serializer = NULL;
-+ l->attrs.unserializer = NULL;
-+
-+ assert(list_attrOk(l));
-+
-+ return 0;
-+}
-+
-+/* setting list properties */
-+int list_attributes_comparator(list_t *restrict l, element_comparator comparator_fun) {
-+ if (l == NULL) return -1;
-+
-+ l->attrs.comparator = comparator_fun;
-+
-+ assert(list_attrOk(l));
-+
-+ return 0;
-+}
-+
-+int list_attributes_seeker(list_t *restrict l, element_seeker seeker_fun) {
-+ if (l == NULL) return -1;
-+
-+ l->attrs.seeker = seeker_fun;
-+ assert(list_attrOk(l));
-+
-+ return 0;
-+}
-+
-+int list_attributes_copy(list_t *restrict l, element_meter metric_fun, int copy_data) {
-+ if (l == NULL || (metric_fun == NULL && copy_data != 0)) return -1;
-+
-+ l->attrs.meter = metric_fun;
-+ l->attrs.copy_data = copy_data;
-+
-+ assert(list_attrOk(l));
-+
-+ return 0;
-+}
-+
-+int list_attributes_hash_computer(list_t *restrict l, element_hash_computer hash_computer_fun) {
-+ if (l == NULL) return -1;
-+
-+ l->attrs.hasher = hash_computer_fun;
-+ assert(list_attrOk(l));
-+ return 0;
-+}
-+
-+int list_attributes_serializer(list_t *restrict l, element_serializer serializer_fun) {
-+ if (l == NULL) return -1;
-+
-+ l->attrs.serializer = serializer_fun;
-+ assert(list_attrOk(l));
-+ return 0;
-+}
-+
-+int list_attributes_unserializer(list_t *restrict l, element_unserializer unserializer_fun) {
-+ if (l == NULL) return -1;
-+
-+ l->attrs.unserializer = unserializer_fun;
-+ assert(list_attrOk(l));
-+ return 0;
-+}
-+
-+int list_append(list_t *restrict l, const void *data) {
-+ return list_insert_at(l, data, l->numels);
-+}
-+
-+int list_prepend(list_t *restrict l, const void *data) {
-+ return list_insert_at(l, data, 0);
-+}
-+
-+void *list_fetch(list_t *restrict l) {
-+ return list_extract_at(l, 0);
-+}
-+
-+void *list_get_at(const list_t *restrict l, unsigned int pos) {
-+ struct list_entry_s *tmp;
-+
-+ tmp = list_findpos(l, pos);
-+
-+ return (tmp != NULL ? tmp->data : NULL);
-+}
-+
-+void *list_get_max(const list_t *restrict l) {
-+ return list_get_minmax(l, +1);
-+}
-+
-+void *list_get_min(const list_t *restrict l) {
-+ return list_get_minmax(l, -1);
-+}
-+
-+/* REQUIRES {list->numels >= 1}
-+ * return the min (versus < 0) or max value (v > 0) in l */
-+static void *list_get_minmax(const list_t *restrict l, int versus) {
-+ void *curminmax;
-+ struct list_entry_s *s;
-+
-+ if (l->attrs.comparator == NULL || l->numels == 0)
-+ return NULL;
-+
-+ curminmax = l->head_sentinel->next->data;
-+ for (s = l->head_sentinel->next->next; s != l->tail_sentinel; s = s->next) {
-+ if (l->attrs.comparator(curminmax, s->data) * versus > 0)
-+ curminmax = s->data;
-+ }
-+
-+ return curminmax;
-+}
-+
-+/* set tmp to point to element at index posstart in l */
-+static inline struct list_entry_s *list_findpos(const list_t *restrict l, int posstart) {
-+ struct list_entry_s *ptr;
-+ float x;
-+ int i;
-+
-+ /* accept 1 slot overflow for fetching head and tail sentinels */
-+ if (posstart < -1 || posstart > (int)l->numels) return NULL;
-+
-+ x = (float)(posstart+1) / l->numels;
-+ if (x <= 0.25) {
-+ /* first quarter: get to posstart from head */
-+ for (i = -1, ptr = l->head_sentinel; i < posstart; ptr = ptr->next, i++);
-+ } else if (x < 0.5) {
-+ /* second quarter: get to posstart from mid */
-+ for (i = (l->numels-1)/2, ptr = l->mid; i > posstart; ptr = ptr->prev, i--);
-+ } else if (x <= 0.75) {
-+ /* third quarter: get to posstart from mid */
-+ for (i = (l->numels-1)/2, ptr = l->mid; i < posstart; ptr = ptr->next, i++);
-+ } else {
-+ /* fourth quarter: get to posstart from tail */
-+ for (i = l->numels, ptr = l->tail_sentinel; i > posstart; ptr = ptr->prev, i--);
-+ }
-+
-+ return ptr;
-+}
-+
-+void *list_extract_at(list_t *restrict l, unsigned int pos) {
-+ struct list_entry_s *tmp;
-+ void *data;
-+
-+ if (l->iter_active || pos >= l->numels) return NULL;
-+
-+ tmp = list_findpos(l, pos);
-+ data = tmp->data;
-+
-+ tmp->data = NULL; /* save data from list_drop_elem() free() */
-+ list_drop_elem(l, tmp, pos);
-+ l->numels--;
-+
-+ assert(list_repOk(l));
-+
-+ return data;
-+}
-+
-+int list_insert_at(list_t *restrict l, const void *data, unsigned int pos) {
-+ struct list_entry_s *lent, *succ, *prec;
-+
-+ if (l->iter_active || pos > l->numels) return -1;
-+
-+ /* this code optimizes malloc() with a free-list */
-+ if (l->spareelsnum > 0) {
-+ lent = l->spareels[l->spareelsnum-1];
-+ l->spareelsnum--;
-+ } else {
-+ lent = (struct list_entry_s *)malloc(sizeof(struct list_entry_s));
-+ if (lent == NULL)
-+ return -1;
-+ }
-+
-+ if (l->attrs.copy_data) {
-+ /* make room for user' data (has to be copied) */
-+ size_t datalen = l->attrs.meter(data);
-+ lent->data = (struct list_entry_s *)malloc(datalen);
-+ memcpy(lent->data, data, datalen);
-+ } else {
-+ lent->data = (void*)data;
-+ }
-+
-+ /* actually append element */
-+ prec = list_findpos(l, pos-1);
-+ succ = prec->next;
-+
-+ prec->next = lent;
-+ lent->prev = prec;
-+ lent->next = succ;
-+ succ->prev = lent;
-+
-+ l->numels++;
-+
-+ /* fix mid pointer */
-+ if (l->numels == 1) { /* first element, set pointer */
-+ l->mid = lent;
-+ } else if (l->numels % 2) { /* now odd */
-+ if (pos >= (l->numels-1)/2) l->mid = l->mid->next;
-+ } else { /* now even */
-+ if (pos <= (l->numels-1)/2) l->mid = l->mid->prev;
-+ }
-+
-+ assert(list_repOk(l));
-+
-+ return 1;
-+}
-+
-+int list_delete(list_t *restrict l, const void *data) {
-+ int pos, r;
-+
-+ pos = list_locate(l, data);
-+ if (pos < 0)
-+ return -1;
-+
-+ r = list_delete_at(l, pos);
-+ if (r < 0)
-+ return -1;
-+
-+ assert(list_repOk(l));
-+
-+ return 0;
-+}
-+
-+int list_delete_at(list_t *restrict l, unsigned int pos) {
-+ struct list_entry_s *delendo;
-+
-+
-+ if (l->iter_active || pos >= l->numels) return -1;
-+
-+ delendo = list_findpos(l, pos);
-+
-+ list_drop_elem(l, delendo, pos);
-+
-+ l->numels--;
-+
-+
-+ assert(list_repOk(l));
-+
-+ return 0;
-+}
-+
-+int list_delete_range(list_t *restrict l, unsigned int posstart, unsigned int posend) {
-+ struct list_entry_s *lastvalid, *tmp, *tmp2;
-+ unsigned int numdel, midposafter, i;
-+ int movedx;
-+
-+ if (l->iter_active || posend < posstart || posend >= l->numels) return -1;
-+
-+ numdel = posend - posstart + 1;
-+ if (numdel == l->numels) return list_clear(l);
-+
-+ tmp = list_findpos(l, posstart); /* first el to be deleted */
-+ lastvalid = tmp->prev; /* last valid element */
-+
-+ midposafter = (l->numels-1-numdel)/2;
-+
-+ midposafter = midposafter < posstart ? midposafter : midposafter+numdel;
-+ movedx = midposafter - (l->numels-1)/2;
-+
-+ if (movedx > 0) { /* move right */
-+ for (i = 0; i < (unsigned int)movedx; l->mid = l->mid->next, i++);
-+ } else { /* move left */
-+ movedx = -movedx;
-+ for (i = 0; i < (unsigned int)movedx; l->mid = l->mid->prev, i++);
-+ }
-+
-+ assert(posstart == 0 || lastvalid != l->head_sentinel);
-+ i = posstart;
-+ if (l->attrs.copy_data) {
-+ /* also free element data */
-+ for (; i <= posend; i++) {
-+ tmp2 = tmp;
-+ tmp = tmp->next;
-+ if (tmp2->data != NULL) free(tmp2->data);
-+ if (l->spareelsnum < SIMCLIST_MAX_SPARE_ELEMS) {
-+ l->spareels[l->spareelsnum++] = tmp2;
-+ } else {
-+ free(tmp2);
-+ }
-+ }
-+ } else {
-+ /* only free containers */
-+ for (; i <= posend; i++) {
-+ tmp2 = tmp;
-+ tmp = tmp->next;
-+ if (l->spareelsnum < SIMCLIST_MAX_SPARE_ELEMS) {
-+ l->spareels[l->spareelsnum++] = tmp2;
-+ } else {
-+ free(tmp2);
-+ }
-+ }
-+ }
-+ assert(i == posend+1 && (posend != l->numels || tmp == l->tail_sentinel));
-+
-+ lastvalid->next = tmp;
-+ tmp->prev = lastvalid;
-+
-+ l->numels -= posend - posstart + 1;
-+
-+ assert(list_repOk(l));
-+
-+ return numdel;
-+}
-+
-+int list_clear(list_t *restrict l) {
-+ struct list_entry_s *s;
-+ unsigned int numels;
-+
-+ /* will be returned */
-+ numels = l->numels;
-+
-+ if (l->iter_active) return -1;
-+
-+ if (l->attrs.copy_data) { /* also free user data */
-+ /* spare a loop conditional with two loops: spareing elems and freeing elems */
-+ for (s = l->head_sentinel->next; l->spareelsnum < SIMCLIST_MAX_SPARE_ELEMS && s != l->tail_sentinel; s = s->next) {
-+ /* move elements as spares as long as there is room */
-+ if (s->data != NULL) free(s->data);
-+ l->spareels[l->spareelsnum++] = s;
-+ }
-+ while (s != l->tail_sentinel) {
-+ /* free the remaining elems */
-+ if (s->data != NULL) free(s->data);
-+ s = s->next;
-+ free(s->prev);
-+ }
-+ l->head_sentinel->next = l->tail_sentinel;
-+ l->tail_sentinel->prev = l->head_sentinel;
-+ } else { /* only free element containers */
-+ /* spare a loop conditional with two loops: spareing elems and freeing elems */
-+ for (s = l->head_sentinel->next; l->spareelsnum < SIMCLIST_MAX_SPARE_ELEMS && s != l->tail_sentinel; s = s->next) {
-+ /* move elements as spares as long as there is room */
-+ l->spareels[l->spareelsnum++] = s;
-+ }
-+ while (s != l->tail_sentinel) {
-+ /* free the remaining elems */
-+ s = s->next;
-+ free(s->prev);
-+ }
-+ l->head_sentinel->next = l->tail_sentinel;
-+ l->tail_sentinel->prev = l->head_sentinel;
-+ }
-+ l->numels = 0;
-+ l->mid = NULL;
-+
-+ assert(list_repOk(l));
-+
-+ return numels;
-+}
-+
-+unsigned int list_size(const list_t *restrict l) {
-+ return l->numels;
-+}
-+
-+int list_empty(const list_t *restrict l) {
-+ return (l->numels == 0);
-+}
-+
-+int list_locate(const list_t *restrict l, const void *data) {
-+ struct list_entry_s *el;
-+ int pos = 0;
-+
-+ if (l->attrs.comparator != NULL) {
-+ /* use comparator */
-+ for (el = l->head_sentinel->next; el != l->tail_sentinel; el = el->next, pos++) {
-+ if (l->attrs.comparator(data, el->data) == 0) break;
-+ }
-+ } else {
-+ /* compare references */
-+ for (el = l->head_sentinel->next; el != l->tail_sentinel; el = el->next, pos++) {
-+ if (el->data == data) break;
-+ }
-+ }
-+ if (el == l->tail_sentinel) return -1;
-+
-+ return pos;
-+}
-+
-+void *list_seek(list_t *restrict l, const void *indicator) {
-+ const struct list_entry_s *iter;
-+
-+ if (l->attrs.seeker == NULL) return NULL;
-+
-+ for (iter = l->head_sentinel->next; iter != l->tail_sentinel; iter = iter->next) {
-+ if (l->attrs.seeker(iter->data, indicator) != 0) return iter->data;
-+ }
-+
-+ return NULL;
-+}
-+
-+int list_contains(const list_t *restrict l, const void *data) {
-+ return (list_locate(l, data) >= 0);
-+}
-+
-+int list_concat(const list_t *l1, const list_t *l2, list_t *restrict dest) {
-+ struct list_entry_s *el, *srcel;
-+ unsigned int cnt;
-+ int err;
-+
-+
-+ if (l1 == NULL || l2 == NULL || dest == NULL || l1 == dest || l2 == dest)
-+ return -1;
-+
-+ list_init(dest);
-+
-+ dest->numels = l1->numels + l2->numels;
-+ if (dest->numels == 0)
-+ return 0;
-+
-+ /* copy list1 */
-+ srcel = l1->head_sentinel->next;
-+ el = dest->head_sentinel;
-+ while (srcel != l1->tail_sentinel) {
-+ el->next = (struct list_entry_s *)malloc(sizeof(struct list_entry_s));
-+ el->next->prev = el;
-+ el = el->next;
-+ el->data = srcel->data;
-+ srcel = srcel->next;
-+ }
-+ dest->mid = el; /* approximate position (adjust later) */
-+ /* copy list 2 */
-+ srcel = l2->head_sentinel->next;
-+ while (srcel != l2->tail_sentinel) {
-+ el->next = (struct list_entry_s *)malloc(sizeof(struct list_entry_s));
-+ el->next->prev = el;
-+ el = el->next;
-+ el->data = srcel->data;
-+ srcel = srcel->next;
-+ }
-+ el->next = dest->tail_sentinel;
-+ dest->tail_sentinel->prev = el;
-+
-+ /* fix mid pointer */
-+ err = l2->numels - l1->numels;
-+ if ((err+1)/2 > 0) { /* correct pos RIGHT (err-1)/2 moves */
-+ err = (err+1)/2;
-+ for (cnt = 0; cnt < (unsigned int)err; cnt++) dest->mid = dest->mid->next;
-+ } else if (err/2 < 0) { /* correct pos LEFT (err/2)-1 moves */
-+ err = -err/2;
-+ for (cnt = 0; cnt < (unsigned int)err; cnt++) dest->mid = dest->mid->prev;
-+ }
-+
-+ assert(!(list_repOk(l1) && list_repOk(l2)) || list_repOk(dest));
-+
-+ return 0;
-+}
-+
-+int list_sort(list_t *restrict l, int versus) {
-+ if (l->iter_active || l->attrs.comparator == NULL) /* cannot modify list in the middle of an iteration */
-+ return -1;
-+
-+ if (l->numels <= 1)
-+ return 0;
-+ list_sort_quicksort(l, versus, 0, l->head_sentinel->next, l->numels-1, l->tail_sentinel->prev);
-+ assert(list_repOk(l));
-+ return 0;
-+}
-+
-+#ifdef SIMCLIST_WITH_THREADS
-+struct list_sort_wrappedparams {
-+ list_t *restrict l;
-+ int versus;
-+ unsigned int first, last;
-+ struct list_entry_s *fel, *lel;
-+};
-+
-+static void *list_sort_quicksort_threadwrapper(void *wrapped_params) {
-+ struct list_sort_wrappedparams *wp = (struct list_sort_wrappedparams *)wrapped_params;
-+ list_sort_quicksort(wp->l, wp->versus, wp->first, wp->fel, wp->last, wp->lel);
-+ free(wp);
-+ pthread_exit(NULL);
-+ return NULL;
-+}
-+#endif
-+
-+static inline void list_sort_selectionsort(list_t *restrict l, int versus,
-+ unsigned int first, struct list_entry_s *fel,
-+ unsigned int last, struct list_entry_s *lel) {
-+ struct list_entry_s *cursor, *toswap, *firstunsorted;
-+ void *tmpdata;
-+
-+ if (last <= first) /* <= 1-element lists are always sorted */
-+ return;
-+
-+ for (firstunsorted = fel; firstunsorted != lel; firstunsorted = firstunsorted->next) {
-+ /* find min or max in the remainder of the list */
-+ for (toswap = firstunsorted, cursor = firstunsorted->next; cursor != lel->next; cursor = cursor->next)
-+ if (l->attrs.comparator(toswap->data, cursor->data) * -versus > 0) toswap = cursor;
-+ if (toswap != firstunsorted) { /* swap firstunsorted with toswap */
-+ tmpdata = firstunsorted->data;
-+ firstunsorted->data = toswap->data;
-+ toswap->data = tmpdata;
-+ }
-+ }
-+}
-+
-+static void list_sort_quicksort(list_t *restrict l, int versus,
-+ unsigned int first, struct list_entry_s *fel,
-+ unsigned int last, struct list_entry_s *lel) {
-+ unsigned int pivotid;
-+ unsigned int i;
-+ register struct list_entry_s *pivot;
-+ struct list_entry_s *left, *right;
-+ void *tmpdata;
-+#ifdef SIMCLIST_WITH_THREADS
-+ pthread_t tid;
-+ int traised;
-+#endif
-+
-+
-+ if (last <= first) /* <= 1-element lists are always sorted */
-+ return;
-+
-+ if (last - first+1 <= SIMCLIST_MINQUICKSORTELS) {
-+ list_sort_selectionsort(l, versus, first, fel, last, lel);
-+ return;
-+ }
-+
-+ /* base of iteration: one element list */
-+ if (! (last > first)) return;
-+
-+ pivotid = (get_random() % (last - first + 1));
-+ /* pivotid = (last - first + 1) / 2; */
-+
-+ /* find pivot */
-+ if (pivotid < (last - first + 1)/2) {
-+ for (i = 0, pivot = fel; i < pivotid; pivot = pivot->next, i++);
-+ } else {
-+ for (i = last - first, pivot = lel; i > pivotid; pivot = pivot->prev, i--);
-+ }
-+
-+ /* smaller PIVOT bigger */
-+ left = fel;
-+ right = lel;
-+ /* iterate --- left ---> PIV <--- right --- */
-+ while (left != pivot && right != pivot) {
-+ for (; left != pivot && (l->attrs.comparator(left->data, pivot->data) * -versus <= 0); left = left->next);
-+ /* left points to a smaller element, or to pivot */
-+ for (; right != pivot && (l->attrs.comparator(right->data, pivot->data) * -versus >= 0); right = right->prev);
-+ /* right points to a bigger element, or to pivot */
-+ if (left != pivot && right != pivot) {
-+ /* swap, then move iterators */
-+ tmpdata = left->data;
-+ left->data = right->data;
-+ right->data = tmpdata;
-+
-+ left = left->next;
-+ right = right->prev;
-+ }
-+ }
-+
-+ /* now either left points to pivot (end run), or right */
-+ if (right == pivot) { /* left part longer */
-+ while (left != pivot) {
-+ if (l->attrs.comparator(left->data, pivot->data) * -versus > 0) {
-+ tmpdata = left->data;
-+ left->data = pivot->prev->data;
-+ pivot->prev->data = pivot->data;
-+ pivot->data = tmpdata;
-+ pivot = pivot->prev;
-+ pivotid--;
-+ if (pivot == left) break;
-+ } else {
-+ left = left->next;
-+ }
-+ }
-+ } else { /* right part longer */
-+ while (right != pivot) {
-+ if (l->attrs.comparator(right->data, pivot->data) * -versus < 0) {
-+ /* move current right before pivot */
-+ tmpdata = right->data;
-+ right->data = pivot->next->data;
-+ pivot->next->data = pivot->data;
-+ pivot->data = tmpdata;
-+ pivot = pivot->next;
-+ pivotid++;
-+ if (pivot == right) break;
-+ } else {
-+ right = right->prev;
-+ }
-+ }
-+ }
-+
-+ /* sort sublists A and B : |---A---| pivot |---B---| */
-+
-+#ifdef SIMCLIST_WITH_THREADS
-+ traised = 0;
-+ if (pivotid > 0) {
-+ /* prepare wrapped args, then start thread */
-+ if (l->threadcount < SIMCLIST_MAXTHREADS-1) {
-+ struct list_sort_wrappedparams *wp = (struct list_sort_wrappedparams *)malloc(sizeof(struct list_sort_wrappedparams));
-+ l->threadcount++;
-+ traised = 1;
-+ wp->l = l;
-+ wp->versus = versus;
-+ wp->first = first;
-+ wp->fel = fel;
-+ wp->last = first+pivotid-1;
-+ wp->lel = pivot->prev;
-+ if (pthread_create(&tid, NULL, list_sort_quicksort_threadwrapper, wp) != 0) {
-+ free(wp);
-+ traised = 0;
-+ list_sort_quicksort(l, versus, first, fel, first+pivotid-1, pivot->prev);
-+ }
-+ } else {
-+ list_sort_quicksort(l, versus, first, fel, first+pivotid-1, pivot->prev);
-+ }
-+ }
-+ if (first + pivotid < last) list_sort_quicksort(l, versus, first+pivotid+1, pivot->next, last, lel);
-+ if (traised) {
-+ pthread_join(tid, (void **)NULL);
-+ l->threadcount--;
-+ }
-+#else
-+ if (pivotid > 0) list_sort_quicksort(l, versus, first, fel, first+pivotid-1, pivot->prev);
-+ if (first + pivotid < last) list_sort_quicksort(l, versus, first+pivotid+1, pivot->next, last, lel);
-+#endif
-+}
-+
-+int list_iterator_start(list_t *restrict l) {
-+ if (l->iter_active) return 0;
-+ l->iter_pos = 0;
-+ l->iter_active = 1;
-+ l->iter_curentry = l->head_sentinel->next;
-+ return 1;
-+}
-+
-+void *list_iterator_next(list_t *restrict l) {
-+ void *toret;
-+
-+ if (! l->iter_active) return NULL;
-+
-+ toret = l->iter_curentry->data;
-+ l->iter_curentry = l->iter_curentry->next;
-+ l->iter_pos++;
-+
-+ return toret;
-+}
-+
-+int list_iterator_hasnext(const list_t *restrict l) {
-+ if (! l->iter_active) return 0;
-+ return (l->iter_pos < l->numels);
-+}
-+
-+int list_iterator_stop(list_t *restrict l) {
-+ if (! l->iter_active) return 0;
-+ l->iter_pos = 0;
-+ l->iter_active = 0;
-+ return 1;
-+}
-+
-+int list_hash(const list_t *restrict l, list_hash_t *restrict hash) {
-+ struct list_entry_s *x;
-+ list_hash_t tmphash;
-+
-+ assert(hash != NULL);
-+
-+ tmphash = l->numels * 2 + 100;
-+ if (l->attrs.hasher == NULL) {
-+#ifdef SIMCLIST_ALLOW_LOCATIONBASED_HASHES
-+ /* ENABLE WITH CARE !! */
-+#warning "Memlocation-based hash is consistent only for testing modification in the same program run."
-+ int i;
-+
-+ /* only use element references */
-+ for (x = l->head_sentinel->next; x != l->tail_sentinel; x = x->next) {
-+ for (i = 0; i < sizeof(x->data); i++) {
-+ tmphash += (tmphash ^ (uintptr_t)x->data);
-+ }
-+ tmphash += tmphash % l->numels;
-+ }
-+#else
-+ return -1;
-+#endif
-+ } else {
-+ /* hash each element with the user-given function */
-+ for (x = l->head_sentinel->next; x != l->tail_sentinel; x = x->next) {
-+ tmphash += tmphash ^ l->attrs.hasher(x->data);
-+ tmphash += tmphash % l->numels;
-+ }
-+ }
-+
-+ *hash = tmphash;
-+
-+ return 0;
-+}
-+
-+#ifndef SIMCLIST_NO_DUMPRESTORE
-+int list_dump_getinfo_filedescriptor(int fd, list_dump_info_t *restrict info) {
-+ int32_t terminator_head, terminator_tail;
-+ uint32_t elemlen;
-+ off_t hop;
-+
-+
-+ /* version */
-+ READ_ERRCHECK(fd, & info->version, sizeof(info->version));
-+ info->version = ntohs(info->version);
-+ if (info->version > SIMCLIST_DUMPFORMAT_VERSION) {
-+ errno = EILSEQ;
-+ return -1;
-+ }
-+
-+ /* timestamp.tv_sec and timestamp.tv_usec */
-+ READ_ERRCHECK(fd, & info->timestamp.tv_sec, sizeof(info->timestamp.tv_sec));
-+ info->timestamp.tv_sec = ntohl(info->timestamp.tv_sec);
-+ READ_ERRCHECK(fd, & info->timestamp.tv_usec, sizeof(info->timestamp.tv_usec));
-+ info->timestamp.tv_usec = ntohl(info->timestamp.tv_usec);
-+
-+ /* list terminator (to check thereafter) */
-+ READ_ERRCHECK(fd, & terminator_head, sizeof(terminator_head));
-+ terminator_head = ntohl(terminator_head);
-+
-+ /* list size */
-+ READ_ERRCHECK(fd, & info->list_size, sizeof(info->list_size));
-+ info->list_size = ntohl(info->list_size);
-+
-+ /* number of elements */
-+ READ_ERRCHECK(fd, & info->list_numels, sizeof(info->list_numels));
-+ info->list_numels = ntohl(info->list_numels);
-+
-+ /* length of each element (for checking for consistency) */
-+ READ_ERRCHECK(fd, & elemlen, sizeof(elemlen));
-+ elemlen = ntohl(elemlen);
-+
-+ /* list hash */
-+ READ_ERRCHECK(fd, & info->list_hash, sizeof(info->list_hash));
-+ info->list_hash = ntohl(info->list_hash);
-+
-+ /* check consistency */
-+ if (elemlen > 0) {
-+ /* constant length, hop by size only */
-+ hop = info->list_size;
-+ } else {
-+ /* non-constant length, hop by size + all element length blocks */
-+ hop = info->list_size + elemlen*info->list_numels;
-+ }
-+ if (lseek(fd, hop, SEEK_CUR) == -1) {
-+ return -1;
-+ }
-+
-+ /* read the trailing value and compare with terminator_head */
-+ READ_ERRCHECK(fd, & terminator_tail, sizeof(terminator_tail));
-+ terminator_tail = ntohl(terminator_tail);
-+
-+ if (terminator_head == terminator_tail)
-+ info->consistent = 1;
-+ else
-+ info->consistent = 0;
-+
-+ return 0;
-+}
-+
-+int list_dump_getinfo_file(const char *restrict filename, list_dump_info_t *restrict info) {
-+ int fd, ret;
-+
-+ fd = open(filename, O_RDONLY, 0);
-+ if (fd < 0) return -1;
-+
-+ ret = list_dump_getinfo_filedescriptor(fd, info);
-+ close(fd);
-+
-+ return ret;
-+}
-+
-+int list_dump_filedescriptor(const list_t *restrict l, int fd, size_t *restrict len) {
-+ struct list_entry_s *x;
-+ void *ser_buf;
-+ uint32_t bufsize;
-+ struct timeval timeofday;
-+ struct list_dump_header_s header;
-+
-+ if (l->attrs.meter == NULL && l->attrs.serializer == NULL) {
-+ errno = ENOTTY;
-+ return -1;
-+ }
-+
-+ /**** DUMP FORMAT ****
-+
-+ [ ver timestamp | totlen numels elemlen hash | DATA ]
-+
-+ where DATA can be:
-+ @ for constant-size list (element size is constant; elemlen > 0)
-+ [ elem elem ... elem ]
-+ @ for other lists (element size dictated by element_meter each time; elemlen <= 0)
-+ [ size elem size elem ... size elem ]
-+
-+ all integers are encoded in NETWORK BYTE FORMAT
-+ *****/
-+
-+
-+ /* prepare HEADER */
-+ /* version */
-+ header.ver = htons( SIMCLIST_DUMPFORMAT_VERSION );
-+
-+ /* timestamp */
-+ gettimeofday(&timeofday, NULL);
-+ header.timestamp_sec = htonl(timeofday.tv_sec);
-+ header.timestamp_usec = htonl(timeofday.tv_usec);
-+
-+ header.rndterm = htonl((int32_t)get_random());
-+
-+ /* total list size is postprocessed afterwards */
-+
-+ /* number of elements */
-+ header.numels = htonl(l->numels);
-+
-+ /* include an hash, if possible */
-+ if (l->attrs.hasher != NULL) {
-+ if (htonl(list_hash(l, & header.listhash)) != 0) {
-+ /* could not compute list hash! */
-+ return -1;
-+ }
-+ } else {
-+ header.listhash = htonl(0);
-+ }
-+
-+ header.totlistlen = header.elemlen = 0;
-+
-+ /* leave room for the header at the beginning of the file */
-+ if (lseek(fd, SIMCLIST_DUMPFORMAT_HEADERLEN, SEEK_SET) < 0) {
-+ /* errno set by lseek() */
-+ return -1;
-+ }
-+
-+ /* write CONTENT */
-+ if (l->numels > 0) {
-+ /* SPECULATE that the list has constant element size */
-+
-+ if (l->attrs.serializer != NULL) { /* user user-specified serializer */
-+ /* get preliminary length of serialized element in header.elemlen */
-+ ser_buf = l->attrs.serializer(l->head_sentinel->next->data, & header.elemlen);
-+ free(ser_buf);
-+ /* request custom serialization of each element */
-+ for (x = l->head_sentinel->next; x != l->tail_sentinel; x = x->next) {
-+ ser_buf = l->attrs.serializer(x->data, &bufsize);
-+ header.totlistlen += bufsize;
-+ if (header.elemlen != 0) { /* continue on speculation */
-+ if (header.elemlen != bufsize) {
-+ free(ser_buf);
-+ /* constant element length speculation broken! */
-+ header.elemlen = 0;
-+ header.totlistlen = 0;
-+ x = l->head_sentinel;
-+ if (lseek(fd, SIMCLIST_DUMPFORMAT_HEADERLEN, SEEK_SET) < 0) {
-+ /* errno set by lseek() */
-+ return -1;
-+ }
-+ /* restart from the beginning */
-+ continue;
-+ }
-+ /* speculation confirmed */
-+ WRITE_ERRCHECK(fd, ser_buf, bufsize);
-+ } else { /* speculation found broken */
-+ WRITE_ERRCHECK(fd, & bufsize, sizeof(size_t));
-+ WRITE_ERRCHECK(fd, ser_buf, bufsize);
-+ }
-+ free(ser_buf);
-+ }
-+ } else if (l->attrs.meter != NULL) {
-+ header.elemlen = (uint32_t)l->attrs.meter(l->head_sentinel->next->data);
-+
-+ /* serialize the element straight from its data */
-+ for (x = l->head_sentinel->next; x != l->tail_sentinel; x = x->next) {
-+ bufsize = l->attrs.meter(x->data);
-+ header.totlistlen += bufsize;
-+ if (header.elemlen != 0) {
-+ if (header.elemlen != bufsize) {
-+ /* constant element length speculation broken! */
-+ header.elemlen = 0;
-+ header.totlistlen = 0;
-+ x = l->head_sentinel;
-+ /* restart from the beginning */
-+ continue;
-+ }
-+ WRITE_ERRCHECK(fd, x->data, bufsize);
-+ } else {
-+ WRITE_ERRCHECK(fd, &bufsize, sizeof(size_t));
-+ WRITE_ERRCHECK(fd, x->data, bufsize);
-+ }
-+ }
-+ }
-+ /* adjust endianness */
-+ header.elemlen = htonl(header.elemlen);
-+ header.totlistlen = htonl(header.totlistlen);
-+ }
-+
-+ /* write random terminator */
-+ WRITE_ERRCHECK(fd, & header.rndterm, sizeof(header.rndterm)); /* list terminator */
-+
-+
-+ /* write header */
-+ lseek(fd, 0, SEEK_SET);
-+
-+ WRITE_ERRCHECK(fd, & header.ver, sizeof(header.ver)); /* version */
-+ WRITE_ERRCHECK(fd, & header.timestamp_sec, sizeof(header.timestamp_sec)); /* timestamp seconds */
-+ WRITE_ERRCHECK(fd, & header.timestamp_usec, sizeof(header.timestamp_usec)); /* timestamp microseconds */
-+ WRITE_ERRCHECK(fd, & header.rndterm, sizeof(header.rndterm)); /* random terminator */
-+
-+ WRITE_ERRCHECK(fd, & header.totlistlen, sizeof(header.totlistlen)); /* total length of elements */
-+ WRITE_ERRCHECK(fd, & header.numels, sizeof(header.numels)); /* number of elements */
-+ WRITE_ERRCHECK(fd, & header.elemlen, sizeof(header.elemlen)); /* size of each element, or 0 for independent */
-+ WRITE_ERRCHECK(fd, & header.listhash, sizeof(header.listhash)); /* list hash, or 0 for "ignore" */
-+
-+
-+ /* possibly store total written length in "len" */
-+ if (len != NULL) {
-+ *len = sizeof(header) + ntohl(header.totlistlen);
-+ }
-+
-+ return 0;
-+}
-+
-+int list_restore_filedescriptor(list_t *restrict l, int fd, size_t *restrict len) {
-+ struct list_dump_header_s header;
-+ unsigned long cnt;
-+ void *buf;
-+ uint32_t elsize, totreadlen, totmemorylen;
-+
-+ memset(& header, 0, sizeof(header));
-+
-+ /* read header */
-+
-+ /* version */
-+ READ_ERRCHECK(fd, &header.ver, sizeof(header.ver));
-+ header.ver = ntohs(header.ver);
-+ if (header.ver != SIMCLIST_DUMPFORMAT_VERSION) {
-+ errno = EILSEQ;
-+ return -1;
-+ }
-+
-+ /* timestamp */
-+ READ_ERRCHECK(fd, & header.timestamp_sec, sizeof(header.timestamp_sec));
-+ header.timestamp_sec = ntohl(header.timestamp_sec);
-+ READ_ERRCHECK(fd, & header.timestamp_usec, sizeof(header.timestamp_usec));
-+ header.timestamp_usec = ntohl(header.timestamp_usec);
-+
-+ /* list terminator */
-+ READ_ERRCHECK(fd, & header.rndterm, sizeof(header.rndterm));
-+
-+ header.rndterm = ntohl(header.rndterm);
-+
-+ /* total list size */
-+ READ_ERRCHECK(fd, & header.totlistlen, sizeof(header.totlistlen));
-+ header.totlistlen = ntohl(header.totlistlen);
-+
-+ /* number of elements */
-+ READ_ERRCHECK(fd, & header.numels, sizeof(header.numels));
-+ header.numels = ntohl(header.numels);
-+
-+ /* length of every element, or '0' = variable */
-+ READ_ERRCHECK(fd, & header.elemlen, sizeof(header.elemlen));
-+ header.elemlen = ntohl(header.elemlen);
-+
-+ /* list hash, or 0 = 'ignore' */
-+ READ_ERRCHECK(fd, & header.listhash, sizeof(header.listhash));
-+ header.listhash = ntohl(header.listhash);
-+
-+
-+ /* read content */
-+ totreadlen = totmemorylen = 0;
-+ if (header.elemlen > 0) {
-+ /* elements have constant size = header.elemlen */
-+ if (l->attrs.unserializer != NULL) {
-+ /* use unserializer */
-+ buf = malloc(header.elemlen);
-+ for (cnt = 0; cnt < header.numels; cnt++) {
-+ READ_ERRCHECK(fd, buf, header.elemlen);
-+ list_append(l, l->attrs.unserializer(buf, & elsize));
-+ totmemorylen += elsize;
-+ }
-+ } else {
-+ /* copy verbatim into memory */
-+ for (cnt = 0; cnt < header.numels; cnt++) {
-+ buf = malloc(header.elemlen);
-+ READ_ERRCHECK(fd, buf, header.elemlen);
-+ list_append(l, buf);
-+ }
-+ totmemorylen = header.numels * header.elemlen;
-+ }
-+ totreadlen = header.numels * header.elemlen;
-+ } else {
-+ /* elements have variable size. Each element is preceded by its size */
-+ if (l->attrs.unserializer != NULL) {
-+ /* use unserializer */
-+ for (cnt = 0; cnt < header.numels; cnt++) {
-+ READ_ERRCHECK(fd, & elsize, sizeof(elsize));
-+ buf = malloc((size_t)elsize);
-+ READ_ERRCHECK(fd, buf, elsize);
-+ totreadlen += elsize;
-+ list_append(l, l->attrs.unserializer(buf, & elsize));
-+ totmemorylen += elsize;
-+ }
-+ } else {
-+ /* copy verbatim into memory */
-+ for (cnt = 0; cnt < header.numels; cnt++) {
-+ READ_ERRCHECK(fd, & elsize, sizeof(elsize));
-+ buf = malloc(elsize);
-+ READ_ERRCHECK(fd, buf, elsize);
-+ totreadlen += elsize;
-+ list_append(l, buf);
-+ }
-+ totmemorylen = totreadlen;
-+ }
-+ }
-+
-+ READ_ERRCHECK(fd, &elsize, sizeof(elsize)); /* read list terminator */
-+ elsize = ntohl(elsize);
-+
-+ /* possibly verify the list consistency */
-+ /* wrt hash */
-+ /* don't do that
-+ if (header.listhash != 0 && header.listhash != list_hash(l)) {
-+ errno = ECANCELED;
-+ return -1;
-+ }
-+ */
-+
-+ /* wrt header */
-+ if (totreadlen != header.totlistlen && (int32_t)elsize == header.rndterm) {
-+ errno = EPROTO;
-+ return -1;
-+ }
-+
-+ /* wrt file */
-+ if (lseek(fd, 0, SEEK_CUR) != lseek(fd, 0, SEEK_END)) {
-+ errno = EPROTO;
-+ return -1;
-+ }
-+
-+ if (len != NULL) {
-+ *len = totmemorylen;
-+ }
-+
-+ return 0;
-+}
-+
-+int list_dump_file(const list_t *restrict l, const char *restrict filename, size_t *restrict len) {
-+ int fd, oflag, mode;
-+
-+#ifndef _WIN32
-+ oflag = O_RDWR | O_CREAT | O_TRUNC;
-+ mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
-+#else
-+ oflag = _O_RDWR | _O_CREAT | _O_TRUNC;
-+ mode = _S_IRUSR | _S_IWUSR | _S_IRGRP | _S_IROTH;
-+#endif
-+ fd = open(filename, oflag, mode);
-+ if (fd < 0) return -1;
-+
-+ list_dump_filedescriptor(l, fd, len);
-+ close(fd);
-+
-+ return 0;
-+}
-+
-+int list_restore_file(list_t *restrict l, const char *restrict filename, size_t *restrict len) {
-+ int fd;
-+
-+ fd = open(filename, O_RDONLY, 0);
-+ if (fd < 0) return -1;
-+
-+ list_restore_filedescriptor(l, fd, len);
-+ close(fd);
-+
-+ return 0;
-+}
-+#endif /* ifndef SIMCLIST_NO_DUMPRESTORE */
-+
-+
-+static int list_drop_elem(list_t *restrict l, struct list_entry_s *tmp, unsigned int pos) {
-+ if (tmp == NULL) return -1;
-+
-+ /* fix mid pointer. This is wrt the PRE situation */
-+ if (l->numels % 2) { /* now odd */
-+ /* sort out the base case by hand */
-+ if (l->numels == 1) l->mid = NULL;
-+ else if (pos >= l->numels/2) l->mid = l->mid->prev;
-+ } else { /* now even */
-+ if (pos < l->numels/2) l->mid = l->mid->next;
-+ }
-+
-+ tmp->prev->next = tmp->next;
-+ tmp->next->prev = tmp->prev;
-+
-+ /* free what's to be freed */
-+ if (l->attrs.copy_data && tmp->data != NULL)
-+ free(tmp->data);
-+
-+ if (l->spareelsnum < SIMCLIST_MAX_SPARE_ELEMS) {
-+ l->spareels[l->spareelsnum++] = tmp;
-+ } else {
-+ free(tmp);
-+ }
-+
-+ return 0;
-+}
-+
-+/* ready-made comparators and meters */
-+#define SIMCLIST_NUMBER_COMPARATOR(type) int list_comparator_##type(const void *a, const void *b) { return( *(type *)a < *(type *)b) - (*(type *)a > *(type *)b); }
-+
-+SIMCLIST_NUMBER_COMPARATOR(int8_t)
-+SIMCLIST_NUMBER_COMPARATOR(int16_t)
-+SIMCLIST_NUMBER_COMPARATOR(int32_t)
-+SIMCLIST_NUMBER_COMPARATOR(int64_t)
-+
-+SIMCLIST_NUMBER_COMPARATOR(uint8_t)
-+SIMCLIST_NUMBER_COMPARATOR(uint16_t)
-+SIMCLIST_NUMBER_COMPARATOR(uint32_t)
-+SIMCLIST_NUMBER_COMPARATOR(uint64_t)
-+
-+SIMCLIST_NUMBER_COMPARATOR(float)
-+SIMCLIST_NUMBER_COMPARATOR(double)
-+
-+int list_comparator_string(const void *a, const void *b) { return strcmp((const char *)b, (const char *)a); }
-+
-+/* ready-made metric functions */
-+#define SIMCLIST_METER(type) size_t list_meter_##type(const void *el) { if (el) { /* kill compiler whinge */ } return sizeof(type); }
-+
-+SIMCLIST_METER(int8_t)
-+SIMCLIST_METER(int16_t)
-+SIMCLIST_METER(int32_t)
-+SIMCLIST_METER(int64_t)
-+
-+SIMCLIST_METER(uint8_t)
-+SIMCLIST_METER(uint16_t)
-+SIMCLIST_METER(uint32_t)
-+SIMCLIST_METER(uint64_t)
-+
-+SIMCLIST_METER(float)
-+SIMCLIST_METER(double)
-+
-+size_t list_meter_string(const void *el) { return strlen((const char *)el) + 1; }
-+
-+/* ready-made hashing functions */
-+#define SIMCLIST_HASHCOMPUTER(type) list_hash_t list_hashcomputer_##type(const void *el) { return (list_hash_t)(*(type *)el); }
-+
-+SIMCLIST_HASHCOMPUTER(int8_t)
-+SIMCLIST_HASHCOMPUTER(int16_t)
-+SIMCLIST_HASHCOMPUTER(int32_t)
-+SIMCLIST_HASHCOMPUTER(int64_t)
-+
-+SIMCLIST_HASHCOMPUTER(uint8_t)
-+SIMCLIST_HASHCOMPUTER(uint16_t)
-+SIMCLIST_HASHCOMPUTER(uint32_t)
-+SIMCLIST_HASHCOMPUTER(uint64_t)
-+
-+SIMCLIST_HASHCOMPUTER(float)
-+SIMCLIST_HASHCOMPUTER(double)
-+
-+list_hash_t list_hashcomputer_string(const void *el) {
-+ size_t l;
-+ list_hash_t hash = 123;
-+ const char *str = (const char *)el;
-+ char plus;
-+
-+ for (l = 0; str[l] != '\0'; l++) {
-+ if (l) plus = hash ^ str[l];
-+ else plus = hash ^ (str[l] - str[0]);
-+ hash += (plus << (CHAR_BIT * (l % sizeof(list_hash_t))));
-+ }
-+
-+ return hash;
-+}
-+
-+
-+#ifndef NDEBUG
-+static int list_repOk(const list_t *restrict l) {
-+ int ok, i;
-+ struct list_entry_s *s;
-+
-+ ok = (l != NULL) && (
-+ /* head/tail checks */
-+ (l->head_sentinel != NULL && l->tail_sentinel != NULL) &&
-+ (l->head_sentinel != l->tail_sentinel) && (l->head_sentinel->prev == NULL && l->tail_sentinel->next == NULL) &&
-+ /* empty list */
-+ (l->numels > 0 || (l->mid == NULL && l->head_sentinel->next == l->tail_sentinel && l->tail_sentinel->prev == l->head_sentinel)) &&
-+ /* spare elements checks */
-+ l->spareelsnum <= SIMCLIST_MAX_SPARE_ELEMS
-+ );
-+
-+ if (!ok) return 0;
-+
-+ if (l->numels >= 1) {
-+ /* correct referencing */
-+ for (i = -1, s = l->head_sentinel; i < (int)(l->numels-1)/2 && s->next != NULL; i++, s = s->next) {
-+ if (s->next->prev != s) break;
-+ }
-+ ok = (i == (int)(l->numels-1)/2 && l->mid == s);
-+ if (!ok) return 0;
-+ for (; s->next != NULL; i++, s = s->next) {
-+ if (s->next->prev != s) break;
-+ }
-+ ok = (i == (int)l->numels && s == l->tail_sentinel);
-+ }
-+
-+ return ok;
-+}
-+
-+static int list_attrOk(const list_t *restrict l) {
-+ int ok;
-+
-+ ok = (l->attrs.copy_data == 0 || l->attrs.meter != NULL);
-+ return ok;
-+}
-+
-+#endif
-+
-diff --git a/src/simclist.h b/src/simclist.h
-deleted file mode 120000
-index 8a44093..0000000
---- a/src/simclist.h
-+++ /dev/null
-@@ -1 +0,0 @@
--../PCSC/src/simclist.h
-\ No newline at end of file
-diff --git a/src/simclist.h b/src/simclist.h
-new file mode 100644
-index 0000000..2ce9d49
---- /dev/null
-+++ b/src/simclist.h
-@@ -0,0 +1,980 @@
-+/*
-+ * Copyright (c) 2007,2008 Mij <mij@bitchx.it>
-+ *
-+ * Permission to use, copy, modify, and distribute this software for any
-+ * purpose with or without fee is hereby granted, provided that the above
-+ * copyright notice and this permission notice appear in all copies.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-+ */
-+
-+
-+/*
-+ * SimCList library. See http://mij.oltrelinux.com/devel/simclist
-+ */
-+
-+
-+#ifndef SIMCLIST_H
-+#define SIMCLIST_H
-+
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
-+#include <inttypes.h>
-+#include <errno.h>
-+#include <sys/types.h>
-+
-+#ifndef SIMCLIST_NO_DUMPRESTORE
-+# ifndef _WIN32
-+# include <sys/time.h> /* list_dump_info_t's struct timeval */
-+# else
-+# include <time.h>
-+# endif
-+#endif
-+
-+
-+/* Be friend of both C90 and C99 compilers */
-+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-+ /* "inline" and "restrict" are keywords */
-+#else
-+# define inline /* inline */
-+# define restrict /* restrict */
-+#endif
-+
-+
-+/**
-+ * Type representing list hashes.
-+ *
-+ * This is a signed integer value.
-+ */
-+typedef int32_t list_hash_t;
-+
-+#ifndef SIMCLIST_NO_DUMPRESTORE
-+typedef struct {
-+ uint16_t version; /* dump version */
-+ struct timeval timestamp; /* when the list has been dumped, seconds since UNIX epoch */
-+ uint32_t list_size;
-+ uint32_t list_numels;
-+ list_hash_t list_hash; /* hash of the list when dumped, or 0 if invalid */
-+ uint32_t dumpsize;
-+ int consistent; /* 1 if the dump is verified complete/consistent; 0 otherwise */
-+} list_dump_info_t;
-+#endif
-+
-+/**
-+ * a comparator of elements.
-+ *
-+ * A comparator of elements is a function that:
-+ * -# receives two references to elements a and b
-+ * -# returns {<0, 0, >0} if (a > b), (a == b), (a < b) respectively
-+ *
-+ * It is responsability of the function to handle possible NULL values.
-+ */
-+typedef int (*element_comparator)(const void *a, const void *b);
-+
-+/**
-+ * a seeker of elements.
-+ *
-+ * An element seeker is a function that:
-+ * -# receives a reference to an element el
-+ * -# receives a reference to some indicator data
-+ * -# returns non-0 if the element matches the indicator, 0 otherwise
-+ *
-+ * It is responsability of the function to handle possible NULL values in any
-+ * argument.
-+ */
-+typedef int (*element_seeker)(const void *el, const void *indicator);
-+
-+/**
-+ * an element lenght meter.
-+ *
-+ * An element meter is a function that:
-+ * -# receives the reference to an element el
-+ * -# returns its size in bytes
-+ *
-+ * It is responsability of the function to handle possible NULL values.
-+ */
-+typedef size_t (*element_meter)(const void *el);
-+
-+/**
-+ * a function computing the hash of elements.
-+ *
-+ * An hash computing function is a function that:
-+ * -# receives the reference to an element el
-+ * -# returns a hash value for el
-+ *
-+ * It is responsability of the function to handle possible NULL values.
-+ */
-+typedef list_hash_t (*element_hash_computer)(const void *el);
-+
-+/**
-+ * a function for serializing an element.
-+ *
-+ * A serializer function is one that gets a reference to an element,
-+ * and returns a reference to a buffer that contains its serialization
-+ * along with the length of this buffer.
-+ * It is responsability of the function to handle possible NULL values,
-+ * returning a NULL buffer and a 0 buffer length.
-+ *
-+ * These functions have 3 goals:
-+ * -# "freeze" and "flatten" the memory representation of the element
-+ * -# provide a portable (wrt byte order, or type size) representation of the element, if the dump can be used on different sw/hw combinations
-+ * -# possibly extract a compressed representation of the element
-+ *
-+ * @param el reference to the element data
-+ * @param serialize_buffer reference to fill with the length of the buffer
-+ * @return reference to the buffer with the serialized data
-+ */
-+typedef void *(*element_serializer)(const void *restrict el, uint32_t *restrict serializ_len);
-+
-+/**
-+ * a function for un-serializing an element.
-+ *
-+ * An unserializer function accomplishes the inverse operation of the
-+ * serializer function. An unserializer function is one that gets a
-+ * serialized representation of an element and turns it backe to the original
-+ * element. The serialized representation is passed as a reference to a buffer
-+ * with its data, and the function allocates and returns the buffer containing
-+ * the original element, and it sets the length of this buffer into the
-+ * integer passed by reference.
-+ *
-+ * @param data reference to the buffer with the serialized representation of the element
-+ * @param data_len reference to the location where to store the length of the data in the buffer returned
-+ * @return reference to a buffer with the original, unserialized representation of the element
-+ */
-+typedef void *(*element_unserializer)(const void *restrict data, uint32_t *restrict data_len);
-+
-+/* [private-use] list entry -- olds actual user datum */
-+struct list_entry_s {
-+ void *data;
-+
-+ /* doubly-linked list service references */
-+ struct list_entry_s *next;
-+ struct list_entry_s *prev;
-+};
-+
-+/* [private-use] list attributes */
-+struct list_attributes_s {
-+ /* user-set routine for comparing list elements */
-+ element_comparator comparator;
-+ /* user-set routing for seeking elements */
-+ element_seeker seeker;
-+ /* user-set routine for determining the length of an element */
-+ element_meter meter;
-+ int copy_data;
-+ /* user-set routine for computing the hash of an element */
-+ element_hash_computer hasher;
-+ /* user-set routine for serializing an element */
-+ element_serializer serializer;
-+ /* user-set routine for unserializing an element */
-+ element_unserializer unserializer;
-+};
-+
-+/** list object */
-+typedef struct {
-+ struct list_entry_s *head_sentinel;
-+ struct list_entry_s *tail_sentinel;
-+ struct list_entry_s *mid;
-+
-+ unsigned int numels;
-+
-+ /* array of spare elements */
-+ struct list_entry_s **spareels;
-+ unsigned int spareelsnum;
-+
-+#ifdef SIMCLIST_WITH_THREADS
-+ /* how many threads are currently running */
-+ unsigned int threadcount;
-+#endif
-+
-+ /* service variables for list iteration */
-+ int iter_active;
-+ unsigned int iter_pos;
-+ struct list_entry_s *iter_curentry;
-+
-+ /* list attributes */
-+ struct list_attributes_s attrs;
-+} list_t;
-+
-+/**
-+ * initialize a list object for use.
-+ *
-+ * @param l must point to a user-provided memory location
-+ * @return 0 for success. -1 for failure
-+ */
-+int list_init(list_t *restrict l);
-+
-+/**
-+ * completely remove the list from memory.
-+ *
-+ * This function is the inverse of list_init(). It is meant to be called when
-+ * the list is no longer going to be used. Elements and possible memory taken
-+ * for internal use are freed.
-+ *
-+ * @param l list to destroy
-+ */
-+void list_destroy(list_t *restrict l);
-+
-+/**
-+ * set the comparator function for list elements.
-+ *
-+ * Comparator functions are used for searching and sorting. If NULL is passed
-+ * as reference to the function, the comparator is disabled.
-+ *
-+ * @param l list to operate
-+ * @param comparator_fun pointer to the actual comparator function
-+ * @return 0 if the attribute was successfully set; -1 otherwise
-+ *
-+ * @see element_comparator()
-+ */
-+int list_attributes_comparator(list_t *restrict l, element_comparator comparator_fun);
-+
-+/**
-+ * set a seeker function for list elements.
-+ *
-+ * Seeker functions are used for finding elements. If NULL is passed as reference
-+ * to the function, the seeker is disabled.
-+ *
-+ * @param l list to operate
-+ * @param seeker_fun pointer to the actual seeker function
-+ * @return 0 if the attribute was successfully set; -1 otherwise
-+ *
-+ * @see element_seeker()
-+ */
-+int list_attributes_seeker(list_t *restrict l, element_seeker seeker_fun);
-+
-+/**
-+ * require to free element data when list entry is removed (default: don't free).
-+ *
-+ * [ advanced preference ]
-+ *
-+ * By default, when an element is removed from the list, it disappears from
-+ * the list by its actual data is not free()d. With this option, every
-+ * deletion causes element data to be freed.
-+ *
-+ * It is responsability of this function to correctly handle NULL values, if
-+ * NULL elements are inserted into the list.
-+ *
-+ * @param l list to operate
-+ * @param metric_fun pointer to the actual metric function
-+ * @param copy_data 0: do not free element data (default); non-0: do free
-+ * @return 0 if the attribute was successfully set; -1 otherwise
-+ *
-+ * @see element_meter()
-+ * @see list_meter_int8_t()
-+ * @see list_meter_int16_t()
-+ * @see list_meter_int32_t()
-+ * @see list_meter_int64_t()
-+ * @see list_meter_uint8_t()
-+ * @see list_meter_uint16_t()
-+ * @see list_meter_uint32_t()
-+ * @see list_meter_uint64_t()
-+ * @see list_meter_float()
-+ * @see list_meter_double()
-+ * @see list_meter_string()
-+ */
-+int list_attributes_copy(list_t *restrict l, element_meter metric_fun, int copy_data);
-+
-+/**
-+ * set the element hash computing function for the list elements.
-+ *
-+ * [ advanced preference ]
-+ *
-+ * An hash can be requested depicting the list status at a given time. An hash
-+ * only depends on the elements and their order. By default, the hash of an
-+ * element is only computed on its reference. With this function, the user can
-+ * set a custom function computing the hash of an element. If such function is
-+ * provided, the list_hash() function automatically computes the list hash using
-+ * the custom function instead of simply referring to element references.
-+ *
-+ * @param l list to operate
-+ * @param hash_computer_fun pointer to the actual hash computing function
-+ * @return 0 if the attribute was successfully set; -1 otherwise
-+ *
-+ * @see element_hash_computer()
-+ */
-+int list_attributes_hash_computer(list_t *restrict l, element_hash_computer hash_computer_fun);
-+
-+/**
-+ * set the element serializer function for the list elements.
-+ *
-+ * [ advanced preference ]
-+ *
-+ * Serialize functions are used for dumping the list to some persistent
-+ * storage. The serializer function is called for each element; it is passed
-+ * a reference to the element and a reference to a size_t object. It will
-+ * provide (and return) the buffer with the serialization of the element and
-+ * fill the size_t object with the length of this serialization data.
-+ *
-+ * @param l list to operate
-+ * @param serializer_fun pointer to the actual serializer function
-+ * @return 0 if the attribute was successfully set; -1 otherwise
-+ *
-+ * @see element_serializer()
-+ * @see list_dump_filedescriptor()
-+ * @see list_restore_filedescriptor()
-+ */
-+int list_attributes_serializer(list_t *restrict l, element_serializer serializer_fun);
-+
-+/**
-+ * set the element unserializer function for the list elements.
-+ *
-+ * [ advanced preference ]
-+ *
-+ * Unserialize functions are used for restoring the list from some persistent
-+ * storage. The unserializer function is called for each element segment read
-+ * from the storage; it is passed the segment and a reference to an integer.
-+ * It shall allocate and return a buffer compiled with the resumed memory
-+ * representation of the element, and set the integer value to the length of
-+ * this buffer.
-+ *
-+ * @param l list to operate
-+ * @param unserializer_fun pointer to the actual unserializer function
-+ * @return 0 if the attribute was successfully set; -1 otherwise
-+ *
-+ * @see element_unserializer()
-+ * @see list_dump_filedescriptor()
-+ * @see list_restore_filedescriptor()
-+ */
-+int list_attributes_unserializer(list_t *restrict l, element_unserializer unserializer_fun);
-+
-+/**
-+ * append data at the end of the list.
-+ *
-+ * This function is useful for adding elements with a FIFO/queue policy.
-+ *
-+ * @param l list to operate
-+ * @param data pointer to user data to append
-+ *
-+ * @return 1 for success. < 0 for failure
-+ */
-+int list_append(list_t *restrict l, const void *data);
-+
-+/**
-+ * insert data in the head of the list.
-+ *
-+ * This function is useful for adding elements with a LIFO/Stack policy.
-+ *
-+ * @param l list to operate
-+ * @param data pointer to user data to append
-+ *
-+ * @return 1 for success. < 0 for failure
-+ */
-+int list_prepend(list_t *restrict l, const void *restrict data);
-+
-+/**
-+ * extract the element in the top of the list.
-+ *
-+ * This function is for using a list with a FIFO/queue policy.
-+ *
-+ * @param l list to operate
-+ * @return reference to user datum, or NULL on errors
-+ */
-+void *list_fetch(list_t *restrict l);
-+
-+/**
-+ * retrieve an element at a given position.
-+ *
-+ * @param l list to operate
-+ * @param pos [0,size-1] position index of the element wanted
-+ * @return reference to user datum, or NULL on errors
-+ */
-+void *list_get_at(const list_t *restrict l, unsigned int pos);
-+
-+/**
-+ * return the maximum element of the list.
-+ *
-+ * @warning Requires a comparator function to be set for the list.
-+ *
-+ * Returns the maximum element with respect to the comparator function output.
-+ *
-+ * @see list_attributes_comparator()
-+ *
-+ * @param l list to operate
-+ * @return the reference to the element, or NULL
-+ */
-+void *list_get_max(const list_t *restrict l);
-+
-+/**
-+ * return the minimum element of the list.
-+ *
-+ * @warning Requires a comparator function to be set for the list.
-+ *
-+ * Returns the minimum element with respect to the comparator function output.
-+ *
-+ * @see list_attributes_comparator()
-+ *
-+ * @param l list to operate
-+ * @return the reference to the element, or NULL
-+ */
-+void *list_get_min(const list_t *restrict l);
-+
-+/**
-+ * retrieve and remove from list an element at a given position.
-+ *
-+ * @param l list to operate
-+ * @param pos [0,size-1] position index of the element wanted
-+ * @return reference to user datum, or NULL on errors
-+ */
-+void *list_extract_at(list_t *restrict l, unsigned int pos);
-+
-+/**
-+ * insert an element at a given position.
-+ *
-+ * @param l list to operate
-+ * @param data reference to data to be inserted
-+ * @param pos [0,size-1] position index to insert the element at
-+ * @return positive value on success. Negative on failure
-+ */
-+int list_insert_at(list_t *restrict l, const void *data, unsigned int pos);
-+
-+/**
-+ * expunge the first found given element from the list.
-+ *
-+ * Inspects the given list looking for the given element; if the element
-+ * is found, it is removed. Only the first occurence is removed.
-+ * If a comparator function was not set, elements are compared by reference.
-+ * Otherwise, the comparator is used to match the element.
-+ *
-+ * @param l list to operate
-+ * @param data reference of the element to search for
-+ * @return 0 on success. Negative value on failure
-+ *
-+ * @see list_attributes_comparator()
-+ * @see list_delete_at()
-+ */
-+int list_delete(list_t *restrict l, const void *data);
-+
-+/**
-+ * expunge an element at a given position from the list.
-+ *
-+ * @param l list to operate
-+ * @param pos [0,size-1] position index of the element to be deleted
-+ * @return 0 on success. Negative value on failure
-+ */
-+int list_delete_at(list_t *restrict l, unsigned int pos);
-+
-+/**
-+ * expunge an array of elements from the list, given their position range.
-+ *
-+ * @param l list to operate
-+ * @param posstart [0,size-1] position index of the first element to be deleted
-+ * @param posend [posstart,size-1] position of the last element to be deleted
-+ * @return the number of elements successfully removed on success, <0 on error
-+ */
-+int list_delete_range(list_t *restrict l, unsigned int posstart, unsigned int posend);
-+
-+/**
-+ * clear all the elements off of the list.
-+ *
-+ * The element datums will not be freed.
-+ *
-+ * @see list_delete_range()
-+ * @see list_size()
-+ *
-+ * @param l list to operate
-+ * @return the number of elements removed on success, <0 on error
-+ */
-+int list_clear(list_t *restrict l);
-+
-+/**
-+ * inspect the number of elements in the list.
-+ *
-+ * @param l list to operate
-+ * @return number of elements currently held by the list
-+ */
-+unsigned int list_size(const list_t *restrict l);
-+
-+/**
-+ * inspect whether the list is empty.
-+ *
-+ * @param l list to operate
-+ * @return 0 iff the list is not empty
-+ *
-+ * @see list_size()
-+ */
-+int list_empty(const list_t *restrict l);
-+
-+/**
-+ * find the position of an element in a list.
-+ *
-+ * @warning Requires a comparator function to be set for the list.
-+ *
-+ * Inspects the given list looking for the given element; if the element
-+ * is found, its position into the list is returned.
-+ * Elements are inspected comparing references if a comparator has not been
-+ * set. Otherwise, the comparator is used to find the element.
-+ *
-+ * @param l list to operate
-+ * @param data reference of the element to search for
-+ * @return position of element in the list, or <0 if not found
-+ *
-+ * @see list_attributes_comparator()
-+ * @see list_get_at()
-+ */
-+int list_locate(const list_t *restrict l, const void *data);
-+
-+/**
-+ * returns an element given an indicator.
-+ *
-+ * @warning Requires a seeker function to be set for the list.
-+ *
-+ * Inspect the given list looking with the seeker if an element matches
-+ * an indicator. If such element is found, the reference to the element
-+ * is returned.
-+ *
-+ * @param l list to operate
-+ * @param indicator indicator data to pass to the seeker along with elements
-+ * @return reference to the element accepted by the seeker, or NULL if none found
-+ */
-+void *list_seek(list_t *restrict l, const void *indicator);
-+
-+/**
-+ * inspect whether some data is member of the list.
-+ *
-+ * @warning Requires a comparator function to be set for the list.
-+ *
-+ * By default, a per-reference comparison is accomplished. That is,
-+ * the data is in list if any element of the list points to the same
-+ * location of data.
-+ * A "semantic" comparison is accomplished, otherwise, if a comparator
-+ * function has been set previously, with list_attributes_comparator();
-+ * in which case, the given data reference is believed to be in list iff
-+ * comparator_fun(elementdata, userdata) == 0 for any element in the list.
-+ *
-+ * @param l list to operate
-+ * @param data reference to the data to search
-+ * @return 0 iff the list does not contain data as an element
-+ *
-+ * @see list_attributes_comparator()
-+ */
-+int list_contains(const list_t *restrict l, const void *data);
-+
-+/**
-+ * concatenate two lists
-+ *
-+ * Concatenates one list with another, and stores the result into a
-+ * user-provided list object, which must be different from both the
-+ * lists to concatenate. Attributes from the original lists are not
-+ * cloned.
-+ * The destination list referred is threated as virgin room: if it
-+ * is an existing list containing elements, memory leaks will happen.
-+ * It is OK to specify the same list twice as source, for "doubling"
-+ * it in the destination.
-+ *
-+ * @param l1 base list
-+ * @param l2 list to append to the base
-+ * @param dest reference to the destination list
-+ * @return 0 for success, -1 for errors
-+ */
-+int list_concat(const list_t *l1, const list_t *l2, list_t *restrict dest);
-+
-+/**
-+ * sort list elements.
-+ *
-+ * @warning Requires a comparator function to be set for the list.
-+ *
-+ * Sorts the list in ascending or descending order as specified by the versus
-+ * flag. The algorithm chooses autonomously what algorithm is best suited for
-+ * sorting the list wrt its current status.
-+ *
-+ * @param l list to operate
-+ * @param versus positive: order small to big; negative: order big to small
-+ * @return 0 iff sorting was successful
-+ *
-+ * @see list_attributes_comparator()
-+ */
-+int list_sort(list_t *restrict l, int versus);
-+
-+/**
-+ * start an iteration session.
-+ *
-+ * This function prepares the list to be iterated.
-+ *
-+ * @param l list to operate
-+ * @return 0 if the list cannot be currently iterated. >0 otherwise
-+ *
-+ * @see list_iterator_stop()
-+ */
-+int list_iterator_start(list_t *restrict l);
-+
-+/**
-+ * return the next element in the iteration session.
-+ *
-+ * @param l list to operate
-+ * @return element datum, or NULL on errors
-+ */
-+void *list_iterator_next(list_t *restrict l);
-+
-+/**
-+ * inspect whether more elements are available in the iteration session.
-+ *
-+ * @param l list to operate
-+ * @return 0 iff no more elements are available.
-+ */
-+int list_iterator_hasnext(const list_t *restrict l);
-+
-+/**
-+ * end an iteration session.
-+ *
-+ * @param l list to operate
-+ * @return 0 iff the iteration session cannot be stopped
-+ */
-+int list_iterator_stop(list_t *restrict l);
-+
-+/**
-+ * return the hash of the current status of the list.
-+ *
-+ * @param l list to operate
-+ * @param hash where the resulting hash is put
-+ *
-+ * @return 0 for success; <0 for failure
-+ */
-+int list_hash(const list_t *restrict l, list_hash_t *restrict hash);
-+
-+#ifndef SIMCLIST_NO_DUMPRESTORE
-+/**
-+ * get meta informations on a list dump on filedescriptor.
-+ *
-+ * [ advanced function ]
-+ *
-+ * Extracts the meta information from a SimCList dump located in a file
-+ * descriptor. The file descriptor must be open and positioned at the
-+ * beginning of the SimCList dump block.
-+ *
-+ * @param fd file descriptor to get metadata from
-+ * @param info reference to a dump metainformation structure to fill
-+ * @return 0 for success; <0 for failure
-+ *
-+ * @see list_dump_filedescriptor()
-+ */
-+int list_dump_getinfo_filedescriptor(int fd, list_dump_info_t *restrict info);
-+
-+/**
-+ * get meta informations on a list dump on file.
-+ *
-+ * [ advanced function ]
-+ *
-+ * Extracts the meta information from a SimCList dump located in a file.
-+ *
-+ * @param filename filename of the file to fetch from
-+ * @param info reference to a dump metainformation structure to fill
-+ * @return 0 for success; <0 for failure
-+ *
-+ * @see list_dump_filedescriptor()
-+ */
-+int list_dump_getinfo_file(const char *restrict filename, list_dump_info_t *restrict info);
-+
-+/**
-+ * dump the list into an open, writable file descriptor.
-+ *
-+ * This function "dumps" the list to a persistent storage so it can be
-+ * preserved across process terminations.
-+ * When called, the file descriptor must be open for writing and positioned
-+ * where the serialized data must begin. It writes its serialization of the
-+ * list in a form which is portable across different architectures. Dump can
-+ * be safely performed on stream-only (non seekable) descriptors. The file
-+ * descriptor is not closed at the end of the operations.
-+ *
-+ * To use dump functions, either of these conditions must be satisfied:
-+ * -# a metric function has been specified with list_attributes_copy()
-+ * -# a serializer function has been specified with list_attributes_serializer()
-+ *
-+ * If a metric function has been specified, each element of the list is dumped
-+ * as-is from memory, copying it from its pointer for its length down to the
-+ * file descriptor. This might have impacts on portability of the dump to
-+ * different architectures.
-+ *
-+ * If a serializer function has been specified, its result for each element is
-+ * dumped to the file descriptor.
-+ *
-+ *
-+ * @param l list to operate
-+ * @param fd file descriptor to write to
-+ * @param len location to store the resulting length of the dump (bytes), or NULL
-+ *
-+ * @return 0 if successful; -1 otherwise
-+ *
-+ * @see element_serializer()
-+ * @see list_attributes_copy()
-+ * @see list_attributes_serializer()
-+ */
-+int list_dump_filedescriptor(const list_t *restrict l, int fd, size_t *restrict len);
-+
-+/**
-+ * dump the list to a file name.
-+ *
-+ * This function creates a filename and dumps the current content of the list
-+ * to it. If the file exists it is overwritten. The number of bytes written to
-+ * the file can be returned in a specified argument.
-+ *
-+ * @param l list to operate
-+ * @param filename filename to write to
-+ * @param len location to store the resulting length of the dump (bytes), or NULL
-+ *
-+ * @return 0 if successful; -1 otherwise
-+ *
-+ * @see list_attributes_copy()
-+ * @see element_serializer()
-+ * @see list_attributes_serializer()
-+ * @see list_dump_filedescriptor()
-+ * @see list_restore_file()
-+ *
-+ * This function stores a representation of the list
-+ */
-+int list_dump_file(const list_t *restrict l, const char *restrict filename, size_t *restrict len);
-+
-+/**
-+ * restore the list from an open, readable file descriptor to memory.
-+ *
-+ * This function is the "inverse" of list_dump_filedescriptor(). It restores
-+ * the list content from a (open, read-ready) file descriptor to memory. An
-+ * unserializer might be needed to restore elements from the persistent
-+ * representation back into memory-consistent format. List attributes can not
-+ * be restored and must be set manually.
-+ *
-+ * @see list_dump_filedescriptor()
-+ * @see list_attributes_serializer()
-+ * @see list_attributes_unserializer()
-+ *
-+ * @param l list to restore to
-+ * @param fd file descriptor to read from.
-+ * @param len location to store the length of the dump read (bytes), or NULL
-+ * @return 0 if successful; -1 otherwise
-+ */
-+int list_restore_filedescriptor(list_t *restrict l, int fd, size_t *restrict len);
-+
-+/**
-+ * restore the list from a file name.
-+ *
-+ * This function restores the content of a list from a file into memory. It is
-+ * the inverse of list_dump_file().
-+ *
-+ * @see element_unserializer()
-+ * @see list_attributes_unserializer()
-+ * @see list_dump_file()
-+ * @see list_restore_filedescriptor()
-+ *
-+ * @param l list to restore to
-+ * @param filename filename to read data from
-+ * @param len location to store the length of the dump read (bytes), or NULL
-+ * @return 0 if successful; -1 otherwise
-+ */
-+int list_restore_file(list_t *restrict l, const char *restrict filename, size_t *len);
-+#endif
-+
-+/* ready-made comparators, meters and hash computers */
-+ /* comparator functions */
-+/**
-+ * ready-made comparator for int8_t elements.
-+ * @see list_attributes_comparator()
-+ */
-+int list_comparator_int8_t(const void *a, const void *b);
-+
-+/**
-+ * ready-made comparator for int16_t elements.
-+ * @see list_attributes_comparator()
-+ */
-+int list_comparator_int16_t(const void *a, const void *b);
-+
-+/**
-+ * ready-made comparator for int32_t elements.
-+ * @see list_attributes_comparator()
-+ */
-+int list_comparator_int32_t(const void *a, const void *b);
-+
-+/**
-+ * ready-made comparator for int64_t elements.
-+ * @see list_attributes_comparator()
-+ */
-+int list_comparator_int64_t(const void *a, const void *b);
-+
-+/**
-+ * ready-made comparator for uint8_t elements.
-+ * @see list_attributes_comparator()
-+ */
-+int list_comparator_uint8_t(const void *a, const void *b);
-+
-+/**
-+ * ready-made comparator for uint16_t elements.
-+ * @see list_attributes_comparator()
-+ */
-+int list_comparator_uint16_t(const void *a, const void *b);
-+
-+/**
-+ * ready-made comparator for uint32_t elements.
-+ * @see list_attributes_comparator()
-+ */
-+int list_comparator_uint32_t(const void *a, const void *b);
-+
-+/**
-+ * ready-made comparator for uint64_t elements.
-+ * @see list_attributes_comparator()
-+ */
-+int list_comparator_uint64_t(const void *a, const void *b);
-+
-+/**
-+ * ready-made comparator for float elements.
-+ * @see list_attributes_comparator()
-+ */
-+int list_comparator_float(const void *a, const void *b);
-+
-+/**
-+ * ready-made comparator for double elements.
-+ * @see list_attributes_comparator()
-+ */
-+int list_comparator_double(const void *a, const void *b);
-+
-+/**
-+ * ready-made comparator for string elements.
-+ * @see list_attributes_comparator()
-+ */
-+int list_comparator_string(const void *a, const void *b);
-+
-+ /* metric functions */
-+/**
-+ * ready-made metric function for int8_t elements.
-+ * @see list_attributes_copy()
-+ */
-+size_t list_meter_int8_t(const void *el);
-+
-+/**
-+ * ready-made metric function for int16_t elements.
-+ * @see list_attributes_copy()
-+ */
-+size_t list_meter_int16_t(const void *el);
-+
-+/**
-+ * ready-made metric function for int32_t elements.
-+ * @see list_attributes_copy()
-+ */
-+size_t list_meter_int32_t(const void *el);
-+
-+/**
-+ * ready-made metric function for int64_t elements.
-+ * @see list_attributes_copy()
-+ */
-+size_t list_meter_int64_t(const void *el);
-+
-+/**
-+ * ready-made metric function for uint8_t elements.
-+ * @see list_attributes_copy()
-+ */
-+size_t list_meter_uint8_t(const void *el);
-+
-+/**
-+ * ready-made metric function for uint16_t elements.
-+ * @see list_attributes_copy()
-+ */
-+size_t list_meter_uint16_t(const void *el);
-+
-+/**
-+ * ready-made metric function for uint32_t elements.
-+ * @see list_attributes_copy()
-+ */
-+size_t list_meter_uint32_t(const void *el);
-+
-+/**
-+ * ready-made metric function for uint64_t elements.
-+ * @see list_attributes_copy()
-+ */
-+size_t list_meter_uint64_t(const void *el);
-+
-+/**
-+ * ready-made metric function for float elements.
-+ * @see list_attributes_copy()
-+ */
-+size_t list_meter_float(const void *el);
-+
-+/**
-+ * ready-made metric function for double elements.
-+ * @see list_attributes_copy()
-+ */
-+size_t list_meter_double(const void *el);
-+
-+/**
-+ * ready-made metric function for string elements.
-+ * @see list_attributes_copy()
-+ */
-+size_t list_meter_string(const void *el);
-+
-+ /* hash functions */
-+/**
-+ * ready-made hash function for int8_t elements.
-+ * @see list_attributes_hash_computer()
-+ */
-+list_hash_t list_hashcomputer_int8_t(const void *el);
-+
-+/**
-+ * ready-made hash function for int16_t elements.
-+ * @see list_attributes_hash_computer()
-+ */
-+list_hash_t list_hashcomputer_int16_t(const void *el);
-+
-+/**
-+ * ready-made hash function for int32_t elements.
-+ * @see list_attributes_hash_computer()
-+ */
-+list_hash_t list_hashcomputer_int32_t(const void *el);
-+
-+/**
-+ * ready-made hash function for int64_t elements.
-+ * @see list_attributes_hash_computer()
-+ */
-+list_hash_t list_hashcomputer_int64_t(const void *el);
-+
-+/**
-+ * ready-made hash function for uint8_t elements.
-+ * @see list_attributes_hash_computer()
-+ */
-+list_hash_t list_hashcomputer_uint8_t(const void *el);
-+
-+/**
-+ * ready-made hash function for uint16_t elements.
-+ * @see list_attributes_hash_computer()
-+ */
-+list_hash_t list_hashcomputer_uint16_t(const void *el);
-+
-+/**
-+ * ready-made hash function for uint32_t elements.
-+ * @see list_attributes_hash_computer()
-+ */
-+list_hash_t list_hashcomputer_uint32_t(const void *el);
-+
-+/**
-+ * ready-made hash function for uint64_t elements.
-+ * @see list_attributes_hash_computer()
-+ */
-+list_hash_t list_hashcomputer_uint64_t(const void *el);
-+
-+/**
-+ * ready-made hash function for float elements.
-+ * @see list_attributes_hash_computer()
-+ */
-+list_hash_t list_hashcomputer_float(const void *el);
-+
-+/**
-+ * ready-made hash function for double elements.
-+ * @see list_attributes_hash_computer()
-+ */
-+list_hash_t list_hashcomputer_double(const void *el);
-+
-+/**
-+ * ready-made hash function for string elements.
-+ * @see list_attributes_hash_computer()
-+ */
-+list_hash_t list_hashcomputer_string(const void *el);
-+
-+#ifdef __cplusplus
-+}
-+#endif
-+
-+#endif
-+
-diff --git a/src/strlcpy.c b/src/strlcpy.c
-deleted file mode 120000
-index bde77fc..0000000
---- a/src/strlcpy.c
-+++ /dev/null
-@@ -1 +0,0 @@
--../PCSC/src/strlcpy.c
-\ No newline at end of file
-diff --git a/src/strlcpy.c b/src/strlcpy.c
-new file mode 100644
-index 0000000..437df6d
---- /dev/null
-+++ b/src/strlcpy.c
-@@ -0,0 +1,60 @@
-+/* $OpenBSD: strlcpy.c,v 1.10 2005/08/08 08:05:37 espie Exp $ */
-+
-+/*
-+ * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
-+ *
-+ * Permission to use, copy, modify, and distribute this software for any
-+ * purpose with or without fee is hereby granted, provided that the above
-+ * copyright notice and this permission notice appear in all copies.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-+ */
-+
-+#ifdef HAVE_CONFIG_H
-+#include <config.h>
-+#endif
-+
-+#ifndef HAVE_STRLCPY
-+
-+#include <sys/types.h>
-+#include <string.h>
-+#include "strlcpycat.h"
-+
-+/*
-+ * Copy src to string dst of size siz. At most siz-1 characters
-+ * will be copied. Always NUL terminates (unless siz == 0).
-+ * Returns strlen(src); if retval >= siz, truncation occurred.
-+ */
-+size_t
-+strlcpy(char *dst, const char *src, size_t siz)
-+{
-+ char *d = dst;
-+ const char *s = src;
-+ size_t n = siz;
-+
-+ /* Copy as many bytes as will fit */
-+ if (n != 0 && --n != 0) {
-+ do {
-+ if ((*d++ = *s++) == 0)
-+ break;
-+ } while (--n != 0);
-+ }
-+
-+ /* Not enough room in dst, add NUL and traverse rest of src */
-+ if (n == 0) {
-+ if (siz != 0)
-+ *d = '\0'; /* NUL-terminate dst */
-+ while (*s++)
-+ ;
-+ }
-+
-+ return(s - src - 1); /* count does not include NUL */
-+}
-+
-+#endif
-diff --git a/src/strlcpycat.h b/src/strlcpycat.h
-deleted file mode 120000
-index c240eca..0000000
---- a/src/strlcpycat.h
-+++ /dev/null
-@@ -1 +0,0 @@
--../PCSC/src/strlcpycat.h
-\ No newline at end of file
-diff --git a/src/strlcpycat.h b/src/strlcpycat.h
-new file mode 100644
-index 0000000..82c264a
---- /dev/null
-+++ b/src/strlcpycat.h
-@@ -0,0 +1,45 @@
-+/*
-+ * MUSCLE SmartCard Development ( http://pcsclite.alioth.debian.org/pcsclite.html )
-+ *
-+ * Copyright (C) 2004-2010
-+ * Ludovic Rousseau <ludovic.rousseau@free.fr>
-+ *
-+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. The name of the author may not be used to endorse or promote products
-+ derived from this software without specific prior written permission.
-+
-+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
-+ */
-+
-+/**
-+ * @file
-+ * @brief prototypes of strlcpy()/strlcat() imported from OpenBSD
-+ */
-+
-+#ifdef HAVE_STRLCPY
-+#include <string.h>
-+#else
-+size_t strlcpy(char *dst, const char *src, size_t siz);
-+#endif
-+
-+#ifndef HAVE_STRLCAT
-+size_t strlcat(char *dst, const char *src, size_t siz);
-+#endif
-+
-diff --git a/src/tokenparser.c b/src/tokenparser.c
-new file mode 100644
-index 0000000..352e69e
---- /dev/null
-+++ b/src/tokenparser.c
-@@ -0,0 +1,2020 @@
-+
-+#line 3 "tokenparser.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 5
-+#define YY_FLEX_SUBMINOR_VERSION 39
-+#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 <stdio.h>
-+#include <string.h>
-+#include <errno.h>
-+#include <stdlib.h>
-+
-+/* end standard C headers. */
-+
-+/* flex integer type definitions */
-+
-+#ifndef FLEXINT_H
-+#define FLEXINT_H
-+
-+/* C99 systems have <inttypes.h>. 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 <inttypes.h>
-+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
-+
-+#endif /* ! C99 */
-+
-+#endif /* ! FLEXINT_H */
-+
-+#ifdef __cplusplus
-+
-+/* The "const" storage-class-modifier is valid. */
-+#define YY_USE_CONST
-+
-+#else /* ! __cplusplus */
-+
-+/* C99 requires __STDC__ to be defined as 1. */
-+#if defined (__STDC__)
-+
-+#define YY_USE_CONST
-+
-+#endif /* defined (__STDC__) */
-+#endif /* ! __cplusplus */
-+
-+#ifdef YY_USE_CONST
-+#define yyconst const
-+#else
-+#define yyconst
-+#endif
-+
-+/* Returned upon end-of-file. */
-+#define YY_NULL 0
-+
-+/* Promotes a possibly negative, possibly signed char to an unsigned
-+ * integer for use as an array index. If the signed char is negative,
-+ * we want to instead treat it as an 8-bit unsigned char, hence the
-+ * double cast.
-+ */
-+#define YY_SC_TO_UI(c) ((unsigned int) (unsigned 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 yy_size_t 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.
-+ */
-+ yy_size_t yy_buf_size;
-+
-+ /* Number of characters read into yy_ch_buf, not including EOB
-+ * characters.
-+ */
-+ yy_size_t 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 = 0; /**< 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 yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
-+yy_size_t yyleng;
-+
-+/* Points to current character in buffer. */
-+static char *yy_c_buf_p = (char *) 0;
-+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 (yyconst char *yy_str );
-+YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t 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() 1
-+#define YY_SKIP_YYWRAP
-+
-+typedef unsigned char YY_CHAR;
-+
-+FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
-+
-+typedef int yy_state_type;
-+
-+extern int yylineno;
-+
-+int yylineno = 1;
-+
-+extern char *yytext;
-+#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 yy_fatal_error (yyconst 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 = (size_t) (yy_cp - yy_bp); \
-+ (yy_hold_char) = *yy_cp; \
-+ *yy_cp = '\0'; \
-+ (yy_c_buf_p) = yy_cp;
-+
-+#define YY_NUM_RULES 7
-+#define YY_END_OF_BUFFER 8
-+/* 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 yyconst flex_int16_t yy_accept[39] =
-+ { 0,
-+ 0, 0, 8, 6, 4, 2, 1, 6, 1, 0,
-+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,
-+ 0, 0, 0, 0, 0, 0, 5, 0
-+ } ;
-+
-+static yyconst flex_int32_t 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, 4, 4, 5, 4, 4, 4, 4, 4,
-+ 4, 4, 4, 4, 4, 4, 6, 7, 7, 7,
-+ 7, 7, 7, 7, 7, 7, 7, 4, 4, 8,
-+ 4, 9, 4, 4, 10, 10, 10, 10, 10, 10,
-+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
-+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
-+ 4, 1, 4, 4, 4, 1, 11, 11, 11, 11,
-+
-+ 12, 11, 13, 11, 14, 11, 15, 11, 11, 16,
-+ 11, 11, 11, 17, 18, 19, 11, 11, 11, 11,
-+ 20, 11, 1, 1, 1, 4, 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 yyconst flex_int32_t yy_meta[21] =
-+ { 0,
-+ 1, 2, 3, 4, 4, 4, 2, 1, 1, 2,
-+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
-+ } ;
-+
-+static yyconst flex_int16_t yy_base[43] =
-+ { 0,
-+ 0, 7, 49, 50, 50, 50, 0, 1, 0, 36,
-+ 28, 26, 28, 35, 29, 0, 26, 33, 27, 33,
-+ 29, 22, 0, 24, 27, 14, 27, 23, 13, 50,
-+ 10, 9, 4, 1, 0, 2, 50, 50, 19, 23,
-+ 2, 26
-+ } ;
-+
-+static yyconst flex_int16_t yy_def[43] =
-+ { 0,
-+ 39, 39, 38, 38, 38, 38, 40, 38, 40, 38,
-+ 38, 38, 38, 38, 38, 41, 38, 41, 38, 38,
-+ 38, 38, 42, 38, 42, 38, 38, 38, 38, 38,
-+ 38, 38, 38, 38, 38, 38, 38, 0, 38, 38,
-+ 38, 38
-+ } ;
-+
-+static yyconst flex_int16_t yy_nxt[71] =
-+ { 0,
-+ 38, 5, 6, 18, 7, 38, 38, 8, 5, 6,
-+ 37, 7, 36, 38, 8, 10, 35, 34, 11, 4,
-+ 4, 4, 4, 9, 9, 33, 9, 25, 32, 25,
-+ 31, 30, 29, 28, 27, 26, 24, 23, 22, 21,
-+ 20, 19, 17, 16, 15, 14, 13, 12, 38, 3,
-+ 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
-+ 38, 38, 38, 38, 38, 38, 38, 38, 38, 38
-+ } ;
-+
-+static yyconst flex_int16_t yy_chk[71] =
-+ { 0,
-+ 0, 1, 1, 41, 1, 0, 0, 1, 2, 2,
-+ 36, 2, 35, 0, 2, 8, 34, 33, 8, 39,
-+ 39, 39, 39, 40, 40, 32, 40, 42, 31, 42,
-+ 29, 28, 27, 26, 25, 24, 22, 21, 20, 19,
-+ 18, 17, 15, 14, 13, 12, 11, 10, 3, 38,
-+ 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
-+ 38, 38, 38, 38, 38, 38, 38, 38, 38, 38
-+ } ;
-+
-+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 "tokenparser.l"
-+/*
-+ * Reads lexical config files and updates database.
-+ *
-+ * MUSCLE SmartCard Development ( http://pcsclite.alioth.debian.org/pcsclite.html )
-+ *
-+ * Copyright (C) 2001-2003
-+ * David Corcoran <corcoran@musclecard.com>
-+ * Copyright (C) 2003-2010
-+ * Ludovic Rousseau <ludovic.rousseau@free.fr>
-+ *
-+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. The name of the author may not be used to endorse or promote products
-+ derived from this software without specific prior written permission.
-+
-+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
-+ */
-+/**
-+ * @file
-+ * @brief provides parsing functions for Info.plist files
-+ * platforms
-+ */
-+#line 42 "tokenparser.l"
-+
-+#include "config.h"
-+#include <stdio.h>
-+#include <string.h>
-+#include <errno.h>
-+#define NDEBUG
-+#include <assert.h>
-+
-+#include "simclist.h"
-+#include "debuglog.h"
-+#include "parser.h"
-+
-+static void eval_key(char *pcToken, list_t *list_key);
-+static void eval_value(char *pcToken, list_t *list_values);
-+void tperrorCheck (char *pcToken_error);
-+
-+static list_t *ListKeys;
-+static list_t *ListValues;
-+
-+#define YY_NO_INPUT 1
-+#line 545 "tokenparser.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 <unistd.h>
-+#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 );
-+
-+yy_size_t 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 yytext_ptr
-+static void yy_flex_strncpy (char *,yyconst char *,int );
-+#endif
-+
-+#ifdef YY_NEED_STRLEN
-+static int yy_flex_strlen (yyconst 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, 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 = '*'; \
-+ size_t 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 = fread(buf, 1, 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 break;
-+#endif
-+
-+#define YY_RULE_SETUP \
-+ YY_USER_ACTION
-+
-+/** The main scanner function which does all the work.
-+ */
-+YY_DECL
-+{
-+ register yy_state_type yy_current_state;
-+ register char *yy_cp, *yy_bp;
-+ register 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 67 "tokenparser.l"
-+
-+
-+#line 760 "tokenparser.c"
-+
-+ while ( 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
-+ {
-+ register 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 >= 39 )
-+ yy_c = yy_meta[(unsigned int) yy_c];
-+ }
-+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-+ ++yy_cp;
-+ }
-+ while ( yy_base[yy_current_state] != 50 );
-+
-+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 69 "tokenparser.l"
-+{}
-+ YY_BREAK
-+case 2:
-+/* rule 2 can match eol */
-+YY_RULE_SETUP
-+#line 70 "tokenparser.l"
-+{}
-+ YY_BREAK
-+case 3:
-+YY_RULE_SETUP
-+#line 71 "tokenparser.l"
-+{ eval_key(yytext, ListKeys); }
-+ YY_BREAK
-+case 4:
-+YY_RULE_SETUP
-+#line 72 "tokenparser.l"
-+{}
-+ YY_BREAK
-+case 5:
-+YY_RULE_SETUP
-+#line 73 "tokenparser.l"
-+{ eval_value(yytext, ListValues); }
-+ YY_BREAK
-+case 6:
-+YY_RULE_SETUP
-+#line 74 "tokenparser.l"
-+{ tperrorCheck(yytext); }
-+ YY_BREAK
-+case 7:
-+YY_RULE_SETUP
-+#line 75 "tokenparser.l"
-+ECHO;
-+ YY_BREAK
-+#line 853 "tokenparser.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)
-+{
-+ register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
-+ register char *source = (yytext_ptr);
-+ register 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
-+ {
-+ yy_size_t 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 )
-+ {
-+ yy_size_t 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,b->yy_buf_size + 2 );
-+ }
-+ else
-+ /* Can't grow it, we don't own it. */
-+ b->yy_ch_buf = 0;
-+
-+ 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_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
-+ /* Extend the array by 50%, plus the number we really need. */
-+ yy_size_t 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,new_size );
-+ if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
-+ YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
-+ }
-+
-+ (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)
-+{
-+ register yy_state_type yy_current_state;
-+ register char *yy_cp;
-+
-+ yy_current_state = (yy_start);
-+
-+ for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
-+ {
-+ register 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 >= 39 )
-+ yy_c = yy_meta[(unsigned int) yy_c];
-+ }
-+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) 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 )
-+{
-+ register int yy_is_jam;
-+ register char *yy_cp = (yy_c_buf_p);
-+
-+ register 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 >= 39 )
-+ yy_c = yy_meta[(unsigned int) yy_c];
-+ }
-+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-+ yy_is_jam = (yy_current_state == 38);
-+
-+ return yy_is_jam ? 0 : yy_current_state;
-+}
-+
-+#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 */
-+ yy_size_t offset = (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 EOF;
-+
-+ 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(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;
-+ (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. */
-+ int 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 0;
-+
-+ 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 = 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 = 0;
-+ 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 (yyconst char * yystr )
-+{
-+
-+ return yy_scan_bytes(yystr,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 (yyconst char * yybytes, yy_size_t _yybytes_len )
-+{
-+ YY_BUFFER_STATE b;
-+ char *buf;
-+ yy_size_t n;
-+ yy_size_t i;
-+
-+ /* Get memory for full buffer, including space for trailing EOB's. */
-+ n = _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 yy_fatal_error (yyconst char* msg )
-+{
-+ (void) 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.
-+ *
-+ */
-+yy_size_t yyget_leng (void)
-+{
-+ return yyleng;
-+}
-+
-+/** Get the current token.
-+ *
-+ */
-+
-+char *yyget_text (void)
-+{
-+ return yytext;
-+}
-+
-+/** Set the current line number.
-+ * @param 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) = 0;
-+ (yy_buffer_stack_top) = 0;
-+ (yy_buffer_stack_max) = 0;
-+ (yy_c_buf_p) = (char *) 0;
-+ (yy_init) = 0;
-+ (yy_start) = 0;
-+
-+/* Defined in main.c */
-+#ifdef YY_STDINIT
-+ yyin = stdin;
-+ yyout = stdout;
-+#else
-+ yyin = (FILE *) 0;
-+ yyout = (FILE *) 0;
-+#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, yyconst char * s2, int n )
-+{
-+ register int i;
-+ for ( i = 0; i < n; ++i )
-+ s1[i] = s2[i];
-+}
-+#endif
-+
-+#ifdef YY_NEED_STRLEN
-+static int yy_flex_strlen (yyconst char * s )
-+{
-+ register int n;
-+ for ( n = 0; s[n]; ++n )
-+ ;
-+
-+ return n;
-+}
-+#endif
-+
-+void *yyalloc (yy_size_t size )
-+{
-+ return (void *) 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 (void *) realloc( (char *) ptr, size );
-+}
-+
-+void yyfree (void * ptr )
-+{
-+ free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
-+}
-+
-+#define YYTABLES_NAME "yytables"
-+
-+#line 74 "tokenparser.l"
-+
-+
-+
-+
-+static void eval_key(char *pcToken, list_t *list_key)
-+{
-+ struct bundleElt *elt;
-+ int r;
-+ size_t len;
-+
-+ /* create a new list element */
-+ elt = malloc(sizeof(*elt));
-+ assert(elt);
-+
-+ /* <key>foobar</key>
-+ * 012345 : 5 is the first key character index */
-+
-+ /* calculate the argument length */
-+ for (len=0; pcToken[len+5] != '<'; len++)
-+ ;
-+ len++; /* final NULL byte */
-+
-+ elt->key = malloc(len);
-+ memcpy(elt->key, &pcToken[5], len-1);
-+ elt->key[len-1] = '\0';
-+
-+ r = list_init(&elt->values);
-+ assert(r >= 0);
-+ (void)r;
-+
-+ /* add the key/values */
-+ list_append(list_key, elt);
-+
-+ /* set the list to store the values */
-+ ListValues = &elt->values;
-+}
-+
-+static void eval_value(char *pcToken, list_t *list_values)
-+{
-+ int r;
-+ size_t len;
-+ char *value;
-+ char *amp;
-+
-+ /* <string>foobar</string>
-+ * 012345678 : 8 is the first string character index */
-+
-+ /* calculate the argument length */
-+ for (len=0; pcToken[len+8] != '<'; len++)
-+ ;
-+ len++; /* final NULL byte */
-+
-+ value = malloc(len);
-+ assert(value);
-+
-+ memcpy(value, &pcToken[8], len-1);
-+ value[len-1] = '\0';
-+
-+ /* for all &amp; in the string */
-+ amp = value;
-+ while ((amp = strstr(amp, "&amp;")) != NULL)
-+ {
-+ char *p;
-+
-+ /* just skip "amp;" substring (4 letters) */
-+ for (p = amp+1; *(p+4); p++)
-+ {
-+ *p = *(p+4);
-+ }
-+ /* terminate the now shorter string */
-+ *p = '\0';
-+
-+ /* skip the & and continue */
-+ amp++;
-+ }
-+
-+ r = list_append(list_values, value);
-+ assert(r >= 0);
-+ (void)r;
-+}
-+
-+void tperrorCheck (char *token_error)
-+{
-+ (void)token_error;
-+}
-+
-+/**
-+ * Find an optional key in a configuration file
-+ * No error is logged if the key is not found
-+ *
-+ * @param l list generated by bundleParse()
-+ * @param key searched key
-+ * @param[out] values list of token value (if key found)
-+ * @retval 0 OK
-+ * @retval 1 key not found
-+ */
-+int LTPBundleFindValueWithKey(list_t *l, const char *key, list_t **values)
-+{
-+ unsigned int i;
-+ int ret = 1;
-+
-+ for (i=0; i < list_size(l); i++)
-+ {
-+ struct bundleElt *elt;
-+
-+ elt = list_get_at(l, i);
-+ assert(elt);
-+
-+ if (0 == strcmp(elt->key, key))
-+ {
-+ *values = &elt->values;
-+ ret = 0;
-+ }
-+ }
-+
-+ return ret;
-+}
-+
-+
-+/**
-+ * Parse a Info.plist file and file a list
-+ *
-+ * @param fileName file name
-+ * @param l list containing the results
-+ * @retval -1 configuration file not found
-+ * @retval 0 OK
-+ */
-+int bundleParse(const char *fileName, list_t *l)
-+{
-+ FILE *file = NULL;
-+ int r;
-+#ifndef NDEBUG
-+ int i;
-+#endif
-+
-+ file = fopen(fileName, "r");
-+ if (!file)
-+ {
-+ Log3(PCSC_LOG_CRITICAL, "Could not open bundle file %s: %s",
-+ fileName, strerror(errno));
-+ return 1;
-+ }
-+
-+ r = list_init(l);
-+ assert(r >= 0);
-+ (void)r;
-+
-+ ListKeys = l;
-+ yyin = file;
-+
-+ do
-+ {
-+ (void)yylex();
-+ } while (!feof(file));
-+ yylex_destroy();
-+
-+ (void)fclose(file);
-+
-+#ifndef NDEBUG
-+ printf("size: %d\n", list_size(l));
-+ for (i=0; i < list_size(l); i++)
-+ {
-+ struct bundleElt *elt;
-+ unsigned int j;
-+
-+ elt = list_get_at(l, i);
-+ assert(elt);
-+ printf("Key: %s\n", elt->key);
-+
-+ for (j=0; j<list_size(&elt->values); j++)
-+ {
-+ char *v = list_get_at(&elt->values, j);
-+ printf(" value: %s\n", v);
-+ }
-+ }
-+#endif
-+
-+ return 0;
-+}
-+
-+/**
-+ * Free the list created by bundleParse()
-+ *
-+ * @param l list containing the results
-+ */
-+void bundleRelease(list_t *l)
-+{
-+ unsigned int i;
-+
-+ for (i=0; i < list_size(l); i++)
-+ {
-+ struct bundleElt *elt;
-+ unsigned int j;
-+
-+ elt = list_get_at(l, i);
-+ assert(elt);
-+
-+ /* free all the values */
-+ for (j=0; j<list_size(&elt->values); j++)
-+ free(list_get_at(&elt->values, j));
-+ list_destroy(&elt->values);
-+
-+ /* free the key */
-+ free(elt->key);
-+ free(elt);
-+ }
-+
-+ list_destroy(l);
-+}
-+
-diff --git a/src/tokenparser.l b/src/tokenparser.l
-deleted file mode 120000
-index a703db9..0000000
---- a/src/tokenparser.l
-+++ /dev/null
-@@ -1 +0,0 @@
--../PCSC/src/tokenparser.l
-\ No newline at end of file
-diff --git a/src/tokenparser.l b/src/tokenparser.l
-new file mode 100644
-index 0000000..0dd47b4
---- /dev/null
-+++ b/src/tokenparser.l
-@@ -0,0 +1,282 @@
-+/*
-+ * Reads lexical config files and updates database.
-+ *
-+ * MUSCLE SmartCard Development ( http://pcsclite.alioth.debian.org/pcsclite.html )
-+ *
-+ * Copyright (C) 2001-2003
-+ * David Corcoran <corcoran@musclecard.com>
-+ * Copyright (C) 2003-2010
-+ * Ludovic Rousseau <ludovic.rousseau@free.fr>
-+ *
-+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. The name of the author may not be used to endorse or promote products
-+ derived from this software without specific prior written permission.
-+
-+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
-+ */
-+
-+/**
-+ * @file
-+ * @brief provides parsing functions for Info.plist files
-+ * platforms
-+ */
-+
-+%{
-+
-+#include "config.h"
-+#include <stdio.h>
-+#include <string.h>
-+#include <errno.h>
-+#define NDEBUG
-+#include <assert.h>
-+
-+#include "simclist.h"
-+#include "debuglog.h"
-+#include "parser.h"
-+
-+static void eval_key(char *pcToken, list_t *list_key);
-+static void eval_value(char *pcToken, list_t *list_values);
-+void tperrorCheck (char *pcToken_error);
-+
-+static list_t *ListKeys;
-+static list_t *ListValues;
-+
-+%}
-+
-+%option nounput
-+%option noinput
-+%option noyywrap
-+
-+%%
-+
-+#.* {}
-+"\n" {}
-+\<key\>([A-Z]|[a-z]|[0-9]|[ \t])+\<\/key\> { eval_key(yytext, ListKeys); }
-+[ \t] {}
-+\<string\>([A-Z]|[a-z]|[0-9]|[ \t]|[!@#$%^&*()\-+/_\:?.,=~'";\[\]])+\<\/string\> { eval_value(yytext, ListValues); }
-+. { tperrorCheck(yytext); }
-+%%
-+
-+
-+static void eval_key(char *pcToken, list_t *list_key)
-+{
-+ struct bundleElt *elt;
-+ int r;
-+ size_t len;
-+
-+ /* create a new list element */
-+ elt = malloc(sizeof(*elt));
-+ assert(elt);
-+
-+ /* <key>foobar</key>
-+ * 012345 : 5 is the first key character index */
-+
-+ /* calculate the argument length */
-+ for (len=0; pcToken[len+5] != '<'; len++)
-+ ;
-+ len++; /* final NULL byte */
-+
-+ elt->key = malloc(len);
-+ memcpy(elt->key, &pcToken[5], len-1);
-+ elt->key[len-1] = '\0';
-+
-+ r = list_init(&elt->values);
-+ assert(r >= 0);
-+ (void)r;
-+
-+ /* add the key/values */
-+ list_append(list_key, elt);
-+
-+ /* set the list to store the values */
-+ ListValues = &elt->values;
-+}
-+
-+static void eval_value(char *pcToken, list_t *list_values)
-+{
-+ int r;
-+ size_t len;
-+ char *value;
-+ char *amp;
-+
-+ /* <string>foobar</string>
-+ * 012345678 : 8 is the first string character index */
-+
-+ /* calculate the argument length */
-+ for (len=0; pcToken[len+8] != '<'; len++)
-+ ;
-+ len++; /* final NULL byte */
-+
-+ value = malloc(len);
-+ assert(value);
-+
-+ memcpy(value, &pcToken[8], len-1);
-+ value[len-1] = '\0';
-+
-+ /* for all &amp; in the string */
-+ amp = value;
-+ while ((amp = strstr(amp, "&amp;")) != NULL)
-+ {
-+ char *p;
-+
-+ /* just skip "amp;" substring (4 letters) */
-+ for (p = amp+1; *(p+4); p++)
-+ {
-+ *p = *(p+4);
-+ }
-+ /* terminate the now shorter string */
-+ *p = '\0';
-+
-+ /* skip the & and continue */
-+ amp++;
-+ }
-+
-+ r = list_append(list_values, value);
-+ assert(r >= 0);
-+ (void)r;
-+}
-+
-+void tperrorCheck (char *token_error)
-+{
-+ (void)token_error;
-+}
-+
-+/**
-+ * Find an optional key in a configuration file
-+ * No error is logged if the key is not found
-+ *
-+ * @param l list generated by bundleParse()
-+ * @param key searched key
-+ * @param[out] values list of token value (if key found)
-+ * @retval 0 OK
-+ * @retval 1 key not found
-+ */
-+int LTPBundleFindValueWithKey(list_t *l, const char *key, list_t **values)
-+{
-+ unsigned int i;
-+ int ret = 1;
-+
-+ for (i=0; i < list_size(l); i++)
-+ {
-+ struct bundleElt *elt;
-+
-+ elt = list_get_at(l, i);
-+ assert(elt);
-+
-+ if (0 == strcmp(elt->key, key))
-+ {
-+ *values = &elt->values;
-+ ret = 0;
-+ }
-+ }
-+
-+ return ret;
-+}
-+
-+
-+/**
-+ * Parse a Info.plist file and file a list
-+ *
-+ * @param fileName file name
-+ * @param l list containing the results
-+ * @retval -1 configuration file not found
-+ * @retval 0 OK
-+ */
-+int bundleParse(const char *fileName, list_t *l)
-+{
-+ FILE *file = NULL;
-+ int r;
-+#ifndef NDEBUG
-+ int i;
-+#endif
-+
-+ file = fopen(fileName, "r");
-+ if (!file)
-+ {
-+ Log3(PCSC_LOG_CRITICAL, "Could not open bundle file %s: %s",
-+ fileName, strerror(errno));
-+ return 1;
-+ }
-+
-+ r = list_init(l);
-+ assert(r >= 0);
-+ (void)r;
-+
-+ ListKeys = l;
-+ yyin = file;
-+
-+ do
-+ {
-+ (void)yylex();
-+ } while (!feof(file));
-+ yylex_destroy();
-+
-+ (void)fclose(file);
-+
-+#ifndef NDEBUG
-+ printf("size: %d\n", list_size(l));
-+ for (i=0; i < list_size(l); i++)
-+ {
-+ struct bundleElt *elt;
-+ unsigned int j;
-+
-+ elt = list_get_at(l, i);
-+ assert(elt);
-+ printf("Key: %s\n", elt->key);
-+
-+ for (j=0; j<list_size(&elt->values); j++)
-+ {
-+ char *v = list_get_at(&elt->values, j);
-+ printf(" value: %s\n", v);
-+ }
-+ }
-+#endif
-+
-+ return 0;
-+}
-+
-+/**
-+ * Free the list created by bundleParse()
-+ *
-+ * @param l list containing the results
-+ */
-+void bundleRelease(list_t *l)
-+{
-+ unsigned int i;
-+
-+ for (i=0; i < list_size(l); i++)
-+ {
-+ struct bundleElt *elt;
-+ unsigned int j;
-+
-+ elt = list_get_at(l, i);
-+ assert(elt);
-+
-+ /* free all the values */
-+ for (j=0; j<list_size(&elt->values); j++)
-+ free(list_get_at(&elt->values, j));
-+ list_destroy(&elt->values);
-+
-+ /* free the key */
-+ free(elt->key);
-+ free(elt);
-+ }
-+
-+ list_destroy(l);
-+}
---
-2.9.0
-
diff --git a/extra/ccid/rev b/extra/ccid/rev
deleted file mode 100644
index d00491fd..00000000
--- a/extra/ccid/rev
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/extra/ccid/src b/extra/ccid/src
deleted file mode 160000
-Subproject a1197c49cee479f4187dfd05c900224b99127e1
diff --git a/extra/efibootmgr/gen.rc b/extra/efibootmgr/gen.rc
deleted file mode 100644
index 2e0cc06e..00000000
--- a/extra/efibootmgr/gen.rc
+++ /dev/null
@@ -1,11 +0,0 @@
-cflags\
- -I '$builddir'/extra/efivar/include\
- -I '$srcdir'/src/include
-
-exe efibootmgr -d extra/efivar/headers\
- src/^(efibootmgr/efibootmgr.c lib/^(efi.c unparse_path.c))\
- '$builddir'/extra/efivar/^(libefiboot.a libefivar.a)
-file bin/efibootmgr '$outdir'/efibootmgr 755
-file share/man/man8/efibootmgr.8 '$srcdir'/src/man/man8/efibootmgr.8 644
-
-fetch git
diff --git a/extra/efibootmgr/rev b/extra/efibootmgr/rev
deleted file mode 100644
index d00491fd..00000000
--- a/extra/efibootmgr/rev
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/extra/efibootmgr/src b/extra/efibootmgr/src
deleted file mode 160000
-Subproject bedb008bbc464818dbeabce6cbd0fec88b5d938
diff --git a/extra/efivar/.gitignore b/extra/efivar/.gitignore
deleted file mode 100644
index 012dc66e..00000000
--- a/extra/efivar/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/tools.ninja
diff --git a/extra/efivar/compat.h b/extra/efivar/compat.h
deleted file mode 100644
index 4f4842f7..00000000
--- a/extra/efivar/compat.h
+++ /dev/null
@@ -1,3 +0,0 @@
-#ifndef __bswap_constant_16
-#define __bswap_constant_16(x) ((x)<<8&0xff00 | (x)>>8&0xff)
-#endif
diff --git a/extra/efivar/gen.rc b/extra/efivar/gen.rc
deleted file mode 100644
index 4dc6f8fd..00000000
--- a/extra/efivar/gen.rc
+++ /dev/null
@@ -1,36 +0,0 @@
-cc src/guids.S '||' '$outdir'/^(guids.bin names.bin) ; with\
- cflags '$cflags -I $outdir'
-
-cflags\
- -D _GNU_SOURCE\
- -include '$dir'/compat.h\
- -I '$outdir'/include\
- -I '$srcdir'/src/include/efivar
-
-{
- include 'toolchain/$host_toolchain.ninja'
- cflags\
- -D EFIVAR_BUILD_ENVIRONMENT\
- -I '$srcdir'/src/include/efivar
- build '$outdir'/host-guid.c.o cc '$srcdir'/src/guid.c
- exe makeguids src/makeguids.c host-guid.c.o
-} >tools.ninja ; subninja tools.ninja
-
-rule makeguids '$outdir/makeguids $in $out'
-outs='$outdir'/^(guids.bin names.bin guid-symbols.c include/efivar-guids.h)\
- build $"outs makeguids '$srcdir'/src/guids.txt '|' '$outdir'/makeguids
-
-hdrs=(efiboot.h efiboot-creator.h efiboot-loadopt.h efivar.h efivar-dp.h)
-for(hdr in $hdrs) {
- build '$outdir'/include/$hdr copy '$srcdir'/src/include/efivar/$hdr
-}
-phony headers '$outdir'/include/^($hdrs efivar-guids.h)
-
-lib libefiboot.a src/^(crc32.c creator.c disk.c gpt.c linux.c loadopt.c)
-lib libefivar.a -d '$outdir'/include/efivar-guids.h src/^(\
- dp.c dp-acpi.c dp-hw.c dp-media.c dp-message.c\
- efivarfs.c export.c guid.c guids.S.o\
- lib.c vars.c\
-) '$outdir'/guid-symbols.c
-
-fetch git
diff --git a/extra/efivar/patch/0001-Workaround-rename-of-linux-nvme.h.patch b/extra/efivar/patch/0001-Workaround-rename-of-linux-nvme.h.patch
deleted file mode 100644
index d18b779f..00000000
--- a/extra/efivar/patch/0001-Workaround-rename-of-linux-nvme.h.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From 2b91a687fc2734ee53abfb02b115ea546f46c6f1 Mon Sep 17 00:00:00 2001
-From: Mike Gilbert <floppym@gentoo.org>
-Date: Thu, 14 Jan 2016 17:02:31 -0500
-Subject: [PATCH] Workaround rename of linux/nvme.h
-
-Bug: https://bugs.gentoo.org/571548
----
- src/linux.c | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/src/linux.c b/src/linux.c
-index b618cfd..9388cd3 100644
---- a/src/linux.c
-+++ b/src/linux.c
-@@ -22,7 +22,12 @@
- #include <inttypes.h>
- #include <limits.h>
- #include <linux/ethtool.h>
-+#include <linux/version.h>
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)
-+#include <linux/nvme_ioctl.h>
-+#else
- #include <linux/nvme.h>
-+#endif
- #include <linux/sockios.h>
- #include <net/if.h>
- #include <scsi/scsi.h>
---
-2.9.0
-
diff --git a/extra/efivar/rev b/extra/efivar/rev
deleted file mode 100644
index d00491fd..00000000
--- a/extra/efivar/rev
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/extra/efivar/src b/extra/efivar/src
deleted file mode 160000
-Subproject 6478af5af7e2fc8fa2247a47b6db9f2a5dc9136
diff --git a/extra/fribidi/.gitignore b/extra/fribidi/.gitignore
deleted file mode 100644
index 012dc66e..00000000
--- a/extra/fribidi/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/tools.ninja
diff --git a/extra/fribidi/config.h b/extra/fribidi/config.h
deleted file mode 100644
index 60024eab..00000000
--- a/extra/fribidi/config.h
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <config-posix.h>
-
-/* #undef DEBUG */
-/* #undef HAVE_ASM_PAGE_H */
-#define HAVE_MEMORY_H 1
-#define HAVE_STRINGIZE 1
-#define LT_OBJDIR ".libs/"
-#define PACKAGE_BUGREPORT "http://bugs.freedesktop.org/enter_bug.cgi?product=fribidi"
-#define PACKAGE_NAME "GNU FriBidi"
-#define PACKAGE_STRING "GNU FriBidi 0.19.7"
-#define PACKAGE_TARNAME "fribidi"
-#define PACKAGE_URL "http://fribidi.org/"
-#define PACKAGE_VERSION "0.19.7"
-#define SIZEOF_INT 4
-#define SIZEOF_SHORT 2
-#define SIZEOF_VOID_P 8
-#define SIZEOF_WCHAR_T 4
-#define USE_SIMPLE_MALLOC 1
-/* #undef const */
diff --git a/extra/fribidi/fribidi-config.h b/extra/fribidi/fribidi-config.h
deleted file mode 100644
index d7791240..00000000
--- a/extra/fribidi/fribidi-config.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* lib/fribidi-config.h. Generated from fribidi-config.h.in by configure. */
-/* Not copyrighted, in public domain. */
-#ifndef FRIBIDI_CONFIG_H
-#define FRIBIDI_CONFIG_H
-
-#define FRIBIDI "fribidi"
-#define FRIBIDI_NAME "GNU FriBidi"
-#define FRIBIDI_BUGREPORT "http://bugs.freedesktop.org/enter_bug.cgi?product=fribidi"
-
-#define FRIBIDI_VERSION "0.19.7"
-#define FRIBIDI_MAJOR_VERSION 0
-#define FRIBIDI_MINOR_VERSION 19
-#define FRIBIDI_MICRO_VERSION 7
-#define FRIBIDI_INTERFACE_VERSION 3
-#define FRIBIDI_INTERFACE_VERSION_STRING "3"
-
-/* Define to 1 if you want charset conversion codes in the library */
-#define FRIBIDI_CHARSETS 0
-
-/* Define to 1 if you want to use glib */
-#define FRIBIDI_USE_GLIB 0
-
-/* The size of a `int', as computed by sizeof. */
-#define FRIBIDI_SIZEOF_INT 4
-
-#endif /* FRIBIDI_CONFIG_H */
diff --git a/extra/fribidi/gen.rc b/extra/fribidi/gen.rc
deleted file mode 100644
index 18d55075..00000000
--- a/extra/fribidi/gen.rc
+++ /dev/null
@@ -1,63 +0,0 @@
-cflags\
- -D HAVE_CONFIG_H\
- -I include\
- -I '$dir' \
- -I '$outdir' \
- -I '$outdir'/include\
- -I '$srcdir'/lib
-
-{
- cc gen.tab/packtab.c
- exe gen-unicode-version gen.tab/gen-unicode-version.c
- for(t in bidi-type joining-type arabic-shaping mirroring)
- exe gen-$t-tab -d '$dir'/headers gen.tab/^(gen-$t-tab.c packtab.c.o)
-} >tools.ninja ; subninja tools.ninja
-
-set compression 2
-
-rule gentool '$outdir/$tool $args $in >$out.tmp && mv $out.tmp $out'
-fn gentool {
- tool=$1
- out=$2
- shift 2
- build '$outdir'/$out gentool '$srcdir'/gen.tab/unidata/$* '|' '$outdir'/gen-$tool
- with tool gen-$tool
-}
-
-gentool unicode-version include/fribidi-unicode-version.h BidiMirroring.txt
-gentool bidi-type-tab bidi-type.tab.i UnicodeData.txt ; with args '$compression'
-gentool joining-type-tab joining-type.tab.i UnicodeData.txt ArabicShaping.txt ; with args '$compression'
-gentool arabic-shaping-tab arabic-shaping.tab.i UnicodeData.txt ; with args '$compression'
-gentool mirroring-tab mirroring.tab.i BidiMirroring.txt ; with args '$compression'
-
-hdrs=(\
- fribidi.h fribidi-arabic.h fribidi-begindecls.h\
- fribidi-bidi.h fribidi-bidi-types.h fribidi-bidi-types-list.h\
- fribidi-common.h fribidi-deprecated.h fribidi-enddecls.h fribidi-flags.h\
- fribidi-joining.h fribidi-joining-types.h fribidi-joining-types-list.h\
- fribidi-mirroring.h fribidi-shape.h fribidi-types.h fribidi-unicode.h\
-)
-for(hdr in $hdrs)
- build '$outdir'/include/$hdr copy '$srcdir'/lib/$hdr
-build '$outdir'/include/fribidi-config.h copy '$dir'/fribidi-config.h
-phony headers '$outdir'/include/^($hdrs fribidi-config.h fribidi-unicode-version.h)
-
-phony deps\
- '$outdir'/^(bidi-type joining-type arabic-shaping mirroring)^.tab.i\
- '$dir'/headers
-
-lib libfribidi.a -d '$dir'/deps lib/^(\
- fribidi.c\
- fribidi-arabic.c\
- fribidi-bidi.c\
- fribidi-bidi-types.c\
- fribidi-deprecated.c\
- fribidi-joining.c\
- fribidi-joining-types.c\
- fribidi-mem.c\
- fribidi-mirroring.c\
- fribidi-run.c\
- fribidi-shape.c\
-)
-
-fetch git
diff --git a/extra/fribidi/rev b/extra/fribidi/rev
deleted file mode 100644
index d00491fd..00000000
--- a/extra/fribidi/rev
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/extra/fribidi/src b/extra/fribidi/src
deleted file mode 160000
-Subproject 1a6935cd8cd7d907fb3c5f3bcae174bee727c83
diff --git a/extra/gen.rc b/extra/gen.rc
deleted file mode 100644
index 084f615c..00000000
--- a/extra/gen.rc
+++ /dev/null
@@ -1,23 +0,0 @@
-subgen ccid
-subgen efibootmgr
-subgen efivar
-subgen fribidi
-subgen hostap
-subgen ii
-subgen less
-subgen libevent
-subgen libfuse
-subgen libnl
-subgen libtermkey
-subgen libusb
-subgen lpeg
-subgen man-pages-posix
-subgen msmtp
-subgen ncurses
-subgen pcre
-subgen pcsc
-subgen sshfs
-subgen the_silver_searcher
-subgen transmission
-subgen unzip
-subgen vis
diff --git a/extra/hostap/config.h b/extra/hostap/config.h
deleted file mode 100644
index 75c66698..00000000
--- a/extra/hostap/config.h
+++ /dev/null
@@ -1,17 +0,0 @@
-#define CONFIG_BACKEND_FILE
-#define CONFIG_CTRL_IFACE
-#define CONFIG_CTRL_IFACE_DIR "/run/wpa_supplicant"
-#define CONFIG_CTRL_IFACE_UNIX
-#define CONFIG_DRIVER_NL80211
-#define CONFIG_ELOOP_POLL
-#define CONFIG_IBSS_RSN
-#define CONFIG_LIBNL20
-#define CONFIG_LIBNL32
-#define CONFIG_NO_CONFIG_BLOBS
-#define CONFIG_NO_CONFIG_WRITE
-#define CONFIG_NO_RADIUS
-#define CONFIG_NO_VLAN
-#define CONFIG_PEERKEY
-#define CONFIG_SHA256
-#define CONFIG_SME
-#define CONFIG_TDLS
diff --git a/extra/hostap/gen.rc b/extra/hostap/gen.rc
deleted file mode 100644
index 9f5d3e62..00000000
--- a/extra/hostap/gen.rc
+++ /dev/null
@@ -1,88 +0,0 @@
-cflags\
- -include '$dir'/config.h\
- -isystem '$builddir'/core/libressl/include\
- -isystem '$builddir'/extra/libnl/include\
- -I '$srcdir'/src/utils\
- -I '$srcdir'/src
-
-phony deps (core/libressl extra/libnl)^/headers
-
-lib libcommon.a -d '$dir'/deps src/utils/^(common.c eloop.c os_unix.c wpa_debug.c)
-
-exe bin/wpa_supplicant -d '$dir'/deps\
- src/ap/^(\
- wpa_auth.c\
- wpa_auth_ie.c\
- pmksa_cache_auth.c\
- peerkey_auth.c\
- )\
- src/common/^(\
- ctrl_iface_common.c\
- hw_features_common.c\
- ieee802_11_common.c\
- wpa_common.c\
- )\
- src/crypto/^(\
- aes-omac1.c\
- crypto_openssl.c\
- random.c\
- sha1-prf.c\
- sha256-prf.c\
- tls_none.c\
- )\
- src/drivers/^(\
- driver_common.c\
- driver_nl80211.c\
- driver_nl80211_capa.c\
- driver_nl80211_event.c\
- driver_nl80211_monitor.c\
- driver_nl80211_scan.c\
- drivers.c\
- linux_ioctl.c\
- netlink.c\
- rfkill.c\
- )\
- src/l2_packet/l2_packet_linux.c\
- src/rsn_supp/^(\
- peerkey.c\
- pmksa_cache.c\
- preauth.c\
- tdls.c\
- wpa.c\
- wpa_ie.c\
- )\
- src/utils/^(radiotap.c wpabuf.c)\
- wpa_supplicant/^(\
- blacklist.c\
- bss.c\
- config.c\
- config_file.c\
- ctrl_iface.c\
- ctrl_iface_unix.c\
- eap_register.c\
- events.c\
- ibss_rsn.c\
- main.c\
- notify.c\
- scan.c\
- sme.c\
- wmm_ac.c\
- wpa_supplicant.c\
- wpas_glue.c\
- )\
- libcommon.a\
- '$builddir'/^(\
- core/libressl/libcrypto.a\
- core/openbsd/libbsd.a\
- extra/libnl/^(libnl-3.a libnl-genl-3.a)\
- )
-file bin/wpa_supplicant '$outdir'/bin/wpa_supplicant 755
-
-exe bin/wpa_cli -d '$dir'/deps\
- src/common/^(cli.c wpa_ctrl.c)\
- src/utils/edit_simple.c\
- wpa_supplicant/wpa_cli.c\
- libcommon.a
-file bin/wpa_cli '$outdir'/bin/wpa_cli 755
-
-fetch git
diff --git a/extra/hostap/patch/0001-LibreSSL-Fix-dh5-code.patch b/extra/hostap/patch/0001-LibreSSL-Fix-dh5-code.patch
deleted file mode 100644
index 4477adb3..00000000
--- a/extra/hostap/patch/0001-LibreSSL-Fix-dh5-code.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From ae1639dc00fe116c88403c7c23bdd76181191c7a Mon Sep 17 00:00:00 2001
-From: Christian Neukirchen <chneukirchen@gmail.com>
-Date: Wed, 5 Oct 2016 16:35:48 +0200
-Subject: [PATCH] LibreSSL: Fix dh5 code
-
-Add LibreSSL check to old OpenSSL #ifdef guard as DH_{get0,set0}_key()
-is not implemented in LibreSSL.
-
-Signed-off-by: Christian Neukirchen <chneukirchen@gmail.com>
----
- src/crypto/crypto_openssl.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/crypto/crypto_openssl.c b/src/crypto/crypto_openssl.c
-index 19e0e2b..b3d1b07 100644
---- a/src/crypto/crypto_openssl.c
-+++ b/src/crypto/crypto_openssl.c
-@@ -611,7 +611,7 @@ void crypto_cipher_deinit(struct crypto_cipher *ctx)
-
- void * dh5_init(struct wpabuf **priv, struct wpabuf **publ)
- {
--#if OPENSSL_VERSION_NUMBER < 0x10100000L
-+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
- DH *dh;
- struct wpabuf *pubkey = NULL, *privkey = NULL;
- size_t publen, privlen;
-@@ -712,7 +712,7 @@ err:
-
- void * dh5_init_fixed(const struct wpabuf *priv, const struct wpabuf *publ)
- {
--#if OPENSSL_VERSION_NUMBER < 0x10100000L
-+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
- DH *dh;
-
- dh = DH_new();
---
-2.10.1
-
diff --git a/extra/hostap/rev b/extra/hostap/rev
deleted file mode 100644
index 0cfbf088..00000000
--- a/extra/hostap/rev
+++ /dev/null
@@ -1 +0,0 @@
-2
diff --git a/extra/hostap/src b/extra/hostap/src
deleted file mode 160000
-Subproject 2462f347bca0a7cce7e06ff88adbe3aa47c52d5
diff --git a/extra/ii/gen.rc b/extra/ii/gen.rc
deleted file mode 100644
index 9b8f8e56..00000000
--- a/extra/ii/gen.rc
+++ /dev/null
@@ -1,9 +0,0 @@
-cflags\
- -Wall\
- -D 'VERSION=''"1.7-12-g714bd0c"'''
-
-exe ii ii.c
-file bin/ii '$outdir'/ii 755
-file share/man/man1/ii.1 '$srcdir'/ii.1 644
-
-fetch git
diff --git a/extra/ii/rev b/extra/ii/rev
deleted file mode 100644
index d00491fd..00000000
--- a/extra/ii/rev
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/extra/ii/src b/extra/ii/src
deleted file mode 160000
-Subproject 714bd0cb6ae1eae57ca69b4dbe9fb5243c7a945
diff --git a/extra/less/.gitignore b/extra/less/.gitignore
deleted file mode 100644
index 937c7e72..00000000
--- a/extra/less/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/less-481.tar.gz
-/src
diff --git a/extra/less/defines.h b/extra/less/defines.h
deleted file mode 100644
index 5dc06828..00000000
--- a/extra/less/defines.h
+++ /dev/null
@@ -1,99 +0,0 @@
-#include <config-posix.h>
-
-#define BINDIR "/bin"
-#define SYSDIR "/etc"
-
-#define SECURE SECURE_COMPILE
-#define SHELL_ESCAPE (!SECURE)
-#define EXAMINE (!SECURE)
-#define TAB_COMPLETE_FILENAME (!SECURE)
-#define CMD_HISTORY 1
-#define HILITE_SEARCH 1
-#define EDITOR (!SECURE)
-#define TAGS (!SECURE)
-#define USERFILE (!SECURE)
-#define GLOB (!SECURE)
-#define PIPEC (!SECURE)
-#define LOGFILE (!SECURE)
-#define GNU_OPTIONS 1
-#define ONLY_RETURN 0
-#define LESSKEYFILE ".less"
-#define LESSKEYFILE_SYS SYSDIR "/sysless"
-#define DEF_LESSKEYINFILE ".lesskey"
-#define LESSHISTFILE ".lesshst"
-#define MSDOS_COMPILER 0
-#define PATHNAME_SEP "/"
-#define TGETENT_OK 1
-/* #undef HAVE_SGSTAT_H */
-#define HAVE_PERROR 1
-#define HAVE_TIME 1
-#define HAVE_SHELL 1
-#define DEF_METACHARS "; *?\t\n'\"()<>[]|&^`#\\$%=~"
-#define DEF_METAESCAPE "\\"
-#define HAVE_DUP 1
-#if 0 /* old sizes for small memory machines */
-#define CMDBUF_SIZE 512 /* Buffer for multichar commands */
-#define UNGOT_SIZE 100 /* Max chars to unget() */
-#define LINEBUF_SIZE 1024 /* Max size of line in input file */
-#define OUTBUF_SIZE 1024 /* Output buffer */
-#define PROMPT_SIZE 200 /* Max size of prompt string */
-#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */
-#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */
-#define TAGLINE_SIZE 512 /* Max size of line in tags file */
-#define TABSTOP_MAX 32 /* Max number of custom tab stops */
-#else /* more reasonable sizes for modern machines */
-#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */
-#define UNGOT_SIZE 200 /* Max chars to unget() */
-#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */
-#define OUTBUF_SIZE 1024 /* Output buffer */
-#define PROMPT_SIZE 2048 /* Max size of prompt string */
-#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */
-#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */
-#define TAGLINE_SIZE 1024 /* Max size of line in tags file */
-#define TABSTOP_MAX 128 /* Max number of custom tab stops */
-#endif
-#define EDIT_PGM "vi"
-#define HAVE_CONST 1
-#define HAVE_FLOAT 1
-/* #undef HAVE_GNU_REGEX */
-#define HAVE_LOCALE 1
-#define HAVE_MEMORY_H 1
-#define HAVE_OSPEED 1
-/* #undef HAVE_PCRE */
-#define HAVE_POSIX_REGCOMP 1
-/* #undef HAVE_REGCMP */
-/* #undef HAVE_REGEXEC2 */
-/* #undef HAVE_RE_COMP */
-/* #undef HAVE_SIGSETMASK */
-#define HAVE_SIGSET_T 1
-#define HAVE_STAT_INO 1
-#define HAVE_SYS_ERRLIST 1
-#define HAVE_SYS_IOCTL_H 1
-/* #undef HAVE_SYS_STREAM_H */
-#define HAVE_TERMCAP_H 1
-#define HAVE_TERMIOS_FUNCS 1
-/* #undef HAVE_TERMIO_H */
-#define HAVE_UPPER_LOWER 1
-/* #undef HAVE_V8_REGCOMP */
-#define HAVE_VALUES_H 1
-#define HAVE_VOID 1
-/* #undef MUST_DEFINE_ERRNO */
-/* #undef MUST_DEFINE_OSPEED */
-/* #undef NO_REGEX */
-#define PACKAGE_BUGREPORT ""
-#define PACKAGE_NAME "less"
-#define PACKAGE_STRING "less 1"
-#define PACKAGE_TARNAME "less"
-#define PACKAGE_URL ""
-#define PACKAGE_VERSION "1"
-#define SECURE_COMPILE 0
-/* #undef STAT_MACROS_BROKEN */
-#define TIME_WITH_SYS_TIME 1
-#ifndef _DARWIN_USE_64_BIT_INODE
-# define _DARWIN_USE_64_BIT_INODE 1
-#endif
-/* #undef _FILE_OFFSET_BITS */
-/* #undef _LARGE_FILES */
-/* #undef const */
-/* #undef off_t */
-/* #undef size_t */
diff --git a/extra/less/gen.rc b/extra/less/gen.rc
deleted file mode 100644
index ff5fbd97..00000000
--- a/extra/less/gen.rc
+++ /dev/null
@@ -1,17 +0,0 @@
-cflags\
- -isystem '$builddir'/extra/ncurses/include\
- -I include\
- -I '$dir'
-
-exe less -d extra/ncurses/headers\
- main.c screen.c brac.c ch.c charset.c cmdbuf.c\
- command.c cvt.c decode.c edit.c filename.c forwback.c\
- help.c ifile.c input.c jump.c line.c linenum.c\
- lsystem.c mark.c optfunc.c option.c opttbl.c os.c\
- output.c pattern.c position.c prompt.c search.c signal.c\
- tags.c ttyin.c version.c\
- '$builddir'/extra/ncurses/libncurses.a
-file bin/less '$outdir'/less 755
-file share/man/man1/less.1 '$srcdir'/less.nro 644
-
-fetch curl
diff --git a/extra/less/rev b/extra/less/rev
deleted file mode 100644
index d00491fd..00000000
--- a/extra/less/rev
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/extra/less/sha256 b/extra/less/sha256
deleted file mode 100644
index f404456f..00000000
--- a/extra/less/sha256
+++ /dev/null
@@ -1 +0,0 @@
-3fa38f2cf5e9e040bb44fffaa6c76a84506e379e47f5a04686ab78102090dda5 less-481.tar.gz
diff --git a/extra/less/url b/extra/less/url
deleted file mode 100644
index 1d361f40..00000000
--- a/extra/less/url
+++ /dev/null
@@ -1 +0,0 @@
-url = "http://www.greenwoodsoftware.com/less/less-481.tar.gz"
diff --git a/extra/libevent/config.h b/extra/libevent/config.h
deleted file mode 100644
index 8b729bcf..00000000
--- a/extra/libevent/config.h
+++ /dev/null
@@ -1,149 +0,0 @@
-/* don't use config-posix.h here, this file gets processed by make-event-config.sed */
-
-/* disabled to prevent building extra backends */
-/* #undef HAVE_POLL */
-/* #undef HAVE_SELECT */
-
-/* #undef DISABLE_DEBUG_MODE */
-#define DISABLE_MM_REPLACEMENT 1
-/* #undef DISABLE_THREAD_SUPPORT */
-/* #undef HAVE_ARC4RANDOM */
-/* #undef HAVE_ARC4RANDOM_BUF */
-#define HAVE_ARPA_INET_H 1
-#define HAVE_CLOCK_GETTIME 1
-/* #undef HAVE_DECL_CTL_KERN */
-/* #undef HAVE_DECL_KERN_ARND */
-/* #undef HAVE_DECL_KERN_RANDOM */
-/* #undef HAVE_DECL_RANDOM_UUID */
-/* #undef HAVE_DEVPOLL */
-#define HAVE_DLFCN_H 1
-#define HAVE_EPOLL 1
-#define HAVE_EPOLL_CTL 1
-#define HAVE_EVENTFD 1
-/* #undef HAVE_EVENT_PORTS */
-#define HAVE_FCNTL 1
-#define HAVE_FCNTL_H 1
-#define HAVE_FD_MASK 1
-#define HAVE_GETADDRINFO 1
-#define HAVE_GETEGID 1
-#define HAVE_GETEUID 1
-/* #undef HAVE_GETHOSTBYNAME_R */
-/* #undef HAVE_GETHOSTBYNAME_R_3_ARG */
-/* #undef HAVE_GETHOSTBYNAME_R_5_ARG */
-/* #undef HAVE_GETHOSTBYNAME_R_6_ARG */
-#define HAVE_GETNAMEINFO 1
-#define HAVE_GETPROTOBYNUMBER 1
-/* #undef HAVE_GETSERVBYNAME */
-#define HAVE_GETTIMEOFDAY 1
-#define HAVE_INET_ATON 1
-#define HAVE_INET_NTOP 1
-#define HAVE_INET_PTON 1
-#define HAVE_INTTYPES_H 1
-#define HAVE_ISSETUGID 1
-/* #undef HAVE_KQUEUE */
-/* #undef HAVE_LIBZ */
-#define HAVE_MEMORY_H 1
-#define HAVE_MMAP 1
-#define HAVE_NETDB_H 1
-/* #undef HAVE_NETINET_IN6_H */
-#define HAVE_NETINET_IN_H 1
-/* #undef HAVE_OPENSSL */
-/* #undef HAVE_OPENSSL_BIO_H */
-#define HAVE_PIPE 1
-#define HAVE_POLL_H 1
-/* #undef HAVE_PORT_CREATE */
-/* #undef HAVE_PORT_H */
-/* #undef HAVE_PTHREAD */
-#define HAVE_PTHREADS 1
-#define HAVE_PUTENV 1
-#define HAVE_SA_FAMILY_T 1
-#define HAVE_SENDFILE 1
-#define HAVE_SETENV 1
-#define HAVE_SETFD 1
-#define HAVE_SIGACTION 1
-#define HAVE_SIGNAL 1
-#define HAVE_SPLICE 1
-#define HAVE_STDARG_H 1
-#define HAVE_STDDEF_H 1
-#define HAVE_STDINT_H 1
-#define HAVE_STDLIB_H 1
-#define HAVE_STRINGS_H 1
-#define HAVE_STRING_H 1
-#define HAVE_STRLCPY 1
-#define HAVE_STRSEP 1
-#define HAVE_STRTOK_R 1
-#define HAVE_STRTOLL 1
-#define HAVE_STRUCT_ADDRINFO 1
-#define HAVE_STRUCT_IN6_ADDR 1
-#define HAVE_STRUCT_IN6_ADDR_S6_ADDR16 1
-#define HAVE_STRUCT_IN6_ADDR_S6_ADDR32 1
-#define HAVE_STRUCT_SOCKADDR_IN6 1
-/* #undef HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN */
-/* #undef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN */
-#define HAVE_STRUCT_SOCKADDR_STORAGE 1
-#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1
-/* #undef HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY */
-/* #undef HAVE_SYSCTL */
-/* #undef HAVE_SYS_DEVPOLL_H */
-#define HAVE_SYS_EPOLL_H 1
-#define HAVE_SYS_EVENTFD_H 1
-/* #undef HAVE_SYS_EVENT_H */
-#define HAVE_SYS_IOCTL_H 1
-#define HAVE_SYS_MMAN_H 1
-#define HAVE_SYS_PARAM_H 1
-/* #undef HAVE_SYS_QUEUE_H */
-#define HAVE_SYS_SELECT_H 1
-#define HAVE_SYS_SENDFILE_H 1
-#define HAVE_SYS_SOCKET_H 1
-#define HAVE_SYS_STAT_H 1
-/* #undef HAVE_SYS_SYSCTL_H */
-#define HAVE_SYS_TIME_H 1
-#define HAVE_SYS_TYPES_H 1
-#define HAVE_SYS_UIO_H 1
-#define HAVE_SYS_WAIT_H 1
-/* #undef HAVE_TAILQFOREACH */
-#define HAVE_TIMERADD 1
-#define HAVE_TIMERCLEAR 1
-#define HAVE_TIMERCMP 1
-#define HAVE_TIMERISSET 1
-#define HAVE_UINT16_T 1
-#define HAVE_UINT32_T 1
-#define HAVE_UINT64_T 1
-#define HAVE_UINT8_T 1
-#define HAVE_UINTPTR_T 1
-#define HAVE_UMASK 1
-#define HAVE_UNISTD_H 1
-#define HAVE_UNSETENV 1
-#define HAVE_VASPRINTF 1
-/* #undef HAVE_WORKING_KQUEUE */
-/* #undef HAVE_ZLIB_H */
-#define LT_OBJDIR ".libs/"
-#define NUMERIC_VERSION 0x02001600
-#define PACKAGE "libevent"
-#define PACKAGE_BUGREPORT ""
-#define PACKAGE_NAME ""
-#define PACKAGE_STRING ""
-#define PACKAGE_TARNAME ""
-#define PACKAGE_URL ""
-#define PACKAGE_VERSION ""
-/* #undef PTHREAD_CREATE_JOINABLE */
-#define SIZEOF_INT 4
-#define SIZEOF_LONG 8
-#define SIZEOF_LONG_LONG 8
-#define SIZEOF_OFF_T 8
-#define SIZEOF_PTHREAD_T 8
-#define SIZEOF_SHORT 2
-#define SIZEOF_SIZE_T 8
-#define SIZEOF_VOID_P 8
-#define STDC_HEADERS 1
-#define TIME_WITH_SYS_TIME 1
-#define VERSION "2.0.22-stable"
-/* #undef __func__ */
-/* #undef const */
-#ifndef __cplusplus
-/* #undef inline */
-#endif
-/* #undef pid_t */
-/* #undef size_t */
-/* #undef socklen_t */
-/* #undef ssize_t */
diff --git a/extra/libevent/gen.rc b/extra/libevent/gen.rc
deleted file mode 100644
index 1656be3e..00000000
--- a/extra/libevent/gen.rc
+++ /dev/null
@@ -1,23 +0,0 @@
-cflags\
- -I '$outdir'/include\
- -I '$srcdir'/include\
- -I include\
- -idirafter core/openbsd/src/sys
-
-build '$outdir'/include/event2/event-config.h\
- sed '$dir'/config.h '|' '$srcdir'/make-event-config.sed
-with expr '-f $srcdir/make-event-config.sed'
-
-phony headers '$outdir'/include/event2/event-config.h
-
-lib libevent.a -d '$dir'/headers\
- event.c evthread.c buffer.c \
- bufferevent.c bufferevent_sock.c bufferevent_filter.c \
- bufferevent_pair.c listener.c bufferevent_ratelim.c \
- evmap.c log.c evutil.c evutil_rand.c strlcpy.c\
- \
- epoll.c signal.c\
- \
- event_tagging.c http.c evdns.c evrpc.c
-
-fetch git
diff --git a/extra/libevent/rev b/extra/libevent/rev
deleted file mode 100644
index d00491fd..00000000
--- a/extra/libevent/rev
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/extra/libevent/src b/extra/libevent/src
deleted file mode 160000
-Subproject c51b159cff9f5e86696f5b9a4c6f51727605625
diff --git a/extra/libfuse/config.h b/extra/libfuse/config.h
deleted file mode 100644
index a4dfbf5a..00000000
--- a/extra/libfuse/config.h
+++ /dev/null
@@ -1,22 +0,0 @@
-#include <config-posix.h>
-
-#define FUSERMOUNT_DIR "/bin"
-#define IGNORE_MTAB
-
-#define HAVE_MEMORY_H 1
-#define HAVE_SETXATTR 1
-#define HAVE_SPLICE 1
-#define HAVE_STRUCT_STAT_ST_ATIM 1
-/* #undef HAVE_STRUCT_STAT_ST_ATIMESPEC */
-#define HAVE_VMSPLICE 1
-#define ICONV_CONST
-/* #undef IGNORE_MTAB */
-#define LT_OBJDIR ".libs/"
-#define PACKAGE "fuse"
-#define PACKAGE_BUGREPORT ""
-#define PACKAGE_NAME "fuse"
-#define PACKAGE_STRING "fuse 2.9.7"
-#define PACKAGE_TARNAME "fuse"
-#define PACKAGE_URL ""
-#define PACKAGE_VERSION "2.9.7"
-#define VERSION "2.9.7"
diff --git a/extra/libfuse/gen.rc b/extra/libfuse/gen.rc
deleted file mode 100644
index 096ac3e0..00000000
--- a/extra/libfuse/gen.rc
+++ /dev/null
@@ -1,33 +0,0 @@
-cflags\
- -D '_FILE_OFFSET_BITS=64' \
- -D 'FUSE_USE_VERSION=26' \
- -I include\
- -I '$dir' \
- -I '$srcdir'/include\
- -I '$srcdir'/lib
-
-cc lib/mount_util.c
-
-exe fusermount util/fusermount.c lib/mount_util.c.o
-file bin/fusermount '$outdir'/fusermount 4755
-file share/man/man1/fusermount.1 '$srcdir'/doc/fusermount.1 644
-
-lib libfuse.a lib/^(\
- fuse.c\
- fuse_kern_chan.c\
- fuse_loop.c\
- fuse_loop_mt.c\
- fuse_lowlevel.c\
- fuse_mt.c\
- fuse_opt.c\
- fuse_session.c\
- fuse_signals.c\
- buffer.c\
- cuse_lowlevel.c\
- helper.c\
- modules/subdir.c\
- \
- mount.c mount_util.c.o\
-)
-
-fetch git
diff --git a/extra/libfuse/patch/0001-Fix-poll.h-include.patch b/extra/libfuse/patch/0001-Fix-poll.h-include.patch
deleted file mode 100644
index 193a7b12..00000000
--- a/extra/libfuse/patch/0001-Fix-poll.h-include.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 8926abd905339e40bf096c904d900caa42e3262f Mon Sep 17 00:00:00 2001
-From: Michael Forney <mforney@mforney.org>
-Date: Fri, 15 Jul 2016 19:21:28 -0700
-Subject: [PATCH] Fix poll.h include
-
----
- lib/mount.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/lib/mount.c b/lib/mount.c
-index 227a408..0fc7d15 100644
---- a/lib/mount.c
-+++ b/lib/mount.c
-@@ -20,7 +20,7 @@
- #include <string.h>
- #include <fcntl.h>
- #include <errno.h>
--#include <sys/poll.h>
-+#include <poll.h>
- #include <sys/socket.h>
- #include <sys/un.h>
- #include <sys/wait.h>
---
-2.9.1
-
diff --git a/extra/libfuse/rev b/extra/libfuse/rev
deleted file mode 100644
index 0cfbf088..00000000
--- a/extra/libfuse/rev
+++ /dev/null
@@ -1 +0,0 @@
-2
diff --git a/extra/libfuse/src b/extra/libfuse/src
deleted file mode 160000
-Subproject df499bf1ce634f6e67d4d366c4475d32143f00f
diff --git a/extra/libnl/defs.h b/extra/libnl/defs.h
deleted file mode 100644
index 6c422830..00000000
--- a/extra/libnl/defs.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#include <config-posix.h>
-
-/* #undef DISABLE_PTHREADS */
-#define HAVE_LIBM 1
-#define HAVE_LIBPTHREAD 1
-#define HAVE_MEMORY_H 1
-#define LT_OBJDIR ".libs/"
-#define NL_DEBUG 1
-#define PACKAGE "libnl"
-#define PACKAGE_BUGREPORT ""
-#define PACKAGE_NAME "libnl"
-#define PACKAGE_STRING "libnl 3.2.28"
-#define PACKAGE_TARNAME "libnl"
-#define PACKAGE_URL "http://www.infradead.org/~tgr/libnl/"
-#define PACKAGE_VERSION "3.2.28"
-#define VERSION "3.2.28"
-/* #undef const */
-#ifndef __cplusplus
-/* #undef inline */
-#endif
diff --git a/extra/libnl/gen.rc b/extra/libnl/gen.rc
deleted file mode 100644
index 35e846b8..00000000
--- a/extra/libnl/gen.rc
+++ /dev/null
@@ -1,52 +0,0 @@
-cflags\
- -D _GNU_SOURCE\
- -D 'SYSCONFDIR=''"/etc/libnl"''' \
- -isystem include\
- -I '$dir' \
- -I '$outdir'/include\
- -I '$srcdir'/include\
- -I '$srcdir'/include/linux-private
-
-hdrs=include/netlink/^(\
- addr.h\
- attr.h\
- cache.h\
- data.h\
- errno.h\
- handlers.h\
- genl/^(ctrl.h genl.h)\
- hash.h\
- list.h\
- msg.h\
- netlink.h\
- netlink-compat.h\
- netlink-kernel.h\
- object.h\
- socket.h\
- types.h\
- utils.h\
-)
-for(hdr in $hdrs) build '$outdir'/$hdr copy '$srcdir'/$hdr
-build '$outdir'/include/netlink/version.h sed '$srcdir'/include/netlink/version.h.in ; exprs=(\
- -e s,@PACKAGE_STRING@,'''libnl 3.2.27''',\
- -e s,@PACKAGE_VERSION@,3.2.27,\
- -e s,@MAJ_VERSION@,3,\
- -e s,@MIN_VERSION@,2,\
- -e s,@MIC_VERSION@,27,\
- -e s,@LT_CURRENT@,222,\
- -e s,@LT_REVISION@,0,\
- -e s,@LT_AGE@,22,\
-) with expr $"exprs
-hdrs=($hdrs include/netlink/version.h)
-phony headers '$outdir'/$hdrs
-
-lib libnl-3.a -d '$dir'/headers lib/^(\
- addr.c attr.c cache.c cache_mngr.c cache_mngt.c data.c\
- error.c handlers.c msg.c nl.c object.c socket.c utils.c\
- version.c hash.c hashtable.c\
-)
-
-lib libnl-genl-3.a -d '$dir'/headers\
- lib/genl/^(ctrl.c family.c genl.c mngt.c)
-
-fetch git
diff --git a/extra/libnl/rev b/extra/libnl/rev
deleted file mode 100644
index 0cfbf088..00000000
--- a/extra/libnl/rev
+++ /dev/null
@@ -1 +0,0 @@
-2
diff --git a/extra/libnl/src b/extra/libnl/src
deleted file mode 160000
-Subproject 656f381ccf58785319bb0236595c896125d33ed
diff --git a/extra/libtermkey/.gitignore b/extra/libtermkey/.gitignore
deleted file mode 100644
index f6c9b14b..00000000
--- a/extra/libtermkey/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/libtermkey-0.18.tar.gz
-/src
diff --git a/extra/libtermkey/gen.rc b/extra/libtermkey/gen.rc
deleted file mode 100644
index ba8f9d89..00000000
--- a/extra/libtermkey/gen.rc
+++ /dev/null
@@ -1,9 +0,0 @@
-cflags\
- '-std=c99' -Wall\
- -isystem '$builddir'/extra/ncurses/include
-
-lib libtermkey.a -d extra/ncurses/headers\
- termkey.c driver-csi.c driver-ti.c\
- '$builddir'/extra/ncurses/libncurses.a
-
-fetch curl
diff --git a/extra/libtermkey/rev b/extra/libtermkey/rev
deleted file mode 100644
index d00491fd..00000000
--- a/extra/libtermkey/rev
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/extra/libtermkey/sha256 b/extra/libtermkey/sha256
deleted file mode 100644
index 67ca7f70..00000000
--- a/extra/libtermkey/sha256
+++ /dev/null
@@ -1 +0,0 @@
-239746de41c845af52bb3c14055558f743292dd6c24ac26c2d6567a5a6093926 libtermkey-0.18.tar.gz
diff --git a/extra/libtermkey/url b/extra/libtermkey/url
deleted file mode 100644
index ce0c5c85..00000000
--- a/extra/libtermkey/url
+++ /dev/null
@@ -1 +0,0 @@
-url = "http://www.leonerd.org.uk/code/libtermkey/libtermkey-0.18.tar.gz"
diff --git a/extra/libusb/config.h b/extra/libusb/config.h
deleted file mode 100644
index 64bd7839..00000000
--- a/extra/libusb/config.h
+++ /dev/null
@@ -1,38 +0,0 @@
-#include <config-posix.h>
-
-#define DEFAULT_VISIBILITY __attribute__((visibility("default")))
-/* #undef ENABLE_DEBUG_LOGGING */
-#define ENABLE_LOGGING 1
-#define HAVE_ASM_TYPES_H 1
-/* #undef HAVE_LIBUDEV */
-/* #undef HAVE_LIBUDEV_H */
-#define HAVE_LINUX_NETLINK_H 1
-#define HAVE_MEMORY_H 1
-#define HAVE_SYSLOG_FUNC 1
-#define LT_OBJDIR ".libs/"
-/* #undef OS_DARWIN */
-/* #undef OS_HAIKU */
-#define OS_LINUX 1
-/* #undef OS_NETBSD */
-/* #undef OS_OPENBSD */
-/* #undef OS_SUNOS */
-/* #undef OS_WINDOWS */
-#define PACKAGE "libusb"
-#define PACKAGE_BUGREPORT "libusb-devel@lists.sourceforge.net"
-#define PACKAGE_NAME "libusb"
-#define PACKAGE_STRING "libusb 1.0.21"
-#define PACKAGE_TARNAME "libusb"
-#define PACKAGE_URL "http://libusb.info"
-#define PACKAGE_VERSION "1.0.21"
-#define POLL_NFDS_TYPE nfds_t
-#define THREADS_POSIX 1
-#define USBI_TIMERFD_AVAILABLE 1
-/* #undef USE_SYSTEM_LOGGING_FACILITY */
-/* #undef USE_UDEV */
-/* #undef USE_USBDK */
-#define VERSION "1.0.21"
-/* #undef WINVER */
-#define _GNU_SOURCE 1
-#ifndef __cplusplus
-/* #undef inline */
-#endif
diff --git a/extra/libusb/gen.rc b/extra/libusb/gen.rc
deleted file mode 100644
index e57cdd13..00000000
--- a/extra/libusb/gen.rc
+++ /dev/null
@@ -1,14 +0,0 @@
-cflags\
- -I include\
- -I '$dir' \
- -I '$srcdir'/libusb
-
-build '$outdir'/include/libusb.h copy '$srcdir'/libusb/libusb.h
-phony headers '$outdir'/include/libusb.h
-
-lib libusb-1.0.a libusb/^(\
- core.c descriptor.c hotplug.c io.c strerror.c sync.c\
- os/^(poll_posix.c threads_posix.c linux_usbfs.c linux_netlink.c)\
-)
-
-fetch git
diff --git a/extra/libusb/rev b/extra/libusb/rev
deleted file mode 100644
index 0cfbf088..00000000
--- a/extra/libusb/rev
+++ /dev/null
@@ -1 +0,0 @@
-2
diff --git a/extra/libusb/src b/extra/libusb/src
deleted file mode 160000
-Subproject 09e75e98b4d9ea7909e8837b7a3f00dda4589dc
diff --git a/extra/lpeg/.gitignore b/extra/lpeg/.gitignore
deleted file mode 100644
index a90c6951..00000000
--- a/extra/lpeg/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/lpeg-1.0.0.tar.gz
-/src
diff --git a/extra/lpeg/gen.rc b/extra/lpeg/gen.rc
deleted file mode 100644
index a3de6bd8..00000000
--- a/extra/lpeg/gen.rc
+++ /dev/null
@@ -1,8 +0,0 @@
-cflags\
- '-std=c99' \
- -isystem lang/lua/src/src
-
-lib liblpeg.a -d '$builddir'/lang/lua/fetch.stamp\
- lpvm.c lpcap.c lptree.c lpcode.c lpprint.c
-
-fetch curl
diff --git a/extra/lpeg/rev b/extra/lpeg/rev
deleted file mode 100644
index d00491fd..00000000
--- a/extra/lpeg/rev
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/extra/lpeg/sha256 b/extra/lpeg/sha256
deleted file mode 100644
index 6ecfc507..00000000
--- a/extra/lpeg/sha256
+++ /dev/null
@@ -1 +0,0 @@
-10190ae758a22a16415429a9eb70344cf29cbda738a6962a9f94a732340abf8e lpeg-1.0.0.tar.gz
diff --git a/extra/lpeg/url b/extra/lpeg/url
deleted file mode 100644
index 62d450bf..00000000
--- a/extra/lpeg/url
+++ /dev/null
@@ -1 +0,0 @@
-url = "http://www.inf.puc-rio.br/~roberto/lpeg/lpeg-1.0.0.tar.gz"
diff --git a/extra/man-pages-posix/.gitignore b/extra/man-pages-posix/.gitignore
deleted file mode 100644
index 069144be..00000000
--- a/extra/man-pages-posix/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/man-pages-posix-2013-a.tar.xz
-/src
diff --git a/extra/man-pages-posix/gen.rc b/extra/man-pages-posix/gen.rc
deleted file mode 100644
index 55892923..00000000
--- a/extra/man-pages-posix/gen.rc
+++ /dev/null
@@ -1,7 +0,0 @@
-rule manpages 'rc ./$dir/manpages.rc $builddir/$repo.git $out $srcdir' ; with\
- deps gcc\
- depfile '$out.d'
-build '$outdir'/manpages.index manpages '|' '$dir'/manpages.rc config.rc '||' '$outdir'/fetch.stamp
-index_inputs=($index_inputs '$outdir'/manpages.index)
-
-fetch curl
diff --git a/extra/man-pages-posix/manpages.rc b/extra/man-pages-posix/manpages.rc
deleted file mode 100644
index dbdf782f..00000000
--- a/extra/man-pages-posix/manpages.rc
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/rc
-
-. ./config.rc
-
-flag e +
-
-ifs='
-'
-repo=$1
-out=$2
-dir=$3
-shift 2
-
-fn checkstatus {}
-
-wd=`{pwd}
-checkstatus
-
-cd $dir
-pages=man?p/*
-pages=()
-for(f in man?p/*) if(fs extra/man-pages-posix $f)
- pages=($pages $f)
-cd $wd
-
-if(~ $#pages 0) {
- >$out
- >$out.d
- exit
-}
-
-hashes=`{git -C $repo hash-object -w --no-filters -- $wd/$dir/$pages}
-checkstatus
-
-~ $#pages $#hashes
-printf '100644 %s\n' $hashes' share/man/'$pages >$out.tmp
-mv $out.tmp $out
-
-echo $out: $dir/$pages >$out.d.tmp
-mv $out.d.tmp $out.d
diff --git a/extra/man-pages-posix/rev b/extra/man-pages-posix/rev
deleted file mode 100644
index e69de29b..00000000
--- a/extra/man-pages-posix/rev
+++ /dev/null
diff --git a/extra/man-pages-posix/sha256 b/extra/man-pages-posix/sha256
deleted file mode 100644
index 31d8683e..00000000
--- a/extra/man-pages-posix/sha256
+++ /dev/null
@@ -1 +0,0 @@
-19633a5c75ff7deab35b1d2c3d5b7748e7bd4ef4ab598b647bb7e7f60b90a808 man-pages-posix-2013-a.tar.xz
diff --git a/extra/man-pages-posix/url b/extra/man-pages-posix/url
deleted file mode 100644
index a04876db..00000000
--- a/extra/man-pages-posix/url
+++ /dev/null
@@ -1 +0,0 @@
-url = "https://www.kernel.org/pub/linux/docs/man-pages/man-pages-posix/man-pages-posix-2013-a.tar.xz"
diff --git a/extra/msmtp/config.h b/extra/msmtp/config.h
deleted file mode 100644
index 09c3d9c3..00000000
--- a/extra/msmtp/config.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#include <config-posix.h>
-
-/* features */
-#define HAVE_LIBSSL 1
-#define HAVE_TLS 1
-/* #undef ENABLE_NLS */
-/* #undef HAVE_GAI_IDN */
-/* #undef HAVE_LIBGNUTLS */
-/* #undef HAVE_LIBGSASL */
-/* #undef HAVE_LIBIDN */
-/* #undef HAVE_LIBSECRET */
-/* #undef HAVE_MACOSXKEYRING */
-
-/* headers */
-#define HAVE_MEMORY_H
-#define HAVE_SYSEXITS_H 1
-
-/* types */
-/* #undef SIZEOF_LONG_LONG */ /* not needed after _Static_assert patch */
-
-/* functions */
-#define HAVE_DCGETTEXT 1
-#define HAVE_GETPASS 1
-#define HAVE_GETTEXT 1
-#define HAVE_VASPRINTF 1
-/* #undef HAVE_CFLOCALECOPYCURRENT */
-/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */
-/* #undef HAVE_FSEEKO64 */
-
-/* misc */
-#define PACKAGE "msmtp"
-#define PACKAGE_BUGREPORT "marlam@marlam.de"
-#define PACKAGE_NAME "msmtp"
-#define PACKAGE_STRING "msmtp 1.6.6"
-#define PACKAGE_TARNAME "msmtp"
-#define PACKAGE_URL "http://msmtp.sourceforge.net/"
-#define PACKAGE_VERSION "1.6.6"
-#define PLATFORM "linux"
-#define VERSION "1.6.6"
diff --git a/extra/msmtp/gen.rc b/extra/msmtp/gen.rc
deleted file mode 100644
index c5f0aac3..00000000
--- a/extra/msmtp/gen.rc
+++ /dev/null
@@ -1,29 +0,0 @@
-cflags\
- -D HAVE_CONFIG_H\
- -D 'SYSCONFDIR=\"/etc\"' \
- -isystem '$builddir'/core/libressl/include\
- -I include\
- -I '$dir' \
-
-exe msmtp -d core/libressl/headers src/^(\
- conf.c\
- list.c\
- msmtp.c\
- net.c\
- netrc.c\
- readbuf.c\
- smtp.c\
- stream.c\
- tools.c\
- xalloc.c\
- aliases.c\
- \
- tls.c\
- \
- base64.c md5.c md5-apps.c\
-) '$builddir'/core/libressl/^(libssl.a.d libcrypto.a.d)
-
-file bin/msmtp '$outdir'/msmtp 755
-file share/man/man1/msmtp.1 '$srcdir'/doc/msmtp.1 644
-
-fetch git
diff --git a/extra/msmtp/patch/0001-Use-_Static_assert-instead-of-checking-for-size-of-l.patch b/extra/msmtp/patch/0001-Use-_Static_assert-instead-of-checking-for-size-of-l.patch
deleted file mode 100644
index f2488fc9..00000000
--- a/extra/msmtp/patch/0001-Use-_Static_assert-instead-of-checking-for-size-of-l.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From 5384637142de4c43b19ff069248f95e4b4d0ed8d Mon Sep 17 00:00:00 2001
-From: Michael Forney <mforney@mforney.org>
-Date: Fri, 13 May 2016 23:01:44 -0700
-Subject: [PATCH] Use _Static_assert instead of checking for size of long long
-
----
- configure.ac | 1 -
- src/conf.c | 4 +---
- 2 files changed, 1 insertion(+), 4 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 33ae887..db4b59c 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -49,7 +49,6 @@ AC_CHECK_HEADERS([sysexits.h netdb.h arpa/inet.h sys/socket.h sys/wait.h])
- AC_CHECK_FUNCS([fmemopen fseeko fseeko64 getpass getservbyname link mkstemp strndup syslog vasprintf])
- AC_SEARCH_LIBS([nanosleep], [rt posix4])
- AC_SEARCH_LIBS([socket], [socket])
--AC_CHECK_SIZEOF([long long])
-
- dnl pkg-config (required to detect libraries)
- PKG_PROG_PKG_CONFIG([])
-diff --git a/src/conf.c b/src/conf.c
-index 875e51e..e471bea 100644
---- a/src/conf.c
-+++ b/src/conf.c
-@@ -36,9 +36,7 @@
- #include <ctype.h>
- #include <errno.h>
-
--#if (SIZEOF_LONG_LONG * CHAR_BIT) < 64
--# error "long long has fewer than 64 bits"
--#endif
-+_Static_assert(sizeof(long long) * CHAR_BIT >= 64, "long long has fewer than 64 bits");
-
- #include "gettext.h"
- #define _(string) gettext(string)
---
-2.10.2
-
diff --git a/extra/msmtp/rev b/extra/msmtp/rev
deleted file mode 100644
index 0cfbf088..00000000
--- a/extra/msmtp/rev
+++ /dev/null
@@ -1 +0,0 @@
-2
diff --git a/extra/msmtp/src b/extra/msmtp/src
deleted file mode 160000
-Subproject 2fa66d2b7fd417b024f48addb2dae0432475187
diff --git a/extra/ncurses/.gitignore b/extra/ncurses/.gitignore
deleted file mode 100644
index fbcf6c54..00000000
--- a/extra/ncurses/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-/ncurses-6.0.tar.gz
-/src
-/tools.ninja
diff --git a/extra/ncurses/gen.rc b/extra/ncurses/gen.rc
deleted file mode 100644
index f8e7dea6..00000000
--- a/extra/ncurses/gen.rc
+++ /dev/null
@@ -1,128 +0,0 @@
-set common_cflags\
- -D NDEBUG\
- -I include\
- -I '$dir' \
- -I '$outdir' \
- -I '$outdir'/include\
- -I '$srcdir'/include\
- -I '$srcdir'/ncurses\
- -I '$srcdir'/progs
-cflags '$common_cflags'
-
-{
- include 'toolchain/$host_toolchain.ninja'
- cflags '$common_cflags' -D USE_BUILD_CC
- exe make_keys -d '$outdir/names.c $outdir/include/curses.h $outdir/include/ncurses_dll.h' ncurses/tinfo/make_keys.c
- exe make_hash -d '$outdir/hashsize.h $outdir/include/curses.h' ncurses/tinfo/make_hash.c
-} >tools.ninja ; subninja tools.ninja
-
-build '$outdir'/curses.head sed '$srcdir'/include/curses.h.in '|' '$dir'/subst.sed ; with\
- expr '-f $dir/subst.sed'
-rule mkkeydefs '{ cat $outdir/curses.head && sh $srcdir/include/MKkey_defs.sh $in && cat $srcdir/include/curses.{wide,tail}; } >$out.tmp && mv $out.tmp $out'
-build '$outdir'/include/curses.h mkkeydefs '$srcdir'/include/Caps '|' '$outdir'/curses.head '$srcdir'/include/^(curses.^(wide tail) MKkey_defs.sh)
-
-rule mkhashsize 'sh $srcdir/include/MKhashsize.sh $in >$out.tmp && mv $out.tmp $out'
-build '$outdir'/hashsize.h mkhashsize '$srcdir'/include/Caps '|' '$srcdir'/include/MKhashsize.sh
-
-rule mkkeyslist 'sh $srcdir/ncurses/tinfo/MKkeys_list.sh $in | sort >$out.tmp && mv $out.tmp $out'
-build '$outdir'/keys.list mkkeyslist '$srcdir'/include/Caps '|' '$srcdir'/ncurses/tinfo/MKkeys_list.sh
-
-rule mkkeys '$outdir/make_keys $in >$out.tmp && mv $out.tmp $out'
-build '$outdir'/init_keytry.h mkkeys '$outdir'/keys.list '|' '$outdir'/make_keys
-
-rule mkdefs 'sh $srcdir/include/MKncurses_def.sh $in >$out.tmp && mv $out.tmp $out'
-build '$outdir'/ncurses_def.h mkdefs '$srcdir'/include/ncurses_defs '|' '$srcdir'/include/MKncurses_def.sh
-
-build '$outdir'/include/ncurses_dll.h sed '$srcdir'/include/ncurses_dll.h.in ; with\
- expr s,@NCURSES_WRAP_PREFIX@,_nc_,
-
-rule mkparam '$srcdir/include/MKparametrized.sh $in >$out.tmp && mv $out.tmp $out'
-build '$outdir'/parametrized.h mkparam '$srcdir'/include/Caps '|' '$srcdir'/include/MKparametrized.sh
-
-build '$outdir'/MKterm.h.awk sed '$srcdir'/include/MKterm.h.awk.in '|' '$dir'/subst.sed ; with\
- expr '-f $dir/subst.sed'
-
-for(f in termcap.h unctrl.h) {
- build '$outdir'/include/$f sed '$srcdir'/include/$f.in '|' '$dir'/subst.sed ; with\
- expr '-f $dir/subst.sed'
-}
-
-rule mkterm 'awk -f $outdir/MKterm.h.awk $in >$out.tmp && mv $out.tmp $out'
-build '$outdir'/include/term.h mkterm '$srcdir'/include/Caps '|' '$outdir'/MKterm.h.awk
-
-build '$outdir'/codes.c awk '$srcdir'/include/Caps '|' '$srcdir'/ncurses/tinfo/MKcodes.awk ; with\
- expr '-f $srcdir/ncurses/tinfo/MKcodes.awk bigstrings=1'
-
-rule mkcaptab '(wd=$$PWD && cd $outdir && $$wd/$srcdir/ncurses/tinfo/MKcaptab.sh awk 1 $$wd/$srcdir/ncurses/tinfo/MKcaptab.awk $$wd/$in) >$out.tmp && mv $out.tmp $out'
-build '$outdir'/comp_captab.c mkcaptab '$srcdir'/include/Caps '|' '$outdir'/make_hash '$srcdir'/tinfo/^(MKcaptab.awk MKcaptab.sh)
-
-rule mkfallback 'sh $srcdir/ncurses/tinfo/MKfallback.sh /dev/null /dev/null /dev/null >$out.tmp && mv $out.tmp $out'
-build '$outdir'/fallback.c mkfallback '|' '$srcdir'/ncurses/tinfo/MKfallback.sh
-
-build '$outdir'/lib_keyname.c awk '$outdir'/keys.list ; with\
- expr '-f $srcdir/ncurses/base/MKkeyname.awk bigstrings=1'
-
-build '$outdir'/names.c awk '$srcdir'/include/Caps '|' '$srcdir'/ncurses/tinfo/MKnames.awk ; with\
- expr '-f $srcdir/ncurses/tinfo/MKnames.awk bigstrings=1'
-
-rule mktermsort 'sh $srcdir/progs/MKtermsort.sh awk $in >$out.tmp && mv $out.tmp $out'
-build '$outdir'/termsort.c mktermsort '$srcdir'/include/Caps '|' '$srcdir'/progs/MKtermsort.sh
-
-build '$outdir'/unctrl.c awk /dev/null '|' '$srcdir'/ncurses/base/MKunctrl.awk ; with\
- expr '-f $srcdir/ncurses/base/MKunctrl.awk bigstrings=1'
-
-hdrs=include/^(curses.h ncurses_dll.h term.h termcap.h unctrl.h)
-for(hdr in $hdrs) file $hdr '$outdir'/$hdr 644
-phony headers '$outdir'/$hdrs
-
-phony deps '$outdir'/^(\
- hashsize.h init_keytry.h ncurses_def.h parametrized.h termsort.c\
-) '$dir'/headers
-
-lib libncurses.a -d '$dir'/deps `{grep -v '^#' sources.txt}
-file lib/libncurses.a '$outdir'/libncurses.a 644
-
-exe tic -d '$dir'/deps\
- progs/^(tic.c dump_entry.c tparm_type.c transform.c)\
- ncurses/^(\
- tinfo/^(\
- alloc_entry.c\
- captoinfo.c\
- comp_expand.c\
- comp_parse.c\
- comp_scan.c\
- parse_entry.c\
- write_entry.c\
- )\
- trace/lib_trace.c\
- )\
- libncurses.a
-file bin/tic '$outdir'/tic 755
-
-exe tset -d '$dir'/deps progs/^(tset.c transform.c.o) libncurses.a
-file bin/tset '$outdir'/tset 755
-sym bin/reset tset
-
-for(m in tic.1m tset.1) {
- build '$outdir'/$m sed '$srcdir'/man/$m '|' '$dir'/subst.sed ; with\
- expr '-f $dir/subst.sed'
- file share/man/man1/$m '$outdir'/$m 644
-}
-sym share/man/man1/reset.1 tset.1
-
-terms=(dumb linux tmux tmux-256color xterm xterm-256color)
-terminfo=`{printf %s\n $terms | awk '{print substr($0, 1, 1) "/" $0}'}
-termnames=`{printf ,%s $terms | tail -c +1}
-terminfo_outs='$outdir'/terminfo/$terminfo
-
-build $"terminfo_outs tic '$srcdir'/misc/terminfo.src ; ticflags=(\
- -o '$outdir'/terminfo\
- -e $termnames\
- -x\
-) with ticflags $"ticflags
-for(f in $terminfo)
- file share/terminfo/$f '$outdir'/terminfo/$f 644
-
-gen_inputs='$dir'/sources.txt
-
-fetch curl
diff --git a/extra/ncurses/gensources.awk b/extra/ncurses/gensources.awk
deleted file mode 100644
index b4b45838..00000000
--- a/extra/ncurses/gensources.awk
+++ /dev/null
@@ -1,29 +0,0 @@
-BEGIN {
- dirs["$(base)"] = "ncurses/base"
- dirs["$(serial)"] = "ncurses/tty"
- dirs["$(trace)"] = "ncurses/trace"
- dirs["$(tinfo)"] = "ncurses/tinfo"
- dirs["$(wide)"] = "ncurses/widechar"
- dirs["."] = "$outdir"
-
- skip["expanded"] = 1
- skip["lib_gen"] = 1
- skip["link_test"] = 1
-
- split(subsets, a, "+")
- for (k in a)
- sets[a[k]] = 1
-}
-
-/^(#|$)/ { next }
-
-/^@/ {
- set = $2
- next
-}
-
-set in sets {
- if ($1 ~ /trace/ || $1 in skip)
- next
- print dirs[$3] "/" $1 ".c"
-}
diff --git a/extra/ncurses/ncurses_cfg.h b/extra/ncurses/ncurses_cfg.h
deleted file mode 100644
index fb432d09..00000000
--- a/extra/ncurses/ncurses_cfg.h
+++ /dev/null
@@ -1,86 +0,0 @@
-#ifndef NC_CONFIG_H
-#define NC_CONFIG_H
-
-#include <config-posix.h>
-
-#define PACKAGE "ncurses"
-#define NCURSES_VERSION "6.0"
-#define NCURSES_PATCHDATE 20150808
-#define SYSTEM_NAME "linux-musl"
-#define HAVE_LONG_FILE_NAMES 1
-#define MIXEDCASE_FILENAMES 1
-#define TERMINFO_DIRS "/share/terminfo"
-#define TERMINFO "/share/terminfo"
-#define HAVE_BIG_CORE 1
-#define PURE_TERMINFO 1
-#define USE_HOME_TERMINFO 1
-#define USE_ROOT_ENVIRON 1
-#define USE_LINKS 1
-#define HAVE_LANGINFO_CODESET 1
-#define USE_WIDEC_SUPPORT 1
-#define NCURSES_WIDECHAR 1
-#define NEED_WCHAR_H 1
-#define HAVE_ASSUME_DEFAULT_COLORS 1
-#define HAVE_CURSES_VERSION 1
-#define HAVE_HAS_KEY 1
-#define HAVE_RESIZETERM 1
-#define HAVE_RESIZE_TERM 1
-#define HAVE_TERM_ENTRY_H 1
-#define HAVE_USE_DEFAULT_COLORS 1
-#define HAVE_USE_SCREEN 1
-#define HAVE_USE_WINDOW 1
-#define HAVE_WRESIZE 1
-#define NCURSES_EXT_FUNCS 1
-#define NCURSES_SP_FUNCS 1
-#define NCURSES_EXT_COLORS 1
-#define NCURSES_EXT_PUTWIN 1
-#define NCURSES_NO_PADDING 1
-#define HAVE_MEMORY_H 1
-#define SIZEOF_SIGNED_CHAR 1
-#define USE_SIGWINCH 1
-#define USE_ASSUMED_COLOR 1
-#define USE_HASHMAP 1
-#define NCURSES_WRAP_PREFIX "_nc_"
-#define GCC_SCANF 1
-#define GCC_SCANFLIKE(fmt,var) __attribute__((format(scanf,fmt,var)))
-#define GCC_PRINTF 1
-#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
-#define GCC_UNUSED __attribute__((unused))
-#define GCC_NORETURN __attribute__((noreturn))
-#define HAVE_NC_ALLOC_H 1
-#define TIME_WITH_SYS_TIME 1
-#define HAVE_REGEX_H_FUNCS 1
-#define HAVE_GETOPT_H 1
-#define HAVE_SYS_IOCTL_H 1
-#define HAVE_SYS_PARAM_H 1
-#define HAVE_SYS_POLL_H 1
-#define HAVE_GETOPT_H 1
-#define HAVE_GETOPT_HEADER 1
-#define HAVE_SYS_TIME_SELECT 1
-#define SIG_ATOMIC_T volatile sig_atomic_t
-#define HAVE_ISSETUGID 1
-#define HAVE_SETBUFFER 1
-#define SETVBUF_REVERSED 1
-#define HAVE_SIZECHANGE 1
-#define HAVE_WORKING_POLL 1
-#define USE_OPENPTY_HEADER <pty.h>
-#define USE_XTERM_PTY 1
-#define HAVE_TYPEINFO 1
-#define HAVE_IOSTREAM 1
-#define IOSTREAM_NAMESPACE 1
-#define CPP_HAS_STATIC_CAST 1
-#define SIZEOF_WCHAR_T 4
-#define HAVE_SLK_COLOR 1
-#define HAVE_PANEL_H 1
-#define HAVE_LIBPANEL 1
-#define HAVE_MENU_H 1
-#define HAVE_LIBMENU 1
-#define HAVE_FORM_H 1
-#define HAVE_LIBFORM 1
-#define NCURSES_PATHSEP ':'
-#define NCURSES_VERSION_STRING "6.0.20150808"
-#define NCURSES_OSPEED_COMPAT 1
-
-#include <ncurses_def.h>
-
-#endif /* NC_CONFIG_H */
diff --git a/extra/ncurses/rev b/extra/ncurses/rev
deleted file mode 100644
index d00491fd..00000000
--- a/extra/ncurses/rev
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/extra/ncurses/sha256 b/extra/ncurses/sha256
deleted file mode 100644
index 1434e95c..00000000
--- a/extra/ncurses/sha256
+++ /dev/null
@@ -1 +0,0 @@
-f551c24b30ce8bfb6e96d9f59b42fbea30fa3a6123384172f9e7284bcf647260 ncurses-6.0.tar.gz
diff --git a/extra/ncurses/sources.txt b/extra/ncurses/sources.txt
deleted file mode 100644
index 3a213917..00000000
--- a/extra/ncurses/sources.txt
+++ /dev/null
@@ -1,158 +0,0 @@
-# 2,$<awk -f gensources.awk -v subsets=base+widechar+termlib+ext_funcs+ext_tinfo src/ncurses/modules
-ncurses/tty/hardscroll.c
-ncurses/tty/hashmap.c
-ncurses/base/lib_addch.c
-ncurses/base/lib_addstr.c
-ncurses/base/lib_beep.c
-ncurses/base/lib_bkgd.c
-ncurses/base/lib_box.c
-ncurses/base/lib_chgat.c
-ncurses/base/lib_clear.c
-ncurses/base/lib_clearok.c
-ncurses/base/lib_clrbot.c
-ncurses/base/lib_clreol.c
-ncurses/base/lib_color.c
-ncurses/base/lib_colorset.c
-ncurses/base/lib_delch.c
-ncurses/base/lib_delwin.c
-ncurses/base/lib_echo.c
-ncurses/base/lib_endwin.c
-ncurses/base/lib_erase.c
-ncurses/base/lib_flash.c
-ncurses/base/lib_getch.c
-ncurses/base/lib_getstr.c
-ncurses/base/lib_hline.c
-ncurses/base/lib_immedok.c
-ncurses/base/lib_inchstr.c
-ncurses/base/lib_initscr.c
-ncurses/base/lib_insch.c
-ncurses/base/lib_insdel.c
-ncurses/base/lib_insnstr.c
-ncurses/base/lib_instr.c
-ncurses/base/lib_isendwin.c
-ncurses/base/lib_leaveok.c
-ncurses/base/lib_mouse.c
-ncurses/base/lib_move.c
-ncurses/tty/lib_mvcur.c
-ncurses/base/lib_mvwin.c
-ncurses/base/lib_newterm.c
-ncurses/base/lib_newwin.c
-ncurses/base/lib_nl.c
-ncurses/base/lib_overlay.c
-ncurses/base/lib_pad.c
-ncurses/base/lib_printw.c
-ncurses/base/lib_redrawln.c
-ncurses/base/lib_refresh.c
-ncurses/base/lib_restart.c
-ncurses/base/lib_scanw.c
-ncurses/base/lib_screen.c
-ncurses/base/lib_scroll.c
-ncurses/base/lib_scrollok.c
-ncurses/base/lib_scrreg.c
-ncurses/base/lib_set_term.c
-ncurses/base/lib_slk.c
-ncurses/base/lib_slkatr_set.c
-ncurses/base/lib_slkatrof.c
-ncurses/base/lib_slkatron.c
-ncurses/base/lib_slkatrset.c
-ncurses/base/lib_slkattr.c
-ncurses/base/lib_slkclear.c
-ncurses/base/lib_slkcolor.c
-ncurses/base/lib_slkinit.c
-ncurses/base/lib_slklab.c
-ncurses/base/lib_slkrefr.c
-ncurses/base/lib_slkset.c
-ncurses/base/lib_slktouch.c
-ncurses/base/lib_touch.c
-ncurses/tty/lib_tstp.c
-ncurses/base/lib_ungetch.c
-ncurses/tty/lib_vidattr.c
-ncurses/base/lib_vline.c
-ncurses/base/lib_wattroff.c
-ncurses/base/lib_wattron.c
-ncurses/base/lib_winch.c
-ncurses/base/lib_window.c
-ncurses/base/nc_panel.c
-ncurses/base/safe_sprintf.c
-ncurses/tty/tty_update.c
-ncurses/trace/varargs.c
-ncurses/base/vsscanf.c
-ncurses/base/lib_freeall.c
-ncurses/widechar/charable.c
-ncurses/widechar/lib_add_wch.c
-ncurses/widechar/lib_box_set.c
-ncurses/widechar/lib_cchar.c
-ncurses/widechar/lib_erasewchar.c
-ncurses/widechar/lib_get_wch.c
-ncurses/widechar/lib_get_wstr.c
-ncurses/widechar/lib_hline_set.c
-ncurses/widechar/lib_in_wch.c
-ncurses/widechar/lib_in_wchnstr.c
-ncurses/widechar/lib_ins_wch.c
-ncurses/widechar/lib_inwstr.c
-ncurses/widechar/lib_key_name.c
-ncurses/widechar/lib_pecho_wchar.c
-ncurses/widechar/lib_slk_wset.c
-ncurses/widechar/lib_unget_wch.c
-ncurses/widechar/lib_vid_attr.c
-ncurses/widechar/lib_vline_set.c
-ncurses/widechar/lib_wacs.c
-ncurses/widechar/lib_wunctrl.c
-ncurses/base/legacy_coding.c
-ncurses/base/lib_dft_fgbg.c
-ncurses/tinfo/lib_print.c
-ncurses/base/resizeterm.c
-ncurses/tinfo/use_screen.c
-ncurses/base/use_window.c
-ncurses/base/wresize.c
-ncurses/tinfo/access.c
-ncurses/tinfo/add_tries.c
-ncurses/tinfo/alloc_ttype.c
-$outdir/codes.c
-$outdir/comp_captab.c
-ncurses/tinfo/comp_error.c
-ncurses/tinfo/comp_hash.c
-ncurses/tinfo/db_iterator.c
-ncurses/tinfo/doalloc.c
-ncurses/tinfo/entries.c
-$outdir/fallback.c
-ncurses/tinfo/free_ttype.c
-ncurses/tinfo/getenv_num.c
-ncurses/tinfo/home_terminfo.c
-ncurses/tinfo/init_keytry.c
-ncurses/tinfo/lib_acs.c
-ncurses/tinfo/lib_baudrate.c
-ncurses/tinfo/lib_cur_term.c
-ncurses/tinfo/lib_data.c
-ncurses/tinfo/lib_has_cap.c
-ncurses/tinfo/lib_kernel.c
-$outdir/lib_keyname.c
-ncurses/tinfo/lib_longname.c
-ncurses/tinfo/lib_napms.c
-ncurses/tinfo/lib_options.c
-ncurses/tinfo/lib_raw.c
-ncurses/tinfo/lib_setup.c
-ncurses/tinfo/lib_termcap.c
-ncurses/tinfo/lib_termname.c
-ncurses/tinfo/lib_tgoto.c
-ncurses/tinfo/lib_ti.c
-ncurses/tinfo/lib_tparm.c
-ncurses/tinfo/lib_tputs.c
-ncurses/tinfo/lib_ttyflags.c
-ncurses/tty/lib_twait.c
-ncurses/tinfo/name_match.c
-$outdir/names.c
-ncurses/tinfo/obsolete.c
-ncurses/tinfo/read_entry.c
-ncurses/tinfo/read_termcap.c
-ncurses/tinfo/strings.c
-ncurses/base/tries.c
-ncurses/tinfo/trim_sgr0.c
-$outdir/unctrl.c
-ncurses/trace/visbuf.c
-ncurses/base/define_key.c
-ncurses/tinfo/hashed_db.c
-ncurses/base/key_defined.c
-ncurses/base/keybound.c
-ncurses/base/keyok.c
-ncurses/base/version.c
diff --git a/extra/ncurses/subst.sed b/extra/ncurses/subst.sed
deleted file mode 100644
index 4f3701fe..00000000
--- a/extra/ncurses/subst.sed
+++ /dev/null
@@ -1,51 +0,0 @@
-s,@NCURSES_MAJOR@,6,
-s,@NCURSES_MINOR@,0,
-s,@NCURSES_PATCH@,20150808,
-
-s,@BROKEN_LINKER@,0,
-s,@CAPTOINFO@,captoinfo,
-s,@GENERATED_EXT_FUNCS@,generated,
-s,@HAVE_STDINT_H@,1,
-s,@HAVE_TCGETATTR@,1,
-s,@HAVE_TERMIOS_H@,1,
-s,@HAVE_TERMIO_H@,0,
-s,@HAVE_VSSCANF@,1,
-s,@INFOCMP@,infocmp,
-s,@INFOTOCAP@,infotocap,
-s,@NCURSES_CCHARW_MAX@,5,
-s,@NCURSES_CH_T@,cchar_t,
-s,@NCURSES_CONST@,const,
-s,@NCURSES_EXT_COLORS@,1,
-s,@NCURSES_EXT_FUNCS@,1,
-s,@NCURSES_INLINE@,inline,
-s,@NCURSES_INTEROP_FUNCS@,1,
-s,@NCURSES_LIBUTF8@,0,
-s,@NCURSES_MOUSE_VERSION@,2,
-s,@NCURSES_OK_WCHAR_T@,1,
-s,@NCURSES_OPAQUE@,0,
-s,@NCURSES_OSPEED@,short,
-s,@NCURSES_SBOOL@,char,
-s,@NCURSES_SIZE_T@,short,
-s,@NCURSES_SP_FUNCS@,1,
-s,@NCURSES_TPARM_ARG@,intptr_t,
-s,@NCURSES_TPARM_VARARGS@,1,
-s,@NCURSES_USE_DATABASE@,1,
-s,@NCURSES_USE_TERMCAP@,0,
-s,@NCURSES_WCHAR_T@,0,
-s,@NCURSES_WINT_T@,0,
-s,@NCURSES_XNAMES@,1,
-s,@NEED_WCHAR_H@,1,
-s,@TERMINFO@,/share/terminfo,
-s,@TERMINFO_DIRS@,/share/terminfo,
-s,@TIC@,tic,
-s,@TOE@,toe,
-s,@TSET@,tset,
-s,@USE_CXX_BOOL@,0,
-s,@cf_cv_1UL@,1U,g
-s,@cf_cv_enable_lp64@,1,
-s,@cf_cv_enable_opaque@,NCURSES_OPAQUE,
-s,@cf_cv_enable_reentrant@,0,
-s,@cf_cv_header_stdbool_h@,1,
-s,@cf_cv_type_of_bool@,unsigned char,
-s,@cf_cv_typeof_chtype@,uint32_t,
-s,@cf_cv_typeof_mmask_t@,uint32_t,
diff --git a/extra/ncurses/transform.h b/extra/ncurses/transform.h
deleted file mode 100644
index df994d1d..00000000
--- a/extra/ncurses/transform.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef __TRANSFORM_H
-#define __TRANSFORM_H 1
-#include <progs.priv.h>
-extern bool same_program(const char *, const char *);
-#define PROG_CAPTOINFO "captoinfo"
-#define PROG_INFOTOCAP "infotocap"
-#define PROG_RESET "reset"
-#define PROG_INIT "init"
-#endif /* __TRANSFORM_H */
diff --git a/extra/ncurses/url b/extra/ncurses/url
deleted file mode 100644
index 40dd7fac..00000000
--- a/extra/ncurses/url
+++ /dev/null
@@ -1 +0,0 @@
-url = "http://invisible-mirror.net/archives/ncurses/ncurses-6.0.tar.gz"
diff --git a/extra/pcre/.gitignore b/extra/pcre/.gitignore
deleted file mode 100644
index 39576135..00000000
--- a/extra/pcre/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/pcre-8.39.tar.gz
-/src
diff --git a/extra/pcre/config.h b/extra/pcre/config.h
deleted file mode 100644
index b6cb1a55..00000000
--- a/extra/pcre/config.h
+++ /dev/null
@@ -1,64 +0,0 @@
-#include <config-posix.h>
-
-/* #undef BSR_ANYCRLF */
-/* #undef EBCDIC */
-/* #undef EBCDIC_NL25 */
-#define HAVE_BCOPY 1
-/* #undef HAVE_BITS_TYPE_TRAITS_H */
-/* #undef HAVE_BZLIB_H */
-/* #undef HAVE_EDITLINE_READLINE_H */
-/* #undef HAVE_EDIT_READLINE_READLINE_H */
-#define HAVE_LONG_LONG 1
-#define HAVE_MEMORY_H 1
-#define HAVE_PTHREAD 1
-#define HAVE_PTHREAD_PRIO_INHERIT 1
-/* #undef HAVE_READLINE_HISTORY_H */
-/* #undef HAVE_READLINE_READLINE_H */
-#define HAVE_STRING 1
-/* #undef HAVE_STRTOQ */
-/* #undef HAVE_TYPE_TRAITS_H */
-#define HAVE_UNSIGNED_LONG_LONG 1
-#define HAVE_VISIBILITY 1
-/* #undef HAVE_WINDOWS_H */
-/* #undef HAVE_ZLIB_H */
-/* #undef HAVE__STRTOI64 */
-#define LINK_SIZE 2
-#define LT_OBJDIR ".libs/"
-#define MATCH_LIMIT 10000000
-#define MATCH_LIMIT_RECURSION MATCH_LIMIT
-#define MAX_NAME_COUNT 10000
-#define MAX_NAME_SIZE 32
-#define NEWLINE 10
-/* #undef NO_RECURSE */
-#define PACKAGE "pcre"
-#define PACKAGE_BUGREPORT ""
-#define PACKAGE_NAME "PCRE"
-#define PACKAGE_STRING "PCRE 8.39"
-#define PACKAGE_TARNAME "pcre"
-#define PACKAGE_URL ""
-#define PACKAGE_VERSION "8.39"
-#define PARENS_NEST_LIMIT 250
-#define PCRECPP_EXP_DECL extern __attribute__ ((visibility ("default")))
-#define PCRECPP_EXP_DEFN __attribute__ ((visibility ("default")))
-#define PCREGREP_BUFSIZE 20480
-#define PCREPOSIX_EXP_DECL extern __attribute__ ((visibility ("default")))
-#define PCREPOSIX_EXP_DEFN extern __attribute__ ((visibility ("default")))
-#define PCRE_EXP_DATA_DEFN __attribute__ ((visibility ("default")))
-#define PCRE_EXP_DECL extern __attribute__ ((visibility ("default")))
-#define PCRE_EXP_DEFN __attribute__ ((visibility ("default")))
-#define PCRE_STATIC 1
-#define POSIX_MALLOC_THRESHOLD 10
-/* #undef PTHREAD_CREATE_JOINABLE */
-#define SUPPORT_JIT /**/
-/* #undef SUPPORT_LIBBZ2 */
-/* #undef SUPPORT_LIBEDIT */
-/* #undef SUPPORT_LIBREADLINE */
-/* #undef SUPPORT_LIBZ */
-/* #undef SUPPORT_PCRE16 */
-/* #undef SUPPORT_PCRE32 */
-#define SUPPORT_PCRE8 /**/
-#define SUPPORT_PCREGREP_JIT /**/
-#define SUPPORT_UCP /**/
-#define SUPPORT_UTF /**/
-/* #undef SUPPORT_VALGRIND */
-#define VERSION "8.39"
diff --git a/extra/pcre/gen.rc b/extra/pcre/gen.rc
deleted file mode 100644
index 6064222d..00000000
--- a/extra/pcre/gen.rc
+++ /dev/null
@@ -1,41 +0,0 @@
-cflags\
- -D HAVE_CONFIG_H\
- -I include\
- -I '$dir' \
- -I '$srcdir' \
- -I '$outdir'/include
-
-build '$outdir'/include/pcre.h sed '$srcdir'/pcre.h.in ; exprs=(\
- -e s,@PCRE_MAJOR@,8,\
- -e s,@PCRE_MINOR@,39,\
- -e s,@PCRE_PRERELEASE@,,\
- -e s,@PCRE_DATE@,2016-06-14,\
-) with expr $"exprs
-
-phony headers '$outdir'/include/pcre.h
-
-build '$outdir'/pcre_chartables.c copy '$srcdir'/pcre_chartables.c.dist
-lib libpcre.a -d '$dir'/headers\
- pcre_byte_order.c\
- pcre_compile.c\
- pcre_config.c\
- pcre_dfa_exec.c\
- pcre_exec.c\
- pcre_fullinfo.c\
- pcre_get.c\
- pcre_globals.c\
- pcre_jit_compile.c\
- pcre_maketables.c\
- pcre_newline.c\
- pcre_ord2utf8.c\
- pcre_refcount.c\
- pcre_string_utils.c\
- pcre_study.c\
- pcre_tables.c\
- pcre_ucd.c\
- pcre_valid_utf8.c\
- pcre_version.c\
- pcre_xclass.c\
- '$outdir'/pcre_chartables.c
-
-fetch curl
diff --git a/extra/pcre/rev b/extra/pcre/rev
deleted file mode 100644
index d00491fd..00000000
--- a/extra/pcre/rev
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/extra/pcre/sha256 b/extra/pcre/sha256
deleted file mode 100644
index a8ae49d8..00000000
--- a/extra/pcre/sha256
+++ /dev/null
@@ -1 +0,0 @@
-ccdf7e788769838f8285b3ee672ed573358202305ee361cfec7a4a4fb005bbc7 pcre-8.39.tar.gz
diff --git a/extra/pcre/url b/extra/pcre/url
deleted file mode 100644
index 8333bf31..00000000
--- a/extra/pcre/url
+++ /dev/null
@@ -1 +0,0 @@
-url = "ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.39.tar.gz"
diff --git a/extra/pcsc/config.h b/extra/pcsc/config.h
deleted file mode 100644
index 2b1bd274..00000000
--- a/extra/pcsc/config.h
+++ /dev/null
@@ -1,66 +0,0 @@
-#include <config-posix.h>
-
-/* #undef AC_APPLE_UNIVERSAL_BUILD */
-/* #undef ATR_DEBUG */
-/* #undef CRAY_STACKSEG_END */
-/* #undef C_ALLOCA */
-/* #undef FILTER_NAMES */
-#define HAVE_ALLOCA 1
-#define HAVE_ALLOCA_H 1
-#define HAVE_DAEMON 1
-/* #undef HAVE_DL_H */
-/* #undef HAVE_DOPRNT */
-#define HAVE_FLOCK 1
-#define HAVE_GETOPT_H 1
-#define HAVE_GETOPT_LONG 1
-/* #undef HAVE_LIBUDEV */
-/* #undef HAVE_LIBUDEV_H */
-#define HAVE_LIBUSB 1
-#define HAVE_LIBUSB_H 1
-#define HAVE_MEMORY_H 1
-/* #undef HAVE_NDIR_H */
-/* #undef HAVE_POLKIT */
-#define HAVE_PTHREAD 1
-#define HAVE_PTHREAD_PRIO_INHERIT 1
-/* #undef HAVE_STAT_EMPTY_STRING_BUG */
-#define HAVE_STRUCT_DIRENT_D_TYPE 1
-/* #undef HAVE_SYS_DIR_H */
-/* #undef HAVE_SYS_FILIO_H */
-/* #undef HAVE_SYS_NDIR_H */
-#define LT_OBJDIR ".libs/"
-/* #undef NO_LOG */
-#define PACKAGE "pcsc-lite"
-#define PACKAGE_BUGREPORT ""
-#define PACKAGE_NAME "pcsc-lite"
-#define PACKAGE_STRING "pcsc-lite 1.8.17"
-#define PACKAGE_TARNAME "pcsc-lite"
-#define PACKAGE_URL ""
-#define PACKAGE_VERSION "1.8.17"
-#define PCSCD_BINARY "/sbin/pcscd"
-#define PCSCLITE_FEATURES " Linux x86_64-unknown-linux-gnu usb usbdropdir=/lib/pcsc/drivers ipcdir=/var/run/pcscd configdir=/etc/reader.conf.d"
-#define PCSCLITE_HP_DROPDIR "/lib/pcsc/drivers"
-#define PCSC_ARCH "Linux"
-/* #undef PTHREAD_CREATE_JOINABLE */
-/* #undef STACK_DIRECTION */
-#define TIME_WITH_SYS_TIME 1
-#define USE_IPCDIR "/var/run/pcscd"
-/* #undef USE_SERIAL */
-#define USE_USB 1
-#define VERSION "1.8.17"
-#if defined AC_APPLE_UNIVERSAL_BUILD
-# if defined __BIG_ENDIAN__
-# define WORDS_BIGENDIAN 1
-# endif
-#else
-# ifndef WORDS_BIGENDIAN
-/* # undef WORDS_BIGENDIAN */
-# endif
-#endif
-/* #undef YYTEXT_POINTER */
-/* #undef const */
-/* #undef gid_t */
-#ifndef __cplusplus
-/* #undef inline */
-#endif
-/* #undef size_t */
-/* #undef uid_t */
diff --git a/extra/pcsc/gen.rc b/extra/pcsc/gen.rc
deleted file mode 100644
index 90d33c87..00000000
--- a/extra/pcsc/gen.rc
+++ /dev/null
@@ -1,34 +0,0 @@
-version=1.8.17
-cflags\
- -D HAVE_CONFIG_H\
- -I include\
- -I '$dir' \
- -I '$outdir' \
- -I '$outdir'/include\
- -I '$srcdir'/src/PCSC
-
-set subst\
- -e s,@VERSION@,$version,\
- -e s,@PCSCLITE_CONFIG_DIR@,/etc/reader.conf.d,
-
-hdrs=(debuglog.h ifdhandler.h reader.h winscard.h wintypes.h)
-for(hdr in $hdrs)
- build '$outdir'/include/$hdr copy '$srcdir'/src/PCSC/$hdr
-build '$outdir'/include/pcsclite.h sed '$srcdir'/src/PCSC/pcsclite.h.in ; with expr '$subst'
-hdrs=($hdrs pcsclite.h)
-phony headers '$outdir'/include/$hdrs
-
-build '$outdir'/pcscd.h sed '$srcdir'/src/pcscd.h.in ; with expr '$subst'
-phony deps '$outdir'/pcscd.h '$dir'/headers
-
-lib libpcsclite.a -d '$dir'/deps src/^(\
- debug.c\
- error.c\
- winscard_clnt.c\
- simclist.c\
- sys_unix.c\
- utils.c\
- winscard_msg.c\
-)
-
-fetch git
diff --git a/extra/pcsc/patch/0001-Add-tokenparser.c-from-pcsc-1.8.17-distribution.patch b/extra/pcsc/patch/0001-Add-tokenparser.c-from-pcsc-1.8.17-distribution.patch
deleted file mode 100644
index 9c99d360..00000000
--- a/extra/pcsc/patch/0001-Add-tokenparser.c-from-pcsc-1.8.17-distribution.patch
+++ /dev/null
@@ -1,2058 +0,0 @@
-From 13f8dbbd6cd2de7ac0c0567df53b72e82bc21d2d Mon Sep 17 00:00:00 2001
-From: Michael Forney <mforney@mforney.org>
-Date: Tue, 5 Jul 2016 23:13:48 -0700
-Subject: [PATCH] Add tokenparser.c from pcsc 1.8.17 distribution
-
----
- src/tokenparser.c | 2039 +++++++++++++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 2039 insertions(+)
- create mode 100644 src/tokenparser.c
-
-diff --git a/src/tokenparser.c b/src/tokenparser.c
-new file mode 100644
-index 0000000..94cee67
---- /dev/null
-+++ b/src/tokenparser.c
-@@ -0,0 +1,2039 @@
-+
-+#line 3 "tokenparser.c"
-+
-+#define YY_INT_ALIGNED short int
-+
-+/* A lexical scanner generated by flex */
-+
-+#define yy_create_buffer tp_create_buffer
-+#define yy_delete_buffer tp_delete_buffer
-+#define yy_flex_debug tp_flex_debug
-+#define yy_init_buffer tp_init_buffer
-+#define yy_flush_buffer tp_flush_buffer
-+#define yy_load_buffer_state tp_load_buffer_state
-+#define yy_switch_to_buffer tp_switch_to_buffer
-+#define yyin tpin
-+#define yyleng tpleng
-+#define yylex tplex
-+#define yylineno tplineno
-+#define yyout tpout
-+#define yyrestart tprestart
-+#define yytext tptext
-+#define yywrap tpwrap
-+#define yyalloc tpalloc
-+#define yyrealloc tprealloc
-+#define yyfree tpfree
-+
-+#define FLEX_SCANNER
-+#define YY_FLEX_MAJOR_VERSION 2
-+#define YY_FLEX_MINOR_VERSION 5
-+#define YY_FLEX_SUBMINOR_VERSION 39
-+#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 <stdio.h>
-+#include <string.h>
-+#include <errno.h>
-+#include <stdlib.h>
-+
-+/* end standard C headers. */
-+
-+/* flex integer type definitions */
-+
-+#ifndef FLEXINT_H
-+#define FLEXINT_H
-+
-+/* C99 systems have <inttypes.h>. 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 <inttypes.h>
-+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
-+
-+#endif /* ! C99 */
-+
-+#endif /* ! FLEXINT_H */
-+
-+#ifdef __cplusplus
-+
-+/* The "const" storage-class-modifier is valid. */
-+#define YY_USE_CONST
-+
-+#else /* ! __cplusplus */
-+
-+/* C99 requires __STDC__ to be defined as 1. */
-+#if defined (__STDC__)
-+
-+#define YY_USE_CONST
-+
-+#endif /* defined (__STDC__) */
-+#endif /* ! __cplusplus */
-+
-+#ifdef YY_USE_CONST
-+#define yyconst const
-+#else
-+#define yyconst
-+#endif
-+
-+/* Returned upon end-of-file. */
-+#define YY_NULL 0
-+
-+/* Promotes a possibly negative, possibly signed char to an unsigned
-+ * integer for use as an array index. If the signed char is negative,
-+ * we want to instead treat it as an 8-bit unsigned char, hence the
-+ * double cast.
-+ */
-+#define YY_SC_TO_UI(c) ((unsigned int) (unsigned 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 tprestart(tpin )
-+
-+#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 yy_size_t tpleng;
-+
-+extern FILE *tpin, *tpout;
-+
-+#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 tptext. */ \
-+ 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 tptext 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.
-+ */
-+ yy_size_t yy_buf_size;
-+
-+ /* Number of characters read into yy_ch_buf, not including EOB
-+ * characters.
-+ */
-+ yy_size_t 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 tprestart()), so that the user can continue scanning by
-+ * just pointing tpin 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 = 0; /**< 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 tptext is formed. */
-+static char yy_hold_char;
-+static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
-+yy_size_t tpleng;
-+
-+/* Points to current character in buffer. */
-+static char *yy_c_buf_p = (char *) 0;
-+static int yy_init = 0; /* whether we need to initialize */
-+static int yy_start = 0; /* start state number */
-+
-+/* Flag which is used to allow tpwrap()'s to do buffer switches
-+ * instead of setting up a fresh tpin. A bit of a hack ...
-+ */
-+static int yy_did_buffer_switch_on_eof;
-+
-+void tprestart (FILE *input_file );
-+void tp_switch_to_buffer (YY_BUFFER_STATE new_buffer );
-+YY_BUFFER_STATE tp_create_buffer (FILE *file,int size );
-+void tp_delete_buffer (YY_BUFFER_STATE b );
-+void tp_flush_buffer (YY_BUFFER_STATE b );
-+void tppush_buffer_state (YY_BUFFER_STATE new_buffer );
-+void tppop_buffer_state (void );
-+
-+static void tpensure_buffer_stack (void );
-+static void tp_load_buffer_state (void );
-+static void tp_init_buffer (YY_BUFFER_STATE b,FILE *file );
-+
-+#define YY_FLUSH_BUFFER tp_flush_buffer(YY_CURRENT_BUFFER )
-+
-+YY_BUFFER_STATE tp_scan_buffer (char *base,yy_size_t size );
-+YY_BUFFER_STATE tp_scan_string (yyconst char *yy_str );
-+YY_BUFFER_STATE tp_scan_bytes (yyconst char *bytes,yy_size_t len );
-+
-+void *tpalloc (yy_size_t );
-+void *tprealloc (void *,yy_size_t );
-+void tpfree (void * );
-+
-+#define yy_new_buffer tp_create_buffer
-+
-+#define yy_set_interactive(is_interactive) \
-+ { \
-+ if ( ! YY_CURRENT_BUFFER ){ \
-+ tpensure_buffer_stack (); \
-+ YY_CURRENT_BUFFER_LVALUE = \
-+ tp_create_buffer(tpin,YY_BUF_SIZE ); \
-+ } \
-+ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
-+ }
-+
-+#define yy_set_bol(at_bol) \
-+ { \
-+ if ( ! YY_CURRENT_BUFFER ){\
-+ tpensure_buffer_stack (); \
-+ YY_CURRENT_BUFFER_LVALUE = \
-+ tp_create_buffer(tpin,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 tpwrap() 1
-+#define YY_SKIP_YYWRAP
-+
-+typedef unsigned char YY_CHAR;
-+
-+FILE *tpin = (FILE *) 0, *tpout = (FILE *) 0;
-+
-+typedef int yy_state_type;
-+
-+extern int tplineno;
-+
-+int tplineno = 1;
-+
-+extern char *tptext;
-+#define yytext_ptr tptext
-+
-+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 yy_fatal_error (yyconst char msg[] );
-+
-+/* Done after the current pattern has been matched and before the
-+ * corresponding action - sets up tptext.
-+ */
-+#define YY_DO_BEFORE_ACTION \
-+ (yytext_ptr) = yy_bp; \
-+ tpleng = (size_t) (yy_cp - yy_bp); \
-+ (yy_hold_char) = *yy_cp; \
-+ *yy_cp = '\0'; \
-+ (yy_c_buf_p) = yy_cp;
-+
-+#define YY_NUM_RULES 7
-+#define YY_END_OF_BUFFER 8
-+/* 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 yyconst flex_int16_t yy_accept[39] =
-+ { 0,
-+ 0, 0, 8, 6, 4, 2, 1, 6, 1, 0,
-+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,
-+ 0, 0, 0, 0, 0, 0, 5, 0
-+ } ;
-+
-+static yyconst flex_int32_t 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, 4, 4, 5, 4, 4, 4, 4, 4,
-+ 4, 4, 4, 4, 4, 4, 6, 7, 7, 7,
-+ 7, 7, 7, 7, 7, 7, 7, 4, 4, 8,
-+ 4, 9, 4, 4, 10, 10, 10, 10, 10, 10,
-+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
-+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
-+ 4, 1, 4, 4, 4, 1, 11, 11, 11, 11,
-+
-+ 12, 11, 13, 11, 14, 11, 15, 11, 11, 16,
-+ 11, 11, 11, 17, 18, 19, 11, 11, 11, 11,
-+ 20, 11, 1, 1, 1, 4, 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 yyconst flex_int32_t yy_meta[21] =
-+ { 0,
-+ 1, 2, 3, 4, 4, 4, 2, 1, 1, 2,
-+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
-+ } ;
-+
-+static yyconst flex_int16_t yy_base[43] =
-+ { 0,
-+ 0, 7, 49, 50, 50, 50, 0, 1, 0, 36,
-+ 28, 26, 28, 35, 29, 0, 26, 33, 27, 33,
-+ 29, 22, 0, 24, 27, 14, 27, 23, 13, 50,
-+ 10, 9, 4, 1, 0, 2, 50, 50, 19, 23,
-+ 2, 26
-+ } ;
-+
-+static yyconst flex_int16_t yy_def[43] =
-+ { 0,
-+ 39, 39, 38, 38, 38, 38, 40, 38, 40, 38,
-+ 38, 38, 38, 38, 38, 41, 38, 41, 38, 38,
-+ 38, 38, 42, 38, 42, 38, 38, 38, 38, 38,
-+ 38, 38, 38, 38, 38, 38, 38, 0, 38, 38,
-+ 38, 38
-+ } ;
-+
-+static yyconst flex_int16_t yy_nxt[71] =
-+ { 0,
-+ 38, 5, 6, 18, 7, 38, 38, 8, 5, 6,
-+ 37, 7, 36, 38, 8, 10, 35, 34, 11, 4,
-+ 4, 4, 4, 9, 9, 33, 9, 25, 32, 25,
-+ 31, 30, 29, 28, 27, 26, 24, 23, 22, 21,
-+ 20, 19, 17, 16, 15, 14, 13, 12, 38, 3,
-+ 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
-+ 38, 38, 38, 38, 38, 38, 38, 38, 38, 38
-+ } ;
-+
-+static yyconst flex_int16_t yy_chk[71] =
-+ { 0,
-+ 0, 1, 1, 41, 1, 0, 0, 1, 2, 2,
-+ 36, 2, 35, 0, 2, 8, 34, 33, 8, 39,
-+ 39, 39, 39, 40, 40, 32, 40, 42, 31, 42,
-+ 29, 28, 27, 26, 25, 24, 22, 21, 20, 19,
-+ 18, 17, 15, 14, 13, 12, 11, 10, 3, 38,
-+ 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
-+ 38, 38, 38, 38, 38, 38, 38, 38, 38, 38
-+ } ;
-+
-+static yy_state_type yy_last_accepting_state;
-+static char *yy_last_accepting_cpos;
-+
-+extern int tp_flex_debug;
-+int tp_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 *tptext;
-+#line 1 "tokenparser.l"
-+/*
-+ * Reads lexical config files and updates database.
-+ *
-+ * MUSCLE SmartCard Development ( http://pcsclite.alioth.debian.org/pcsclite.html )
-+ *
-+ * Copyright (C) 2001-2003
-+ * David Corcoran <corcoran@musclecard.com>
-+ * Copyright (C) 2003-2010
-+ * Ludovic Rousseau <ludovic.rousseau@free.fr>
-+ *
-+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. The name of the author may not be used to endorse or promote products
-+ derived from this software without specific prior written permission.
-+
-+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
-+ */
-+/**
-+ * @file
-+ * @brief provides parsing functions for Info.plist files
-+ * platforms
-+ */
-+#line 42 "tokenparser.l"
-+
-+#include "config.h"
-+#include <stdio.h>
-+#include <string.h>
-+#include <errno.h>
-+#define NDEBUG
-+#include <assert.h>
-+
-+#include "simclist.h"
-+#include "debuglog.h"
-+#include "parser.h"
-+
-+static void eval_key(char *pcToken, list_t *list_key);
-+static void eval_value(char *pcToken, list_t *list_values);
-+void tperrorCheck (char *pcToken_error);
-+
-+static list_t *ListKeys;
-+static list_t *ListValues;
-+
-+#define YY_NO_INPUT 1
-+#line 564 "tokenparser.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 <unistd.h>
-+#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 tplex_destroy (void );
-+
-+int tpget_debug (void );
-+
-+void tpset_debug (int debug_flag );
-+
-+YY_EXTRA_TYPE tpget_extra (void );
-+
-+void tpset_extra (YY_EXTRA_TYPE user_defined );
-+
-+FILE *tpget_in (void );
-+
-+void tpset_in (FILE * in_str );
-+
-+FILE *tpget_out (void );
-+
-+void tpset_out (FILE * out_str );
-+
-+yy_size_t tpget_leng (void );
-+
-+char *tpget_text (void );
-+
-+int tpget_lineno (void );
-+
-+void tpset_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 tpwrap (void );
-+#else
-+extern int tpwrap (void );
-+#endif
-+#endif
-+
-+#ifndef yytext_ptr
-+static void yy_flex_strncpy (char *,yyconst char *,int );
-+#endif
-+
-+#ifdef YY_NEED_STRLEN
-+static int yy_flex_strlen (yyconst 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( tptext, tpleng, 1, tpout )) {} } 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 = '*'; \
-+ size_t n; \
-+ for ( n = 0; n < max_size && \
-+ (c = getc( tpin )) != EOF && c != '\n'; ++n ) \
-+ buf[n] = (char) c; \
-+ if ( c == '\n' ) \
-+ buf[n++] = (char) c; \
-+ if ( c == EOF && ferror( tpin ) ) \
-+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
-+ result = n; \
-+ } \
-+ else \
-+ { \
-+ errno=0; \
-+ while ( (result = fread(buf, 1, max_size, tpin))==0 && ferror(tpin)) \
-+ { \
-+ if( errno != EINTR) \
-+ { \
-+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
-+ break; \
-+ } \
-+ errno=0; \
-+ clearerr(tpin); \
-+ } \
-+ }\
-+\
-+
-+#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 tplex (void);
-+
-+#define YY_DECL int tplex (void)
-+#endif /* !YY_DECL */
-+
-+/* Code executed at the beginning of each rule, after tptext and tpleng
-+ * 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 break;
-+#endif
-+
-+#define YY_RULE_SETUP \
-+ YY_USER_ACTION
-+
-+/** The main scanner function which does all the work.
-+ */
-+YY_DECL
-+{
-+ register yy_state_type yy_current_state;
-+ register char *yy_cp, *yy_bp;
-+ register 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 ( ! tpin )
-+ tpin = stdin;
-+
-+ if ( ! tpout )
-+ tpout = stdout;
-+
-+ if ( ! YY_CURRENT_BUFFER ) {
-+ tpensure_buffer_stack ();
-+ YY_CURRENT_BUFFER_LVALUE =
-+ tp_create_buffer(tpin,YY_BUF_SIZE );
-+ }
-+
-+ tp_load_buffer_state( );
-+ }
-+
-+ {
-+#line 67 "tokenparser.l"
-+
-+
-+#line 779 "tokenparser.c"
-+
-+ while ( 1 ) /* loops until end-of-file is reached */
-+ {
-+ yy_cp = (yy_c_buf_p);
-+
-+ /* Support of tptext. */
-+ *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
-+ {
-+ register 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 >= 39 )
-+ yy_c = yy_meta[(unsigned int) yy_c];
-+ }
-+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-+ ++yy_cp;
-+ }
-+ while ( yy_base[yy_current_state] != 50 );
-+
-+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 69 "tokenparser.l"
-+{}
-+ YY_BREAK
-+case 2:
-+/* rule 2 can match eol */
-+YY_RULE_SETUP
-+#line 70 "tokenparser.l"
-+{}
-+ YY_BREAK
-+case 3:
-+YY_RULE_SETUP
-+#line 71 "tokenparser.l"
-+{ eval_key(tptext, ListKeys); }
-+ YY_BREAK
-+case 4:
-+YY_RULE_SETUP
-+#line 72 "tokenparser.l"
-+{}
-+ YY_BREAK
-+case 5:
-+YY_RULE_SETUP
-+#line 73 "tokenparser.l"
-+{ eval_value(tptext, ListValues); }
-+ YY_BREAK
-+case 6:
-+YY_RULE_SETUP
-+#line 74 "tokenparser.l"
-+{ tperrorCheck(tptext); }
-+ YY_BREAK
-+case 7:
-+YY_RULE_SETUP
-+#line 75 "tokenparser.l"
-+ECHO;
-+ YY_BREAK
-+#line 872 "tokenparser.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 tpin at a new source and called
-+ * tplex(). 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 = tpin;
-+ 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 ( tpwrap( ) )
-+ {
-+ /* Note: because we've taken care in
-+ * yy_get_next_buffer() to have set up
-+ * tptext, 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 tplex */
-+
-+/* 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)
-+{
-+ register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
-+ register char *source = (yytext_ptr);
-+ register 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
-+ {
-+ yy_size_t 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 )
-+ {
-+ yy_size_t 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. */
-+ tprealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
-+ }
-+ else
-+ /* Can't grow it, we don't own it. */
-+ b->yy_ch_buf = 0;
-+
-+ 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;
-+ tprestart(tpin );
-+ }
-+
-+ 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_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
-+ /* Extend the array by 50%, plus the number we really need. */
-+ yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
-+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) tprealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
-+ if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
-+ YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
-+ }
-+
-+ (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)
-+{
-+ register yy_state_type yy_current_state;
-+ register char *yy_cp;
-+
-+ yy_current_state = (yy_start);
-+
-+ for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
-+ {
-+ register 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 >= 39 )
-+ yy_c = yy_meta[(unsigned int) yy_c];
-+ }
-+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) 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 )
-+{
-+ register int yy_is_jam;
-+ register char *yy_cp = (yy_c_buf_p);
-+
-+ register 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 >= 39 )
-+ yy_c = yy_meta[(unsigned int) yy_c];
-+ }
-+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-+ yy_is_jam = (yy_current_state == 38);
-+
-+ return yy_is_jam ? 0 : yy_current_state;
-+}
-+
-+#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 */
-+ yy_size_t offset = (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. */
-+ tprestart(tpin );
-+
-+ /*FALLTHROUGH*/
-+
-+ case EOB_ACT_END_OF_FILE:
-+ {
-+ if ( tpwrap( ) )
-+ return EOF;
-+
-+ 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 tptext */
-+ (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 tprestart (FILE * input_file )
-+{
-+
-+ if ( ! YY_CURRENT_BUFFER ){
-+ tpensure_buffer_stack ();
-+ YY_CURRENT_BUFFER_LVALUE =
-+ tp_create_buffer(tpin,YY_BUF_SIZE );
-+ }
-+
-+ tp_init_buffer(YY_CURRENT_BUFFER,input_file );
-+ tp_load_buffer_state( );
-+}
-+
-+/** Switch to a different input buffer.
-+ * @param new_buffer The new input buffer.
-+ *
-+ */
-+ void tp_switch_to_buffer (YY_BUFFER_STATE new_buffer )
-+{
-+
-+ /* TODO. We should be able to replace this entire function body
-+ * with
-+ * tppop_buffer_state();
-+ * tppush_buffer_state(new_buffer);
-+ */
-+ tpensure_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;
-+ tp_load_buffer_state( );
-+
-+ /* We don't actually know whether we did this switch during
-+ * EOF (tpwrap()) processing, but the only time this flag
-+ * is looked at is after tpwrap() is called, so it's safe
-+ * to go ahead and always set it.
-+ */
-+ (yy_did_buffer_switch_on_eof) = 1;
-+}
-+
-+static void tp_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;
-+ tpin = 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 tp_create_buffer (FILE * file, int size )
-+{
-+ YY_BUFFER_STATE b;
-+
-+ b = (YY_BUFFER_STATE) tpalloc(sizeof( struct yy_buffer_state ) );
-+ if ( ! b )
-+ YY_FATAL_ERROR( "out of dynamic memory in tp_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 *) tpalloc(b->yy_buf_size + 2 );
-+ if ( ! b->yy_ch_buf )
-+ YY_FATAL_ERROR( "out of dynamic memory in tp_create_buffer()" );
-+
-+ b->yy_is_our_buffer = 1;
-+
-+ tp_init_buffer(b,file );
-+
-+ return b;
-+}
-+
-+/** Destroy the buffer.
-+ * @param b a buffer created with tp_create_buffer()
-+ *
-+ */
-+ void tp_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 )
-+ tpfree((void *) b->yy_ch_buf );
-+
-+ tpfree((void *) b );
-+}
-+
-+/* Initializes or reinitializes a buffer.
-+ * This function is sometimes called more than once on the same buffer,
-+ * such as during a tprestart() or at EOF.
-+ */
-+ static void tp_init_buffer (YY_BUFFER_STATE b, FILE * file )
-+
-+{
-+ int oerrno = errno;
-+
-+ tp_flush_buffer(b );
-+
-+ b->yy_input_file = file;
-+ b->yy_fill_buffer = 1;
-+
-+ /* If b is the current buffer, then tp_init_buffer was _probably_
-+ * called from tprestart() 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 tp_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 )
-+ tp_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 tppush_buffer_state (YY_BUFFER_STATE new_buffer )
-+{
-+ if (new_buffer == NULL)
-+ return;
-+
-+ tpensure_buffer_stack();
-+
-+ /* This block is copied from tp_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 tp_switch_to_buffer. */
-+ tp_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 tppop_buffer_state (void)
-+{
-+ if (!YY_CURRENT_BUFFER)
-+ return;
-+
-+ tp_delete_buffer(YY_CURRENT_BUFFER );
-+ YY_CURRENT_BUFFER_LVALUE = NULL;
-+ if ((yy_buffer_stack_top) > 0)
-+ --(yy_buffer_stack_top);
-+
-+ if (YY_CURRENT_BUFFER) {
-+ tp_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 tpensure_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;
-+ (yy_buffer_stack) = (struct yy_buffer_state**)tpalloc
-+ (num_to_alloc * sizeof(struct yy_buffer_state*)
-+ );
-+ if ( ! (yy_buffer_stack) )
-+ YY_FATAL_ERROR( "out of dynamic memory in tpensure_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. */
-+ int grow_size = 8 /* arbitrary grow size */;
-+
-+ num_to_alloc = (yy_buffer_stack_max) + grow_size;
-+ (yy_buffer_stack) = (struct yy_buffer_state**)tprealloc
-+ ((yy_buffer_stack),
-+ num_to_alloc * sizeof(struct yy_buffer_state*)
-+ );
-+ if ( ! (yy_buffer_stack) )
-+ YY_FATAL_ERROR( "out of dynamic memory in tpensure_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 tp_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 0;
-+
-+ b = (YY_BUFFER_STATE) tpalloc(sizeof( struct yy_buffer_state ) );
-+ if ( ! b )
-+ YY_FATAL_ERROR( "out of dynamic memory in tp_scan_buffer()" );
-+
-+ b->yy_buf_size = 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 = 0;
-+ 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;
-+
-+ tp_switch_to_buffer(b );
-+
-+ return b;
-+}
-+
-+/** Setup the input buffer state to scan a string. The next call to tplex() 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
-+ * tp_scan_bytes() instead.
-+ */
-+YY_BUFFER_STATE tp_scan_string (yyconst char * yystr )
-+{
-+
-+ return tp_scan_bytes(yystr,strlen(yystr) );
-+}
-+
-+/** Setup the input buffer state to scan the given bytes. The next call to tplex() 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 tp_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
-+{
-+ YY_BUFFER_STATE b;
-+ char *buf;
-+ yy_size_t n;
-+ yy_size_t i;
-+
-+ /* Get memory for full buffer, including space for trailing EOB's. */
-+ n = _yybytes_len + 2;
-+ buf = (char *) tpalloc(n );
-+ if ( ! buf )
-+ YY_FATAL_ERROR( "out of dynamic memory in tp_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 = tp_scan_buffer(buf,n );
-+ if ( ! b )
-+ YY_FATAL_ERROR( "bad buffer in tp_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 yy_fatal_error (yyconst char* msg )
-+{
-+ (void) 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 tptext. */ \
-+ int yyless_macro_arg = (n); \
-+ YY_LESS_LINENO(yyless_macro_arg);\
-+ tptext[tpleng] = (yy_hold_char); \
-+ (yy_c_buf_p) = tptext + yyless_macro_arg; \
-+ (yy_hold_char) = *(yy_c_buf_p); \
-+ *(yy_c_buf_p) = '\0'; \
-+ tpleng = yyless_macro_arg; \
-+ } \
-+ while ( 0 )
-+
-+/* Accessor methods (get/set functions) to struct members. */
-+
-+/** Get the current line number.
-+ *
-+ */
-+int tpget_lineno (void)
-+{
-+
-+ return tplineno;
-+}
-+
-+/** Get the input stream.
-+ *
-+ */
-+FILE *tpget_in (void)
-+{
-+ return tpin;
-+}
-+
-+/** Get the output stream.
-+ *
-+ */
-+FILE *tpget_out (void)
-+{
-+ return tpout;
-+}
-+
-+/** Get the length of the current token.
-+ *
-+ */
-+yy_size_t tpget_leng (void)
-+{
-+ return tpleng;
-+}
-+
-+/** Get the current token.
-+ *
-+ */
-+
-+char *tpget_text (void)
-+{
-+ return tptext;
-+}
-+
-+/** Set the current line number.
-+ * @param line_number
-+ *
-+ */
-+void tpset_lineno (int line_number )
-+{
-+
-+ tplineno = line_number;
-+}
-+
-+/** Set the input stream. This does not discard the current
-+ * input buffer.
-+ * @param in_str A readable stream.
-+ *
-+ * @see tp_switch_to_buffer
-+ */
-+void tpset_in (FILE * in_str )
-+{
-+ tpin = in_str ;
-+}
-+
-+void tpset_out (FILE * out_str )
-+{
-+ tpout = out_str ;
-+}
-+
-+int tpget_debug (void)
-+{
-+ return tp_flex_debug;
-+}
-+
-+void tpset_debug (int bdebug )
-+{
-+ tp_flex_debug = bdebug ;
-+}
-+
-+static int yy_init_globals (void)
-+{
-+ /* Initialization is the same as for the non-reentrant scanner.
-+ * This function is called from tplex_destroy(), so don't allocate here.
-+ */
-+
-+ (yy_buffer_stack) = 0;
-+ (yy_buffer_stack_top) = 0;
-+ (yy_buffer_stack_max) = 0;
-+ (yy_c_buf_p) = (char *) 0;
-+ (yy_init) = 0;
-+ (yy_start) = 0;
-+
-+/* Defined in main.c */
-+#ifdef YY_STDINIT
-+ tpin = stdin;
-+ tpout = stdout;
-+#else
-+ tpin = (FILE *) 0;
-+ tpout = (FILE *) 0;
-+#endif
-+
-+ /* For future reference: Set errno on error, since we are called by
-+ * tplex_init()
-+ */
-+ return 0;
-+}
-+
-+/* tplex_destroy is for both reentrant and non-reentrant scanners. */
-+int tplex_destroy (void)
-+{
-+
-+ /* Pop the buffer stack, destroying each element. */
-+ while(YY_CURRENT_BUFFER){
-+ tp_delete_buffer(YY_CURRENT_BUFFER );
-+ YY_CURRENT_BUFFER_LVALUE = NULL;
-+ tppop_buffer_state();
-+ }
-+
-+ /* Destroy the stack itself. */
-+ tpfree((yy_buffer_stack) );
-+ (yy_buffer_stack) = NULL;
-+
-+ /* Reset the globals. This is important in a non-reentrant scanner so the next time
-+ * tplex() is called, initialization will occur. */
-+ yy_init_globals( );
-+
-+ return 0;
-+}
-+
-+/*
-+ * Internal utility routines.
-+ */
-+
-+#ifndef yytext_ptr
-+static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
-+{
-+ register int i;
-+ for ( i = 0; i < n; ++i )
-+ s1[i] = s2[i];
-+}
-+#endif
-+
-+#ifdef YY_NEED_STRLEN
-+static int yy_flex_strlen (yyconst char * s )
-+{
-+ register int n;
-+ for ( n = 0; s[n]; ++n )
-+ ;
-+
-+ return n;
-+}
-+#endif
-+
-+void *tpalloc (yy_size_t size )
-+{
-+ return (void *) malloc( size );
-+}
-+
-+void *tprealloc (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 (void *) realloc( (char *) ptr, size );
-+}
-+
-+void tpfree (void * ptr )
-+{
-+ free( (char *) ptr ); /* see tprealloc() for (char *) cast */
-+}
-+
-+#define YYTABLES_NAME "yytables"
-+
-+#line 74 "tokenparser.l"
-+
-+
-+
-+
-+static void eval_key(char *pcToken, list_t *list_key)
-+{
-+ struct bundleElt *elt;
-+ int r;
-+ size_t len;
-+
-+ /* create a new list element */
-+ elt = malloc(sizeof(*elt));
-+ assert(elt);
-+
-+ /* <key>foobar</key>
-+ * 012345 : 5 is the first key character index */
-+
-+ /* calculate the argument length */
-+ for (len=0; pcToken[len+5] != '<'; len++)
-+ ;
-+ len++; /* final NULL byte */
-+
-+ elt->key = malloc(len);
-+ memcpy(elt->key, &pcToken[5], len-1);
-+ elt->key[len-1] = '\0';
-+
-+ r = list_init(&elt->values);
-+ assert(r >= 0);
-+ (void)r;
-+
-+ /* add the key/values */
-+ list_append(list_key, elt);
-+
-+ /* set the list to store the values */
-+ ListValues = &elt->values;
-+}
-+
-+static void eval_value(char *pcToken, list_t *list_values)
-+{
-+ int r;
-+ size_t len;
-+ char *value;
-+ char *amp;
-+
-+ /* <string>foobar</string>
-+ * 012345678 : 8 is the first string character index */
-+
-+ /* calculate the argument length */
-+ for (len=0; pcToken[len+8] != '<'; len++)
-+ ;
-+ len++; /* final NULL byte */
-+
-+ value = malloc(len);
-+ assert(value);
-+
-+ memcpy(value, &pcToken[8], len-1);
-+ value[len-1] = '\0';
-+
-+ /* for all &amp; in the string */
-+ amp = value;
-+ while ((amp = strstr(amp, "&amp;")) != NULL)
-+ {
-+ char *p;
-+
-+ /* just skip "amp;" substring (4 letters) */
-+ for (p = amp+1; *(p+4); p++)
-+ {
-+ *p = *(p+4);
-+ }
-+ /* terminate the now shorter string */
-+ *p = '\0';
-+
-+ /* skip the & and continue */
-+ amp++;
-+ }
-+
-+ r = list_append(list_values, value);
-+ assert(r >= 0);
-+ (void)r;
-+}
-+
-+void tperrorCheck (char *token_error)
-+{
-+ (void)token_error;
-+}
-+
-+/**
-+ * Find an optional key in a configuration file
-+ * No error is logged if the key is not found
-+ *
-+ * @param l list generated by bundleParse()
-+ * @param key searched key
-+ * @param[out] values list of token value (if key found)
-+ * @retval 0 OK
-+ * @retval 1 key not found
-+ */
-+int LTPBundleFindValueWithKey(list_t *l, const char *key, list_t **values)
-+{
-+ unsigned int i;
-+ int ret = 1;
-+
-+ for (i=0; i < list_size(l); i++)
-+ {
-+ struct bundleElt *elt;
-+
-+ elt = list_get_at(l, i);
-+ assert(elt);
-+
-+ if (0 == strcmp(elt->key, key))
-+ {
-+ *values = &elt->values;
-+ ret = 0;
-+ }
-+ }
-+
-+ return ret;
-+}
-+
-+
-+/**
-+ * Parse a Info.plist file and file a list
-+ *
-+ * @param fileName file name
-+ * @param l list containing the results
-+ * @retval -1 configuration file not found
-+ * @retval 0 OK
-+ */
-+int bundleParse(const char *fileName, list_t *l)
-+{
-+ FILE *file = NULL;
-+ int r;
-+#ifndef NDEBUG
-+ int i;
-+#endif
-+
-+ file = fopen(fileName, "r");
-+ if (!file)
-+ {
-+ Log3(PCSC_LOG_CRITICAL, "Could not open bundle file %s: %s",
-+ fileName, strerror(errno));
-+ return 1;
-+ }
-+
-+ r = list_init(l);
-+ assert(r >= 0);
-+ (void)r;
-+
-+ ListKeys = l;
-+ tpin = file;
-+
-+ do
-+ {
-+ (void)tplex();
-+ } while (!feof(file));
-+ tplex_destroy();
-+
-+ (void)fclose(file);
-+
-+#ifndef NDEBUG
-+ printf("size: %d\n", list_size(l));
-+ for (i=0; i < list_size(l); i++)
-+ {
-+ struct bundleElt *elt;
-+ unsigned int j;
-+
-+ elt = list_get_at(l, i);
-+ assert(elt);
-+ printf("Key: %s\n", elt->key);
-+
-+ for (j=0; j<list_size(&elt->values); j++)
-+ {
-+ char *v = list_get_at(&elt->values, j);
-+ printf(" value: %s\n", v);
-+ }
-+ }
-+#endif
-+
-+ return 0;
-+}
-+
-+/**
-+ * Free the list created by bundleParse()
-+ *
-+ * @param l list containing the results
-+ */
-+void bundleRelease(list_t *l)
-+{
-+ unsigned int i;
-+
-+ for (i=0; i < list_size(l); i++)
-+ {
-+ struct bundleElt *elt;
-+ unsigned int j;
-+
-+ elt = list_get_at(l, i);
-+ assert(elt);
-+
-+ /* free all the values */
-+ for (j=0; j<list_size(&elt->values); j++)
-+ free(list_get_at(&elt->values, j));
-+ list_destroy(&elt->values);
-+
-+ /* free the key */
-+ free(elt->key);
-+ free(elt);
-+ }
-+
-+ list_destroy(l);
-+}
-+
---
-2.9.0
-
diff --git a/extra/pcsc/rev b/extra/pcsc/rev
deleted file mode 100644
index d00491fd..00000000
--- a/extra/pcsc/rev
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/extra/pcsc/src b/extra/pcsc/src
deleted file mode 160000
-Subproject f74dc1feea4c7a2345abb3e1861b350d46946c8
diff --git a/extra/sshfs/config.h b/extra/sshfs/config.h
deleted file mode 100644
index 9c23d485..00000000
--- a/extra/sshfs/config.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#define IDMAP_DEFAULT "none"
-
-#define PACKAGE "sshfs"
-#define PACKAGE_BUGREPORT ""
-#define PACKAGE_NAME "sshfs"
-#define PACKAGE_STRING "sshfs 2.8"
-#define PACKAGE_TARNAME "sshfs"
-#define PACKAGE_URL ""
-#define PACKAGE_VERSION "2.8"
-/* #undef SSH_NODELAY_WORKAROUND */
-#define VERSION "2.8"
diff --git a/extra/sshfs/gen.rc b/extra/sshfs/gen.rc
deleted file mode 100644
index 07cc8249..00000000
--- a/extra/sshfs/gen.rc
+++ /dev/null
@@ -1,15 +0,0 @@
-cflags\
- -D '_FILE_OFFSET_BITS=64' \
- -D 'FUSE_USE_VERSION=26' \
- -isystem extra/libfuse/src/include\
- -I '$dir'
-
-build '$outdir'/sshfs.1 sed '$srcdir'/sshfs.1.in ; with\
- expr 's,__UNMOUNT_COMMAND__,''fusermount -u'','
-
-exe sshfs -d '$builddir'/extra/libfuse/fetch.stamp\
- sshfs.c nocache.c '$builddir'/extra/libfuse/libfuse.a
-file bin/sshfs '$outdir'/sshfs 755
-file share/man/man1/sshfs.1 '$outdir'/sshfs.1 644
-
-fetch git
diff --git a/extra/sshfs/patch/0001-Add-nocache.c-stub.patch b/extra/sshfs/patch/0001-Add-nocache.c-stub.patch
deleted file mode 100644
index 3f6669d6..00000000
--- a/extra/sshfs/patch/0001-Add-nocache.c-stub.patch
+++ /dev/null
@@ -1,113 +0,0 @@
-From d58fbf8ca4a9a72ad8d72c7a6a4d765b419122f6 Mon Sep 17 00:00:00 2001
-From: Michael Forney <mforney@mforney.org>
-Date: Sun, 5 Jun 2016 17:13:58 -0700
-Subject: [PATCH] Add nocache.c stub
-
----
- nocache.c | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 94 insertions(+)
- create mode 100644 nocache.c
-
-diff --git a/nocache.c b/nocache.c
-new file mode 100644
-index 0000000..58d7528
---- /dev/null
-+++ b/nocache.c
-@@ -0,0 +1,94 @@
-+#include "cache.h"
-+
-+struct cache {
-+ struct fuse_cache_operations *next_oper;
-+};
-+
-+static struct cache cache;
-+
-+struct fuse_cache_dirhandle {
-+ fuse_dirh_t h;
-+ fuse_dirfil_t filler;
-+};
-+
-+void cache_invalidate(const char *path)
-+{
-+}
-+
-+void cache_add_attr(const char *path, const struct stat *stbuf, uint64_t wrctr)
-+{
-+}
-+
-+uint64_t cache_get_write_ctr(void)
-+{
-+ return 0;
-+}
-+
-+static int cache_unity_dirfill(fuse_cache_dirh_t ch, const char *name,
-+ const struct stat *stbuf)
-+{
-+ (void) stbuf;
-+ return ch->filler(ch->h, name, 0, 0);
-+}
-+
-+static int cache_unity_getdir(const char *path, fuse_dirh_t h,
-+ fuse_dirfil_t filler)
-+{
-+ struct fuse_cache_dirhandle ch;
-+ ch.h = h;
-+ ch.filler = filler;
-+ return cache.next_oper->cache_getdir(path, &ch, cache_unity_dirfill);
-+}
-+
-+static void cache_unity_fill(struct fuse_cache_operations *oper,
-+ struct fuse_operations *cache_oper)
-+{
-+#if FUSE_VERSION >= 23
-+ cache_oper->init = oper->oper.init;
-+#endif
-+ cache_oper->getattr = oper->oper.getattr;
-+ cache_oper->access = oper->oper.access;
-+ cache_oper->readlink = oper->oper.readlink;
-+ cache_oper->getdir = cache_unity_getdir;
-+ cache_oper->mknod = oper->oper.mknod;
-+ cache_oper->mkdir = oper->oper.mkdir;
-+ cache_oper->symlink = oper->oper.symlink;
-+ cache_oper->unlink = oper->oper.unlink;
-+ cache_oper->rmdir = oper->oper.rmdir;
-+ cache_oper->rename = oper->oper.rename;
-+ cache_oper->link = oper->oper.link;
-+ cache_oper->chmod = oper->oper.chmod;
-+ cache_oper->chown = oper->oper.chown;
-+ cache_oper->truncate = oper->oper.truncate;
-+ cache_oper->utime = oper->oper.utime;
-+ cache_oper->open = oper->oper.open;
-+ cache_oper->read = oper->oper.read;
-+ cache_oper->write = oper->oper.write;
-+ cache_oper->flush = oper->oper.flush;
-+ cache_oper->release = oper->oper.release;
-+ cache_oper->fsync = oper->oper.fsync;
-+ cache_oper->statfs = oper->oper.statfs;
-+ cache_oper->setxattr = oper->oper.setxattr;
-+ cache_oper->getxattr = oper->oper.getxattr;
-+ cache_oper->listxattr = oper->oper.listxattr;
-+ cache_oper->removexattr = oper->oper.removexattr;
-+#if FUSE_VERSION >= 25
-+ cache_oper->create = oper->oper.create;
-+ cache_oper->ftruncate = oper->oper.ftruncate;
-+ cache_oper->fgetattr = oper->oper.fgetattr;
-+#endif
-+}
-+
-+struct fuse_operations *cache_init(struct fuse_cache_operations *oper)
-+{
-+ static struct fuse_operations cache_oper;
-+ cache.next_oper = oper;
-+
-+ cache_unity_fill(oper, &cache_oper);
-+ return &cache_oper;
-+}
-+
-+int cache_parse_options(struct fuse_args *args)
-+{
-+ return 0;
-+}
---
-2.9.0
-
diff --git a/extra/sshfs/patch/0002-Use-a-compact-array-and-free-list-for-requests.patch b/extra/sshfs/patch/0002-Use-a-compact-array-and-free-list-for-requests.patch
deleted file mode 100644
index 43128eb2..00000000
--- a/extra/sshfs/patch/0002-Use-a-compact-array-and-free-list-for-requests.patch
+++ /dev/null
@@ -1,292 +0,0 @@
-From 820d2b71f49667fe5459f5cb4be8240c3ce5ae8a Mon Sep 17 00:00:00 2001
-From: Michael Forney <mforney@mforney.org>
-Date: Sun, 5 Jun 2016 17:25:36 -0700
-Subject: [PATCH] Use a compact array and free list for requests
-
----
- sshfs.c | 125 +++++++++++++++++++++++++++++++++++++++++-----------------------
- 1 file changed, 80 insertions(+), 45 deletions(-)
-
-diff --git a/sshfs.c b/sshfs.c
-index f41d987..32db6f4 100644
---- a/sshfs.c
-+++ b/sshfs.c
-@@ -171,6 +171,17 @@ struct request {
- struct list_head list;
- };
-
-+union request_entry {
-+ struct request *req;
-+ uintptr_t next;
-+};
-+
-+struct request_table {
-+ union request_entry *entries;
-+ int len, cap;
-+ uint32_t free;
-+};
-+
- struct sshfs_io {
- int num_reqs;
- pthread_cond_t finished;
-@@ -245,7 +256,7 @@ struct sshfs {
- int slave;
- char *host;
- char *base_path;
-- GHashTable *reqtab;
-+ struct request_table reqtab;
- pthread_mutex_t lock;
- pthread_mutex_t lock_write;
- int processing_thread_started;
-@@ -1241,12 +1252,6 @@ static int do_write(struct iovec *iov, size_t count)
- return 0;
- }
-
--static uint32_t sftp_get_id(void)
--{
-- static uint32_t idctr;
-- return idctr++;
--}
--
- static void buf_to_iov(const struct buffer *buf, struct iovec *iov)
- {
- iov->iov_base = buf->p;
-@@ -1339,6 +1344,43 @@ static void request_free(struct request *req)
- g_free(req);
- }
-
-+static int request_table_insert(struct request_table *reqtab, struct request *req)
-+{
-+ union request_entry *entries;
-+ size_t cap;
-+
-+ if (reqtab->free) {
-+ req->id = reqtab->free;
-+ reqtab->free = reqtab->entries[req->id-1].next >> 1;
-+ } else {
-+ if (reqtab->len == reqtab->cap) {
-+ cap = reqtab->cap * 2 + 1;
-+ entries = realloc(reqtab->entries, cap * sizeof(reqtab->entries[0]));
-+ if (!entries)
-+ return -1;
-+ reqtab->cap = cap;
-+ reqtab->entries = entries;
-+ }
-+ req->id = ++reqtab->len;
-+ }
-+
-+ reqtab->entries[req->id-1].req = req;
-+ return 0;
-+}
-+
-+static struct request *request_table_lookup(struct request_table *reqtab, uint32_t id)
-+{
-+ if (reqtab->entries[id-1].next & 1)
-+ return NULL;
-+ return reqtab->entries[id-1].req;
-+}
-+
-+static void request_table_remove(struct request_table *reqtab, uint32_t id)
-+{
-+ reqtab->entries[id-1].next = (reqtab->free << 1) | 1;
-+ reqtab->free = id;
-+}
-+
- static void chunk_free(struct read_chunk *chunk)
- {
- while (!list_empty(&chunk->reqs)) {
-@@ -1368,21 +1410,6 @@ static void chunk_put_locked(struct read_chunk *chunk)
- pthread_mutex_unlock(&sshfs.lock);
- }
-
--static int clean_req(void *key_, struct request *req)
--{
-- (void) key_;
--
-- req->error = -EIO;
-- if (req->want_reply)
-- sem_post(&req->ready);
-- else {
-- if (req->end_func)
-- req->end_func(req);
-- request_free(req);
-- }
-- return TRUE;
--}
--
- static int process_one_request(void)
- {
- int res;
-@@ -1399,8 +1426,7 @@ static int process_one_request(void)
- return -1;
-
- pthread_mutex_lock(&sshfs.lock);
-- req = (struct request *)
-- g_hash_table_lookup(sshfs.reqtab, GUINT_TO_POINTER(id));
-+ req = request_table_lookup(&sshfs.reqtab, id);
- if (req == NULL)
- fprintf(stderr, "request %i not found\n", id);
- else {
-@@ -1412,7 +1438,7 @@ static int process_one_request(void)
- sshfs.outstanding_len <= sshfs.max_outstanding_len) {
- pthread_cond_broadcast(&sshfs.outstanding_cond);
- }
-- g_hash_table_remove(sshfs.reqtab, GUINT_TO_POINTER(id));
-+ request_table_remove(&sshfs.reqtab, id);
- }
- pthread_mutex_unlock(&sshfs.lock);
- if (req != NULL) {
-@@ -1473,6 +1499,9 @@ static void close_conn(void)
-
- static void *process_requests(void *data_)
- {
-+ int i;
-+ struct request *req;
-+
- (void) data_;
-
- while (1) {
-@@ -1483,7 +1512,20 @@ static void *process_requests(void *data_)
- pthread_mutex_lock(&sshfs.lock);
- sshfs.processing_thread_started = 0;
- close_conn();
-- g_hash_table_foreach_remove(sshfs.reqtab, (GHRFunc) clean_req, NULL);
-+ for (i = 0; i < sshfs.reqtab.len; ++i) {
-+ if (sshfs.reqtab.entries[i].next & 1)
-+ continue;
-+ req = sshfs.reqtab.entries[i].req;
-+ req->error = -EIO;
-+ if (req->want_reply)
-+ sem_post(&req->ready);
-+ else {
-+ if (req->end_func)
-+ req->end_func(req);
-+ request_free(req);
-+ }
-+ request_table_remove(&sshfs.reqtab, i + 1);
-+ }
- sshfs.connver ++;
- sshfs.outstanding_len = 0;
- pthread_cond_broadcast(&sshfs.outstanding_cond);
-@@ -1631,7 +1673,6 @@ static int sftp_error_to_errno(uint32_t error)
- static void sftp_detect_uid()
- {
- int flags;
-- uint32_t id = sftp_get_id();
- uint32_t replid;
- uint8_t type;
- struct buffer buf;
-@@ -1641,7 +1682,7 @@ static void sftp_detect_uid()
- buf_init(&buf, 5);
- buf_add_string(&buf, ".");
- buf_to_iov(&buf, &iov[0]);
-- if (sftp_send_iov(SSH_FXP_STAT, id, iov, 1) == -1)
-+ if (sftp_send_iov(SSH_FXP_STAT, 0, iov, 1) == -1)
- goto out;
- buf_clear(&buf);
- if (sftp_read(&type, &buf) == -1)
-@@ -1652,7 +1693,7 @@ static void sftp_detect_uid()
- }
- if (buf_get_uint32(&buf, &replid) == -1)
- goto out;
-- if (replid != id) {
-+ if (replid != 0) {
- fprintf(stderr, "bad reply ID\n");
- goto out;
- }
-@@ -1689,7 +1730,6 @@ out:
- static int sftp_check_root(const char *base_path)
- {
- int flags;
-- uint32_t id = sftp_get_id();
- uint32_t replid;
- uint8_t type;
- struct buffer buf;
-@@ -1701,7 +1741,7 @@ static int sftp_check_root(const char *base_path)
- buf_init(&buf, 0);
- buf_add_string(&buf, remote_dir);
- buf_to_iov(&buf, &iov[0]);
-- if (sftp_send_iov(SSH_FXP_LSTAT, id, iov, 1) == -1)
-+ if (sftp_send_iov(SSH_FXP_LSTAT, 0, iov, 1) == -1)
- goto out;
- buf_clear(&buf);
- if (sftp_read(&type, &buf) == -1)
-@@ -1712,7 +1752,7 @@ static int sftp_check_root(const char *base_path)
- }
- if (buf_get_uint32(&buf, &replid) == -1)
- goto out;
-- if (replid != id) {
-+ if (replid != 0) {
- fprintf(stderr, "bad reply ID\n");
- goto out;
- }
-@@ -1903,7 +1943,6 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count,
- struct request **reqp)
- {
- int err;
-- uint32_t id;
- struct request *req = g_new0(struct request, 1);
-
- req->want_reply = want_reply;
-@@ -1914,8 +1953,6 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count,
- pthread_mutex_lock(&sshfs.lock);
- if (begin_func)
- begin_func(req);
-- id = sftp_get_id();
-- req->id = id;
- err = start_processing_thread();
- if (err) {
- pthread_mutex_unlock(&sshfs.lock);
-@@ -1926,21 +1963,24 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count,
- while (sshfs.outstanding_len > sshfs.max_outstanding_len)
- pthread_cond_wait(&sshfs.outstanding_cond, &sshfs.lock);
-
-- g_hash_table_insert(sshfs.reqtab, GUINT_TO_POINTER(id), req);
-+ if (request_table_insert(&sshfs.reqtab, req) < 0)
-+ abort();
- if (sshfs.debug) {
- gettimeofday(&req->start, NULL);
- sshfs.num_sent++;
- sshfs.bytes_sent += req->len;
- }
-- DEBUG("[%05i] %s\n", id, type_name(type));
-+ DEBUG("[%05i] %s\n", req->id, type_name(type));
- pthread_mutex_unlock(&sshfs.lock);
-
- err = -EIO;
-- if (sftp_send_iov(type, id, iov, count) == -1) {
-+ if (sftp_send_iov(type, req->id, iov, count) == -1) {
- gboolean rmed;
-
- pthread_mutex_lock(&sshfs.lock);
-- rmed = g_hash_table_remove(sshfs.reqtab, GUINT_TO_POINTER(id));
-+ rmed = !!request_table_lookup(&sshfs.reqtab, req->id);
-+ if (rmed)
-+ request_table_remove(&sshfs.reqtab, req->id);
- pthread_mutex_unlock(&sshfs.lock);
-
- if (!rmed && !want_reply) {
-@@ -2130,7 +2170,7 @@ static int sftp_readdir_send(struct request **req, struct buffer *handle)
-
- static int sshfs_req_pending(struct request *req)
- {
-- if (g_hash_table_lookup(sshfs.reqtab, GUINT_TO_POINTER(req->id)))
-+ if (request_table_lookup(&sshfs.reqtab, req->id))
- return 1;
- else
- return 0;
-@@ -3336,11 +3376,6 @@ static int processing_init(void)
- pthread_mutex_init(&sshfs.lock, NULL);
- pthread_mutex_init(&sshfs.lock_write, NULL);
- pthread_cond_init(&sshfs.outstanding_cond, NULL);
-- sshfs.reqtab = g_hash_table_new(NULL, NULL);
-- if (!sshfs.reqtab) {
-- fprintf(stderr, "failed to create hash table\n");
-- return -1;
-- }
- return 0;
- }
-
---
-2.9.0
-
diff --git a/extra/sshfs/patch/0003-Use-bool-instead-of-gboolean.patch b/extra/sshfs/patch/0003-Use-bool-instead-of-gboolean.patch
deleted file mode 100644
index 39d1e544..00000000
--- a/extra/sshfs/patch/0003-Use-bool-instead-of-gboolean.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From b8324473e35fbcfec302955456f545572521872b Mon Sep 17 00:00:00 2001
-From: Michael Forney <mforney@mforney.org>
-Date: Sun, 5 Jun 2016 17:28:40 -0700
-Subject: [PATCH] Use bool instead of gboolean
-
----
- sshfs.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/sshfs.c b/sshfs.c
-index 32db6f4..f43ae5a 100644
---- a/sshfs.c
-+++ b/sshfs.c
-@@ -16,6 +16,7 @@
- # include <fuse_darwin.h>
- #endif
- #include <assert.h>
-+#include <stdbool.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <unistd.h>
-@@ -1975,7 +1976,7 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count,
-
- err = -EIO;
- if (sftp_send_iov(type, req->id, iov, count) == -1) {
-- gboolean rmed;
-+ bool rmed;
-
- pthread_mutex_lock(&sshfs.lock);
- rmed = !!request_table_lookup(&sshfs.reqtab, req->id);
---
-2.9.0
-
diff --git a/extra/sshfs/patch/0004-Use-struct-list_head-instead-of-GList.patch b/extra/sshfs/patch/0004-Use-struct-list_head-instead-of-GList.patch
deleted file mode 100644
index d028a336..00000000
--- a/extra/sshfs/patch/0004-Use-struct-list_head-instead-of-GList.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From 7b8c2f9e7484db2031ff1190b85be085524dfe2b Mon Sep 17 00:00:00 2001
-From: Michael Forney <mforney@mforney.org>
-Date: Sun, 5 Jun 2016 17:30:20 -0700
-Subject: [PATCH] Use struct list_head instead of GList
-
----
- sshfs.c | 16 +++++++---------
- 1 file changed, 7 insertions(+), 9 deletions(-)
-
-diff --git a/sshfs.c b/sshfs.c
-index f43ae5a..14adca5 100644
---- a/sshfs.c
-+++ b/sshfs.c
-@@ -2180,13 +2180,13 @@ static int sshfs_req_pending(struct request *req)
- static int sftp_readdir_async(struct buffer *handle, fuse_cache_dirh_t h,
- fuse_cache_dirfil_t filler)
- {
-+ int done = 0;
- int err = 0;
- int outstanding = 0;
- int max = READDIR_START;
-- GList *list = NULL;
--
-- int done = 0;
-+ struct list_head list;
-
-+ list_init(&list);
- while (!done || outstanding) {
- struct request *req;
- struct buffer name;
-@@ -2201,16 +2201,14 @@ static int sftp_readdir_async(struct buffer *handle, fuse_cache_dirh_t h,
- break;
- }
-
-- list = g_list_append(list, req);
-+ list_add(&req->list, &list);
- outstanding++;
- }
-
- if (outstanding) {
-- GList *first;
- /* wait for response to next request */
-- first = g_list_first(list);
-- req = first->data;
-- list = g_list_delete_link(list, first);
-+ req = list_entry(list.prev, struct request, list);
-+ list_del(&req->list);
- outstanding--;
-
- if (done) {
-@@ -2244,7 +2242,7 @@ static int sftp_readdir_async(struct buffer *handle, fuse_cache_dirh_t h,
- }
- }
- }
-- assert(list == NULL);
-+ assert(list_empty(&list));
-
- return err;
- }
---
-2.9.0
-
diff --git a/extra/sshfs/patch/0005-Use-standard-C-functions.patch b/extra/sshfs/patch/0005-Use-standard-C-functions.patch
deleted file mode 100644
index e58cc29a..00000000
--- a/extra/sshfs/patch/0005-Use-standard-C-functions.patch
+++ /dev/null
@@ -1,277 +0,0 @@
-From 4714c177e2fde09cfa76609ccaf9c72d62f39bfd Mon Sep 17 00:00:00 2001
-From: Michael Forney <mforney@mforney.org>
-Date: Sun, 5 Jun 2016 17:42:29 -0700
-Subject: [PATCH] Use standard C functions
-
----
- sshfs.c | 101 ++++++++++++++++++++++++++++++++++++++--------------------------
- 1 file changed, 60 insertions(+), 41 deletions(-)
-
-diff --git a/sshfs.c b/sshfs.c
-index 14adca5..4f3bfe4 100644
---- a/sshfs.c
-+++ b/sshfs.c
-@@ -637,25 +637,25 @@ static inline void buf_add_path(struct buffer *buf, const char *path)
- if (sshfs.base_path[0]) {
- if (path[1]) {
- if (sshfs.base_path[strlen(sshfs.base_path)-1] != '/') {
-- realpath = g_strdup_printf("%s/%s",
-- sshfs.base_path,
-- path + 1);
-+ if (asprintf(&realpath, "%s/%s", sshfs.base_path, path + 1) < 0)
-+ abort();
- } else {
-- realpath = g_strdup_printf("%s%s",
-- sshfs.base_path,
-- path + 1);
-+ if (asprintf(&realpath, "%s%s", sshfs.base_path, path + 1) < 0)
-+ abort();
- }
- } else {
-- realpath = g_strdup(sshfs.base_path);
-+ realpath = strdup(sshfs.base_path);
- }
- } else {
- if (path[1])
-- realpath = g_strdup(path + 1);
-+ realpath = strdup(path + 1);
- else
-- realpath = g_strdup(".");
-+ realpath = strdup(".");
- }
-+ if (!realpath)
-+ abort();
- buf_add_string(buf, realpath);
-- g_free(realpath);
-+ free(realpath);
- }
-
- static int buf_check_get(struct buffer *buf, size_t len)
-@@ -948,10 +948,9 @@ nobundle:
- pathok:
- #endif
-
-- newpreload = g_strdup_printf("%s%s%s",
-- oldpreload ? oldpreload : "",
-- oldpreload ? " " : "",
-- sopath);
-+ if (asprintf(&newpreload, "%s%s%s",
-+ oldpreload ? oldpreload : "", oldpreload ? " " : "", sopath) < 0)
-+ abort();
-
- #ifdef __APPLE__
- if (!newpreload || setenv("DYLD_INSERT_LIBRARIES", newpreload, 1) == -1)
-@@ -962,7 +961,7 @@ pathok:
- "for ssh nodelay workaround\n");
- }
- #endif /* __APPLE__ */
-- g_free(newpreload);
-+ free(newpreload);
- return 0;
- }
- #endif
-@@ -1342,7 +1341,7 @@ static void request_free(struct request *req)
- {
- buf_free(&req->reply);
- sem_destroy(&req->ready);
-- g_free(req);
-+ free(req);
- }
-
- static int request_table_insert(struct request_table *reqtab, struct request *req)
-@@ -1390,9 +1389,9 @@ static void chunk_free(struct read_chunk *chunk)
- rreq = list_entry(chunk->reqs.prev, struct read_req, list);
- list_del(&rreq->list);
- buf_free(&rreq->data);
-- g_free(rreq);
-+ free(rreq);
- }
-- g_free(chunk);
-+ free(chunk);
- }
-
- static void chunk_put(struct read_chunk *chunk)
-@@ -1944,8 +1943,10 @@ static int sftp_request_send(uint8_t type, struct iovec *iov, size_t count,
- struct request **reqp)
- {
- int err;
-- struct request *req = g_new0(struct request, 1);
-+ struct request *req = calloc(1, sizeof(struct request));
-
-+ if (!req)
-+ return -ENOMEM;
- req->want_reply = want_reply;
- req->end_func = end_func;
- req->data = data;
-@@ -2586,7 +2587,9 @@ static int sshfs_open_common(const char *path, mode_t mode,
- if (fi->flags & O_TRUNC)
- pflags |= SSH_FXF_TRUNC;
-
-- sf = g_new0(struct sshfs_file, 1);
-+ sf = calloc(1, sizeof(struct sshfs_file));
-+ if (!sf)
-+ return -ENOMEM;
- list_init(&sf->write_reqs);
- pthread_cond_init(&sf->write_finished, NULL);
- /* Assume random read after open */
-@@ -2628,7 +2631,7 @@ static int sshfs_open_common(const char *path, mode_t mode,
- fi->fh = (unsigned long) sf;
- } else {
- cache_invalidate(path);
-- g_free(sf);
-+ free(sf);
- }
- buf_free(&buf);
- return err;
-@@ -2701,7 +2704,7 @@ static void sshfs_file_put(struct sshfs_file *sf)
- {
- sf->refs--;
- if (!sf->refs)
-- g_free(sf);
-+ free(sf);
- }
-
- static void sshfs_file_get(struct sshfs_file *sf)
-@@ -2771,9 +2774,11 @@ static void sshfs_read_begin(struct request *req)
- static struct read_chunk *sshfs_send_read(struct sshfs_file *sf, size_t size,
- off_t offset)
- {
-- struct read_chunk *chunk = g_new0(struct read_chunk, 1);
-+ struct read_chunk *chunk = calloc(1, sizeof(struct read_chunk));
- struct buffer *handle = &sf->handle;
-
-+ if (!chunk)
-+ abort();
- pthread_cond_init(&chunk->sio.finished, NULL);
- list_init(&chunk->reqs);
- chunk->size = size;
-@@ -2787,7 +2792,9 @@ static struct read_chunk *sshfs_send_read(struct sshfs_file *sf, size_t size,
- struct read_req *rreq;
- size_t bsize = size < sshfs.max_read ? size : sshfs.max_read;
-
-- rreq = g_new0(struct read_req, 1);
-+ rreq = calloc(1, sizeof(struct read_req));
-+ if (!rreq)
-+ abort();
- rreq->sio = &chunk->sio;
- rreq->size = bsize;
- buf_init(&rreq->data, 0);
-@@ -2858,7 +2865,7 @@ static int wait_chunk(struct read_chunk *chunk, char *buf, size_t size)
- size -= rreq->res;
- list_del(&rreq->list);
- buf_free(&rreq->data);
-- g_free(rreq);
-+ free(rreq);
- }
- }
-
-@@ -3513,9 +3520,10 @@ static int sshfs_opt_proc(void *data, const char *arg, int key,
- switch (key) {
- case FUSE_OPT_KEY_OPT:
- if (is_ssh_opt(arg)) {
-- tmp = g_strdup_printf("-o%s", arg);
-+ if (asprintf(&tmp, "-o%s", arg) < 0)
-+ abort();
- ssh_add_arg(tmp);
-- g_free(tmp);
-+ free(tmp);
- return 0;
- }
- return 1;
-@@ -3528,9 +3536,10 @@ static int sshfs_opt_proc(void *data, const char *arg, int key,
- return 1;
-
- case KEY_PORT:
-- tmp = g_strdup_printf("-oPort=%s", arg + 2);
-+ if (asprintf(&tmp, "-oPort=%s", arg + 2) < 0)
-+ abort();
- ssh_add_arg(tmp);
-- g_free(tmp);
-+ free(tmp);
- return 0;
-
- case KEY_COMPRESS:
-@@ -3538,9 +3547,10 @@ static int sshfs_opt_proc(void *data, const char *arg, int key,
- return 0;
-
- case KEY_CONFIGFILE:
-- tmp = g_strdup_printf("-F%s", arg + 2);
-+ if (asprintf(&tmp, "-F%s", arg + 2) < 0)
-+ abort();
- ssh_add_arg(tmp);
-- g_free(tmp);
-+ free(tmp);
- return 0;
-
- case KEY_HELP:
-@@ -3755,17 +3765,19 @@ static void fsname_remove_commas(char *fsname)
- #if FUSE_VERSION >= 27
- static char *fsname_escape_commas(char *fsnameold)
- {
-- char *fsname = g_malloc(strlen(fsnameold) * 2 + 1);
-+ char *fsname = malloc(strlen(fsnameold) * 2 + 1);
- char *d = fsname;
- char *s;
-
-+ if (!fsname)
-+ abort();
- for (s = fsnameold; *s; s++) {
- if (*s == '\\' || *s == ',')
- *d++ = '\\';
- *d++ = *s;
- }
- *d = '\0';
-- g_free(fsnameold);
-+ free(fsnameold);
-
- return fsname;
- }
-@@ -4081,15 +4093,20 @@ int main(int argc, char *argv[])
- exit(1);
- }
-
-- fsname = g_strdup(sshfs.host);
-- sshfs.base_path = g_strdup(find_base_path());
-+ fsname = strdup(sshfs.host);
-+ if (!fsname)
-+ abort();
-+ sshfs.base_path = strdup(find_base_path());
-+ if (!sshfs.base_path)
-+ abort();
-
- if (sshfs.ssh_command)
- set_ssh_command();
-
-- tmp = g_strdup_printf("-%i", sshfs.ssh_ver);
-+ if (asprintf(&tmp, "-%i", sshfs.ssh_ver) < 0)
-+ abort();
- ssh_add_arg(tmp);
-- g_free(tmp);
-+ free(tmp);
- ssh_add_arg(sshfs.host);
- if (sshfs.sftp_server)
- sftp_server = sshfs.sftp_server;
-@@ -4125,14 +4142,16 @@ int main(int argc, char *argv[])
- fsname = fsname_escape_commas(fsname);
- else
- fsname_remove_commas(fsname);
-- tmp = g_strdup_printf("-osubtype=sshfs,fsname=%s", fsname);
-+ if (asprintf(&tmp, "-osubtype=sshfs,fsname=%s", fsname) < 0)
-+ abort();
- #else
- fsname_remove_commas(fsname);
-- tmp = g_strdup_printf("-ofsname=sshfs#%s", fsname);
-+ if (asprintf(&tmp, "-ofsname=sshfs#%s", fsname) < 0)
-+ abort();
- #endif
- fuse_opt_insert_arg(&args, 1, tmp);
-- g_free(tmp);
-- g_free(fsname);
-+ free(tmp);
-+ free(fsname);
- check_large_read(&args);
-
- #if FUSE_VERSION >= 26
---
-2.9.0
-
diff --git a/extra/sshfs/patch/0006-Add-missing-includes.patch b/extra/sshfs/patch/0006-Add-missing-includes.patch
deleted file mode 100644
index 968d8186..00000000
--- a/extra/sshfs/patch/0006-Add-missing-includes.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From e969e57612df9b24df2ac16ac545466fca0989f1 Mon Sep 17 00:00:00 2001
-From: Michael Forney <mforney@mforney.org>
-Date: Sun, 5 Jun 2016 18:21:02 -0700
-Subject: [PATCH] Add missing includes
-
-stddef.h for offsetof
-sys/param.h for MIN
----
- sshfs.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/sshfs.c b/sshfs.c
-index 4f3bfe4..cd6abf6 100644
---- a/sshfs.c
-+++ b/sshfs.c
-@@ -17,6 +17,7 @@
- #endif
- #include <assert.h>
- #include <stdbool.h>
-+#include <stddef.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <unistd.h>
-@@ -37,6 +38,7 @@
- #include <sys/socket.h>
- #include <sys/utsname.h>
- #include <sys/mman.h>
-+#include <sys/param.h>
- #include <sys/poll.h>
- #include <netinet/in.h>
- #include <netinet/tcp.h>
---
-2.9.0
-
diff --git a/extra/sshfs/patch/0007-Disable-uidmap-and-gidmap-support.patch b/extra/sshfs/patch/0007-Disable-uidmap-and-gidmap-support.patch
deleted file mode 100644
index 1a232a7d..00000000
--- a/extra/sshfs/patch/0007-Disable-uidmap-and-gidmap-support.patch
+++ /dev/null
@@ -1,127 +0,0 @@
-From d12abc4b94f24c52637bcb19f6ac7819cf66af10 Mon Sep 17 00:00:00 2001
-From: Michael Forney <mforney@mforney.org>
-Date: Sun, 5 Jun 2016 18:24:16 -0700
-Subject: [PATCH] Disable uidmap and gidmap support
-
----
- sshfs.c | 16 ++++++++++++++++
- 1 file changed, 16 insertions(+)
-
-diff --git a/sshfs.c b/sshfs.c
-index cd6abf6..9af8814 100644
---- a/sshfs.c
-+++ b/sshfs.c
-@@ -242,10 +242,12 @@ struct sshfs {
- int disable_hardlink;
- char *uid_file;
- char *gid_file;
-+#if 0
- GHashTable *uid_map;
- GHashTable *gid_map;
- GHashTable *r_uid_map;
- GHashTable *r_gid_map;
-+#endif
- unsigned max_read;
- unsigned max_write;
- unsigned ssh_ver;
-@@ -366,7 +368,9 @@ enum {
- enum {
- IDMAP_NONE,
- IDMAP_USER,
-+#if 0
- IDMAP_FILE,
-+#endif
- };
-
- enum {
-@@ -387,7 +391,9 @@ static struct fuse_opt sshfs_opts[] = {
- SSHFS_OPT("workaround=%s", workarounds, 0),
- SSHFS_OPT("idmap=none", idmap, IDMAP_NONE),
- SSHFS_OPT("idmap=user", idmap, IDMAP_USER),
-+#if 0
- SSHFS_OPT("idmap=file", idmap, IDMAP_FILE),
-+#endif
- SSHFS_OPT("uidfile=%s", uid_file, 0),
- SSHFS_OPT("gidfile=%s", gid_file, 0),
- SSHFS_OPT("nomap=ignore", nomap, NOMAP_IGNORE),
-@@ -520,6 +526,7 @@ static int list_empty(const struct list_head *head)
- return head->next == head;
- }
-
-+#if 0
- /* given a pointer to the uid/gid, and the mapping table, remap the
- * uid/gid, if necessary */
- static inline int translate_id(uint32_t *id, GHashTable *map)
-@@ -537,6 +544,7 @@ static inline int translate_id(uint32_t *id, GHashTable *map)
- abort();
- }
- }
-+#endif
-
- static inline void buf_init(struct buffer *buf, size_t size)
- {
-@@ -784,12 +792,14 @@ static int buf_get_attrs(struct buffer *buf, struct stat *stbuf, int *flagsp)
- if (sshfs.remote_uid_detected && uid == sshfs.remote_uid)
- uid = sshfs.local_uid;
- #endif /* __APPLE__ */
-+#if 0
- if (sshfs.idmap == IDMAP_FILE && sshfs.uid_map)
- if (translate_id(&uid, sshfs.uid_map) == -1)
- return -EPERM;
- if (sshfs.idmap == IDMAP_FILE && sshfs.gid_map)
- if (translate_id(&gid, sshfs.gid_map) == -1)
- return -EPERM;
-+#endif
-
- memset(stbuf, 0, sizeof(struct stat));
- stbuf->st_mode = mode;
-@@ -2486,12 +2496,14 @@ static int sshfs_chown(const char *path, uid_t uid, gid_t gid)
- if (sshfs.remote_uid_detected && uid == sshfs.local_uid)
- uid = sshfs.remote_uid;
- #endif /* __APPLE__ */
-+#if 0
- if (sshfs.idmap == IDMAP_FILE && sshfs.r_uid_map)
- if(translate_id(&uid, sshfs.r_uid_map) == -1)
- return -EPERM;
- if (sshfs.idmap == IDMAP_FILE && sshfs.r_gid_map)
- if (translate_id(&gid, sshfs.r_gid_map) == -1)
- return -EPERM;
-+#endif
-
- buf_init(&buf, 0);
- buf_add_path(&buf, path);
-@@ -3805,6 +3817,7 @@ static int ssh_connect(void)
- return 0;
- }
-
-+#if 0
- /* number of ':' separated fields in a passwd/group file that we care
- * about */
- #define IDMAP_FIELDS 3
-@@ -3979,6 +3992,7 @@ static inline void load_gid_map(void)
- {
- read_id_map(sshfs.gid_file, &groupname_to_gid, "gid", &sshfs.gid_map, &sshfs.r_gid_map);
- }
-+#endif
-
- #ifdef __APPLE__
- int main(int argc, char *argv[], __unused char *envp[], char **exec_path)
-@@ -4046,6 +4060,7 @@ int main(int argc, char *argv[])
-
- if (sshfs.idmap == IDMAP_USER)
- sshfs.detect_uid = 1;
-+#if 0
- else if (sshfs.idmap == IDMAP_FILE) {
- sshfs.uid_map = NULL;
- sshfs.gid_map = NULL;
-@@ -4060,6 +4075,7 @@ int main(int argc, char *argv[])
- if (sshfs.gid_file)
- load_gid_map();
- }
-+#endif
- free(sshfs.uid_file);
- free(sshfs.gid_file);
-
---
-2.9.0
-
diff --git a/extra/sshfs/patch/0008-Remove-remaining-uses-of-glib.patch b/extra/sshfs/patch/0008-Remove-remaining-uses-of-glib.patch
deleted file mode 100644
index b21b5d34..00000000
--- a/extra/sshfs/patch/0008-Remove-remaining-uses-of-glib.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 4d8a47a8754e549dc75d5201547762718de8ce52 Mon Sep 17 00:00:00 2001
-From: Michael Forney <mforney@mforney.org>
-Date: Sun, 5 Jun 2016 18:24:31 -0700
-Subject: [PATCH] Remove remaining uses of glib
-
----
- sshfs.c | 5 -----
- 1 file changed, 5 deletions(-)
-
-diff --git a/sshfs.c b/sshfs.c
-index 9af8814..44c13d1 100644
---- a/sshfs.c
-+++ b/sshfs.c
-@@ -42,7 +42,6 @@
- #include <sys/poll.h>
- #include <netinet/in.h>
- #include <netinet/tcp.h>
--#include <glib.h>
- #include <pwd.h>
- #include <grp.h>
- #include <limits.h>
-@@ -4011,11 +4010,7 @@ int main(int argc, char *argv[])
- if (!realpath(*exec_path, sshfs_program_path)) {
- memset(sshfs_program_path, 0, PATH_MAX);
- }
--
-- /* Until this gets fixed somewhere else. */
-- g_slice_set_config(G_SLICE_CONFIG_ALWAYS_MALLOC, TRUE);
- #endif /* __APPLE__ */
-- g_thread_init(NULL);
-
- sshfs.blksize = 4096;
- /* SFTP spec says all servers should allow at least 32k I/O */
---
-2.9.0
-
diff --git a/extra/sshfs/rev b/extra/sshfs/rev
deleted file mode 100644
index d00491fd..00000000
--- a/extra/sshfs/rev
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/extra/sshfs/src b/extra/sshfs/src
deleted file mode 160000
-Subproject b2fa7593586b141298e6159f40f521d2b0f4f89
diff --git a/extra/the_silver_searcher/config.h b/extra/the_silver_searcher/config.h
deleted file mode 100644
index 41a9cbf9..00000000
--- a/extra/the_silver_searcher/config.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#include <config-posix.h>
-
-/* #undef HAVE_DIRENT_DNAMLEN */
-#define HAVE_DIRENT_DTYPE /**/
-#define HAVE_FGETLN 1
-/* #undef HAVE_LIBSHLWAPI */
-/* #undef HAVE_LZMA_H */
-#define HAVE_MADVISE 1
-#define HAVE_MEMORY_H 1
-/* #undef HAVE_PLEDGE */
-#define HAVE_PTHREAD_PRIO_INHERIT 1
-#define HAVE_PTHREAD_SETAFFINITY_NP 1
-#define HAVE_STRLCPY 1
-#define HAVE_VASPRINTF 1
-/* #undef HAVE_ZLIB_H */
-#define PACKAGE_BUGREPORT "https://github.com/ggreer/the_silver_searcher/issues"
-#define PACKAGE_NAME "the_silver_searcher"
-#define PACKAGE_STRING "the_silver_searcher 1.0.2"
-#define PACKAGE_TARNAME "the_silver_searcher"
-#define PACKAGE_URL "https://github.com/ggreer/the_silver_searcher"
-#define PACKAGE_VERSION "1.0.2"
-/* #undef PTHREAD_CREATE_JOINABLE */
-#define USE_CPU_SET /**/
-#define USE_PCRE_JIT 1
diff --git a/extra/the_silver_searcher/gen.rc b/extra/the_silver_searcher/gen.rc
deleted file mode 100644
index 66e447fc..00000000
--- a/extra/the_silver_searcher/gen.rc
+++ /dev/null
@@ -1,14 +0,0 @@
-cflags\
- -D _GNU_SOURCE\
- -isystem '$builddir'/extra/pcre/include\
- -I include\
- -I '$dir'
-
-exe ag -d extra/pcre/headers src/^(\
- ignore.c log.c options.c print.c print_w32.c scandir.c search.c lang.c\
- util.c decompress.c main.c\
-) '$builddir'/extra/pcre/libpcre.a
-file bin/ag '$outdir'/ag 755
-file share/man/man1/ag.1 '$srcdir'/doc/ag.1 644
-
-fetch git
diff --git a/extra/the_silver_searcher/rev b/extra/the_silver_searcher/rev
deleted file mode 100644
index b8626c4c..00000000
--- a/extra/the_silver_searcher/rev
+++ /dev/null
@@ -1 +0,0 @@
-4
diff --git a/extra/the_silver_searcher/src b/extra/the_silver_searcher/src
deleted file mode 160000
-Subproject 682ab865e174ce289b7dda5514abfdf21037a2d
diff --git a/extra/transmission/.gitignore b/extra/transmission/.gitignore
deleted file mode 100644
index c914ea0a..00000000
--- a/extra/transmission/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-/libminiupnp.ninja
-/libnatpmp.ninja
-/libutp.ninja
-/src
-/transmission-2.92.tar.xz
diff --git a/extra/transmission/config.h b/extra/transmission/config.h
deleted file mode 100644
index a0009f4e..00000000
--- a/extra/transmission/config.h
+++ /dev/null
@@ -1,27 +0,0 @@
-#include <config-posix.h>
-
-#define PACKAGE_DATA_DIR "/share"
-#define WITH_INOTIFY 1
-
-#define PACKAGE_NAME "transmission"
-#define PACKAGE_TARNAME "transmission"
-#define PACKAGE_VERSION "2.92"
-#define PACKAGE_STRING "transmission\ 2.92"
-#define PACKAGE_BUGREPORT "http://trac.transmissionbt.com/newticket"
-#define PACKAGE_URL ""
-#define PACKAGE "transmission"
-#define VERSION "2.92"
-#define HAVE_MEMORY_H 1
-#define LT_OBJDIR ".libs/"
-#define TIME_WITH_SYS_TIME 1
-#define HAVE_STRLCPY 1
-#define HAVE_DAEMON 1
-#define HAVE_FALLOCATE64 1
-#define HAVE_MEMMEM 1
-#define HAVE_STRSEP 1
-#define HAVE_VALLOC 1
-#define HAVE_GETPAGESIZE 1
-#define HAVE_PTHREAD 1
-#define HAVE_GETMNTENT 1
-#define HAVE_DECL_POSIX_FADVISE 1
-#define WITH_UTP 1
diff --git a/extra/transmission/gen.rc b/extra/transmission/gen.rc
deleted file mode 100644
index b5280b5f..00000000
--- a/extra/transmission/gen.rc
+++ /dev/null
@@ -1,152 +0,0 @@
-set orig_cflags '$cflags'
-cflags\
- -D __TRANSMISSION__\
- -I '$builddir'/core/curl/include\
- -I '$builddir'/core/libressl/include\
- -I '$builddir'/core/zlib/include\
- -I '$builddir'/extra/libevent/include\
- -I '$dir' \
- -I '$srcdir' \
- -I '$srcdir'/third-party\
- -I '$srcdir'/third-party/libb64\
- -I '$srcdir'/third-party/libnatpmp\
- -I '$srcdir'/third-party/libutp\
- -I extra/libevent/src/include\
- -I include\
- -idirafter core/openbsd/src/sys\
- -include config.h
-
-phony deps (core/^(curl libressl zlib) extra/libevent)^/headers
-
-lib libtransmission.a -d '$dir'/deps libtransmission/^(\
- announcer.c\
- announcer-http.c\
- announcer-udp.c\
- bandwidth.c\
- bitfield.c\
- blocklist.c\
- cache.c\
- clients.c\
- completion.c\
- ConvertUTF.c\
- crypto.c\
- crypto-utils.c\
- crypto-utils-fallback.c\
- error.c\
- fdlimit.c\
- file.c\
- handshake.c\
- history.c\
- inout.c\
- list.c\
- log.c\
- magnet.c\
- makemeta.c\
- metainfo.c\
- natpmp.c\
- net.c\
- peer-io.c\
- peer-mgr.c\
- peer-msgs.c\
- platform.c\
- platform-quota.c\
- port-forwarding.c\
- ptrarray.c\
- quark.c\
- resume.c\
- rpcimpl.c\
- rpc-server.c\
- session.c\
- stats.c\
- torrent.c\
- torrent-ctor.c\
- torrent-magnet.c\
- tr-dht.c\
- tr-lpd.c\
- tr-udp.c\
- tr-utp.c\
- tr-getopt.c\
- trevent.c\
- upnp.c\
- utils.c\
- variant.c\
- variant-benc.c\
- variant-json.c\
- verify.c\
- watchdir.c\
- watchdir-generic.c\
- web.c\
- webseed.c\
- wildmat.c\
- \
- watchdir-inotify.c\
- file-posix.c\
- crypto-utils-openssl.c\
-) libb64.a libdht.a libminiupnp.a libnatpmp.a libutp.a '$builddir'/^(\
- core/curl/libcurl.a.d\
- core/libressl/libcrypto.a.d\
- core/zlib/libz.a\
- extra/libevent/libevent.a\
-)
-
-lib libb64.a third-party/libb64/^(cdecode.c cencode.c)
-lib libdht.a third-party/dht/dht.c
-
-{
- set cflags '$orig_cflags' \
- -D ENABLE_STRNATPMPERR
- lib libnatpmp.a third-party/libnatpmp/^(getgateway.c natpmp.c wingettimeofday.c)
-} >libnatpmp.ninja ; subninja libnatpmp.ninja
-
-{
- set cflags '$orig_cflags' \
- -D _GNU_SOURCE\
- -I '$outdir'/miniupnp\
- -idirafter core/openbsd/src/sys
-
- hdr='$outdir'/miniupnp/miniupnpcstrings.h
- build $hdr sed '$srcdir'/third-party/miniupnp/miniupnpcstrings.h.in ; with\
- expr '-e s,OS/version,Linux, -e s,version,,'
-
- lib libminiupnp.a -d $hdr third-party/miniupnp/^(\
- connecthostport.c\
- igd_desc_parse.c\
- minisoap.c\
- minissdpc.c\
- miniupnpc.c\
- miniwget.c\
- minixml.c\
- portlistingparse.c\
- receivedata.c\
- upnpcommands.c\
- upnpreplyparse.c\
- )
-} >libminiupnp.ninja ; subninja libminiupnp.ninja
-
-{
- set cc '$cxx'
- set cflags '$cxxflags' \
- -fno-exceptions\
- -fno-rtti\
- -ansi\
- -D POSIX\
- -I '$srcdir'/third-party/libutp
-
- lib libutp.a third-party/libutp/^(utp.cpp utp_utils.cpp)
-} >libutp.ninja ; subninja libutp.ninja
-
-exe transmission-daemon -d '$dir'/deps daemon/^(daemon.c daemon-posix.c) libtransmission.a.d
-file bin/transmission-daemon '$outdir'/transmission-daemon 755
-file share/man/man1/transmission-daemon.1 '$srcdir'/daemon/transmission-daemon.1 644
-
-exe transmission-remote -d '$dir'/deps daemon/remote.c libtransmission.a.d
-file bin/transmission-remote '$outdir'/transmission-remote 755
-file share/man/man1/transmission-remote.1 '$srcdir'/daemon/transmission-remote.1 644
-
-for(tool in create edit show) {
- exe transmission-$tool utils/$tool.c libtransmission.a.d
- file bin/transmission-$tool '$outdir'/transmission-$tool 755
- file share/man/man1/transmission-$tool.1 '$srcdir'/utils/transmission-$tool.1 644
-}
-
-fetch curl
diff --git a/extra/transmission/rev b/extra/transmission/rev
deleted file mode 100644
index d00491fd..00000000
--- a/extra/transmission/rev
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/extra/transmission/sha256 b/extra/transmission/sha256
deleted file mode 100644
index 16625e70..00000000
--- a/extra/transmission/sha256
+++ /dev/null
@@ -1 +0,0 @@
-3a8d045c306ad9acb7bf81126939b9594553a388482efa0ec1bfb67b22acd35f transmission-2.92.tar.xz
diff --git a/extra/transmission/url b/extra/transmission/url
deleted file mode 100644
index 8ba77c57..00000000
--- a/extra/transmission/url
+++ /dev/null
@@ -1 +0,0 @@
-url = "https://download.transmissionbt.com/files/transmission-2.92.tar.xz"
diff --git a/extra/unzip/.gitignore b/extra/unzip/.gitignore
deleted file mode 100644
index dcae2209..00000000
--- a/extra/unzip/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/src
-/unzip60.tar.gz
diff --git a/extra/unzip/config.h b/extra/unzip/config.h
deleted file mode 100644
index 5d254d27..00000000
--- a/extra/unzip/config.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#define ACORN_FTYPE_NFS
-#define DATE_FORMAT DF_YMD
-#define IZ_HAVE_UXUIDGID
-#define LARGE_FILE_SUPPORT
-#define UNICODE_SUPPORT
-#define UNICODE_WCHAR
-#define UNIX
-#define USE_BZIP2
-#define UTF8_MAYBE_NATIVE
-#define WILD_STOP_AT_DIR
-
-/* why does Debian define these? */
-#define NOMEMCPY
-#define NO_LCHMOD
-#define NO_WORKING_ISPRINT
diff --git a/extra/unzip/gen.rc b/extra/unzip/gen.rc
deleted file mode 100644
index 5b5a537a..00000000
--- a/extra/unzip/gen.rc
+++ /dev/null
@@ -1,15 +0,0 @@
-cflags\
- -include '$dir'/config.h\
- -isystem core/bzip2/src\
- -I '$srcdir'
-
-exe unzip -d '$builddir'/core/bzip2/fetch.stamp\
- unzip.c crc32.c crypt.c envargs.c explode.c\
- extract.c fileio.c globals.c inflate.c list.c match.c\
- process.c ttyio.c ubz2err.c unreduce.c unshrink.c zipinfo.c\
- unix/unix.c\
- '$builddir'/core/bzip2/libbz2.a
-file bin/unzip '$outdir'/unzip 755
-file share/man/man1/unzip.1 '$srcdir'/man/unzip.1 644
-
-fetch curl
diff --git a/extra/unzip/patch/0001-Drop-L-suffix-from-man-page-sections.patch b/extra/unzip/patch/0001-Drop-L-suffix-from-man-page-sections.patch
deleted file mode 100644
index 27d1f048..00000000
--- a/extra/unzip/patch/0001-Drop-L-suffix-from-man-page-sections.patch
+++ /dev/null
@@ -1,319 +0,0 @@
-From 099364ef5cdd7801c9744815ef5ec75f5f267222 Mon Sep 17 00:00:00 2001
-From: Santiago Vila <sanvila@debian.org>
-Date: Thu, 16 Jun 2016 22:39:42 -0700
-Subject: [PATCH] Drop L suffix from man page sections
-
-From 01-manpages-in-section-1-not-in-section-1l in
-unzip_6.0-16+deb8u2.debian.tar.xz.
----
- man/funzip.1 | 8 ++++----
- man/unzip.1 | 24 ++++++++++++------------
- man/unzipsfx.1 | 32 ++++++++++++++++----------------
- man/zipgrep.1 | 8 ++++----
- man/zipinfo.1 | 10 +++++-----
- 5 files changed, 41 insertions(+), 41 deletions(-)
-
-diff --git a/man/funzip.1 b/man/funzip.1
-index 30206e4..a9b4195 100644
---- a/man/funzip.1
-+++ b/man/funzip.1
-@@ -20,7 +20,7 @@
- .in -4n
- ..
- .\" =========================================================================
--.TH FUNZIP 1L "20 April 2009 (v3.95)" "Info-ZIP"
-+.TH FUNZIP 1 "20 April 2009 (v3.95)" "Info-ZIP"
- .SH NAME
- funzip \- filter for extracting from a ZIP archive in a pipe
- .PD
-@@ -78,7 +78,7 @@ funzip test.zip > /dev/null
- .EE
- .PP
- To use \fIzip\fP and \fIfunzip\fP in place of \fIcompress\fP(1) and
--\fIzcat\fP(1) (or \fIgzip\fP(1L) and \fIgzcat\fP(1L)) for tape backups:
-+\fIzcat\fP(1) (or \fIgzip\fP(1) and \fIgzcat\fP(1)) for tape backups:
- .PP
- .EX
- tar cf \- . | zip \-7 | dd of=/dev/nrst0 obs=8k
-@@ -108,8 +108,8 @@ itself (future release).
- .PD
- .\" =========================================================================
- .SH "SEE ALSO"
--\fIgzip\fP(1L), \fIunzip\fP(1L), \fIunzipsfx\fP(1L), \fIzip\fP(1L),
--\fIzipcloak\fP(1L), \fIzipinfo\fP(1L), \fIzipnote\fP(1L), \fIzipsplit\fP(1L)
-+\fIgzip\fP(1), \fIunzip\fP(1), \fIunzipsfx\fP(1), \fIzip\fP(1),
-+\fIzipcloak\fP(1), \fIzipinfo\fP(1), \fIzipnote\fP(1), \fIzipsplit\fP(1)
- .PD
- .\" =========================================================================
- .SH URL
-diff --git a/man/unzip.1 b/man/unzip.1
-index 75a7060..eee43a9 100644
---- a/man/unzip.1
-+++ b/man/unzip.1
-@@ -20,7 +20,7 @@
- .in -4n
- ..
- .\" =========================================================================
--.TH UNZIP 1L "20 April 2009 (v6.0)" "Info-ZIP"
-+.TH UNZIP 1 "20 April 2009 (v6.0)" "Info-ZIP"
- .SH NAME
- unzip \- list, test and extract compressed files in a ZIP archive
- .PD
-@@ -34,7 +34,7 @@ unzip \- list, test and extract compressed files in a ZIP archive
- \fIunzip\fP will list, test, or extract files from a ZIP archive, commonly
- found on MS-DOS systems. The default behavior (with no options) is to extract
- into the current directory (and subdirectories below it) all files from the
--specified ZIP archive. A companion program, \fIzip\fP(1L), creates ZIP
-+specified ZIP archive. A companion program, \fIzip\fP(1), creates ZIP
- archives; both programs are compatible with archives created by PKWARE's
- \fIPKZIP\fP and \fIPKUNZIP\fP for MS-DOS, but in many cases the program
- options or default behaviors differ.
-@@ -105,8 +105,8 @@ only a reminder of the basic \fIunzip\fP syntax rather than an exhaustive
- list of all possible flags. The exhaustive list follows:
- .TP
- .B \-Z
--\fIzipinfo\fP(1L) mode. If the first option on the command line is \fB\-Z\fP,
--the remaining options are taken to be \fIzipinfo\fP(1L) options. See the
-+\fIzipinfo\fP(1) mode. If the first option on the command line is \fB\-Z\fP,
-+the remaining options are taken to be \fIzipinfo\fP(1) options. See the
- appropriate manual page for a description of these options.
- .TP
- .B \-A
-@@ -178,7 +178,7 @@ encrypted entries from the compressed size numbers. Therefore,
- compressed size and compression ratio figures are independent of the entry's
- encryption status and show the correct compression performance. (The complete
- size of the encrypted compressed data stream for zipfile entries is reported
--by the more verbose \fIzipinfo\fP(1L) reports, see the separate manual.)
-+by the more verbose \fIzipinfo\fP(1) reports, see the separate manual.)
- When no zipfile is specified (that is, the complete command is simply
- ``\fCunzip \-v\fR''), a diagnostic screen is printed. In addition to
- the normal header with release date and version, \fIunzip\fP lists the
-@@ -379,8 +379,8 @@ file, skip extraction of all existing files, or rename the current file.
- .TP
- .B \-N
- [Amiga] extract file comments as Amiga filenotes. File comments are created
--with the \-c option of \fIzip\fP(1L), or with the \-N option of the Amiga port
--of \fIzip\fP(1L), which stores filenotes as comments.
-+with the \-c option of \fIzip\fP(1), or with the \-N option of the Amiga port
-+of \fIzip\fP(1), which stores filenotes as comments.
- .TP
- .B \-o
- overwrite existing files without prompting. This is a dangerous option, so
-@@ -598,7 +598,7 @@ Unix \fInice\fP(1).
- As suggested by the examples above, the default variable names are UNZIP_OPTS
- for VMS (where the symbol used to install \fIunzip\fP as a foreign command
- would otherwise be confused with the environment variable), and UNZIP
--for all other operating systems. For compatibility with \fIzip\fP(1L),
-+for all other operating systems. For compatibility with \fIzip\fP(1),
- UNZIPOPT is also accepted (don't ask). If both UNZIP and UNZIPOPT
- are defined, however, UNZIP takes precedence. \fIunzip\fP's diagnostic
- option (\fB\-v\fP with no zipfile name) can be used to check the values
-@@ -648,8 +648,8 @@ prompt for another password, and so on until all files are extracted. If
- a password is not known, entering a null password (that is, just a carriage
- return or ``Enter'') is taken as a signal to skip all further prompting.
- Only unencrypted files in the archive(s) will thereafter be extracted. (In
--fact, that's not quite true; older versions of \fIzip\fP(1L) and
--\fIzipcloak\fP(1L) allowed null passwords, so \fIunzip\fP checks each encrypted
-+fact, that's not quite true; older versions of \fIzip\fP(1) and
-+\fIzipcloak\fP(1) allowed null passwords, so \fIunzip\fP checks each encrypted
- file to see if the null password works. This may result in ``false positives''
- and extraction errors, as noted above.)
- .PP
-@@ -943,8 +943,8 @@ deleted.
- .PD
- .\" =========================================================================
- .SH "SEE ALSO"
--\fIfunzip\fP(1L), \fIzip\fP(1L), \fIzipcloak\fP(1L), \fIzipgrep\fP(1L),
--\fIzipinfo\fP(1L), \fIzipnote\fP(1L), \fIzipsplit\fP(1L)
-+\fIfunzip\fP(1), \fIzip\fP(1), \fIzipcloak\fP(1), \fIzipgrep\fP(1),
-+\fIzipinfo\fP(1), \fIzipnote\fP(1), \fIzipsplit\fP(1)
- .PD
- .\" =========================================================================
- .SH URL
-diff --git a/man/unzipsfx.1 b/man/unzipsfx.1
-index d9a0e59..533711f 100644
---- a/man/unzipsfx.1
-+++ b/man/unzipsfx.1
-@@ -20,7 +20,7 @@
- .in -4n
- ..
- .\" =========================================================================
--.TH UNZIPSFX 1L "20 April 2009 (v6.0)" "Info-ZIP"
-+.TH UNZIPSFX 1 "20 April 2009 (v6.0)" "Info-ZIP"
- .SH NAME
- unzipsfx \- self-extracting stub for prepending to ZIP archives
- .PD
-@@ -30,7 +30,7 @@ unzipsfx \- self-extracting stub for prepending to ZIP archives
- .PD
- .\" =========================================================================
- .SH DESCRIPTION
--\fIunzipsfx\fP is a modified version of \fIunzip\fP(1L) designed to be
-+\fIunzipsfx\fP is a modified version of \fIunzip\fP(1) designed to be
- prepended to existing ZIP archives in order to form self-extracting archives.
- Instead of taking its first non-flag argument to be the zipfile(s) to be
- extracted, \fIunzipsfx\fP seeks itself under the name by which it was invoked
-@@ -109,7 +109,7 @@ literal subdirectory ``\fB~\fP'' of the current directory.
- .PD
- .\" =========================================================================
- .SH OPTIONS
--\fIunzipsfx\fP supports the following \fIunzip\fP(1L) options: \fB\-c\fP
-+\fIunzipsfx\fP supports the following \fIunzip\fP(1) options: \fB\-c\fP
- and \fB\-p\fP (extract to standard output/screen), \fB\-f\fP and \fB\-u\fP
- (freshen and update existing files upon extraction), \fB\-t\fP (test
- archive) and \fB\-z\fP (print archive comment). All normal listing options
-@@ -118,11 +118,11 @@ option (\fB\-t\fP) may be used as a ``poor man's'' listing. Alternatively,
- those creating self-extracting archives may wish to include a short listing
- in the zipfile comment.
- .PP
--See \fIunzip\fP(1L) for a more complete description of these options.
-+See \fIunzip\fP(1) for a more complete description of these options.
- .PD
- .\" =========================================================================
- .SH MODIFIERS
--\fIunzipsfx\fP currently supports all \fIunzip\fP(1L) modifiers: \fB\-a\fP
-+\fIunzipsfx\fP currently supports all \fIunzip\fP(1) modifiers: \fB\-a\fP
- (convert text files), \fB\-n\fP (never overwrite), \fB\-o\fP (overwrite
- without prompting), \fB\-q\fP (operate quietly), \fB\-C\fP (match names
- case-insensitively), \fB\-L\fP (convert uppercase-OS names to lowercase),
-@@ -137,18 +137,18 @@ files have the appropriate format for the local OS. EBCDIC conversion will
- of course continue to be supported since the zipfile format implies ASCII
- storage of text files.)
- .PP
--See \fIunzip\fP(1L) for a more complete description of these modifiers.
-+See \fIunzip\fP(1) for a more complete description of these modifiers.
- .PD
- .\" =========================================================================
- .SH "ENVIRONMENT OPTIONS"
--\fIunzipsfx\fP uses the same environment variables as \fIunzip\fP(1L) does,
-+\fIunzipsfx\fP uses the same environment variables as \fIunzip\fP(1) does,
- although this is likely to be an issue only for the person creating and
--testing the self-extracting archive. See \fIunzip\fP(1L) for details.
-+testing the self-extracting archive. See \fIunzip\fP(1) for details.
- .PD
- .\" =========================================================================
- .SH DECRYPTION
--Decryption is supported exactly as in \fIunzip\fP(1L); that is, interactively
--with a non-echoing prompt for the password(s). See \fIunzip\fP(1L) for
-+Decryption is supported exactly as in \fIunzip\fP(1); that is, interactively
-+with a non-echoing prompt for the password(s). See \fIunzip\fP(1) for
- details. Once again, note that if the archive has no encrypted files there
- is no reason to use a version of \fIunzipsfx\fP with decryption support;
- that only adds to the size of the archive.
-@@ -286,7 +286,7 @@ available that provide the full path name, so the archive may be invoked
- from anywhere in the user's path. The situation is not known for AmigaDOS,
- Atari TOS, MacOS, etc.
- .PP
--As noted above, a number of the normal \fIunzip\fP(1L) functions have
-+As noted above, a number of the normal \fIunzip\fP(1) functions have
- been removed in order to make \fIunzipsfx\fP smaller: usage and diagnostic
- info, listing functions and extraction to other directories. Also, only
- stored and deflated files are supported. The latter limitation is mainly
-@@ -303,17 +303,17 @@ does not work. (For technically oriented users, the attached archive is
- defined as a ``debug hunk.'') There may be compatibility problems between
- the ROM levels of older Amigas and newer ones.
- .PP
--All current bugs in \fIunzip\fP(1L) exist in \fIunzipsfx\fP as well.
-+All current bugs in \fIunzip\fP(1) exist in \fIunzipsfx\fP as well.
- .PD
- .\" =========================================================================
- .SH DIAGNOSTICS
- \fIunzipsfx\fP's exit status (error level) is identical to that of
--\fIunzip\fP(1L); see the corresponding man page.
-+\fIunzip\fP(1); see the corresponding man page.
- .PD
- .\" =========================================================================
- .SH "SEE ALSO"
--\fIfunzip\fP(1L), \fIunzip\fP(1L), \fIzip\fP(1L), \fIzipcloak\fP(1L),
--\fIzipgrep\fP(1L), \fIzipinfo\fP(1L), \fIzipnote\fP(1L), \fIzipsplit\fP(1L)
-+\fIfunzip\fP(1), \fIunzip\fP(1), \fIzip\fP(1), \fIzipcloak\fP(1),
-+\fIzipgrep\fP(1), \fIzipinfo\fP(1), \fIzipnote\fP(1), \fIzipsplit\fP(1)
- .PD
- .PD
- .\" =========================================================================
-@@ -330,7 +330,7 @@ or
- .\" =========================================================================
- .SH AUTHORS
- Greg Roelofs was responsible for the basic modifications to UnZip necessary
--to create UnZipSFX. See \fIunzip\fP(1L) for the current list of Zip-Bugs
-+to create UnZipSFX. See \fIunzip\fP(1) for the current list of Zip-Bugs
- authors, or the file CONTRIBS in the UnZip source distribution for the
- full list of Info-ZIP contributors.
- .PD
-diff --git a/man/zipgrep.1 b/man/zipgrep.1
-index dad83f8..252fcae 100644
---- a/man/zipgrep.1
-+++ b/man/zipgrep.1
-@@ -8,7 +8,7 @@
- .\" zipgrep.1 by Greg Roelofs.
- .\"
- .\" =========================================================================
--.TH ZIPGREP 1L "20 April 2009" "Info-ZIP"
-+.TH ZIPGREP 1 "20 April 2009" "Info-ZIP"
- .SH NAME
- zipgrep \- search files in a ZIP archive for lines matching a pattern
- .PD
-@@ -21,7 +21,7 @@ zipgrep \- search files in a ZIP archive for lines matching a pattern
- .SH DESCRIPTION
- \fIzipgrep\fP will search files within a ZIP archive for lines matching
- the given string or pattern. \fIzipgrep\fP is a shell script and requires
--\fIegrep\fP(1) and \fIunzip\fP(1L) to function. Its output is identical to
-+\fIegrep\fP(1) and \fIunzip\fP(1) to function. Its output is identical to
- that of \fIegrep\fP(1).
- .PD
- .\" =========================================================================
-@@ -69,8 +69,8 @@ All options prior to the ZIP archive filename are passed to \fIegrep\fP(1).
- .PD
- .\" =========================================================================
- .SH "SEE ALSO"
--\fIegrep\fP(1), \fIunzip\fP(1L), \fIzip\fP(1L), \fIfunzip\fP(1L),
--\fIzipcloak\fP(1L), \fIzipinfo\fP(1L), \fIzipnote\fP(1L), \fIzipsplit\fP(1L)
-+\fIegrep\fP(1), \fIunzip\fP(1), \fIzip\fP(1), \fIfunzip\fP(1),
-+\fIzipcloak\fP(1), \fIzipinfo\fP(1), \fIzipnote\fP(1), \fIzipsplit\fP(1)
- .PD
- .\" =========================================================================
- .SH URL
-diff --git a/man/zipinfo.1 b/man/zipinfo.1
-index 428e4b9..22d1fa2 100644
---- a/man/zipinfo.1
-+++ b/man/zipinfo.1
-@@ -34,7 +34,7 @@
- .in -4n
- ..
- .\" =========================================================================
--.TH ZIPINFO 1L "20 April 2009 (v3.0)" "Info-ZIP"
-+.TH ZIPINFO 1 "20 April 2009 (v3.0)" "Info-ZIP"
- .SH NAME
- zipinfo \- list detailed information about a ZIP archive
- .PD
-@@ -272,7 +272,7 @@ format:
- Note that because of limitations in the MS-DOS format used to store file
- times, the seconds field is always rounded to the nearest even second.
- For Unix files this is expected to change in the next major releases of
--\fIzip\fP(1L) and \fIunzip\fP.
-+\fIzip\fP(1) and \fIunzip\fP.
- .PP
- In addition to individual file information, a default zipfile listing
- also includes header and trailer lines:
-@@ -361,7 +361,7 @@ of the Unix command \fInice\fP(1).
- As suggested above, the default variable names are ZIPINFO_OPTS for VMS
- (where the symbol used to install \fIzipinfo\fP as a foreign command
- would otherwise be confused with the environment variable), and ZIPINFO
--for all other operating systems. For compatibility with \fIzip\fP(1L),
-+for all other operating systems. For compatibility with \fIzip\fP(1),
- ZIPINFOOPT is also accepted (don't ask). If both ZIPINFO and ZIPINFOOPT
- are defined, however, ZIPINFO takes precedence. \fIunzip\fP's diagnostic
- option (\fB\-v\fP with no zipfile name) can be used to check the values
-@@ -496,8 +496,8 @@ be simplified. (This is not to say that it will be.)
- .PP
- .\" =========================================================================
- .SH "SEE ALSO"
--\fIls\fP(1), \fIfunzip\fP(1L), \fIunzip\fP(1L), \fIunzipsfx\fP(1L),
--\fIzip\fP(1L), \fIzipcloak\fP(1L), \fIzipnote\fP(1L), \fIzipsplit\fP(1L)
-+\fIls\fP(1), \fIfunzip\fP(1), \fIunzip\fP(1), \fIunzipsfx\fP(1),
-+\fIzip\fP(1), \fIzipcloak\fP(1), \fIzipnote\fP(1), \fIzipsplit\fP(1)
- .PD
- .\" =========================================================================
- .SH URL
---
-2.8.1
-
diff --git a/extra/unzip/patch/0002-Handle-the-PKWare-verification-bit-of-internal-attri.patch b/extra/unzip/patch/0002-Handle-the-PKWare-verification-bit-of-internal-attri.patch
deleted file mode 100644
index f7d9caab..00000000
--- a/extra/unzip/patch/0002-Handle-the-PKWare-verification-bit-of-internal-attri.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 4a125f29b8d313456ad91ab6694d84db7d1685da Mon Sep 17 00:00:00 2001
-From: Steven Schweda <sms@antinode.info>
-Date: Thu, 16 Jun 2016 22:41:39 -0700
-Subject: [PATCH] Handle the PKWare verification bit of internal attributes
-
-From 04-handle-pkware-verification-bit in
-unzip_6.0-16+deb8u2.debian.tar.xz.
----
- process.c | 7 +++++++
- 1 file changed, 7 insertions(+)
-
-diff --git a/process.c b/process.c
-index 1e9a1e1..ed314e1 100644
---- a/process.c
-+++ b/process.c
-@@ -1729,6 +1729,13 @@ int process_cdir_file_hdr(__G) /* return PK-type error code */
- else if (uO.L_flag > 1) /* let -LL force lower case for all names */
- G.pInfo->lcflag = 1;
-
-+ /* Handle the PKWare verification bit, bit 2 (0x0004) of internal
-+ attributes. If this is set, then a verification checksum is in the
-+ first 3 bytes of the external attributes. In this case all we can use
-+ for setting file attributes is the last external attributes byte. */
-+ if (G.crec.internal_file_attributes & 0x0004)
-+ G.crec.external_file_attributes &= (ulg)0xff;
-+
- /* do Amigas (AMIGA_) also have volume labels? */
- if (IS_VOLID(G.crec.external_file_attributes) &&
- (G.pInfo->hostnum == FS_FAT_ || G.pInfo->hostnum == FS_HPFS_ ||
---
-2.8.1
-
diff --git a/extra/unzip/patch/0003-Restore-uid-and-gid-information-when-requested.patch b/extra/unzip/patch/0003-Restore-uid-and-gid-information-when-requested.patch
deleted file mode 100644
index ce3b3f0b..00000000
--- a/extra/unzip/patch/0003-Restore-uid-and-gid-information-when-requested.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From a32a7b300ba2a8df9468a2c029c3a8d20971e823 Mon Sep 17 00:00:00 2001
-From: Steven Schweda <sms@antinode.info>
-Date: Thu, 16 Jun 2016 22:41:43 -0700
-Subject: [PATCH] Restore uid and gid information when requested
-
-From 05-fix-uid-gid-handling in unzip_6.0-16+deb8u2.debian.tar.xz.
----
- process.c | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/process.c b/process.c
-index ed314e1..df58d28 100644
---- a/process.c
-+++ b/process.c
-@@ -2904,7 +2904,7 @@ unsigned ef_scan_for_izux(ef_buf, ef_len, ef_is_c, dos_mdatetime,
- #ifdef IZ_HAVE_UXUIDGID
- if (eb_len >= EB_UX3_MINLEN
- && z_uidgid != NULL
-- && (*((EB_HEADSIZE + 0) + ef_buf) == 1)
-+ && (*((EB_HEADSIZE + 0) + ef_buf) == 1))
- /* only know about version 1 */
- {
- uch uid_size;
-@@ -2916,10 +2916,10 @@ unsigned ef_scan_for_izux(ef_buf, ef_len, ef_is_c, dos_mdatetime,
- flags &= ~0x0ff; /* ignore any previous UNIX field */
-
- if ( read_ux3_value((EB_HEADSIZE + 2) + ef_buf,
-- uid_size, z_uidgid[0])
-+ uid_size, &z_uidgid[0])
- &&
- read_ux3_value((EB_HEADSIZE + uid_size + 3) + ef_buf,
-- gid_size, z_uidgid[1]) )
-+ gid_size, &z_uidgid[1]) )
- {
- flags |= EB_UX2_VALID; /* signal success */
- }
---
-2.8.1
-
diff --git a/extra/unzip/patch/0004-Initialize-the-symlink-flag.patch b/extra/unzip/patch/0004-Initialize-the-symlink-flag.patch
deleted file mode 100644
index d8f4d38d..00000000
--- a/extra/unzip/patch/0004-Initialize-the-symlink-flag.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 6e7edd8d5093795a96a80e36b7c019de3f637cc8 Mon Sep 17 00:00:00 2001
-From: Andreas Schwab <schwab@linux-m68k.org>
-Date: Thu, 16 Jun 2016 22:41:53 -0700
-Subject: [PATCH] Initialize the symlink flag
-
-From 06-initialize-the-symlink-flag in
-unzip_6.0-16+deb8u2.debian.tar.xz.
----
- process.c | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/process.c b/process.c
-index df58d28..3228bde 100644
---- a/process.c
-+++ b/process.c
-@@ -1758,6 +1758,12 @@ int process_cdir_file_hdr(__G) /* return PK-type error code */
- = (G.crec.general_purpose_bit_flag & (1 << 11)) == (1 << 11);
- #endif
-
-+#ifdef SYMLINKS
-+ /* Initialize the symlink flag, may be set by the platform-specific
-+ mapattr function. */
-+ G.pInfo->symlink = 0;
-+#endif
-+
- return PK_COOL;
-
- } /* end function process_cdir_file_hdr() */
---
-2.8.1
-
diff --git a/extra/unzip/patch/0005-Increase-size-of-cfactorstr-array-to-avoid-buffer-ov.patch b/extra/unzip/patch/0005-Increase-size-of-cfactorstr-array-to-avoid-buffer-ov.patch
deleted file mode 100644
index e58bbdd5..00000000
--- a/extra/unzip/patch/0005-Increase-size-of-cfactorstr-array-to-avoid-buffer-ov.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 638801fa4a9ffb16839d6dd42e70afc3e989e510 Mon Sep 17 00:00:00 2001
-From: Steven Schweda <sms@antinode.info>
-Date: Thu, 16 Jun 2016 22:41:56 -0700
-Subject: [PATCH] Increase size of cfactorstr array to avoid buffer overflow
-
-From 07-increase-size-of-cfactorstr in
-unzip_6.0-16+deb8u2.debian.tar.xz.
----
- list.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/list.c b/list.c
-index 15e0011..5de41e5 100644
---- a/list.c
-+++ b/list.c
-@@ -97,7 +97,7 @@ int list_files(__G) /* return PK-type error code */
- {
- int do_this_file=FALSE, cfactor, error, error_in_archive=PK_COOL;
- #ifndef WINDLL
-- char sgn, cfactorstr[10];
-+ char sgn, cfactorstr[12];
- int longhdr=(uO.vflag>1);
- #endif
- int date_format;
---
-2.8.1
-
diff --git a/extra/unzip/patch/0006-zipinfo.c-Do-not-crash-when-hostver-byte-is-100.patch b/extra/unzip/patch/0006-zipinfo.c-Do-not-crash-when-hostver-byte-is-100.patch
deleted file mode 100644
index f7ea35fa..00000000
--- a/extra/unzip/patch/0006-zipinfo.c-Do-not-crash-when-hostver-byte-is-100.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 0a3f8770bbe8fbd71a62a806a3fe9681a9e14c9e Mon Sep 17 00:00:00 2001
-From: Santiago Vila <sanvila@debian.org>
-Date: Thu, 16 Jun 2016 22:42:02 -0700
-Subject: [PATCH] zipinfo.c: Do not crash when hostver byte is >= 100
-
-From 08-allow-greater-hostver-values in
-unzip_6.0-16+deb8u2.debian.tar.xz.
----
- zipinfo.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/zipinfo.c b/zipinfo.c
-index a92bca9..5e77018 100644
---- a/zipinfo.c
-+++ b/zipinfo.c
-@@ -2114,7 +2114,7 @@ static int zi_short(__G) /* return PK-type error code */
- else
- attribs[9] = (xattr & UNX_ISVTX)? 'T' : '-'; /* T==undefined */
-
-- sprintf(&attribs[12], "%u.%u", hostver/10, hostver%10);
-+ sprintf(&attribs[11], "%2u.%u", hostver/10, hostver%10);
- break;
-
- } /* end switch (hostnum: external attributes format) */
---
-2.8.1
-
diff --git a/extra/unzip/patch/0007-Fix-CVE-2014-8139-CRC32-verification-heap-based-over.patch b/extra/unzip/patch/0007-Fix-CVE-2014-8139-CRC32-verification-heap-based-over.patch
deleted file mode 100644
index cbf42c2e..00000000
--- a/extra/unzip/patch/0007-Fix-CVE-2014-8139-CRC32-verification-heap-based-over.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From 52cb9b4a9bfc63f0fce3ffe41cf7a61cb3bb625a Mon Sep 17 00:00:00 2001
-From: Steven Schweda <sms@antinode.info>
-Date: Thu, 16 Jun 2016 22:42:06 -0700
-Subject: [PATCH] Fix CVE-2014-8139: CRC32 verification heap-based overflow
-
-From 09-cve-2014-8139-crc-overflow in unzip_6.0-16+deb8u2.debian.tar.xz.
----
- extract.c | 17 ++++++++++++++---
- 1 file changed, 14 insertions(+), 3 deletions(-)
-
-diff --git a/extract.c b/extract.c
-index 1acd769..df0fa1c 100644
---- a/extract.c
-+++ b/extract.c
-@@ -1,5 +1,5 @@
- /*
-- Copyright (c) 1990-2009 Info-ZIP. All rights reserved.
-+ Copyright (c) 1990-2014 Info-ZIP. All rights reserved.
-
- See the accompanying file LICENSE, version 2009-Jan-02 or later
- (the contents of which are also included in unzip.h) for terms of use.
-@@ -298,6 +298,8 @@ char ZCONST Far TruncNTSD[] =
- #ifndef SFX
- static ZCONST char Far InconsistEFlength[] = "bad extra-field entry:\n \
- EF block length (%u bytes) exceeds remaining EF data (%u bytes)\n";
-+ static ZCONST char Far TooSmallEBlength[] = "bad extra-field entry:\n \
-+ EF block length (%u bytes) invalid (< %d)\n";
- static ZCONST char Far InvalidComprDataEAs[] =
- " invalid compressed data for EAs\n";
- # if (defined(WIN32) && defined(NTSD_EAS))
-@@ -2023,7 +2025,8 @@ static int TestExtraField(__G__ ef, ef_len)
- ebID = makeword(ef);
- ebLen = (unsigned)makeword(ef+EB_LEN);
-
-- if (ebLen > (ef_len - EB_HEADSIZE)) {
-+ if (ebLen > (ef_len - EB_HEADSIZE))
-+ {
- /* Discovered some extra field inconsistency! */
- if (uO.qflag)
- Info(slide, 1, ((char *)slide, "%-22s ",
-@@ -2158,11 +2161,19 @@ static int TestExtraField(__G__ ef, ef_len)
- }
- break;
- case EF_PKVMS:
-- if (makelong(ef+EB_HEADSIZE) !=
-+ if (ebLen < 4)
-+ {
-+ Info(slide, 1,
-+ ((char *)slide, LoadFarString(TooSmallEBlength),
-+ ebLen, 4));
-+ }
-+ else if (makelong(ef+EB_HEADSIZE) !=
- crc32(CRCVAL_INITIAL, ef+(EB_HEADSIZE+4),
- (extent)(ebLen-4)))
-+ {
- Info(slide, 1, ((char *)slide,
- LoadFarString(BadCRC_EAs)));
-+ }
- break;
- case EF_PKW32:
- case EF_PKUNIX:
---
-2.8.1
-
diff --git a/extra/unzip/patch/0008-Fix-CVE-2014-8140-out-of-bounds-write-issue-in-test_.patch b/extra/unzip/patch/0008-Fix-CVE-2014-8140-out-of-bounds-write-issue-in-test_.patch
deleted file mode 100644
index b60fc149..00000000
--- a/extra/unzip/patch/0008-Fix-CVE-2014-8140-out-of-bounds-write-issue-in-test_.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From 74f5aaa429f14d8888504127921e9da6554425af Mon Sep 17 00:00:00 2001
-From: Steven Schweda <sms@antinode.info>
-Date: Thu, 16 Jun 2016 22:42:11 -0700
-Subject: [PATCH] Fix CVE-2014-8140: out-of-bounds write issue in
- test_compr_eb()
-
-From 10-cve-2014-8140-test-compr-eb in
-unzip_6.0-16+deb8u2.debian.tar.xz.
----
- extract.c | 13 ++++++++++---
- 1 file changed, 10 insertions(+), 3 deletions(-)
-
-diff --git a/extract.c b/extract.c
-index df0fa1c..ec31e60 100644
---- a/extract.c
-+++ b/extract.c
-@@ -2232,10 +2232,17 @@ static int test_compr_eb(__G__ eb, eb_size, compr_offset, test_uc_ebdata)
- if (compr_offset < 4) /* field is not compressed: */
- return PK_OK; /* do nothing and signal OK */
-
-+ /* Return no/bad-data error status if any problem is found:
-+ * 1. eb_size is too small to hold the uncompressed size
-+ * (eb_ucsize). (Else extract eb_ucsize.)
-+ * 2. eb_ucsize is zero (invalid). 2014-12-04 SMS.
-+ * 3. eb_ucsize is positive, but eb_size is too small to hold
-+ * the compressed data header.
-+ */
- if ((eb_size < (EB_UCSIZE_P + 4)) ||
-- ((eb_ucsize = makelong(eb+(EB_HEADSIZE+EB_UCSIZE_P))) > 0L &&
-- eb_size <= (compr_offset + EB_CMPRHEADLEN)))
-- return IZ_EF_TRUNC; /* no compressed data! */
-+ ((eb_ucsize = makelong( eb+ (EB_HEADSIZE+ EB_UCSIZE_P))) == 0L) ||
-+ ((eb_ucsize > 0L) && (eb_size <= (compr_offset + EB_CMPRHEADLEN))))
-+ return IZ_EF_TRUNC; /* no/bad compressed data! */
-
- if (
- #ifdef INT_16BIT
---
-2.8.1
-
diff --git a/extra/unzip/patch/0009-Fix-CVE-2014-8141-out-of-bounds-read-issues-in-getZi.patch b/extra/unzip/patch/0009-Fix-CVE-2014-8141-out-of-bounds-read-issues-in-getZi.patch
deleted file mode 100644
index b34ae1a8..00000000
--- a/extra/unzip/patch/0009-Fix-CVE-2014-8141-out-of-bounds-read-issues-in-getZi.patch
+++ /dev/null
@@ -1,152 +0,0 @@
-From 2fbede051e0344ac5fcc6e6bcb865d4cb8a45f21 Mon Sep 17 00:00:00 2001
-From: Steven Schweda <sms@antinode.info>
-Date: Thu, 16 Jun 2016 22:42:14 -0700
-Subject: [PATCH] Fix CVE-2014-8141: out-of-bounds read issues in
- getZip64Data()
-
-From 11-cve-2014-8141-getzip64data in unzip_6.0-16+deb8u2.debian.tar.xz.
----
- fileio.c | 9 ++++++++-
- process.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++----------------
- 2 files changed, 59 insertions(+), 18 deletions(-)
-
-diff --git a/fileio.c b/fileio.c
-index ba0a1d0..36bfea3 100644
---- a/fileio.c
-+++ b/fileio.c
-@@ -176,6 +176,8 @@ static ZCONST char Far FilenameTooLongTrunc[] =
- #endif
- static ZCONST char Far ExtraFieldTooLong[] =
- "warning: extra field too long (%d). Ignoring...\n";
-+static ZCONST char Far ExtraFieldCorrupt[] =
-+ "warning: extra field (type: 0x%04x) corrupt. Continuing...\n";
-
- #ifdef WINDLL
- static ZCONST char Far DiskFullQuery[] =
-@@ -2295,7 +2297,12 @@ int do_string(__G__ length, option) /* return PK-type error code */
- if (readbuf(__G__ (char *)G.extra_field, length) == 0)
- return PK_EOF;
- /* Looks like here is where extra fields are read */
-- getZip64Data(__G__ G.extra_field, length);
-+ if (getZip64Data(__G__ G.extra_field, length) != PK_COOL)
-+ {
-+ Info(slide, 0x401, ((char *)slide,
-+ LoadFarString( ExtraFieldCorrupt), EF_PKSZ64));
-+ error = PK_WARN;
-+ }
- #ifdef UNICODE_SUPPORT
- G.unipath_filename = NULL;
- if (G.UzO.U_flag < 2) {
-diff --git a/process.c b/process.c
-index 3228bde..df683ea 100644
---- a/process.c
-+++ b/process.c
-@@ -1,5 +1,5 @@
- /*
-- Copyright (c) 1990-2009 Info-ZIP. All rights reserved.
-+ Copyright (c) 1990-2014 Info-ZIP. All rights reserved.
-
- See the accompanying file LICENSE, version 2009-Jan-02 or later
- (the contents of which are also included in unzip.h) for terms of use.
-@@ -1901,48 +1901,82 @@ int getZip64Data(__G__ ef_buf, ef_len)
- and a 4-byte version of disk start number.
- Sets both local header and central header fields. Not terribly clever,
- but it means that this procedure is only called in one place.
-+
-+ 2014-12-05 SMS.
-+ Added checks to ensure that enough data are available before calling
-+ makeint64() or makelong(). Replaced various sizeof() values with
-+ simple ("4" or "8") constants. (The Zip64 structures do not depend
-+ on our variable sizes.) Error handling is crude, but we should now
-+ stay within the buffer.
- ---------------------------------------------------------------------------*/
-
-+#define Z64FLGS 0xffff
-+#define Z64FLGL 0xffffffff
-+
- if (ef_len == 0 || ef_buf == NULL)
- return PK_COOL;
-
- Trace((stderr,"\ngetZip64Data: scanning extra field of length %u\n",
- ef_len));
-
-- while (ef_len >= EB_HEADSIZE) {
-+ while (ef_len >= EB_HEADSIZE)
-+ {
- eb_id = makeword(EB_ID + ef_buf);
- eb_len = makeword(EB_LEN + ef_buf);
-
-- if (eb_len > (ef_len - EB_HEADSIZE)) {
-- /* discovered some extra field inconsistency! */
-+ if (eb_len > (ef_len - EB_HEADSIZE))
-+ {
-+ /* Extra block length exceeds remaining extra field length. */
- Trace((stderr,
- "getZip64Data: block length %u > rest ef_size %u\n", eb_len,
- ef_len - EB_HEADSIZE));
- break;
- }
-- if (eb_id == EF_PKSZ64) {
--
-+ if (eb_id == EF_PKSZ64)
-+ {
- int offset = EB_HEADSIZE;
-
-- if (G.crec.ucsize == 0xffffffff || G.lrec.ucsize == 0xffffffff){
-- G.lrec.ucsize = G.crec.ucsize = makeint64(offset + ef_buf);
-- offset += sizeof(G.crec.ucsize);
-+ if ((G.crec.ucsize == Z64FLGL) || (G.lrec.ucsize == Z64FLGL))
-+ {
-+ if (offset+ 8 > ef_len)
-+ return PK_ERR;
-+
-+ G.crec.ucsize = G.lrec.ucsize = makeint64(offset + ef_buf);
-+ offset += 8;
- }
-- if (G.crec.csize == 0xffffffff || G.lrec.csize == 0xffffffff){
-- G.csize = G.lrec.csize = G.crec.csize = makeint64(offset + ef_buf);
-- offset += sizeof(G.crec.csize);
-+
-+ if ((G.crec.csize == Z64FLGL) || (G.lrec.csize == Z64FLGL))
-+ {
-+ if (offset+ 8 > ef_len)
-+ return PK_ERR;
-+
-+ G.csize = G.crec.csize = G.lrec.csize = makeint64(offset + ef_buf);
-+ offset += 8;
- }
-- if (G.crec.relative_offset_local_header == 0xffffffff){
-+
-+ if (G.crec.relative_offset_local_header == Z64FLGL)
-+ {
-+ if (offset+ 8 > ef_len)
-+ return PK_ERR;
-+
- G.crec.relative_offset_local_header = makeint64(offset + ef_buf);
-- offset += sizeof(G.crec.relative_offset_local_header);
-+ offset += 8;
- }
-- if (G.crec.disk_number_start == 0xffff){
-+
-+ if (G.crec.disk_number_start == Z64FLGS)
-+ {
-+ if (offset+ 4 > ef_len)
-+ return PK_ERR;
-+
- G.crec.disk_number_start = (zuvl_t)makelong(offset + ef_buf);
-- offset += sizeof(G.crec.disk_number_start);
-+ offset += 4;
- }
-+#if 0
-+ break; /* Expect only one EF_PKSZ64 block. */
-+#endif /* 0 */
- }
-
-- /* Skip this extra field block */
-+ /* Skip this extra field block. */
- ef_buf += (eb_len + EB_HEADSIZE);
- ef_len -= (eb_len + EB_HEADSIZE);
- }
---
-2.8.1
-
diff --git a/extra/unzip/patch/0010-Info-ZIP-UnZip-buffer-overflow.patch b/extra/unzip/patch/0010-Info-ZIP-UnZip-buffer-overflow.patch
deleted file mode 100644
index edd9706f..00000000
--- a/extra/unzip/patch/0010-Info-ZIP-UnZip-buffer-overflow.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From fb09687478043d64dc433bd034d063f33f718084 Mon Sep 17 00:00:00 2001
-From: mancha <mancha1@zoho.com>
-Date: Thu, 16 Jun 2016 22:42:17 -0700
-Subject: [PATCH] Info-ZIP UnZip buffer overflow
-
-From 12-cve-2014-9636-test-compr-eb in
-unzip_6.0-16+deb8u2.debian.tar.xz.
----
- extract.c | 9 +++++++++
- 1 file changed, 9 insertions(+)
-
-diff --git a/extract.c b/extract.c
-index ec31e60..d816603 100644
---- a/extract.c
-+++ b/extract.c
-@@ -2228,6 +2228,7 @@ static int test_compr_eb(__G__ eb, eb_size, compr_offset, test_uc_ebdata)
- ulg eb_ucsize;
- uch *eb_ucptr;
- int r;
-+ ush eb_compr_method;
-
- if (compr_offset < 4) /* field is not compressed: */
- return PK_OK; /* do nothing and signal OK */
-@@ -2244,6 +2245,14 @@ static int test_compr_eb(__G__ eb, eb_size, compr_offset, test_uc_ebdata)
- ((eb_ucsize > 0L) && (eb_size <= (compr_offset + EB_CMPRHEADLEN))))
- return IZ_EF_TRUNC; /* no/bad compressed data! */
-
-+ /* 2014-11-03 Michal Zalewski, SMS.
-+ * For STORE method, compressed and uncompressed sizes must agree.
-+ * http://www.info-zip.org/phpBB3/viewtopic.php?f=7&t=450
-+ */
-+ eb_compr_method = makeword( eb + (EB_HEADSIZE + compr_offset));
-+ if ((eb_compr_method == STORED) && (eb_size - compr_offset != eb_ucsize))
-+ return PK_ERR;
-+
- if (
- #ifdef INT_16BIT
- (((ulg)(extent)eb_ucsize) != eb_ucsize) ||
---
-2.8.1
-
diff --git a/extra/unzip/patch/0011-Upstream-fix-for-heap-overflow.patch b/extra/unzip/patch/0011-Upstream-fix-for-heap-overflow.patch
deleted file mode 100644
index 52681e0b..00000000
--- a/extra/unzip/patch/0011-Upstream-fix-for-heap-overflow.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 0fbf62b364615cd0566c0803fff8b0dae4118402 Mon Sep 17 00:00:00 2001
-From: Petr Stodulka <pstodulk@redhat.com>
-Date: Thu, 16 Jun 2016 22:42:25 -0700
-Subject: [PATCH] Upstream fix for heap overflow
-
-From 14-cve-2015-7696 in unzip_6.0-16+deb8u2.debian.tar.xz.
----
- crypt.c | 12 +++++++++++-
- 1 file changed, 11 insertions(+), 1 deletion(-)
-
-diff --git a/crypt.c b/crypt.c
-index 784e411..a8975f2 100644
---- a/crypt.c
-+++ b/crypt.c
-@@ -465,7 +465,17 @@ int decrypt(__G__ passwrd)
- GLOBAL(pInfo->encrypted) = FALSE;
- defer_leftover_input(__G);
- for (n = 0; n < RAND_HEAD_LEN; n++) {
-- b = NEXTBYTE;
-+ /* 2012-11-23 SMS. (OUSPG report.)
-+ * Quit early if compressed size < HEAD_LEN. The resulting
-+ * error message ("unable to get password") could be improved,
-+ * but it's better than trying to read nonexistent data, and
-+ * then continuing with a negative G.csize. (See
-+ * fileio.c:readbyte()).
-+ */
-+ if ((b = NEXTBYTE) == (ush)EOF)
-+ {
-+ return PK_ERR;
-+ }
- h[n] = (uch)b;
- Trace((stdout, " (%02x)", h[n]));
- }
---
-2.8.1
-
diff --git a/extra/unzip/patch/0012-fix-infinite-loop-when-extracting-empty-bzip2-data.patch b/extra/unzip/patch/0012-fix-infinite-loop-when-extracting-empty-bzip2-data.patch
deleted file mode 100644
index 7e15d681..00000000
--- a/extra/unzip/patch/0012-fix-infinite-loop-when-extracting-empty-bzip2-data.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From b2833dbb4beddd027f46d1bea62cdac40ec3b343 Mon Sep 17 00:00:00 2001
-From: Kamil Dudka <kdudka@redhat.com>
-Date: Thu, 16 Jun 2016 22:42:29 -0700
-Subject: [PATCH] fix infinite loop when extracting empty bzip2 data
-
-From 15-cve-2015-7697 in unzip_6.0-16+deb8u2.debian.tar.xz.
----
- extract.c | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/extract.c b/extract.c
-index d816603..ad8b3f7 100644
---- a/extract.c
-+++ b/extract.c
-@@ -2728,6 +2728,12 @@ __GDEF
- int repeated_buf_err;
- bz_stream bstrm;
-
-+ if (G.incnt <= 0 && G.csize <= 0L) {
-+ /* avoid an infinite loop */
-+ Trace((stderr, "UZbunzip2() got empty input\n"));
-+ return 2;
-+ }
-+
- #if (defined(DLL) && !defined(NO_SLIDE_REDIR))
- if (G.redirect_slide)
- wsize = G.redirect_size, redirSlide = G.redirect_buffer;
---
-2.8.1
-
diff --git a/extra/unzip/patch/0013-extract-prevent-unsigned-overflow-on-invalid-input.patch b/extra/unzip/patch/0013-extract-prevent-unsigned-overflow-on-invalid-input.patch
deleted file mode 100644
index 9f816a7a..00000000
--- a/extra/unzip/patch/0013-extract-prevent-unsigned-overflow-on-invalid-input.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 91f3ce1672778ebb41317c2cad4b0a75cf3d002f Mon Sep 17 00:00:00 2001
-From: Kamil Dudka <kdudka@redhat.com>
-Date: Thu, 16 Jun 2016 22:42:33 -0700
-Subject: [PATCH] extract: prevent unsigned overflow on invalid input
-
-From 16-fix-integer-underflow-csiz-decrypted in
-unzip_6.0-16+deb8u2.debian.tar.xz.
----
- extract.c | 11 ++++++++++-
- 1 file changed, 10 insertions(+), 1 deletion(-)
-
-diff --git a/extract.c b/extract.c
-index ad8b3f7..3ec8813 100644
---- a/extract.c
-+++ b/extract.c
-@@ -1257,8 +1257,17 @@ static int extract_or_test_entrylist(__G__ numchunk,
- if (G.lrec.compression_method == STORED) {
- zusz_t csiz_decrypted = G.lrec.csize;
-
-- if (G.pInfo->encrypted)
-+ if (G.pInfo->encrypted) {
-+ if (csiz_decrypted < 12) {
-+ /* handle the error now to prevent unsigned overflow */
-+ Info(slide, 0x401, ((char *)slide,
-+ LoadFarStringSmall(ErrUnzipNoFile),
-+ LoadFarString(InvalidComprData),
-+ LoadFarStringSmall2(Inflate)));
-+ return PK_ERR;
-+ }
- csiz_decrypted -= 12;
-+ }
- if (G.lrec.ucsize != csiz_decrypted) {
- Info(slide, 0x401, ((char *)slide,
- LoadFarStringSmall2(WrnStorUCSizCSizDiff),
---
-2.8.1
-
diff --git a/extra/unzip/rev b/extra/unzip/rev
deleted file mode 100644
index d00491fd..00000000
--- a/extra/unzip/rev
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/extra/unzip/sha256 b/extra/unzip/sha256
deleted file mode 100644
index 0b45b49d..00000000
--- a/extra/unzip/sha256
+++ /dev/null
@@ -1 +0,0 @@
-036d96991646d0449ed0aa952e4fbe21b476ce994abc276e49d30e686708bd37 unzip60.tar.gz
diff --git a/extra/unzip/url b/extra/unzip/url
deleted file mode 100644
index c021ee6d..00000000
--- a/extra/unzip/url
+++ /dev/null
@@ -1 +0,0 @@
-url = "http://downloads.sourceforge.net/infozip/unzip60.tar.gz"
diff --git a/extra/vis/gen.rc b/extra/vis/gen.rc
deleted file mode 100644
index 429d2b04..00000000
--- a/extra/vis/gen.rc
+++ /dev/null
@@ -1,196 +0,0 @@
-version=v0.2-539-g37d98f3
-cflags\
- '-std=c99' \
- -D 'CONFIG_LUA=1' \
- -D 'CONFIG_LUA_STATIC=1' \
- -D '_POSIX_C_SOURCE=200809L' \
- -D '_XOPEN_SOURCE=700' \
- -D 'VERSION=''"'$version'"''' \
- -D 'VIS_PATH=''"/share/vis"''' \
- -D NDEBUG\
- -isystem extra/libtermkey/src\
- -isystem lang/lua/src/src\
- -isystem '$builddir'/extra/ncurses/include\
- -I '$outdir'
-
-build '$outdir'/config.h copy '$srcdir'/config.def.h
-
-phony deps '$outdir'/config.h '$builddir'/^(\
- extra/libtermkey/fetch.stamp\
- lang/lua/fetch.stamp\
-) extra/ncurses/headers
-
-exe vis -d '$dir'/deps \
- array.c buffer.c libutf.c main.c map.c register.c ring-buffer.c\
- sam.c text.c text-motions.c text-objects.c text-regex.c text-util.c\
- ui-curses.c view.c vis.c vis-lua.c vis-modes.c vis-motions.c\
- vis-operators.c vis-prompt.c vis-text-objects.c\
- '$builddir'/^(\
- extra/libtermkey/libtermkey.a.d\
- extra/lpeg/liblpeg.a\
- extra/ncurses/libncurses.a\
- lang/lua/liblua.a\
- )
-file bin/vis '$outdir'/vis 755
-
-exe vis-menu vis-menu.c
-file bin/vis-menu '$outdir'/vis-menu 755
-
-file bin/vis-open '$srcdir'/vis-open 755
-
-for(f in vis.1 vis-menu.1 vis-open.1) {
- build '$outdir'/$f sed '$srcdir'/man/$f ; with\
- expr s,VERSION,$version,
- file share/man/man1/$f '$outdir'/$f 644
-}
-
-# <cd src/lua/lexers && printf '\t%s\\\n' *.lua | sort
-lexers=(\
- lexer.lua\
- vis-std.lua\
- vis.lua\
- visrc.lua\
- plugins/^(\
- filetype.lua\
- textobject-lexer.lua\
- )\
- lexers/^(\
- actionscript.lua\
- ada.lua\
- ansi_c.lua\
- antlr.lua\
- apdl.lua\
- apl.lua\
- applescript.lua\
- asm.lua\
- asp.lua\
- autoit.lua\
- awk.lua\
- bash.lua\
- batch.lua\
- bibtex.lua\
- boo.lua\
- caml.lua\
- chuck.lua\
- cmake.lua\
- coffeescript.lua\
- container.lua\
- context.lua\
- cpp.lua\
- crystal.lua\
- csharp.lua\
- css.lua\
- cuda.lua\
- dart.lua\
- desktop.lua\
- diff.lua\
- django.lua\
- dmd.lua\
- dockerfile.lua\
- dot.lua\
- dsv.lua\
- eiffel.lua\
- elixir.lua\
- erlang.lua\
- faust.lua\
- fish.lua\
- forth.lua\
- fortran.lua\
- fsharp.lua\
- fstab.lua\
- gap.lua\
- gettext.lua\
- gherkin.lua\
- glsl.lua\
- gnuplot.lua\
- go.lua\
- groovy.lua\
- gtkrc.lua\
- haskell.lua\
- html.lua\
- icon.lua\
- idl.lua\
- inform.lua\
- ini.lua\
- io_lang.lua\
- java.lua\
- javascript.lua\
- json.lua\
- jsp.lua\
- latex.lua\
- ledger.lua\
- less.lua\
- lexer.lua\
- lilypond.lua\
- lisp.lua\
- litcoffee.lua\
- lua.lua\
- makefile.lua\
- man.lua\
- markdown.lua\
- matlab.lua\
- moonscript.lua\
- nemerle.lua\
- networkd.lua\
- nim.lua\
- nsis.lua\
- null.lua\
- objective_c.lua\
- pascal.lua\
- perl.lua\
- php.lua\
- pico8.lua\
- pike.lua\
- pkgbuild.lua\
- powershell.lua\
- prolog.lua\
- props.lua\
- protobuf.lua\
- ps.lua\
- pure.lua\
- python.lua\
- rails.lua\
- rebol.lua\
- rest.lua\
- rexx.lua\
- rhtml.lua\
- rstats.lua\
- ruby.lua\
- rust.lua\
- sass.lua\
- scala.lua\
- scheme.lua\
- smalltalk.lua\
- sml.lua\
- snobol4.lua\
- sql.lua\
- systemd.lua\
- taskpaper.lua\
- tcl.lua\
- tex.lua\
- texinfo.lua\
- text.lua\
- toml.lua\
- vala.lua\
- vb.lua\
- vbscript.lua\
- vcard.lua\
- verilog.lua\
- vhdl.lua\
- wsf.lua\
- xml.lua\
- xtend.lua\
- yaml.lua\
- )\
- themes/^(\
- dark-16.lua\
- default-16.lua\
- default-256.lua\
- light-16.lua\
- solarized.lua\
- )\
-)
-for(f in $lexers)
- file share/vis/$f '$srcdir'/lua/$f 644
-
-fetch git
diff --git a/extra/vis/patch/0001-Allow-building-lpeg-statically.patch b/extra/vis/patch/0001-Allow-building-lpeg-statically.patch
deleted file mode 100644
index 025bfb41..00000000
--- a/extra/vis/patch/0001-Allow-building-lpeg-statically.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From 7a20eee4766219a030f8f581713d9a2b04d2e0ea Mon Sep 17 00:00:00 2001
-From: Michael Forney <mforney@mforney.org>
-Date: Fri, 18 Nov 2016 21:35:52 -0800
-Subject: [PATCH] Allow building lpeg statically
-
----
- Makefile | 3 ++-
- vis-lua.c | 9 +++++++++
- 2 files changed, 11 insertions(+), 1 deletion(-)
-
-diff --git a/Makefile b/Makefile
-index 962fb7e..201c0c1 100644
---- a/Makefile
-+++ b/Makefile
-@@ -16,6 +16,7 @@ MANPREFIX ?= ${PREFIX}/man
- VERSION = $(shell git describe --always 2>/dev/null || echo "0.2")
-
- CONFIG_LUA ?= 1
-+CONFIG_LUA_STATIC ?= 0
- CONFIG_ACL ?= 0
- CONFIG_SELINUX ?= 0
-
-@@ -27,7 +28,7 @@ CFLAGS_VIS = $(CFLAGS_AUTO) $(CFLAGS_TERMKEY) $(CFLAGS_CURSES) $(CFLAGS_ACL) \
- $(CFLAGS_SELINUX) $(CFLAGS_LUA) $(CFLAGS_STD)
-
- CFLAGS_VIS += -DVIS_PATH=\"${SHAREPREFIX}/vis\"
--CFLAGS_VIS += -DCONFIG_LUA=${CONFIG_LUA}
-+CFLAGS_VIS += -DCONFIG_LUA=${CONFIG_LUA} -DCONFIG_LUA_STATIC=${CONFIG_LUA_STATIC}
- CFLAGS_VIS += -DCONFIG_SELINUX=${CONFIG_SELINUX}
- CFLAGS_VIS += -DCONFIG_ACL=${CONFIG_ACL}
- CFLAGS_VIS += ${CFLAGS_DEBUG}
-diff --git a/vis-lua.c b/vis-lua.c
-index 29e94ef..83d2e52 100644
---- a/vis-lua.c
-+++ b/vis-lua.c
-@@ -1889,6 +1889,15 @@ void vis_lua_init(Vis *vis) {
- vis->lua = L;
- luaL_openlibs(L);
-
-+#if CONFIG_LUA_STATIC
-+ extern int luaopen_lpeg(lua_State *L);
-+ lua_getglobal(L, "package");
-+ lua_getfield(L, -1, "preload");
-+ lua_pushcfunction(L, luaopen_lpeg);
-+ lua_setfield(L, -2, "lpeg");
-+ lua_pop(L, 2);
-+#endif
-+
- /* remove any relative paths from lua's default package.path */
- vis_lua_path_strip(vis);
-
---
-2.10.2
-
diff --git a/extra/vis/patch/0002-Set-default-theme-to-dark-16.patch b/extra/vis/patch/0002-Set-default-theme-to-dark-16.patch
deleted file mode 100644
index 254b5c5c..00000000
--- a/extra/vis/patch/0002-Set-default-theme-to-dark-16.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From af9461125ed8466c39da15ab9845fd95888da66e Mon Sep 17 00:00:00 2001
-From: Michael Forney <mforney@mforney.org>
-Date: Fri, 18 Nov 2016 21:53:25 -0800
-Subject: [PATCH] Set default theme to dark-16
-
----
- lua/visrc.lua | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/lua/visrc.lua b/lua/visrc.lua
-index 13bd7f7..e308fc3 100644
---- a/lua/visrc.lua
-+++ b/lua/visrc.lua
-@@ -5,7 +5,7 @@ require('plugins/textobject-lexer')
-
- vis.events.subscribe(vis.events.INIT, function()
- -- Your global configuration options
-- vis:command("set theme ".. (vis.ui.colors <= 16 and "default-16" or "default-256"))
-+ vis:command("set theme default-16")
- end)
-
- vis.events.subscribe(vis.events.WIN_OPEN, function(win)
---
-2.10.2
-
diff --git a/extra/vis/rev b/extra/vis/rev
deleted file mode 100644
index 00750edc..00000000
--- a/extra/vis/rev
+++ /dev/null
@@ -1 +0,0 @@
-3
diff --git a/extra/vis/src b/extra/vis/src
deleted file mode 160000
-Subproject 37d98f3119d5d3a63492bf9683ec6a4d68cc1e2